linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] efi: Request desired alignment via the PE/COFF headers
@ 2014-07-09 22:44 Michael Brown
       [not found] ` <1404945890-10754-1-git-send-email-mbrown-OViyBiuKJBuK421+ScFKDQ@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Brown @ 2014-07-09 22:44 UTC (permalink / raw)
  To: linux-efi-u79uwXL29TY76Z2rM5mHXA; +Cc: Michael Brown

Signed-off-by: Michael Brown <mbrown-OViyBiuKJBuK421+ScFKDQ@public.gmane.org>
---
 arch/x86/boot/header.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
index 7a6d43a..16ef025 100644
--- a/arch/x86/boot/header.S
+++ b/arch/x86/boot/header.S
@@ -154,7 +154,7 @@ extra_header_fields:
 #else
 	.quad	0				# ImageBase
 #endif
-	.long	0x20				# SectionAlignment
+	.long	CONFIG_PHYSICAL_ALIGN		# SectionAlignment
 	.long	0x20				# FileAlignment
 	.word	0				# MajorOperatingSystemVersion
 	.word	0				# MinorOperatingSystemVersion
-- 
1.8.4.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] efi: Request desired alignment via the PE/COFF headers
       [not found] ` <1404945890-10754-1-git-send-email-mbrown-OViyBiuKJBuK421+ScFKDQ@public.gmane.org>
@ 2014-07-10 12:16   ` Matt Fleming
  2014-07-12  0:31   ` H. Peter Anvin
  1 sibling, 0 replies; 8+ messages in thread
From: Matt Fleming @ 2014-07-10 12:16 UTC (permalink / raw)
  To: Michael Brown; +Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA

On Wed, 09 Jul, at 11:44:50PM, Michael Brown wrote:
> Signed-off-by: Michael Brown <mbrown-OViyBiuKJBuK421+ScFKDQ@public.gmane.org>
> ---
>  arch/x86/boot/header.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
> index 7a6d43a..16ef025 100644
> --- a/arch/x86/boot/header.S
> +++ b/arch/x86/boot/header.S
> @@ -154,7 +154,7 @@ extra_header_fields:
>  #else
>  	.quad	0				# ImageBase
>  #endif
> -	.long	0x20				# SectionAlignment
> +	.long	CONFIG_PHYSICAL_ALIGN		# SectionAlignment
>  	.long	0x20				# FileAlignment
>  	.word	0				# MajorOperatingSystemVersion
>  	.word	0				# MinorOperatingSystemVersion

Could you expand on the commit log? It's not clear why this is
desirable, especially for anyone that hasn't read the previous thread on
the new EFI stub .bss header.

That actual change looks fine though.

-- 
Matt Fleming, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] efi: Request desired alignment via the PE/COFF headers
       [not found] ` <1404945890-10754-1-git-send-email-mbrown-OViyBiuKJBuK421+ScFKDQ@public.gmane.org>
  2014-07-10 12:16   ` Matt Fleming
@ 2014-07-12  0:31   ` H. Peter Anvin
       [not found]     ` <53C081DC.5080605-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 8+ messages in thread
From: H. Peter Anvin @ 2014-07-12  0:31 UTC (permalink / raw)
  To: Michael Brown, linux-efi-u79uwXL29TY76Z2rM5mHXA

On 07/09/2014 03:44 PM, Michael Brown wrote:
> Signed-off-by: Michael Brown <mbrown-OViyBiuKJBuK421+ScFKDQ@public.gmane.org>
> ---
>  arch/x86/boot/header.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
> index 7a6d43a..16ef025 100644
> --- a/arch/x86/boot/header.S
> +++ b/arch/x86/boot/header.S
> @@ -154,7 +154,7 @@ extra_header_fields:
>  #else
>  	.quad	0				# ImageBase
>  #endif
> -	.long	0x20				# SectionAlignment
> +	.long	CONFIG_PHYSICAL_ALIGN		# SectionAlignment
>  	.long	0x20				# FileAlignment
>  	.word	0				# MajorOperatingSystemVersion
>  	.word	0				# MinorOperatingSystemVersion
> 

Are large alignments (16 MiB!) actually allowed in PE/COFF?

	-hpa

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] efi: Request desired alignment via the PE/COFF headers
       [not found]     ` <53C081DC.5080605-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
@ 2014-07-12 13:34       ` Michael Brown
       [not found]         ` <53C13962.1000309-OViyBiuKJBuK421+ScFKDQ@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Brown @ 2014-07-12 13:34 UTC (permalink / raw)
  To: H. Peter Anvin, linux-efi-u79uwXL29TY76Z2rM5mHXA

On 12/07/14 01:31, H. Peter Anvin wrote:
>> --- a/arch/x86/boot/header.S
>> +++ b/arch/x86/boot/header.S
>> @@ -154,7 +154,7 @@ extra_header_fields:
>>   #else
>>   	.quad	0				# ImageBase
>>   #endif
>> -	.long	0x20				# SectionAlignment
>> +	.long	CONFIG_PHYSICAL_ALIGN		# SectionAlignment
>>   	.long	0x20				# FileAlignment
>>   	.word	0				# MajorOperatingSystemVersion
>>   	.word	0				# MinorOperatingSystemVersion
>
> Are large alignments (16 MiB!) actually allowed in PE/COFF?

I tested it: the EDK2 code seems perfectly happy to load images with 
that alignment.

Michael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] efi: Request desired alignment via the PE/COFF headers
       [not found]         ` <53C13962.1000309-OViyBiuKJBuK421+ScFKDQ@public.gmane.org>
@ 2014-07-14 12:08           ` Matt Fleming
       [not found]             ` <20140714120832.GG5952-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Matt Fleming @ 2014-07-14 12:08 UTC (permalink / raw)
  To: Michael Brown; +Cc: H. Peter Anvin, linux-efi-u79uwXL29TY76Z2rM5mHXA

On Sat, 12 Jul, at 02:34:26PM, Michael Brown wrote:
> On 12/07/14 01:31, H. Peter Anvin wrote:
> >>--- a/arch/x86/boot/header.S
> >>+++ b/arch/x86/boot/header.S
> >>@@ -154,7 +154,7 @@ extra_header_fields:
> >>  #else
> >>  	.quad	0				# ImageBase
> >>  #endif
> >>-	.long	0x20				# SectionAlignment
> >>+	.long	CONFIG_PHYSICAL_ALIGN		# SectionAlignment
> >>  	.long	0x20				# FileAlignment
> >>  	.word	0				# MajorOperatingSystemVersion
> >>  	.word	0				# MinorOperatingSystemVersion
> >
> >Are large alignments (16 MiB!) actually allowed in PE/COFF?
> 
> I tested it: the EDK2 code seems perfectly happy to load images with
> that alignment.

Right, I also quickly scanned the PE/COFF spec and didn't see anything
to suggest that such a large alignment would be allowed for
SectionAlignment (FileAlignment is another matter).

-- 
Matt Fleming, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] efi: Request desired alignment via the PE/COFF headers
       [not found]             ` <20140714120832.GG5952-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
@ 2014-07-14 12:12               ` Matt Fleming
       [not found]                 ` <20140714121248.GH5952-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Matt Fleming @ 2014-07-14 12:12 UTC (permalink / raw)
  To: Michael Brown; +Cc: H. Peter Anvin, linux-efi-u79uwXL29TY76Z2rM5mHXA

On Mon, 14 Jul, at 01:08:32PM, Matt Fleming wrote:
> On Sat, 12 Jul, at 02:34:26PM, Michael Brown wrote:
> > On 12/07/14 01:31, H. Peter Anvin wrote:
> > >>--- a/arch/x86/boot/header.S
> > >>+++ b/arch/x86/boot/header.S
> > >>@@ -154,7 +154,7 @@ extra_header_fields:
> > >>  #else
> > >>  	.quad	0				# ImageBase
> > >>  #endif
> > >>-	.long	0x20				# SectionAlignment
> > >>+	.long	CONFIG_PHYSICAL_ALIGN		# SectionAlignment
> > >>  	.long	0x20				# FileAlignment
> > >>  	.word	0				# MajorOperatingSystemVersion
> > >>  	.word	0				# MinorOperatingSystemVersion
> > >
> > >Are large alignments (16 MiB!) actually allowed in PE/COFF?
> > 
> > I tested it: the EDK2 code seems perfectly happy to load images with
> > that alignment.
> 
> Right, I also quickly scanned the PE/COFF spec and didn't see anything
> to suggest that such a large alignment would be allowed for
> SectionAlignment (FileAlignment is another matter).

Urgh...

I didn't see anything in the spec saying a 16MB alignment would *not* be
allowed.

-- 
Matt Fleming, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] efi: Request desired alignment via the PE/COFF headers
       [not found]                 ` <20140714121248.GH5952-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
@ 2014-07-14 20:56                   ` H. Peter Anvin
       [not found]                     ` <53C443E9.2030305-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: H. Peter Anvin @ 2014-07-14 20:56 UTC (permalink / raw)
  To: Matt Fleming, Michael Brown; +Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA

On 07/14/2014 05:12 AM, Matt Fleming wrote:
> On Mon, 14 Jul, at 01:08:32PM, Matt Fleming wrote:
>> On Sat, 12 Jul, at 02:34:26PM, Michael Brown wrote:
>>> On 12/07/14 01:31, H. Peter Anvin wrote:
>>>>> --- a/arch/x86/boot/header.S
>>>>> +++ b/arch/x86/boot/header.S
>>>>> @@ -154,7 +154,7 @@ extra_header_fields:
>>>>>  #else
>>>>>  	.quad	0				# ImageBase
>>>>>  #endif
>>>>> -	.long	0x20				# SectionAlignment
>>>>> +	.long	CONFIG_PHYSICAL_ALIGN		# SectionAlignment
>>>>>  	.long	0x20				# FileAlignment
>>>>>  	.word	0				# MajorOperatingSystemVersion
>>>>>  	.word	0				# MinorOperatingSystemVersion
>>>>
>>>> Are large alignments (16 MiB!) actually allowed in PE/COFF?
>>>
>>> I tested it: the EDK2 code seems perfectly happy to load images with
>>> that alignment.
>>
>> Right, I also quickly scanned the PE/COFF spec and didn't see anything
>> to suggest that such a large alignment would be allowed for
>> SectionAlignment (FileAlignment is another matter).
> 
> Urgh...
> 
> I didn't see anything in the spec saying a 16MB alignment would *not* be
> allowed.
> 

That's good.  So will you apply it, or should I?

	-hpa

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] efi: Request desired alignment via the PE/COFF headers
       [not found]                     ` <53C443E9.2030305-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
@ 2014-07-15  8:38                       ` Matt Fleming
  0 siblings, 0 replies; 8+ messages in thread
From: Matt Fleming @ 2014-07-15  8:38 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Michael Brown, linux-efi-u79uwXL29TY76Z2rM5mHXA

On Mon, 14 Jul, at 01:56:09PM, H. Peter Anvin wrote:
> 
> That's good.  So will you apply it, or should I?

I've queued it up for v3.17.

-- 
Matt Fleming, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-07-15  8:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-09 22:44 [PATCH] efi: Request desired alignment via the PE/COFF headers Michael Brown
     [not found] ` <1404945890-10754-1-git-send-email-mbrown-OViyBiuKJBuK421+ScFKDQ@public.gmane.org>
2014-07-10 12:16   ` Matt Fleming
2014-07-12  0:31   ` H. Peter Anvin
     [not found]     ` <53C081DC.5080605-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2014-07-12 13:34       ` Michael Brown
     [not found]         ` <53C13962.1000309-OViyBiuKJBuK421+ScFKDQ@public.gmane.org>
2014-07-14 12:08           ` Matt Fleming
     [not found]             ` <20140714120832.GG5952-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-07-14 12:12               ` Matt Fleming
     [not found]                 ` <20140714121248.GH5952-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-07-14 20:56                   ` H. Peter Anvin
     [not found]                     ` <53C443E9.2030305-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2014-07-15  8:38                       ` Matt Fleming

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