Linux Confidential Computing Development
 help / color / mirror / Atom feed
From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
	"challvy.tee@gmail.com" <challvy.tee@gmail.com>,
	"x86@kernel.org" <x86@kernel.org>
Cc: "seanjc@google.com" <seanjc@google.com>,
	"kai.huang@intel.com" <kai.huang@intel.com>,
	"kas@kernel.org" <kas@kernel.org>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Verma, Vishal L" <vishal.l.verma@intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"regressions@lists.linux.dev" <regressions@lists.linux.dev>
Subject: Re: [PATCH v4] x86/virt/tdx: Skip TDH.SYS.DISABLE if the TDX module is not initialized
Date: Mon, 2 Nov 2026 19:28:32 +0000	[thread overview]
Message-ID: <223dd15d2740bf6d2010e3b4a295b22c559dfdad.camel@intel.com> (raw)
In-Reply-To: <20261102073244.919864-1-challvy.tee@gmail.com>

On Mon, 2026-11-02 at 15:32 +0800, Challvy Tee wrote:
> Commit 5b25f249be32 ("x86/tdx: Disable the TDX module during kexec and
> kdump") made native_machine_crash_shutdown() call tdx_sys_disable(),
> whose only gate is compile time (CONFIG_INTEL_TDX_HOST).  A kernel that
> never initialized the TDX module therefore still issues
> TDH.SYS.DISABLE.
> 
> In VMX non-root operation on a SEAM-capable host, SEAMCALL causes a VM
> exit instead of a native #UD.  KVM injects #UD only since
> commit 9d7dfb95da2c ("KVM: VMX: Inject #UD if guest tries to execute
> SEAMCALL or TDCALL"), first released in v6.18.  On an older host the
> VMM gets KVM_EXIT_INTERNAL_ERROR and the vCPU never resumes, so
> machine_kexec() is never reached and no vmcore is written.  Kdump is
> thus broken only in guests on SEAM-capable hosts whose hypervisor does
> not handle the exit; plain kexec is unaffected because tdx_shutdown()
> only runs as a syscore op, registered after init_tdx_module() succeeds.
> 
> Gate the SEAMCALL on X86_FEATURE_TDX_HOST_PLATFORM before issuing it,
> the way paddr_is_tdx_private() already guards its own SEAMCALL in this
> file.  Without that feature the module is never initialized, so there
> is nothing to disable; on a TDX host the gate is a no-op.
> 
> It also decouples kdump from the host KVM version -- a guest cannot
> require its host to inject the #UD.
> 
> Fixes: 5b25f249be32 ("x86/tdx: Disable the TDX module during kexec and kdump")
> Suggested-by: Kiryl Shutsemau <kas@kernel.org>
> Cc: stable@vger.kernel.org
> Signed-off-by: Challvy Tee <challvy.tee@gmail.com>
> ---

Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>

  parent reply	other threads:[~2026-11-02 19:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20261029080731.890996-1-challvy.tee@gmail.com>
2026-10-29  9:47 ` [PATCH v2] x86/virt/tdx: Skip TDH.SYS.DISABLE if the TDX module is not initialized Challvy Tee
2026-10-29 12:10   ` Kiryl Shutsemau
2026-10-30 15:48     ` [PATCH v3] " Challvy Tee
2026-10-30 16:13       ` Dave Hansen
2026-10-30 16:26         ` Kiryl Shutsemau
2026-10-30 16:38           ` Dave Hansen
2026-11-02  7:32             ` [PATCH v4] " Challvy Tee
2026-11-02  9:42               ` Kiryl Shutsemau
2026-11-02 19:28               ` Edgecombe, Rick P [this message]
2026-11-02 22:24               ` Verma, Vishal L

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=223dd15d2740bf6d2010e3b4a295b22c559dfdad.camel@intel.com \
    --to=rick.p.edgecombe@intel.com \
    --cc=challvy.tee@gmail.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=kai.huang@intel.com \
    --cc=kas@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=regressions@lists.linux.dev \
    --cc=seanjc@google.com \
    --cc=stable@vger.kernel.org \
    --cc=vishal.l.verma@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox