When PMC virtualization (X86_FEATURE_PERFCTR_VIRT) is supported and the feature is enabled, additional save slots are available in the VMCB for the following MSRs. * Performance Counter Global Control (MSR 0xc0000301) (Swap Type C) * Performance Counter Global Status (MSR 0xc0000300) (Swap Type A) * Performance Event Select (MSR 0xc0010200..0xc001020a) (Swap Type C) * Performance Event Counter (MSR 0xc0010201..0xc001020b) (Swap Type C) Define the additional VMCB fields that will be used by hardware to save and restore the guest PMU state. Signed-off-by: Sandipan Das --- arch/x86/include/asm/svm.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h index ffc27f676243..a80df935b580 100644 --- a/arch/x86/include/asm/svm.h +++ b/arch/x86/include/asm/svm.h @@ -327,7 +327,12 @@ struct vmcb_save_area { u8 cpl; u8 reserved_0xcc[4]; u64 efer; - u8 reserved_0xd8[112]; + u8 reserved_0xd8[8]; + struct { + u64 perf_ctl; + u64 perf_ctr; + } __packed pmc[6]; + u8 reserved_0x140[8]; u64 cr4; u64 cr3; u64 cr0; @@ -335,7 +340,9 @@ struct vmcb_save_area { u64 dr6; u64 rflags; u64 rip; - u8 reserved_0x180[88]; + u8 reserved_0x180[72]; + u64 perf_cntr_global_status; + u64 perf_cntr_global_control; u64 rsp; u64 s_cet; u64 ssp; -- 2.43.0