|
|
Log in / Subscribe / Register

x86/snp: Add kexec support

From:  Ashish Kalra <Ashish.Kalra-AT-amd.com>
To:  <tglx-AT-linutronix.de>, <mingo-AT-redhat.com>, <bp-AT-alien8.de>, <dave.hansen-AT-linux.intel.com>, <x86-AT-kernel.org>
Subject:  [PATCH v3 0/4] x86/snp: Add kexec support
Date:  Thu, 04 Apr 2024 23:10:46 +0000
Message-ID:  <cover.1712270975.git.ashish.kalra@amd.com>
Cc:  <rafael-AT-kernel.org>, <peterz-AT-infradead.org>, <adrian.hunter-AT-intel.com>, <sathyanarayanan.kuppuswamy-AT-linux.intel.com>, <jun.nakajima-AT-intel.com>, <rick.p.edgecombe-AT-intel.com>, <thomas.lendacky-AT-amd.com>, <michael.roth-AT-amd.com>, <seanjc-AT-google.com>, <kai.huang-AT-intel.com>, <bhe-AT-redhat.com>, <kirill.shutemov-AT-linux.intel.com>, <bdas-AT-redhat.com>, <vkuznets-AT-redhat.com>, <dionnaglaze-AT-google.com>, <anisinha-AT-redhat.com>, <jroedel-AT-suse.de>, <ardb-AT-kernel.org>, <kexec-AT-lists.infradead.org>, <linux-coco-AT-lists.linux.dev>, <linux-kernel-AT-vger.kernel.org>
Archive-link:  Article

From: Ashish Kalra <ashish.kalra@amd.com>

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 if running under kexec kernel.
- added new sev_es_enabled() function.
- skip video memory access in decompressor for SEV-ES/SNP systems to 
  prevent guest termination as boot stage2 #VC handler does not handle
  MMIO.

v2:
- address zeroing of unaccepted memory table mappings at all page table levels
  adding phys_pte_init(), phys_pud_init() and phys_p4d_init().
- include skip efi_arch_mem_reserve() in case of kexec as part of this 
  patch set.
- rename last_address_shd_kexec to a more appropriate 
  kexec_last_address_to_make_private.
- remove duplicate code shared with TDX and use common interfaces
  defined for SNP and TDX for kexec/kdump.
- remove set_pte_enc() dependency on pg_level_to_pfn() and make the 
  function simpler.
- rename unshare_pte() to make_pte_private().
- clarify and make the comment for using kexec_last_address_to_make_private  
  more understandable.
- general cleanup. 

Ashish Kalra (4):
  efi/x86: skip efi_arch_mem_reserve() in case of kexec.
  x86/sev: add sev_es_enabled() function.
  x86/boot/compressed: Skip Video Memory access in Decompressor for
    SEV-ES/SNP.
  x86/snp: Convert shared memory back to private on kexec

 arch/x86/boot/compressed/misc.c   |   6 +-
 arch/x86/boot/compressed/misc.h   |   1 +
 arch/x86/boot/compressed/sev.c    |   5 +
 arch/x86/boot/compressed/sev.h    |   2 +
 arch/x86/include/asm/probe_roms.h |   1 +
 arch/x86/include/asm/sev.h        |   4 +
 arch/x86/kernel/probe_roms.c      |  16 +++
 arch/x86/kernel/sev.c             | 169 ++++++++++++++++++++++++++++++
 arch/x86/mm/mem_encrypt_amd.c     |   3 +
 arch/x86/platform/efi/quirks.c    |  23 +++-
 10 files changed, 225 insertions(+), 5 deletions(-)

-- 
2.34.1




Copyright © 2024, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds