On Mon, Feb 12, 2018 at 11:07 AM, Philipp Rudo wrote:
> 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
When inspecting __kexec_load_purgatory you find that it has two tasks
1) setting up the kexec_buffer for the new kernel and,
2) setting up pi->sechdrs for the final load address.
The two tasks are independent of each other. To improve readability split
up __kexec_load_purgatory
For s390 new kernels are loaded to fixed addresses in memory before they
are booted. With the current code this is a problem as it assumes the
kernel will be loaded to an 'arbitrary' address. In particular,
kexec_locate_mem_hole searches for a large enough memory region and sets
the load address
When the relocations are applied to the purgatory only the section the
relocations are applied to is writable. The other sections, i.e. the symtab
and .rel/.rela, are in read-only kexec_purgatory. Highlight this by marking
the corresponding variables as 'const'.
While at it also change the
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
---
arch/s390/include/asm/kexec.h | 1 +
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
---
include/linux/kexec.h |
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
The code to verify the new kernels sha digest are applicable for all
architectures. Move it to common code.
Signed-off-by: Philipp Rudo
---
arch/x86/purgatory/Makefile| 3 +++
arch/x86/purgatory/purgatory.c | 2 +-
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
---
arch/s390/Kconfig | 4 +
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
Reviewed-by: Martin Schwidefsky
---
The current code uses the sh_offset field in purgatory_info->sechdrs to
store a pointer to the current load address of the section. Depending
whether the section will be loaded or not this is either a pointer into
purgatory_info->purgatory_buf or kexec_purgatory. This is not only a
violation of
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.
No changes made to the patches since first time i sent them. The patches
apply to the current master (v4.16-rc1).
Thanks
Philipp
---
this
Add support to load a crash kernel to the image loader. This requires
extending the purgatory.
Signed-off-by: Philipp Rudo
Reviewed-by: Martin Schwidefsky
---
arch/s390/kernel/kexec_image.c| 6 +-
arch/s390/kernel/machine_kexec_file.c
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
---
arch/s390/Kbuild | 1 +
arch/s390/include/asm/purgatory.h | 17 +++
To update the entry point there is an extra loop over all section headers
although this can be done in the main loop. So move it there and eliminate
the extra loop and variable to store the 'entry section index'.
Also, in the main loop, move the usual case, i.e. non-bss section, out of
the extra
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
---
kernel/kexec_file.c | 38
Before the purgatory is loaded several checks are done whether the ELF file
in kexec_purgatory is valid or not. These checks are incomplete. For
example they don't check for the total size of the sections defined in the
section header table or if the entry point actually points into the
purgatory.
When building the kernel with CONFIG_KEXEC_FILE enabled gcc prints a
compile warning multiple times.
In file included from /linux/init/initramfs.c:526:0:
/include/linux/kexec.h:120:9: warning: ‘struct kimage’ declared inside
parameter list [enabled by default]
unsigned long
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
---
kernel/kexec_file.c | 34 --
1 file changed, 12 insertions(+),
On Mon, 12 Feb 2018 11:56:25 +0100
Philippe Ombredanne wrote:
> On Mon, Feb 12, 2018 at 11:07 AM, Philipp Rudo
> wrote:
> > This patch adds the kexec_file_load system call to s390 as well as the arch
> > specific functions common code requires to
20 matches
Mail list logo