From patchwork Tue Apr 27 10:38:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 95342 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3RAfN4H020087 for ; Tue, 27 Apr 2010 10:41:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754793Ab0D0KjI (ORCPT ); Tue, 27 Apr 2010 06:39:08 -0400 Received: from tx2ehsobe003.messaging.microsoft.com ([65.55.88.13]:6377 "EHLO TX2EHSOBE005.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754748Ab0D0KjE (ORCPT ); Tue, 27 Apr 2010 06:39:04 -0400 Received: from mail103-tx2-R.bigfish.com (10.9.14.237) by TX2EHSOBE005.bigfish.com (10.9.40.25) with Microsoft SMTP Server id 8.1.340.0; Tue, 27 Apr 2010 10:39:04 +0000 Received: from mail103-tx2 (localhost.localdomain [127.0.0.1]) by mail103-tx2-R.bigfish.com (Postfix) with ESMTP id 589BDDF039A; Tue, 27 Apr 2010 10:39:04 +0000 (UTC) X-SpamScore: 1 X-BigFish: VPS1(zzab9bhzz1202hzz6ff19hz32i2a8h87h61h) X-Spam-TCS-SCL: 0:0 X-FB-DOMAIN-IP-MATCH: fail Received: from mail103-tx2 (localhost.localdomain [127.0.0.1]) by mail103-tx2 (MessageSwitch) id 1272364744106291_28537; Tue, 27 Apr 2010 10:39:04 +0000 (UTC) Received: from TX2EHSMHS026.bigfish.com (unknown [10.9.14.245]) by mail103-tx2.bigfish.com (Postfix) with ESMTP id 15C6C3E0053; Tue, 27 Apr 2010 10:39:04 +0000 (UTC) Received: from ausb3extmailp02.amd.com (163.181.251.22) by TX2EHSMHS026.bigfish.com (10.9.99.126) with Microsoft SMTP Server (TLS) id 14.0.482.44; Tue, 27 Apr 2010 10:38:59 +0000 Received: from ausb3twp01.amd.com (ausb3twp01.amd.com [163.181.250.37]) by ausb3extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with SMTP id o3RAdLLq012810; Tue, 27 Apr 2010 05:39:24 -0500 X-WSS-ID: 0L1J6WS-01-331-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 ausb3twp01.amd.com (Tumbleweed MailGate 3.7.2) with ESMTP id 2D0B71028562; Tue, 27 Apr 2010 05:38:52 -0500 (CDT) Received: from storexhtp01.amd.com (172.24.4.3) by sausexhtp01.amd.com (163.181.3.165) with Microsoft SMTP Server (TLS) id 8.2.234.1; Tue, 27 Apr 2010 03:38:55 -0700 Received: from storexbh1.amd.com (10.1.1.17) by storexhtp01.amd.com (172.24.4.3) with Microsoft SMTP Server id 8.2.234.1; Tue, 27 Apr 2010 03:38:53 -0700 Received: from sausexmb1.amd.com ([163.181.3.156]) by storexbh1.amd.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 27 Apr 2010 06:38:52 -0400 Received: from seurexmb1.amd.com ([165.204.9.130]) by sausexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 27 Apr 2010 05:38:49 -0500 Received: from lemmy.osrc.amd.com ([165.204.15.93]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 27 Apr 2010 12:38:36 +0200 Received: by lemmy.osrc.amd.com (Postfix, from userid 41430) id 21029C9AB5; Tue, 27 Apr 2010 12:38:36 +0200 (CEST) From: Joerg Roedel To: Avi Kivity , Marcelo Tosatti CC: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: [PATCH 18/22] KVM: X86: Propagate fetch faults Date: Tue, 27 Apr 2010 12:38:28 +0200 Message-ID: <1272364712-17425-19-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1272364712-17425-1-git-send-email-joerg.roedel@amd.com> References: <1272364712-17425-1-git-send-email-joerg.roedel@amd.com> X-OriginalArrivalTime: 27 Apr 2010 10:38:36.0152 (UTC) FILETIME=[CA8DCF80:01CAE5F5] MIME-Version: 1.0 X-Reverse-DNS: ausb3extmailp02.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 (demeter.kernel.org [140.211.167.41]); Tue, 27 Apr 2010 10:41:23 +0000 (UTC) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 171e1c7..bb90307 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -1260,7 +1260,7 @@ done_prefixes: } done: - return (rc == X86EMUL_UNHANDLEABLE) ? -1 : 0; + return rc; } static int pio_in_emulated(struct x86_emulate_ctxt *ctxt, diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 4d3a698..d159319 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3856,6 +3856,10 @@ int emulate_instruction(struct kvm_vcpu *vcpu, ? X86EMUL_MODE_PROT32 : X86EMUL_MODE_PROT16; r = x86_decode_insn(&vcpu->arch.emulate_ctxt, &emulate_ops); + if (r == X86EMUL_PROPAGATE_FAULT) { + kvm_propagate_fault(vcpu); + return EMULATE_DONE; + } trace_kvm_emulate_insn_start(vcpu); /* Only allow emulation of specific instructions on #UD