From: Nadav Amit <nadav.amit@xxxxxxxxx> Old Intel CPUs, which do not support control protection exception, do not expect an error code for #CP, while new ones expect an error-code. Intel SDM does not say that the delivery of an error-code for #CP is conditional on anything, not even CPU support of CET. So it appears that the correct testing is just to skip the error-code delivery test for the #CP exception. Signed-off-by: Nadav Amit <nadav.amit@xxxxxxxxx> --- lib/x86/processor.h | 1 + x86/vmx_tests.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib/x86/processor.h b/lib/x86/processor.h index 517ee70..53e71fc 100644 --- a/lib/x86/processor.h +++ b/lib/x86/processor.h @@ -28,6 +28,7 @@ #define GP_VECTOR 13 #define PF_VECTOR 14 #define AC_VECTOR 17 +#define CP_VECTOR 21 #define X86_CR0_PE 0x00000001 #define X86_CR0_MP 0x00000002 diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c index 179a55b..5b9faa2 100644 --- a/x86/vmx_tests.c +++ b/x86/vmx_tests.c @@ -4413,6 +4413,9 @@ skip_unrestricted_guest: case PF_VECTOR: case AC_VECTOR: has_error_code = true; + case CP_VECTOR: + /* Some CPUs have error code and some do not, skip */ + continue; } /* Negative case */ -- 2.25.1