Skip to content

Commit fb29541

Browse files
committed
KVM, x86: add architectural support code for #VE
Dump the contents of the #VE info data structure and assert that #VE does not happen, but do not yet do anything with it. No functional change intended, separated for clarity only. Extracted from a patch by Isaku Yamahata <[email protected]>. Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 949019b commit fb29541

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

arch/x86/include/asm/vmx.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
#define SECONDARY_EXEC_ENCLS_EXITING VMCS_CONTROL_BIT(ENCLS_EXITING)
7272
#define SECONDARY_EXEC_RDSEED_EXITING VMCS_CONTROL_BIT(RDSEED_EXITING)
7373
#define SECONDARY_EXEC_ENABLE_PML VMCS_CONTROL_BIT(PAGE_MOD_LOGGING)
74+
#define SECONDARY_EXEC_EPT_VIOLATION_VE VMCS_CONTROL_BIT(EPT_VIOLATION_VE)
7475
#define SECONDARY_EXEC_PT_CONCEAL_VMX VMCS_CONTROL_BIT(PT_CONCEAL_VMX)
7576
#define SECONDARY_EXEC_ENABLE_XSAVES VMCS_CONTROL_BIT(XSAVES)
7677
#define SECONDARY_EXEC_MODE_BASED_EPT_EXEC VMCS_CONTROL_BIT(MODE_BASED_EPT_EXEC)
@@ -226,6 +227,8 @@ enum vmcs_field {
226227
VMREAD_BITMAP_HIGH = 0x00002027,
227228
VMWRITE_BITMAP = 0x00002028,
228229
VMWRITE_BITMAP_HIGH = 0x00002029,
230+
VE_INFORMATION_ADDRESS = 0x0000202A,
231+
VE_INFORMATION_ADDRESS_HIGH = 0x0000202B,
229232
XSS_EXIT_BITMAP = 0x0000202C,
230233
XSS_EXIT_BITMAP_HIGH = 0x0000202D,
231234
ENCLS_EXITING_BITMAP = 0x0000202E,
@@ -631,4 +634,13 @@ enum vmx_l1d_flush_state {
631634

632635
extern enum vmx_l1d_flush_state l1tf_vmx_mitigation;
633636

637+
struct vmx_ve_information {
638+
u32 exit_reason;
639+
u32 delivery;
640+
u64 exit_qualification;
641+
u64 guest_linear_address;
642+
u64 guest_physical_address;
643+
u16 eptp_index;
644+
};
645+
634646
#endif

arch/x86/kvm/vmx/vmx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6408,6 +6408,10 @@ void dump_vmcs(struct kvm_vcpu *vcpu)
64086408
if (secondary_exec_control & SECONDARY_EXEC_ENABLE_VPID)
64096409
pr_err("Virtual processor ID = 0x%04x\n",
64106410
vmcs_read16(VIRTUAL_PROCESSOR_ID));
6411+
if (secondary_exec_control & SECONDARY_EXEC_EPT_VIOLATION_VE) {
6412+
pr_err("VE info address = 0x%016llx\n",
6413+
vmcs_read64(VE_INFORMATION_ADDRESS));
6414+
}
64116415
}
64126416

64136417
/*

0 commit comments

Comments
 (0)