From patchwork Thu Jan 28 14:01:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takuya Yoshikawa X-Patchwork-Id: 75587 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 o0SDwtiW009910 for ; Thu, 28 Jan 2010 13:58:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755186Ab0A1N6w (ORCPT ); Thu, 28 Jan 2010 08:58:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756223Ab0A1N6w (ORCPT ); Thu, 28 Jan 2010 08:58:52 -0500 Received: from serv2.oss.ntt.co.jp ([222.151.198.100]:60571 "EHLO serv2.oss.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754902Ab0A1N6w (ORCPT ); Thu, 28 Jan 2010 08:58:52 -0500 Received: from serv2.oss.ntt.co.jp (localhost [127.0.0.1]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id 4E7FB2481C0; Thu, 28 Jan 2010 22:58:51 +0900 (JST) Received: from serv1.oss.ntt.co.jp (serv1.oss.ntt.co.jp [172.19.0.2]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id 3DE112481B4; Thu, 28 Jan 2010 22:58:51 +0900 (JST) Received: from yshtky3.kern.oss.ntt.co.jp (unknown [172.17.1.124]) by serv1.oss.ntt.co.jp (Postfix) with SMTP id 2135411C097; Thu, 28 Jan 2010 22:58:51 +0900 (JST) Date: Thu, 28 Jan 2010 23:01:30 +0900 From: Takuya Yoshikawa To: avi@redhat.com, mtosatti@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH 4/5] KVM: load|save_guest_segment_descriptor() should return X86EMUL_* values Message-Id: <20100128230130.3d24a46e.yoshikawa.takuya@oss.ntt.co.jp> In-Reply-To: <20100128225114.7a28762c.yoshikawa.takuya@oss.ntt.co.jp> References: <20100128225114.7a28762c.yoshikawa.takuya@oss.ntt.co.jp> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 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]); Thu, 28 Jan 2010 13:58:55 +0000 (UTC) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index ac8672f..78b8ddb 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4663,7 +4663,7 @@ static int load_guest_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector, if (dtable.limit < index * 8 + 7) { kvm_queue_exception_e(vcpu, GP_VECTOR, selector & 0xfffc); - return 1; + return X86EMUL_UNHANDLEABLE; } return kvm_read_guest_virt(dtable.base + index*8, seg_desc, sizeof(*seg_desc), vcpu); } @@ -4678,7 +4678,7 @@ static int save_guest_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector, get_segment_descriptor_dtable(vcpu, selector, &dtable); if (dtable.limit < index * 8 + 7) - return 1; + return X86EMUL_UNHANDLEABLE; return kvm_write_guest_virt(dtable.base + index*8, seg_desc, sizeof(*seg_desc), vcpu); }