[PATCH v3 4/4] x86/snp: Convert shared memory back to private on kexec

2024-04-04 Thread Ashish Kalra
From: Ashish Kalra SNP guests allocate shared buffers to perform I/O. It is done by allocating pages normally from the buddy allocator and converting them to shared with set_memory_decrypted(). The second kernel has no idea what memory is converted this way. It only sees E820_TYPE_RAM. Accessin

[PATCH v3 3/4] x86/boot/compressed: Skip Video Memory access in Decompressor for SEV-ES/SNP.

2024-04-04 Thread Ashish Kalra
From: Ashish Kalra Accessing guest video memory/RAM during kernel decompressor causes guest termination as boot stage2 #VC handler for SEV-ES/SNP systems does not support MMIO handling. This issue is observed with SEV-ES/SNP guest kexec as kexec -c adds screen_info to the boot parameters passed

[PATCH v3 2/4] x86/sev: add sev_es_enabled() function.

2024-04-04 Thread Ashish Kalra
From: Ashish Kalra Add sev_es_enabled() function to detect if SEV-ES support is enabled. Signed-off-by: Ashish Kalra --- arch/x86/boot/compressed/sev.c | 5 + arch/x86/boot/compressed/sev.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boo

[PATCH v3 1/4] efi/x86: skip efi_arch_mem_reserve() in case of kexec.

2024-04-04 Thread Ashish Kalra
From: Ashish Kalra For kexec use case, need to use and stick to the EFI memmap passed from the first kernel via boot-params/setup data, hence, skip efi_arch_mem_reserve() during kexec. Additionally during SNP guest kexec testing discovered that EFI memmap is corrupted during chained kexec. kexec

[PATCH v3 0/4] x86/snp: Add kexec support

2024-04-04 Thread Ashish Kalra
From: Ashish Kalra The patchset adds bits and pieces to get kexec (and crashkernel) work on SNP guest. v3: - Rebased; - moved Keep page tables that maps E820_TYPE_ACPI patch to Kirill's tdx guest kexec patch series. - checking the md attribute instead of checking the efi_setup for detecting

Re: [PATCH v2] vmcore: replace strncpy with strscpy_pad

2024-04-04 Thread Kees Cook
On Mon, Apr 01, 2024 at 06:39:55PM +, Justin Stitt wrote: > strncpy() is in the process of being replaced as it is deprecated [1]. > We should move towards safer and less ambiguous string interfaces. > > Looking at vmcoredd_header's definition: > | struct vmcoredd_header { > |

Re: [PATCHv9 00/17] x86/tdx: Add kexec support

2024-04-04 Thread Kalra, Ashish
Hi Kirill, On 3/25/2024 5:38 AM, Kirill A. Shutemov wrote: The patchset adds bits and pieces to get kexec (and crashkernel) work on TDX guest. The last patch implements CPU offlining according to the approved ACPI spec change poposal[1]. It unlocks kexec with all CPUs visible in the target kern

Re: [PATCH v8 06/15] x86: Add early SHA support for Secure Launch early measurements

2024-04-04 Thread Jarkko Sakkinen
On Thu Apr 4, 2024 at 2:56 AM EEST, Eric Biggers wrote: > On Wed, Apr 03, 2024 at 09:32:02AM -0700, Andy Lutomirski wrote: > > On Fri, Feb 23, 2024, at 10:30 AM, Eric Biggers wrote: > > > On Fri, Feb 23, 2024 at 06:20:27PM +, Andrew Cooper wrote: > > >> On 23/02/2024 5:54 pm, Eric Biggers wrote

Re: [PATCHv9 05/17] x86/kexec: Keep CR4.MCE set during kexec for TDX guest

2024-04-04 Thread Kirill A. Shutemov
On Thu, Apr 04, 2024 at 10:40:34AM +1300, Huang, Kai wrote: > > > On 3/04/2024 4:42 am, Kirill A. Shutemov wrote: > > On Fri, Mar 29, 2024 at 06:48:21PM +0200, Kirill A. Shutemov wrote: > > > On Fri, Mar 29, 2024 at 11:21:32PM +0800, Xiaoyao Li wrote: > > > > On 3/25/2024 6:38 PM, Kirill A. Shute