public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: "Huang, Kai" <kai.huang@intel.com>
To: "seanjc@google.com" <seanjc@google.com>
Cc: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"kas@kernel.org" <kas@kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Verma, Vishal L" <vishal.l.verma@intel.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"pbonzini@redhat.com" <pbonzini@redhat.com>,
	"tglx@kernel.org" <tglx@kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>
Subject: Re: [PATCH] x86/virt/tdx: Fix lockdep assertion failure in cache flush for kexec
Date: Tue, 10 Mar 2026 21:15:28 +0000	[thread overview]
Message-ID: <402683f68fba4fcdff9b1e342189bb469a820d57.camel@intel.com> (raw)
In-Reply-To: <abAhne3A5WNARgZo@google.com>

On Tue, 2026-03-10 at 06:50 -0700, Sean Christopherson wrote:
> On Tue, Mar 10, 2026, Kai Huang wrote:
> > On Mon, 2026-03-09 at 16:38 +0000, Edgecombe, Rick P wrote:
> > > On Mon, 2026-03-02 at 23:22 +1300, Kai Huang wrote:
> > > > Remove the too strong lockdep_assert_preemption_disabled(), and
> > > > change this_cpu_{read|write}() to __this_cpu_{read|write}() which
> > > > provide the more proper check (when CONFIG_DEBUG_PREEMPT is true),
> > > > which checks all conditions that the context cannot be moved to
> > > > another CPU to run in the middle.
> > > > 
> > > > Fixes: 61221d07e815 ("KVM/TDX: Explicitly do WBINVD when no more TDX
> > > > SEAMCALLs")
> > > > Cc: stable@vger.kernel.org
> > > > Reported-by: Vishal Verma <vishal.l.verma@intel.com>
> > > > Signed-off-by: Kai Huang <kai.huang@intel.com>
> > > > Tested-by: Vishal Verma <vishal.l.verma@intel.com>
> > > 
> > > Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
> > > 
> > > But this issue is also solved by:
> > > https://lore.kernel.org/kvm/20260307010358.819645-3-rick.p.edgecombe@intel.com/
> 
> Even when that series comes along, I would rather have __this_cpu_{read|write}()
> instead of the explicit lockdep_assert_preemption_disabled().  Similar to the WARN
> about IRQs being disabled that got removed, explicitly requiring that preemption
> be disabled feels like a description of the current code, not an actual requirement.
> 
> Asserting that preemption is disabled gives the false impression that the current
> task must not be scheduled out, between reading and writing cache_state_incoherent.
> Which then raises the question of why scheduling out the current task is bad".

Agreed.

> 
> > This depends on Sean's series to move VMXON to x86 core, so it's not stable
> > friendly.
> > 
> > > 
> > > I guess that these changes are correct in either case. There is no need
> > > for the stricter asserts. But depending on the order the log would be
> > > confusing in the history when it talks about lockdep warnings. So we'll
> > > have to keep an eye on things. If this goes first, then it's fine.
> > 
> > I see.  Will keep this in mind.
> > 
> > > 
> > > You know, it might have helped to include the splat if you end up with
> > > a v2.
> 
> +1.  I can read a backtrace about 10x faster than a full sentence describing the
> backtrace.

I'll include the actual WARN splat in v2.

Thanks for the ack!

  parent reply	other threads:[~2026-03-10 21:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 10:22 [PATCH] x86/virt/tdx: Fix lockdep assertion failure in cache flush for kexec Kai Huang
2026-03-02 10:22 ` [PATCH v2] " Kai Huang
2026-03-02 10:26   ` Huang, Kai
2026-03-05 18:33   ` Nikolay Borisov
2026-03-05 21:35     ` Huang, Kai
2026-03-06  9:58       ` Nikolay Borisov
2026-03-08 10:12         ` Huang, Kai
2026-03-10 13:43   ` Sean Christopherson
2026-03-09 16:38 ` [PATCH] " Edgecombe, Rick P
2026-03-10  7:19   ` Huang, Kai
2026-03-10 13:50     ` Sean Christopherson
2026-03-10 16:36       ` Edgecombe, Rick P
2026-03-10 21:15       ` Huang, Kai [this message]
2026-03-10 16:42   ` Edgecombe, Rick P

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=402683f68fba4fcdff9b1e342189bb469a820d57.camel@intel.com \
    --to=kai.huang@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@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