Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MUk3E-0006yt-Pc for mharc-grub-devel@gnu.org; Sat, 25 Jul 2009 12:24:48 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MUk3C-0006yl-HS for grub-devel@gnu.org; Sat, 25 Jul 2009 12:24:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MUk37-0006uf-Uz for grub-devel@gnu.org; Sat, 25 Jul 2009 12:24:45 -0400 Received: from [199.232.76.173] (port=47845 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUk37-0006uE-MY for grub-devel@gnu.org; Sat, 25 Jul 2009 12:24:41 -0400 Received: from aybabtu.com ([69.60.117.155]:40738) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MUk37-0003w7-AX for grub-devel@gnu.org; Sat, 25 Jul 2009 12:24:41 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtp (Exim 4.69) (envelope-from ) id 1MUix4-00029B-1T for grub-devel@gnu.org; Sat, 25 Jul 2009 17:14:22 +0200 Received: from rmh by thorin with local (Exim 4.69) (envelope-from ) id 1MUk34-0003Hf-V4 for grub-devel@gnu.org; Sat, 25 Jul 2009 18:24:38 +0200 Date: Sat, 25 Jul 2009 18:24:38 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20090725162438.GI12326@thorin> References: <1248384717.2661.109.camel@mj> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1248384717.2661.109.camel@mj> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.18 (2008-05-17) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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: Sat, 25 Jul 2009 16:24:47 -0000 On Thu, Jul 23, 2009 at 05:31:57PM -0400, 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. Something 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) > /* push ADDR */ > pushl %eax > > + /* clear the request area, buggy BIOSes may not clear it */ > + xor %edi, %edi > + movl %edi, 4(%eax) > + movl %edi, 8(%eax) > + movl %edi, 12(%eax) > + movl %edi, 16(%eax) > + movl %edi, 20(%eax) This effectively hardcodes sizeof(entry). Can we avoid it? -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."