linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Matt Fleming <matt-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH V2] efi_high_alloc: use EFI_ALLOCATE_MAX_ADDRESS
Date: Mon, 25 Aug 2014 16:33:54 +0200	[thread overview]
Message-ID: <53FB4952.1090104@redhat.com> (raw)
In-Reply-To: <20140825130724.GT29733-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>

On 25.08.2014 15:07, Matt Fleming wrote:
> On Mon, 25 Aug, at 01:55:32PM, harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org wrote:
>> From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>>
>> On my Lenovo T420s with 4GB memory, efi_high_alloc() was checking the
>> following memory regions:
>>
>> 0x0000000000100000 - 0x0000000020000000
>> 0x0000000020200000 - 0x0000000040000000
>> 0x0000000040200000 - 0x00000000d2c02000
>> 0x00000000d6e9f000 - 0x000000011e600000
>>
>> and decided to allocate 2649 pages at address 0x11dba7000.
>> ...
>> [    0.000000] efi: mem53: type=2, attr=0xf, range=[0x000000011dba7000-0x000000011e600000) (10MB)
>> ...
>> [    0.000000] RAMDISK: [mem 0x11dba7000-0x11e5fffff]
>> ...
>> [    0.154933] Unpacking initramfs...
>> [    0.160990] Initramfs unpacking failed: junk in compressed archive
>> [    0.163436] Freeing initrd memory: 10596K (ffff88011dba7000 - ffff88011e600000)
>> ...
>>
>> Nevertheless, unpacking of the initramfs later on failed.
>> This is maybe caused by my buggy EFI BIOS and
>> commit 4bf7111f50167133a71c23530ca852a41355e739,
>> which enables loading the initramfs above 4G addresses.
>>
>> With this patch efi_high_alloc() now uses EFI_ALLOCATE_MAX_ADDRESS,
>> which should do the same as before, but use the EFI logic to select the high memory range.
>  
> No, that's not correct. Your patch changes the semantics of
> efi_high_alloc(). The original version allocates from the top of memory
> down, so you always get the highest aligned address, that is no higher
> than 'max_addr'.
> 
> Your version allocates some address that isn't above 'max_addr', but it
> needn't necessarily be the highest possible address. The following is
> taken from the AllocatePages() documentation in the UEFI spec,
> 
>   "Allocation requests of Type AllocateMaxAddress allocate any available
>    range of pages whose uppermost address is less than or equal to the
>    address pointed to by Memory on input."
> 
> Note the part about allocating *any* available range.
> 
> Furthermore, there are more callers of efi_high_alloc() than the initrd
> loading case, and you've changed their behaviour with this patch.
> 
> I get where you're coming from, but this isn't the best way to solve
> this problem, sorry. NAK.
> 

So is that ok, if other callers of efi_high_alloc() get an address > 4GB?

Will the buggy EFI implementation work with the usage of the other caller's
allocated memory? Or will they run into the same issues as the initramfs loader?

  parent reply	other threads:[~2014-08-25 14:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1408715303-2215-1-git-send-email-harald@redhat.com>
2014-08-25 10:34 ` [PATCH] efi_high_alloc: use EFI_ALLOCATE_MAX_ADDRESS Matt Fleming
     [not found]   ` <20140825103447.GP29733-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-08-25 11:10     ` Harald Hoyer
     [not found] ` <1408715303-2215-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-08-25 11:55   ` [PATCH V2] " harald-H+wXaHxf7aLQT0dZR+AlfA
     [not found]     ` <1408967732-2381-1-git-send-email-harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-08-25 13:07       ` Matt Fleming
     [not found]         ` <20140825130724.GT29733-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-08-25 14:33           ` Harald Hoyer [this message]
2014-08-27 10:30             ` Matt Fleming

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=53FB4952.1090104@redhat.com \
    --to=harald-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matt-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).