From: Joerg Roedel <joerg.roedel@amd.com>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: <kvm@vger.kernel.org>, Joerg Roedel <joerg.roedel@amd.com>
Subject: [PATCH 4/4] test: Add test to check if asid 0 is allowed
Date: Mon, 2 Aug 2010 15:33:36 +0200 [thread overview]
Message-ID: <1280756016-11330-5-git-send-email-joerg.roedel@amd.com> (raw)
In-Reply-To: <1280756016-11330-1-git-send-email-joerg.roedel@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
kvm/test/x86/svm.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c
index fd98505..2f1c900 100644
--- a/kvm/test/x86/svm.c
+++ b/kvm/test/x86/svm.c
@@ -342,6 +342,21 @@ static bool check_mode_switch(struct test *test)
return test->scratch == 2;
}
+static void prepare_asid_zero(struct test *test)
+{
+ test->vmcb->control.asid = 0;
+}
+
+static void test_asid_zero(struct test *test)
+{
+ asm volatile ("vmmcall\n\t");
+}
+
+static bool check_asid_zero(struct test *test)
+{
+ return test->vmcb->control.exit_code == SVM_EXIT_ERR;
+}
+
static struct test tests[] = {
{ "null", default_supported, default_prepare, null_test,
default_finished, null_check },
@@ -360,6 +375,8 @@ static struct test tests[] = {
default_finished, check_next_rip },
{ "mode_switch", default_supported, prepare_mode_switch, test_mode_switch,
mode_switch_finished, check_mode_switch },
+ { "asid_zero", default_supported, prepare_asid_zero, test_asid_zero,
+ default_finished, check_asid_zero },
};
--
1.7.0.4
next prev parent reply other threads:[~2010-08-02 13:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-02 13:33 [PATCH 0/4] qemu-kvm: Add some nested svm tests Joerg Roedel
2010-08-02 13:33 ` [PATCH 1/4] test: Run tests with asid 1 Joerg Roedel
2010-08-02 13:33 ` [PATCH 2/4] test: Add nested svm next_rip test Joerg Roedel
2010-08-02 13:33 ` [PATCH 3/4] test: Add mode-switch test for nested svm Joerg Roedel
2010-08-02 13:55 ` Avi Kivity
2010-08-02 14:11 ` Roedel, Joerg
2010-08-02 14:24 ` Avi Kivity
2010-08-02 14:56 ` Roedel, Joerg
2010-08-02 13:33 ` Joerg Roedel [this message]
2010-08-02 14:44 ` [PATCH 0/4] qemu-kvm: Add some nested svm tests Avi Kivity
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=1280756016-11330-5-git-send-email-joerg.roedel@amd.com \
--to=joerg.roedel@amd.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox