public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Lara Lazier <laramglazier@gmail.com>
To: kvm@vger.kernel.org
Cc: Lara Lazier <laramglazier@gmail.com>
Subject: [PATCH v2 kvm-unit-tests] svm: Updated cr4 in test_efer to fix report msg
Date: Mon, 21 Jun 2021 17:39:25 +0200	[thread overview]
Message-ID: <20210621153925.31375-1-laramglazier@gmail.com> (raw)

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(-)

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


             reply	other threads:[~2021-06-21 15:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 15:39 Lara Lazier [this message]
2021-06-22 12:38 ` [PATCH v2 kvm-unit-tests] svm: Updated cr4 in test_efer to fix report msg Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210621153925.31375-1-laramglazier@gmail.com \
    --to=laramglazier@gmail.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox