diff mbox series

[v2,kvm-unit-tests] svm: Updated cr4 in test_efer to fix report msg

Message ID 20210621153925.31375-1-laramglazier@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v2,kvm-unit-tests] svm: Updated cr4 in test_efer to fix report msg | expand

Commit Message

Lara Lazier June 21, 2021, 3:39 p.m. UTC
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@gmail.com>
---
 x86/svm_tests.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Paolo Bonzini June 22, 2021, 12:38 p.m. UTC | #1
On Mon, 21 Jun 2021 17:39:25 +0200, Lara Lazier wrote:
> 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.

Applied, thanks!

[1/1] svm: Updated cr4 in test_efer to fix report msg
      commit: fc050452b8c37729c2348e7c63075cc2a9ae3738

Best regards,
diff mbox series

Patch

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), "