All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mohammed Gamal <mgamal@redhat.com>
To: kvm@vger.kernel.org, pbonzini@redhat.com
Cc: Mohammed Gamal <mgamal@redhat.com>
Subject: [kvm-unit-tests PATCH 2/3] x86/access: Skip running guest physical bits tests on AMD with NPT enabled
Date: Thu,  6 Aug 2020 14:43:57 +0200	[thread overview]
Message-ID: <20200806124358.4928-3-mgamal@redhat.com> (raw)
In-Reply-To: <20200806124358.4928-1-mgamal@redhat.com>

Since we can't handle NPT VM exits properly. We won't run
guest physical bits tests if NPT is enabled.

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
---
 x86/access.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/x86/access.c b/x86/access.c
index 7dc9eb6..90c5fe4 100644
--- a/x86/access.c
+++ b/x86/access.c
@@ -973,6 +973,14 @@ static int ac_test_run(void)
         invalid_mask |= AC_PTE_BIT36_MASK;
     }
 
+    if (this_cpu_has(X86_FEATURE_NPT)) {
+        printf("NPT enabled. Skipping physical bits tests\n");
+        invalid_mask |= AC_PDE_BIT51_MASK;
+        invalid_mask |= AC_PTE_BIT51_MASK;
+        invalid_mask |= AC_PDE_BIT36_MASK;
+        invalid_mask |= AC_PTE_BIT36_MASK;
+    }
+
     if (this_cpu_has(X86_FEATURE_PKU)) {
         set_cr4_pke(1);
         set_cr4_pke(0);
-- 
2.26.2


  parent reply	other threads:[~2020-08-06 17:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-06 12:43 [kvm-unit-tests PATCH 0/3] x86: Add guest physical bits tests Mohammed Gamal
2020-08-06 12:43 ` [kvm-unit-tests PATCH 1/3] unittests.cfg: Increase timeout for access test Mohammed Gamal
2020-08-06 12:43 ` Mohammed Gamal [this message]
2020-08-06 12:43 ` [kvm-unit-tests PATCH 3/3] Revert "access: disable phys-bits=36 for now" Mohammed Gamal

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=20200806124358.4928-3-mgamal@redhat.com \
    --to=mgamal@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.