Skip to content

Commit a7670a4

Browse files
Automatic merge of 'master' into merge (2025-11-17 13:18)
2 parents 88ca349 + 6fa9041 commit a7670a4

107 files changed

Lines changed: 1041 additions & 592 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.mailmap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,8 @@ Oleksij Rempel <o.rempel@pengutronix.de>
605605
Oleksij Rempel <o.rempel@pengutronix.de> <ore@pengutronix.de>
606606
Oliver Hartkopp <socketcan@hartkopp.net> <oliver.hartkopp@volkswagen.de>
607607
Oliver Hartkopp <socketcan@hartkopp.net> <oliver@hartkopp.net>
608-
Oliver Upton <oliver.upton@linux.dev> <oupton@google.com>
608+
Oliver Upton <oupton@kernel.org> <oupton@google.com>
609+
Oliver Upton <oupton@kernel.org> <oliver.upton@linux.dev>
609610
Ondřej Jirman <megi@xff.cz> <megous@megous.com>
610611
Oza Pawandeep <quic_poza@quicinc.com> <poza@codeaurora.org>
611612
Pali Rohár <pali@kernel.org> <pali.rohar@gmail.com>

MAINTAINERS

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@ F: drivers/staging/media/sunxi/cedrus/
915915
ALPHA PORT
916916
M: Richard Henderson <richard.henderson@linaro.org>
917917
M: Matt Turner <mattst88@gmail.com>
918+
M: Magnus Lindholm <linmag7@gmail.com>
918919
L: linux-alpha@vger.kernel.org
919920
S: Odd Fixes
920921
F: arch/alpha/
@@ -13659,7 +13660,7 @@ F: virt/kvm/*
1365913660

1366013661
KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)
1366113662
M: Marc Zyngier <maz@kernel.org>
13662-
M: Oliver Upton <oliver.upton@linux.dev>
13663+
M: Oliver Upton <oupton@kernel.org>
1366313664
R: Joey Gouly <joey.gouly@arm.com>
1366413665
R: Suzuki K Poulose <suzuki.poulose@arm.com>
1366513666
R: Zenghui Yu <yuzenghui@huawei.com>
@@ -16498,12 +16499,12 @@ F: mm/secretmem.c
1649816499

1649916500
MEMORY MANAGEMENT - SWAP
1650016501
M: Andrew Morton <akpm@linux-foundation.org>
16502+
M: Chris Li <chrisl@kernel.org>
16503+
M: Kairui Song <kasong@tencent.com>
1650116504
R: Kemeng Shi <shikemeng@huaweicloud.com>
16502-
R: Kairui Song <kasong@tencent.com>
1650316505
R: Nhat Pham <nphamcs@gmail.com>
1650416506
R: Baoquan He <bhe@redhat.com>
1650516507
R: Barry Song <baohua@kernel.org>
16506-
R: Chris Li <chrisl@kernel.org>
1650716508
L: linux-mm@kvack.org
1650816509
S: Maintained
1650916510
F: Documentation/mm/swap-table.rst

arch/arm64/include/asm/alternative.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@ void __init apply_alternatives_all(void);
2626
bool alternative_is_applied(u16 cpucap);
2727

2828
#ifdef CONFIG_MODULES
29-
void apply_alternatives_module(void *start, size_t length);
29+
int apply_alternatives_module(void *start, size_t length);
3030
#else
31-
static inline void apply_alternatives_module(void *start, size_t length) { }
31+
static inline int apply_alternatives_module(void *start, size_t length)
32+
{
33+
return 0;
34+
}
3235
#endif
3336

3437
void alt_cb_patch_nops(struct alt_instr *alt, __le32 *origptr,

arch/arm64/include/asm/kfence.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
#include <asm/set_memory.h>
1212

13-
static inline bool arch_kfence_init_pool(void) { return true; }
14-
1513
static inline bool kfence_protect_page(unsigned long addr, bool protect)
1614
{
1715
set_memory_valid(addr, 1, !protect);
@@ -25,6 +23,7 @@ static inline bool arm64_kfence_can_set_direct_map(void)
2523
{
2624
return !kfence_early_init;
2725
}
26+
bool arch_kfence_init_pool(void);
2827
#else /* CONFIG_KFENCE */
2928
static inline bool arm64_kfence_can_set_direct_map(void) { return false; }
3029
#endif /* CONFIG_KFENCE */

arch/arm64/include/asm/percpu.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ __percpu_##name##_case_##sz(void *ptr, unsigned long val) \
7777
" stxr" #sfx "\t%w[loop], %" #w "[tmp], %[ptr]\n" \
7878
" cbnz %w[loop], 1b", \
7979
/* LSE atomics */ \
80-
#op_lse "\t%" #w "[val], %[ptr]\n" \
80+
#op_lse "\t%" #w "[val], %" #w "[tmp], %[ptr]\n" \
8181
__nops(3)) \
8282
: [loop] "=&r" (loop), [tmp] "=&r" (tmp), \
8383
[ptr] "+Q"(*(u##sz *)ptr) \
@@ -124,9 +124,16 @@ PERCPU_RW_OPS(8)
124124
PERCPU_RW_OPS(16)
125125
PERCPU_RW_OPS(32)
126126
PERCPU_RW_OPS(64)
127-
PERCPU_OP(add, add, stadd)
128-
PERCPU_OP(andnot, bic, stclr)
129-
PERCPU_OP(or, orr, stset)
127+
128+
/*
129+
* Use value-returning atomics for CPU-local ops as they are more likely
130+
* to execute "near" to the CPU (e.g. in L1$).
131+
*
132+
* https://lore.kernel.org/r/e7d539ed-ced0-4b96-8ecd-048a5b803b85@paulmck-laptop
133+
*/
134+
PERCPU_OP(add, add, ldadd)
135+
PERCPU_OP(andnot, bic, ldclr)
136+
PERCPU_OP(or, orr, ldset)
130137
PERCPU_RET_OP(add, add, ldadd)
131138

132139
#undef PERCPU_RW_OPS

arch/arm64/include/asm/scs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ enum {
5353
EDYNSCS_INVALID_CFA_OPCODE = 4,
5454
};
5555

56-
int __pi_scs_patch(const u8 eh_frame[], int size);
56+
int __pi_scs_patch(const u8 eh_frame[], int size, bool skip_dry_run);
5757

5858
#endif /* __ASSEMBLY __ */
5959

arch/arm64/include/asm/spectre.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ void spectre_bhb_patch_wa3(struct alt_instr *alt,
117117
__le32 *origptr, __le32 *updptr, int nr_inst);
118118
void spectre_bhb_patch_clearbhb(struct alt_instr *alt,
119119
__le32 *origptr, __le32 *updptr, int nr_inst);
120+
void spectre_print_disabled_mitigations(void);
120121

121122
#endif /* __ASSEMBLY__ */
122123
#endif /* __ASM_SPECTRE_H */

arch/arm64/kernel/acpi.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@ static int __init acpi_fadt_sanity_check(void)
197197
*/
198198
void __init acpi_boot_table_init(void)
199199
{
200-
int ret;
201-
202200
/*
203201
* Enable ACPI instead of device tree unless
204202
* - ACPI has been disabled explicitly (acpi=off), or
@@ -252,12 +250,8 @@ void __init acpi_boot_table_init(void)
252250
* behaviour, use acpi=nospcr to disable console in ACPI SPCR
253251
* table as default serial console.
254252
*/
255-
ret = acpi_parse_spcr(earlycon_acpi_spcr_enable,
253+
acpi_parse_spcr(earlycon_acpi_spcr_enable,
256254
!param_acpi_nospcr);
257-
if (!ret || param_acpi_nospcr || !IS_ENABLED(CONFIG_ACPI_SPCR_TABLE))
258-
pr_info("Use ACPI SPCR as default console: No\n");
259-
else
260-
pr_info("Use ACPI SPCR as default console: Yes\n");
261255

262256
if (IS_ENABLED(CONFIG_ACPI_BGRT))
263257
acpi_table_parse(ACPI_SIG_BGRT, acpi_parse_bgrt);

arch/arm64/kernel/alternative.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ static noinstr void clean_dcache_range_nopatch(u64 start, u64 end)
139139
} while (cur += d_size, cur < end);
140140
}
141141

142-
static void __apply_alternatives(const struct alt_region *region,
143-
bool is_module,
144-
unsigned long *cpucap_mask)
142+
static int __apply_alternatives(const struct alt_region *region,
143+
bool is_module,
144+
unsigned long *cpucap_mask)
145145
{
146146
struct alt_instr *alt;
147147
__le32 *origptr, *updptr;
@@ -166,10 +166,13 @@ static void __apply_alternatives(const struct alt_region *region,
166166
updptr = is_module ? origptr : lm_alias(origptr);
167167
nr_inst = alt->orig_len / AARCH64_INSN_SIZE;
168168

169-
if (ALT_HAS_CB(alt))
169+
if (ALT_HAS_CB(alt)) {
170170
alt_cb = ALT_REPL_PTR(alt);
171-
else
171+
if (is_module && !core_kernel_text((unsigned long)alt_cb))
172+
return -ENOEXEC;
173+
} else {
172174
alt_cb = patch_alternative;
175+
}
173176

174177
alt_cb(alt, origptr, updptr, nr_inst);
175178

@@ -193,6 +196,8 @@ static void __apply_alternatives(const struct alt_region *region,
193196
bitmap_and(applied_alternatives, applied_alternatives,
194197
system_cpucaps, ARM64_NCAPS);
195198
}
199+
200+
return 0;
196201
}
197202

198203
static void __init apply_alternatives_vdso(void)
@@ -277,7 +282,7 @@ void __init apply_boot_alternatives(void)
277282
}
278283

279284
#ifdef CONFIG_MODULES
280-
void apply_alternatives_module(void *start, size_t length)
285+
int apply_alternatives_module(void *start, size_t length)
281286
{
282287
struct alt_region region = {
283288
.begin = start,
@@ -287,7 +292,7 @@ void apply_alternatives_module(void *start, size_t length)
287292

288293
bitmap_fill(all_capabilities, ARM64_NCAPS);
289294

290-
__apply_alternatives(&region, true, &all_capabilities[0]);
295+
return __apply_alternatives(&region, true, &all_capabilities[0]);
291296
}
292297
#endif
293298

arch/arm64/kernel/cpufeature.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
#include <asm/vectors.h>
9696
#include <asm/virt.h>
9797

98+
#include <asm/spectre.h>
9899
/* Kernel representation of AT_HWCAP and AT_HWCAP2 */
99100
static DECLARE_BITMAP(elf_hwcap, MAX_CPU_FEATURES) __read_mostly;
100101

@@ -3875,6 +3876,11 @@ static void __init setup_system_capabilities(void)
38753876
*/
38763877
if (system_uses_ttbr0_pan())
38773878
pr_info("emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching\n");
3879+
3880+
/*
3881+
* Report Spectre mitigations status.
3882+
*/
3883+
spectre_print_disabled_mitigations();
38783884
}
38793885

38803886
void __init setup_system_features(void)

0 commit comments

Comments
 (0)