Skip to content

Commit 1e0f7c3

Browse files
leoliu-ocopsiff
authored andcommitted
x86/bus_lock: Add support for AMD
mainline inclusion from-v6.11-rc2 commit 408eb74 category: feature ------------------- 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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Tom Lendacky <[email protected]> Link: https://lore.kernel.org/all/[email protected] Signed-off-by: LeoLiu-oc <[email protected]>
1 parent f234801 commit 1e0f7c3

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
@@ -2488,7 +2488,7 @@ source "kernel/livepatch/Kconfig"
24882488

24892489
config X86_BUS_LOCK_DETECT
24902490
bool "Split Lock Detect and Bus Lock Detect support"
2491-
depends on CPU_SUP_INTEL
2491+
depends on CPU_SUP_INTEL || CPU_SUP_AMD
24922492
default y
24932493
help
24942494
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
@@ -2078,6 +2078,8 @@ static void identify_cpu(struct cpuinfo_x86 *c)
20782078
if (this_cpu->c_init)
20792079
this_cpu->c_init(c);
20802080

2081+
bus_lock_init();
2082+
20812083
/* Disable the PN if appropriate */
20822084
squash_the_stupid_serial_number(c);
20832085

arch/x86/kernel/cpu/intel.c

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

692692
split_lock_init();
693-
bus_lock_init();
694693

695694
intel_init_thermal(c);
696695
}

0 commit comments

Comments
 (0)