Linux Confidential Computing Development
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: kas@kernel.org
Cc: bp@alien8.de, chao.p.peng@intel.com, chenyi.qiang@intel.com,
	dave.hansen@linux.intel.com, hpa@zytor.com, kvm@vger.kernel.org,
	linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org,
	mingo@redhat.com, reinette.chatre@intel.com,
	rick.p.edgecombe@intel.com, tglx@linutronix.de, x86@kernel.org,
	xiaoyao.li@intel.com, Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 1/2] x86/split_lock: Don't try to handle user split lock in TDX guest
Date: Thu, 27 Nov 2025 16:55:27 +0000	[thread overview]
Message-ID: <4676722f-98a3-4217-a357-068440dc6e14@citrix.com> (raw)
In-Reply-To: <f2hkqt5xtmej7cfnuytigcfszr3qja4l6ywww4qrqxjbqmlko2@r75b6deae2hd>

> I am not sure. Leaving it as produces produces false messages which is
> not good, but not critical.
>
> Maybe just clear X86_FEATURE_BUS_LOCK_DETECT and stop pretending we
> control split-lock behaviour from the guest?

(Having just played with this mess for another task) you're talking
about two different things.

Sapphire Rapids has an architectural BUS_LOCK_DETECT (trap semantics,
#DB or VMExit), and a model-specific BUS_LOCK_DISABLE.

It's BUS_LOCK_DISABLE which generates #AC, with fault semantics,
preventing forward progress.  It also means the Bus Lock didn't happen,
and there's nothing to trigger the BUS_LOCK_DETECT (trap) behaviour.

Given that TDX is enabling BUS_LOCK_DISABLE, it's probably also enabling
UC_LOCK_DISABLE (causes #GP) too.

Looking at the backtrace:

  x86/split lock detection: #AC: split_lock/1176 took a split_lock trap at address: 0x5630b30921f9
  unchecked MSR access error: WRMSR to 0x33 (tried to write 0x0000000000000000) at rIP: 0xffffffff812a061f (native_write_msr+0xf/0x30)


First, "took a split_lock trap" is wrong.  It's a fault, not a trap.

Second, because the attempt to disable BUS_LOCK_DISABLE was blocked,
simply retrying the instruction will generate a new #AC and livelock. 
Linux probably ought to raise SIGSEGV with userspace, for want of
anything better to do.

It looks like software in a TDX VM will simply have to accept that it
cannot cause a bus lock.

~Andrew

  reply	other threads:[~2025-11-27 16:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26 10:02 [PATCH 0/2] x86/split_lock: Fix and enhancement for TDX guest Xiaoyao Li
2025-11-26 10:02 ` [PATCH 1/2] x86/split_lock: Don't try to handle user split lock in " Xiaoyao Li
2025-11-26 11:25   ` Kiryl Shutsemau
2025-11-26 12:17     ` Xiaoyao Li
2025-11-26 13:35       ` Kiryl Shutsemau
2025-11-27  2:00         ` Xiaoyao Li
2025-11-27 16:16           ` Kiryl Shutsemau
2025-11-27 16:55             ` Andrew Cooper [this message]
2025-11-28  2:40               ` Xiaoyao Li
2025-11-28  2:28             ` Xiaoyao Li
2025-12-17 10:56     ` Xiaoyao Li
2025-11-26 10:02 ` [PATCH 2/2] x86/split_lock: Describe #AC handling in TDX guest kernel log Xiaoyao Li

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=4676722f-98a3-4217-a357-068440dc6e14@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=bp@alien8.de \
    --cc=chao.p.peng@intel.com \
    --cc=chenyi.qiang@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kas@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=reinette.chatre@intel.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=xiaoyao.li@intel.com \
    /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