Skip to content

Commit dc64de4

Browse files
committed
Merge branch 'for-next/fixes' into for-next/core
Merge in for-next/fixes, as subsequent improvements to our early PI code that disallow BSS exports depend on the 'arm64_use_ng_mappings' fix here. * for-next/fixes: arm64: cpufeature: Move arm64_use_ng_mappings to the .data section to prevent wrong idmap generation arm64: errata: Add missing sentinels to Spectre-BHB MIDR arrays
2 parents 48055fb + 363cd2b commit dc64de4

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

arch/arm64/kernel/cpufeature.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,14 @@ static struct arm64_cpu_capabilities const __ro_after_init *cpucap_ptrs[ARM64_NC
114114

115115
DECLARE_BITMAP(boot_cpucaps, ARM64_NCAPS);
116116

117-
bool arm64_use_ng_mappings = false;
117+
/*
118+
* arm64_use_ng_mappings must be placed in the .data section, otherwise it
119+
* ends up in the .bss section where it is initialized in early_map_kernel()
120+
* after the MMU (with the idmap) was enabled. create_init_idmap() - which
121+
* runs before early_map_kernel() and reads the variable via PTE_MAYBE_NG -
122+
* may end up generating an incorrect idmap page table attributes.
123+
*/
124+
bool arm64_use_ng_mappings __read_mostly = false;
118125
EXPORT_SYMBOL(arm64_use_ng_mappings);
119126

120127
DEFINE_PER_CPU_READ_MOSTLY(const char *, this_cpu_vector) = vectors;

arch/arm64/kernel/proton-pack.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,10 +879,12 @@ static u8 spectre_bhb_loop_affected(void)
879879
static const struct midr_range spectre_bhb_k132_list[] = {
880880
MIDR_ALL_VERSIONS(MIDR_CORTEX_X3),
881881
MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2),
882+
{},
882883
};
883884
static const struct midr_range spectre_bhb_k38_list[] = {
884885
MIDR_ALL_VERSIONS(MIDR_CORTEX_A715),
885886
MIDR_ALL_VERSIONS(MIDR_CORTEX_A720),
887+
{},
886888
};
887889
static const struct midr_range spectre_bhb_k32_list[] = {
888890
MIDR_ALL_VERSIONS(MIDR_CORTEX_A78),

0 commit comments

Comments
 (0)