Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MU6EW-0005ro-4l for mharc-grub-devel@gnu.org; Thu, 23 Jul 2009 17:53:48 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MU6EU-0005rD-Ny for grub-devel@gnu.org; Thu, 23 Jul 2009 17:53:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MU6EP-0005qA-AJ for grub-devel@gnu.org; Thu, 23 Jul 2009 17:53:45 -0400 Received: from [199.232.76.173] (port=43749 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MU6EP-0005q7-0b for grub-devel@gnu.org; Thu, 23 Jul 2009 17:53:41 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:58557) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MU6EO-0001ma-H7 for grub-devel@gnu.org; Thu, 23 Jul 2009 17:53:40 -0400 Received: by bwz5 with SMTP id 5so805100bwz.42 for ; Thu, 23 Jul 2009 14:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=EFa4KIJZk8+Ly92eHKOrlgxlZGDbxWvykmini4SxYL4=; b=e7uuVAZuCG8ttK/TlQwOd1ylB0eKZesActxMvKzATn7C0zH6eFuF6/Ghihw3BRrVE/ XL9TN/Zwh8Bj0KULZrm3uPjxu04n/4CaLrf06dh6x5/EAGp/PBXu21igNNvKhZN9a//W 3dgSMv8F6oegdF6sxlKAGUjeUYl6QYOjAefwA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=I4apgksHCmnlV86U+NN7qy99ymEZzh+QWo5iU4RutNFnsF8ra3KKihoRmwBC81jHjH 54X3hNSPtFFJpYuK4iMO1Beuo/EQSZnp/FTS/iEqxaGENuyANn6Ur1nKjDcm3Ld6Boyg bnvozC7zR0c9NCsSKIebjqLj1lzkmUfSlEZeY= MIME-Version: 1.0 Received: by 10.204.118.138 with SMTP id v10mr2495265bkq.40.1248386019317; Thu, 23 Jul 2009 14:53:39 -0700 (PDT) In-Reply-To: <1248384717.2661.109.camel@mj> References: <1248384717.2661.109.camel@mj> Date: Thu, 23 Jul 2009 23:53:39 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] zero-fill entry before asking BIOS for memory map X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2009 21:53:46 -0000 On Thu, Jul 23, 2009 at 11:31 PM, Pavel Roskin wrote: > On Thu, 2009-07-23 at 11:38 +0200, Vladimir 'phcoder' Serbinenko wrote: >> Hello. According to xen some BIOSes update only lower 32-bit in mmap >> entries. To workaround this and not get high values in memory map >> zero-fill before calling BIOS > > I think the fix belongs to grub_get_mmap_entry(), not to all of its > callers. I'm ok with this too. The main reason for me to decide for one or another would be core.img size but I haven't checked yet which one is smaller. Actually asm part is kept to minimum and grub_machine_mmap_iterate is the C wrapper and I followed this idea. But as I said your solution is fine for me too. >=A0Something like this: > > diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S > index be258fb..5468ba8 100644 > --- a/kern/i386/pc/startup.S > +++ b/kern/i386/pc/startup.S > @@ -997,6 +997,14 @@ FUNCTION(grub_get_mmap_entry) > =A0 =A0 =A0 =A0/* push ADDR */ > =A0 =A0 =A0 =A0pushl =A0 %eax > > + =A0 =A0 =A0 /* clear the request area, buggy BIOSes may not clear it */ > + =A0 =A0 =A0 xor =A0 =A0 %edi, %edi > + =A0 =A0 =A0 movl =A0 =A0%edi, 4(%eax) > + =A0 =A0 =A0 movl =A0 =A0%edi, 8(%eax) > + =A0 =A0 =A0 movl =A0 =A0%edi, 12(%eax) > + =A0 =A0 =A0 movl =A0 =A0%edi, 16(%eax) > + =A0 =A0 =A0 movl =A0 =A0%edi, 20(%eax) > + > =A0 =A0 =A0 =A0/* place address (+4) in ES:DI */ > =A0 =A0 =A0 =A0addl =A0 =A0$4, %eax > =A0 =A0 =A0 =A0movl =A0 =A0%eax, %edi For me this coode looks weird because of using edi as zero register and eax as pointer. Could we perhaps move this code down and use eax as 0 and edi as pointer? > > I don't know whether it would interfere with the Apple CC workaround. > It would be great if we get rid of it, perhaps by using labels starting > with "L_". > > -- > Regards, > Pavel Roskin > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git