[PATCH 04/17] kexec_file: Search symbols in read-only kexec_purgatory

2018-02-02 Thread Philipp Rudo
The stripped purgatory does not contain a symtab. So when looking for symbols this is done in read-only kexec_purgatory. Highlight this by marking the corresponding variables as 'const'. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- kernel/kexec_file.

[PATCH 05/17] kexec_file: Use read-only sections in arch_kexec_apply_relocations*

2018-02-02 Thread Philipp Rudo
the signatures of arch_kexec_apply_relocations* to take section pointers instead of just the index of the relocation section. This removes the second lookup and sanity check of the sections in arch code. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/x86/kernel/machine_kexec_64.

[PATCH 02/17] kexec_file: Remove checks in kexec_purgatory_load

2018-02-02 Thread Philipp Rudo
. On the other hand the purgatory, although an ELF file on its own, is part of the kernel. Thus not trusting the purgatory means not trusting the kernel build itself. So remove all validity checks on the purgatory and just trust the kernel build. Signed-off-by: Philipp Rudo <

[PATCH 07/17] kexec_file: Simplify kexec_purgatory_setup_sechdrs 1

2018-02-02 Thread Philipp Rudo
if-block. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> Reviewed-by: Martin Schwidefsky <schwidef...@de.ibm.com> --- kernel/kexec_file.c | 76 + 1 file changed, 30 insertions(+), 46 deletions(-) diff --git a/kernel/kexec_fil

[PATCH 06/17] kexec_file: Split up __kexec_load_puragory

2018-02-02 Thread Philipp Rudo
ory into two functions, one for each task, and call them directly from kexec_load_purgatory. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- kernel/kexec_file.c | 200 +++- 1 file changed, 103 insertions(+), 97 deletions(-) diff --git

[PATCH 09/17] kexec_file: Remove mis-use of sh_offset field

2018-02-02 Thread Philipp Rudo
lation of the ELF standard but also makes the code very hard to understand as you cannot tell if the memory you are using is read-only or not. Remove this mis-use and store the offset of the section in pugaroty_info->purgatory_buf in sh_offset. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.co

[PATCH 08/17] kexec_file: Simplify kexec_purgatory_setup_sechdrs 2

2018-02-02 Thread Philipp Rudo
The main loop currently uses quite a lot of variables to update the section headers. Some of them are unnecessary. So clean them up a little. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- kernel/kexec_file.c | 34 -- 1 file changed, 12 inse

[PATCH 01/17] kexec_file: Silence compile warnings

2018-02-02 Thread Philipp Rudo
); ^ This is because the typedefs for kexec_file_load uses struct kimage before it is declared. Fix this by simply forward declaring struct kimage. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- include/linux/kexec.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/i

[PATCH 11/17] kexec_file: Move purgatories sha256 to common code

2018-02-02 Thread Philipp Rudo
The code to verify the new kernels sha digest are applicable for all architectures. Move it to common code. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/x86/purgatory/Makefile| 3 +++ arch/x86/purgatory/purgatory.c | 2 +- {ar

[PATCH 10/17] kexec_file: Allow archs to set purgatory load address

2018-02-02 Thread Philipp Rudo
hat we can get rid of the purgatory_info->purgatory_load_address field. As now the information stored there can directly be accessed from kbuf->mem. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> Reviewed-by: Martin Schwidefsky <schwidef...@de.ibm.com> --- arch/powerpc/ke

[PATCH 13/17] s390/kexec_file: Add purgatory

2018-02-02 Thread Philipp Rudo
The common code expects the architecture to have a purgatory that runs between the two kernels. Add it now. For simplicity first skip crash support. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/s390/Kbuild | 1 + arch/s390/include/asm/purgatory.

[PATCH 00/17] Add kexec_file_load support to s390

2018-02-02 Thread Philipp Rudo
have a way to test it. Cross-compiling with defconfig(*) works fine for both. Thanks Philipp (*) On x86 with the orc unwinder turned off. objtool SEGFAULTs on s390... Philipp Rudo (17): kexec_file: Silence compile warnings kexec_file: Remove checks in kexec_purgatory_load kexec_file: Make purg

[PATCH 03/17] kexec_file: Make purgatory_info->ehdr const

2018-02-02 Thread Philipp Rudo
The kexec_purgatory buffer is read-only. Thus all pointers into kexec_purgatory are read-only, too. Point this out by explicitly marking purgatory_info->ehdr as 'const' and update the comments in purgatory_info. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- include/linu

[PATCH 16/17] s390/kexec_file: Add crash support to image loader

2018-02-02 Thread Philipp Rudo
Add support to load a crash kernel to the image loader. This requires extending the purgatory. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> Reviewed-by: Martin Schwidefsky <schwidef...@de.ibm.com> --- arch/s390/kernel/kexec_image.c| 6 +- arch/s390/kernel/machine_

[PATCH 17/17] s390/kexec_file: Add ELF loader

2018-02-02 Thread Philipp Rudo
Add an ELF loader for kexec_file. The main task here is to do proper sanity checks on the ELF file. Basically all other functionality was already implemented for the image loader. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/s390/include/asm/kexec.h | 1 + arc

[PATCH 15/17] s390/kexec_file: Add image loader

2018-02-02 Thread Philipp Rudo
Add an image loader for kexec_file_load. For simplicity first skip crash support. The functions defined in machine_kexec_file will later be shared with the ELF loader. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> Reviewed-by: Martin Schwidefsky <schwidef...@de.ibm.com> --

[PATCH 14/17] s390/kexec_file: Add kexec_file_load system call

2018-02-02 Thread Philipp Rudo
This patch adds the kexec_file_load system call to s390 as well as the arch specific functions common code requires to work. Loaders for the different file types will be added later. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/s390/Kconfig | 4 +

[PATCH 12/17] s390/kexec_file: Prepare setup.h for kexec_file_load

2018-02-02 Thread Philipp Rudo
kexec_file_load needs to prepare the new kernels before they are loaded. For that it has to know the offsets in head.S, e.g. to register the new command line. Unfortunately there are no macros right now defining those offsets. Define them now. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.

Re: [PATCH 14/17] s390/kexec_file: Add kexec_file_load system call

2018-02-12 Thread Philipp Rudo
On Mon, 12 Feb 2018 11:56:25 +0100 Philippe Ombredanne <pombreda...@nexb.com> wrote: > On Mon, Feb 12, 2018 at 11:07 AM, Philipp Rudo <pr...@linux.vnet.ibm.com> > wrote: > > This patch adds the kexec_file_load system call to s390 as well as the arch > > specific

[PATCH 13/17] s390/kexec_file: Add purgatory

2018-02-12 Thread Philipp Rudo
The common code expects the architecture to have a purgatory that runs between the two kernels. Add it now. For simplicity first skip crash support. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/s390/Kbuild | 1 + arch/s390/include/asm/purgatory.

[PATCH 15/17] s390/kexec_file: Add image loader

2018-02-12 Thread Philipp Rudo
Add an image loader for kexec_file_load. For simplicity first skip crash support. The functions defined in machine_kexec_file will later be shared with the ELF loader. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> Reviewed-by: Martin Schwidefsky <schwidef...@de.ibm.com> --

[PATCH 16/17] s390/kexec_file: Add crash support to image loader

2018-02-12 Thread Philipp Rudo
Add support to load a crash kernel to the image loader. This requires extending the purgatory. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> Reviewed-by: Martin Schwidefsky <schwidef...@de.ibm.com> --- arch/s390/kernel/kexec_image.c| 6 +- arch/s390/kernel/machine_

[PATCH 10/17] kexec_file: Allow archs to set purgatory load address

2018-02-12 Thread Philipp Rudo
hat we can get rid of the purgatory_info->purgatory_load_address field. As now the information stored there can directly be accessed from kbuf->mem. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> Reviewed-by: Martin Schwidefsky <schwidef...@de.ibm.com> --- arch/powerpc/ke

[PATCH 11/17] kexec_file: Move purgatories sha256 to common code

2018-02-12 Thread Philipp Rudo
The code to verify the new kernels sha digest are applicable for all architectures. Move it to common code. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/x86/purgatory/Makefile| 3 +++ arch/x86/purgatory/purgatory.c | 2 +- {ar

[PATCH 12/17] s390/kexec_file: Prepare setup.h for kexec_file_load

2018-02-12 Thread Philipp Rudo
kexec_file_load needs to prepare the new kernels before they are loaded. For that it has to know the offsets in head.S, e.g. to register the new command line. Unfortunately there are no macros right now defining those offsets. Define them now. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.

[PATCH 03/17] kexec_file: Make purgatory_info->ehdr const

2018-02-12 Thread Philipp Rudo
The kexec_purgatory buffer is read-only. Thus all pointers into kexec_purgatory are read-only, too. Point this out by explicitly marking purgatory_info->ehdr as 'const' and update the comments in purgatory_info. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- include/linu

[PATCH 06/17] kexec_file: Split up __kexec_load_puragory

2018-02-12 Thread Philipp Rudo
ory into two functions, one for each task, and call them directly from kexec_load_purgatory. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- kernel/kexec_file.c | 200 +++- 1 file changed, 103 insertions(+), 97 deletions(-) diff --git

[PATCH 01/17] kexec_file: Silence compile warnings

2018-02-12 Thread Philipp Rudo
); ^ This is because the typedefs for kexec_file_load uses struct kimage before it is declared. Fix this by simply forward declaring struct kimage. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- include/linux/kexec.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/i

[PATCH 05/17] kexec_file: Use read-only sections in arch_kexec_apply_relocations*

2018-02-12 Thread Philipp Rudo
the signatures of arch_kexec_apply_relocations* to take section pointers instead of just the index of the relocation section. This removes the second lookup and sanity check of the sections in arch code. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/x86/kernel/machine_kexec_64.

[PATCH 00/17] Add kexec_file_load support to s390

2018-02-12 Thread Philipp Rudo
-compiling with defconfig(*) works fine for both. Thanks Philipp (*) On x86 with the orc unwinder turned off. objtool SEGFAULTs on s390... Philipp Rudo (17): kexec_file: Silence compile warnings kexec_file: Remove checks in kexec_purgatory_load kexec_file: Make purgatory_info->ehdr const

[PATCH 04/17] kexec_file: Search symbols in read-only kexec_purgatory

2018-02-12 Thread Philipp Rudo
The stripped purgatory does not contain a symtab. So when looking for symbols this is done in read-only kexec_purgatory. Highlight this by marking the corresponding variables as 'const'. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- kernel/kexec_file.

[PATCH 07/17] kexec_file: Simplify kexec_purgatory_setup_sechdrs 1

2018-02-12 Thread Philipp Rudo
if-block. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> Reviewed-by: Martin Schwidefsky <schwidef...@de.ibm.com> --- kernel/kexec_file.c | 76 + 1 file changed, 30 insertions(+), 46 deletions(-) diff --git a/kernel/kexec_fil

[PATCH 08/17] kexec_file: Simplify kexec_purgatory_setup_sechdrs 2

2018-02-12 Thread Philipp Rudo
The main loop currently uses quite a lot of variables to update the section headers. Some of them are unnecessary. So clean them up a little. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- kernel/kexec_file.c | 34 -- 1 file changed, 12 inse

[PATCH 17/17] s390/kexec_file: Add ELF loader

2018-02-12 Thread Philipp Rudo
Add an ELF loader for kexec_file. The main task here is to do proper sanity checks on the ELF file. Basically all other functionality was already implemented for the image loader. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/s390/include/asm/kexec.h | 1 + arc

[PATCH 09/17] kexec_file: Remove mis-use of sh_offset field

2018-02-12 Thread Philipp Rudo
lation of the ELF standard but also makes the code very hard to understand as you cannot tell if the memory you are using is read-only or not. Remove this mis-use and store the offset of the section in pugaroty_info->purgatory_buf in sh_offset. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.co

[PATCH 02/17] kexec_file: Remove checks in kexec_purgatory_load

2018-02-12 Thread Philipp Rudo
. On the other hand the purgatory, although an ELF file on its own, is part of the kernel. Thus not trusting the purgatory means not trusting the kernel build itself. So remove all validity checks on the purgatory and just trust the kernel build. Signed-off-by: Philipp Rudo <

[PATCH 14/17] s390/kexec_file: Add kexec_file_load system call

2018-02-12 Thread Philipp Rudo
This patch adds the kexec_file_load system call to s390 as well as the arch specific functions common code requires to work. Loaders for the different file types will be added later. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/s390/Kconfig | 4 +

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

2018-02-14 Thread Philipp Rudo
s nice, but still need read the > details. > > On 02/12/18 at 11:07am, Philipp Rudo wrote: > > Hi everybody > > > > resending the series as there was no reaction, yet. Furthermore i was told > > that Andrew and the x86 list should also be CCed, so welcome. > >

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

2018-02-23 Thread Philipp Rudo
Hi Dave On Fri, 23 Feb 2018 16:34:05 +0800 Dave Young <dyo...@redhat.com> wrote: > On 02/14/18 at 10:54am, Philipp Rudo wrote: > > Hi Dave, > > > > I just browsed AKASHI's patches (v7). The way I see it the common code > > changes > > are on differen

Re: [PATCH 09/11] kexec_file: Remove mis-use of sh_offset field

2018-03-12 Thread Philipp Rudo
On Mon, 12 Mar 2018 15:42:18 +0800 Dave Young <dyo...@redhat.com> wrote: > Hi Philipp, > On 03/09/18 at 11:02am, Philipp Rudo wrote: > > Hi Dave, > > > > > > On Fri, 9 Mar 2018 11:14:20 +0800 > > Dave Young <dyo...@redhat.com> wrote: > &g

Re: [PATCH 00/11] kexec_file: Clean up purgatory load

2018-03-14 Thread Philipp Rudo
Hi Ingo, do you have an idea about this? This problem is currently holding me back to send a v2 of the patch set. Thanks Philipp On Mon, 12 Mar 2018 15:40:16 +0800 Dave Young <dyo...@redhat.com> wrote: > Hi Philipp, > On 03/09/18 at 03:25pm, Philipp Rudo wrote: > > Hi Dave,

Re: [PATCH 00/11] kexec_file: Clean up purgatory load

2018-03-15 Thread Philipp Rudo
Hi Dave, On Thu, 15 Mar 2018 15:34:22 +0800 Dave Young <dyo...@redhat.com> wrote: > On 03/12/18 at 03:40pm, Dave Young wrote: > > Hi Philipp, > > On 03/09/18 at 03:25pm, Philipp Rudo wrote: > > > Hi Dave, > > > > > > On Fri, 9 Mar 2018 13:19:40

Re: [PATCH 00/11] kexec_file: Clean up purgatory load

2018-03-09 Thread Philipp Rudo
Hi Dave, On Fri, 9 Mar 2018 13:33:48 +0800 Dave Young <dyo...@redhat.com> wrote: > On 03/09/18 at 01:19pm, Dave Young wrote: > > Hi Philipp, > > On 02/26/18 at 04:16pm, Philipp Rudo wrote: > > > > > > Hi everybody > > > > > > following

Re: [PATCH 08/11] kexec_file: Simplify kexec_purgatory_setup_sechdrs 2

2018-03-09 Thread Philipp Rudo
Hi Dave, On Fri, 9 Mar 2018 11:18:05 +0800 Dave Young <dyo...@redhat.com> wrote: > Hi, > > On 02/26/18 at 04:16pm, Philipp Rudo wrote: > > The main loop currently uses quite a lot of variables to update the section > > headers. Some of them are unnecessary

Re: [PATCH 09/11] kexec_file: Remove mis-use of sh_offset field

2018-03-09 Thread Philipp Rudo
Hi Dave, On Fri, 9 Mar 2018 11:14:20 +0800 Dave Young <dyo...@redhat.com> wrote: > On 02/26/18 at 04:16pm, Philipp Rudo wrote: > > The current code uses the sh_offset field in purgatory_info->sechdrs to > > store a pointer to the current load address of the sectio

Re: [PATCH 11/11] kexec_file: Move purgatories sha256 to common code

2018-03-09 Thread Philipp Rudo
Hi Dave, On Fri, 9 Mar 2018 12:43:53 +0800 Dave Young <dyo...@redhat.com> wrote: > On 02/26/18 at 04:16pm, Philipp Rudo wrote: > > The code to verify the new kernels sha digest are applicable for all > > architectures. Move it to common code. > > > >

Re: [PATCH 00/11] kexec_file: Clean up purgatory load

2018-03-09 Thread Philipp Rudo
Hi Dave, On Fri, 9 Mar 2018 13:19:40 +0800 Dave Young <dyo...@redhat.com> wrote: > Hi Philipp, > On 02/26/18 at 04:16pm, Philipp Rudo wrote: > > > > Hi everybody > > > > following the discussion with Dave and AKASHI, here are the common code > > patch

Re: [PATCH v1 0/2] kexec: Remove "weak" annotations from headers

2018-04-13 Thread Philipp Rudo
Hi Bjorn, in recent patches AKASHI [1] and I [2] made some changes to the declarations you are touching and already removed some of the weak statements. The patches got accepted on linux-next and will (hopefully) be pulled for v4.17. So you should prepare for some merge conflicts. Nevertheless

Re: [PATCH 00/11] kexec_file: Clean up purgatory load

2018-03-20 Thread Philipp Rudo
Hi Dave, sorry for the late answer. On Fri, 16 Mar 2018 14:41:02 +0800 Dave Young <dyo...@redhat.com> wrote: > On 03/15/18 at 11:13am, Philipp Rudo wrote: > > Hi Dave, > > > > On Thu, 15 Mar 2018 15:34:22 +0800 > > Dave Young <dyo...@redhat.com> wro

[PATCH v2 05/11] kexec_file: Use read-only sections in arch_kexec_apply_relocations*

2018-03-21 Thread Philipp Rudo
the signatures of arch_kexec_apply_relocations* to take section pointers instead of just the index of the relocation section. This removes the second lookup and sanity check of the sections in arch code. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/x86/kernel/machine_kexec_64.

[PATCH v2 11/11] kexec_file: Move purgatories sha256 to common code

2018-03-21 Thread Philipp Rudo
to common code and changing the include to linux/string.h both functions are no longer defined. Thus definitions have to be provided in x86/purgatory/string.c Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/x86/purgatory/Makefile| 3 +++ arch/x86/purgatory/purga

[PATCH v2 07/11] kexec_file: Remove unneeded for-loop in kexec_purgatory_setup_sechdrs

2018-03-21 Thread Philipp Rudo
if-block. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> Reviewed-by: Martin Schwidefsky <schwidef...@de.ibm.com> --- kernel/kexec_file.c | 76 + 1 file changed, 30 insertions(+), 46 deletions(-) diff --git a/kernel/kexec_fil

[PATCH v2 01/11] kexec_file: Silence compile warnings

2018-03-21 Thread Philipp Rudo
); ^ This is because the typedefs for kexec_file_load uses struct kimage before it is declared. Fix this by simply forward declaring struct kimage. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- include/linux/kexec.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/i

[PATCH v2 02/11] kexec_file: Remove checks in kexec_purgatory_load

2018-03-21 Thread Philipp Rudo
. On the other hand the purgatory, although an ELF file on its own, is part of the kernel. Thus not trusting the purgatory means not trusting the kernel build itself. So remove all validity checks on the purgatory and just trust the kernel build. Signed-off-by: Philipp Rudo <

[PATCH v2 00/11] kexec_file: Clean up purgatory load

2018-03-21 Thread Philipp Rudo
off. objtool SEGFAULTs on s390... Philipp Rudo (11): kexec_file: Silence compile warnings kexec_file: Remove checks in kexec_purgatory_load kexec_file: Make purgatory_info->ehdr const kexec_file: Search symbols in read-only kexec_purgatory kexec_file: Use re

[PATCH v2 06/11] kexec_file: Split up __kexec_load_puragory

2018-03-21 Thread Philipp Rudo
ory into two functions, one for each task, and call them directly from kexec_load_purgatory. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- kernel/kexec_file.c | 200 +++- 1 file changed, 103 insertions(+), 97 deletions(-) diff --git

[PATCH v2 09/11] kexec_file: Remove mis-use of sh_offset field during purgatory load

2018-03-21 Thread Philipp Rudo
lation of the ELF standard but also makes the code very hard to understand as you cannot tell if the memory you are using is read-only or not. Remove this mis-use and store the offset of the section in pugaroty_info->purgatory_buf in sh_offset. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.co

[PATCH v2 10/11] kexec_file: Allow archs to set purgatory load address

2018-03-21 Thread Philipp Rudo
hat we can get rid of the purgatory_info->purgatory_load_address field. As now the information stored there can directly be accessed from kbuf->mem. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> Reviewed-by: Martin Schwidefsky <schwidef...@de.ibm.com> --- arch/powerpc/ke

[PATCH v2 08/11] kexec_file: Remove unneeded variables in kexec_purgatory_setup_sechdrs

2018-03-21 Thread Philipp Rudo
The main loop currently uses quite a lot of variables to update the section headers. Some of them are unnecessary. So clean them up a little. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- kernel/kexec_file.c | 34 -- 1 file changed, 12 inse

[PATCH v2 04/11] kexec_file: Search symbols in read-only kexec_purgatory

2018-03-21 Thread Philipp Rudo
The stripped purgatory does not contain a symtab. So when looking for symbols this is done in read-only kexec_purgatory. Highlight this by marking the corresponding variables as 'const'. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- kernel/kexec_file.

[PATCH v2 03/11] kexec_file: Make purgatory_info->ehdr const

2018-03-21 Thread Philipp Rudo
The kexec_purgatory buffer is read-only. Thus all pointers into kexec_purgatory are read-only, too. Point this out by explicitly marking purgatory_info->ehdr as 'const' and update the comments in purgatory_info. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- include/linu

Re: [PATCH v2 00/11] kexec_file: Clean up purgatory load

2018-03-23 Thread Philipp Rudo
12:27:40 +0100 Philipp Rudo <pr...@linux.vnet.ibm.com> > wrote: > > > here is the updated patch set including Dave's comments. > > There were some syntactic clashes with the "kexec_file, x86, powerpc: > refactoring for other architecutres" series. Please che

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

2018-02-26 Thread Philipp Rudo
Hi Dave Hi AKASHI On Mon, 26 Feb 2018 10:21:02 +0900 AKASHI Takahiro wrote: > > > > Arch code need arch maintainer to review, maybe either of you can send > > the common part first before the arch code, eg. AKASHI can split the common > > cleanup patches and post

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

2018-02-26 Thread Philipp Rudo
Hi AKASHI On Thu, 22 Feb 2018 20:17:22 +0900 AKASHI Takahiro wrote: [...] > diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c > index 990adae52151..a6d14a768b3e 100644 > --- a/kernel/kexec_file.c > +++ b/kernel/kexec_file.c > @@ -26,34 +26,83 @@ > #include >

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

2018-02-26 Thread Philipp Rudo
On Mon, 26 Feb 2018 19:01:39 +0900 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: > > > As arch_kexec_kernel_*_{probe,load}(), > > >

[PATCH 02/11] kexec_file: Remove checks in kexec_purgatory_load

2018-02-26 Thread Philipp Rudo
. On the other hand the purgatory, although an ELF file on its own, is part of the kernel. Thus not trusting the purgatory means not trusting the kernel build itself. So remove all validity checks on the purgatory and just trust the kernel build. Signed-off-by: Philipp Rudo <

[PATCH 03/11] kexec_file: Make purgatory_info->ehdr const

2018-02-26 Thread Philipp Rudo
The kexec_purgatory buffer is read-only. Thus all pointers into kexec_purgatory are read-only, too. Point this out by explicitly marking purgatory_info->ehdr as 'const' and update the comments in purgatory_info. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- include/linu

[PATCH 07/11] kexec_file: Simplify kexec_purgatory_setup_sechdrs 1

2018-02-26 Thread Philipp Rudo
if-block. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> Reviewed-by: Martin Schwidefsky <schwidef...@de.ibm.com> --- kernel/kexec_file.c | 76 + 1 file changed, 30 insertions(+), 46 deletions(-) diff --git a/kernel/kexec_fil

[PATCH 08/11] kexec_file: Simplify kexec_purgatory_setup_sechdrs 2

2018-02-26 Thread Philipp Rudo
The main loop currently uses quite a lot of variables to update the section headers. Some of them are unnecessary. So clean them up a little. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- kernel/kexec_file.c | 34 -- 1 file changed, 12 inse

[PATCH 05/11] kexec_file: Use read-only sections in arch_kexec_apply_relocations*

2018-02-26 Thread Philipp Rudo
the signatures of arch_kexec_apply_relocations* to take section pointers instead of just the index of the relocation section. This removes the second lookup and sanity check of the sections in arch code. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/x86/kernel/machine_kexec_64.

[PATCH 10/11] kexec_file: Allow archs to set purgatory load address

2018-02-26 Thread Philipp Rudo
hat we can get rid of the purgatory_info->purgatory_load_address field. As now the information stored there can directly be accessed from kbuf->mem. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> Reviewed-by: Martin Schwidefsky <schwidef...@de.ibm.com> --- arch/powerpc/ke

[PATCH 00/11] kexec_file: Clean up purgatory load

2018-02-26 Thread Philipp Rudo
th the orc unwinder and stack validation turned off. objtool SEGFAULTs on s390... Philipp Rudo (11): kexec_file: Silence compile warnings kexec_file: Remove checks in kexec_purgatory_load kexec_file: Make purgatory_info->ehdr const kexec_file: Search symbols in read-only kexec_purgatory ke

[PATCH 09/11] kexec_file: Remove mis-use of sh_offset field

2018-02-26 Thread Philipp Rudo
lation of the ELF standard but also makes the code very hard to understand as you cannot tell if the memory you are using is read-only or not. Remove this mis-use and store the offset of the section in pugaroty_info->purgatory_buf in sh_offset. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.co

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

2018-02-27 Thread Philipp Rudo
On Tue, 27 Feb 2018 11:03:07 +0900 AKASHI Takahiro <takahiro.aka...@linaro.org> wrote: > 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>

[PATCH 06/11] kexec_file: Split up __kexec_load_puragory

2018-02-26 Thread Philipp Rudo
ory into two functions, one for each task, and call them directly from kexec_load_purgatory. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- kernel/kexec_file.c | 200 +++- 1 file changed, 103 insertions(+), 97 deletions(-) diff --git

[PATCH 04/11] kexec_file: Search symbols in read-only kexec_purgatory

2018-02-26 Thread Philipp Rudo
The stripped purgatory does not contain a symtab. So when looking for symbols this is done in read-only kexec_purgatory. Highlight this by marking the corresponding variables as 'const'. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- kernel/kexec_file.

[PATCH 11/11] kexec_file: Move purgatories sha256 to common code

2018-02-26 Thread Philipp Rudo
The code to verify the new kernels sha digest are applicable for all architectures. Move it to common code. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- arch/x86/purgatory/Makefile| 3 +++ arch/x86/purgatory/purgatory.c | 2 +- {ar

[PATCH 01/11] kexec_file: Silence compile warnings

2018-02-26 Thread Philipp Rudo
); ^ This is because the typedefs for kexec_file_load uses struct kimage before it is declared. Fix this by simply forward declaring struct kimage. Signed-off-by: Philipp Rudo <pr...@linux.vnet.ibm.com> --- include/linux/kexec.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/i