Updated cr4 so that cr4 and vmcb->save.cr4 are the same and the report statement prints out the correct cr4. v1->v2: moved the assignment to vmcb->save.cr4 back to the previous test as described in the comment. Signed-off-by: Lara Lazier <laramglazier@xxxxxxxxx> --- x86/svm_tests.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x86/svm_tests.c b/x86/svm_tests.c index 8387bea..824c856 100644 --- a/x86/svm_tests.c +++ b/x86/svm_tests.c @@ -2251,8 +2251,12 @@ static void test_efer(void) /* * EFER.LME and CR0.PG are both set and CR0.PE is zero. + * CR4.PAE needs to be set as we otherwise cannot + * determine if CR4.PAE=0 or CR0.PE=0 triggered the + * SVM_EXIT_ERR. */ - vmcb->save.cr4 = cr4_saved | X86_CR4_PAE; + cr4 = cr4_saved | X86_CR4_PAE; + vmcb->save.cr4 = cr4; cr0 &= ~X86_CR0_PE; vmcb->save.cr0 = cr0; report(svm_vmrun() == SVM_EXIT_ERR, "EFER.LME=1 (%lx), " -- 2.25.1