[PATCH v8 0/7] TDX host: kexec/kdump support

Paolo Bonzini posted 7 patches 5 months, 1 week ago
Documentation/arch/x86/tdx.rst       | 14 ++++-----
arch/x86/Kconfig                     |  1 -
arch/x86/include/asm/kexec.h         | 12 ++++++--
arch/x86/include/asm/processor.h     |  2 ++
arch/x86/include/asm/tdx.h           | 31 +++++++++++++++++++-
arch/x86/kernel/cpu/amd.c            | 17 +++++++++++
arch/x86/kernel/machine_kexec_64.c   | 44 ++++++++++++++++++++++------
arch/x86/kernel/process.c            | 24 +++++++--------
arch/x86/kernel/relocate_kernel_64.S | 36 +++++++++++++++--------
arch/x86/kvm/vmx/tdx.c               | 10 +++++++
arch/x86/virt/vmx/tdx/tdx.c          | 23 +++++++++++++--
11 files changed, 167 insertions(+), 47 deletions(-)
[PATCH v8 0/7] TDX host: kexec/kdump support
Posted by Paolo Bonzini 5 months, 1 week ago
Currently kexec() support and TDX host are muturally exclusive in the
Kconfig.  This series adds the TDX host kexec support so that they can
be both enabled in Kconfig.

With this series, the user can kexec (including crash kdump) to the new
kernel at any time regardless of whether TDX has been enabled in the
first kernel.  One limitation is if the first kernel has ever enabled
TDX, for now the second kernel cannot use TDX.  This is the future work
in my TODO list.

This series should go in through the tip tree.

Thanks,

Paolo

v7->v8: stub out the new code when kexec is not enabled in the kernel.
	Of course even the smallest code change is subject to bikeshedding,
	and I chose my preferred color for the bikeshed.  But it's pastel
	green and I'm sure you'll agree that it's beautiful.


Kai Huang (7):
  x86/kexec: Consolidate relocate_kernel() function parameters
  x86/sme: Use percpu boolean to control WBINVD during kexec
  x86/virt/tdx: Mark memory cache state incoherent when making SEAMCALL
  x86/kexec: Disable kexec/kdump on platforms with TDX partial write
    erratum
  x86/virt/tdx: Remove the !KEXEC_CORE dependency
  x86/virt/tdx: Update the kexec section in the TDX documentation
  KVM: TDX: Explicitly do WBINVD when no more TDX SEAMCALLs

 Documentation/arch/x86/tdx.rst       | 14 ++++-----
 arch/x86/Kconfig                     |  1 -
 arch/x86/include/asm/kexec.h         | 12 ++++++--
 arch/x86/include/asm/processor.h     |  2 ++
 arch/x86/include/asm/tdx.h           | 31 +++++++++++++++++++-
 arch/x86/kernel/cpu/amd.c            | 17 +++++++++++
 arch/x86/kernel/machine_kexec_64.c   | 44 ++++++++++++++++++++++------
 arch/x86/kernel/process.c            | 24 +++++++--------
 arch/x86/kernel/relocate_kernel_64.S | 36 +++++++++++++++--------
 arch/x86/kvm/vmx/tdx.c               | 10 +++++++
 arch/x86/virt/vmx/tdx/tdx.c          | 23 +++++++++++++--
 11 files changed, 167 insertions(+), 47 deletions(-)

-- 
2.51.0
Re: [PATCH v8 0/7] TDX host: kexec/kdump support
Posted by Paolo Bonzini 4 months ago
Hi Dave and others,

any reason why this series was not pulled into 6.18? I was a bit
surprised not to see it...

Thanks,

Paolo

On Mon, Sep 1, 2025 at 6:09 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Currently kexec() support and TDX host are muturally exclusive in the
> Kconfig.  This series adds the TDX host kexec support so that they can
> be both enabled in Kconfig.
>
> With this series, the user can kexec (including crash kdump) to the new
> kernel at any time regardless of whether TDX has been enabled in the
> first kernel.  One limitation is if the first kernel has ever enabled
> TDX, for now the second kernel cannot use TDX.  This is the future work
> in my TODO list.
>
> This series should go in through the tip tree.
>
> Thanks,
>
> Paolo
>
> v7->v8: stub out the new code when kexec is not enabled in the kernel.
>         Of course even the smallest code change is subject to bikeshedding,
>         and I chose my preferred color for the bikeshed.  But it's pastel
>         green and I'm sure you'll agree that it's beautiful.
>
>
> Kai Huang (7):
>   x86/kexec: Consolidate relocate_kernel() function parameters
>   x86/sme: Use percpu boolean to control WBINVD during kexec
>   x86/virt/tdx: Mark memory cache state incoherent when making SEAMCALL
>   x86/kexec: Disable kexec/kdump on platforms with TDX partial write
>     erratum
>   x86/virt/tdx: Remove the !KEXEC_CORE dependency
>   x86/virt/tdx: Update the kexec section in the TDX documentation
>   KVM: TDX: Explicitly do WBINVD when no more TDX SEAMCALLs
>
>  Documentation/arch/x86/tdx.rst       | 14 ++++-----
>  arch/x86/Kconfig                     |  1 -
>  arch/x86/include/asm/kexec.h         | 12 ++++++--
>  arch/x86/include/asm/processor.h     |  2 ++
>  arch/x86/include/asm/tdx.h           | 31 +++++++++++++++++++-
>  arch/x86/kernel/cpu/amd.c            | 17 +++++++++++
>  arch/x86/kernel/machine_kexec_64.c   | 44 ++++++++++++++++++++++------
>  arch/x86/kernel/process.c            | 24 +++++++--------
>  arch/x86/kernel/relocate_kernel_64.S | 36 +++++++++++++++--------
>  arch/x86/kvm/vmx/tdx.c               | 10 +++++++
>  arch/x86/virt/vmx/tdx/tdx.c          | 23 +++++++++++++--
>  11 files changed, 167 insertions(+), 47 deletions(-)
>
> --
> 2.51.0
Re: [PATCH v8 0/7] TDX host: kexec/kdump support
Posted by Dave Hansen 4 months ago
On 10/3/25 06:09, Paolo Bonzini wrote:
> any reason why this series was not pulled into 6.18? I was a bit
> surprised not to see it...

The usual reasons. It fell through the cracks when it got posted and
nobody mentioned it until now.

I'll stick it on my list for after the merge window closes.
Re: [PATCH v8 0/7] TDX host: kexec/kdump support
Posted by David Woodhouse 4 months ago
On Fri, 2025-10-03 at 15:09 +0200, Paolo Bonzini wrote:
> Hi Dave and others,
> 
> any reason why this series was not pulled into 6.18? I was a bit
> surprised not to see it...

At the very least I'd like to see the first patch with the
relocate_kernel() rework go in. I have some stuff lined up which would
conflict with that and needs to go after it, to speed up kexec by
keeping CPUs online, etc.