From patchwork Wed Nov 24 18:18:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 353901 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 oAOILwH8018860 for ; Wed, 24 Nov 2010 18:21:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753032Ab0KXSSn (ORCPT ); Wed, 24 Nov 2010 13:18:43 -0500 Received: from tx2ehsobe001.messaging.microsoft.com ([65.55.88.11]:41949 "EHLO TX2EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751757Ab0KXSSm (ORCPT ); Wed, 24 Nov 2010 13:18:42 -0500 Received: from mail105-tx2-R.bigfish.com (10.9.14.247) by TX2EHSOBE001.bigfish.com (10.9.40.21) with Microsoft SMTP Server id 14.1.225.8; Wed, 24 Nov 2010 18:18:41 +0000 Received: from mail105-tx2 (localhost.localdomain [127.0.0.1]) by mail105-tx2-R.bigfish.com (Postfix) with ESMTP id 451C2BD00E8; Wed, 24 Nov 2010 18:18:41 +0000 (UTC) X-SpamScore: -2 X-BigFish: VPS-2(zzbb2cKzz1202hzz8275bhz32i691h668h67dh685h) X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:ausb3twp02.amd.com; RD:none; EFVD:NLI Received: from mail105-tx2 (localhost.localdomain [127.0.0.1]) by mail105-tx2 (MessageSwitch) id 1290622721110269_10544; Wed, 24 Nov 2010 18:18:41 +0000 (UTC) Received: from TX2EHSMHS034.bigfish.com (unknown [10.9.14.252]) by mail105-tx2.bigfish.com (Postfix) with ESMTP id 1767EB8804D; Wed, 24 Nov 2010 18:18:41 +0000 (UTC) Received: from ausb3twp02.amd.com (163.181.249.109) by TX2EHSMHS034.bigfish.com (10.9.99.134) with Microsoft SMTP Server id 14.1.225.8; Wed, 24 Nov 2010 18:18:40 +0000 X-WSS-ID: 0LCEIUY-02-3OC-02 X-M-MSG: Received: from sausexedgep02.amd.com (sausexedgep02-ext.amd.com [163.181.249.73]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ausb3twp02.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 234EAC884C; Wed, 24 Nov 2010 12:18:33 -0600 (CST) Received: from sausexhtp01.amd.com (163.181.3.165) by sausexedgep02.amd.com (163.181.36.59) with Microsoft SMTP Server (TLS) id 8.3.106.1; Wed, 24 Nov 2010 12:19:47 -0600 Received: from storexhtp02.amd.com (172.24.4.4) by sausexhtp01.amd.com (163.181.3.165) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 24 Nov 2010 12:18:39 -0600 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; Wed, 24 Nov 2010 13:18:38 -0500 Received: from lemmy.osrc.amd.com (lemmy.osrc.amd.com [165.204.15.93]) by gwo.osrc.amd.com (Postfix) with ESMTP id A509549C258; Wed, 24 Nov 2010 18:18:37 +0000 (GMT) Received: by lemmy.osrc.amd.com (Postfix, from userid 1000) id AC9C0100ED4; Wed, 24 Nov 2010 19:18:39 +0100 (CET) From: Joerg Roedel To: Avi Kivity , Marcelo Tosatti CC: , , Joerg Roedel Subject: [PATCH 3/9] KVM: SVM: Add checks for DRx read and write intercepts Date: Wed, 24 Nov 2010 19:18:29 +0100 Message-ID: <1290622715-8382-4-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1290622715-8382-1-git-send-email-joerg.roedel@amd.com> References: <1290622715-8382-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.3 (demeter1.kernel.org [140.211.167.41]); Wed, 24 Nov 2010 18:21:58 +0000 (UTC) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 29f0491..16ff569 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -3669,6 +3669,9 @@ static int svm_insn_intercepted(struct kvm_vcpu *vcpu, case 0x20: /* CR read */ vmcb->control.exit_code = SVM_EXIT_READ_CR0 + c->modrm_reg; break; + case 0x21: + vmcb->control.exit_code = SVM_EXIT_READ_DR0 + c->modrm_reg; + break; case 0x22: /* CR write */ vmcb->control.exit_code = SVM_EXIT_WRITE_CR0 + c->modrm_reg; if (c->modrm_reg == 0 && @@ -3683,6 +3686,9 @@ static int svm_insn_intercepted(struct kvm_vcpu *vcpu, vmcb->control.exit_code = SVM_EXIT_CR0_SEL_WRITE; } break; + case 0x23: + vmcb->control.exit_code = SVM_EXIT_WRITE_DR0 + c->modrm_reg; + break; } vmcb->control.next_rip = ctxt->eip;