Skip to content

Commit 58fb66c

Browse files
committed
Merge tag 'v6.6.83' into 6.6-main
This is the 6.6.83 stable release # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmfSyLoACgkQONu9yGCS # aT5ioRAAjc8tbbt6WfQoHQdy34s+/OUX8H+BTIHuGVbSRqU9xEbKmcaTbaQD266K # AVcu+FpxwDNF9l1jxeh3XZsyIX5AwrFshA78HVwrz+IXtFcWBajwZ02Hv3EmUEqV # ZrJksF/B1UcSSeBnAFHk/z3OLhqPgucmAKhlJRSvZf+Ps79+J405aG7/TUt5nVPE # klQhqh35LWlCOZujKGwgOlJXsWwZdEA3rn87JBQxfTWJGQlMUY7+HP2dOLBu1cdZ # zi72mkxw9Z6oA1IJl4DhVEsx/EH5P+tVGgiLN5yoJw5+NwB5XdXZ2TH5fZfcEtK4 # PEFs735w4VB8gbhVsDsnI23dSBNwbcwYFJgEIWHd+ZmfwNRSW4W0LPgFaKp79i3M # CDoi0HZ8v0P9p5ZO+11oCAVfndxtVZlVSAm/lrTS0yEan7jiPcfN173hNfCMWAxj # TR+O5IT9FbfYeVcnYUE9LdQZf5tx0GakvylGBfPWuwG0oCEQi5C9zSus7+pDSyrG # rCNjnrhvS1shZrijV4xBaRFfqNv1kWl5k9jZCrq2EiWi1hyL+uiRKvUhhroiE4BF # OA/2hllJSqzvW0hLcxd9YqbxwlQJ8h+hox4TyCyvA1pjnbtCIAOQ5pxfY4EVcmD9 # oG2B+JGHxQJmSXArRW7KctcAu/h7ciTsC7yej1fXbzBOxeadO/A= # =3QPz # -----END PGP SIGNATURE----- # gpg: Signature made Thu Mar 13 12:59:54 2025 CET # gpg: using RSA key 647F28654894E3BD457199BE38DBBDC86092693E # gpg: Can't check signature: No public key
2 parents 6007032 + 594a1dd commit 58fb66c

File tree

166 files changed

+1330
-707
lines changed

Some content is hidden

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

166 files changed

+1330
-707
lines changed

Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 6
33
PATCHLEVEL = 6
4-
SUBLEVEL = 82
4+
SUBLEVEL = 83
55
EXTRAVERSION =
66
NAME = Pinguïn Aangedreven
77

@@ -1057,6 +1057,11 @@ endif
10571057
KBUILD_USERCFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
10581058
KBUILD_USERLDFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
10591059

1060+
# userspace programs are linked via the compiler, use the correct linker
1061+
ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_LD_IS_LLD),yy)
1062+
KBUILD_USERLDFLAGS += $(call cc-option, --ld-path=$(LD))
1063+
endif
1064+
10601065
# make the checker run with the right architecture
10611066
CHECKFLAGS += --arch=$(ARCH)
10621067

arch/arm64/boot/dts/rockchip/px30-ringneck-haikou.dts

+1
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@
226226

227227
&uart5 {
228228
pinctrl-0 = <&uart5_xfer>;
229+
rts-gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
229230
status = "okay";
230231
};
231232

arch/arm64/include/asm/hugetlb.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
3434
unsigned long addr, pte_t *ptep,
3535
pte_t pte, int dirty);
3636
#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
37-
extern pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
38-
unsigned long addr, pte_t *ptep);
37+
extern pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
38+
pte_t *ptep, unsigned long sz);
3939
#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
4040
extern void huge_ptep_set_wrprotect(struct mm_struct *mm,
4141
unsigned long addr, pte_t *ptep);

arch/arm64/mm/hugetlbpage.c

+25-36
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,11 @@ static int find_num_contig(struct mm_struct *mm, unsigned long addr,
121121

122122
static inline int num_contig_ptes(unsigned long size, size_t *pgsize)
123123
{
124-
int contig_ptes = 0;
124+
int contig_ptes = 1;
125125

126126
*pgsize = size;
127127

128128
switch (size) {
129-
#ifndef __PAGETABLE_PMD_FOLDED
130-
case PUD_SIZE:
131-
if (pud_sect_supported())
132-
contig_ptes = 1;
133-
break;
134-
#endif
135-
case PMD_SIZE:
136-
contig_ptes = 1;
137-
break;
138129
case CONT_PMD_SIZE:
139130
*pgsize = PMD_SIZE;
140131
contig_ptes = CONT_PMDS;
@@ -143,6 +134,8 @@ static inline int num_contig_ptes(unsigned long size, size_t *pgsize)
143134
*pgsize = PAGE_SIZE;
144135
contig_ptes = CONT_PTES;
145136
break;
137+
default:
138+
WARN_ON(!__hugetlb_valid_size(size));
146139
}
147140

148141
return contig_ptes;
@@ -184,24 +177,23 @@ static pte_t get_clear_contig(struct mm_struct *mm,
184177
unsigned long pgsize,
185178
unsigned long ncontig)
186179
{
187-
pte_t orig_pte = ptep_get(ptep);
188-
unsigned long i;
189-
190-
for (i = 0; i < ncontig; i++, addr += pgsize, ptep++) {
191-
pte_t pte = ptep_get_and_clear(mm, addr, ptep);
192-
193-
/*
194-
* If HW_AFDBM is enabled, then the HW could turn on
195-
* the dirty or accessed bit for any page in the set,
196-
* so check them all.
197-
*/
198-
if (pte_dirty(pte))
199-
orig_pte = pte_mkdirty(orig_pte);
200-
201-
if (pte_young(pte))
202-
orig_pte = pte_mkyoung(orig_pte);
180+
pte_t pte, tmp_pte;
181+
bool present;
182+
183+
pte = ptep_get_and_clear(mm, addr, ptep);
184+
present = pte_present(pte);
185+
while (--ncontig) {
186+
ptep++;
187+
addr += pgsize;
188+
tmp_pte = ptep_get_and_clear(mm, addr, ptep);
189+
if (present) {
190+
if (pte_dirty(tmp_pte))
191+
pte = pte_mkdirty(pte);
192+
if (pte_young(tmp_pte))
193+
pte = pte_mkyoung(pte);
194+
}
203195
}
204-
return orig_pte;
196+
return pte;
205197
}
206198

207199
static pte_t get_clear_contig_flush(struct mm_struct *mm,
@@ -403,18 +395,13 @@ void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
403395
pte_clear(mm, addr, ptep);
404396
}
405397

406-
pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
407-
unsigned long addr, pte_t *ptep)
398+
pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
399+
pte_t *ptep, unsigned long sz)
408400
{
409401
int ncontig;
410402
size_t pgsize;
411-
pte_t orig_pte = ptep_get(ptep);
412-
413-
if (!pte_cont(orig_pte))
414-
return ptep_get_and_clear(mm, addr, ptep);
415-
416-
ncontig = find_num_contig(mm, addr, ptep, &pgsize);
417403

404+
ncontig = num_contig_ptes(sz, &pgsize);
418405
return get_clear_contig(mm, addr, ptep, pgsize, ncontig);
419406
}
420407

@@ -556,6 +543,8 @@ bool __init arch_hugetlb_valid_size(unsigned long size)
556543

557544
pte_t huge_ptep_modify_prot_start(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep)
558545
{
546+
unsigned long psize = huge_page_size(hstate_vma(vma));
547+
559548
if (IS_ENABLED(CONFIG_ARM64_ERRATUM_2645198) &&
560549
cpus_have_const_cap(ARM64_WORKAROUND_2645198)) {
561550
/*
@@ -566,7 +555,7 @@ pte_t huge_ptep_modify_prot_start(struct vm_area_struct *vma, unsigned long addr
566555
if (pte_user_exec(READ_ONCE(*ptep)))
567556
return huge_ptep_clear_flush(vma, addr, ptep);
568557
}
569-
return huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
558+
return huge_ptep_get_and_clear(vma->vm_mm, addr, ptep, psize);
570559
}
571560

572561
void huge_ptep_modify_prot_commit(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep,

arch/loongarch/include/asm/hugetlb.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
4141

4242
#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
4343
static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
44-
unsigned long addr, pte_t *ptep)
44+
unsigned long addr, pte_t *ptep,
45+
unsigned long sz)
4546
{
4647
pte_t clear;
4748
pte_t pte = *ptep;
@@ -56,8 +57,9 @@ static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
5657
unsigned long addr, pte_t *ptep)
5758
{
5859
pte_t pte;
60+
unsigned long sz = huge_page_size(hstate_vma(vma));
5961

60-
pte = huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
62+
pte = huge_ptep_get_and_clear(vma->vm_mm, addr, ptep, sz);
6163
flush_tlb_page(vma, addr);
6264
return pte;
6365
}

arch/loongarch/kernel/machine_kexec.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ void kexec_reboot(void)
126126
/* All secondary cpus go to kexec_smp_wait */
127127
if (smp_processor_id() > 0) {
128128
relocated_kexec_smp_wait(NULL);
129-
unreachable();
129+
BUG();
130130
}
131131
#endif
132132

133133
do_kexec = (void *)reboot_code_buffer;
134134
do_kexec(efi_boot, cmdline_ptr, systable_ptr, start_addr, first_ind_entry);
135135

136-
unreachable();
136+
BUG();
137137
}
138138

139139

arch/loongarch/kernel/setup.c

+3
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,9 @@ static void __init check_kernel_sections_mem(void)
400400
*/
401401
static void __init arch_mem_init(char **cmdline_p)
402402
{
403+
/* Recalculate max_low_pfn for "mem=xxx" */
404+
max_pfn = max_low_pfn = PHYS_PFN(memblock_end_of_DRAM());
405+
403406
if (usermem)
404407
pr_info("User-defined physical RAM map overwrite\n");
405408

arch/loongarch/kernel/smp.c

+46-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/smp.h>
1919
#include <linux/threads.h>
2020
#include <linux/export.h>
21+
#include <linux/suspend.h>
2122
#include <linux/syscore_ops.h>
2223
#include <linux/time.h>
2324
#include <linux/tracepoint.h>
@@ -388,7 +389,7 @@ void loongson_cpu_die(unsigned int cpu)
388389
mb();
389390
}
390391

391-
void __noreturn arch_cpu_idle_dead(void)
392+
static void __noreturn idle_play_dead(void)
392393
{
393394
register uint64_t addr;
394395
register void (*init_fn)(void);
@@ -412,6 +413,50 @@ void __noreturn arch_cpu_idle_dead(void)
412413
BUG();
413414
}
414415

416+
#ifdef CONFIG_HIBERNATION
417+
static void __noreturn poll_play_dead(void)
418+
{
419+
register uint64_t addr;
420+
register void (*init_fn)(void);
421+
422+
idle_task_exit();
423+
__this_cpu_write(cpu_state, CPU_DEAD);
424+
425+
__smp_mb();
426+
do {
427+
__asm__ __volatile__("nop\n\t");
428+
addr = iocsr_read64(LOONGARCH_IOCSR_MBUF0);
429+
} while (addr == 0);
430+
431+
init_fn = (void *)TO_CACHE(addr);
432+
iocsr_write32(0xffffffff, LOONGARCH_IOCSR_IPI_CLEAR);
433+
434+
init_fn();
435+
BUG();
436+
}
437+
#endif
438+
439+
static void (*play_dead)(void) = idle_play_dead;
440+
441+
void __noreturn arch_cpu_idle_dead(void)
442+
{
443+
play_dead();
444+
BUG(); /* play_dead() doesn't return */
445+
}
446+
447+
#ifdef CONFIG_HIBERNATION
448+
int hibernate_resume_nonboot_cpu_disable(void)
449+
{
450+
int ret;
451+
452+
play_dead = poll_play_dead;
453+
ret = suspend_disable_secondary_cpus();
454+
play_dead = idle_play_dead;
455+
456+
return ret;
457+
}
458+
#endif
459+
415460
#endif
416461

417462
/*

arch/mips/include/asm/hugetlb.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ static inline int prepare_hugepage_range(struct file *file,
3232

3333
#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
3434
static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
35-
unsigned long addr, pte_t *ptep)
35+
unsigned long addr, pte_t *ptep,
36+
unsigned long sz)
3637
{
3738
pte_t clear;
3839
pte_t pte = *ptep;
@@ -47,13 +48,14 @@ static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
4748
unsigned long addr, pte_t *ptep)
4849
{
4950
pte_t pte;
51+
unsigned long sz = huge_page_size(hstate_vma(vma));
5052

5153
/*
5254
* clear the huge pte entry firstly, so that the other smp threads will
5355
* not get old pte entry after finishing flush_tlb_page and before
5456
* setting new huge pte entry
5557
*/
56-
pte = huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
58+
pte = huge_ptep_get_and_clear(vma->vm_mm, addr, ptep, sz);
5759
flush_tlb_page(vma, addr);
5860
return pte;
5961
}

arch/parisc/include/asm/hugetlb.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
1010

1111
#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
1212
pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
13-
pte_t *ptep);
13+
pte_t *ptep, unsigned long sz);
1414

1515
/*
1616
* If the arch doesn't supply something else, assume that hugepage

arch/parisc/mm/hugetlbpage.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
147147

148148

149149
pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
150-
pte_t *ptep)
150+
pte_t *ptep, unsigned long sz)
151151
{
152152
pte_t entry;
153153

arch/powerpc/include/asm/hugetlb.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
4646

4747
#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
4848
static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
49-
unsigned long addr, pte_t *ptep)
49+
unsigned long addr, pte_t *ptep,
50+
unsigned long sz)
5051
{
5152
return __pte(pte_update(mm, addr, ptep, ~0UL, 0, 1));
5253
}
@@ -56,8 +57,9 @@ static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
5657
unsigned long addr, pte_t *ptep)
5758
{
5859
pte_t pte;
60+
unsigned long sz = huge_page_size(hstate_vma(vma));
5961

60-
pte = huge_ptep_get_and_clear(vma->vm_mm, addr, ptep);
62+
pte = huge_ptep_get_and_clear(vma->vm_mm, addr, ptep, sz);
6163
flush_hugetlb_page(vma, addr);
6264
return pte;
6365
}

0 commit comments

Comments
 (0)