aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-10-25 10:06:30 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2016-11-02 16:32:17 -0400
commit1b07304c587d4fe572ea50bdefaa6047dc9a6d1a (patch)
tree4112c73f6074a428bd78658dac2d9ad9d7ed1460
parent5587859fb1e8bea5e3b8a0ab7866526ad7d1d673 (diff)
KVM: nVMX: support descriptor table exits
These are never used by the host, but they can still be reflected to the guest. Tested-by: Ladi Prosek <lprosek@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/include/asm/vmx.h1
-rw-r--r--arch/x86/include/uapi/asm/vmx.h4
-rw-r--r--arch/x86/kvm/vmx.c3
3 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
index a002b07a7099..5ef9848f743f 100644
--- a/arch/x86/include/asm/vmx.h
+++ b/arch/x86/include/asm/vmx.h
@@ -60,6 +60,7 @@
60 */ 60 */
61#define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001 61#define SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES 0x00000001
62#define SECONDARY_EXEC_ENABLE_EPT 0x00000002 62#define SECONDARY_EXEC_ENABLE_EPT 0x00000002
63#define SECONDARY_EXEC_DESC 0x00000004
63#define SECONDARY_EXEC_RDTSCP 0x00000008 64#define SECONDARY_EXEC_RDTSCP 0x00000008
64#define SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE 0x00000010 65#define SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE 0x00000010
65#define SECONDARY_EXEC_ENABLE_VPID 0x00000020 66#define SECONDARY_EXEC_ENABLE_VPID 0x00000020
diff --git a/arch/x86/include/uapi/asm/vmx.h b/arch/x86/include/uapi/asm/vmx.h
index 37fee272618f..f9dea4fd4107 100644
--- a/arch/x86/include/uapi/asm/vmx.h
+++ b/arch/x86/include/uapi/asm/vmx.h
@@ -65,6 +65,8 @@
65#define EXIT_REASON_TPR_BELOW_THRESHOLD 43 65#define EXIT_REASON_TPR_BELOW_THRESHOLD 43
66#define EXIT_REASON_APIC_ACCESS 44 66#define EXIT_REASON_APIC_ACCESS 44
67#define EXIT_REASON_EOI_INDUCED 45 67#define EXIT_REASON_EOI_INDUCED 45
68#define EXIT_REASON_GDTR_IDTR 46
69#define EXIT_REASON_LDTR_TR 47
68#define EXIT_REASON_EPT_VIOLATION 48 70#define EXIT_REASON_EPT_VIOLATION 48
69#define EXIT_REASON_EPT_MISCONFIG 49 71#define EXIT_REASON_EPT_MISCONFIG 49
70#define EXIT_REASON_INVEPT 50 72#define EXIT_REASON_INVEPT 50
@@ -113,6 +115,8 @@
113 { EXIT_REASON_MCE_DURING_VMENTRY, "MCE_DURING_VMENTRY" }, \ 115 { EXIT_REASON_MCE_DURING_VMENTRY, "MCE_DURING_VMENTRY" }, \
114 { EXIT_REASON_TPR_BELOW_THRESHOLD, "TPR_BELOW_THRESHOLD" }, \ 116 { EXIT_REASON_TPR_BELOW_THRESHOLD, "TPR_BELOW_THRESHOLD" }, \
115 { EXIT_REASON_APIC_ACCESS, "APIC_ACCESS" }, \ 117 { EXIT_REASON_APIC_ACCESS, "APIC_ACCESS" }, \
118 { EXIT_REASON_GDTR_IDTR, "GDTR_IDTR" }, \
119 { EXIT_REASON_LDTR_TR, "LDTR_TR" }, \
116 { EXIT_REASON_EPT_VIOLATION, "EPT_VIOLATION" }, \ 120 { EXIT_REASON_EPT_VIOLATION, "EPT_VIOLATION" }, \
117 { EXIT_REASON_EPT_MISCONFIG, "EPT_MISCONFIG" }, \ 121 { EXIT_REASON_EPT_MISCONFIG, "EPT_MISCONFIG" }, \
118 { EXIT_REASON_INVEPT, "INVEPT" }, \ 122 { EXIT_REASON_INVEPT, "INVEPT" }, \
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 7eb72f7bd0e3..dcb840e8bfe3 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2796,6 +2796,7 @@ static void nested_vmx_setup_ctls_msrs(struct vcpu_vmx *vmx)
2796 vmx->nested.nested_vmx_secondary_ctls_high &= 2796 vmx->nested.nested_vmx_secondary_ctls_high &=
2797 SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES | 2797 SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
2798 SECONDARY_EXEC_RDTSCP | 2798 SECONDARY_EXEC_RDTSCP |
2799 SECONDARY_EXEC_DESC |
2799 SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE | 2800 SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE |
2800 SECONDARY_EXEC_ENABLE_VPID | 2801 SECONDARY_EXEC_ENABLE_VPID |
2801 SECONDARY_EXEC_APIC_REGISTER_VIRT | 2802 SECONDARY_EXEC_APIC_REGISTER_VIRT |
@@ -7961,6 +7962,8 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
7961 return nested_cpu_has(vmcs12, CPU_BASED_MOV_DR_EXITING); 7962 return nested_cpu_has(vmcs12, CPU_BASED_MOV_DR_EXITING);
7962 case EXIT_REASON_IO_INSTRUCTION: 7963 case EXIT_REASON_IO_INSTRUCTION:
7963 return nested_vmx_exit_handled_io(vcpu, vmcs12); 7964 return nested_vmx_exit_handled_io(vcpu, vmcs12);
7965 case EXIT_REASON_GDTR_IDTR: case EXIT_REASON_LDTR_TR:
7966 return nested_cpu_has2(vmcs12, SECONDARY_EXEC_DESC);
7964 case EXIT_REASON_MSR_READ: 7967 case EXIT_REASON_MSR_READ:
7965 case EXIT_REASON_MSR_WRITE: 7968 case EXIT_REASON_MSR_WRITE:
7966 return nested_vmx_exit_handled_msr(vcpu, vmcs12, exit_reason); 7969 return nested_vmx_exit_handled_msr(vcpu, vmcs12, exit_reason);