Re: [PATCH v2] x86/kexec: Add EFI config table identity mapping for kexec kernel

2023-07-17 Thread Tao Liu
On Mon, Jul 17, 2023 at 10:57 PM Ard Biesheuvel wrote: > > On Mon, 17 Jul 2023 at 15:53, Tao Liu wrote: > > > > Hi Borislav, > > > > On Thu, Jul 13, 2023 at 6:05 PM Borislav Petkov wrote: > > > > > > On Thu, Jun 01, 2023 at 03:20:44PM +0800, Tao Liu wrote: > > > >

Re: [PATCH v2] x86/kexec: Add EFI config table identity mapping for kexec kernel

2023-07-17 Thread Tao Liu
Hi Ard, Thanks for your explanation! On Thu, Jul 13, 2023 at 6:18 PM Ard Biesheuvel wrote: > > On Fri, 7 Jul 2023 at 19:12, Borislav Petkov wrote: > > > > On Fri, Jul 07, 2023 at 10:25:15AM -0500, Michael Roth wrote: > > > ... > > > It would be unfortunate if we finally abandoned this path

Re: [PATCH v2] x86/kexec: Add EFI config table identity mapping for kexec kernel

2023-07-17 Thread Ard Biesheuvel
On Mon, 17 Jul 2023 at 15:53, Tao Liu wrote: > > Hi Borislav, > > On Thu, Jul 13, 2023 at 6:05 PM Borislav Petkov wrote: > > > > On Thu, Jun 01, 2023 at 03:20:44PM +0800, Tao Liu wrote: > > > arch/x86/kernel/machine_kexec_64.c | 35 ++ > > > 1 file changed, 31

Re: [PATCH v2] x86/kexec: Add EFI config table identity mapping for kexec kernel

2023-07-17 Thread Tao Liu
On Mon, Jul 17, 2023 at 10:14 PM Borislav Petkov wrote: > > On Mon, Jul 17, 2023 at 09:53:06PM +0800, Tao Liu wrote: > > ...snip... > > [ 21.360763] nvme0n1: p1 p2 p3 > > [ 21.364207] igc :03:00.0: PTM enabled, 4ns granularity > > [ 21.421097] pps pps1: new PPS source ptp1 > > [

Re: [PATCH v2] x86/kexec: Add EFI config table identity mapping for kexec kernel

2023-07-17 Thread Borislav Petkov
On Mon, Jul 17, 2023 at 09:53:06PM +0800, Tao Liu wrote: > ...snip... > [ 21.360763] nvme0n1: p1 p2 p3 > [ 21.364207] igc :03:00.0: PTM enabled, 4ns granularity > [ 21.421097] pps pps1: new PPS source ptp1 > [ 21.425396] igc :03:00.0 (unnamed net_device) (uninitialized): PHC >

Re: [PATCH v2] x86/kexec: Add EFI config table identity mapping for kexec kernel

2023-07-17 Thread Tao Liu
Hi Borislav, On Thu, Jul 13, 2023 at 6:05 PM Borislav Petkov wrote: > > On Thu, Jun 01, 2023 at 03:20:44PM +0800, Tao Liu wrote: > > arch/x86/kernel/machine_kexec_64.c | 35 ++ > > 1 file changed, 31 insertions(+), 4 deletions(-) > > Ok, pls try this totally untested

[PATCHv5 8/8] arm64: Hook up the ZBOOT support as vmlinuz

2023-07-17 Thread Pingfan Liu
From: Jeremy Linton Add the previously defined _probe() and _usage() routines to the kexec file types table, and build the new module. It should be noted that this "vmlinuz" support reuses the "Image" support to actually load the resulting image after it has been decompressed to a temporary

[PATCHv5 7/8] arm64: Add ZBOOT PE containing compressed image support

2023-07-17 Thread Pingfan Liu
From: Jeremy Linton The kernel EFI stub ZBOOT feature creates a PE that contains a compressed linux kernel image. The stub when run in a valid UEFI environment then decompresses the resulting image and executes it. Support these image formats with kexec as well to avoid having to keep an

[PATCHv5 6/8] kexec/zboot: Add arch independent zboot support

2023-07-17 Thread Pingfan Liu
From: Jeremy Linton The linux kernel CONFIG_ZBOOT option creates self decompressing PE kernel images. So this means that kexec should have a generic understanding of the format which may be used by multiple arches. So lets add an arch independent validation and decompression routine.

[PATCHv5 5/8] kexec: Drop condition macro for aarch64

2023-07-17 Thread Pingfan Liu
Since all arm64 images have transfer from the interface probe() to probe2(), the snippet dedicated for aarch64 to call probe() can be dropped now. Signed-off-by: Pingfan Liu To: kexec@lists.infradead.org Cc: ho...@verge.net.au Cc: a...@kernel.org Cc: jeremy.lin...@arm.com --- kexec/kexec.c | 10

[PATCHv5 0/8] arm64: zboot support

2023-07-17 Thread Pingfan Liu
As more complicated capsule kernel format occurs like zboot, where the compressed kernel is stored as a payload. The straight forward decompression can not meet the demand. As the first step, on aarch64, reading in the kernel file in a probe method and decide how to unfold the content by the

[PATCHv5 4/8] arm64: Transfer from probe() to probe2()

2023-07-17 Thread Pingfan Liu
Scatter the logic of reading of kernel file into each probe As more complicated capsule kernel format ,such as zboot, emerge, where the compressed kernel is stored as a payload. The straight forward decompression can not meet the demand. Therefore, introduce a method probe2, which reads in the

[PATCHv5 2/8] kexec: Isolate probe method

2023-07-17 Thread Pingfan Liu
Isolating the calling to the probe method, so in a later patch, a new prototype probe2 interface can be introduced without exposure of the change. Signed-off-by: Pingfan Liu To: kexec@lists.infradead.org Cc: ho...@verge.net.au Cc: a...@kernel.org Cc: jeremy.lin...@arm.com --- kexec/kexec.c | 81

[PATCHv5 3/8] kexec: Introduce a new image probe method 'probe2'

2023-07-17 Thread Pingfan Liu
As more complicated capsule kernel format occurs like zboot, where the compressed kernel is stored as a payload. The straight forward decompression can not meet the demand. So introducing a new image probe interface -- probe2, which reads in the kernel file and decides how to unfold the content

[PATCHv5 1/8] arm64: Fix some issues with zImage _probe()

2023-07-17 Thread Pingfan Liu
From: Jeremy Linton Current compilers note that fname will be null while attempting to print failures from strdup(). Further fix a memory leak caused by kernel_uncompressed_buf never being used/freed before the allocated block is replaced by the one returned by slurp_decompress_file().