From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kd42C-0002C8-Hq for qemu-devel@nongnu.org; Tue, 09 Sep 2008 10:17:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kd42B-0002Bw-SL for qemu-devel@nongnu.org; Tue, 09 Sep 2008 10:17:36 -0400 Received: from [199.232.76.173] (port=56109 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kd42B-0002Bt-Pc for qemu-devel@nongnu.org; Tue, 09 Sep 2008 10:17:35 -0400 Received: from il.qumranet.com ([212.179.150.194]:48704) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kd42B-0007qx-Kj for qemu-devel@nongnu.org; Tue, 09 Sep 2008 10:17:35 -0400 Message-ID: <48C6857C.9010404@qumranet.com> Date: Tue, 09 Sep 2008 17:17:32 +0300 From: Avi Kivity MIME-Version: 1.0 References: <1220303503-19413-1-git-send-email-glommer@redhat.com> <48BCFBB1.4090109@qumranet.com> <5d6222a80809020407l68f7ab87i6d2520c57c7ddeb3@mail.gmail.com> <48BD59D7.7000702@qumranet.com> <20080903192700.GA8000@poweredge.glommer> <48C377BF.1020700@qumranet.com> <20080908153801.GA3724@poweredge.glommer> In-Reply-To: <20080908153801.GA3724@poweredge.glommer> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] Fix up pxe boot Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Glauber Costa Cc: aliguori@us.ibm.com, kvm@vger.kernel.org, apevec@redhat.com, Glauber Costa , qemu-devel@nongnu.org, chrisw@sous-sol.org, Eduardo Habkost Glauber Costa wrote: > On Sun, Sep 07, 2008 at 09:42:07AM +0300, Avi Kivity wrote: > >> Glauber Costa wrote: >> >>> After a second look, here's what it seems to me: >>> >>> It's not in a generic place, such as ldl, because in general, we may want to grab >>> a 32-bit value from a 64-bit address. This is perfectly valid. >>> >>> It's a specifity that the pop instruction, when not in long mode (manual says that in 64-bit mode >>> no 32-bit operand is valid, but then again, qemu should use the POPQ macro), that ssp:sp may overflow, >>> but we don't want it. >>> >>> It would be possible to do something more generic if we had a segment_to_linear() function, that returned >>> the linear address, but we don't. >>> >>> Does it make more sense to you? >>> >>> >> Yes. >> >> I guess tcg code is mostly safe since it generates 32-bit additions for >> segment bases, so this is limited to the places you identified. And a >> helper to add segment bases would be helpful. >> >> -- >> error compiling committee.c: too many arguments to function >> >> > > what do you think of the attached version? > Looks fine to me. One can thing of a cleverer helper (that receives the segment number and adds its base to the offset), but there's not reason to do this all at one. -- error compiling committee.c: too many arguments to function