Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'loongarch-fixes-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson

Pull LoongArch fixes from Huacai Chen:
"Fix several build errors, a potential kernel panic, a cpu hotplug
issue and update links in documentations"

* tag 'loongarch-fixes-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
Docs/zh_CN/LoongArch: Update links in LoongArch introduction.rst
Docs/LoongArch: Update links in LoongArch introduction.rst
LoongArch: Implement constant timer shutdown interface
LoongArch: Mark {dmw,tlb}_virt_to_page() exports as non-GPL
LoongArch: Silence the boot warning about 'nokaslr'
LoongArch: Add __percpu annotation for __percpu_read()/__percpu_write()
LoongArch: Record pc instead of offset in la_abs relocation
LoongArch: Explicitly set -fdirect-access-external-data for vmlinux
LoongArch: Add dependency between vmlinuz.efi and vmlinux.efi

+36 -32
+2 -2
Documentation/arch/loongarch/introduction.rst
··· 375 375 376 376 Documentation of LoongArch ISA: 377 377 378 - https://github.com/loongson/LoongArch-Documentation/releases/latest/download/LoongArch-Vol1-v1.02-CN.pdf (in Chinese) 378 + https://github.com/loongson/LoongArch-Documentation/releases/latest/download/LoongArch-Vol1-v1.10-CN.pdf (in Chinese) 379 379 380 - https://github.com/loongson/LoongArch-Documentation/releases/latest/download/LoongArch-Vol1-v1.02-EN.pdf (in English) 380 + https://github.com/loongson/LoongArch-Documentation/releases/latest/download/LoongArch-Vol1-v1.10-EN.pdf (in English) 381 381 382 382 Documentation of LoongArch ELF psABI: 383 383
+2 -2
Documentation/translations/zh_CN/arch/loongarch/introduction.rst
··· 338 338 339 339 LoongArch指令集架构的文档: 340 340 341 - https://github.com/loongson/LoongArch-Documentation/releases/latest/download/LoongArch-Vol1-v1.02-CN.pdf (中文版) 341 + https://github.com/loongson/LoongArch-Documentation/releases/latest/download/LoongArch-Vol1-v1.10-CN.pdf (中文版) 342 342 343 - https://github.com/loongson/LoongArch-Documentation/releases/latest/download/LoongArch-Vol1-v1.02-EN.pdf (英文版) 343 + https://github.com/loongson/LoongArch-Documentation/releases/latest/download/LoongArch-Vol1-v1.10-EN.pdf (英文版) 344 344 345 345 LoongArch的ELF psABI文档: 346 346
+3
arch/loongarch/Makefile
··· 68 68 ifdef CONFIG_AS_HAS_EXPLICIT_RELOCS 69 69 cflags-y += $(call cc-option,-mexplicit-relocs) 70 70 KBUILD_CFLAGS_KERNEL += $(call cc-option,-mdirect-extern-access) 71 + KBUILD_CFLAGS_KERNEL += $(call cc-option,-fdirect-access-external-data) 71 72 KBUILD_AFLAGS_MODULE += $(call cc-option,-fno-direct-access-external-data) 72 73 KBUILD_CFLAGS_MODULE += $(call cc-option,-fno-direct-access-external-data) 73 74 KBUILD_AFLAGS_MODULE += $(call cc-option,-mno-relax) $(call cc-option,-Wa$(comma)-mno-relax) ··· 142 141 vdso-install-y += arch/loongarch/vdso/vdso.so.dbg 143 142 144 143 all: $(notdir $(KBUILD_IMAGE)) 144 + 145 + vmlinuz.efi: vmlinux.efi 145 146 146 147 vmlinux.elf vmlinux.efi vmlinuz.efi: vmlinux 147 148 $(Q)$(MAKE) $(build)=$(boot) $(bootvars-y) $(boot)/$@
+1 -2
arch/loongarch/include/asm/asmmacro.h
··· 609 609 lu32i.d \reg, 0 610 610 lu52i.d \reg, \reg, 0 611 611 .pushsection ".la_abs", "aw", %progbits 612 - 768: 613 - .dword 768b-766b 612 + .dword 766b 614 613 .dword \sym 615 614 .popsection 616 615 #endif
+5 -6
arch/loongarch/include/asm/percpu.h
··· 40 40 switch (size) { \ 41 41 case 4: \ 42 42 __asm__ __volatile__( \ 43 - "am"#asm_op".w" " %[ret], %[val], %[ptr] \n" \ 43 + "am"#asm_op".w" " %[ret], %[val], %[ptr] \n" \ 44 44 : [ret] "=&r" (ret), [ptr] "+ZB"(*(u32 *)ptr) \ 45 45 : [val] "r" (val)); \ 46 46 break; \ 47 47 case 8: \ 48 48 __asm__ __volatile__( \ 49 - "am"#asm_op".d" " %[ret], %[val], %[ptr] \n" \ 49 + "am"#asm_op".d" " %[ret], %[val], %[ptr] \n" \ 50 50 : [ret] "=&r" (ret), [ptr] "+ZB"(*(u64 *)ptr) \ 51 51 : [val] "r" (val)); \ 52 52 break; \ ··· 63 63 PERCPU_OP(or, or, |) 64 64 #undef PERCPU_OP 65 65 66 - static __always_inline unsigned long __percpu_read(void *ptr, int size) 66 + static __always_inline unsigned long __percpu_read(void __percpu *ptr, int size) 67 67 { 68 68 unsigned long ret; 69 69 ··· 100 100 return ret; 101 101 } 102 102 103 - static __always_inline void __percpu_write(void *ptr, unsigned long val, int size) 103 + static __always_inline void __percpu_write(void __percpu *ptr, unsigned long val, int size) 104 104 { 105 105 switch (size) { 106 106 case 1: ··· 132 132 } 133 133 } 134 134 135 - static __always_inline unsigned long __percpu_xchg(void *ptr, unsigned long val, 136 - int size) 135 + static __always_inline unsigned long __percpu_xchg(void *ptr, unsigned long val, int size) 137 136 { 138 137 switch (size) { 139 138 case 1:
+1 -1
arch/loongarch/include/asm/setup.h
··· 25 25 #ifdef CONFIG_RELOCATABLE 26 26 27 27 struct rela_la_abs { 28 - long offset; 28 + long pc; 29 29 long symvalue; 30 30 }; 31 31
+9 -1
arch/loongarch/kernel/relocate.c
··· 52 52 for (p = begin; (void *)p < end; p++) { 53 53 long v = p->symvalue; 54 54 uint32_t lu12iw, ori, lu32id, lu52id; 55 - union loongarch_instruction *insn = (void *)p - p->offset; 55 + union loongarch_instruction *insn = (void *)p->pc; 56 56 57 57 lu12iw = (v >> 12) & 0xfffff; 58 58 ori = v & 0xfff; ··· 101 101 102 102 return hash; 103 103 } 104 + 105 + static int __init nokaslr(char *p) 106 + { 107 + pr_info("KASLR is disabled.\n"); 108 + 109 + return 0; /* Print a notice and silence the boot warning */ 110 + } 111 + early_param("nokaslr", nokaslr); 104 112 105 113 static inline __init bool kaslr_disabled(void) 106 114 {
+11 -16
arch/loongarch/kernel/time.c
··· 58 58 return 0; 59 59 } 60 60 61 - static int constant_set_state_oneshot_stopped(struct clock_event_device *evt) 62 - { 63 - unsigned long timer_config; 64 - 65 - raw_spin_lock(&state_lock); 66 - 67 - timer_config = csr_read64(LOONGARCH_CSR_TCFG); 68 - timer_config &= ~CSR_TCFG_EN; 69 - csr_write64(timer_config, LOONGARCH_CSR_TCFG); 70 - 71 - raw_spin_unlock(&state_lock); 72 - 73 - return 0; 74 - } 75 - 76 61 static int constant_set_state_periodic(struct clock_event_device *evt) 77 62 { 78 63 unsigned long period; ··· 77 92 78 93 static int constant_set_state_shutdown(struct clock_event_device *evt) 79 94 { 95 + unsigned long timer_config; 96 + 97 + raw_spin_lock(&state_lock); 98 + 99 + timer_config = csr_read64(LOONGARCH_CSR_TCFG); 100 + timer_config &= ~CSR_TCFG_EN; 101 + csr_write64(timer_config, LOONGARCH_CSR_TCFG); 102 + 103 + raw_spin_unlock(&state_lock); 104 + 80 105 return 0; 81 106 } 82 107 ··· 156 161 cd->rating = 320; 157 162 cd->cpumask = cpumask_of(cpu); 158 163 cd->set_state_oneshot = constant_set_state_oneshot; 159 - cd->set_state_oneshot_stopped = constant_set_state_oneshot_stopped; 164 + cd->set_state_oneshot_stopped = constant_set_state_shutdown; 160 165 cd->set_state_periodic = constant_set_state_periodic; 161 166 cd->set_state_shutdown = constant_set_state_shutdown; 162 167 cd->set_next_event = constant_timer_next_event;
+2 -2
arch/loongarch/mm/pgtable.c
··· 13 13 { 14 14 return pfn_to_page(virt_to_pfn(kaddr)); 15 15 } 16 - EXPORT_SYMBOL_GPL(dmw_virt_to_page); 16 + EXPORT_SYMBOL(dmw_virt_to_page); 17 17 18 18 struct page *tlb_virt_to_page(unsigned long kaddr) 19 19 { 20 20 return pfn_to_page(pte_pfn(*virt_to_kpte(kaddr))); 21 21 } 22 - EXPORT_SYMBOL_GPL(tlb_virt_to_page); 22 + EXPORT_SYMBOL(tlb_virt_to_page); 23 23 24 24 pgd_t *pgd_alloc(struct mm_struct *mm) 25 25 {