From patchwork Mon Mar 28 10:46:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 668111 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2SAmr31017052 for ; Mon, 28 Mar 2011 10:49:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752958Ab1C1KtB (ORCPT ); Mon, 28 Mar 2011 06:49:01 -0400 Received: from tx2ehsobe004.messaging.microsoft.com ([65.55.88.14]:53374 "EHLO TX2EHSOBE009.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752517Ab1C1KtA (ORCPT ); Mon, 28 Mar 2011 06:49:00 -0400 Received: from mail25-tx2-R.bigfish.com (10.9.14.251) by TX2EHSOBE009.bigfish.com (10.9.40.29) with Microsoft SMTP Server id 14.1.225.8; Mon, 28 Mar 2011 10:48:57 +0000 Received: from mail25-tx2 (localhost.localdomain [127.0.0.1]) by mail25-tx2-R.bigfish.com (Postfix) with ESMTP id CACBC1C702B7; Mon, 28 Mar 2011 10:48:56 +0000 (UTC) X-SpamScore: -2 X-BigFish: VPS-2(zzbb2cKzz1202hzz8275bhz32i668h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:ausb3twp01.amd.com; RD:none; EFVD:NLI Received: from mail25-tx2 (localhost.localdomain [127.0.0.1]) by mail25-tx2 (MessageSwitch) id 1301309322959708_14161; Mon, 28 Mar 2011 10:48:42 +0000 (UTC) Received: from TX2EHSMHS009.bigfish.com (unknown [10.9.14.252]) by mail25-tx2.bigfish.com (Postfix) with ESMTP id 5DC331078057; Mon, 28 Mar 2011 10:47:00 +0000 (UTC) Received: from ausb3twp01.amd.com (163.181.249.108) by TX2EHSMHS009.bigfish.com (10.9.99.109) with Microsoft SMTP Server id 14.1.225.8; Mon, 28 Mar 2011 10:46:59 +0000 X-WSS-ID: 0LIRKM6-01-4FO-02 X-M-MSG: Received: from sausexedgep01.amd.com (sausexedgep01-ext.amd.com [163.181.249.72]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ausb3twp01.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 242781028843; Mon, 28 Mar 2011 05:46:54 -0500 (CDT) Received: from sausexhtp02.amd.com (163.181.3.152) by sausexedgep01.amd.com (163.181.36.54) with Microsoft SMTP Server (TLS) id 8.3.106.1; Mon, 28 Mar 2011 05:54:32 -0500 Received: from storexhtp02.amd.com (172.24.4.4) by sausexhtp02.amd.com (163.181.3.152) with Microsoft SMTP Server (TLS) id 8.3.83.0; Mon, 28 Mar 2011 05:46:57 -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.3.83.0; Mon, 28 Mar 2011 06:46:56 -0400 Received: from lemmy.osrc.amd.com (lemmy.osrc.amd.com [165.204.15.93]) by gwo.osrc.amd.com (Postfix) with ESMTP id 40D3A49C5A3; Mon, 28 Mar 2011 11:46:55 +0100 (BST) Received: by lemmy.osrc.amd.com (Postfix, from userid 1000) id 36210FFB8B; Mon, 28 Mar 2011 12:46:55 +0200 (CEST) From: Joerg Roedel To: Avi Kivity , Marcelo Tosatti CC: , Joerg Roedel Subject: [PATCH 09/13] KVM: SVM: Add intercept checks for remaining group7 instructions Date: Mon, 28 Mar 2011 12:46:46 +0200 Message-ID: <1301309210-11120-10-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1301309210-11120-1-git-send-email-joerg.roedel@amd.com> References: <1301309210-11120-1-git-send-email-joerg.roedel@amd.com> MIME-Version: 1.0 X-OriginatorOrg: amd.com 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.6 (demeter1.kernel.org [140.211.167.41]); Mon, 28 Mar 2011 10:49:15 +0000 (UTC) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 8b8f63d..e0eed4c 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2366,6 +2366,12 @@ static int em_mov(struct x86_emulate_ctxt *ctxt) D2bv(((_f) & ~Lock) | DstAcc | SrcImm) +static struct opcode group7_rm1[] = { + DI(SrcNone | ModRM | Priv, monitor), + DI(SrcNone | ModRM | Priv, mwait), + N, N, N, N, N, N, +}; + static struct opcode group7_rm3[] = { DI(SrcNone | ModRM | Priv, vmrun), DI(SrcNone | ModRM | Priv, vmmcall), @@ -2377,6 +2383,11 @@ static struct opcode group7_rm3[] = { DI(SrcNone | ModRM | Priv, invlpga), }; +static struct opcode group7_rm7[] = { + N, + DI(SrcNone | ModRM, rdtscp), + N, N, N, N, N, N, +}; static struct opcode group1[] = { X7(D(Lock)), N }; @@ -2419,10 +2430,10 @@ static struct group_dual group7 = { { DI(SrcMem16 | ModRM | Mov | Priv, lmsw), DI(SrcMem | ModRM | ByteOp | Priv | NoAccess, invlpg), }, { - D(SrcNone | ModRM | Priv | VendorSpecific), N, + D(SrcNone | ModRM | Priv | VendorSpecific), EXT(0, group7_rm1), N, EXT(0, group7_rm3), DI(SrcNone | ModRM | DstMem | Mov, smsw), N, - DI(SrcMem16 | ModRM | Mov | Priv, lmsw), N, + DI(SrcMem16 | ModRM | Mov | Priv, lmsw), EXT(0, group7_rm7), } }; static struct opcode group8[] = { diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 9b22f5f..2853625 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -3904,6 +3904,9 @@ static struct __x86_intercept { [x86_intercept_clgi] = POST_EX(SVM_EXIT_CLGI), [x86_intercept_skinit] = POST_EX(SVM_EXIT_SKINIT), [x86_intercept_invlpga] = POST_EX(SVM_EXIT_INVLPGA), + [x86_intercept_rdtscp] = POST_EX(SVM_EXIT_RDTSCP), + [x86_intercept_monitor] = POST_MEM(SVM_EXIT_MONITOR), + [x86_intercept_mwait] = POST_EX(SVM_EXIT_MWAIT), }; #undef POST_EX