Re: [PATCH v7 14/18] x86/boot: make sure KASLR does not step over KHO preserved memory

2025-05-02 Thread Dave Hansen
On 5/2/25 14:16, Mike Rapoport wrote: >>> +/* >>> + * If KHO is active, only process its scratch areas to ensure we are not >>> + * stepping onto preserved memory. >>> + */ >>> +#ifdef CONFIG_KEXEC_HANDOVER >>> +static bool process_kho_entries(unsigned long minimum, unsigned long >>> image_size) >

[PATCH v4] x86/sev: Fix making shared pages private during kdump

2025-05-02 Thread Ashish Kalra
From: Ashish Kalra When the shared pages are being made private during kdump preparation there are additional checks to handle shared GHCB pages. These additional checks include handling the case of GHCB page being contained within a huge page. The check for handling the case of GHCB contained

Re: [PATCH v7 14/18] x86/boot: make sure KASLR does not step over KHO preserved memory

2025-05-02 Thread Mike Rapoport
On Fri, May 02, 2025 at 11:48:54AM -0700, Dave Hansen wrote: > On 5/1/25 15:54, Changyuan Lyu wrote: > > +/* > > + * If KHO is active, only process its scratch areas to ensure we are not > > + * stepping onto preserved memory. > > + */ > > +#ifdef CONFIG_KEXEC_HANDOVER > > +static bool process_kho_

[PATCH] ima: Kdump kernel doesn't need IMA to do integrity measurement

2025-05-02 Thread steven chen
From: Steven Chen Kdump kernel doesn't need IMA to do integrity measurement. Hence the measurement list in 1st kernel doesn't need to be copied to kdump kenrel. Here skip allocating buffer for measurement list copying if loading kdump kernel. Then there won't be the later handling related to ima

Re: [PATCH v3] x86/sev: Fix making shared pages private during kdump

2025-05-02 Thread Tom Lendacky
On 5/2/25 14:32, Kalra, Ashish wrote: > Hello Tom, > > On 5/1/2025 8:56 AM, Tom Lendacky wrote: >> On 4/30/25 18:17, Ashish Kalra wrote: >>> From: Ashish Kalra > > I agree, i really don't need the check as i can simply apply the mask as > the mask is based on page level/size. > > mask = page_l

Re: [PATCH v3] x86/sev: Fix making shared pages private during kdump

2025-05-02 Thread Kalra, Ashish
Hello Tom, On 5/1/2025 8:56 AM, Tom Lendacky wrote: > On 4/30/25 18:17, Ashish Kalra wrote: >> From: Ashish Kalra >> >> When the shared pages are being made private during kdump preparation >> there are additional checks to handle shared GHCB pages. >> >> These additional checks include handling

Re: [PATCH v7 14/18] x86/boot: make sure KASLR does not step over KHO preserved memory

2025-05-02 Thread Dave Hansen
On 5/1/25 15:54, Changyuan Lyu wrote: > KHO uses "scratch regions" to bootstrap a kexec'ed kernel. These regions are > guaranteed to not have any memory that KHO would preserve. I understand how these changelogs got written. They were written by someone thinking *only* about KHO and hacking it int

Re: [PATCH v7 13/18] x86/e820: temporarily enable KHO scratch for memory below 1M

2025-05-02 Thread Dave Hansen
On 5/1/25 15:54, Changyuan Lyu wrote: > From: Alexander Graf > > KHO kernels are special and use only scratch memory for memblock > allocations, but memory below 1M is ignored by kernel after early boot > and cannot be naturally marked as scratch. > > To allow allocation of the real-mode trampol

Re: [PATCH v7 12/18] x86/kexec: add support for passing kexec handover (KHO) data

2025-05-02 Thread Dave Hansen
On 5/1/25 15:54, Changyuan Lyu wrote: > From: Alexander Graf > > kexec handover (KHO) creates a metadata that the kernels pass between each > other during kexec. This metadata is stored in memory and kexec image > contains a (physical) pointer to that memory. > > In addition, KHO keeps "scratch

Re: [PATCH v7 06/18] kexec: include asm/early_ioremap.h

2025-05-02 Thread Changyuan Lyu
On Thu, May 1, 2025 at 5:36 PM Andrew Morton wrote: > > On Thu, 1 May 2025 15:54:13 -0700 Changyuan Lyu > wrote: > > > From: Arnd Bergmann > > > > The early_memremap() function is decleared in a header that is only > > indirectly > > included here: > > > > kernel/kexec_handover.c:1116:8: erro

Re: [PATCH v13 0/9] ima: kexec: measure events between kexec load and execute

2025-05-02 Thread steven chen
On 4/24/2025 7:37 AM, Baoquan He wrote: Hi Steven, Could you test below code and post a formal patch to not copy measurement list buffer to kdump kernel? Below log is just for your reference, please feel free to modify or rephrase. === Kdump kernel doesn't need IMA to do integrity measurement.

Re: [PATCH v4] x86/sev: Don't touch VMSA pages during kdump of SNP guest memory

2025-05-02 Thread Borislav Petkov
On Thu, May 01, 2025 at 08:29:59AM -0500, Tom Lendacky wrote: > Just occurred to me that, while we don't use it, there is another create > event, SVM_VMGEXIT_AP_CREATE_ON_INIT. So maybe change this to > > bool create = event != SVM_VMGEXIT_AP_DESTROY; Thx, I have this applied now: --- From: As

Re: [PATCH v3] x86/sev: Fix making shared pages private during kdump

2025-05-02 Thread Borislav Petkov
On Thu, May 01, 2025 at 08:56:00AM -0500, Tom Lendacky wrote: > On 4/30/25 18:17, Ashish Kalra wrote: > > From: Ashish Kalra > > > > When the shared pages are being made private during kdump preparation > > there are additional checks to handle shared GHCB pages. > > > > These additional checks