From 17ad93ee402f79607453fddaddcd17ae8b2e8d42 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Sat, 11 May 2019 16:16:56 +0000 Subject: kexec-tools: refresh patches with devtool * to make it easier to rebase Signed-off-by: Martin Jansa Signed-off-by: Richard Purdie --- .../kexec-tools/0001-Disable-PIE-during-link.patch | 31 -------- ...0001-powerpc-change-the-memory-size-limit.patch | 35 ++++++++ .../0001-purgatory-Pass-r-directly-to-linker.patch | 32 -------- ...0002-powerpc-change-the-memory-size-limit.patch | 35 -------- .../0002-purgatory-Pass-r-directly-to-linker.patch | 29 +++++++ ...-ARM-Fix-add_buffer_phys_virt-align-issue.patch | 49 ++++++++++++ ...support-to-build-kexec-tools-with-x32-ABI.patch | 93 ++++++++++++++++++++++ .../kexec-tools/0005-Disable-PIE-during-link.patch | 28 +++++++ ...-ARM-Fix-add_buffer_phys_virt-align-issue.patch | 52 ------------ .../kexec/kexec-tools/kexec-x32.patch | 88 -------------------- meta/recipes-kernel/kexec/kexec-tools_2.0.19.bb | 18 ++--- 11 files changed, 243 insertions(+), 247 deletions(-) delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-powerpc-change-the-memory-size-limit.patch delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0002-purgatory-Pass-r-directly-to-linker.patch create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0004-x86_64-Add-support-to-build-kexec-tools-with-x32-ABI.patch create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0005-Disable-PIE-during-link.patch delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch delete mode 100644 meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch (limited to 'meta/recipes-kernel/kexec') diff --git a/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch deleted file mode 100644 index 3f2f85e337..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/0001-Disable-PIE-during-link.patch +++ /dev/null @@ -1,31 +0,0 @@ -From ea7be6d71b85880e8e8a2c8a4f49a696c5f31ae4 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sat, 10 Jun 2017 11:18:49 -0700 -Subject: [PATCH] Disable PIE during link - -We have explcitly disabled PIE during compile so we -just need to match it with linker flags - -Upstream-Status: Pending - -Signed-off-by: Khem Raj ---- - purgatory/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/purgatory/Makefile b/purgatory/Makefile -index 564bdb7..a08e41f 100644 ---- a/purgatory/Makefile -+++ b/purgatory/Makefile -@@ -59,7 +59,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ - -Iinclude \ - -I$(shell $(CC) -print-file-name=include) - $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\ -- -Wl,--no-undefined -nostartfiles -nostdlib \ -+ -Wl,--no-undefined -no-pie -nostartfiles -nostdlib \ - -nodefaultlibs -e purgatory_start -Wl,-r \ - -Wl,-Map=$(PURGATORY_MAP) - --- -2.13.1 - diff --git a/meta/recipes-kernel/kexec/kexec-tools/0001-powerpc-change-the-memory-size-limit.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-powerpc-change-the-memory-size-limit.patch new file mode 100644 index 0000000000..029650f35c --- /dev/null +++ b/meta/recipes-kernel/kexec/kexec-tools/0001-powerpc-change-the-memory-size-limit.patch @@ -0,0 +1,35 @@ +From 211cae4b6a02a4d9d37bfcd76f3702696e095fc3 Mon Sep 17 00:00:00 2001 +From: Quanyang Wang +Date: Tue, 16 Jun 2015 12:59:57 +0800 +Subject: [PATCH] powerpc: change the memory size limit + +When run "kexec" in powerpc board, the kexec has a limit that +the kernel text and bss size must be less than 24M. But now +some kernel size exceed the limit. So we need to change the limit, +else will get the error log as below: + +my_load:669: do +Could not find a free area of memory of 0x12400 bytes... +Could not find a free area of memory of 0x13000 bytes... +locate_hole failed + +Upstream-Status: Pending + +Signed-off-by: Quanyang Wang +--- + kexec/arch/ppc/kexec-ppc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kexec/arch/ppc/kexec-ppc.h b/kexec/arch/ppc/kexec-ppc.h +index 04e728e..6bae9ec 100644 +--- a/kexec/arch/ppc/kexec-ppc.h ++++ b/kexec/arch/ppc/kexec-ppc.h +@@ -44,7 +44,7 @@ void dol_ppc_usage(void); + * During inital setup the kernel does not map the whole memory but a part of + * it. On Book-E that is 64MiB, 601 24MiB or 256MiB (if possible). + */ +-#define KERNEL_ACCESS_TOP (24 * 1024 * 1024) ++#define KERNEL_ACCESS_TOP (36 * 1024 * 1024) + + /* boot block version 17 as defined by the linux kernel */ + struct bootblock { diff --git a/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch deleted file mode 100644 index bfd077daf0..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a1135b3170963ba956f2364c1283864c35541295 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 7 Sep 2015 07:59:45 +0000 -Subject: [PATCH] purgatory: Pass -r directly to linker - -This helps compiling with clang since -r is not a known option for clang -where as gcc knows how to deal with it and passes it down to linker -unfiltered - -Signed-off-by: Khem Raj ---- -Upstream-Status: Pending - - purgatory/Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/purgatory/Makefile b/purgatory/Makefile -index 2b5c061..b251353 100644 ---- a/purgatory/Makefile -+++ b/purgatory/Makefile -@@ -61,7 +61,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ - -I$(shell $(CC) -print-file-name=include) - $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\ - -Wl,--no-undefined -nostartfiles -nostdlib \ -- -nodefaultlibs -e purgatory_start -r \ -+ -nodefaultlibs -e purgatory_start -Wl,-r \ - -Wl,-Map=$(PURGATORY_MAP) - - $(PURGATORY): $(PURGATORY_OBJS) --- -2.5.1 - diff --git a/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch b/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch deleted file mode 100644 index dc97d930e9..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch +++ /dev/null @@ -1,35 +0,0 @@ -From b19b68eab567aa534cf8dec79fe18e3dc0e14043 Mon Sep 17 00:00:00 2001 -From: Quanyang Wang -Date: Tue, 16 Jun 2015 12:59:57 +0800 -Subject: [PATCH] powerpc: change the memory size limit - -When run "kexec" in powerpc board, the kexec has a limit that -the kernel text and bss size must be less than 24M. But now -some kernel size exceed the limit. So we need to change the limit, -else will get the error log as below: - -my_load:669: do -Could not find a free area of memory of 0x12400 bytes... -Could not find a free area of memory of 0x13000 bytes... -locate_hole failed - -Upstream-Status: Pending - -Signed-off-by: Quanyang Wang ---- - kexec/arch/ppc/kexec-ppc.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: kexec-tools-2.0.10/kexec/arch/ppc/kexec-ppc.h -=================================================================== ---- kexec-tools-2.0.10.orig/kexec/arch/ppc/kexec-ppc.h -+++ kexec-tools-2.0.10/kexec/arch/ppc/kexec-ppc.h -@@ -42,7 +42,7 @@ void dol_ppc_usage(void); - * During inital setup the kernel does not map the whole memory but a part of - * it. On Book-E that is 64MiB, 601 24MiB or 256MiB (if possible). - */ --#define KERNEL_ACCESS_TOP (24 * 1024 * 1024) -+#define KERNEL_ACCESS_TOP (36 * 1024 * 1024) - - /* boot block version 17 as defined by the linux kernel */ - struct bootblock { diff --git a/meta/recipes-kernel/kexec/kexec-tools/0002-purgatory-Pass-r-directly-to-linker.patch b/meta/recipes-kernel/kexec/kexec-tools/0002-purgatory-Pass-r-directly-to-linker.patch new file mode 100644 index 0000000000..363d5da4ae --- /dev/null +++ b/meta/recipes-kernel/kexec/kexec-tools/0002-purgatory-Pass-r-directly-to-linker.patch @@ -0,0 +1,29 @@ +From a04bcf8f683c1a5a7d015920124457ad56fb7cf0 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 7 Sep 2015 07:59:45 +0000 +Subject: [PATCH] purgatory: Pass -r directly to linker + +This helps compiling with clang since -r is not a known option for clang +where as gcc knows how to deal with it and passes it down to linker +unfiltered + +Signed-off-by: Khem Raj + +Upstream-Status: Pending +--- + purgatory/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/purgatory/Makefile b/purgatory/Makefile +index 2dd6c47..416e6b9 100644 +--- a/purgatory/Makefile ++++ b/purgatory/Makefile +@@ -60,7 +60,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ + -I$(shell $(CC) -print-file-name=include) + $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\ + -Wl,--no-undefined -nostartfiles -nostdlib \ +- -nodefaultlibs -e purgatory_start -r \ ++ -nodefaultlibs -e purgatory_start -Wl,-r \ + -Wl,-Map=$(PURGATORY_MAP) + + $(PURGATORY): $(PURGATORY_OBJS) diff --git a/meta/recipes-kernel/kexec/kexec-tools/0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch b/meta/recipes-kernel/kexec/kexec-tools/0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch new file mode 100644 index 0000000000..832fe67716 --- /dev/null +++ b/meta/recipes-kernel/kexec/kexec-tools/0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch @@ -0,0 +1,49 @@ +From 55e583d20651e829afbbc8dba0f8ec3017cda2d5 Mon Sep 17 00:00:00 2001 +From: Haiqing Bai +Date: Mon, 9 Jan 2017 15:26:29 +0800 +Subject: [PATCH] kexec: ARM: Fix add_buffer_phys_virt() align issue + +When "CONFIG_ARM_LPAE" is enabled,3 level page table +is used by MMU, the "SECTION_SIZE" is defined with +(1 << 21), but 'add_buffer_phys_virt()' hardcode this +to (1 << 20). + +Upstream-Status: Pending + +Suggested-By:fredrik.markstrom@gmail.com +Signed-off-by: Haiqing Bai +--- + kexec/arch/arm/crashdump-arm.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c +index daa4788..3f72b38 100644 +--- a/kexec/arch/arm/crashdump-arm.c ++++ b/kexec/arch/arm/crashdump-arm.c +@@ -240,6 +240,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline) + void *buf; + int err; + int last_ranges; ++ unsigned short align_bit_shift = 20; + + /* + * First fetch all the memory (RAM) ranges that we are going to pass to +@@ -281,6 +282,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline) + + /* for support LPAE enabled kernel*/ + elf_info.class = ELFCLASS64; ++ align_bit_shift = 21; + + err = crash_create_elf64_headers(info, &elf_info, + usablemem_rgns.ranges, +@@ -302,8 +304,9 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline) + * 1MB) so that available memory passed in kernel command line will be + * aligned to 1MB. This is because kernel create_mapping() wants memory + * regions to be aligned to SECTION_SIZE. ++ * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in pgtable-3level.h + */ +- elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20, ++ elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << align_bit_shift, + crash_kernel_mem.start, + crash_kernel_mem.end, -1, 0); + diff --git a/meta/recipes-kernel/kexec/kexec-tools/0004-x86_64-Add-support-to-build-kexec-tools-with-x32-ABI.patch b/meta/recipes-kernel/kexec/kexec-tools/0004-x86_64-Add-support-to-build-kexec-tools-with-x32-ABI.patch new file mode 100644 index 0000000000..a809d5ba8e --- /dev/null +++ b/meta/recipes-kernel/kexec/kexec-tools/0004-x86_64-Add-support-to-build-kexec-tools-with-x32-ABI.patch @@ -0,0 +1,93 @@ +From 8c9a5076543eb3d497e016b3d7707e93d6311883 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= +Date: Mon, 15 Jul 2013 23:32:36 -0700 +Subject: [PATCH] x86_64: Add support to build kexec-tools with x32 ABI +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Summary of changes, + +configure.ac: Add test for detect x32 ABI. +purgatory/arch/x86_64/Makefile: Not use mcmodel large when + x32 ABI is set. +kexec/arch/x86_64/kexec-elf-rel-x86_64.c: When x32 ABI is set + use ELFCLASS32 instead of ELFCLASS64. +kexec/kexec-syscall.h: Add correct syscall number for x32 ABI. + +Upstream-Status: Submitted + +Signed-off-by: Aníbal Limón +Signed-off-by: Mariano Lopez +--- + configure.ac | 9 +++++++++ + kexec/arch/x86_64/kexec-elf-rel-x86_64.c | 4 ++++ + kexec/kexec-syscall.h | 4 ++++ + purgatory/arch/x86_64/Makefile | 4 +++- + 4 files changed, 20 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index c2b0c68..60882b8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -54,6 +54,15 @@ case $target_cpu in + ;; + ia64|x86_64|alpha|m68k ) + ARCH="$target_cpu" ++ ++ dnl ---Test for x32 ABI in x86_64 ++ if test "x$ARCH" = "xx86_64" ; then ++ AC_EGREP_CPP(x32_test, ++ [#if defined(__x86_64__) && defined (__ILP32__) ++ x32_test ++ #endif ++ ], SUBARCH='x32', SUBARCH='64') ++ fi + ;; + * ) + AC_MSG_ERROR([unsupported architecture $target_cpu]) +diff --git a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c +index db85b44..0ce1172 100644 +--- a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c ++++ b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c +@@ -8,7 +8,11 @@ int machine_verify_elf_rel(struct mem_ehdr *ehdr) + if (ehdr->ei_data != ELFDATA2LSB) { + return 0; + } ++#ifdef __ILP32__ ++ if (ehdr->ei_class != ELFCLASS32) { ++#else + if (ehdr->ei_class != ELFCLASS64) { ++#endif + return 0; + } + if (ehdr->e_machine != EM_X86_64) { +diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h +index dac1c1f..e9479b7 100644 +--- a/kexec/kexec-syscall.h ++++ b/kexec/kexec-syscall.h +@@ -31,8 +31,12 @@ + #define __NR_kexec_load 268 + #endif + #ifdef __x86_64__ ++#ifdef __ILP32__ ++#define __NR_kexec_load 528 ++#else + #define __NR_kexec_load 246 + #endif ++#endif + #ifdef __s390x__ + #define __NR_kexec_load 277 + #endif +diff --git a/purgatory/arch/x86_64/Makefile b/purgatory/arch/x86_64/Makefile +index 7300937..4af11e4 100644 +--- a/purgatory/arch/x86_64/Makefile ++++ b/purgatory/arch/x86_64/Makefile +@@ -23,4 +23,6 @@ x86_64_PURGATORY_SRCS += purgatory/arch/i386/console-x86.c + x86_64_PURGATORY_SRCS += purgatory/arch/i386/vga.c + x86_64_PURGATORY_SRCS += purgatory/arch/i386/pic.c + +-x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large ++ifeq ($(SUBARCH),64) ++ x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large ++endif diff --git a/meta/recipes-kernel/kexec/kexec-tools/0005-Disable-PIE-during-link.patch b/meta/recipes-kernel/kexec/kexec-tools/0005-Disable-PIE-during-link.patch new file mode 100644 index 0000000000..7a4b8548ca --- /dev/null +++ b/meta/recipes-kernel/kexec/kexec-tools/0005-Disable-PIE-during-link.patch @@ -0,0 +1,28 @@ +From c54488ad5fd657e0f154d76d7456d9080be24836 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 10 Jun 2017 11:18:49 -0700 +Subject: [PATCH] Disable PIE during link + +We have explcitly disabled PIE during compile so we +just need to match it with linker flags + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + purgatory/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/purgatory/Makefile b/purgatory/Makefile +index 416e6b9..f00edb4 100644 +--- a/purgatory/Makefile ++++ b/purgatory/Makefile +@@ -59,7 +59,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \ + -Iinclude \ + -I$(shell $(CC) -print-file-name=include) + $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\ +- -Wl,--no-undefined -nostartfiles -nostdlib \ ++ -Wl,--no-undefined -no-pie -nostartfiles -nostdlib \ + -nodefaultlibs -e purgatory_start -Wl,-r \ + -Wl,-Map=$(PURGATORY_MAP) + diff --git a/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch b/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch deleted file mode 100644 index 6c6c66d885..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 78e497fb69950665e639cfab8f4fb50cc404a1eb Mon Sep 17 00:00:00 2001 -From: Haiqing Bai -Date: Mon, 9 Jan 2017 15:26:29 +0800 -Subject: [PATCH] kexec: ARM: Fix add_buffer_phys_virt() align issue - -When "CONFIG_ARM_LPAE" is enabled,3 level page table -is used by MMU, the "SECTION_SIZE" is defined with -(1 << 21), but 'add_buffer_phys_virt()' hardcode this -to (1 << 20). - -Upstream-Status: Pending - -Suggested-By:fredrik.markstrom@gmail.com -Signed-off-by: Haiqing Bai ---- - kexec/arch/arm/crashdump-arm.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/kexec/arch/arm/crashdump-arm.c b/kexec/arch/arm/crashdump-arm.c -index 245c21a..12139c3 100644 ---- a/kexec/arch/arm/crashdump-arm.c -+++ b/kexec/arch/arm/crashdump-arm.c -@@ -240,6 +240,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline) - void *buf; - int err; - int last_ranges; -+ unsigned short align_bit_shift = 20; - - /* - * First fetch all the memory (RAM) ranges that we are going to pass to -@@ -281,6 +282,7 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline) - - /* for support LPAE enabled kernel*/ - elf_info.class = ELFCLASS64; -+ align_bit_shift = 21; - - err = crash_create_elf64_headers(info, &elf_info, - usablemem_rgns.ranges, -@@ -302,8 +304,9 @@ int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline) - * 1MB) so that available memory passed in kernel command line will be - * aligned to 1MB. This is because kernel create_mapping() wants memory - * regions to be aligned to SECTION_SIZE. -+ * The SECTION_SIZE of LPAE kernel is '1UL << 21' defined in pgtable-3level.h - */ -- elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20, -+ elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << align_bit_shift, - crash_kernel_mem.start, - crash_kernel_mem.end, -1, 0); - --- -1.9.1 - diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch b/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch deleted file mode 100644 index 26d18eb6fe..0000000000 --- a/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch +++ /dev/null @@ -1,88 +0,0 @@ -x86_64: Add support to build kexec-tools with x32 ABI - -Summary of changes, - -configure.ac: Add test for detect x32 ABI. -purgatory/arch/x86_64/Makefile: Not use mcmodel large when - x32 ABI is set. -kexec/arch/x86_64/kexec-elf-rel-x86_64.c: When x32 ABI is set - use ELFCLASS32 instead of ELFCLASS64. -kexec/kexec-syscall.h: Add correct syscall number for x32 ABI. - -Upstream-Status: Submitted - -Signed-off-by: Aníbal Limón -Signed-off-by: Mariano Lopez - ---- - configure.ac | 9 +++++++++ - kexec/arch/x86_64/kexec-elf-rel-x86_64.c | 4 ++++ - kexec/kexec-syscall.h | 4 ++++ - purgatory/arch/x86_64/Makefile | 4 +++- - 4 files changed, 20 insertions(+), 1 deletion(-) - -Index: kexec-tools-2.0.10/configure.ac -=================================================================== ---- kexec-tools-2.0.10.orig/configure.ac -+++ kexec-tools-2.0.10/configure.ac -@@ -56,6 +56,15 @@ case $target_cpu in - ;; - ia64|x86_64|alpha|m68k ) - ARCH="$target_cpu" -+ -+ dnl ---Test for x32 ABI in x86_64 -+ if test "x$ARCH" = "xx86_64" ; then -+ AC_EGREP_CPP(x32_test, -+ [#if defined(__x86_64__) && defined (__ILP32__) -+ x32_test -+ #endif -+ ], SUBARCH='x32', SUBARCH='64') -+ fi - ;; - * ) - AC_MSG_ERROR([unsupported architecture $target_cpu]) -Index: kexec-tools-2.0.10/kexec/arch/x86_64/kexec-elf-rel-x86_64.c -=================================================================== ---- kexec-tools-2.0.10.orig/kexec/arch/x86_64/kexec-elf-rel-x86_64.c -+++ kexec-tools-2.0.10/kexec/arch/x86_64/kexec-elf-rel-x86_64.c -@@ -8,7 +8,11 @@ int machine_verify_elf_rel(struct mem_eh - if (ehdr->ei_data != ELFDATA2LSB) { - return 0; - } -+#ifdef __ILP32__ -+ if (ehdr->ei_class != ELFCLASS32) { -+#else - if (ehdr->ei_class != ELFCLASS64) { -+#endif - return 0; - } - if (ehdr->e_machine != EM_X86_64) { -Index: kexec-tools-2.0.10/kexec/kexec-syscall.h -=================================================================== ---- kexec-tools-2.0.10.orig/kexec/kexec-syscall.h -+++ kexec-tools-2.0.10/kexec/kexec-syscall.h -@@ -31,8 +31,12 @@ - #define __NR_kexec_load 268 - #endif - #ifdef __x86_64__ -+#ifdef __ILP32__ -+#define __NR_kexec_load 528 -+#else - #define __NR_kexec_load 246 - #endif -+#endif - #ifdef __s390x__ - #define __NR_kexec_load 277 - #endif -Index: kexec-tools-2.0.10/purgatory/arch/x86_64/Makefile -=================================================================== ---- kexec-tools-2.0.10.orig/purgatory/arch/x86_64/Makefile -+++ kexec-tools-2.0.10/purgatory/arch/x86_64/Makefile -@@ -23,4 +23,6 @@ x86_64_PURGATORY_SRCS += purgatory/arch/ - x86_64_PURGATORY_SRCS += purgatory/arch/i386/vga.c - x86_64_PURGATORY_SRCS += purgatory/arch/i386/pic.c - --x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large -+ifeq ($(SUBARCH),64) -+ x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large -+endif diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.19.bb b/meta/recipes-kernel/kexec/kexec-tools_2.0.19.bb index f65cd9f106..3439899070 100644 --- a/meta/recipes-kernel/kexec/kexec-tools_2.0.19.bb +++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.19.bb @@ -10,15 +10,15 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \ DEPENDS = "zlib xz" SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz \ - file://kdump \ - file://kdump.conf \ - file://kdump.service \ - file://0002-powerpc-change-the-memory-size-limit.patch \ - file://0001-purgatory-Pass-r-directly-to-linker.patch \ - file://0010-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \ - file://kexec-x32.patch \ - file://0001-Disable-PIE-during-link.patch \ - " + file://kdump \ + file://kdump.conf \ + file://kdump.service \ + file://0001-powerpc-change-the-memory-size-limit.patch \ + file://0002-purgatory-Pass-r-directly-to-linker.patch \ + file://0003-kexec-ARM-Fix-add_buffer_phys_virt-align-issue.patch \ + file://0004-x86_64-Add-support-to-build-kexec-tools-with-x32-ABI.patch \ + file://0005-Disable-PIE-during-link.patch \ +" SRC_URI[md5sum] = "052458f0a35c2a3b0d2302caa3318e9f" SRC_URI[sha256sum] = "913c8dee918e5855a4ba60d609371390978144b4c8d15d6446ca0057b7bc5e58" -- cgit v1.2.3-54-g00ecf