Skip to content

Commit f9e373e

Browse files
committed
Merge remote-tracking branch 'stable/linux-6.12.y' into v6.12+
2 parents 7eb4b3d + 319addc commit f9e373e

168 files changed

Lines changed: 1680 additions & 886 deletions

File tree

Some content is hidden

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

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 6
33
PATCHLEVEL = 12
4-
SUBLEVEL = 6
4+
SUBLEVEL = 7
55
EXTRAVERSION =
66
NAME = Baby Opossum Posse
77

arch/arm64/kvm/sys_regs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,8 @@ static const struct sys_reg_desc sys_reg_descs[] = {
25032503
ID_WRITABLE(ID_AA64MMFR0_EL1, ~(ID_AA64MMFR0_EL1_RES0 |
25042504
ID_AA64MMFR0_EL1_TGRAN4_2 |
25052505
ID_AA64MMFR0_EL1_TGRAN64_2 |
2506-
ID_AA64MMFR0_EL1_TGRAN16_2)),
2506+
ID_AA64MMFR0_EL1_TGRAN16_2 |
2507+
ID_AA64MMFR0_EL1_ASIDBITS)),
25072508
ID_WRITABLE(ID_AA64MMFR1_EL1, ~(ID_AA64MMFR1_EL1_RES0 |
25082509
ID_AA64MMFR1_EL1_HCX |
25092510
ID_AA64MMFR1_EL1_TWED |

arch/hexagon/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ KBUILD_LDFLAGS += $(ldflags-y)
3232
TIR_NAME := r19
3333
KBUILD_CFLAGS += -ffixed-$(TIR_NAME) -DTHREADINFO_REG=$(TIR_NAME) -D__linux__
3434
KBUILD_AFLAGS += -DTHREADINFO_REG=$(TIR_NAME)
35+
36+
# Disable HexagonConstExtenders pass for LLVM versions prior to 19.1.0
37+
# https://github.com/llvm/llvm-project/issues/99714
38+
ifneq ($(call clang-min-version, 190100),y)
39+
KBUILD_CFLAGS += -mllvm -hexagon-cext=false
40+
endif

arch/riscv/kvm/aia.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ void kvm_riscv_aia_enable(void)
552552
csr_set(CSR_HIE, BIT(IRQ_S_GEXT));
553553
/* Enable IRQ filtering for overflow interrupt only if sscofpmf is present */
554554
if (__riscv_isa_extension_available(NULL, RISCV_ISA_EXT_SSCOFPMF))
555-
csr_write(CSR_HVIEN, BIT(IRQ_PMU_OVF));
555+
csr_set(CSR_HVIEN, BIT(IRQ_PMU_OVF));
556556
}
557557

558558
void kvm_riscv_aia_disable(void)

arch/s390/boot/startup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ static unsigned long get_vmem_size(unsigned long identity_size,
231231
vsize = round_up(SZ_2G + max_mappable, rte_size) +
232232
round_up(vmemmap_size, rte_size) +
233233
FIXMAP_SIZE + MODULES_LEN + KASLR_LEN;
234+
if (IS_ENABLED(CONFIG_KMSAN))
235+
vsize += MODULES_LEN * 2;
234236
return size_add(vsize, vmalloc_size);
235237
}
236238

arch/s390/boot/vmem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ static void pgtable_pte_populate(pmd_t *pmd, unsigned long addr, unsigned long e
306306
pages++;
307307
}
308308
}
309-
if (mode == POPULATE_DIRECT)
309+
if (mode == POPULATE_IDENTITY)
310310
update_page_count(PG_DIRECT_MAP_4K, pages);
311311
}
312312

@@ -339,7 +339,7 @@ static void pgtable_pmd_populate(pud_t *pud, unsigned long addr, unsigned long e
339339
}
340340
pgtable_pte_populate(pmd, addr, next, mode);
341341
}
342-
if (mode == POPULATE_DIRECT)
342+
if (mode == POPULATE_IDENTITY)
343343
update_page_count(PG_DIRECT_MAP_1M, pages);
344344
}
345345

@@ -372,7 +372,7 @@ static void pgtable_pud_populate(p4d_t *p4d, unsigned long addr, unsigned long e
372372
}
373373
pgtable_pmd_populate(pud, addr, next, mode);
374374
}
375-
if (mode == POPULATE_DIRECT)
375+
if (mode == POPULATE_IDENTITY)
376376
update_page_count(PG_DIRECT_MAP_2G, pages);
377377
}
378378

arch/s390/kernel/ipl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static ssize_t sys_##_prefix##_##_name##_store(struct kobject *kobj, \
270270
if (len >= sizeof(_value)) \
271271
return -E2BIG; \
272272
len = strscpy(_value, buf, sizeof(_value)); \
273-
if (len < 0) \
273+
if ((ssize_t)len < 0) \
274274
return len; \
275275
strim(_value); \
276276
return len; \

arch/x86/kernel/cpu/mshyperv.c

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,63 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs)
223223
hyperv_cleanup();
224224
}
225225
#endif /* CONFIG_CRASH_DUMP */
226+
227+
static u64 hv_ref_counter_at_suspend;
228+
static void (*old_save_sched_clock_state)(void);
229+
static void (*old_restore_sched_clock_state)(void);
230+
231+
/*
232+
* Hyper-V clock counter resets during hibernation. Save and restore clock
233+
* offset during suspend/resume, while also considering the time passed
234+
* before suspend. This is to make sure that sched_clock using hv tsc page
235+
* based clocksource, proceeds from where it left off during suspend and
236+
* it shows correct time for the timestamps of kernel messages after resume.
237+
*/
238+
static void save_hv_clock_tsc_state(void)
239+
{
240+
hv_ref_counter_at_suspend = hv_read_reference_counter();
241+
}
242+
243+
static void restore_hv_clock_tsc_state(void)
244+
{
245+
/*
246+
* Adjust the offsets used by hv tsc clocksource to
247+
* account for the time spent before hibernation.
248+
* adjusted value = reference counter (time) at suspend
249+
* - reference counter (time) now.
250+
*/
251+
hv_adj_sched_clock_offset(hv_ref_counter_at_suspend - hv_read_reference_counter());
252+
}
253+
254+
/*
255+
* Functions to override save_sched_clock_state and restore_sched_clock_state
256+
* functions of x86_platform. The Hyper-V clock counter is reset during
257+
* suspend-resume and the offset used to measure time needs to be
258+
* corrected, post resume.
259+
*/
260+
static void hv_save_sched_clock_state(void)
261+
{
262+
old_save_sched_clock_state();
263+
save_hv_clock_tsc_state();
264+
}
265+
266+
static void hv_restore_sched_clock_state(void)
267+
{
268+
restore_hv_clock_tsc_state();
269+
old_restore_sched_clock_state();
270+
}
271+
272+
static void __init x86_setup_ops_for_tsc_pg_clock(void)
273+
{
274+
if (!(ms_hyperv.features & HV_MSR_REFERENCE_TSC_AVAILABLE))
275+
return;
276+
277+
old_save_sched_clock_state = x86_platform.save_sched_clock_state;
278+
x86_platform.save_sched_clock_state = hv_save_sched_clock_state;
279+
280+
old_restore_sched_clock_state = x86_platform.restore_sched_clock_state;
281+
x86_platform.restore_sched_clock_state = hv_restore_sched_clock_state;
282+
}
226283
#endif /* CONFIG_HYPERV */
227284

228285
static uint32_t __init ms_hyperv_platform(void)
@@ -579,6 +636,7 @@ static void __init ms_hyperv_init_platform(void)
579636

580637
/* Register Hyper-V specific clocksource */
581638
hv_init_clocksource();
639+
x86_setup_ops_for_tsc_pg_clock();
582640
hv_vtl_init_platform();
583641
#endif
584642
/*

arch/x86/kvm/cpuid.c

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,26 @@
3636
u32 kvm_cpu_caps[NR_KVM_CPU_CAPS] __read_mostly;
3737
EXPORT_SYMBOL_GPL(kvm_cpu_caps);
3838

39+
struct cpuid_xstate_sizes {
40+
u32 eax;
41+
u32 ebx;
42+
u32 ecx;
43+
};
44+
45+
static struct cpuid_xstate_sizes xstate_sizes[XFEATURE_MAX] __ro_after_init;
46+
47+
void __init kvm_init_xstate_sizes(void)
48+
{
49+
u32 ign;
50+
int i;
51+
52+
for (i = XFEATURE_YMM; i < ARRAY_SIZE(xstate_sizes); i++) {
53+
struct cpuid_xstate_sizes *xs = &xstate_sizes[i];
54+
55+
cpuid_count(0xD, i, &xs->eax, &xs->ebx, &xs->ecx, &ign);
56+
}
57+
}
58+
3959
u32 xstate_required_size(u64 xstate_bv, bool compacted)
4060
{
4161
int feature_bit = 0;
@@ -44,14 +64,15 @@ u32 xstate_required_size(u64 xstate_bv, bool compacted)
4464
xstate_bv &= XFEATURE_MASK_EXTEND;
4565
while (xstate_bv) {
4666
if (xstate_bv & 0x1) {
47-
u32 eax, ebx, ecx, edx, offset;
48-
cpuid_count(0xD, feature_bit, &eax, &ebx, &ecx, &edx);
67+
struct cpuid_xstate_sizes *xs = &xstate_sizes[feature_bit];
68+
u32 offset;
69+
4970
/* ECX[1]: 64B alignment in compacted form */
5071
if (compacted)
51-
offset = (ecx & 0x2) ? ALIGN(ret, 64) : ret;
72+
offset = (xs->ecx & 0x2) ? ALIGN(ret, 64) : ret;
5273
else
53-
offset = ebx;
54-
ret = max(ret, offset + eax);
74+
offset = xs->ebx;
75+
ret = max(ret, offset + xs->eax);
5576
}
5677

5778
xstate_bv >>= 1;

arch/x86/kvm/cpuid.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
3232
bool kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx,
3333
u32 *ecx, u32 *edx, bool exact_only);
3434

35+
void __init kvm_init_xstate_sizes(void);
3536
u32 xstate_required_size(u64 xstate_bv, bool compacted);
3637

3738
int cpuid_query_maxphyaddr(struct kvm_vcpu *vcpu);

0 commit comments

Comments
 (0)