From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] Fix up pxe boot Date: Tue, 09 Sep 2008 17:17:32 +0300 Message-ID: <48C6857C.9010404@qumranet.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Glauber Costa , qemu-devel@nongnu.org, kvm@vger.kernel.org, aliguori@us.ibm.com, apevec@redhat.com, chrisw@sous-sol.org, Eduardo Habkost To: Glauber Costa Return-path: Received: from il.qumranet.com ([212.179.150.194]:48700 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752387AbYIIORd (ORCPT ); Tue, 9 Sep 2008 10:17:33 -0400 In-Reply-To: <20080908153801.GA3724@poweredge.glommer> Sender: kvm-owner@vger.kernel.org List-ID: 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