From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCHv2 4/5] KVM: emulator: move linearize() out of emulator code. Date: Sun, 24 Jun 2012 16:12:05 +0300 Message-ID: <4FE71225.2010504@redhat.com> References: <1339502487-30049-1-git-send-email-gleb@redhat.com> <1339502487-30049-5-git-send-email-gleb@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, mtosatti@redhat.com To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:22681 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753383Ab2FXNMH (ORCPT ); Sun, 24 Jun 2012 09:12:07 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5ODC7Ut011533 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 24 Jun 2012 09:12:07 -0400 In-Reply-To: <1339502487-30049-5-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 06/12/2012 03:01 PM, Gleb Natapov wrote: > The function will be used outside of the emulator. > > /* > * x86_emulate_ops: > * > @@ -194,6 +199,10 @@ struct x86_emulate_ops { > > bool (*get_cpuid)(struct x86_emulate_ctxt *ctxt, > u32 *eax, u32 *ebx, u32 *ecx, u32 *edx); > + > + int (*linearize)(struct x86_emulate_ctxt *ctxt, > + struct segmented_address addr, unsigned size, > + bool write, bool fetch, ulong *linear); > }; > linearize is defined in terms of the other ops; this means that if we get a second user they will have to replicate it. Why not make the current linearize available to users? -- error compiling committee.c: too many arguments to function