All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joerg.roedel@amd.com>
To: Avi Kivity <avi@redhat.com>
Cc: <kvm@vger.kernel.org>, Joerg Roedel <joerg.roedel@amd.com>
Subject: [PATCH 5/7] svm: Add test for RSVD  bit check in emulated NPT
Date: Tue, 14 Sep 2010 17:59:10 +0200	[thread overview]
Message-ID: <1284479952-4916-6-git-send-email-joerg.roedel@amd.com> (raw)
In-Reply-To: <1284479952-4916-1-git-send-email-joerg.roedel@amd.com>

This patch adds a test to check if the RSVD bits are checked in
the NPT emulation of KVM.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
 x86/svm.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/x86/svm.c b/x86/svm.c
index 04ca028..03e07e2 100644
--- a/x86/svm.c
+++ b/x86/svm.c
@@ -516,6 +516,22 @@ static bool npt_us_check(struct test *test)
            && (test->vmcb->control.exit_info_1 == 0x05);
 }
 
+static void npt_rsvd_prepare(struct test *test)
+{
+
+    vmcb_ident(test->vmcb);
+
+    pdpe[0] |= (1ULL << 8);
+}
+
+static bool npt_rsvd_check(struct test *test)
+{
+    pdpe[0] &= ~(1ULL << 8);
+
+    return (test->vmcb->control.exit_code == SVM_EXIT_NPF)
+            && (test->vmcb->control.exit_info_1 == 0x0f);
+}
+
 static struct test tests[] = {
     { "null", default_supported, default_prepare, null_test,
       default_finished, null_check },
@@ -542,6 +558,8 @@ static struct test tests[] = {
 	    default_finished, npt_nx_check },
     { "npt_us", npt_supported, npt_us_prepare, npt_us_test,
 	    default_finished, npt_us_check },
+    { "npt_rsvd", npt_supported, npt_rsvd_prepare, null_test,
+	    default_finished, npt_rsvd_check },
 };
 
 int main(int ac, char **av)
-- 
1.7.0.4



  parent reply	other threads:[~2010-09-14 15:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-14 15:59 [PATCH 0/7] New Unit-Tests for KVM SVM emulation v2 Joerg Roedel
2010-09-14 15:59 ` [PATCH 1/7] svm: Add test for selective cr0 intercept Joerg Roedel
2010-09-14 15:59 ` [PATCH 2/7] svm: Run tests with NPT enabled if available Joerg Roedel
2010-09-14 15:59 ` [PATCH 3/7] svm: Add test for NX bit check in emulated NPT Joerg Roedel
2010-09-14 15:59 ` [PATCH 4/7] svm: Add test for US " Joerg Roedel
2010-09-14 15:59 ` Joerg Roedel [this message]
2010-09-14 15:59 ` [PATCH 6/7] svm: Add test for RW " Joerg Roedel
2010-09-14 15:59 ` [PATCH 7/7] svm: Add test for the NPT page table walker Joerg Roedel
2010-09-19 10:01 ` [PATCH 0/7] New Unit-Tests for KVM SVM emulation v2 Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2010-09-10 15:34 [PATCH 0/7] New Unit-Tests for KVM SVM emulation Joerg Roedel
2010-09-10 15:34 ` [PATCH 5/7] svm: Add test for RSVD bit check in emulated NPT Joerg Roedel

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=1284479952-4916-6-git-send-email-joerg.roedel@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=avi@redhat.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 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.