[PATCH v14 12/16] arm64: kexec_file: add crash dump support

2018-09-07 Thread AKASHI Takahiro
y range to be used by crash dump kernel and the header's location Signed-off-by: AKASHI Takahiro Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: James Morse --- arch/arm64/include/asm/kexec.h | 4 + arch/arm64/kernel/machine_kexec_file.c | 113 - 2 files cha

[PATCH v14 11/16] arm64: kexec_file: allow for loading Image-format kernel

2018-09-07 Thread AKASHI Takahiro
, you must have IMA enforced with, at least, the following security policy: "appraise func=KEXEC_KERNEL_CHECK appraise_type=imasig" See more details about IMA here: https://sourceforge.net/p/linux-ima/wiki/Home/ Signed-off-by: AKASHI Takahiro Cc: Catalin Marinas Cc: Will Deacon

[PATCH v14 08/16] arm64: cpufeature: add MMFR0 helper functions

2018-09-07 Thread AKASHI Takahiro
Those helper functions for MMFR0 register will be used later by kexec_file loader. Signed-off-by: AKASHI Takahiro Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: James Morse --- arch/arm64/include/asm/cpufeature.h | 48 + 1 file changed, 48 insertions(+) diff

Re: [PATCH v2 1/3] arm64: implement ftrace with regs

2018-08-29 Thread AKASHI Takahiro
On Fri, Aug 17, 2018 at 12:27:24PM +0200, Torsten Duwe wrote: > Check for compiler support of -fpatchable-function-entry and use it > to intercept functions immediately on entry, saving the LR in x9. > Disable ftracing in efi/libstub, because this triggers cross-section > linker errors now (-pg is

[PATCH v13 16/16] arm64: kexec_file: add kaslr support

2018-08-01 Thread AKASHI Takahiro
by passing "nokaslr" as a kernel boot argument. Signed-off-by: AKASHI Takahiro Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/kernel/machine_kexec_file.c | 45 ++ 1 file changed, 45 insertions(+) diff --git a/arch/arm64/kernel/machine_kex

[PATCH v13 00/16] subject: arm64: kexec: add kexec_file_load() support

2018-08-01 Thread AKASHI Takahiro
r KEXEC_FILE support (additionally allowing for IMA-based verification): Patch #1 to #6 are all preparatory patches on generic side. Patch #7 to #11 are to enable kexec_file_load on arm64. Patch #12 to #13 are for KEXEC_VERIFY_SIG (arch-specific verification) support AKASHI Takahiro (16):

[PATCH v13 04/16] powerpc, kexec_file: factor out memblock-based arch_kexec_walk_mem()

2018-08-01 Thread AKASHI Takahiro
(), the current kexec_walk_memblock() won't work for kdump either in this form, this will be fixed in the next patch. Signed-off-by: AKASHI Takahiro Cc: "Eric W. Biederman" Acked-by: Dave Young Cc: Vivek Goyal Cc: Baoquan He Acked-by: James Morse --- arch/powerpc/kernel/machine_kexec_file

Re: [PATCH v12 16/16] arm64: kexec_file: add kaslr support

2018-08-01 Thread AKASHI Takahiro
James, All the changes mentioned below were applied to my coming v13. On Fri, Jul 27, 2018 at 10:22:31AM +0100, James Morse wrote: > Hi Akashi, > > > On 07/27/2018 09:31 AM, AKASHI Takahiro wrote: > >On Thu, Jul 26, 2018 at 02:40:49PM +0100, James Morse wrote: > >&g

Re: [PATCH 1/1] arm64: kexec: machine_kexec should call __flush_icache_range

2018-07-30 Thread AKASHI Takahiro
On Mon, Jul 30, 2018 at 04:36:28PM -0500, Dave Kleikamp wrote: > On 07/30/2018 11:57 AM, Will Deacon wrote: > > On Mon, Jul 30, 2018 at 11:46:24AM -0500, Dave Kleikamp wrote: > >> On 07/30/2018 11:22 AM, Will Deacon wrote: > >>> On Mon, Jul 30, 2018 at 05:16:42PM +0100, Catalin Marinas wrote: >

Re: [PATCH v12 04/16] powerpc, kexec_file: factor out memblock-based arch_kexec_walk_mem()

2018-07-26 Thread AKASHI Takahiro
On Wed, Jul 25, 2018 at 08:31:29PM +0800, Dave Young wrote: > On 07/24/18 at 03:57pm, AKASHI Takahiro wrote: > > Memblock list is another source for usable system memory layout. > > So move powerpc's arch_kexec_walk_mem() to common code so that other > > memblock-based archit

Re: linux-next: build warning after merge of the arm64 tree

2018-07-23 Thread AKASHI Takahiro
On Tue, Jul 24, 2018 at 09:05:45AM +1000, Stephen Rothwell wrote: > Hi all, > > After merging the arm64 tree, today's linux-next build (x86_64 > allmodconfig) produced this warning: Where can I find this specific branch? > drivers/acpi/Kconfig:6:error: recursive dependency detected! >

[PATCH v3 2/3] efi/arm: map UEFI memory map even w/o runtime services enabled

2018-07-08 Thread AKASHI Takahiro
=2 Signed-off-by: AKASHI Takahiro Reviewed-by: Ard Biesheuvel --- drivers/firmware/efi/arm-runtime.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index 59a8c0ec94d5..a00934d263c5 100644

[PATCH v3 3/3] arm64: acpi: fix alignment fault in accessing ACPI

2018-07-08 Thread AKASHI Takahiro
ed access support (ACPI_MISALIGNMENT_NOT_SUPPORTED), any unaligned access to ACPI tables can cause a fatal panic. With this patch, acpi_os_ioremap() always honors memory attribute information provided by the firmware (EFI) and retaining cacheability allows the kernel safe access to ACPI tables.

[PATCH v3 0/3] arm64: kexec,kdump: fix boot failures on acpi-only system

2018-07-08 Thread AKASHI Takahiro
reak bisect [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2018-March/565980.html [2] https://git.linaro.org/people/takahiro.akashi/kexec-tools.git arm64/resv_mem [3] http://lists.infradead.org/pipermail/linux-arm-kernel/2018-April/573655.html [4] https://marc.info/?l=linux-efi=15293077350

[PATCH v3 1/3] arm64: export memblock_reserve()d regions via /proc/iomem

2018-07-08 Thread AKASHI Takahiro
n initcall. Reported-by: Bhupesh Sharma Reported-by: Tyler Baicar Suggested-by: Akashi Takahiro Signed-off-by: James Morse Fixes: d28f6df1305a ("arm64/kexec: Add core kexec support") Reviewed-by: Ard Biesheuvel CC: Mark Rutland --- arch/arm64/kernel/setup.c | 38 +

[PATCH v2 4/4] arm64: acpi: fix alignment fault in accessing ACPI

2018-06-19 Thread AKASHI Takahiro
ed access support (ACPI_MISALIGNMENT_NOT_SUPPORTED), any unaligned access to ACPI tables can cause a fatal panic. With this patch, acpi_os_ioremap() always honors memory attribute information provided by the firmware (EFI) and retaining cacheability allows the kernel safe access to ACPI tables. S

Re: [PATCH v9 07/11] arm64: kexec_file: add crash dump support

2018-05-21 Thread AKASHI Takahiro
Hi Rob, On Fri, May 18, 2018 at 10:35:52AM -0500, Rob Herring wrote: > On Tue, May 15, 2018 at 06:12:59PM +0100, James Morse wrote: > > Hi guys, > > > > (CC: +RobH, devicetree list) > > Thanks. > > > On 25/04/18 07:26, AKASHI Takahiro wrote: > &

Re: [PATCH v9 07/11] arm64: kexec_file: add crash dump support

2018-05-21 Thread AKASHI Takahiro
James, On Fri, May 18, 2018 at 05:00:55PM +0100, James Morse wrote: > Hi Akashi, > > On 18/05/18 11:39, AKASHI Takahiro wrote: > > On Tue, May 15, 2018 at 06:11:15PM +0100, James Morse wrote: > >> On 25/04/18 07:26, AKASHI Takahiro wrote: > >>>

Re: [PATCH v9 06/11] arm64: kexec_file: allow for loading Image-format kernel

2018-05-21 Thread AKASHI Takahiro
James, I haven't commented on this email. On Tue, May 15, 2018 at 06:14:37PM +0100, James Morse wrote: > Hi Akashi, > > On 15/05/18 06:13, AKASHI Takahiro wrote: > > On Fri, May 11, 2018 at 06:07:06PM +0100, James Morse wrote: > >> On 07/05/18 08:21, AKASHI Takahiro wro

Re: [PATCH v9 07/11] arm64: kexec_file: add crash dump support

2018-05-18 Thread AKASHI Takahiro
On Tue, May 15, 2018 at 06:11:15PM +0100, James Morse wrote: > Hi Akashi, > > On 25/04/18 07:26, AKASHI Takahiro wrote: > > Enabling crash dump (kdump) includes > > * prepare contents of ELF header of a core dump file, /proc/vmcore, > > using crash_prepare_elf64_h

Re: [PATCH v9 07/11] arm64: kexec_file: add crash dump support

2018-05-18 Thread AKASHI Takahiro
On Wed, May 16, 2018 at 09:34:41AM +0100, James Morse wrote: > Hi Akashi, > > On 15/05/18 18:11, James Morse wrote: > > On 25/04/18 07:26, AKASHI Takahiro wrote: > >> Enabling crash dump (kdump) includes > >> * prepare contents of ELF header of a core dump

Re: [PATCH v9 07/11] arm64: kexec_file: add crash dump support

2018-05-18 Thread AKASHI Takahiro
On Wed, May 16, 2018 at 11:06:02AM +0100, James Morse wrote: > Hi Akashi, > > On 15/05/18 18:11, James Morse wrote: > > On 25/04/18 07:26, AKASHI Takahiro wrote: > >> Enabling crash dump (kdump) includes > >> * prepare contents of ELF header of a core dump

Re: [PATCH v9 05/11] arm64: kexec_file: load initrd and device-tree

2018-05-18 Thread AKASHI Takahiro
On Fri, May 18, 2018 at 04:11:35PM +0900, AKASHI Takahiro wrote: > James, > > On Tue, May 15, 2018 at 05:20:00PM +0100, James Morse wrote: > > Hi Akashi, > > > > On 25/04/18 07:26, AKASHI Takahiro wrote: > > > load_other_segments() is expected to allocate and

Re: [PATCH v9 05/11] arm64: kexec_file: load initrd and device-tree

2018-05-18 Thread AKASHI Takahiro
James, On Tue, May 15, 2018 at 05:20:00PM +0100, James Morse wrote: > Hi Akashi, > > On 25/04/18 07:26, AKASHI Takahiro wrote: > > load_other_segments() is expected to allocate and place all the necessary > > memory segments other than kernel, including initrd and device-t

Re: [PATCH v9 03/11] arm64: kexec_file: invoke the kernel without purgatory

2018-05-18 Thread AKASHI Takahiro
James, On Tue, May 15, 2018 at 05:15:52PM +0100, James Morse wrote: > Hi Akashi, > > On 15/05/18 05:45, AKASHI Takahiro wrote: > > On Fri, May 11, 2018 at 06:03:49PM +0100, James Morse wrote: > >> On 07/05/18 06:22, AKASHI Takahiro wrote: > >>> On Tue, May

Re: [PATCH v9 04/11] arm64: kexec_file: allocate memory walking through memblock list

2018-05-17 Thread AKASHI Takahiro
Baoquan, On Fri, May 18, 2018 at 09:37:35AM +0800, Baoquan He wrote: > On 05/17/18 at 07:04pm, James Morse wrote: > > Hi Baoquan, > > > > On 17/05/18 03:15, Baoquan He wrote: > > > On 05/17/18 at 10:10am, Baoquan He wrote: > > >> On 05/07/18 at 02:59pm,

Re: [PATCH v9 06/11] arm64: kexec_file: allow for loading Image-format kernel

2018-05-14 Thread AKASHI Takahiro
James, On Fri, May 11, 2018 at 06:07:06PM +0100, James Morse wrote: > Hi Akashi, > > On 07/05/18 08:21, AKASHI Takahiro wrote: > > On Tue, May 01, 2018 at 06:46:11PM +0100, James Morse wrote: > >> On 25/04/18 07:26, AKASHI Takahiro wrote: > >>> This patc

Re: [PATCH v9 03/11] arm64: kexec_file: invoke the kernel without purgatory

2018-05-14 Thread AKASHI Takahiro
James, On Fri, May 11, 2018 at 06:03:49PM +0100, James Morse wrote: > Hi Akashi, > > On 07/05/18 06:22, AKASHI Takahiro wrote: > > On Tue, May 01, 2018 at 06:46:06PM +0100, James Morse wrote: > >> On 25/04/18 07:26, AKASHI Takahiro wrote: > >>> diff --git

Re: [PATCH v9 04/11] arm64: kexec_file: allocate memory walking through memblock list

2018-05-14 Thread AKASHI Takahiro
James, On Mon, May 07, 2018 at 02:59:07PM +0900, AKASHI Takahiro wrote: > James, > > On Tue, May 01, 2018 at 06:46:09PM +0100, James Morse wrote: > > Hi Akashi, > > > > On 25/04/18 07:26, AKASHI Takahiro wrote: > > > We need to prevent firmware-reser

Re: [PATCH v9 06/11] arm64: kexec_file: allow for loading Image-format kernel

2018-05-07 Thread AKASHI Takahiro
James, On Tue, May 01, 2018 at 06:46:11PM +0100, James Morse wrote: > Hi Akashi, > > On 25/04/18 07:26, AKASHI Takahiro wrote: > > This patch provides kexec_file_ops for "Image"-format kernel. In this > > implementation, a binary is always loaded with a fixed offse

Re: [PATCH v9 04/11] arm64: kexec_file: allocate memory walking through memblock list

2018-05-06 Thread AKASHI Takahiro
James, On Tue, May 01, 2018 at 06:46:09PM +0100, James Morse wrote: > Hi Akashi, > > On 25/04/18 07:26, AKASHI Takahiro wrote: > > We need to prevent firmware-reserved memory regions, particularly EFI > > memory map as well as ACPI tables, from being corrupted by load

Re: [PATCH v9 03/11] arm64: kexec_file: invoke the kernel without purgatory

2018-05-06 Thread AKASHI Takahiro
On Tue, May 01, 2018 at 06:46:06PM +0100, James Morse wrote: > Hi Akashi, > > On 25/04/18 07:26, AKASHI Takahiro wrote: > > On arm64, purugatory would do almosty nothing. So just invoke secondary > > kernel directy by jumping into its entry code. > > (Nits: purgatory,

Re: [PATCH v9 02/11] kexec_file: make kexec_image_post_load_cleanup_default() global

2018-05-06 Thread AKASHI Takahiro
On Tue, May 01, 2018 at 06:46:04PM +0100, James Morse wrote: > Hi Akashi, > > On 25/04/18 07:26, AKASHI Takahiro wrote: > > Change this function from static to global so that arm64 can implement > > its own arch_kimage_file_post_load_cleanup() later using > > kexec_imag

Re: [RESEND PATCH] arm64: acpi,efi: fix alignment fault in accessing ACPI tables at kdump

2018-04-25 Thread AKASHI Takahiro
Ard, On Wed, Apr 25, 2018 at 10:09:26AM +0200, Ard Biesheuvel wrote: > On 25 April 2018 at 08:35, AKASHI Takahiro <takahiro.aka...@linaro.org> wrote: > > This is a fix against the issue that crash dump kernel may hang up > > during booting, which can happen on any ACPI-ba

[RESEND PATCH] arm64: acpi,efi: fix alignment fault in accessing ACPI tables at kdump

2018-04-25 Thread AKASHI Takahiro
les. Please note that arm_enable_runtime_services(), which is renamed to efi_enter_virtual_mode() due to the similarity to x86's, is now called earlier before acpi_early_init() since efi_mem_attributes() relies on efi.memmap being mapped. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linar

[PATCH v9 02/11] kexec_file: make kexec_image_post_load_cleanup_default() global

2018-04-25 Thread AKASHI Takahiro
Change this function from static to global so that arm64 can implement its own arch_kimage_file_post_load_cleanup() later using kexec_image_post_load_cleanup_default(). Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Dave Young <dyo...@redhat.com> Cc: Vive

[PATCH v9 04/11] arm64: kexec_file: allocate memory walking through memblock list

2018-04-25 Thread AKASHI Takahiro
specific arch_kexec_walk_mem() which will search for available memory ranges in usable memblock list, i.e. !NOMAP & !reserved, instead of system resource tree. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Catalin Marinas <catalin.mari...@arm.com> Cc: Will Deacon <

[PATCH v9 10/11] arm64: kexec_file: add kernel signature verification support

2018-04-25 Thread AKASHI Takahiro
CONFIG_EFI is enabled, we adopt this format for kernel signing. You can create a signed kernel image with: $ sbsign --key ${KEY} --cert ${CERT} Image Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Catalin Marinas <catalin.mari...@arm.com> Cc: Will Deacon <will.dea...

[PATCH v9 06/11] arm64: kexec_file: allow for loading Image-format kernel

2018-04-25 Thread AKASHI Takahiro
, you must have IMA enforced with, at least, the following security policy: "appraise func=KEXEC_KERNEL_CHECK appraise_type=imasig" See more details about IMA here: https://sourceforge.net/p/linux-ima/wiki/Home/ Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.o

[PATCH v9 07/11] arm64: kexec_file: add crash dump support

2018-04-25 Thread AKASHI Takahiro
y range to be used by crash dump kernel and the header's location Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Catalin Marinas <catalin.mari...@arm.com> Cc: Will Deacon <will.dea...@arm.com> --- arch/arm64/include/asm/kexec.h | 4 + arch/arm64/kernel/kex

[PATCH v9 03/11] arm64: kexec_file: invoke the kernel without purgatory

2018-04-25 Thread AKASHI Takahiro
is null. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Catalin Marinas <catalin.mari...@arm.com> Cc: Will Deacon <will.dea...@arm.com> --- arch/arm64/kernel/cpu-reset.S | 6 +++--- arch/arm64/kernel/machine_kexec.c | 11 +-- arch/arm64/kernel/relo

[PATCH v9 09/11] include: pe.h: remove message[] from mz header definition

2018-04-25 Thread AKASHI Takahiro
ddr(cursor, mz->peaddr, sizeof(*pe)); Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheu...@linaro.org> Cc: David Howells <dhowe...@redhat.com> Cc: Vivek Goyal <vgo...@redhat.com> Cc: Herbert Xu <herb...@gond

[PATCH v9 11/11] arm64: kexec_file: add kaslr support

2018-04-25 Thread AKASHI Takahiro
by passing "nokaslr" as a kernel boot argument. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Catalin Marinas <catalin.mari...@arm.com> Cc: Will Deacon <will.dea...@arm.com> --- arch/arm64/kernel/machine_kexec_file.c | 7 +++ 1 file changed,

[PATCH v9 08/11] arm64: enable KEXEC_FILE config

2018-04-25 Thread AKASHI Takahiro
Modify arm64/Kconfig to enable kexec_file_load support. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Catalin Marinas <catalin.mari...@arm.com> Cc: Will Deacon <will.dea...@arm.com> --- arch/arm64/Kconfig | 10 ++ 1 file changed, 10 insertions(+)

[PATCH v9 01/11] asm-generic: add kexec_file_load system call to unistd.h

2018-04-25 Thread AKASHI Takahiro
The initial user of this system call number is arm64. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Acked-by: Arnd Bergmann <a...@arndb.de> --- include/uapi/asm-generic/unistd.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/uapi/asm-gene

[PATCH v9 05/11] arm64: kexec_file: load initrd and device-tree

2018-04-25 Thread AKASHI Takahiro
, instead, the dtb presented by a boot loader is reused. arch_kimage_kernel_post_load_cleanup() is responsible for freeing arm64- specific data allocated in load_other_segments(). Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Catalin Marinas <catalin.mari...@ar

[PATCH v9 00/11] arm64: kexec: add kexec_file_load() support

2018-04-25 Thread AKASHI Takahiro
ons_add() * drop older kernel support * drop vmlinux support (at least, for this series) Patch #1 to #10 are essential part for KEXEC_FILE support (additionally allowing for IMA-based verification): Patch #1 to #6 are all preparatory patches on generic side. Patch #7 to #11 are to enable kexec_

Re: [PATCH v8 01/13] resource: add walk_system_ram_res_rev()

2018-03-19 Thread AKASHI Takahiro
Baoquan, On Tue, Mar 20, 2018 at 09:43:18AM +0800, Baoquan He wrote: > On 02/23/18 at 04:36pm, Dave Young wrote: > > Hi AKASHI, > > > > On 02/22/18 at 08:17pm, AKASHI Takahiro wrote: > > > This function, being a variant of walk_system_ram_res() introduced in > &

Re: [PATCH v2 0/7] kexec_file, x86, powerpc: refactoring for other architecutres

2018-03-09 Thread AKASHI Takahiro
Dave, On Fri, Mar 09, 2018 at 03:55:47PM +0800, Dave Young wrote: > On 03/09/18 at 03:46pm, Dave Young wrote: > > Hi AKASHI, > > > > On 03/09/18 at 04:18pm, AKASHI Takahiro wrote: > > > Dave, > > > > > > On Fri, Mar 09, 2018 at 02:44:12PM +0800,

Re: [PATCH v2 0/7] kexec_file, x86, powerpc: refactoring for other architecutres

2018-03-08 Thread AKASHI Takahiro
Dave, On Fri, Mar 09, 2018 at 02:44:12PM +0800, Dave Young wrote: > On 03/09/18 at 02:02pm, Dave Young wrote: > > On 03/08/18 at 09:05am, Dave Young wrote: > > > [Cc Andrew] > > > > > > On 03/06/18 at 07:22pm, AKASHI Takahiro wrote: > > > > This

Re: [PATCH 0/2] ESRT fixes for relocatable kexec'd kernel

2018-03-08 Thread AKASHI Takahiro
Ard, On Wed, Mar 07, 2018 at 07:55:34PM +, Ard Biesheuvel wrote: > (+ James) > > Hello Akashi, > > On 6 March 2018 at 09:00, AKASHI Takahiro <takahiro.aka...@linaro.org> wrote: > > Tyler, Jeffrey, > > > > On Fri, Mar 02, 2018 at 08:27:11AM -0500, Tyl

Re: [PATCH 0/7] kexec_file: refactoring for other architecutres

2018-03-06 Thread AKASHI Takahiro
Dave, On Mon, Mar 05, 2018 at 10:36:07AM +0800, Dave Young wrote: > On 03/02/18 at 01:56pm, Dave Young wrote: > > Hi AKASHI, > > On 02/27/18 at 01:48pm, AKASHI Takahiro wrote: > > > subject: > > > > > > This is a preparatory patch

[PATCH v2 6/7] x86: kexec_file: clean up prepare_elf64_headers()

2018-03-06 Thread AKASHI Takahiro
removing bufp variable in prepare_elf64_headers() makes the code simpler and more understandable. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Dave Young <dyo...@redhat.com> Cc: Vivek Goyal <vgo...@redhat.com> Cc: Baoquan He <b...@redhat.com> --- arch

[PATCH v2 5/7] x86: kexec_file: lift CRASH_MAX_RANGES limit on crash_mem buffer

2018-03-06 Thread AKASHI Takahiro
While CRASH_MAX_RANGES (== 16) seems to be good enough, fixed-number array is not a good idea in general. In this patch, size of crash_mem buffer is calculated as before and the buffer is now dynamically allocated. This change also allows removing crash_elf_data structure. Signed-off-by: AKASHI

[PATCH v2 7/7] kexec_file, x86: move re-factored code to generic side

2018-03-06 Thread AKASHI Takahiro
In the previous patches, commonly-used routines, exclude_mem_range() and prepare_elf64_headers(), were carved out. Now place them in kexec common code. A prefix "crash_" is given to each of their names to avoid possible name collisions. Signed-off-by: AKASHI Takahiro <takahiro.aka.

[PATCH v2 3/7] x86: kexec_file: purge system-ram walking from prepare_elf64_headers()

2018-03-06 Thread AKASHI Takahiro
, prepare_elf64_headers_callback(), is now responsible for filling up crash_mem buffer. Meanwhile exclude_elf_header_ranges() used to be called every time in this callback it is rather redundant and now called only once in prepare_elf_headers() as well. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc

[PATCH v2 4/7] x86: kexec_file: remove X86_64 dependency from prepare_elf64_headers()

2018-03-06 Thread AKASHI Takahiro
The code guarded by CONFIG_X86_64 is necessary on some architectures which have a dedicated kernel mapping outside of linear memory mapping. (arm64 is among those.) In this patch, an additional argument, kernel_map, is added to enable/ disable the code removing #ifdef. Signed-off-by: AKASHI

[PATCH v2 2/7] kexec_file,x86,powerpc: factor out kexec_file_ops functions

2018-03-06 Thread AKASHI Takahiro
As arch_kexec_kernel_image_{probe,load}(), arch_kimage_file_post_load_cleanup() and arch_kexec_kernel_verify_sig() are almost duplicated among architectures, they can be commonalized with an architecture-defined kexec_file_ops array. So let's factor them out. Signed-off-by: AKASHI Takahiro

[PATCH v2 1/7] kexec_file: make an use of purgatory optional

2018-03-06 Thread AKASHI Takahiro
, ARCH_HAS_KEXEC_PURGATORY, and allows related code to be compiled in only if necessary. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Dave Young <dyo...@redhat.com> Cc: Vivek Goyal <vgo...@redhat.com> Cc: Baoquan He <b...@redhat.com> --- arch/powerpc/Kconfig |

[PATCH v2 0/7] kexec_file, x86, powerpc: refactoring for other architecutres

2018-03-06 Thread AKASHI Takahiro
h_elf_data() and use vzalloc() instead of vmalloc() AKASHI Takahiro (7): kexec_file: make an use of purgatory optional kexec_file,x86,powerpc: factor out kexec_file_ops functions x86: kexec_file: purge system-ram walking from prepare_elf64_headers() x86: kexec_file: remove X86_64 depen

Re: [PATCH 0/2] ESRT fixes for relocatable kexec'd kernel

2018-03-06 Thread AKASHI Takahiro
Tyler, Jeffrey, On Fri, Mar 02, 2018 at 08:27:11AM -0500, Tyler Baicar wrote: > On 3/2/2018 12:53 AM, AKASHI Takahiro wrote: > >Tyler, Jeffrey, > > > >[Note: This issue takes place in kexec, not kdump. So to be precise, > >it is not the same phenomenon as what I add

Re: [PATCH 1/7] kexec_file: make an use of purgatory optional

2018-03-01 Thread AKASHI Takahiro
On Fri, Mar 02, 2018 at 02:11:14PM +0800, Dave Young wrote: > On 03/02/18 at 01:58pm, Dave Young wrote: > > On 02/27/18 at 01:48pm, AKASHI Takahiro wrote: > > > On arm64, crash dump kernel's usable memory is protected by > > > *unmapping* it from kernel virtual space

Re: [PATCH 2/7] kexec_file,x86,powerpc: factor out kexec_file_ops functions

2018-03-01 Thread AKASHI Takahiro
On Fri, Mar 02, 2018 at 02:08:57PM +0800, Dave Young wrote: > On 03/02/18 at 01:53pm, Dave Young wrote: > > On 03/02/18 at 02:24pm, AKASHI Takahiro wrote: > > > On Fri, Mar 02, 2018 at 01:04:26PM +0800, Dave Young wrote: > > > > On 02/27/18 at

Re: [PATCH 6/7] x86: kexec_file: clean up prepare_elf64_headers()

2018-03-01 Thread AKASHI Takahiro
On Fri, Mar 02, 2018 at 01:39:45PM +0800, Dave Young wrote: > On 02/27/18 at 01:48pm, AKASHI Takahiro wrote: > > removing bufp variable in prepare_elf64_headers() makes the code simpler > > and more understandable. > > > > Signed-off-by: AKASHI Takahiro <takahiro.a

Re: [PATCH 5/7] x86: kexec_file: lift CRASH_MAX_RANGES limit on crash_mem buffer

2018-03-01 Thread AKASHI Takahiro
On Fri, Mar 02, 2018 at 01:31:53PM +0800, Dave Young wrote: > On 02/27/18 at 01:48pm, AKASHI Takahiro wrote: > > While CRASH_MAX_RANGES (== 16) seems to be good enough, fixed-number > > array is not a good idea in general. > > > > In this patch, size of crash_mem buf

Re: [PATCH 4/7] x86: kexec_file: remove X86_64 dependency from prepare_elf64_headers()

2018-03-01 Thread AKASHI Takahiro
On Fri, Mar 02, 2018 at 01:19:56PM +0800, Dave Young wrote: > On 02/27/18 at 01:48pm, AKASHI Takahiro wrote: > > The code guarded by CONFIG_X86_64 is necessary on some architectures > > which have a dedicated kernel mapping outside of linear memory mapping. > >

Re: [PATCH 2/7] kexec_file,x86,powerpc: factor out kexec_file_ops functions

2018-03-01 Thread AKASHI Takahiro
On Fri, Mar 02, 2018 at 01:04:26PM +0800, Dave Young wrote: > On 02/27/18 at 01:48pm, AKASHI Takahiro wrote: > > As arch_kexec_kernel_image_{probe,load}(), > > arch_kimage_file_post_load_cleanup() and arch_kexec_kernel_verify_sig() > > are almost duplicated among ar

Re: [PATCH v8 03/13] kexec_file,x86,powerpc: factor out kexec_file_ops functions

2018-02-28 Thread AKASHI Takahiro
On Wed, Feb 28, 2018 at 08:38:00PM +0800, Dave Young wrote: > On 02/26/18 at 07:01pm, AKASHI Takahiro wrote: > > On Fri, Feb 23, 2018 at 05:24:59PM +0800, Dave Young wrote: > > > Hi AKASHI, > > > > > > On 02/22/18 at 08:17pm, AKASHI Takahiro wrote: > &

Re: [PATCH v8 02/13] kexec_file: make an use of purgatory optional

2018-02-28 Thread AKASHI Takahiro
On Wed, Feb 28, 2018 at 08:33:59PM +0800, Dave Young wrote: > On 02/26/18 at 07:24pm, AKASHI Takahiro wrote: > > On Fri, Feb 23, 2018 at 04:49:34PM +0800, Dave Young wrote: > > > Hi AKASHI, > > > > > > On 02/22/18 at 08:17pm, AKASHI Takahiro wrote: > > &

Re: [PATCH 0/2] ESRT fixes for relocatable kexec'd kernel

2018-02-28 Thread AKASHI Takahiro
Hi, On Wed, Feb 28, 2018 at 08:39:42AM -0700, Jeffrey Hugo wrote: > On 2/27/2018 11:19 PM, AKASHI Takahiro wrote: > >Tyler, > > > ># I missed catching your patch as its subject doesn't contain arm64. > > > >On Fri, Feb 23, 2018 at 12:42:31PM -0700, Tyler Baicar w

Re: [PATCH 0/2] ESRT fixes for relocatable kexec'd kernel

2018-02-27 Thread AKASHI Takahiro
Tyler, # I missed catching your patch as its subject doesn't contain arm64. On Fri, Feb 23, 2018 at 12:42:31PM -0700, Tyler Baicar wrote: > Currently on arm64 ESRT memory does not appear to be properly blocked off. > Upon successful initialization, ESRT prints out the memory region that it >

Re: [PATCH v8 00/13] arm64: kexec: add kexec_file_load() support

2018-02-26 Thread AKASHI Takahiro
Now my patch#2 to #5 were extracted from this patch set and put into another separate one. Please see http://lists.infradead.org/pipermail/linux-arm-kernel/2018-February/562195.htmlk Thanks, -Takahiro AKASHI On Thu, Feb 22, 2018 at 08:17:19PM +0900, AKASHI Takahiro wrote: > This is the eig

[PATCH 3/7] x86: kexec_file: purge system-ram walking from prepare_elf64_headers()

2018-02-26 Thread AKASHI Takahiro
, prepare_elf64_headers_callback(), is now responsible for filling up crash_mem buffer. Meanwhile exclude_elf_header_ranges() used to be called every time in this callback it is rather redundant and now called only once in prepare_elf_headers() as well. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc

[PATCH 4/7] x86: kexec_file: remove X86_64 dependency from prepare_elf64_headers()

2018-02-26 Thread AKASHI Takahiro
The code guarded by CONFIG_X86_64 is necessary on some architectures which have a dedicated kernel mapping outside of linear memory mapping. (arm64 is among those.) In this patch, an additional argument, kernel_map, is added to enable/ disable the code removing #ifdef. Signed-off-by: AKASHI

[PATCH 7/7] kexec_file, x86: move re-factored code to generic side

2018-02-26 Thread AKASHI Takahiro
In the previous patches, commonly-used routines, exclude_mem_range() and prepare_elf64_headers(), were carved out. Now place them in kexec common code. A prefix "crash_" is given to each of their names to avoid possible name collisions. Signed-off-by: AKASHI Takahiro <takahiro.aka.

[PATCH 6/7] x86: kexec_file: clean up prepare_elf64_headers()

2018-02-26 Thread AKASHI Takahiro
removing bufp variable in prepare_elf64_headers() makes the code simpler and more understandable. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Dave Young <dyo...@redhat.com> Cc: Vivek Goyal <vgo...@redhat.com> Cc: Baoquan He <b...@redhat.com> --- arch

[PATCH 1/7] kexec_file: make an use of purgatory optional

2018-02-26 Thread AKASHI Takahiro
, ARCH_HAS_KEXEC_PURGATORY, and allows related code to be compiled in only if necessary. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Dave Young <dyo...@redhat.com> Cc: Vivek Goyal <vgo...@redhat.com> Cc: Baoquan He <b...@redhat.com> --- arch/powerpc/Kconfig |

[PATCH 0/7] kexec_file: refactoring for other architecutres

2018-02-26 Thread AKASHI Takahiro
//hypermail/linux/kernel/1802.1/02596.html [3] http://lists.infradead.org/pipermail/linux-arm-kernel/2018-February/562041.html AKASHI Takahiro (7): kexec_file: make an use of purgatory optional kexec_file,x86,powerpc: factor out kexec_file_ops functions x86: kexec_file: purge system-ram walking

[PATCH 5/7] x86: kexec_file: lift CRASH_MAX_RANGES limit on crash_mem buffer

2018-02-26 Thread AKASHI Takahiro
While CRASH_MAX_RANGES (== 16) seems to be good enough, fixed-number array is not a good idea in general. In this patch, size of crash_mem buffer is calculated as before and the buffer is now dynamically allocated. This change also allows removing crash_elf_data structure. Signed-off-by: AKASHI

[PATCH 2/7] kexec_file,x86,powerpc: factor out kexec_file_ops functions

2018-02-26 Thread AKASHI Takahiro
As arch_kexec_kernel_image_{probe,load}(), arch_kimage_file_post_load_cleanup() and arch_kexec_kernel_verify_sig() are almost duplicated among architectures, they can be commonalized with an architecture-defined kexec_file_ops array. So let's factor them out. Signed-off-by: AKASHI Takahiro

Re: [PATCH v8 03/13] kexec_file, x86, powerpc: factor out kexec_file_ops functions

2018-02-26 Thread AKASHI Takahiro
On Mon, Feb 26, 2018 at 12:17:18PM +0100, Philipp Rudo wrote: > Hi AKASHI > > On Thu, 22 Feb 2018 20:17:22 +0900 > AKASHI Takahiro <takahiro.aka...@linaro.org> wrote: > > [...] > > > diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c > >

Re: [PATCH v8 02/13] kexec_file: make an use of purgatory optional

2018-02-26 Thread AKASHI Takahiro
On Fri, Feb 23, 2018 at 04:49:34PM +0800, Dave Young wrote: > Hi AKASHI, > > On 02/22/18 at 08:17pm, AKASHI Takahiro wrote: > > On arm64, no trampline code between old kernel and new kernel will be > > required in kexec_file implementation. This patch introduces a

Re: [PATCH v8 03/13] kexec_file,x86,powerpc: factor out kexec_file_ops functions

2018-02-26 Thread AKASHI Takahiro
On Fri, Feb 23, 2018 at 05:24:59PM +0800, Dave Young wrote: > Hi AKASHI, > > On 02/22/18 at 08:17pm, AKASHI Takahiro wrote: > > As arch_kexec_kernel_*_{probe,load}(), arch_kimage_file_post_load_cleanup() > > and arch_kexec_kernel_verify_sg can be parameterized with a kex

Re: [PATCH v8 04/13] x86: kexec_file: factor out elf core header related functions

2018-02-26 Thread AKASHI Takahiro
On Sat, Feb 24, 2018 at 11:15:03AM +0800, Dave Young wrote: > Hi AKASHI, > On 02/22/18 at 08:17pm, AKASHI Takahiro wrote: > > exclude_mem_range() and prepare_elf64_headers() can be re-used on other > > architectures, including arm64, as well. So let them factored out so a

Re: [PATCH 00/17] Add kexec_file_load support to s390

2018-02-25 Thread AKASHI Takahiro
On Sat, Feb 24, 2018 at 09:59:56AM +0800, Dave Young wrote: > On 02/23/18 at 11:01am, Philipp Rudo wrote: > > Hi Dave > > > > On Fri, 23 Feb 2018 16:34:05 +0800 > > Dave Young wrote: > > > > > On 02/14/18 at 10:54am, Philipp Rudo wrote: > > > > Hi Dave, > > > > > > > > I

[PATCH v8 12/13] include: pe.h: remove message[] from mz header definition

2018-02-22 Thread AKASHI Takahiro
ddr(cursor, mz->peaddr, sizeof(*pe)); Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheu...@linaro.org> Cc: David Howells <dhowe...@redhat.com> Cc: Vivek Goyal <vgo...@redhat.com> Cc: Herbert Xu <herb...@gond

[PATCH v8 13/13] arm64: kexec_file: enable KEXEC_VERIFY_SIG for Image

2018-02-22 Thread AKASHI Takahiro
CONFIG_EFI is enabled, we adopt this format for kernel signing. You can create a signed kernel image with: $ sbsign --key ${KEY} --cert ${CERT} Image Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Catalin Marinas <catalin.mari...@arm.com> Cc: Will Deacon <will.dea...

[PATCH v8 11/13] arm64: kexec_file: enable KEXEC_FILE config

2018-02-22 Thread AKASHI Takahiro
Modify arm64/Kconfig to enable kexec_file_load support. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Catalin Marinas <catalin.mari...@arm.com> Cc: Will Deacon <will.dea...@arm.com> --- arch/arm64/Kconfig | 10 ++ 1 file changed, 10 insertions(+)

[PATCH v8 10/13] arm64: kexec_file: add Image format support

2018-02-22 Thread AKASHI Takahiro
.pem Image On live system, you must have IMA enforced with, at least, the following security policy: "appraise func=KEXEC_KERNEL_CHECK appraise_type=imasig" Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Catalin Marinas <catalin.mari...@arm.com> Cc: Will Deacon

[PATCH v8 08/13] arm64: kexec_file: load initrd and device-tree

2018-02-22 Thread AKASHI Takahiro
in load_other_segments(). Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Catalin Marinas <catalin.mari...@arm.com> Cc: Will Deacon <will.dea...@arm.com> --- arch/arm64/include/asm/kexec.h | 19 arch/arm64/kernel/Makefile | 3 +- arch/arm64/kernel/ma

[PATCH v8 09/13] arm64: kexec_file: add crash dump support

2018-02-22 Thread AKASHI Takahiro
used on crash dump kernel and a region of ELF core header (The logic of this cod is also from kexec-tools.) Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Catalin Marinas <catalin.mari...@arm.com> Cc: Will Deacon <will.dea...@arm.com> --- arch/arm64/include/a

[PATCH v8 03/13] kexec_file,x86,powerpc: factor out kexec_file_ops functions

2018-02-22 Thread AKASHI Takahiro
As arch_kexec_kernel_*_{probe,load}(), arch_kimage_file_post_load_cleanup() and arch_kexec_kernel_verify_sg can be parameterized with a kexec_file_ops array and now duplicated among some architectures, let's factor them out. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc

[PATCH v8 05/13] kexec_file, x86: move re-factored code to generic side

2018-02-22 Thread AKASHI Takahiro
In the previous patch, commonly-used routines were carved out. Now place them in kexec common code. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Dave Young <dyo...@redhat.com> Cc: Vivek Goyal <vgo...@redhat.com> Cc: Baoquan He <b...@redhat.com> ---

[PATCH v8 07/13] arm64: kexec_file: invoke the kernel without purgatory

2018-02-22 Thread AKASHI Takahiro
On arm64, purugatory would do almosty nothing. So just invoke the second kernel by jumping into the entry code directly. While, in this case, cpu_soft_restart() must be called in a specific way, it still stays compatible with kexec as far as the fifth argument is null. Signed-off-by: AKASHI

[PATCH v8 04/13] x86: kexec_file: factor out elf core header related functions

2018-02-22 Thread AKASHI Takahiro
resources (/proc/iomem) for a list of "System RAM", but leave it private for now. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Dave Young <dyo...@redhat.com> Cc: Vivek Goyal <vgo...@redhat.com> Cc: Baoquan He <b...@redhat.com>

[PATCH v8 06/13] asm-generic: add kexec_file_load system call to unistd.h

2018-02-22 Thread AKASHI Takahiro
The initial user of this system call number is arm64. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Acked-by: Arnd Bergmann <a...@arndb.de> --- include/uapi/asm-generic/unistd.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/uapi/asm-gene

[PATCH v8 01/13] resource: add walk_system_ram_res_rev()

2018-02-22 Thread AKASHI Takahiro
kexec_file implementation on arm64. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.org> Cc: Vivek Goyal <vgo...@redhat.com> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Linus Torvalds <torva...@linux-foundation.org> --- include/linux/ioport.h |

[PATCH v8 02/13] kexec_file: make an use of purgatory optional

2018-02-22 Thread AKASHI Takahiro
On arm64, no trampline code between old kernel and new kernel will be required in kexec_file implementation. This patch introduces a new configuration, ARCH_HAS_KEXEC_PURGATORY, and allows related code to be compiled in only if necessary. Signed-off-by: AKASHI Takahiro <takahiro.aka...@linaro.

[PATCH v8 00/13] arm64: kexec: add kexec_file_load() support

2018-02-22 Thread AKASHI Takahiro
_FILE support (additionally allowing for IMA-based verification): Patch #1 to #6 are all preparatory patches on generic side. Patch #7 to #11 are to enable kexec_file_load on arm64. Patch #12 to #13 are for KEXEC_VERIFY_SIG (arch-specific verification) support AKASHI Takahiro (13): resource: add

Re: [PATCH] arm64: acpi,efi: fix alignment fault in accessing ACPI tables at kdump

2018-02-15 Thread AKASHI Takahiro
, 2018 at 04:03:56PM +, James Morse wrote: > Hi Akashi, Ard, > > On 02/02/18 04:35, AKASHI Takahiro wrote: > > On Thu, Feb 01, 2018 at 05:34:26PM +, Ard Biesheuvel wrote: > >> On 1 February 2018 at 09:04, AKASHI Takahiro <takahiro.aka...@linaro.org> > >

  1   2   3   4   5   6   7   >