From patchwork Mon Aug 2 13:33:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 116504 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o72DUv3P017898 for ; Mon, 2 Aug 2010 13:30:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753844Ab0HBNat (ORCPT ); Mon, 2 Aug 2010 09:30:49 -0400 Received: from va3ehsobe001.messaging.microsoft.com ([216.32.180.11]:15921 "EHLO VA3EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751521Ab0HBNan (ORCPT ); Mon, 2 Aug 2010 09:30:43 -0400 Received: from mail171-va3-R.bigfish.com (10.7.14.253) by VA3EHSOBE001.bigfish.com (10.7.40.21) with Microsoft SMTP Server id 8.1.340.0; Mon, 2 Aug 2010 13:30:42 +0000 Received: from mail171-va3 (localhost.localdomain [127.0.0.1]) by mail171-va3-R.bigfish.com (Postfix) with ESMTP id AEC4372814A; Mon, 2 Aug 2010 13:30:42 +0000 (UTC) X-SpamScore: 1 X-BigFish: VS1(zzzz1202hzzz32i87h2a8h43h61h) X-Spam-TCS-SCL: 0:0 X-FB-DOMAIN-IP-MATCH: fail Received: from mail171-va3 (localhost.localdomain [127.0.0.1]) by mail171-va3 (MessageSwitch) id 1280755842458066_27546; Mon, 2 Aug 2010 13:30:42 +0000 (UTC) Received: from VA3EHSMHS018.bigfish.com (unknown [10.7.14.253]) by mail171-va3.bigfish.com (Postfix) with ESMTP id 6C6731B3804F; Mon, 2 Aug 2010 13:30:42 +0000 (UTC) Received: from ausb3extmailp01.amd.com (163.181.251.8) by VA3EHSMHS018.bigfish.com (10.7.99.28) with Microsoft SMTP Server (TLS) id 14.0.482.44; Mon, 2 Aug 2010 13:30:40 +0000 Received: from ausb3twp02.amd.com ([163.181.250.38]) by ausb3extmailp01.amd.com (Switch-3.2.7/Switch-3.2.7) with SMTP id o72DV3hG006285; Mon, 2 Aug 2010 08:31:06 -0500 X-WSS-ID: 0L6J1IV-02-3KO-02 X-M-MSG: Received: from sausexhtp01.amd.com (sausexhtp01.amd.com [163.181.3.165]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by ausb3twp02.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 24274C85CC; Mon, 2 Aug 2010 08:30:31 -0500 (CDT) Received: from storexhtp02.amd.com (172.24.4.4) by sausexhtp01.amd.com (163.181.3.165) with Microsoft SMTP Server (TLS) id 8.2.254.0; Mon, 2 Aug 2010 08:30:35 -0500 Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp02.amd.com (172.24.4.4) with Microsoft SMTP Server id 8.2.254.0; Mon, 2 Aug 2010 09:30:34 -0400 Received: from lemmy.osrc.amd.com (lemmy.osrc.amd.com [165.204.15.93]) by gwo.osrc.amd.com (Postfix) with ESMTP id 8CD4549C265; Mon, 2 Aug 2010 14:30:33 +0100 (BST) Received: by lemmy.osrc.amd.com (Postfix, from userid 1000) id B4E9C9FC01; Mon, 2 Aug 2010 15:33:39 +0200 (CEST) From: Joerg Roedel To: Avi Kivity , Marcelo Tosatti CC: , Joerg Roedel Subject: [PATCH 4/4] test: Add test to check if asid 0 is allowed Date: Mon, 2 Aug 2010 15:33:36 +0200 Message-ID: <1280756016-11330-5-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1280756016-11330-1-git-send-email-joerg.roedel@amd.com> References: <1280756016-11330-1-git-send-email-joerg.roedel@amd.com> MIME-Version: 1.0 X-Reverse-DNS: unknown Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 02 Aug 2010 13:30:58 +0000 (UTC) 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 }, };