From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1GcbUy-0006V7-12 for mharc-grub-devel@gnu.org; Wed, 25 Oct 2006 01:40:20 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GcbUv-0006TX-NI for grub-devel@gnu.org; Wed, 25 Oct 2006 01:40:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GcbUv-0006T7-AD for grub-devel@gnu.org; Wed, 25 Oct 2006 01:40:17 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GcbUv-0006Sv-5l for grub-devel@gnu.org; Wed, 25 Oct 2006 01:40:17 -0400 Received: from [192.55.52.88] (helo=mga01.intel.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GcbUv-0002Ft-1Y for grub-devel@gnu.org; Wed, 25 Oct 2006 01:40:17 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by mga01.intel.com with ESMTP; 24 Oct 2006 22:40:15 -0700 Received: from bmao-mobl.ccr.corp.intel.com (HELO [10.239.22.151]) ([10.239.22.151]) by fmsmga002.fm.intel.com with ESMTP; 24 Oct 2006 22:40:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.09,354,1157353200"; d="scan'208"; a="7415355:sNHT20352708" Message-ID: <453EF8BC.4030708@intel.com> Date: Wed, 25 Oct 2006 13:40:12 +0800 From: "bibo,mao" User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: grub-devel@gnu.org References: <453DBAAB.6090002@intel.com> In-Reply-To: <453DBAAB.6090002@intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [patch 2/3] grub efi initrd image memory allocation 4K alignment 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: Wed, 25 Oct 2006 05:40:18 -0000 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)); > } > } >