grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] zero-fill entry before asking BIOS for memory map


From: Robert Millan
Subject: Re: [PATCH] zero-fill entry before asking BIOS for memory map
Date: Sat, 25 Jul 2009 18:24:38 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

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."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]