From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 15/23] KVM: do not inject #PF in (read|write)_emulated() callbacks Date: Thu, 29 Apr 2010 12:23:33 +0300 Message-ID: <4BD95015.2060005@redhat.com> References: <1272370524-1295-1-git-send-email-gleb@redhat.com> <1272370524-1295-16-git-send-email-gleb@redhat.com> <4BD7FBCD.50707@redhat.com> <20100428092153.GM10044@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:30759 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932911Ab0D3RQe (ORCPT ); Fri, 30 Apr 2010 13:16:34 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3T9dctt011281 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 29 Apr 2010 05:39:46 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3T9NYjx015518 for ; Thu, 29 Apr 2010 05:23:34 -0400 In-Reply-To: <20100428092153.GM10044@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 04/28/2010 12:21 PM, Gleb Natapov wrote: > On Wed, Apr 28, 2010 at 12:11:41PM +0300, Avi Kivity wrote: > >> On 04/27/2010 03:15 PM, Gleb Natapov wrote: >> >>> Return error to x86 emulator instead of injection exception behind its back. >>> >>> Signed-off-by: Gleb Natapov >>> --- >>> arch/x86/include/asm/kvm_emulate.h | 3 +++ >>> arch/x86/kvm/emulate.c | 12 +++++++++++- >>> arch/x86/kvm/x86.c | 28 ++++++++++++++-------------- >>> 3 files changed, 28 insertions(+), 15 deletions(-) >>> >>> diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h >>> index ae4af86..b977ccf 100644 >>> --- a/arch/x86/include/asm/kvm_emulate.h >>> +++ b/arch/x86/include/asm/kvm_emulate.h >>> @@ -94,6 +94,7 @@ struct x86_emulate_ops { >>> int (*read_emulated)(unsigned long addr, >>> void *val, >>> unsigned int bytes, >>> + unsigned int *error, >>> struct kvm_vcpu *vcpu); >>> >>> >> The fault may be at a different address than addr, if we cross a >> page boundary. Need a struct here. >> >> > Correct and you can find couple of FIXME in emulator.c that say so. > I'll fix that later. This is not the problem that was introduced by this > patch set. OK. > What do you mean we need struct here? Struct with > error code + error location? > > Yes. -- error compiling committee.c: too many arguments to function