From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator Date: Mon, 12 Jul 2010 17:49:37 +0300 Message-ID: <4C3B2B81.6070109@redhat.com> References: <1278888970-2936-1-git-send-email-m.gamal005@gmail.com> <4C3AB59B.60705@redhat.com> <4C3B14E2.8050404@redhat.com> <4C3B1DCE.4050000@redhat.com> <20100712144103.GA17853@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Mohammed Gamal , KVM list To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:48416 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755913Ab0GLOtk (ORCPT ); Mon, 12 Jul 2010 10:49:40 -0400 In-Reply-To: <20100712144103.GA17853@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 07/12/2010 05:41 PM, Gleb Natapov wrote: > >> A good way to do this is to add a segment variable to 'struct >> operand', and doing all the base adjustment at the end (instead of >> up front as we do now). That means we'll have the minimum number of >> places to add checks to. >> > ->read_emulated(), ->write_emulated() get liner address as a parameter > and know nothing about 'struct operand'. Luckily emulator.c has only one > call for each one of them, so segment checking can be done there just > before call to the functions. > > I'd prefer a new helper (with an additional parameter) so that if a new call is added, we don't need to change anything. -- error compiling committee.c: too many arguments to function