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: Wed, 28 Apr 2010 12:11:41 +0300 Message-ID: <4BD7FBCD.50707@redhat.com> References: <1272370524-1295-1-git-send-email-gleb@redhat.com> <1272370524-1295-16-git-send-email-gleb@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]:63559 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753158Ab0D1J6n (ORCPT ); Wed, 28 Apr 2010 05:58:43 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3S9wZ6K003534 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 28 Apr 2010 05:58:43 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3S9BgKY008932 for ; Wed, 28 Apr 2010 05:11:42 -0400 In-Reply-To: <1272370524-1295-16-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. -- error compiling committee.c: too many arguments to function