Skip to content

Commit e0f8d63

Browse files
committed
deepin: arm64: cpufeature: add parameter to force disable LSE
deepin inclusion category: debug Force disable LSE without detect, default off. Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 2078ef2 commit e0f8d63

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3065,6 +3065,9 @@
30653065
ltpc= [NET]
30663066
Format: <io>,<irq>,<dma>
30673067

3068+
lse_disable_force [ARM64]
3069+
Force disable LSE without detect, default off.
3070+
30683071
lse_disable_on_uma [ARM64]
30693072
Disable LSE (Large System Extension) atomic instructions
30703073
on UMA (Uniform Memory Access) systems to improve

arch/arm64/kernel/cpufeature.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,14 @@ static bool has_32bit_el0(const struct arm64_cpu_capabilities *entry, int scope)
15401540
return true;
15411541
}
15421542

1543+
static bool lse_disable_force __read_mostly;
1544+
1545+
static int __init arm64_lse_disable_force_setup(char *str)
1546+
{
1547+
return kstrtobool(str, &lse_disable_force);
1548+
}
1549+
early_param("lse_disable_force", arm64_lse_disable_force_setup);
1550+
15431551
static bool lse_disable_on_uma __read_mostly = true; // UMA decision enabled by default
15441552

15451553
static int __init arm64_lse_disable_on_uma_setup(char *str)
@@ -1553,6 +1561,12 @@ static bool has_lse_capability_uma_aware(const struct arm64_cpu_capabilities *ca
15531561
{
15541562
int num_nodes = num_possible_nodes();
15551563

1564+
if (lse_disable_force) {
1565+
if (scope == SCOPE_SYSTEM && smp_processor_id() == 0)
1566+
pr_info("LSE atomics: force disabled by lse_disable_force=1.\n");
1567+
return false;
1568+
}
1569+
15561570
/* UMA system: disable LSE when lse_disable_on_uma is enabled */
15571571
if (num_nodes <= 1 && lse_disable_on_uma) {
15581572
if (scope == SCOPE_SYSTEM && smp_processor_id() == 0)

0 commit comments

Comments
 (0)