pmu.h (d7808f739162c003d249168bfe4c571aba18fb8a) pmu.h (b9181c8ef35636152facc72f801f27b4264df8c0)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __KVM_X86_PMU_H
3#define __KVM_X86_PMU_H
4
5#include <linux/nospec.h>
6
7#define vcpu_to_pmu(vcpu) (&(vcpu)->arch.pmu)
8#define pmu_to_vcpu(pmu) (container_of((pmu), struct kvm_vcpu, arch.pmu))
9#define pmc_to_pmu(pmc) (&(pmc)->vcpu->arch.pmu)
10
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __KVM_X86_PMU_H
3#define __KVM_X86_PMU_H
4
5#include <linux/nospec.h>
6
7#define vcpu_to_pmu(vcpu) (&(vcpu)->arch.pmu)
8#define pmu_to_vcpu(pmu) (container_of((pmu), struct kvm_vcpu, arch.pmu))
9#define pmc_to_pmu(pmc) (&(pmc)->vcpu->arch.pmu)
10
11#define MSR_IA32_MISC_ENABLE_PMU_RO_MASK (MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL | \
12 MSR_IA32_MISC_ENABLE_BTS_UNAVAIL)
13
11/* retrieve the 4 bits for EN and PMI out of IA32_FIXED_CTR_CTRL */
12#define fixed_ctrl_field(ctrl_reg, idx) (((ctrl_reg) >> ((idx)*4)) & 0xf)
13
14#define VMWARE_BACKDOOR_PMC_HOST_TSC 0x10000
15#define VMWARE_BACKDOOR_PMC_REAL_TIME 0x10001
16#define VMWARE_BACKDOOR_PMC_APPARENT_TIME 0x10002
17
18struct kvm_event_hw_type_mapping {

--- 184 unchanged lines hidden ---
14/* retrieve the 4 bits for EN and PMI out of IA32_FIXED_CTR_CTRL */
15#define fixed_ctrl_field(ctrl_reg, idx) (((ctrl_reg) >> ((idx)*4)) & 0xf)
16
17#define VMWARE_BACKDOOR_PMC_HOST_TSC 0x10000
18#define VMWARE_BACKDOOR_PMC_REAL_TIME 0x10001
19#define VMWARE_BACKDOOR_PMC_APPARENT_TIME 0x10002
20
21struct kvm_event_hw_type_mapping {

--- 184 unchanged lines hidden ---