Re: [PATCH v2] efi: Config options to assign versions in the PE-COFF header

2017-04-17 Thread Roy Franz (HPE)
On Thu, Apr 13, 2017 at 12:47 AM, Gary Lin  wrote:
> On Thu, Apr 13, 2017 at 08:26:04AM +0100, Ard Biesheuvel wrote:
>> On 13 April 2017 at 04:58, Gary Lin  wrote:
>> > This commit adds the new config options to allow the user to modify the
>> > following fields in the PE-COFF header.
>> >
>> > UINT16 MajorOperatingSystemVersion
>> > UINT16 MinorOperatingSystemVersion
>> > UINT16 MajorImageVersion
>> > UINT16 MinorImageVersion
>> >
>> > Those fields are mainly for the executables or libraries in Windows NT
>> > or higher to specify the minimum supported Windows version and the
>> > version of the image itself.
>> >
>> > Given the fact that those fields are ignored in UEFI, we can safely reuse
>> > those fields for other purposes, e.g. Security Version(*).
>> >
>> > (*) https://github.com/lcp/shim/wiki/Security-Version
>> >
>> > v2 changes:
>> > - Modify the header direct instead of using an external script as
>> >   suggested by Ard Biesheuvel
>> > - Include arm and arm64
>> >
>>
>> Thanks for the update. Could we put the Kconfig changes in
>> drivers/firmware/efi/Kconfig, rather than duplicating them 3 times?
>
> Sure. Will send a v3 to update Kconfig.
>
> Thanks,
>
> Gary Lin

I think it would be nice to have a comment in the code (or maybe help
in the kconfig, or Documentation/efi-stub.txt) that indicates the
expected use of these variables, as the field names and PE/COFF spec
won't help here.

Thanks,
Roy

>
>>
>> > Cc: Russell King 
>> > Cc: Matt Fleming 
>> > Cc: Ard Biesheuvel 
>> > Cc: Catalin Marinas 
>> > Cc: Will Deacon 
>> > Cc: Thomas Gleixner 
>> > Cc: Ingo Molnar 
>> > Cc: "H. Peter Anvin" 
>> > Cc: Joey Lee 
>> > Cc: Vojtech Pavlik 
>> > Signed-off-by: Gary Lin 
>> > ---
>> >  arch/arm/Kconfig  | 24 
>> >  arch/arm/boot/compressed/efi-header.S |  8 
>> >  arch/arm64/Kconfig| 24 
>> >  arch/arm64/kernel/head.S  |  8 
>> >  arch/x86/Kconfig  | 24 
>> >  arch/x86/boot/header.S|  8 
>> >  6 files changed, 84 insertions(+), 12 deletions(-)
>> >
>> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> > index 0d4e71b42c77..4965ad2ccc23 100644
>> > --- a/arch/arm/Kconfig
>> > +++ b/arch/arm/Kconfig
>> > @@ -2090,6 +2090,30 @@ config EFI
>> >   is only useful for kernels that may run on systems that have
>> >   UEFI firmware.
>> >
>> > +config EFI_MAJOR_OS
>> > +   hex "EFI Major OS Version"
>> > +   range 0x0 0x
>> > +   default "0x0"
>> > +   depends on EFI_STUB
>> > +
>> > +config EFI_MINOR_OS
>> > +   hex "EFI Minor OS Version"
>> > +   range 0x0 0x
>> > +   default "0x0"
>> > +   depends on EFI_STUB
>> > +
>> > +config EFI_MAJOR_IMAGE
>> > +   hex "EFI Major Image Version"
>> > +   range 0x0 0x
>> > +   default "0x0"
>> > +   depends on EFI_STUB
>> > +
>> > +config EFI_MINOR_IMAGE
>> > +   hex "EFI Minor Image Version"
>> > +   range 0x0 0x
>> > +   default "0x0"
>> > +   depends on EFI_STUB
>> > +
>> >  endmenu
>> >
>> >  menu "CPU Power Management"
>> > diff --git a/arch/arm/boot/compressed/efi-header.S 
>> > b/arch/arm/boot/compressed/efi-header.S
>> > index 9d5dc4fda3c1..67715472a76f 100644
>> > --- a/arch/arm/boot/compressed/efi-header.S
>> > +++ b/arch/arm/boot/compressed/efi-header.S
>> > @@ -69,10 +69,10 @@ extra_header_fields:
>> > .long   0   @ ImageBase
>> > .long   0x200   @ SectionAlignment
>> > .long   0x200   @ FileAlignment
>> > -   .short  0   @ 
>> > MajorOperatingSystemVersion
>> > -   .short  0   @ 
>> > MinorOperatingSystemVersion
>> > -   .short  0   @ MajorImageVersion
>> > -   .short  0   @ MinorImageVersion
>> > +   .short  CONFIG_EFI_MAJOR_OS @ 
>> > MajorOperatingSystemVersion
>> > +   .short  CONFIG_EFI_MINOR_OS @ 
>> > MinorOperatingSystemVersion
>> > +   .short  CONFIG_EFI_MAJOR_IMAGE  @ MajorImageVersion
>> > +   .short  CONFIG_EFI_MINOR_IMAGE  @ MinorImageVersion
>> > .short  0   @ MajorSubsystemVersion
>> > .short  0   @ MinorSubsystemVersion
>> > .long   0   @ Win32VersionValue
>> > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
>> > index 3741859765cf..c782c422e58c 100644
>> > --- a/arch/arm64/Kconfig
>> > +++ b/arch/arm64/Kconfig
>> > @@ -1033,6 +1033,30 @@ config EFI
>> >   allow the kernel to be booted as an EFI application. This
>> >   is only useful on systems that have UEFI firmware.
>> >
>> > +config EFI_MAJOR_OS
>> > +   hex "EFI Major OS Version"
>> > +   range 

Re: [PATCH v5 0/1] ARM64: ACPI: Update documentation for latest specification version

2016-05-12 Thread Roy Franz (HPE)
On Mon, May 2, 2016 at 1:19 PM, Al Stone  wrote:
> On 04/25/2016 03:21 PM, Al Stone wrote:
>> The ACPI 6.1 specification was recently released at the end of January
>> 2016, but the arm64 kernel documentation for the use of ACPI was written
>> for the 5.1 version of the spec.  There were significant additions to the
>> spec that had not yet been mentioned -- for example, the 6.0 mechanisms
>> added to make it easier to define processors and low power idle states,
>> as well as the 6.1 addition allowing regular interrupts (not just from
>> GPIO) be used to signal ACPI general purpose events.
>>
>> This patch reflects going back through and examining the specs in detail
>> and updating content appropriately.  Whilst there, a few odds and ends of
>> typos were caught as well.  This brings the documentation up to date with
>> ACPI 6.1 for arm64.
>>
>> Changes for v5:
>>-- Miscellaneous typos and corrections (Lorenzo Pieralisi)
>>-- Add linux-acpi@ ML to the distribution list (Alexey Klimov)
>>-- Corrections to CPPC information (Alexey Klimov)
>>-- ACK from Lorenzo Pieralisi
>>-- Updated bibliographic info (Al Stone)
>>
>> Changes for v4:
>>-- Clarify that IORT can sometimes be optional (Jon Masters).
>>-- Remove "Use as needed" descriptions of ACPI objects; they provide
>>   no substantive information and doing so simplifies maintenance of
>>   this document over time.  These have been replaced with a simpler
>>   notice that states that unless otherwise noted, do what the ACPI
>>   specification says is needed.
>>-- Corrected the _OSI object usage recommendation; it described kernel
>>   behavior that does not exist (Al Stone).
>>
>> Changes for v3:
>>-- Clarify use of _LPI/_RDI (Vikas Sajjan)
>>-- Whitespace cleanup as pointed out by checkpatch
>>
>> Changes for v2:
>>-- Clean up white space (Harb Abdulhahmid)
>>-- Clarification on _CCA usage (Harb Abdulhamid)
>>-- IORT moved to required from recommended (Hanjun Guo)
>>-- Clarify IORT description (Hanjun Guo)
>>
>>
>> Al Stone (1):
>>   ARM64: ACPI: Update documentation for latest specification version
>>
>>  Documentation/arm64/acpi_object_usage.txt | 343 
>> --
>>  Documentation/arm64/arm-acpi.txt  |  40 ++--
>>  2 files changed, 213 insertions(+), 170 deletions(-)
>>
>
> Ping?  If there are no further comments, can this be pulled in through
> either the documentation or arm64 tree?
>
> Thanks.

I've read through this - looks good to me.  I think it provides useful
guidance to
reference as we work on getting good ACPI support provided by various platforms
under development.

Reviewed-by: Roy Franz 

>
> --
> ciao,
> al
> ---
> Al Stone
> Software Engineer
> Red Hat, Inc.
> a...@redhat.com
> ---
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html