diff mbox series

[kvm-unit-tests,2/2] x86: nVMX: Fix wrong reserved bits of error-code

Message ID 20190830204031.3100-3-namit@vmware.com (mailing list archive)
State New, archived
Headers show
Series x86: nVMX: Bug fixes | expand

Commit Message

Nadav Amit Aug. 30, 2019, 8:40 p.m. UTC
The SDM indeed says that "If deliver-error-code is 1, bits 31:15 of the
VM-entry exception error-code field are 0." However, the SDM is wrong,
and bits that need to be zeroed are 31:16.

Our engineers confirmed that the SDM is wrong with Intel. Fix the test.

Note that KVM should be fixed as well.

Fixes: 8d2cdb35a07a ("x86: Add test for nested VM entry prereqs")
Cc: Marc Orr <marcorr@google.com>
Signed-off-by: Nadav Amit <namit@vmware.com>
---
 x86/vmx_tests.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Sean Christopherson Sept. 3, 2019, 5:23 p.m. UTC | #1
On Fri, Aug 30, 2019 at 01:40:31PM -0700, Nadav Amit wrote:
> The SDM indeed says that "If deliver-error-code is 1, bits 31:15 of the
> VM-entry exception error-code field are 0." However, the SDM is wrong,
> and bits that need to be zeroed are 31:16.
> 
> Our engineers confirmed that the SDM is wrong with Intel. Fix the test.
> 
> Note that KVM should be fixed as well.
> 
> Fixes: 8d2cdb35a07a ("x86: Add test for nested VM entry prereqs")
> Cc: Marc Orr <marcorr@google.com>
> Signed-off-by: Nadav Amit <namit@vmware.com>
> ---

Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
diff mbox series

Patch

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index 4ff1570..37c56df 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -4306,15 +4306,15 @@  skip_unrestricted_guest:
 
 	/*
 	 * If deliver-error-code is 1
-	 * bits 31:15 of the VM-entry exception error-code field are 0.
+	 * bits 31:16 of the VM-entry exception error-code field are 0.
 	 */
 	ent_intr_info = ent_intr_info_base | INTR_INFO_DELIVER_CODE_MASK |
 			INTR_TYPE_HARD_EXCEPTION | GP_VECTOR;
 	report_prefix_pushf("%s, VM-entry intr info=0x%x",
-			    "VM-entry exception error code[31:15] clear",
+			    "VM-entry exception error code[31:16] clear",
 			    ent_intr_info);
 	vmcs_write(ENT_INTR_INFO, ent_intr_info);
-	for (cnt = 15; cnt <= 31; cnt++) {
+	for (cnt = 16; cnt <= 31; cnt++) {
 		ent_intr_err = 1U << cnt;
 		report_prefix_pushf("VM-entry intr error=0x%x [-]",
 				    ent_intr_err);