Commit 74e9347e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'loongarch-fixes-6.6-3' of...

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

Pull LoongArch fixes from Huacai ChenL
 "Fix 4-level pagetable building, disable WUC for pgprot_writecombine()
  like ioremap_wc(), use correct annotation for exception handlers, and
  a trivial cleanup"

* tag 'loongarch-fixes-6.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
  LoongArch: Disable WUC for pgprot_writecombine() like ioremap_wc()
  LoongArch: Replace kmap_atomic() with kmap_local_page() in copy_user_highpage()
  LoongArch: Export symbol invalid_pud_table for modules building
  LoongArch: Use SYM_CODE_* to annotate exception handlers
parents 54fb58ae 278be836
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -52,10 +52,9 @@ static inline void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size,
 * @offset:    bus address of the memory
 * @size:      size of the resource to map
 */
extern pgprot_t pgprot_wc;

#define ioremap_wc(offset, size)	\
	ioremap_prot((offset), (size), pgprot_val(pgprot_wc))
	ioremap_prot((offset), (size),	\
		pgprot_val(wc_enabled ? PAGE_KERNEL_WUC : PAGE_KERNEL_SUC))

#define ioremap_cache(offset, size)	\
	ioremap_prot((offset), (size), pgprot_val(PAGE_KERNEL))
+8 −0
Original line number Diff line number Diff line
@@ -33,4 +33,12 @@
	.cfi_endproc;					\
	SYM_END(name, SYM_T_FUNC)

#define SYM_CODE_START(name)				\
	SYM_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)	\
	.cfi_startproc;

#define SYM_CODE_END(name)				\
	.cfi_endproc;					\
	SYM_END(name, SYM_T_NONE)

#endif
+3 −1
Original line number Diff line number Diff line
@@ -105,13 +105,15 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot)
	return __pgprot(prot);
}

extern bool wc_enabled;

#define pgprot_writecombine pgprot_writecombine

static inline pgprot_t pgprot_writecombine(pgprot_t _prot)
{
	unsigned long prot = pgprot_val(_prot);

	prot = (prot & ~_CACHE_MASK) | _CACHE_WUC;
	prot = (prot & ~_CACHE_MASK) | (wc_enabled ? _CACHE_WUC : _CACHE_SUC);

	return __pgprot(prot);
}
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
	.text
	.cfi_sections	.debug_frame
	.align	5
SYM_FUNC_START(handle_syscall)
SYM_CODE_START(handle_syscall)
	csrrd		t0, PERCPU_BASE_KS
	la.pcrel	t1, kernelsp
	add.d		t1, t1, t0
@@ -71,7 +71,7 @@ SYM_FUNC_START(handle_syscall)
	bl		do_syscall

	RESTORE_ALL_AND_RET
SYM_FUNC_END(handle_syscall)
SYM_CODE_END(handle_syscall)
_ASM_NOKPROBE(handle_syscall)

SYM_CODE_START(ret_from_fork)
+8 −8
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ SYM_FUNC_START(__arch_cpu_idle)
1:	jr	ra
SYM_FUNC_END(__arch_cpu_idle)

SYM_FUNC_START(handle_vint)
SYM_CODE_START(handle_vint)
	BACKUP_T0T1
	SAVE_ALL
	la_abs	t1, __arch_cpu_idle
@@ -46,11 +46,11 @@ SYM_FUNC_START(handle_vint)
	la_abs	t0, do_vint
	jirl	ra, t0, 0
	RESTORE_ALL_AND_RET
SYM_FUNC_END(handle_vint)
SYM_CODE_END(handle_vint)

SYM_FUNC_START(except_vec_cex)
SYM_CODE_START(except_vec_cex)
	b	cache_parity_error
SYM_FUNC_END(except_vec_cex)
SYM_CODE_END(except_vec_cex)

	.macro	build_prep_badv
	csrrd	t0, LOONGARCH_CSR_BADV
@@ -66,7 +66,7 @@ SYM_FUNC_END(except_vec_cex)

	.macro	BUILD_HANDLER exception handler prep
	.align	5
	SYM_FUNC_START(handle_\exception)
	SYM_CODE_START(handle_\exception)
	666:
	BACKUP_T0T1
	SAVE_ALL
@@ -76,7 +76,7 @@ SYM_FUNC_END(except_vec_cex)
	jirl	ra, t0, 0
	668:
	RESTORE_ALL_AND_RET
	SYM_FUNC_END(handle_\exception)
	SYM_CODE_END(handle_\exception)
	SYM_DATA(unwind_hint_\exception, .word 668b - 666b)
	.endm

@@ -93,7 +93,7 @@ SYM_FUNC_END(except_vec_cex)
	BUILD_HANDLER watch watch none
	BUILD_HANDLER reserved reserved none	/* others */

SYM_FUNC_START(handle_sys)
SYM_CODE_START(handle_sys)
	la_abs	t0, handle_syscall
	jr	t0
SYM_FUNC_END(handle_sys)
SYM_CODE_END(handle_sys)
Loading