summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2010-08-02 15:33:36 +0200
committerAvi Kivity <avi@redhat.com>2010-08-02 17:43:54 +0300
commit311a14635520a96405bdb5f2f7d77666398f882e (patch)
tree7b19fbf55eae91ab775c66b9f72b19d3c045062f
parent94b8a244bb20dcb8e911306715b607e7b245c712 (diff)
test: Add test to check if asid 0 is allowed
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--kvm/test/x86/svm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c
index fd9850575..2f1c900ff 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 },
};