From: Greg Kroah-Hartman Date: Wed, 11 Dec 2024 15:07:39 +0000 (+0100) Subject: 6.6-stable patches X-Git-Tag: v6.6.65~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=47902d75dc0c553ee8b1d40c1526b20359309607;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: openrisc-use-asm-generic-s-version-of-fix_to_virt-virt_to_fix.patch --- diff --git a/queue-6.6/openrisc-use-asm-generic-s-version-of-fix_to_virt-virt_to_fix.patch b/queue-6.6/openrisc-use-asm-generic-s-version-of-fix_to_virt-virt_to_fix.patch new file mode 100644 index 00000000000..c28742042f7 --- /dev/null +++ b/queue-6.6/openrisc-use-asm-generic-s-version-of-fix_to_virt-virt_to_fix.patch @@ -0,0 +1,64 @@ +From 7f1e2fc493480086fbb375f4f6d33cb93fc069d6 Mon Sep 17 00:00:00 2001 +From: Dawei Li +Date: Sat, 9 Mar 2024 18:24:07 +0800 +Subject: openrisc: Use asm-generic's version of fix_to_virt() & virt_to_fix() + +From: Dawei Li + +commit 7f1e2fc493480086fbb375f4f6d33cb93fc069d6 upstream. + +Openrisc's implementation of fix_to_virt() & virt_to_fix() share same +functionality with ones of asm generic. + +Plus, generic version of fix_to_virt() can trap invalid index at compile +time. + +Thus, Replace the arch-specific implementations with asm generic's ones. + +Signed-off-by: Dawei Li +Signed-off-by: Stafford Horne +Cc: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman +--- + arch/openrisc/include/asm/fixmap.h | 31 +------------------------------ + 1 file changed, 1 insertion(+), 30 deletions(-) + +--- a/arch/openrisc/include/asm/fixmap.h ++++ b/arch/openrisc/include/asm/fixmap.h +@@ -39,35 +39,6 @@ enum fixed_addresses { + extern void __set_fixmap(enum fixed_addresses idx, + phys_addr_t phys, pgprot_t flags); + +-#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT)) +-#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) +- +-/* +- * 'index to address' translation. If anyone tries to use the idx +- * directly without tranlation, we catch the bug with a NULL-deference +- * kernel oops. Illegal ranges of incoming indices are caught too. +- */ +-static __always_inline unsigned long fix_to_virt(const unsigned int idx) +-{ +- /* +- * this branch gets completely eliminated after inlining, +- * except when someone tries to use fixaddr indices in an +- * illegal way. (such as mixing up address types or using +- * out-of-range indices). +- * +- * If it doesn't get removed, the linker will complain +- * loudly with a reasonably clear error message.. +- */ +- if (idx >= __end_of_fixed_addresses) +- BUG(); +- +- return __fix_to_virt(idx); +-} +- +-static inline unsigned long virt_to_fix(const unsigned long vaddr) +-{ +- BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); +- return __virt_to_fix(vaddr); +-} ++#include + + #endif diff --git a/queue-6.6/series b/queue-6.6/series index 8697f398285..2afae88d4b2 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -1,2 +1,3 @@ revert-x86-pvh-call-c-code-via-the-kernel-virtual-mapping.patch revert-x86-pvh-set-phys_base-when-calling-xen_prepare_pvh.patch +openrisc-use-asm-generic-s-version-of-fix_to_virt-virt_to_fix.patch