diff mbox

[16/16] Add config EFI_STUB for ARM to Kconfig

Message ID 1376090777-20090-17-git-send-email-roy.franz@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Roy Franz Aug. 9, 2013, 11:26 p.m. UTC
Signed-off-by: Roy Franz <roy.franz@linaro.org>
---
 arch/arm/Kconfig |   11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Dave Martin Aug. 13, 2013, 1:18 p.m. UTC | #1
On Fri, Aug 09, 2013 at 04:26:17PM -0700, Roy Franz wrote:
> Signed-off-by: Roy Franz <roy.franz@linaro.org>
> ---
>  arch/arm/Kconfig |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 43594d5..8607d03 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1805,6 +1805,17 @@ config UACCESS_WITH_MEMCPY
>  	  However, if the CPU data cache is using a write-allocate mode,
>  	  this option is unlikely to provide any performance gain.
>  
> +config EFI_STUB
> +	bool "EFI stub support"
> +	depends on EFI

&& !CPU_BIG_ENDIAN, in case you didn't get around to that.

Sooner or later, someone may try to fix that, so there should be a
comment somewhere explaining what is broken for BE.

Either in efi-stub.c or in the commit message accompanying this patch, I
guess.

Cheers
---Dave

> +	---help---
> +	  This kernel feature allows a zImage to be loaded directly
> +	  by EFI firmware without the use of a bootloader.  A PE/COFF
> +	  header is added to the zImage in a way that makes the binary
> +	  both a Linux zImage and an PE/COFF executable that can be
> +	  executed directly by EFI firmware.
> +	  See Documentation/efi-stub.txt for more information.
> +
>  config SECCOMP
>  	bool
>  	prompt "Enable seccomp to safely compute untrusted bytecode"
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Roy Franz Aug. 13, 2013, 5:37 p.m. UTC | #2
On Tue, Aug 13, 2013 at 6:18 AM, Dave Martin <Dave.Martin@arm.com> wrote:
> On Fri, Aug 09, 2013 at 04:26:17PM -0700, Roy Franz wrote:
>> Signed-off-by: Roy Franz <roy.franz@linaro.org>
>> ---
>>  arch/arm/Kconfig |   11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> index 43594d5..8607d03 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -1805,6 +1805,17 @@ config UACCESS_WITH_MEMCPY
>>         However, if the CPU data cache is using a write-allocate mode,
>>         this option is unlikely to provide any performance gain.
>>
>> +config EFI_STUB
>> +     bool "EFI stub support"
>> +     depends on EFI
>
> && !CPU_BIG_ENDIAN, in case you didn't get around to that.
>
> Sooner or later, someone may try to fix that, so there should be a
> comment somewhere explaining what is broken for BE.
>
> Either in efi-stub.c or in the commit message accompanying this patch, I
> guess.
>
EFI will be !CPU_BIG_ENDIAN, so we will get the dependency
transitively through EFI.
That said, I think it may be better to have both be explicitly
!CPU_BIG_ENDIAN, as even
though the underlying reasons are the same (EFI services calls being
little endian), both
the stub and runtime services would need to be fixed to enable the
stub to run in BE mode.
I'll make this explicit in the stub Kconfig, and add a comment by the
PE/COFF magic number
regarding the LE requirement.

Thanks,
Roy




> Cheers
> ---Dave
>
>> +     ---help---
>> +       This kernel feature allows a zImage to be loaded directly
>> +       by EFI firmware without the use of a bootloader.  A PE/COFF
>> +       header is added to the zImage in a way that makes the binary
>> +       both a Linux zImage and an PE/COFF executable that can be
>> +       executed directly by EFI firmware.
>> +       See Documentation/efi-stub.txt for more information.
>> +
>>  config SECCOMP
>>       bool
>>       prompt "Enable seccomp to safely compute untrusted bytecode"
>> --
>> 1.7.10.4
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Grant Likely Aug. 30, 2013, 11:17 a.m. UTC | #3
On Tue, 13 Aug 2013 10:37:13 -0700, Roy Franz <roy.franz@linaro.org> wrote:
> On Tue, Aug 13, 2013 at 6:18 AM, Dave Martin <Dave.Martin@arm.com> wrote:
> > On Fri, Aug 09, 2013 at 04:26:17PM -0700, Roy Franz wrote:
> >> Signed-off-by: Roy Franz <roy.franz@linaro.org>
> >> ---
> >>  arch/arm/Kconfig |   11 +++++++++++
> >>  1 file changed, 11 insertions(+)
> >>
> >> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> >> index 43594d5..8607d03 100644
> >> --- a/arch/arm/Kconfig
> >> +++ b/arch/arm/Kconfig
> >> @@ -1805,6 +1805,17 @@ config UACCESS_WITH_MEMCPY
> >>         However, if the CPU data cache is using a write-allocate mode,
> >>         this option is unlikely to provide any performance gain.
> >>
> >> +config EFI_STUB
> >> +     bool "EFI stub support"
> >> +     depends on EFI
> >
> > && !CPU_BIG_ENDIAN, in case you didn't get around to that.
> >
> > Sooner or later, someone may try to fix that, so there should be a
> > comment somewhere explaining what is broken for BE.
> >
> > Either in efi-stub.c or in the commit message accompanying this patch, I
> > guess.
> >
> EFI will be !CPU_BIG_ENDIAN, so we will get the dependency
> transitively through EFI.
> That said, I think it may be better to have both be explicitly
> !CPU_BIG_ENDIAN, as even
> though the underlying reasons are the same (EFI services calls being
> little endian), both
> the stub and runtime services would need to be fixed to enable the
> stub to run in BE mode.
> I'll make this explicit in the stub Kconfig, and add a comment by the
> PE/COFF magic number
> regarding the LE requirement.

Actually, not true! Steve McIntyre is currently doing some of the BE
porting work on TC2 running UEFI. Eventually he will need this.

g.
diff mbox

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 43594d5..8607d03 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1805,6 +1805,17 @@  config UACCESS_WITH_MEMCPY
 	  However, if the CPU data cache is using a write-allocate mode,
 	  this option is unlikely to provide any performance gain.
 
+config EFI_STUB
+	bool "EFI stub support"
+	depends on EFI
+	---help---
+	  This kernel feature allows a zImage to be loaded directly
+	  by EFI firmware without the use of a bootloader.  A PE/COFF
+	  header is added to the zImage in a way that makes the binary
+	  both a Linux zImage and an PE/COFF executable that can be
+	  executed directly by EFI firmware.
+	  See Documentation/efi-stub.txt for more information.
+
 config SECCOMP
 	bool
 	prompt "Enable seccomp to safely compute untrusted bytecode"