All of lore.kernel.org
 help / color / mirror / Atom feed
From: "bibo,mao" <bibo.mao@intel.com>
To: grub-devel@gnu.org
Subject: Re: [patch 2/3] grub efi initrd image memory allocation 4K alignment
Date: Wed, 25 Oct 2006 13:40:12 +0800	[thread overview]
Message-ID: <453EF8BC.4030708@intel.com> (raw)
In-Reply-To: <453DBAAB.6090002@intel.com>

This patch is sent for second time.

thanks
bibo,mao

diff -Nrup grub2.org/loader/i386/efi/linux.c grub2/loader/i386/efi/linux.c
--- grub2.org/loader/i386/efi/linux.c	2006-10-25 12:15:25.000000000 +0800
+++ grub2/loader/i386/efi/linux.c	2006-10-25 11:40:24.000000000 +0800
@@ -587,7 +587,6 @@ grub_rescue_cmd_initrd (int argc, char *
        desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
     {
       if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY
-	  && desc->physical_start >= addr_min
 	  && desc->physical_start + size < addr_max
 	  && desc->num_pages >= initrd_pages)
 	{
@@ -598,7 +597,7 @@ grub_rescue_cmd_initrd (int argc, char *
 	    physical_end = addr_max;
 
 	  if (physical_end > addr)
-	    addr = physical_end - page_align (size);
+	    addr = GRUB_EFI_PAGE_TRUNC (physical_end - page_align (size));
 	}
     }
 

Mao, Bibo wrote:
> Hi,
>   On grub efi platform, initrd image memory allocation start
> address must be 4K alignment, else it will fail to alloc memory
> for initrd image.
>  
> thanks
> bibo,mao
> 
> diff -Nruap grub2.org/loader/i386/efi/linux.c grub2/loader/i386/efi/linux.c
> --- grub2.org/loader/i386/efi/linux.c   2006-10-24 13:24:46.000000000 +0800
> +++ grub2/loader/i386/efi/linux.c       2006-10-24 13:25:35.000000000 +0800
> @@ -587,7 +587,6 @@ grub_rescue_cmd_initrd (int argc, char *
>         desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
>      {
>        if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY
> -         && desc->physical_start >= addr_min
>           && desc->physical_start + size < addr_max
>           && desc->num_pages >= initrd_pages)
>         {
> @@ -598,7 +597,7 @@ grub_rescue_cmd_initrd (int argc, char *
>             physical_end = addr_max;
> 
>           if (physical_end > addr)
> -           addr = physical_end - page_align (size);
> +           addr = PAGE_DOWN(physical_end - page_align (size));
>         }
>      }
> 



      reply	other threads:[~2006-10-25  5:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-24  7:03 [patch 2/3] grub efi initrd image memory allocation 4K alignment bibo,mao
2006-10-25  5:40 ` bibo,mao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=453EF8BC.4030708@intel.com \
    --to=bibo.mao@intel.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.