[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240806125442.1603-1-ravi.bangoria@amd.com>
Date: Tue, 6 Aug 2024 12:54:38 +0000
From: Ravi Bangoria <ravi.bangoria@....com>
To: <tglx@...utronix.de>, <mingo@...hat.com>, <bp@...en8.de>,
<dave.hansen@...ux.intel.com>, <seanjc@...gle.com>, <pbonzini@...hat.com>,
<thomas.lendacky@....com>, <jmattson@...gle.com>
CC: <ravi.bangoria@....com>, <hpa@...or.com>, <rmk+kernel@...linux.org.uk>,
<peterz@...radead.org>, <james.morse@....com>, <lukas.bulwahn@...il.com>,
<arjan@...ux.intel.com>, <j.granados@...sung.com>, <sibs@...natelecom.cn>,
<nik.borisov@...e.com>, <michael.roth@....com>, <nikunj.dadhania@....com>,
<babu.moger@....com>, <x86@...nel.org>, <kvm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <santosh.shukla@....com>,
<ananth.narayan@....com>, <sandipan.das@....com>, <manali.shukla@....com>
Subject: [PATCH v3 0/4] x86/cpu: Add Bus Lock Detect support for AMD
Add Bus Lock Detect (called Bus Lock Trap in AMD docs) support for AMD
platforms. Bus Lock Detect is enumerated with CPUID Fn0000_0007_ECX_x0
bit [24 / BUSLOCKTRAP]. It can be enabled through MSR_IA32_DEBUGCTLMSR.
When enabled, hardware clears DR6[11] and raises a #DB exception on
occurrence of Bus Lock if CPL > 0. More detail about the feature can be
found in AMD APM[1].
Patches are prepared on tip/master (435dfff07e5b).
[1]: AMD64 Architecture Programmer's Manual Pub. 40332, Rev. 4.07 - June
2023, Vol 2, 13.1.3.6 Bus Lock Trap
https://bugzilla.kernel.org/attachment.cgi?id=304653
v2: https://lore.kernel.org/r/20240712093943.1288-1-ravi.bangoria@amd.com
v2->v3:
- Fix build failure reported by LKP test bot
- Reword commit messages
Note:
A Qemu fix is also require to handle a corner case where a hardware
instruction or data breakpoint is created by Qemu remote debugger (gdb)
on the same instruction which also causes a Bus Lock. Qemu patch to
handle it can be found at:
https://lore.kernel.org/r/20240712095208.1553-1-ravi.bangoria@amd.com
Ravi Bangoria (4):
x86/split_lock: Move Split and Bus lock code to a dedicated file
x86/bus_lock: Add support for AMD
KVM: SVM: Don't advertise Bus Lock Detect to guest if SVM support is
missing
KVM: SVM: Add Bus Lock Detect support
arch/x86/include/asm/cpu.h | 12 +-
arch/x86/kernel/cpu/Makefile | 1 +
arch/x86/kernel/cpu/bus_lock.c | 410 +++++++++++++++++++++++++++++++++
arch/x86/kernel/cpu/common.c | 2 +
arch/x86/kernel/cpu/intel.c | 407 --------------------------------
arch/x86/kvm/svm/nested.c | 3 +-
arch/x86/kvm/svm/svm.c | 16 +-
include/linux/sched.h | 2 +-
8 files changed, 440 insertions(+), 413 deletions(-)
create mode 100644 arch/x86/kernel/cpu/bus_lock.c
--
2.34.1
Powered by blists - more mailing lists