Skip to content

Commit b7b3e4a

Browse files
John Allenjallen-amd
authored andcommitted
x86/bus_lock: Add support for AMD
JIRA: https://issues.redhat.com/browse/RHEL-50321 commit 408eb74 Author: Ravi Bangoria <ravi.bangoria@amd.com> Date: Thu Aug 8 06:29:35 2024 +0000 x86/bus_lock: Add 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]. [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 Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Link: https://lore.kernel.org/all/20240808062937.1149-3-ravi.bangoria@amd.com Signed-off-by: John Allen <johnalle@redhat.com>
1 parent cc57834 commit b7b3e4a

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

Documentation/arch/x86/buslock.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Detection
2626
=========
2727

2828
Intel processors may support either or both of the following hardware
29-
mechanisms to detect split locks and bus locks.
29+
mechanisms to detect split locks and bus locks. Some AMD processors also
30+
support bus lock detect.
3031

3132
#AC exception for split lock detection
3233
--------------------------------------

arch/x86/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2434,7 +2434,7 @@ source "kernel/livepatch/Kconfig"
24342434

24352435
config X86_BUS_LOCK_DETECT
24362436
bool "Split Lock Detect and Bus Lock Detect support"
2437-
depends on CPU_SUP_INTEL
2437+
depends on CPU_SUP_INTEL || CPU_SUP_AMD
24382438
default y
24392439
help
24402440
Enable Split Lock Detect and Bus Lock Detect functionalities.

arch/x86/kernel/cpu/common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,6 +1849,8 @@ static void identify_cpu(struct cpuinfo_x86 *c)
18491849
if (this_cpu->c_init)
18501850
this_cpu->c_init(c);
18511851

1852+
bus_lock_init();
1853+
18521854
/* Disable the PN if appropriate */
18531855
squash_the_stupid_serial_number(c);
18541856

arch/x86/kernel/cpu/intel.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,6 @@ static void init_intel(struct cpuinfo_x86 *c)
612612
init_intel_misc_features(c);
613613

614614
split_lock_init();
615-
bus_lock_init();
616615

617616
intel_init_thermal(c);
618617
}

0 commit comments

Comments
 (0)