efi/libstub: Introduce symbolic constants for the stub major/minor version
authorArd Biesheuvel <ardb@kernel.org>
Thu, 20 Feb 2020 10:06:00 +0000 (11:06 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Sun, 23 Feb 2020 20:59:42 +0000 (21:59 +0100)
Now that we have added new ways to load the initrd or the mixed mode
kernel, we will also need a way to tell the loader about this. Add
symbolic constants for the PE/COFF major/minor version numbers (which
fortunately have always been 0x0 for all architectures), so that we
can bump them later to document the capabilities of the stub.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
arch/arm/boot/compressed/efi-header.S
arch/arm64/kernel/efi-header.S
arch/x86/boot/header.S
include/linux/pe.h

index e38fbda..62286da 100644 (file)
@@ -70,8 +70,8 @@ extra_header_fields:
                .long   SZ_512                          @ FileAlignment
                .short  0                               @ MajorOsVersion
                .short  0                               @ MinorOsVersion
-               .short  0                               @ MajorImageVersion
-               .short  0                               @ MinorImageVersion
+               .short  LINUX_EFISTUB_MAJOR_VERSION     @ MajorImageVersion
+               .short  LINUX_EFISTUB_MINOR_VERSION     @ MinorImageVersion
                .short  0                               @ MajorSubsystemVersion
                .short  0                               @ MinorSubsystemVersion
                .long   0                               @ Win32VersionValue
index 40c704c..914999c 100644 (file)
@@ -36,8 +36,8 @@ extra_header_fields:
        .long   PECOFF_FILE_ALIGNMENT                   // FileAlignment
        .short  0                                       // MajorOperatingSystemVersion
        .short  0                                       // MinorOperatingSystemVersion
-       .short  0                                       // MajorImageVersion
-       .short  0                                       // MinorImageVersion
+       .short  LINUX_EFISTUB_MAJOR_VERSION             // MajorImageVersion
+       .short  LINUX_EFISTUB_MINOR_VERSION             // MinorImageVersion
        .short  0                                       // MajorSubsystemVersion
        .short  0                                       // MinorSubsystemVersion
        .long   0                                       // Win32VersionValue
index f65661a..4ee25e2 100644 (file)
@@ -147,8 +147,8 @@ extra_header_fields:
        .long   0x20                            # FileAlignment
        .word   0                               # MajorOperatingSystemVersion
        .word   0                               # MinorOperatingSystemVersion
-       .word   0                               # MajorImageVersion
-       .word   0                               # MinorImageVersion
+       .word   LINUX_EFISTUB_MAJOR_VERSION     # MajorImageVersion
+       .word   LINUX_EFISTUB_MINOR_VERSION     # MinorImageVersion
        .word   0                               # MajorSubsystemVersion
        .word   0                               # MinorSubsystemVersion
        .long   0                               # Win32VersionValue
index c86bd3a..e0869f3 100644 (file)
@@ -10,6 +10,9 @@
 
 #include <linux/types.h>
 
+#define LINUX_EFISTUB_MAJOR_VERSION            0x0
+#define LINUX_EFISTUB_MINOR_VERSION            0x0
+
 #define MZ_MAGIC       0x5a4d  /* "MZ" */
 
 #define PE_MAGIC               0x00004550      /* "PE\0\0" */