LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] powerpc/smp: Remove unused inline functions
From: YueHaibing @ 2021-03-24 14:07 UTC (permalink / raw)
  To: mpe, benh, paulus; +Cc: YueHaibing, linuxppc-dev, linux-kernel

commit 441c19c8a290 ("powerpc/kvm/book3s_hv: Rework the secondary inhibit code")
left behind this, so can remove it.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 arch/powerpc/include/asm/smp.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index 7a13bc20f0a0..ad7129a19e8f 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -189,8 +189,6 @@ extern void __cpu_die(unsigned int cpu);
 #define hard_smp_processor_id()		get_hard_smp_processor_id(0)
 #define smp_setup_cpu_maps()
 #define thread_group_shares_l2  0
-static inline void inhibit_secondary_onlining(void) {}
-static inline void uninhibit_secondary_onlining(void) {}
 static inline const struct cpumask *cpu_sibling_mask(int cpu)
 {
 	return cpumask_of(cpu);
-- 
2.17.1


^ permalink raw reply related

* Re: [PATCH v2 0/7] Generic Command Line changes
From: Rob Herring @ 2021-03-24 14:45 UTC (permalink / raw)
  To: Daniel Walker
  Cc: devicetree, linux-efi, Daniel Gimpelevich, linuxppc-dev, X86 ML,
	H. Peter Anvin, open list:MIPS, linux-kernel@vger.kernel.org,
	Paul Mackerras, xe-linux-external, Andrew Morton, Will Deacon,
	linux-arm-kernel
In-Reply-To: <20210309000247.2989531-1-danielwa@cisco.com>

On Mon, Mar 8, 2021 at 5:02 PM Daniel Walker <danielwa@cisco.com> wrote:
>
> This fixed some problem identified in my last release. I made updates
> based on comments from Christophe Leroy.
>
> I added scripted updates to the defconfig file for mips and powerpc.
> This is required in order to maintain the status quo for those platforms
> which used the prior builtin command line system.
>
> These were tested on all effected architectures.
>
> Daniel Walker (7):
>   CMDLINE: add generic builtin command line
>   CMDLINE: drivers: of: ifdef out cmdline section
>   powerpc: convert config files to generic cmdline
>   CMDLINE: powerpc: convert to generic builtin command line
>   mips: convert config files to generic cmdline
>   CMDLINE: mips: convert to generic builtin command line
>   CMDLINE: x86: convert to generic builtin command line

Can you send out or provide a branch of the other converted arches you
have patches for? Given this got revived due to arm64 cmdline changes,
including arm64 patches at least would be beneficial as there are
folks motivated to review and test this on Arm.

Rob

^ permalink raw reply

* [PATCH v2 1/4] mm/vmalloc: Change the 'caller' type to unsigned long
From: Matthew Wilcox (Oracle) @ 2021-03-24 15:05 UTC (permalink / raw)
  To: linux-mm
  Cc: linux-sh, x86, linux-kernel, Matthew Wilcox (Oracle),
	Russell King, Pekka Enberg, Uladzislau Rezki, Nicholas Piggin,
	David Rientjes, Joonsoo Kim, Andrew Morton, linuxppc-dev,
	Christoph Lameter, Vlastimil Babka
In-Reply-To: <20210324150518.2734402-1-willy@infradead.org>

kmalloc uses an unsigned long while vmalloc uses const void * to
represent the address of the caller.  _RET_IP_ is more popular than
__builtin_return_address (429 to 258), so switch vmalloc to match kmalloc
(which changes the score to 504 to 183).  Also lets us use _THIS_IP_
instead of the explicit function name.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 arch/arm/include/asm/io.h                 |  6 +--
 arch/arm/include/asm/mach/map.h           |  3 --
 arch/arm/kernel/module.c                  |  4 +-
 arch/arm/mach-imx/mm-imx3.c               |  2 +-
 arch/arm/mach-ixp4xx/common.c             |  2 +-
 arch/arm/mach-mvebu/coherency.c           |  2 +-
 arch/arm/mm/ioremap.c                     | 27 +++++-------
 arch/arm/mm/mmu.c                         | 10 ++---
 arch/arm/mm/nommu.c                       | 16 +++----
 arch/arm64/include/asm/vmap_stack.h       |  2 +-
 arch/arm64/kernel/module.c                |  4 +-
 arch/arm64/kernel/probes/kprobes.c        |  2 +-
 arch/arm64/mm/ioremap.c                   |  7 ++-
 arch/arm64/mm/mmu.c                       |  2 +-
 arch/arm64/net/bpf_jit_comp.c             |  2 +-
 arch/mips/kernel/module.c                 |  2 +-
 arch/nds32/kernel/module.c                |  2 +-
 arch/parisc/kernel/module.c               |  2 +-
 arch/powerpc/include/asm/io-workarounds.h |  2 +-
 arch/powerpc/include/asm/io.h             |  6 +--
 arch/powerpc/kernel/io-workarounds.c      |  2 +-
 arch/powerpc/kernel/irq.c                 |  2 +-
 arch/powerpc/kernel/module.c              |  3 +-
 arch/powerpc/kernel/pci_64.c              |  3 +-
 arch/powerpc/mm/ioremap.c                 | 10 ++---
 arch/powerpc/mm/ioremap_32.c              |  8 ++--
 arch/powerpc/mm/ioremap_64.c              |  4 +-
 arch/riscv/kernel/module.c                |  2 +-
 arch/riscv/net/bpf_jit_comp64.c           |  2 +-
 arch/s390/kernel/module.c                 |  2 +-
 arch/s390/kernel/setup.c                  |  3 +-
 arch/sh/include/asm/io.h                  | 11 ++---
 arch/sh/kernel/cpu/sh4/sq.c               |  2 +-
 arch/sh/mm/ioremap.c                      |  2 +-
 arch/sh/mm/pmb.c                          |  2 +-
 arch/sparc/kernel/module.c                |  2 +-
 arch/x86/hyperv/hv_init.c                 |  2 +-
 arch/x86/kernel/module.c                  |  3 +-
 arch/x86/mm/ioremap.c                     | 20 ++++-----
 include/linux/vmalloc.h                   | 22 +++++-----
 kernel/bpf/syscall.c                      |  2 +-
 kernel/fork.c                             |  2 +-
 kernel/module.c                           |  2 +-
 kernel/scs.c                              |  3 +-
 lib/test_vmalloc.c                        |  7 ++-
 mm/ioremap.c                              |  3 +-
 mm/kasan/shadow.c                         |  5 +--
 mm/nommu.c                                |  4 +-
 mm/util.c                                 |  3 +-
 mm/vmalloc.c                              | 52 ++++++++++-------------
 50 files changed, 130 insertions(+), 165 deletions(-)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index fc748122f1e0..8c8699b0820f 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -131,17 +131,17 @@ static inline u32 __raw_readl(const volatile void __iomem *addr)
 /*
  * __arm_ioremap takes CPU physical address.
  * __arm_ioremap_pfn takes a Page Frame Number and an offset into that page
- * The _caller variety takes a __builtin_return_address(0) value for
+ * The _caller variety takes a _RET_IP_ value for
  * /proc/vmalloc to use - and should only be used in non-inline functions.
  */
 extern void __iomem *__arm_ioremap_caller(phys_addr_t, size_t, unsigned int,
-	void *);
+		unsigned long);
 extern void __iomem *__arm_ioremap_pfn(unsigned long, unsigned long, size_t, unsigned int);
 extern void __iomem *__arm_ioremap_exec(phys_addr_t, size_t, bool cached);
 extern void __iounmap(volatile void __iomem *addr);
 
 extern void __iomem * (*arch_ioremap_caller)(phys_addr_t, size_t,
-	unsigned int, void *);
+	unsigned int, unsigned long);
 extern void (*arch_iounmap)(volatile void __iomem *);
 
 /*
diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
index 92282558caf7..56968451349d 100644
--- a/arch/arm/include/asm/mach/map.h
+++ b/arch/arm/include/asm/mach/map.h
@@ -37,8 +37,6 @@ enum {
 
 #ifdef CONFIG_MMU
 extern void iotable_init(struct map_desc *, int);
-extern void vm_reserve_area_early(unsigned long addr, unsigned long size,
-				  void *caller);
 extern void create_mapping_late(struct mm_struct *mm, struct map_desc *md,
 				bool ng);
 
@@ -58,7 +56,6 @@ extern int ioremap_page(unsigned long virt, unsigned long phys,
 			const struct mem_type *mtype);
 #else
 #define iotable_init(map,num)	do { } while (0)
-#define vm_reserve_area_early(a,s,c)	do { } while (0)
 #endif
 
 #endif
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index beac45e89ba6..0fb7e10a0ca7 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -45,12 +45,12 @@ void *module_alloc(unsigned long size)
 
 	p = __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END,
 				gfp_mask, PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE,
-				__builtin_return_address(0));
+				_RET_IP_);
 	if (!IS_ENABLED(CONFIG_ARM_MODULE_PLTS) || p)
 		return p;
 	return __vmalloc_node_range(size, 1,  VMALLOC_START, VMALLOC_END,
 				GFP_KERNEL, PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE,
-				__builtin_return_address(0));
+				_RET_IP_);
 }
 #endif
 
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c
index 28db97289ee8..3b68da4814d0 100644
--- a/arch/arm/mach-imx/mm-imx3.c
+++ b/arch/arm/mach-imx/mm-imx3.c
@@ -54,7 +54,7 @@ static void imx3_idle(void)
 }
 
 static void __iomem *imx3_ioremap_caller(phys_addr_t phys_addr, size_t size,
-					 unsigned int mtype, void *caller)
+		unsigned int mtype, unsigned long caller)
 {
 	if (mtype == MT_DEVICE) {
 		/*
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 000f672a94c9..2e9ae7717c42 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -337,7 +337,7 @@ EXPORT_SYMBOL(dma_set_coherent_mask);
  */
 
 static void __iomem *ixp4xx_ioremap_caller(phys_addr_t addr, size_t size,
-					   unsigned int mtype, void *caller)
+		unsigned int mtype, unsigned long caller)
 {
 	if (!is_pci_memory(addr))
 		return __arm_ioremap_caller(addr, size, mtype, caller);
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
index 49e3c8d20c2f..f213ea920418 100644
--- a/arch/arm/mach-mvebu/coherency.c
+++ b/arch/arm/mach-mvebu/coherency.c
@@ -162,7 +162,7 @@ static void __init armada_370_coherency_init(struct device_node *np)
  */
 static void __iomem *
 armada_wa_ioremap_caller(phys_addr_t phys_addr, size_t size,
-			 unsigned int mtype, void *caller)
+			 unsigned int mtype, unsigned long caller)
 {
 	mtype = MT_UNCACHED;
 	return __arm_ioremap_caller(phys_addr, size, mtype, caller);
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 000e8210000b..134340f6e7c5 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -241,7 +241,8 @@ remap_area_supersections(unsigned long virt, unsigned long pfn,
 #endif
 
 static void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
-	unsigned long offset, size_t size, unsigned int mtype, void *caller)
+		unsigned long offset, size_t size, unsigned int mtype,
+		unsigned long caller)
 {
 	const struct mem_type *type;
 	int err;
@@ -318,7 +319,7 @@ static void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
 }
 
 void __iomem *__arm_ioremap_caller(phys_addr_t phys_addr, size_t size,
-	unsigned int mtype, void *caller)
+		unsigned int mtype, unsigned long caller)
 {
 	phys_addr_t last_addr;
  	unsigned long offset = phys_addr & ~PAGE_MASK;
@@ -348,33 +349,30 @@ void __iomem *
 __arm_ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
 		  unsigned int mtype)
 {
-	return __arm_ioremap_pfn_caller(pfn, offset, size, mtype,
-					__builtin_return_address(0));
+	return __arm_ioremap_pfn_caller(pfn, offset, size, mtype, _RET_IP_);
 }
 EXPORT_SYMBOL(__arm_ioremap_pfn);
 
 void __iomem * (*arch_ioremap_caller)(phys_addr_t, size_t,
-				      unsigned int, void *) =
+				      unsigned int, unsigned long) =
 	__arm_ioremap_caller;
 
 void __iomem *ioremap(resource_size_t res_cookie, size_t size)
 {
-	return arch_ioremap_caller(res_cookie, size, MT_DEVICE,
-				   __builtin_return_address(0));
+	return arch_ioremap_caller(res_cookie, size, MT_DEVICE, _RET_IP_);
 }
 EXPORT_SYMBOL(ioremap);
 
 void __iomem *ioremap_cache(resource_size_t res_cookie, size_t size)
 {
 	return arch_ioremap_caller(res_cookie, size, MT_DEVICE_CACHED,
-				   __builtin_return_address(0));
+				   _RET_IP_);
 }
 EXPORT_SYMBOL(ioremap_cache);
 
 void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size)
 {
-	return arch_ioremap_caller(res_cookie, size, MT_DEVICE_WC,
-				   __builtin_return_address(0));
+	return arch_ioremap_caller(res_cookie, size, MT_DEVICE_WC, _RET_IP_);
 }
 EXPORT_SYMBOL(ioremap_wc);
 
@@ -395,15 +393,13 @@ __arm_ioremap_exec(phys_addr_t phys_addr, size_t size, bool cached)
 	else
 		mtype = MT_MEMORY_RWX_NONCACHED;
 
-	return __arm_ioremap_caller(phys_addr, size, mtype,
-			__builtin_return_address(0));
+	return __arm_ioremap_caller(phys_addr, size, mtype, _RET_IP_);
 }
 
 void *arch_memremap_wb(phys_addr_t phys_addr, size_t size)
 {
 	return (__force void *)arch_ioremap_caller(phys_addr, size,
-						   MT_MEMORY_RW,
-						   __builtin_return_address(0));
+						   MT_MEMORY_RW, _RET_IP_);
 }
 
 void __iounmap(volatile void __iomem *io_addr)
@@ -464,8 +460,7 @@ EXPORT_SYMBOL_GPL(pci_ioremap_io);
 
 void __iomem *pci_remap_cfgspace(resource_size_t res_cookie, size_t size)
 {
-	return arch_ioremap_caller(res_cookie, size, MT_UNCACHED,
-				   __builtin_return_address(0));
+	return arch_ioremap_caller(res_cookie, size, MT_UNCACHED, _RET_IP_);
 }
 EXPORT_SYMBOL_GPL(pci_remap_cfgspace);
 #endif
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index a25b660c3017..26c224c3a33c 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1002,13 +1002,13 @@ void __init iotable_init(struct map_desc *io_desc, int nr)
 		vm->phys_addr = __pfn_to_phys(md->pfn);
 		vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
 		vm->flags |= VM_ARM_MTYPE(md->type);
-		vm->caller = iotable_init;
+		vm->caller = _THIS_IP_;
 		add_static_vm_early(svm++);
 	}
 }
 
-void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
-				  void *caller)
+static void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
+				  unsigned long caller)
 {
 	struct vm_struct *vm;
 	struct static_vm *svm;
@@ -1043,7 +1043,7 @@ void __init vm_reserve_area_early(unsigned long addr, unsigned long size,
 
 static void __init pmd_empty_section_gap(unsigned long addr)
 {
-	vm_reserve_area_early(addr, SECTION_SIZE, pmd_empty_section_gap);
+	vm_reserve_area_early(addr, SECTION_SIZE, _THIS_IP_);
 }
 
 static void __init fill_pmd_gaps(void)
@@ -1100,7 +1100,7 @@ static void __init pci_reserve_io(void)
 	if (svm)
 		return;
 
-	vm_reserve_area_early(PCI_IO_VIRT_BASE, SZ_2M, pci_reserve_io);
+	vm_reserve_area_early(PCI_IO_VIRT_BASE, SZ_2M, _THIS_IP_);
 }
 #else
 #define pci_reserve_io() do { } while (0)
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index 8b3d7191e2b8..b80eaf13e398 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -191,31 +191,30 @@ void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
 EXPORT_SYMBOL(__arm_ioremap_pfn);
 
 void __iomem *__arm_ioremap_caller(phys_addr_t phys_addr, size_t size,
-				   unsigned int mtype, void *caller)
+				   unsigned int mtype, unsigned long caller)
 {
 	return (void __iomem *)phys_addr;
 }
 
-void __iomem * (*arch_ioremap_caller)(phys_addr_t, size_t, unsigned int, void *);
+void __iomem * (*arch_ioremap_caller)(phys_addr_t, size_t, unsigned int,
+					unsigned long);
 
 void __iomem *ioremap(resource_size_t res_cookie, size_t size)
 {
-	return __arm_ioremap_caller(res_cookie, size, MT_DEVICE,
-				    __builtin_return_address(0));
+	return __arm_ioremap_caller(res_cookie, size, MT_DEVICE, _RET_IP_);
 }
 EXPORT_SYMBOL(ioremap);
 
 void __iomem *ioremap_cache(resource_size_t res_cookie, size_t size)
 {
 	return __arm_ioremap_caller(res_cookie, size, MT_DEVICE_CACHED,
-				    __builtin_return_address(0));
+				    _RET_IP_);
 }
 EXPORT_SYMBOL(ioremap_cache);
 
 void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size)
 {
-	return __arm_ioremap_caller(res_cookie, size, MT_DEVICE_WC,
-				    __builtin_return_address(0));
+	return __arm_ioremap_caller(res_cookie, size, MT_DEVICE_WC, _RET_IP_);
 }
 EXPORT_SYMBOL(ioremap_wc);
 
@@ -225,8 +224,7 @@ EXPORT_SYMBOL(ioremap_wc);
 
 void __iomem *pci_remap_cfgspace(resource_size_t res_cookie, size_t size)
 {
-	return arch_ioremap_caller(res_cookie, size, MT_UNCACHED,
-				   __builtin_return_address(0));
+	return arch_ioremap_caller(res_cookie, size, MT_UNCACHED, _RET_IP_);
 }
 EXPORT_SYMBOL_GPL(pci_remap_cfgspace);
 #endif
diff --git a/arch/arm64/include/asm/vmap_stack.h b/arch/arm64/include/asm/vmap_stack.h
index 894e031b28d2..1a525f04257c 100644
--- a/arch/arm64/include/asm/vmap_stack.h
+++ b/arch/arm64/include/asm/vmap_stack.h
@@ -20,7 +20,7 @@ static inline unsigned long *arch_alloc_vmap_stack(size_t stack_size, int node)
 	BUILD_BUG_ON(!IS_ENABLED(CONFIG_VMAP_STACK));
 
 	return __vmalloc_node(stack_size, THREAD_ALIGN, THREADINFO_GFP, node,
-			__builtin_return_address(0));
+			_RET_IP_);
 }
 
 #endif /* __ASM_VMAP_STACK_H */
diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c
index fe21e0f06492..fa4186459927 100644
--- a/arch/arm64/kernel/module.c
+++ b/arch/arm64/kernel/module.c
@@ -37,7 +37,7 @@ void *module_alloc(unsigned long size)
 
 	p = __vmalloc_node_range(size, MODULE_ALIGN, module_alloc_base,
 				module_alloc_end, gfp_mask, PAGE_KERNEL, 0,
-				NUMA_NO_NODE, __builtin_return_address(0));
+				NUMA_NO_NODE, _RET_IP_);
 
 	if (!p && IS_ENABLED(CONFIG_ARM64_MODULE_PLTS) &&
 	    !IS_ENABLED(CONFIG_KASAN_GENERIC) &&
@@ -54,7 +54,7 @@ void *module_alloc(unsigned long size)
 		p = __vmalloc_node_range(size, MODULE_ALIGN, module_alloc_base,
 				module_alloc_base + SZ_2G, GFP_KERNEL,
 				PAGE_KERNEL, 0, NUMA_NO_NODE,
-				__builtin_return_address(0));
+				_RET_IP_);
 
 	if (p && (kasan_module_alloc(p, size) < 0)) {
 		vfree(p);
diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
index 66aac2881ba8..a3180aeb3aa0 100644
--- a/arch/arm64/kernel/probes/kprobes.c
+++ b/arch/arm64/kernel/probes/kprobes.c
@@ -113,7 +113,7 @@ void *alloc_insn_page(void)
 {
 	return __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START, VMALLOC_END,
 			GFP_KERNEL, PAGE_KERNEL_ROX, VM_FLUSH_RESET_PERMS,
-			NUMA_NO_NODE, __builtin_return_address(0));
+			NUMA_NO_NODE, _RET_IP_);
 }
 
 /* arm kprobe: install breakpoint in text */
diff --git a/arch/arm64/mm/ioremap.c b/arch/arm64/mm/ioremap.c
index b5e83c46b23e..7b8a67514314 100644
--- a/arch/arm64/mm/ioremap.c
+++ b/arch/arm64/mm/ioremap.c
@@ -18,7 +18,7 @@
 #include <asm/tlbflush.h>
 
 static void __iomem *__ioremap_caller(phys_addr_t phys_addr, size_t size,
-				      pgprot_t prot, void *caller)
+				      pgprot_t prot, unsigned long caller)
 {
 	unsigned long last_addr;
 	unsigned long offset = phys_addr & ~PAGE_MASK;
@@ -63,8 +63,7 @@ static void __iomem *__ioremap_caller(phys_addr_t phys_addr, size_t size,
 
 void __iomem *__ioremap(phys_addr_t phys_addr, size_t size, pgprot_t prot)
 {
-	return __ioremap_caller(phys_addr, size, prot,
-				__builtin_return_address(0));
+	return __ioremap_caller(phys_addr, size, prot, _RET_IP_);
 }
 EXPORT_SYMBOL(__ioremap);
 
@@ -88,7 +87,7 @@ void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size)
 		return (void __iomem *)__phys_to_virt(phys_addr);
 
 	return __ioremap_caller(phys_addr, size, __pgprot(PROT_NORMAL),
-				__builtin_return_address(0));
+				_RET_IP_);
 }
 EXPORT_SYMBOL(ioremap_cache);
 
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index f6ef5a37a6c7..0a7ae4f09af0 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -590,7 +590,7 @@ static void __init map_kernel_segment(pgd_t *pgdp, void *va_start, void *va_end,
 	vma->phys_addr	= pa_start;
 	vma->size	= size;
 	vma->flags	= VM_MAP | vm_flags;
-	vma->caller	= __builtin_return_address(0);
+	vma->caller	= _RET_IP_;
 
 	vm_area_add_early(vma);
 }
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index f7b194878a99..8aca5bf74685 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -1134,7 +1134,7 @@ void *bpf_jit_alloc_exec(unsigned long size)
 	return __vmalloc_node_range(size, PAGE_SIZE, BPF_JIT_REGION_START,
 				    BPF_JIT_REGION_END, GFP_KERNEL,
 				    PAGE_KERNEL, 0, NUMA_NO_NODE,
-				    __builtin_return_address(0));
+				    _RET_IP_);
 }
 
 void bpf_jit_free_exec(void *addr)
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c
index 14f46d17500a..7541e9533de6 100644
--- a/arch/mips/kernel/module.c
+++ b/arch/mips/kernel/module.c
@@ -36,7 +36,7 @@ void *module_alloc(unsigned long size)
 {
 	return __vmalloc_node_range(size, 1, MODULE_START, MODULE_END,
 				GFP_KERNEL, PAGE_KERNEL, 0, NUMA_NO_NODE,
-				__builtin_return_address(0));
+				_RET_IP_);
 }
 #endif
 
diff --git a/arch/nds32/kernel/module.c b/arch/nds32/kernel/module.c
index 3897fd14a21d..d05cd7f38af6 100644
--- a/arch/nds32/kernel/module.c
+++ b/arch/nds32/kernel/module.c
@@ -11,7 +11,7 @@ void *module_alloc(unsigned long size)
 {
 	return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END,
 				    GFP_KERNEL, PAGE_KERNEL, 0, NUMA_NO_NODE,
-				    __builtin_return_address(0));
+				    _RET_IP_);
 }
 
 void module_free(struct module *module, void *region)
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
index 7df140545b22..320807f755a7 100644
--- a/arch/parisc/kernel/module.c
+++ b/arch/parisc/kernel/module.c
@@ -200,7 +200,7 @@ void *module_alloc(unsigned long size)
 	return __vmalloc_node_range(size, 1, VMALLOC_START, VMALLOC_END,
 				    GFP_KERNEL,
 				    PAGE_KERNEL_RWX, 0, NUMA_NO_NODE,
-				    __builtin_return_address(0));
+				    _RET_IP_);
 }
 
 #ifndef CONFIG_64BIT
diff --git a/arch/powerpc/include/asm/io-workarounds.h b/arch/powerpc/include/asm/io-workarounds.h
index 3cce499fbe27..38d0bd31fd67 100644
--- a/arch/powerpc/include/asm/io-workarounds.h
+++ b/arch/powerpc/include/asm/io-workarounds.h
@@ -50,6 +50,6 @@ static inline bool iowa_is_active(void)
 #endif
 
 void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
-			   pgprot_t prot, void *caller);
+			   pgprot_t prot, unsigned long caller);
 
 #endif /* _IO_WORKAROUNDS_H */
diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index 273edd208ec5..0e87e59dd047 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -839,7 +839,7 @@ static inline void iosync(void)
  * * iounmap undoes such a mapping and can be hooked
  *
  * * __ioremap_caller is the same as above but takes an explicit caller
- *   reference rather than using __builtin_return_address(0)
+ *   reference rather than using _RET_IP_
  *
  */
 extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
@@ -865,10 +865,10 @@ void __iomem *ioremap_phb(phys_addr_t paddr, unsigned long size);
 int early_ioremap_range(unsigned long ea, phys_addr_t pa,
 			unsigned long size, pgprot_t prot);
 void __iomem *do_ioremap(phys_addr_t pa, phys_addr_t offset, unsigned long size,
-			 pgprot_t prot, void *caller);
+			 pgprot_t prot, unsigned long caller);
 
 extern void __iomem *__ioremap_caller(phys_addr_t, unsigned long size,
-				      pgprot_t prot, void *caller);
+				      pgprot_t prot, unsigned long caller);
 
 /*
  * When CONFIG_PPC_INDIRECT_PIO is set, we use the generic iomap implementation
diff --git a/arch/powerpc/kernel/io-workarounds.c b/arch/powerpc/kernel/io-workarounds.c
index 51bbaae94ccc..a52b3625512c 100644
--- a/arch/powerpc/kernel/io-workarounds.c
+++ b/arch/powerpc/kernel/io-workarounds.c
@@ -150,7 +150,7 @@ static const struct ppc_pci_io iowa_pci_io = {
 
 #ifdef CONFIG_PPC_INDIRECT_MMIO
 void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
-			   pgprot_t prot, void *caller)
+			   pgprot_t prot, unsigned long caller)
 {
 	struct iowa_bus *bus;
 	void __iomem *res = __ioremap_caller(addr, size, prot, caller);
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index d71fd10a1dd4..046bb5fd8d6f 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -719,7 +719,7 @@ DEFINE_INTERRUPT_HANDLER_ASYNC(do_IRQ)
 static void *__init alloc_vm_stack(void)
 {
 	return __vmalloc_node(THREAD_SIZE, THREAD_ALIGN, THREADINFO_GFP,
-			      NUMA_NO_NODE, (void *)_RET_IP_);
+			      NUMA_NO_NODE, _RET_IP_);
 }
 
 static void __init vmap_irqstack_init(void)
diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c
index cdb2d88c54e7..dabaa3d7c182 100644
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@ -108,6 +108,5 @@ void *module_alloc(unsigned long size)
 	return __vmalloc_node_range(size, 1, start, end, GFP_KERNEL,
 				    PAGE_KERNEL_EXEC,
 				    VM_NO_HUGE_VMAP | VM_FLUSH_RESET_PERMS,
-				    NUMA_NO_NODE,
-				    __builtin_return_address(0));
+				    NUMA_NO_NODE, _RET_IP_);
 }
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 9312e6eda7ff..71beacdd1808 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -132,8 +132,7 @@ void __iomem *ioremap_phb(phys_addr_t paddr, unsigned long size)
 	 * address decoding but I'd rather not deal with those outside of the
 	 * reserved 64K legacy region.
 	 */
-	area = __get_vm_area_caller(size, 0, PHB_IO_BASE, PHB_IO_END,
-				    __builtin_return_address(0));
+	area = __get_vm_area_caller(size, 0, PHB_IO_BASE, PHB_IO_END, _RET_IP_);
 	if (!area)
 		return NULL;
 
diff --git a/arch/powerpc/mm/ioremap.c b/arch/powerpc/mm/ioremap.c
index b1a0aebe8c48..2b5a599a127f 100644
--- a/arch/powerpc/mm/ioremap.c
+++ b/arch/powerpc/mm/ioremap.c
@@ -12,7 +12,7 @@ EXPORT_SYMBOL(ioremap_bot);
 void __iomem *ioremap(phys_addr_t addr, unsigned long size)
 {
 	pgprot_t prot = pgprot_noncached(PAGE_KERNEL);
-	void *caller = __builtin_return_address(0);
+	unsigned long caller = _RET_IP_;
 
 	if (iowa_is_active())
 		return iowa_ioremap(addr, size, prot, caller);
@@ -23,7 +23,7 @@ EXPORT_SYMBOL(ioremap);
 void __iomem *ioremap_wc(phys_addr_t addr, unsigned long size)
 {
 	pgprot_t prot = pgprot_noncached_wc(PAGE_KERNEL);
-	void *caller = __builtin_return_address(0);
+	unsigned long caller = _RET_IP_;
 
 	if (iowa_is_active())
 		return iowa_ioremap(addr, size, prot, caller);
@@ -34,7 +34,7 @@ EXPORT_SYMBOL(ioremap_wc);
 void __iomem *ioremap_coherent(phys_addr_t addr, unsigned long size)
 {
 	pgprot_t prot = pgprot_cached(PAGE_KERNEL);
-	void *caller = __builtin_return_address(0);
+	unsigned long caller = _RET_IP_;
 
 	if (iowa_is_active())
 		return iowa_ioremap(addr, size, prot, caller);
@@ -44,7 +44,7 @@ void __iomem *ioremap_coherent(phys_addr_t addr, unsigned long size)
 void __iomem *ioremap_prot(phys_addr_t addr, unsigned long size, unsigned long flags)
 {
 	pte_t pte = __pte(flags);
-	void *caller = __builtin_return_address(0);
+	unsigned long caller = _RET_IP_;
 
 	/* writeable implies dirty for kernel addresses */
 	if (pte_write(pte))
@@ -76,7 +76,7 @@ int early_ioremap_range(unsigned long ea, phys_addr_t pa,
 }
 
 void __iomem *do_ioremap(phys_addr_t pa, phys_addr_t offset, unsigned long size,
-			 pgprot_t prot, void *caller)
+			 pgprot_t prot, unsigned long caller)
 {
 	struct vm_struct *area;
 	int ret;
diff --git a/arch/powerpc/mm/ioremap_32.c b/arch/powerpc/mm/ioremap_32.c
index 743e11384dea..f86c76539c90 100644
--- a/arch/powerpc/mm/ioremap_32.c
+++ b/arch/powerpc/mm/ioremap_32.c
@@ -10,12 +10,12 @@ void __iomem *ioremap_wt(phys_addr_t addr, unsigned long size)
 {
 	pgprot_t prot = pgprot_cached_wthru(PAGE_KERNEL);
 
-	return __ioremap_caller(addr, size, prot, __builtin_return_address(0));
+	return __ioremap_caller(addr, size, prot, _RET_IP_);
 }
 EXPORT_SYMBOL(ioremap_wt);
 
-void __iomem *
-__ioremap_caller(phys_addr_t addr, unsigned long size, pgprot_t prot, void *caller)
+void __iomem *__ioremap_caller(phys_addr_t addr, unsigned long size,
+		pgprot_t prot, unsigned long caller)
 {
 	unsigned long v;
 	phys_addr_t p, offset;
@@ -68,7 +68,7 @@ __ioremap_caller(phys_addr_t addr, unsigned long size, pgprot_t prot, void *call
 	/*
 	 * Should check if it is a candidate for a BAT mapping
 	 */
-	pr_warn("ioremap() called early from %pS. Use early_ioremap() instead\n", caller);
+	pr_warn("ioremap() called early from %pS. Use early_ioremap() instead\n", (void *)caller);
 
 	err = early_ioremap_range(ioremap_bot - size, p, size, prot);
 	if (err)
diff --git a/arch/powerpc/mm/ioremap_64.c b/arch/powerpc/mm/ioremap_64.c
index ba5cbb0d66bd..6ff114416612 100644
--- a/arch/powerpc/mm/ioremap_64.c
+++ b/arch/powerpc/mm/ioremap_64.c
@@ -5,7 +5,7 @@
 #include <linux/vmalloc.h>
 
 void __iomem *__ioremap_caller(phys_addr_t addr, unsigned long size,
-			       pgprot_t prot, void *caller)
+			       pgprot_t prot, unsigned long caller)
 {
 	phys_addr_t paligned, offset;
 	void __iomem *ret;
@@ -31,7 +31,7 @@ void __iomem *__ioremap_caller(phys_addr_t addr, unsigned long size,
 	if (slab_is_available())
 		return do_ioremap(paligned, offset, size, prot, caller);
 
-	pr_warn("ioremap() called early from %pS. Use early_ioremap() instead\n", caller);
+	pr_warn("ioremap() called early from %pS. Use early_ioremap() instead\n", (void *)caller);
 
 	err = early_ioremap_range(ioremap_bot, paligned, size, prot);
 	if (err)
diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c
index 104fba889cf7..141de853f661 100644
--- a/arch/riscv/kernel/module.c
+++ b/arch/riscv/kernel/module.c
@@ -415,6 +415,6 @@ void *module_alloc(unsigned long size)
 	return __vmalloc_node_range(size, 1, VMALLOC_MODULE_START,
 				    VMALLOC_END, GFP_KERNEL,
 				    PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE,
-				    __builtin_return_address(0));
+				    _RET_IP_);
 }
 #endif
diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c
index b44ff52f84a6..7f61c69115ab 100644
--- a/arch/riscv/net/bpf_jit_comp64.c
+++ b/arch/riscv/net/bpf_jit_comp64.c
@@ -1154,7 +1154,7 @@ void *bpf_jit_alloc_exec(unsigned long size)
 	return __vmalloc_node_range(size, PAGE_SIZE, BPF_JIT_REGION_START,
 				    BPF_JIT_REGION_END, GFP_KERNEL,
 				    PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE,
-				    __builtin_return_address(0));
+				    _RET_IP_);
 }
 
 void bpf_jit_free_exec(void *addr)
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c
index 4055f1c49814..1e051ac66ecd 100644
--- a/arch/s390/kernel/module.c
+++ b/arch/s390/kernel/module.c
@@ -40,7 +40,7 @@ void *module_alloc(unsigned long size)
 		return NULL;
 	p = __vmalloc_node_range(size, MODULE_ALIGN, MODULES_VADDR, MODULES_END,
 				 GFP_KERNEL, PAGE_KERNEL_EXEC, 0, NUMA_NO_NODE,
-				 __builtin_return_address(0));
+				 _RET_IP_);
 	if (p && (kasan_module_alloc(p, size) < 0)) {
 		vfree(p);
 		return NULL;
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 60da976eee6f..719ee2bcdf67 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -311,8 +311,7 @@ unsigned long stack_alloc(void)
 {
 #ifdef CONFIG_VMAP_STACK
 	return (unsigned long)__vmalloc_node(THREAD_SIZE, THREAD_SIZE,
-			THREADINFO_GFP, NUMA_NO_NODE,
-			__builtin_return_address(0));
+			THREADINFO_GFP, NUMA_NO_NODE, _RET_IP_);
 #else
 	return __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER);
 #endif
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index 6d5c6463bc07..91aa68466c69 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -245,19 +245,17 @@ unsigned long long poke_real_address_q(unsigned long long addr,
 #ifdef CONFIG_MMU
 void iounmap(void __iomem *addr);
 void __iomem *__ioremap_caller(phys_addr_t offset, unsigned long size,
-			       pgprot_t prot, void *caller);
+			       pgprot_t prot, unsigned long caller);
 
 static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
 {
-	return __ioremap_caller(offset, size, PAGE_KERNEL_NOCACHE,
-			__builtin_return_address(0));
+	return __ioremap_caller(offset, size, PAGE_KERNEL_NOCACHE, _RET_IP_);
 }
 
 static inline void __iomem *
 ioremap_cache(phys_addr_t offset, unsigned long size)
 {
-	return __ioremap_caller(offset, size, PAGE_KERNEL,
-			__builtin_return_address(0));
+	return __ioremap_caller(offset, size, PAGE_KERNEL, _RET_IP_);
 }
 #define ioremap_cache ioremap_cache
 
@@ -265,8 +263,7 @@ ioremap_cache(phys_addr_t offset, unsigned long size)
 static inline void __iomem *ioremap_prot(phys_addr_t offset, unsigned long size,
 		unsigned long flags)
 {
-	return __ioremap_caller(offset, size, __pgprot(flags),
-			__builtin_return_address(0));
+	return __ioremap_caller(offset, size, __pgprot(flags), _RET_IP_);
 }
 #endif /* CONFIG_HAVE_IOREMAP_PROT */
 
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index d432164b23b7..bc16e3818db1 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -104,7 +104,7 @@ static int __sq_remap(struct sq_mapping *map, pgprot_t prot)
 	struct vm_struct *vma;
 
 	vma = __get_vm_area_caller(map->size, VM_ALLOC, map->sq_addr,
-			SQ_ADDRMAX, __builtin_return_address(0));
+			SQ_ADDRMAX, _RET_IP_);
 	if (!vma)
 		return -ENOMEM;
 
diff --git a/arch/sh/mm/ioremap.c b/arch/sh/mm/ioremap.c
index 21342581144d..aaabb40526ef 100644
--- a/arch/sh/mm/ioremap.c
+++ b/arch/sh/mm/ioremap.c
@@ -83,7 +83,7 @@ __ioremap_29bit(phys_addr_t offset, unsigned long size, pgprot_t prot)
  */
 void __iomem * __ref
 __ioremap_caller(phys_addr_t phys_addr, unsigned long size,
-		 pgprot_t pgprot, void *caller)
+		 pgprot_t pgprot, unsigned long caller)
 {
 	struct vm_struct *area;
 	unsigned long offset, last_addr, addr, orig_addr;
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c
index 68eb7cc6e564..7d006958db11 100644
--- a/arch/sh/mm/pmb.c
+++ b/arch/sh/mm/pmb.c
@@ -408,7 +408,7 @@ int pmb_bolt_mapping(unsigned long vaddr, phys_addr_t phys,
 }
 
 void __iomem *pmb_remap_caller(phys_addr_t phys, unsigned long size,
-			       pgprot_t prot, void *caller)
+			       pgprot_t prot, unsigned long caller)
 {
 	unsigned long vaddr;
 	phys_addr_t offset, last_addr;
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c
index df39580f398d..a9b79ba194fb 100644
--- a/arch/sparc/kernel/module.c
+++ b/arch/sparc/kernel/module.c
@@ -31,7 +31,7 @@ static void *module_map(unsigned long size)
 		return NULL;
 	return __vmalloc_node_range(size, 1, MODULES_VADDR, MODULES_END,
 				GFP_KERNEL, PAGE_KERNEL, 0, NUMA_NO_NODE,
-				__builtin_return_address(0));
+				_RET_IP_);
 }
 #else
 static void *module_map(unsigned long size)
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index d930ecf92805..4866351282b0 100644
--- a/arch/x86/hyperv/hv_init.c
+++ b/arch/x86/hyperv/hv_init.c
@@ -428,7 +428,7 @@ void __init hyperv_init(void)
 	hv_hypercall_pg = __vmalloc_node_range(PAGE_SIZE, 1, VMALLOC_START,
 			VMALLOC_END, GFP_KERNEL, PAGE_KERNEL_ROX,
 			VM_FLUSH_RESET_PERMS, NUMA_NO_NODE,
-			__builtin_return_address(0));
+			_RET_IP_);
 	if (hv_hypercall_pg == NULL) {
 		wrmsrl(HV_X64_MSR_GUEST_OS_ID, 0);
 		goto remove_cpuhp_state;
diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c
index 5e9a34b5bd74..7d4dff41ca73 100644
--- a/arch/x86/kernel/module.c
+++ b/arch/x86/kernel/module.c
@@ -75,8 +75,7 @@ void *module_alloc(unsigned long size)
 	p = __vmalloc_node_range(size, MODULE_ALIGN,
 				    MODULES_VADDR + get_module_load_offset(),
 				    MODULES_END, GFP_KERNEL,
-				    PAGE_KERNEL, 0, NUMA_NO_NODE,
-				    __builtin_return_address(0));
+				    PAGE_KERNEL, 0, NUMA_NO_NODE, _RET_IP_);
 	if (p && (kasan_module_alloc(p, size) < 0)) {
 		vfree(p);
 		return NULL;
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index 12c686c65ea9..a2954a6591cc 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -174,7 +174,7 @@ static void __ioremap_check_mem(resource_size_t addr, unsigned long size,
  */
 static void __iomem *
 __ioremap_caller(resource_size_t phys_addr, unsigned long size,
-		 enum page_cache_mode pcm, void *caller, bool encrypted)
+		 enum page_cache_mode pcm, unsigned long caller, bool encrypted)
 {
 	unsigned long offset, vaddr;
 	resource_size_t last_addr;
@@ -290,7 +290,7 @@ __ioremap_caller(resource_size_t phys_addr, unsigned long size,
 	 * tree.
 	 */
 	if (iomem_map_sanity_check(unaligned_phys_addr, unaligned_size))
-		pr_warn("caller %pS mapping multiple BARs\n", caller);
+		pr_warn("caller %pS mapping multiple BARs\n", (void *)caller);
 
 	return ret_addr;
 err_free_area:
@@ -333,8 +333,7 @@ void __iomem *ioremap(resource_size_t phys_addr, unsigned long size)
 	 */
 	enum page_cache_mode pcm = _PAGE_CACHE_MODE_UC_MINUS;
 
-	return __ioremap_caller(phys_addr, size, pcm,
-				__builtin_return_address(0), false);
+	return __ioremap_caller(phys_addr, size, pcm, _RET_IP_, false);
 }
 EXPORT_SYMBOL(ioremap);
 
@@ -366,8 +365,7 @@ void __iomem *ioremap_uc(resource_size_t phys_addr, unsigned long size)
 {
 	enum page_cache_mode pcm = _PAGE_CACHE_MODE_UC;
 
-	return __ioremap_caller(phys_addr, size, pcm,
-				__builtin_return_address(0), false);
+	return __ioremap_caller(phys_addr, size, pcm, _RET_IP_, false);
 }
 EXPORT_SYMBOL_GPL(ioremap_uc);
 
@@ -384,7 +382,7 @@ EXPORT_SYMBOL_GPL(ioremap_uc);
 void __iomem *ioremap_wc(resource_size_t phys_addr, unsigned long size)
 {
 	return __ioremap_caller(phys_addr, size, _PAGE_CACHE_MODE_WC,
-					__builtin_return_address(0), false);
+					_RET_IP_, false);
 }
 EXPORT_SYMBOL(ioremap_wc);
 
@@ -401,21 +399,21 @@ EXPORT_SYMBOL(ioremap_wc);
 void __iomem *ioremap_wt(resource_size_t phys_addr, unsigned long size)
 {
 	return __ioremap_caller(phys_addr, size, _PAGE_CACHE_MODE_WT,
-					__builtin_return_address(0), false);
+					_RET_IP_, false);
 }
 EXPORT_SYMBOL(ioremap_wt);
 
 void __iomem *ioremap_encrypted(resource_size_t phys_addr, unsigned long size)
 {
 	return __ioremap_caller(phys_addr, size, _PAGE_CACHE_MODE_WB,
-				__builtin_return_address(0), true);
+				_RET_IP_, true);
 }
 EXPORT_SYMBOL(ioremap_encrypted);
 
 void __iomem *ioremap_cache(resource_size_t phys_addr, unsigned long size)
 {
 	return __ioremap_caller(phys_addr, size, _PAGE_CACHE_MODE_WB,
-				__builtin_return_address(0), false);
+				_RET_IP_, false);
 }
 EXPORT_SYMBOL(ioremap_cache);
 
@@ -424,7 +422,7 @@ void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size,
 {
 	return __ioremap_caller(phys_addr, size,
 				pgprot2cachemode(__pgprot(prot_val)),
-				__builtin_return_address(0), false);
+				_RET_IP_, false);
 }
 EXPORT_SYMBOL(ioremap_prot);
 
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index b4c82f2d40dc..8705952b03f9 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -60,7 +60,7 @@ struct vm_struct {
 #endif
 	unsigned int		nr_pages;
 	phys_addr_t		phys_addr;
-	const void		*caller;
+	unsigned long		caller;
 };
 
 struct vmap_area {
@@ -132,9 +132,9 @@ extern void *__vmalloc(unsigned long size, gfp_t gfp_mask);
 extern void *__vmalloc_node_range(unsigned long size, unsigned long align,
 			unsigned long start, unsigned long end, gfp_t gfp_mask,
 			pgprot_t prot, unsigned long vm_flags, int node,
-			const void *caller);
+			unsigned long caller);
 void *__vmalloc_node(unsigned long size, unsigned long align, gfp_t gfp_mask,
-		int node, const void *caller);
+		int node, unsigned long caller);
 
 extern void vfree(const void *addr);
 extern void vfree_atomic(const void *addr);
@@ -181,16 +181,14 @@ static inline size_t get_vm_area_size(const struct vm_struct *area)
 
 }
 
-extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
-extern struct vm_struct *get_vm_area_caller(unsigned long size,
-					unsigned long flags, const void *caller);
-extern struct vm_struct *__get_vm_area_caller(unsigned long size,
-					unsigned long flags,
-					unsigned long start, unsigned long end,
-					const void *caller);
+struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
+struct vm_struct *get_vm_area_caller(unsigned long size, unsigned long flags,
+		unsigned long caller);
+struct vm_struct *__get_vm_area_caller(unsigned long size, unsigned long flags,
+		unsigned long start, unsigned long end, unsigned long caller);
 void free_vm_area(struct vm_struct *area);
-extern struct vm_struct *remove_vm_area(const void *addr);
-extern struct vm_struct *find_vm_area(const void *addr);
+struct vm_struct *remove_vm_area(const void *addr);
+struct vm_struct *find_vm_area(const void *addr);
 
 static inline bool is_vm_area_hugepages(const void *addr)
 {
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 250503482cda..81ad2e97e49e 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -305,7 +305,7 @@ static void *__bpf_map_area_alloc(u64 size, int numa_node, bool mmapable)
 
 	return __vmalloc_node_range(size, align, VMALLOC_START, VMALLOC_END,
 			gfp | GFP_KERNEL | __GFP_RETRY_MAYFAIL, PAGE_KERNEL,
-			flags, numa_node, __builtin_return_address(0));
+			flags, numa_node, _RET_IP_);
 }
 
 void *bpf_map_area_alloc(u64 size, int numa_node)
diff --git a/kernel/fork.c b/kernel/fork.c
index fa77820649b4..cb446d2596d7 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -246,7 +246,7 @@ static unsigned long *alloc_thread_stack_node(struct task_struct *tsk, int node)
 				     VMALLOC_START, VMALLOC_END,
 				     THREADINFO_GFP & ~__GFP_ACCOUNT,
 				     PAGE_KERNEL,
-				     0, node, __builtin_return_address(0));
+				     0, node, _RET_IP_);
 
 	/*
 	 * We can't call find_vm_area() in interrupt context, and
diff --git a/kernel/module.c b/kernel/module.c
index 30479355ab85..bfc8ca90c870 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2797,7 +2797,7 @@ void * __weak module_alloc(unsigned long size)
 {
 	return __vmalloc_node_range(size, 1, VMALLOC_START, VMALLOC_END,
 			GFP_KERNEL, PAGE_KERNEL_EXEC, VM_FLUSH_RESET_PERMS,
-			NUMA_NO_NODE, __builtin_return_address(0));
+			NUMA_NO_NODE, _RET_IP_);
 }
 
 bool __weak module_init_section(const char *name)
diff --git a/kernel/scs.c b/kernel/scs.c
index e2a71fc82fa0..e84321db1924 100644
--- a/kernel/scs.c
+++ b/kernel/scs.c
@@ -39,8 +39,7 @@ static void *__scs_alloc(int node)
 	}
 
 	return __vmalloc_node_range(SCS_SIZE, 1, VMALLOC_START, VMALLOC_END,
-				    GFP_SCS, PAGE_KERNEL, 0, node,
-				    __builtin_return_address(0));
+				    GFP_SCS, PAGE_KERNEL, 0, node, _RET_IP_);
 }
 
 void *scs_alloc(int node)
diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c
index 5cf2fe9aab9e..3ce421078906 100644
--- a/lib/test_vmalloc.c
+++ b/lib/test_vmalloc.c
@@ -98,7 +98,7 @@ static int random_size_align_alloc_test(void)
 		size = ((rnd % 10) + 1) * PAGE_SIZE;
 
 		ptr = __vmalloc_node(size, align, GFP_KERNEL | __GFP_ZERO, 0,
-				__builtin_return_address(0));
+				_RET_IP_);
 		if (!ptr)
 			return -1;
 
@@ -121,7 +121,7 @@ static int align_shift_alloc_test(void)
 		align = ((unsigned long) 1) << i;
 
 		ptr = __vmalloc_node(PAGE_SIZE, align, GFP_KERNEL|__GFP_ZERO, 0,
-				__builtin_return_address(0));
+				_RET_IP_);
 		if (!ptr)
 			return -1;
 
@@ -138,8 +138,7 @@ static int fix_align_alloc_test(void)
 
 	for (i = 0; i < test_loop_count; i++) {
 		ptr = __vmalloc_node(5 * PAGE_SIZE, THREAD_ALIGN << 1,
-				GFP_KERNEL | __GFP_ZERO, 0,
-				__builtin_return_address(0));
+				GFP_KERNEL | __GFP_ZERO, 0, _RET_IP_);
 		if (!ptr)
 			return -1;
 
diff --git a/mm/ioremap.c b/mm/ioremap.c
index d1dcc7e744ac..fe3ecc5e0952 100644
--- a/mm/ioremap.c
+++ b/mm/ioremap.c
@@ -51,8 +51,7 @@ void __iomem *ioremap_prot(phys_addr_t addr, size_t size, unsigned long prot)
 	addr -= offset;
 	size = PAGE_ALIGN(size + offset);
 
-	area = get_vm_area_caller(size, VM_IOREMAP,
-			__builtin_return_address(0));
+	area = get_vm_area_caller(size, VM_IOREMAP, _RET_IP_);
 	if (!area)
 		return NULL;
 	vaddr = (unsigned long)area->addr;
diff --git a/mm/kasan/shadow.c b/mm/kasan/shadow.c
index 727ad4629173..2a10b9437066 100644
--- a/mm/kasan/shadow.c
+++ b/mm/kasan/shadow.c
@@ -204,7 +204,7 @@ static int __meminit kasan_mem_notifier(struct notifier_block *nb,
 					shadow_end, GFP_KERNEL,
 					PAGE_KERNEL, VM_NO_GUARD,
 					pfn_to_nid(mem_data->start_pfn),
-					__builtin_return_address(0));
+					_RET_IP_);
 		if (!ret)
 			return NOTIFY_BAD;
 
@@ -505,8 +505,7 @@ int kasan_module_alloc(void *addr, size_t size)
 	ret = __vmalloc_node_range(shadow_size, 1, shadow_start,
 			shadow_start + shadow_size,
 			GFP_KERNEL,
-			PAGE_KERNEL, VM_NO_GUARD, NUMA_NO_NODE,
-			__builtin_return_address(0));
+			PAGE_KERNEL, VM_NO_GUARD, NUMA_NO_NODE, _RET_IP_);
 
 	if (ret) {
 		__memset(ret, KASAN_SHADOW_INIT, shadow_size);
diff --git a/mm/nommu.c b/mm/nommu.c
index 5c9ab799c0e6..515b3e528985 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -153,13 +153,13 @@ EXPORT_SYMBOL(__vmalloc);
 void *__vmalloc_node_range(unsigned long size, unsigned long align,
 		unsigned long start, unsigned long end, gfp_t gfp_mask,
 		pgprot_t prot, unsigned long vm_flags, int node,
-		const void *caller)
+		unsigned long caller)
 {
 	return __vmalloc(size, gfp_mask);
 }
 
 void *__vmalloc_node(unsigned long size, unsigned long align, gfp_t gfp_mask,
-		int node, const void *caller)
+		int node, unsigned long caller)
 {
 	return __vmalloc(size, gfp_mask);
 }
diff --git a/mm/util.c b/mm/util.c
index 0b6dd9d81da7..5c2304bb02ae 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -593,8 +593,7 @@ void *kvmalloc_node(size_t size, gfp_t flags, int node)
 	if (ret || size <= PAGE_SIZE)
 		return ret;
 
-	return __vmalloc_node(size, 1, flags, node,
-			__builtin_return_address(0));
+	return __vmalloc_node(size, 1, flags, node, _RET_IP_);
 }
 EXPORT_SYMBOL(kvmalloc_node);
 
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 4b415b4bb7ae..a22241e9c363 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2344,7 +2344,7 @@ void unmap_kernel_range(unsigned long addr, unsigned long size)
 }
 
 static inline void setup_vmalloc_vm_locked(struct vm_struct *vm,
-	struct vmap_area *va, unsigned long flags, const void *caller)
+		struct vmap_area *va, unsigned long flags, unsigned long caller)
 {
 	vm->flags = flags;
 	vm->addr = (void *)va->va_start;
@@ -2354,7 +2354,7 @@ static inline void setup_vmalloc_vm_locked(struct vm_struct *vm,
 }
 
 static void setup_vmalloc_vm(struct vm_struct *vm, struct vmap_area *va,
-			      unsigned long flags, const void *caller)
+			      unsigned long flags, unsigned long caller)
 {
 	spin_lock(&vmap_area_lock);
 	setup_vmalloc_vm_locked(vm, va, flags, caller);
@@ -2374,7 +2374,8 @@ static void clear_vm_uninitialized_flag(struct vm_struct *vm)
 
 static struct vm_struct *__get_vm_area_node(unsigned long size,
 		unsigned long align, unsigned long flags, unsigned long start,
-		unsigned long end, int node, gfp_t gfp_mask, const void *caller)
+		unsigned long end, int node, gfp_t gfp_mask,
+		unsigned long caller)
 {
 	struct vmap_area *va;
 	struct vm_struct *area;
@@ -2411,7 +2412,7 @@ static struct vm_struct *__get_vm_area_node(unsigned long size,
 
 struct vm_struct *__get_vm_area_caller(unsigned long size, unsigned long flags,
 				       unsigned long start, unsigned long end,
-				       const void *caller)
+				       unsigned long caller)
 {
 	return __get_vm_area_node(size, 1, flags, start, end, NUMA_NO_NODE,
 				  GFP_KERNEL, caller);
@@ -2431,12 +2432,11 @@ struct vm_struct *__get_vm_area_caller(unsigned long size, unsigned long flags,
 struct vm_struct *get_vm_area(unsigned long size, unsigned long flags)
 {
 	return __get_vm_area_node(size, 1, flags, VMALLOC_START, VMALLOC_END,
-				  NUMA_NO_NODE, GFP_KERNEL,
-				  __builtin_return_address(0));
+				  NUMA_NO_NODE, GFP_KERNEL, _RET_IP_);
 }
 
 struct vm_struct *get_vm_area_caller(unsigned long size, unsigned long flags,
-				const void *caller)
+				unsigned long caller)
 {
 	return __get_vm_area_node(size, 1, flags, VMALLOC_START, VMALLOC_END,
 				  NUMA_NO_NODE, GFP_KERNEL, caller);
@@ -2720,7 +2720,7 @@ void *vmap(struct page **pages, unsigned int count,
 		return NULL;
 
 	size = (unsigned long)count << PAGE_SHIFT;
-	area = get_vm_area_caller(size, flags, __builtin_return_address(0));
+	area = get_vm_area_caller(size, flags, _RET_IP_);
 	if (!area)
 		return NULL;
 
@@ -2769,8 +2769,7 @@ void *vmap_pfn(unsigned long *pfns, unsigned int count, pgprot_t prot)
 	struct vmap_pfn_data data = { .pfns = pfns, .prot = pgprot_nx(prot) };
 	struct vm_struct *area;
 
-	area = get_vm_area_caller(count * PAGE_SIZE, VM_IOREMAP,
-			__builtin_return_address(0));
+	area = get_vm_area_caller(count * PAGE_SIZE, VM_IOREMAP, _RET_IP_);
 	if (!area)
 		return NULL;
 	if (apply_to_page_range(&init_mm, (unsigned long)area->addr,
@@ -2880,7 +2879,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
 void *__vmalloc_node_range(unsigned long size, unsigned long align,
 			unsigned long start, unsigned long end, gfp_t gfp_mask,
 			pgprot_t prot, unsigned long vm_flags, int node,
-			const void *caller)
+			unsigned long caller)
 {
 	struct vm_struct *area;
 	void *addr;
@@ -2972,7 +2971,7 @@ void *__vmalloc_node_range(unsigned long size, unsigned long align,
  * Return: pointer to the allocated memory or %NULL on error
  */
 void *__vmalloc_node(unsigned long size, unsigned long align,
-			    gfp_t gfp_mask, int node, const void *caller)
+			    gfp_t gfp_mask, int node, unsigned long caller)
 {
 	return __vmalloc_node_range(size, align, VMALLOC_START, VMALLOC_END,
 				gfp_mask, PAGE_KERNEL, 0, node, caller);
@@ -2988,8 +2987,7 @@ EXPORT_SYMBOL_GPL(__vmalloc_node);
 
 void *__vmalloc(unsigned long size, gfp_t gfp_mask)
 {
-	return __vmalloc_node(size, 1, gfp_mask, NUMA_NO_NODE,
-				__builtin_return_address(0));
+	return __vmalloc_node(size, 1, gfp_mask, NUMA_NO_NODE, _RET_IP_);
 }
 EXPORT_SYMBOL(__vmalloc);
 
@@ -3007,8 +3005,7 @@ EXPORT_SYMBOL(__vmalloc);
  */
 void *vmalloc(unsigned long size)
 {
-	return __vmalloc_node(size, 1, GFP_KERNEL, NUMA_NO_NODE,
-				__builtin_return_address(0));
+	return __vmalloc_node(size, 1, GFP_KERNEL, NUMA_NO_NODE, _RET_IP_);
 }
 EXPORT_SYMBOL(vmalloc);
 
@@ -3028,7 +3025,7 @@ EXPORT_SYMBOL(vmalloc);
 void *vzalloc(unsigned long size)
 {
 	return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_ZERO, NUMA_NO_NODE,
-				__builtin_return_address(0));
+				_RET_IP_);
 }
 EXPORT_SYMBOL(vzalloc);
 
@@ -3045,8 +3042,7 @@ void *vmalloc_user(unsigned long size)
 {
 	return __vmalloc_node_range(size, SHMLBA,  VMALLOC_START, VMALLOC_END,
 				    GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL,
-				    VM_USERMAP, NUMA_NO_NODE,
-				    __builtin_return_address(0));
+				    VM_USERMAP, NUMA_NO_NODE, _RET_IP_);
 }
 EXPORT_SYMBOL(vmalloc_user);
 
@@ -3065,8 +3061,7 @@ EXPORT_SYMBOL(vmalloc_user);
  */
 void *vmalloc_node(unsigned long size, int node)
 {
-	return __vmalloc_node(size, 1, GFP_KERNEL, node,
-			__builtin_return_address(0));
+	return __vmalloc_node(size, 1, GFP_KERNEL, node, _RET_IP_);
 }
 EXPORT_SYMBOL(vmalloc_node);
 
@@ -3083,8 +3078,7 @@ EXPORT_SYMBOL(vmalloc_node);
  */
 void *vzalloc_node(unsigned long size, int node)
 {
-	return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_ZERO, node,
-				__builtin_return_address(0));
+	return __vmalloc_node(size, 1, GFP_KERNEL | __GFP_ZERO, node, _RET_IP_);
 }
 EXPORT_SYMBOL(vzalloc_node);
 
@@ -3111,8 +3105,7 @@ EXPORT_SYMBOL(vzalloc_node);
  */
 void *vmalloc_32(unsigned long size)
 {
-	return __vmalloc_node(size, 1, GFP_VMALLOC32, NUMA_NO_NODE,
-			__builtin_return_address(0));
+	return __vmalloc_node(size, 1, GFP_VMALLOC32, NUMA_NO_NODE, _RET_IP_);
 }
 EXPORT_SYMBOL(vmalloc_32);
 
@@ -3129,8 +3122,7 @@ void *vmalloc_32_user(unsigned long size)
 {
 	return __vmalloc_node_range(size, SHMLBA,  VMALLOC_START, VMALLOC_END,
 				    GFP_VMALLOC32 | __GFP_ZERO, PAGE_KERNEL,
-				    VM_USERMAP, NUMA_NO_NODE,
-				    __builtin_return_address(0));
+				    VM_USERMAP, NUMA_NO_NODE, _RET_IP_);
 }
 EXPORT_SYMBOL(vmalloc_32_user);
 
@@ -3712,7 +3704,7 @@ struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
 		insert_vmap_area(vas[area], &vmap_area_root, &vmap_area_list);
 
 		setup_vmalloc_vm_locked(vms[area], vas[area], VM_ALLOC,
-				 pcpu_get_vm_areas);
+				 _THIS_IP_);
 	}
 	spin_unlock(&vmap_area_lock);
 
@@ -3820,7 +3812,7 @@ bool vmalloc_dump_obj(void *object)
 	if (!vm)
 		return false;
 	pr_cont(" %u-page vmalloc region starting at %#lx allocated at %pS\n",
-		vm->nr_pages, (unsigned long)vm->addr, vm->caller);
+		vm->nr_pages, (unsigned long)vm->addr, (void *)vm->caller);
 	return true;
 }
 #endif
@@ -3911,7 +3903,7 @@ static int s_show(struct seq_file *m, void *p)
 		v->addr, v->addr + v->size, v->size);
 
 	if (v->caller)
-		seq_printf(m, " %pS", v->caller);
+		seq_printf(m, " %pS", (void *)v->caller);
 
 	if (v->nr_pages)
 		seq_printf(m, " pages=%d", v->nr_pages);
-- 
2.30.2


^ permalink raw reply related

* Re: [PATCH v2 4/7] CMDLINE: powerpc: convert to generic builtin command line
From: Christophe Leroy @ 2021-03-24 15:31 UTC (permalink / raw)
  To: Daniel Walker
  Cc: Rob Herring, Ruslan Ruslichenko, Ruslan Bilovol,
	Daniel Gimpelevich, linuxppc-dev, x86, linux-mips, linux-kernel,
	Paul Mackerras, xe-linux-external, Andrew Morton, Will Deacon
In-Reply-To: <20210309214051.GS109100@zorba>



Le 09/03/2021 à 22:40, Daniel Walker a écrit :
> On Tue, Mar 09, 2021 at 08:56:47AM +0100, Christophe Leroy wrote:
>>
>>
>> Le 09/03/2021 à 01:02, Daniel Walker a écrit :
>>> This updates the powerpc code to use the CONFIG_GENERIC_CMDLINE
>>> option.
>>>
>>> Cc: xe-linux-external@cisco.com
>>> Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
>>> Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
>>> Signed-off-by: Daniel Walker <danielwa@cisco.com>
>>> ---
>>>    arch/powerpc/Kconfig            | 37 +--------------------------------
>>>    arch/powerpc/kernel/prom.c      |  1 +
>>>    arch/powerpc/kernel/prom_init.c | 35 ++++++++++++++++++-------------
>>>    3 files changed, 23 insertions(+), 50 deletions(-)
>>>
>>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>>> index 107bb4319e0e..276b06d5c961 100644
>>> --- a/arch/powerpc/Kconfig
>>> +++ b/arch/powerpc/Kconfig
>>> @@ -167,6 +167,7 @@ config PPC
>>>    	select EDAC_SUPPORT
>>>    	select GENERIC_ATOMIC64			if PPC32
>>>    	select GENERIC_CLOCKEVENTS_BROADCAST	if SMP
>>> +	select GENERIC_CMDLINE
>>>    	select GENERIC_CMOS_UPDATE
>>>    	select GENERIC_CPU_AUTOPROBE
>>>    	select GENERIC_CPU_VULNERABILITIES	if PPC_BARRIER_NOSPEC
>>> @@ -906,42 +907,6 @@ config PPC_DENORMALISATION
>>>    	  Add support for handling denormalisation of single precision
>>>    	  values.  Useful for bare metal only.  If unsure say Y here.
>>> -config CMDLINE
>>> -	string "Initial kernel command string"
>>> -	default ""
>>> -	help
>>> -	  On some platforms, there is currently no way for the boot loader to
>>> -	  pass arguments to the kernel. For these platforms, you can supply
>>> -	  some command-line options at build time by entering them here.  In
>>> -	  most cases you will need to specify the root device here.
>>> -
>>> -choice
>>> -	prompt "Kernel command line type" if CMDLINE != ""
>>> -	default CMDLINE_FROM_BOOTLOADER
>>> -
>>> -config CMDLINE_FROM_BOOTLOADER
>>> -	bool "Use bootloader kernel arguments if available"
>>> -	help
>>> -	  Uses the command-line options passed by the boot loader. If
>>> -	  the boot loader doesn't provide any, the default kernel command
>>> -	  string provided in CMDLINE will be used.

I can't see how the above is supported in the generic builtin.

Taking into account that it is the default on powerpc, I'm having hardtime with that.

>>> -
>>> -config CMDLINE_EXTEND
>>> -	bool "Extend bootloader kernel arguments"
>>> -	help
>>> -	  The command-line arguments provided by the boot loader will be
>>> -	  appended to the default kernel command string.
>>> -
>>> -config CMDLINE_FORCE
>>> -	bool "Always use the default kernel command string"
>>> -	help
>>> -	  Always use the default kernel command string, even if the boot
>>> -	  loader passes other arguments to the kernel.
>>> -	  This is useful if you cannot or don't want to change the
>>> -	  command-line options your boot loader passes to the kernel.
>>> -
>>> -endchoice
>>> -
>>>    config EXTRA_TARGETS
>>>    	string "Additional default image types"
>>>    	help
>>> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
>>> index ae3c41730367..96d0a01be1b4 100644
>>> --- a/arch/powerpc/kernel/prom.c
>>> +++ b/arch/powerpc/kernel/prom.c
>>> @@ -27,6 +27,7 @@
>>>    #include <linux/irq.h>
>>>    #include <linux/memblock.h>
>>>    #include <linux/of.h>
>>> +#include <linux/cmdline.h>
>>
>> Why is this needed in prom.c ?
>   
> Must have been a mistake, I don't think it's needed.
> 
> 
>>>    #include <linux/of_fdt.h>
>>>    #include <linux/libfdt.h>
>>>    #include <linux/cpu.h>
>>> diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
>>> index e9d4eb6144e1..657241534d69 100644
>>> --- a/arch/powerpc/kernel/prom_init.c
>>> +++ b/arch/powerpc/kernel/prom_init.c
>>> @@ -27,6 +27,7 @@
>>>    #include <linux/initrd.h>
>>>    #include <linux/bitops.h>
>>>    #include <linux/pgtable.h>
>>> +#include <linux/cmdline.h>
>>>    #include <asm/prom.h>
>>>    #include <asm/rtas.h>
>>>    #include <asm/page.h>
>>> @@ -242,15 +243,6 @@ static int __init prom_strcmp(const char *cs, const char *ct)
>>>    	return 0;
>>>    }
>>> -static char __init *prom_strcpy(char *dest, const char *src)
>>> -{
>>> -	char *tmp = dest;
>>> -
>>> -	while ((*dest++ = *src++) != '\0')
>>> -		/* nothing */;
>>> -	return tmp;
>>> -}
>>> -
>>
>> This game with prom_strcpy() should go a separate preceeding patch.
>>
>> Also, it looks like checkpatch.pl recommends to use strscpy() instead of strlcpy().
> 
> strscpy() is very large. I'm not sure it's compatible with this prom_init.c
> environment.

Ok you are right, lets keep strlcpy() and ignore checkpatch complaints

> 
>>>    static int __init prom_strncmp(const char *cs, const char *ct, size_t count)
>>>    {
>>>    	unsigned char c1, c2;
>>> @@ -276,6 +268,20 @@ static size_t __init prom_strlen(const char *s)
>>>    	return sc - s;
>>>    }
>>> +static size_t __init prom_strlcpy(char *dest, const char *src, size_t size)
>>> +{
>>> +	size_t ret = prom_strlen(src);
>>> +
>>> +	if (size) {
>>> +		size_t len = (ret >= size) ? size - 1 : ret;
>>> +
>>> +		memcpy(dest, src, len);
>>> +		dest[len] = '\0';
>>> +	}
>>> +	return ret;
>>> +}
>>> +
>>> +
>>>    static int __init prom_memcmp(const void *cs, const void *ct, size_t count)
>>>    {
>>>    	const unsigned char *su1, *su2;
>>> @@ -304,6 +310,7 @@ static char __init *prom_strstr(const char *s1, const char *s2)
>>>    	return NULL;
>>>    }
>>> +#ifdef GENERIC_CMDLINE_NEED_STRLCAT
>>>    static size_t __init prom_strlcat(char *dest, const char *src, size_t count)
>>>    {
>>>    	size_t dsize = prom_strlen(dest);
>>> @@ -323,6 +330,7 @@ static size_t __init prom_strlcat(char *dest, const char *src, size_t count)
>>>    	return res;
>>>    }
>>> +#endif
>>>    #ifdef CONFIG_PPC_PSERIES
>>>    static int __init prom_strtobool(const char *s, bool *res)
>>> @@ -775,12 +783,11 @@ static void __init early_cmdline_parse(void)
>>>    	prom_cmd_line[0] = 0;
>>>    	p = prom_cmd_line;
>>> -	if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && (long)prom.chosen > 0)
>>> +	if ((long)prom.chosen > 0)
>>>    		l = prom_getprop(prom.chosen, "bootargs", p, COMMAND_LINE_SIZE-1);
>>> -	if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) || l <= 0 || p[0] == '\0')
>>> -		prom_strlcat(prom_cmd_line, " " CONFIG_CMDLINE,
>>> -			     sizeof(prom_cmd_line));
>>> +	cmdline_add_builtin_custom(prom_cmd_line, (l > 0 ? p : NULL), sizeof(prom_cmd_line),
>>> +					__prombss, prom_strlcpy, prom_strlcat);
>>
>> So we are referencing a function that doesn't exist (namely prom_strlcat).
>> But it works because cmdline_add_builtin_custom() looks like a function but
>> is in fact an obscure macro that doesn't use prom_strlcat() unless
>> GENERIC_CMDLINE_NEED_STRLCAT is defined.
>>
>> IMHO that's awful for readability and code maintenance.
> 
> powerpc is a special case, there's no other users like this. The reason is
> because of all the difficulty in this prom_init.c code. A lot of the generic
> code has similar kind of changes to work across architectures.

Any feedback on the proposed changes I made on the 13th ? I know it is partly buggy but that was 
more for the principle. I can make clean working patch if it helps.

> 
> 
>>>    	prom_printf("command line: %s\n", prom_cmd_line);
>>> @@ -2706,7 +2713,7 @@ static void __init flatten_device_tree(void)
>>>    	/* Add "phandle" in there, we'll need it */
>>>    	namep = make_room(&mem_start, &mem_end, 16, 1);
>>> -	prom_strcpy(namep, "phandle");
>>> +	prom_strlcpy(namep, "phandle", 8);
>>
>> Should be in a separate patch.
> 
> I can move it, I missed that from the first round.
> 
> Daniel
> 

Christophe

^ permalink raw reply

* Re: [RFC PATCH 6/8] powerpc/mm/book3s64/hash: drop pre 2.06 tlbiel for clang
From: Segher Boessenkool @ 2021-03-24 15:51 UTC (permalink / raw)
  To: Nicholas Piggin; +Cc: llvmlinux, linuxppc-dev, Daniel Axtens
In-Reply-To: <1616436133.s8792026fh.astroid@bobo.none>

Hi!

On Tue, Mar 23, 2021 at 04:11:10AM +1000, Nicholas Piggin wrote:
> The problem in this file is we generate 3 different tlbie and tlbiel
> instructions with the same mnemonic corresponding to different ISA
> versions.
> 
> This might actually be the one good place to use .machine to make sure 
> the assembler generates the right thing.

Yes, but then hide that in some macro.

(And "the one good place"?  I protest!)

> I'm not entirely sure it is
> foolproof because some of the times the instruction variant is inferred
> by the number of arguments it has yet arguments can be implicit. PPC_
> define would be exactly explicit.

The variants with fewer operands have those coded as 0 in the
instruction.  All of this is backwards compatible.

> But if it can be made reasonably robust with .machine then I'd be okay
> with that too.

Since you should do a macro (or inline) for it anyway, you could just
do .long, all the nastiness is in one place anyway then, it won't make
much difference what you do.  It should be documented there as well :-)


Segher

^ permalink raw reply

* Re: [PATCH v4 00/46] KVM: PPC: Book3S: C-ify the P9 entry/exit code
From: Nicholas Piggin @ 2021-03-24 16:25 UTC (permalink / raw)
  To: kvm-ppc; +Cc: linuxppc-dev
In-Reply-To: <20210323010305.1045293-1-npiggin@gmail.com>

Excerpts from Nicholas Piggin's message of March 23, 2021 11:02 am:
> I think enough changes and fixes have gone in since last round
> to repost.
> 
> I put a git tree here to make things easier to get.
> 
> https://github.com/npiggin/linux/tree/kvm-in-c-2

I just pushed a new tree https://github.com/npiggin/linux/tree/kvm-in-c-3

This mainly fixes up the compile error with older binutils and PR=1 
hcall reflection into guest for PR KVM. Haven't been able to completely 
test PR KVM because of unrelated connectivity issues but at least the
PR=1 syscall reflection is working again.

Thanks,
Nick

^ permalink raw reply

* Re: [PATCH v2 3/7] powerpc: convert config files to generic cmdline
From: Christophe Leroy @ 2021-03-24 16:59 UTC (permalink / raw)
  To: Daniel Walker
  Cc: Rob Herring, Daniel Gimpelevich, linuxppc-dev, x86, linux-mips,
	linux-kernel, Paul Mackerras, xe-linux-external, Andrew Morton,
	Will Deacon
In-Reply-To: <20210309212944.GR109100@zorba>



Le 09/03/2021 à 22:29, Daniel Walker a écrit :
> On Tue, Mar 09, 2021 at 08:47:09AM +0100, Christophe Leroy wrote:
>>
>>
>> Le 09/03/2021 à 01:02, Daniel Walker a écrit :
>>> This is a scripted mass convert of the config files to use
>>> the new generic cmdline. There is a bit of a trim effect here.
>>> It would seems that some of the config haven't been trimmed in
>>> a while.
>>
>> If you do that in a separate patch, you loose bisectability.
>>
>> I think it would have been better to do things in a different way, more or less like I did in my series:
>> 1/ Provide GENERIC cmdline at the same functionnality level as what is
>> spread in the different architectures
>> 2/ Convert architectures to the generic with least churn.
>> 3/ Add new features to the generic
> 
> You have to have the churn eventually, no matter how you do it. The only way you
> don't have churn is if you never upgrade the feature set.
> 
> 
>>>
>>> The bash script used to convert is as follows,
>>>
>>> if [[ -z "$1" || -z "$2" ]]; then
>>>           echo "Two arguments are needed."
>>>           exit 1
>>> fi
>>> mkdir $1
>>> cp $2 $1/.config
>>> sed -i 's/CONFIG_CMDLINE=/CONFIG_CMDLINE_BOOL=y\nCONFIG_CMDLINE_PREPEND=/g' $1/.config
>>
>> This is not correct.
>>
>> By default, on powerpc the provided command line is used only if the bootloader doesn't provide one.
>>
>> Otherwise:
>> - the builtin command line is appended to the one provided by the bootloader
>> if CONFIG_CMDLINE_EXTEND is selected
>> - the builtin command line replaces to the one provided by the bootloader if
>> CONFIG_CMDLINE_FORCE is selected
> 
> I think my changes maintain most of this due to the override of
> CONFIG_CMDLINE_PREPEND. This is an upgrade and the inflexibility in powerpc is
> an example of why these changes were created in the first place.

"inflexibility in powerpc" : Can you elaborate ?

> 
> For example , say the default command line is "root=/dev/issblk0" from iss476
> platform. And the bootloader adds "root=/dev/sda1"
> 
> The result is <prepend><bootloader><append>.


I'm still having hard time understanding the benefit of having both <prepend> and <append>.
Could you please provide a complete exemple from real life, ie what exactly the problem is and what 
it solves ?

> 
> Then you have,
> 
> root=/dev/issblk0 root=/dev/sda1
> 
> and the bootloader has precedent over the default command line. So root= in the
> above cases is defined by the bootloader.
> 
> The only issue would be if a person wants to override the default command line
> with an unrelated bootloader command line. I don't know how many people do this,
> but I doubt it's many. Can you think of any use cases like this?
> 
> I would imagine there are many more people who have to entirely duplicate the
> default command line in the boot loader when they really just want to change a
> single part of it like the root= device or console device or speed.
> 
> Daniel
> 

Christophe

^ permalink raw reply

* Re: [PATCH v2 3/7] powerpc: convert config files to generic cmdline
From: Rob Herring @ 2021-03-24 17:32 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Daniel Gimpelevich, linuxppc-dev, X86 ML, open list:MIPS,
	linux-kernel@vger.kernel.org, Paul Mackerras, xe-linux-external,
	Andrew Morton, Will Deacon, Daniel Walker
In-Reply-To: <e4899874-1684-fa1b-443e-f4e478e05e31@csgroup.eu>

On Wed, Mar 24, 2021 at 11:01 AM Christophe Leroy
<christophe.leroy@csgroup.eu> wrote:
>
>
>
> Le 09/03/2021 à 22:29, Daniel Walker a écrit :
> > On Tue, Mar 09, 2021 at 08:47:09AM +0100, Christophe Leroy wrote:
> >>
> >>
> >> Le 09/03/2021 à 01:02, Daniel Walker a écrit :
> >>> This is a scripted mass convert of the config files to use
> >>> the new generic cmdline. There is a bit of a trim effect here.
> >>> It would seems that some of the config haven't been trimmed in
> >>> a while.
> >>
> >> If you do that in a separate patch, you loose bisectability.
> >>
> >> I think it would have been better to do things in a different way, more or less like I did in my series:
> >> 1/ Provide GENERIC cmdline at the same functionnality level as what is
> >> spread in the different architectures
> >> 2/ Convert architectures to the generic with least churn.
> >> 3/ Add new features to the generic
> >
> > You have to have the churn eventually, no matter how you do it. The only way you
> > don't have churn is if you never upgrade the feature set.
> >
> >
> >>>
> >>> The bash script used to convert is as follows,
> >>>
> >>> if [[ -z "$1" || -z "$2" ]]; then
> >>>           echo "Two arguments are needed."
> >>>           exit 1
> >>> fi
> >>> mkdir $1
> >>> cp $2 $1/.config
> >>> sed -i 's/CONFIG_CMDLINE=/CONFIG_CMDLINE_BOOL=y\nCONFIG_CMDLINE_PREPEND=/g' $1/.config
> >>
> >> This is not correct.
> >>
> >> By default, on powerpc the provided command line is used only if the bootloader doesn't provide one.
> >>
> >> Otherwise:
> >> - the builtin command line is appended to the one provided by the bootloader
> >> if CONFIG_CMDLINE_EXTEND is selected
> >> - the builtin command line replaces to the one provided by the bootloader if
> >> CONFIG_CMDLINE_FORCE is selected
> >
> > I think my changes maintain most of this due to the override of
> > CONFIG_CMDLINE_PREPEND. This is an upgrade and the inflexibility in powerpc is
> > an example of why these changes were created in the first place.
>
> "inflexibility in powerpc" : Can you elaborate ?
>
> >
> > For example , say the default command line is "root=/dev/issblk0" from iss476
> > platform. And the bootloader adds "root=/dev/sda1"
> >
> > The result is <prepend><bootloader><append>.
>
>
> I'm still having hard time understanding the benefit of having both <prepend> and <append>.
> Could you please provide a complete exemple from real life, ie what exactly the problem is and what
> it solves ?

It doesn't matter. We already have both cases and 'extend' has meant either one.

What someone wants is policy and the kernel shouldn't be defining the policy.

Rob

^ permalink raw reply

* Re: [PATCH V2 3/5] tools/perf: Add powerpc support for PERF_SAMPLE_WEIGHT_STRUCT
From: Jiri Olsa @ 2021-03-24 19:43 UTC (permalink / raw)
  To: Athira Rajeev
  Cc: ravi.bangoria, maddy, peterz, linux-kernel, acme,
	linux-perf-users, jolsa, kjain, linuxppc-dev, kan.liang
In-Reply-To: <1616425047-1666-4-git-send-email-atrajeev@linux.vnet.ibm.com>

On Mon, Mar 22, 2021 at 10:57:25AM -0400, Athira Rajeev wrote:
> Add arch specific arch_evsel__set_sample_weight() to set the new
> sample type for powerpc.
> 
> Add arch specific arch_perf_parse_sample_weight() to store the
> sample->weight values depending on the sample type applied.
> if the new sample type (PERF_SAMPLE_WEIGHT_STRUCT) is applied,
> store only the lower 32 bits to sample->weight. If sample type
> is 'PERF_SAMPLE_WEIGHT', store the full 64-bit to sample->weight.
> 
> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
> ---
>  tools/perf/arch/powerpc/util/Build   |  2 ++
>  tools/perf/arch/powerpc/util/event.c | 32 ++++++++++++++++++++++++++++++++
>  tools/perf/arch/powerpc/util/evsel.c |  8 ++++++++
>  3 files changed, 42 insertions(+)
>  create mode 100644 tools/perf/arch/powerpc/util/event.c
>  create mode 100644 tools/perf/arch/powerpc/util/evsel.c
> 
> diff --git a/tools/perf/arch/powerpc/util/Build b/tools/perf/arch/powerpc/util/Build
> index b7945e5a543b..8a79c4126e5b 100644
> --- a/tools/perf/arch/powerpc/util/Build
> +++ b/tools/perf/arch/powerpc/util/Build
> @@ -4,6 +4,8 @@ perf-y += kvm-stat.o
>  perf-y += perf_regs.o
>  perf-y += mem-events.o
>  perf-y += sym-handling.o
> +perf-y += evsel.o
> +perf-y += event.o
>  
>  perf-$(CONFIG_DWARF) += dwarf-regs.o
>  perf-$(CONFIG_DWARF) += skip-callchain-idx.o
> diff --git a/tools/perf/arch/powerpc/util/event.c b/tools/perf/arch/powerpc/util/event.c
> new file mode 100644
> index 000000000000..f49d32c2c8ae
> --- /dev/null
> +++ b/tools/perf/arch/powerpc/util/event.c
> @@ -0,0 +1,32 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include <linux/types.h>
> +#include <linux/string.h>
> +#include <linux/zalloc.h>
> +
> +#include "../../../util/event.h"
> +#include "../../../util/synthetic-events.h"
> +#include "../../../util/machine.h"
> +#include "../../../util/tool.h"
> +#include "../../../util/map.h"
> +#include "../../../util/debug.h"

nit, just #include "utils/...h" should work no?

other than that, the patchset looks ok to me

Acked-by: Jiri Olsa <jolsa@redhat.com>

thanks,
jirka

> +
> +void arch_perf_parse_sample_weight(struct perf_sample *data,
> +				   const __u64 *array, u64 type)
> +{
> +	union perf_sample_weight weight;
> +
> +	weight.full = *array;
> +	if (type & PERF_SAMPLE_WEIGHT)
> +		data->weight = weight.full;
> +	else
> +		data->weight = weight.var1_dw;
> +}
> +
> +void arch_perf_synthesize_sample_weight(const struct perf_sample *data,
> +					__u64 *array, u64 type)
> +{
> +	*array = data->weight;
> +
> +	if (type & PERF_SAMPLE_WEIGHT_STRUCT)
> +		*array &= 0xffffffff;
> +}
> diff --git a/tools/perf/arch/powerpc/util/evsel.c b/tools/perf/arch/powerpc/util/evsel.c
> new file mode 100644
> index 000000000000..2f733cdc8dbb
> --- /dev/null
> +++ b/tools/perf/arch/powerpc/util/evsel.c
> @@ -0,0 +1,8 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include <stdio.h>
> +#include "util/evsel.h"
> +
> +void arch_evsel__set_sample_weight(struct evsel *evsel)
> +{
> +	evsel__set_sample_bit(evsel, WEIGHT_STRUCT);
> +}
> -- 
> 1.8.3.1
> 


^ permalink raw reply

* [PATCH v7 3/7] powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name
From: Serge Semin @ 2021-03-24 20:48 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Felipe Balbi, Michael Ellerman,
	Vladimir Zapolskiy, Alexey Brodkin, Vineet Gupta, Rob Herring,
	Greg Kroah-Hartman, Krzysztof Kozlowski, Benjamin Herrenschmidt,
	Paul Mackerras
  Cc: Serge Semin, devicetree, linuxppc-dev, linux-kernel, Serge Semin
In-Reply-To: <20210324204836.29668-1-Sergey.Semin@baikalelectronics.ru>

In accordance with the Generic EHCI/OHCI bindings the corresponding node
name is suppose to comply with the Generic USB HCD DT schema, which
requires the USB nodes to have the name acceptable by the regexp:
"^usb(@.*)?" . Make sure the "generic-ehci" and "generic-ohci"-compatible
nodes are correctly named.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 arch/powerpc/boot/dts/akebono.dts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/boot/dts/akebono.dts b/arch/powerpc/boot/dts/akebono.dts
index df18f8dc4642..343326c30380 100644
--- a/arch/powerpc/boot/dts/akebono.dts
+++ b/arch/powerpc/boot/dts/akebono.dts
@@ -126,7 +126,7 @@ SATA0: sata@30000010000 {
 			interrupts = <93 2>;
 		};
 
-		EHCI0: ehci@30010000000 {
+		EHCI0: usb@30010000000 {
 			compatible = "ibm,476gtr-ehci", "generic-ehci";
 			reg = <0x300 0x10000000 0x0 0x10000>;
 			interrupt-parent = <&MPIC>;
@@ -140,14 +140,14 @@ SD0: sd@30000000000 {
 			interrupt-parent = <&MPIC>;
 		};
 
-		OHCI0: ohci@30010010000 {
+		OHCI0: usb@30010010000 {
 			compatible = "ibm,476gtr-ohci", "generic-ohci";
 			reg = <0x300 0x10010000 0x0 0x10000>;
 			interrupt-parent = <&MPIC>;
 			interrupts = <89 1>;
 			};
 
-		OHCI1: ohci@30010020000 {
+		OHCI1: usb@30010020000 {
 			compatible = "ibm,476gtr-ohci", "generic-ohci";
 			reg = <0x300 0x10020000 0x0 0x10000>;
 			interrupt-parent = <&MPIC>;
-- 
2.30.1


^ permalink raw reply related

* [PATCH v7 0/7] dt-bindings: usb: Harmonize xHCI/EHCI/OHCI/DWC3 nodes name
From: Serge Semin @ 2021-03-24 20:48 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Felipe Balbi, Michael Ellerman,
	Vladimir Zapolskiy, Alexey Brodkin, Vineet Gupta, Rob Herring,
	Greg Kroah-Hartman, Krzysztof Kozlowski
  Cc: devicetree, Khuong Dinh, Patrice Chotard, Serge Semin,
	linux-kernel, Serge Semin, Paul Mackerras, linux-arm-msm,
	linux-snps-arc, linuxppc-dev, linux-arm-kernel

As the subject states this series is an attempt to harmonize the xHCI,
EHCI, OHCI and DWC USB3 DT nodes with the DT schema introduced in the
framework of the patchset [1].

Firstly as Krzysztof suggested we've deprecated a support of DWC USB3
controllers with "synopsys,"-vendor prefix compatible string in favor of
the ones with valid "snps,"-prefix. It's done in all the DTS files,
which have been unfortunate to define such nodes.

Secondly we suggest to fix the snps,quirk-frame-length-adjustment property
declaration in the Amlogic meson-g12-common.dtsi DTS file, since it has
been erroneously declared as boolean while having uint32 type. Neil said
it was ok to init that property with 0x20 value.

Thirdly the main part of the patchset concern fixing the xHCI, EHCI/OHCI
and DWC USB3 DT nodes name as in accordance with their DT schema the
corresponding node name is suppose to comply with the Generic USB HCD DT
schema, which requires the USB nodes to have the name acceptable by the
regexp: "^usb(@.*)?". Such requirement had been applicable even before we
introduced the new DT schema in [1], but as we can see it hasn't been
strictly implemented for a lot the DTS files. Since DT schema is now
available the automated DTS validation shall make sure that the rule isn't
violated.

Note most of these patches have been a part of the last three patches of
[1]. But since there is no way to have them merged in in a combined
manner, I had to move them to the dedicated series and split them up so to
be accepted by the corresponding subsystem maintainers one-by-one.

[1] Link: https://lore.kernel.org/linux-usb/20201014101402.18271-1-Sergey.Semin@baikalelectronics.ru/
Changelog v1:
- As Krzysztof suggested I've created a script which checked whether the
  node names had been also updated in all the depended dts files. As a
  result I found two more files which should have been also modified:
  arch/arc/boot/dts/{axc003.dtsi,axc003_idu.dtsi}
- Correct the USB DWC3 nodes name found in
  arch/arm64/boot/dts/apm/{apm-storm.dtsi,apm-shadowcat.dtsi} too.

Link: https://lore.kernel.org/linux-usb/20201020115959.2658-1-Sergey.Semin@baikalelectronics.ru
Changelog v2:
- Drop the patch:
  [PATCH 01/29] usb: dwc3: Discard synopsys,dwc3 compatibility string
  and get back the one which marks the "synopsys,dwc3" compatible string
  as deprecated into the DT schema related series.
- Drop the patches:
  [PATCH 03/29] arm: dts: am437x: Correct DWC USB3 compatible string
  [PATCH 04/29] arm: dts: exynos: Correct DWC USB3 compatible string
  [PATCH 07/29] arm: dts: bcm53x: Harmonize EHCI/OHCI DT nodes name
  [PATCH 08/29] arm: dts: stm32: Harmonize EHCI/OHCI DT nodes name
  [PATCH 16/29] arm: dts: bcm5301x: Harmonize xHCI DT nodes name
  [PATCH 19/29] arm: dts: exynos: Harmonize DWC USB3 DT nodes name
  [PATCH 21/29] arm: dts: ls1021a: Harmonize DWC USB3 DT nodes name
  [PATCH 22/29] arm: dts: omap5: Harmonize DWC USB3 DT nodes name
  [PATCH 24/29] arm64: dts: allwinner: h6: Harmonize DWC USB3 DT nodes name
  [PATCH 26/29] arm64: dts: exynos: Harmonize DWC USB3 DT nodes name
  [PATCH 27/29] arm64: dts: layerscape: Harmonize DWC USB3 DT nodes name
  since they have been applied to the corresponding maintainers repos.
- Fix drivers/usb/dwc3/dwc3-qcom.c to be looking for the "usb@"-prefixed
  sub-node and falling back to the "dwc3@"-prefixed one on failure.

Link: https://lore.kernel.org/linux-usb/20201111091552.15593-1-Sergey.Semin@baikalelectronics.ru
Changelog v3:
- Drop the patches:
  [PATCH v2 04/18] arm: dts: hisi-x5hd2: Harmonize EHCI/OHCI DT nodes name
  [PATCH v2 06/18] arm64: dts: hisi: Harmonize EHCI/OHCI DT nodes name
  [PATCH v2 07/18] mips: dts: jz47x: Harmonize EHCI/OHCI DT nodes name
  [PATCH v2 08/18] mips: dts: sead3: Harmonize EHCI/OHCI DT nodes name
  [PATCH v2 09/18] mips: dts: ralink: mt7628a: Harmonize EHCI/OHCI DT nodes name
  [PATCH v2 11/18] arm64: dts: marvell: cp11x: Harmonize xHCI DT nodes name
  [PATCH v2 12/18] arm: dts: marvell: armada-375: Harmonize DWC USB3 DT nodes name
  [PATCH v2 16/18] arm64: dts: hi3660: Harmonize DWC USB3 DT nodes name
  since they have been applied to the corresponding maintainers repos.

Link: https://lore.kernel.org/linux-usb/20201205155621.3045-1-Sergey.Semin@baikalelectronics.ru
Changelog v4:
- Just resend.

Link: https://lore.kernel.org/linux-usb/20201210091756.18057-1-Sergey.Semin@baikalelectronics.ru/
Changelog v5:
- Drop the patch:
  [PATCH v4 02/10] arm64: dts: amlogic: meson-g12: Set FL-adj property value
  since it has been applied to the corresponding maintainers repos.
- Get back the patch:
  [PATCH 21/29] arm: dts: ls1021a: Harmonize DWC USB3 DT nodes name
  as it has been missing in the kernel 5.11-rc7
- Rebase onto the kernel 5.11-rc7.

Link: https://lore.kernel.org/lkml/20210208135154.6645-1-Sergey.Semin@baikalelectronics.ru/
Changelog v6:
- Just resend and add linux-usb.vger.kernel.org to the list of Ccecipients.

Link: https://lore.kernel.org/linux-usb/20210210172850.20849-1-Sergey.Semin@baikalelectronics.ru
Link: https://lore.kernel.org/linux-usb/20210212205521.14280-1-Sergey.Semin@baikalelectronics.ru
Changelog v7:
- Replace "of_get_child_by_name(np, "usb") ?: of_get_child_by_name(np, "dwc3");"
  pattern with using of_get_compatible_child() method in the Qcom DWC3 driver.
- Drop the patches:
  [PATCH v6 01/10] arm: dts: ls1021a: Harmonize DWC USB3 DT nodes name
  [PATCH v6 02/10] arm: dts: keystone: Correct DWC USB3 compatible string
  [PATCH v6 06/10] arm: dts: keystone: Harmonize DWC USB3 DT nodes name
  since they have been applied to the corresponding maintainers repos.
- Cleanup the list of recipients.
- Rebase onto kernel 5.12-rc4.

Cc: Khuong Dinh <khuong@os.amperecomputing.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-snps-arc@lists.infradead.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

Serge Semin (7):
  arc: dts: Harmonize EHCI/OHCI DT nodes name
  arm: dts: lpc18xx: Harmonize EHCI/OHCI DT nodes name
  powerpc: dts: akebono: Harmonize EHCI/OHCI DT nodes name
  arm: dts: stih407-family: Harmonize DWC USB3 DT nodes name
  arm64: dts: apm: Harmonize DWC USB3 DT nodes name
  usb: dwc3: qcom: Detect DWC3 DT-nodes using compatible string
  arm64: dts: qcom: Harmonize DWC USB3 DT nodes name

 arch/arc/boot/dts/axc003.dtsi                | 4 ++--
 arch/arc/boot/dts/axc003_idu.dtsi            | 4 ++--
 arch/arc/boot/dts/axs10x_mb.dtsi             | 4 ++--
 arch/arc/boot/dts/hsdk.dts                   | 4 ++--
 arch/arc/boot/dts/vdk_axs10x_mb.dtsi         | 2 +-
 arch/arm/boot/dts/lpc18xx.dtsi               | 4 ++--
 arch/arm/boot/dts/stih407-family.dtsi        | 2 +-
 arch/arm64/boot/dts/apm/apm-shadowcat.dtsi   | 4 ++--
 arch/arm64/boot/dts/apm/apm-storm.dtsi       | 6 +++---
 arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 4 ++--
 arch/arm64/boot/dts/qcom/ipq8074.dtsi        | 4 ++--
 arch/arm64/boot/dts/qcom/msm8996.dtsi        | 4 ++--
 arch/arm64/boot/dts/qcom/msm8998.dtsi        | 2 +-
 arch/arm64/boot/dts/qcom/qcs404-evb.dtsi     | 2 +-
 arch/arm64/boot/dts/qcom/qcs404.dtsi         | 4 ++--
 arch/arm64/boot/dts/qcom/sc7180.dtsi         | 2 +-
 arch/arm64/boot/dts/qcom/sdm845.dtsi         | 4 ++--
 arch/arm64/boot/dts/qcom/sm8150.dtsi         | 2 +-
 arch/powerpc/boot/dts/akebono.dts            | 6 +++---
 drivers/usb/dwc3/dwc3-qcom.c                 | 2 +-
 20 files changed, 35 insertions(+), 35 deletions(-)

-- 
2.30.1


^ permalink raw reply

* Re: [RFC PATCH 6/8] powerpc/mm/book3s64/hash: drop pre 2.06 tlbiel for clang
From: Segher Boessenkool @ 2021-03-24 21:07 UTC (permalink / raw)
  To: Nicholas Piggin; +Cc: linuxppc-dev, llvmlinux, Daniel Axtens
In-Reply-To: <20210324155105.GZ16691@gate.crashing.org>

On Wed, Mar 24, 2021 at 10:51:05AM -0500, Segher Boessenkool wrote:
> The variants with fewer operands have those coded as 0 in the
> instruction.  All of this is backwards compatible.

I was reminded that this is broken in ISA 2.03.  Ouch.


Segher

^ permalink raw reply

* Re: [PATCH 0/6] ASoC: fsl: Don't use devm_regmap_init_mmio_clk
From: Mark Brown @ 2021-03-24 23:39 UTC (permalink / raw)
  To: Shengjiu Wang, festevam, Xiubo.Lee, timur, nicoleotsuka, tiwai,
	perex, alsa-devel
  Cc: Mark Brown, linuxppc-dev, linux-kernel
In-Reply-To: <1616579928-22428-1-git-send-email-shengjiu.wang@nxp.com>

On Wed, 24 Mar 2021 17:58:42 +0800, Shengjiu Wang wrote:
> When there is power domain bind with ipg clock,
> 
> The call flow:
> devm_regmap_init_mmio_clk
>     - clk_prepare()
>         - clk_pm_runtime_get()
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/6] ASoC: fsl_esai: Don't use devm_regmap_init_mmio_clk
      commit: 203773e39347922b3923df6094324d430664466e
[2/6] ASoC: fsl_spdif: Don't use devm_regmap_init_mmio_clk
      commit: c2562572467a74fd637d2d22fb773b052512528c
[3/6] ASoC: fsl_asrc: Don't use devm_regmap_init_mmio_clk
      commit: cab04ab5900fea6655f2a49d1f94c37200b63a59
[4/6] ASoC: fsl_easrc: Don't use devm_regmap_init_mmio_clk
      commit: 069b24f22eb9dba2e0886b40ea3feaa98e3f4f9b
[5/6] ASoC: fsl_audmix: Don't use devm_regmap_init_mmio_clk
      commit: 3feaba79d8f701a774815483aa0e7f4edb15c880
[6/6] ASoC: fsl_micfil: Don't use devm_regmap_init_mmio_clk
      commit: b5cf28f7a890f3554ca15a43edbbb86dd1b9663c

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply

* Re: [RESEND 1/1] powerpc: asm: hvconsole: Move 'hvc_vio_init_early's prototype to shared location
From: Michael Ellerman @ 2021-03-25  1:10 UTC (permalink / raw)
  To: Lee Jones, linux-kernel, Benjamin Herrenschmidt, Paul Mackerras,
	linuxppc-dev
In-Reply-To: <20210324103854.GK2916463@dell>

Lee Jones <lee.jones@linaro.org> writes:
> On Wed, 03 Mar 2021, Lee Jones wrote:
>
>> Fixes the following W=1 kernel build warning(s):
>> 
>>  drivers/tty/hvc/hvc_vio.c:385:13: warning: no previous prototype for ‘hvc_vio_init_early’ [-Wmissing-prototypes]
>>  385 | void __init hvc_vio_init_early(void)
>>  | ^~~~~~~~~~~~~~~~~~
>> 
>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> Cc: Paul Mackerras <paulus@samba.org>
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Signed-off-by: Lee Jones <lee.jones@linaro.org>
>> Acked-by: Michael Ellerman <mpe@ellerman.id.au>
>> ---
>>  arch/powerpc/include/asm/hvconsole.h     | 3 +++
>>  arch/powerpc/platforms/pseries/pseries.h | 3 ---
>>  arch/powerpc/platforms/pseries/setup.c   | 1 +
>>  3 files changed, 4 insertions(+), 3 deletions(-)
>
> Any idea who might pick this up please?

I will. I have it in my next-test branch. 

cheers

^ permalink raw reply

* Re: [PATCH] powerpc/asm-offsets: GPR14 is not needed either
From: Rashmica Gupta @ 2021-03-25  3:34 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <9881c68fbca004f9ea18fc9473f630e11ccd6417.1615806071.git.christophe.leroy@csgroup.eu>

On Mon, 2021-03-15 at 11:01 +0000, Christophe Leroy wrote:
> Commit aac6a91fea93 ("powerpc/asm: Remove unused symbols in
> asm-offsets.c") removed GPR15 to GPR31 but kept GPR14,
> probably because it pops up in a couple of comments when doing
> a grep.
> 
> However, it was never used either, so remove it as well.
> 

Looks good to me.

Reviewed-by: Rashmica Gupta <rashmica.g@gmail.com>

> Fixes: aac6a91fea93 ("powerpc/asm: Remove unused symbols in asm-
> offsets.c")
> Cc: Rashmica Gupta <rashmicy@gmail.com>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
>  arch/powerpc/kernel/asm-offsets.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/asm-offsets.c
> b/arch/powerpc/kernel/asm-offsets.c
> index f3a662201a9f..4d230c5c7099 100644
> --- a/arch/powerpc/kernel/asm-offsets.c
> +++ b/arch/powerpc/kernel/asm-offsets.c
> @@ -323,9 +323,6 @@ int main(void)
>  	STACK_PT_REGS_OFFSET(GPR11, gpr[11]);
>  	STACK_PT_REGS_OFFSET(GPR12, gpr[12]);
>  	STACK_PT_REGS_OFFSET(GPR13, gpr[13]);
> -#ifndef CONFIG_PPC64
> -	STACK_PT_REGS_OFFSET(GPR14, gpr[14]);
> -#endif /* CONFIG_PPC64 */
>  	/*
>  	 * Note: these symbols include _ because they overlap with
> special
>  	 * register names


^ permalink raw reply

* Re: [PATCH 0/2] Fix EH race and MQ support
From: Martin K. Petersen @ 2021-03-25  3:53 UTC (permalink / raw)
  To: Tyrel Datwyler, james.bottomley
  Cc: brking, linuxppc-dev, linux-scsi, Martin K . Petersen,
	linux-kernel
In-Reply-To: <20210319205029.312969-1-tyreld@linux.ibm.com>

On Fri, 19 Mar 2021 14:50:27 -0600, Tyrel Datwyler wrote:

> Changes to the locking pattern protecting the event lists and handling of scsi
> command completion introduced a race where an ouststanding command that EH is
> waiting ifor to complete is no longer identifiable by being on the sent list, but
> instead as a command that is not on the free list. This is a result of moving
> commands to be completed off the sent list to a private list to be completed
> outside the list lock.
> 
> [...]

Applied to 5.12/scsi-fixes, thanks!

[1/2] ibmvfc: fix potential race in ibmvfc_wait_for_ops
      https://git.kernel.org/mkp/scsi/c/8b1c9b202549
[2/2] ibmvfc: make ibmvfc_wait_for_ops MQ aware
      https://git.kernel.org/mkp/scsi/c/62fc2661482b

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply

* Re: [PATCH 00/36] [Set 4] Rid W=1 warnings in SCSI
From: Martin K. Petersen @ 2021-03-25  3:53 UTC (permalink / raw)
  To: Lee Jones
  Cc: Tyrel Datwyler, Hannes Reinecke, Anil Ravindranath, Brian Macy,
	willy, Le Moal, David Chaw, Marvell, Jirka Hanika, Brian King,
	Artur Paszkiewicz, target-devel, Drew Eckhardt, Linda Xie,
	Ketan Mukadam, Paul Mackerras, linux-drivers, Dave Boutcher,
	Brian King, linux-scsi, Subbu Seetharaman, Sathya Prakash,
	Doug Ledford, Leonard N. Zubkoff, Christoph Hellwig,
	Nicholas A. Bellinger, Colin DeVilbiss, Karan Tilak Kumar,
	Badari Pulavarty, Alan Cox, Bryant G. Ly, Douglas Gilbert,
	Jamie Lenehan, MPT-FusionLinux.pdl, Matthew R. Ochs,
	MPT-FusionLinux.pdl, Eric Youngdale, Torben Mathiasen,
	Michael Cyr, dc395x, Satish Kharat, Suganath Prabu Subramani,
	James E.J. Bottomley, Luben Tuikov, Ali Akcaagac, Santiago Leon,
	Jitendra Bhivare, Manoj N. Kumar, Hannes Reinecke, Erich Chen,
	Dave Boutcher, Richard Gooch, Uma Krishnan, Sreekanth Reddy,
	C.L. Huang, Martin K . Petersen, Oliver Neukum, linux-kernel,
	Sesidhar Baddela, Bas Vermeulen, Alex Davis, Kurt Garloff,
	Shaun Tancheff, FUJITA Tomonori, linuxppc-dev, Linux GmbH
In-Reply-To: <20210317091230.2912389-1-lee.jones@linaro.org>

On Wed, 17 Mar 2021 09:11:54 +0000, Lee Jones wrote:

> This set is part of a larger effort attempting to clean-up W=1
> kernel builds, which are currently overwhelmingly riddled with
> niggly little warnings.
> 
> Lee Jones (36):
>   scsi: myrb: Demote non-conformant kernel-doc headers and fix others
>   scsi: ipr: Fix incorrect function names in their headers
>   scsi: mvumi: Fix formatting and doc-rot issues
>   scsi: sd_zbc: Place function name into header
>   scsi: pmcraid: Fix a whole host of kernel-doc issues
>   scsi: sd: Fix function name in header
>   scsi: aic94xx: aic94xx_dump: Correct misspelling of function
>     asd_dump_seq_state()
>   scsi: be2iscsi: be_main: Ensure function follows directly after its
>     header
>   scsi: dc395x: Fix some function param descriptions
>   scsi: initio: Fix a few kernel-doc misdemeanours
>   scsi: a100u2w: Fix some misnaming and formatting issues
>   scsi: myrs: Add missing ':' to make the kernel-doc checker happy
>   scsi: pmcraid: Correct function name pmcraid_show_adapter_id() in
>     header
>   scsi: mpt3sas: mpt3sas_scs: Fix a few kernel-doc issues
>   scsi: be2iscsi: be_main: Demote incomplete/non-conformant kernel-doc
>     header
>   scsi: isci: phy: Fix a few different kernel-doc related issues
>   scsi: fnic: fnic_scsi: Demote non-conformant kernel-doc headers
>   scsi: fnic: fnic_fcs: Kernel-doc headers must contain the function
>     name
>   scsi: isci: phy: Provide function name and demote non-conforming
>     header
>   scsi: isci: request: Fix a myriad of kernel-doc issues
>   scsi: isci: host: Fix bunch of kernel-doc related issues
>   scsi: isci: task: Demote non-conformant header and remove superfluous
>     param
>   scsi: isci: remote_node_table: Fix a bunch of kernel-doc misdemeanours
>   scsi: isci: remote_node_context: Fix one function header and demote a
>     couple more
>   scsi: isci: port_config: Fix a bunch of doc-rot and demote abuses
>   scsi: isci: remote_device: Fix a bunch of doc-rot issues
>   scsi: isci: request: Fix doc-rot issue relating to 'ireq' param
>   scsi: isci: port: Fix a bunch of kernel-doc issues
>   scsi: isci: remote_node_context: Demote kernel-doc abuse
>   scsi: isci: remote_node_table: Provide some missing params and remove
>     others
>   scsi: cxlflash: main: Fix a little do-rot
>   scsi: cxlflash: superpipe: Fix a few misnaming issues
>   scsi: ibmvscsi: Fix a bunch of kernel-doc related issues
>   scsi: ibmvscsi: ibmvfc: Fix a bunch of misdocumentation
>   scsi: ibmvscsi_tgt: ibmvscsi_tgt: Remove duplicate section 'NOTE'
>   scsi: cxlflash: vlun: Fix some misnaming related doc-rot
> 
> [...]

Applied to 5.13/scsi-queue, thanks!

[01/36] scsi: myrb: Demote non-conformant kernel-doc headers and fix others
        https://git.kernel.org/mkp/scsi/c/12a1b740f225
[02/36] scsi: ipr: Fix incorrect function names in their headers
        https://git.kernel.org/mkp/scsi/c/637b5c3ebc1c
[03/36] scsi: mvumi: Fix formatting and doc-rot issues
        https://git.kernel.org/mkp/scsi/c/5ccd626516e1
[04/36] scsi: sd_zbc: Place function name into header
        https://git.kernel.org/mkp/scsi/c/59863cb53d80
[05/36] scsi: pmcraid: Fix a whole host of kernel-doc issues
        https://git.kernel.org/mkp/scsi/c/3673b7b0007b
[06/36] scsi: sd: Fix function name in header
        https://git.kernel.org/mkp/scsi/c/ad907c54e36f
[07/36] scsi: aic94xx: aic94xx_dump: Correct misspelling of function asd_dump_seq_state()
        https://git.kernel.org/mkp/scsi/c/3e2f4679ea03
[08/36] scsi: be2iscsi: be_main: Ensure function follows directly after its header
        https://git.kernel.org/mkp/scsi/c/f1d50e8ee5c9
[09/36] scsi: dc395x: Fix some function param descriptions
        https://git.kernel.org/mkp/scsi/c/33c8ef953ece
[10/36] scsi: initio: Fix a few kernel-doc misdemeanours
        https://git.kernel.org/mkp/scsi/c/100ec495e01e
[11/36] scsi: a100u2w: Fix some misnaming and formatting issues
        https://git.kernel.org/mkp/scsi/c/c548a6250627
[12/36] scsi: myrs: Add missing ':' to make the kernel-doc checker happy
        https://git.kernel.org/mkp/scsi/c/9eb292eb2ef7
[13/36] scsi: pmcraid: Correct function name pmcraid_show_adapter_id() in header
        https://git.kernel.org/mkp/scsi/c/a364a147b1dc
[14/36] scsi: mpt3sas: mpt3sas_scs: Fix a few kernel-doc issues
        https://git.kernel.org/mkp/scsi/c/a8d548b0b3ee
[15/36] scsi: be2iscsi: be_main: Demote incomplete/non-conformant kernel-doc header
        https://git.kernel.org/mkp/scsi/c/a90a8c607570
[16/36] scsi: isci: phy: Fix a few different kernel-doc related issues
        https://git.kernel.org/mkp/scsi/c/6af1d9bd9051
[17/36] scsi: fnic: fnic_scsi: Demote non-conformant kernel-doc headers
        https://git.kernel.org/mkp/scsi/c/c7eab0704c30
[18/36] scsi: fnic: fnic_fcs: Kernel-doc headers must contain the function name
        https://git.kernel.org/mkp/scsi/c/2efd8631d6a5
[19/36] scsi: isci: phy: Provide function name and demote non-conforming header
        https://git.kernel.org/mkp/scsi/c/6ab7ca5139b7
[20/36] scsi: isci: request: Fix a myriad of kernel-doc issues
        https://git.kernel.org/mkp/scsi/c/db35a0835357
[21/36] scsi: isci: host: Fix bunch of kernel-doc related issues
        https://git.kernel.org/mkp/scsi/c/44b7ca966128
[22/36] scsi: isci: task: Demote non-conformant header and remove superfluous param
        https://git.kernel.org/mkp/scsi/c/0afdee03f2e7
[23/36] scsi: isci: remote_node_table: Fix a bunch of kernel-doc misdemeanours
        https://git.kernel.org/mkp/scsi/c/103d61927ed3
[24/36] scsi: isci: remote_node_context: Fix one function header and demote a couple more
        https://git.kernel.org/mkp/scsi/c/ad276048f1bc
[25/36] scsi: isci: port_config: Fix a bunch of doc-rot and demote abuses
        https://git.kernel.org/mkp/scsi/c/29faa5ce26ae
[26/36] scsi: isci: remote_device: Fix a bunch of doc-rot issues
        https://git.kernel.org/mkp/scsi/c/242e15d7a4f4
[27/36] scsi: isci: request: Fix doc-rot issue relating to 'ireq' param
        https://git.kernel.org/mkp/scsi/c/a8604e44514d
[28/36] scsi: isci: port: Fix a bunch of kernel-doc issues
        https://git.kernel.org/mkp/scsi/c/7292a8b039c5
[29/36] scsi: isci: remote_node_context: Demote kernel-doc abuse
        https://git.kernel.org/mkp/scsi/c/d2d480f132e8
[30/36] scsi: isci: remote_node_table: Provide some missing params and remove others
        https://git.kernel.org/mkp/scsi/c/188f513dd22c
[31/36] scsi: cxlflash: main: Fix a little do-rot
        https://git.kernel.org/mkp/scsi/c/cf0ad7a15ac5
[32/36] scsi: cxlflash: superpipe: Fix a few misnaming issues
        https://git.kernel.org/mkp/scsi/c/32b3edfd28f8
[33/36] scsi: ibmvscsi: Fix a bunch of kernel-doc related issues
        https://git.kernel.org/mkp/scsi/c/841d7df0d416
[34/36] scsi: ibmvscsi: ibmvfc: Fix a bunch of misdocumentation
        https://git.kernel.org/mkp/scsi/c/dd9c77297148
[35/36] scsi: ibmvscsi_tgt: ibmvscsi_tgt: Remove duplicate section 'NOTE'
        https://git.kernel.org/mkp/scsi/c/cba3ebfc008e
[36/36] scsi: cxlflash: vlun: Fix some misnaming related doc-rot
        https://git.kernel.org/mkp/scsi/c/a690baa47fd1

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply

* RE: [PATCH 15/17] iommu: remove DOMAIN_ATTR_NESTING
From: Tian, Kevin @ 2021-03-25  6:12 UTC (permalink / raw)
  To: Auger Eric, Christoph Hellwig
  Cc: freedreno@lists.freedesktop.org, Liu, Yi L, kvm@vger.kernel.org,
	Will Deacon, linux-arm-msm@vger.kernel.org,
	dri-devel@lists.freedesktop.org, Li Yang,
	iommu@lists.linux-foundation.org, netdev@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	linuxppc-dev@lists.ozlabs.org, David Woodhouse,
	linux-arm-kernel@lists.infradead.org
In-Reply-To: <3a1194de-a053-84dd-3d6a-bff8e01ebcd3@redhat.com>

> From: Auger Eric
> Sent: Monday, March 15, 2021 3:52 PM
> To: Christoph Hellwig <hch@lst.de>
> Cc: kvm@vger.kernel.org; Will Deacon <will@kernel.org>; linuxppc-
> dev@lists.ozlabs.org; dri-devel@lists.freedesktop.org; Li Yang
> <leoyang.li@nxp.com>; iommu@lists.linux-foundation.org;
> 
> Hi Christoph,
> 
> On 3/14/21 4:58 PM, Christoph Hellwig wrote:
> > On Sun, Mar 14, 2021 at 11:44:52AM +0100, Auger Eric wrote:
> >> As mentionned by Robin, there are series planning to use
> >> DOMAIN_ATTR_NESTING to get info about the nested caps of the iommu
> (ARM
> >> and Intel):
> >>
> >> [Patch v8 00/10] vfio: expose virtual Shared Virtual Addressing to VMs
> >> patches 1, 2, 3
> >>
> >> Is the plan to introduce a new domain_get_nesting_info ops then?
> >
> > The plan as usual would be to add it the series adding that support.
> > Not sure what the merge plans are - if the series is ready to be
> > merged I could rebase on top of it, otherwise that series will need
> > to add the method.
> OK I think your series may be upstreamed first.
> 

Agree. The vSVA series is still undergoing a refactor according to Jason's
comment thus won't be ready in short term. It's better to let this one
go in first.

Thanks
Kevin

^ permalink raw reply

* Re: [PATCH 15/17] iommu: remove DOMAIN_ATTR_NESTING
From: Christoph Hellwig @ 2021-03-25  6:51 UTC (permalink / raw)
  To: Tian, Kevin
  Cc: freedreno@lists.freedesktop.org, Liu, Yi L, kvm@vger.kernel.org,
	Will Deacon, linux-arm-msm@vger.kernel.org,
	dri-devel@lists.freedesktop.org, Li Yang, Auger Eric,
	iommu@lists.linux-foundation.org, David Woodhouse,
	netdev@vger.kernel.org, virtualization@lists.linux-foundation.org,
	linuxppc-dev@lists.ozlabs.org, Christoph Hellwig,
	linux-arm-kernel@lists.infradead.org
In-Reply-To: <MWHPR11MB188688125518D050E384658F8C629@MWHPR11MB1886.namprd11.prod.outlook.com>

On Thu, Mar 25, 2021 at 06:12:37AM +0000, Tian, Kevin wrote:
> Agree. The vSVA series is still undergoing a refactor according to Jason's
> comment thus won't be ready in short term. It's better to let this one
> go in first.

Would be great to get a few more reviews while we're at it :)

^ permalink raw reply

* Re: [PATCH V3 -next] powerpc: kernel/time.c - cleanup warnings
From: Alexandre Belloni @ 2021-03-25  8:45 UTC (permalink / raw)
  To: heying (H)
  Cc: linux-rtc, a.zummo, geert+renesas, peterz, frederic, linux-kernel,
	npiggin, kernelfans, paulus, geert, tglx, msuchanek, linuxppc-dev
In-Reply-To: <18a8d444-f1a5-61e0-b9f2-f85c03d71686@huawei.com>

On 24/03/2021 17:46:19+0800, heying (H) wrote:
> Many thanks for your suggestion. As you suggest, rtc_lock should be local to
> platforms.
> 
> Does it mean not only powerpc but also all other platforms should adapt this
> change?

Not all the other ones, in the current state, x86 still needs it. I'll
work on that. Again, the patch is fine as is.

Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com>



-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply

* [PATCH v2] pseries: prevent free CPU ids to be reused on another node
From: Laurent Dufour @ 2021-03-25  9:35 UTC (permalink / raw)
  To: mpe, benh, paulus; +Cc: nathanl, cheloha, linuxppc-dev, linux-kernel

When a CPU is hot added, the CPU ids are taken from the available mask from
the lower possible set. If that set of values was previously used for CPU
attached to a different node, this seems to application like if these CPUs
have migrated from a node to another one which is not expected in real
life.

To prevent this, it is needed to record the CPU ids used for each node and
to not reuse them on another node. However, to prevent CPU hot plug to
fail, in the case the CPU ids is starved on a node, the capability to reuse
other nodes’ free CPU ids is kept. A warning is displayed in such a case
to warn the user.

A new CPU bit mask (node_recorded_ids_map) is introduced for each possible
node. It is populated with the CPU onlined at boot time, and then when a
CPU is hot plug to a node. The bits in that mask remain when the CPU is hot
unplugged, to remind this CPU ids have been used for this node.

If no id set was found, a retry is made without removing the ids used on
the other nodes to try reusing them. This is the way ids have been
allocated prior to this patch.

The effect of this patch can be seen by removing and adding CPUs using the
Qemu monitor. In the following case, the first CPU from the node 2 is
removed, then the first one from the node 1 is removed too. Later, the
first CPU of the node 2 is added back. Without that patch, the kernel will
numbered these CPUs using the first CPU ids available which are the ones
freed when removing the second CPU of the node 0. This leads to the CPU ids
16-23 to move from the node 1 to the node 2. With the patch applied, the
CPU ids 32-39 are used since they are the lowest free ones which have not
been used on another node.

At boot time:
[root@vm40 ~]# numactl -H | grep cpus
node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
node 1 cpus: 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
node 2 cpus: 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

Vanilla kernel, after the CPU hot unplug/plug operations:
[root@vm40 ~]# numactl -H | grep cpus
node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
node 1 cpus: 24 25 26 27 28 29 30 31
node 2 cpus: 16 17 18 19 20 21 22 23 40 41 42 43 44 45 46 47

Patched kernel, after the CPU hot unplug/plug operations:
[root@vm40 ~]# numactl -H | grep cpus
node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
node 1 cpus: 24 25 26 27 28 29 30 31
node 2 cpus: 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

Changes since V1 (no functional changes):
 - update the test's output in the commit's description
 - node_recorded_ids_map should be static

Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
---
 arch/powerpc/platforms/pseries/hotplug-cpu.c | 83 ++++++++++++++++++--
 1 file changed, 76 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 12cbffd3c2e3..48c7943b25b0 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -39,6 +39,8 @@
 /* This version can't take the spinlock, because it never returns */
 static int rtas_stop_self_token = RTAS_UNKNOWN_SERVICE;
 
+static cpumask_var_t node_recorded_ids_map[MAX_NUMNODES];
+
 static void rtas_stop_self(void)
 {
 	static struct rtas_args args;
@@ -151,29 +153,61 @@ static void pseries_cpu_die(unsigned int cpu)
  */
 static int pseries_add_processor(struct device_node *np)
 {
-	unsigned int cpu;
+	unsigned int cpu, node;
 	cpumask_var_t candidate_mask, tmp;
-	int err = -ENOSPC, len, nthreads, i;
+	int err = -ENOSPC, len, nthreads, i, nid;
 	const __be32 *intserv;
+	bool force_reusing = false;
 
 	intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", &len);
 	if (!intserv)
 		return 0;
 
-	zalloc_cpumask_var(&candidate_mask, GFP_KERNEL);
-	zalloc_cpumask_var(&tmp, GFP_KERNEL);
+	alloc_cpumask_var(&candidate_mask, GFP_KERNEL);
+	alloc_cpumask_var(&tmp, GFP_KERNEL);
+
+	/*
+	 * Fetch from the DT nodes read by dlpar_configure_connector() the NUMA
+	 * node id the added CPU belongs to.
+	 */
+	nid = of_node_to_nid(np);
+	if (nid < 0 || !node_possible(nid))
+		nid = first_online_node;
 
 	nthreads = len / sizeof(u32);
-	for (i = 0; i < nthreads; i++)
-		cpumask_set_cpu(i, tmp);
 
 	cpu_maps_update_begin();
 
 	BUG_ON(!cpumask_subset(cpu_present_mask, cpu_possible_mask));
 
+again:
+	cpumask_clear(candidate_mask);
+	cpumask_clear(tmp);
+	for (i = 0; i < nthreads; i++)
+		cpumask_set_cpu(i, tmp);
+
 	/* Get a bitmap of unoccupied slots. */
 	cpumask_xor(candidate_mask, cpu_possible_mask, cpu_present_mask);
+
+	/*
+	 * Remove free ids previously assigned on the other nodes. We can walk
+	 * only online nodes because once a node became online it is not turned
+	 * offlined back.
+	 */
+	if (!force_reusing)
+		for_each_online_node(node) {
+			if (node == nid) /* Keep our node's recorded ids */
+				continue;
+			cpumask_andnot(candidate_mask, candidate_mask,
+				       node_recorded_ids_map[node]);
+		}
+
 	if (cpumask_empty(candidate_mask)) {
+		if (!force_reusing) {
+			force_reusing = true;
+			goto again;
+		}
+
 		/* If we get here, it most likely means that NR_CPUS is
 		 * less than the partition's max processors setting.
 		 */
@@ -191,12 +225,36 @@ static int pseries_add_processor(struct device_node *np)
 			cpumask_shift_left(tmp, tmp, nthreads);
 
 	if (cpumask_empty(tmp)) {
+		if (!force_reusing) {
+			force_reusing = true;
+			goto again;
+		}
 		printk(KERN_ERR "Unable to find space in cpu_present_mask for"
 		       " processor %pOFn with %d thread(s)\n", np,
 		       nthreads);
 		goto out_unlock;
 	}
 
+	/* Record the newly used CPU ids for the associate node. */
+	cpumask_or(node_recorded_ids_map[nid], node_recorded_ids_map[nid], tmp);
+
+	/*
+	 * If we force reusing the id, remove these ids from any node which was
+	 * previously using it.
+	 */
+	if (force_reusing) {
+		cpu = cpumask_first(tmp);
+		pr_warn("Reusing free CPU ids %d-%d from another node\n",
+			cpu, cpu + nthreads - 1);
+
+		for_each_online_node(node) {
+			if (node == nid)
+				continue;
+			cpumask_andnot(node_recorded_ids_map[node],
+				       node_recorded_ids_map[node], tmp);
+		}
+	}
+
 	for_each_cpu(cpu, tmp) {
 		BUG_ON(cpu_present(cpu));
 		set_cpu_present(cpu, true);
@@ -889,6 +947,7 @@ static struct notifier_block pseries_smp_nb = {
 static int __init pseries_cpu_hotplug_init(void)
 {
 	int qcss_tok;
+	unsigned int node;
 
 #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
 	ppc_md.cpu_probe = dlpar_cpu_probe;
@@ -910,8 +969,18 @@ static int __init pseries_cpu_hotplug_init(void)
 	smp_ops->cpu_die = pseries_cpu_die;
 
 	/* Processors can be added/removed only on LPAR */
-	if (firmware_has_feature(FW_FEATURE_LPAR))
+	if (firmware_has_feature(FW_FEATURE_LPAR)) {
+		for_each_node(node) {
+			alloc_bootmem_cpumask_var(&node_recorded_ids_map[node]);
+
+			/* Record ids of CPU added at boot time */
+			cpumask_or(node_recorded_ids_map[node],
+				   node_recorded_ids_map[node],
+				   node_to_cpumask_map[node]);
+		}
+
 		of_reconfig_notifier_register(&pseries_smp_nb);
+	}
 
 	return 0;
 }
-- 
2.31.0


^ permalink raw reply related

* Re: [PATCH v2 6/7] cmdline: Gives architectures opportunity to use generically defined boot cmdline manipulation
From: Christophe Leroy @ 2021-03-25 11:18 UTC (permalink / raw)
  To: Will Deacon
  Cc: linux-arch, robh, daniel, devicetree, linux-kernel,
	Paul Mackerras, linuxppc-dev, danielwa
In-Reply-To: <20210303175747.GD19713@willie-the-truck>



Le 03/03/2021 à 18:57, Will Deacon a écrit :
> On Tue, Mar 02, 2021 at 05:25:22PM +0000, Christophe Leroy wrote:
>> Most architectures have similar boot command line manipulation
>> options. This patchs adds the definition in init/Kconfig, gated by
>> CONFIG_HAVE_CMDLINE that the architectures can select to use them.
>>
>> In order to use this, a few architectures will have to change their
>> CONFIG options:
>> - riscv has to replace CMDLINE_FALLBACK by CMDLINE_FROM_BOOTLOADER
>> - architectures using CONFIG_CMDLINE_OVERRIDE or
>> CONFIG_CMDLINE_OVERWRITE have to replace them by CONFIG_CMDLINE_FORCE.
>>
>> Architectures also have to define CONFIG_DEFAULT_CMDLINE.
>>
>> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
>> ---
>>   init/Kconfig | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 56 insertions(+)
>>
>> diff --git a/init/Kconfig b/init/Kconfig
>> index 22946fe5ded9..a0f2ad9467df 100644
>> --- a/init/Kconfig
>> +++ b/init/Kconfig
>> @@ -117,6 +117,62 @@ config INIT_ENV_ARG_LIMIT
>>   	  Maximum of each of the number of arguments and environment
>>   	  variables passed to init from the kernel command line.
>>   
>> +config HAVE_CMDLINE
>> +	bool
>> +
>> +config CMDLINE_BOOL
>> +	bool "Default bootloader kernel arguments"
>> +	depends on HAVE_CMDLINE
>> +	help
>> +	  On some platforms, there is currently no way for the boot loader to
>> +	  pass arguments to the kernel. For these platforms, you can supply
>> +	  some command-line options at build time by entering them here.  In
>> +	  most cases you will need to specify the root device here.
> 
> Why is this needed as well as CMDLINE_FROM_BOOTLOADER? IIUC, the latter
> will use CONFIG_CMDLINE if it fails to get anything from the bootloader,
> which sounds like the same scenario.
> 
>> +config CMDLINE
>> +	string "Initial kernel command string"
> 
> s/Initial/Default
> 
> which is then consistent with the rest of the text here.
> 
>> +	depends on CMDLINE_BOOL
> 
> Ah, so this is a bit different and I don't think lines-up with the
> CMDLINE_BOOL help text.
> 
>> +	default DEFAULT_CMDLINE
>> +	help
>> +	  On some platforms, there is currently no way for the boot loader to
>> +	  pass arguments to the kernel. For these platforms, you can supply
>> +	  some command-line options at build time by entering them here.  In
>> +	  most cases you will need to specify the root device here.
> 
> (same stale text)
> 
>> +choice
>> +	prompt "Kernel command line type" if CMDLINE != ""
>> +	default CMDLINE_FROM_BOOTLOADER
>> +	help
>> +	  Selects the way you want to use the default kernel arguments.
> 
> How about:
> 
> "Determines how the default kernel arguments are combined with any
>   arguments passed by the bootloader"
> 
>> +config CMDLINE_FROM_BOOTLOADER
>> +	bool "Use bootloader kernel arguments if available"
>> +	help
>> +	  Uses the command-line options passed by the boot loader. If
>> +	  the boot loader doesn't provide any, the default kernel command
>> +	  string provided in CMDLINE will be used.
>> +
>> +config CMDLINE_EXTEND
> 
> Can we rename this to CMDLINE_APPEND, please? There is code in the tree
> which disagrees about what CMDLINE_EXTEND means, so that will need be
> to be updated to be consistent (e.g. the EFI stub parsing order). Having
> the generic option with a different name means we won't accidentally end
> up with the same inconsistent behaviours.

Argh, yes. Seems like the problem is even larger than that IIUC:

- For ARM it means to append the bootloader arguments to the CONFIG_CMDLINE
- For Powerpc it means to append the CONFIG_CMDLINE to the bootloader arguments
- For SH  it means to append the CONFIG_CMDLINE to the bootloader arguments
- For EFI it means to append the bootloader arguments to the CONFIG_CMDLINE
- For OF it means to append the CONFIG_CMDLINE to the bootloader arguments

So what happens on ARM for instance when it selects CONFIG_OF for instance ?
Or should we consider that EXTEND means APPEND or PREPEND, no matter which ?
Because EXTEND is for instance used for:

	config INITRAMFS_FORCE
		bool "Ignore the initramfs passed by the bootloader"
		depends on CMDLINE_EXTEND || CMDLINE_FORCE


Christophe

^ permalink raw reply

* [PATCH AUTOSEL 5.11 22/44] powerpc: Force inlining of cpu_has_feature() to avoid build failure
From: Sasha Levin @ 2021-03-25 11:24 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Sasha Levin, linuxppc-dev
In-Reply-To: <20210325112459.1926846-1-sashal@kernel.org>

From: Christophe Leroy <christophe.leroy@csgroup.eu>

[ Upstream commit eed5fae00593ab9d261a0c1ffc1bdb786a87a55a ]

The code relies on constant folding of cpu_has_feature() based
on possible and always true values as defined per
CPU_FTRS_ALWAYS and CPU_FTRS_POSSIBLE.

Build failure is encountered with for instance
book3e_all_defconfig on kisskb in the AMDGPU driver which uses
cpu_has_feature(CPU_FTR_VSX_COMP) to decide whether calling
kernel_enable_vsx() or not.

The failure is due to cpu_has_feature() not being inlined with
that configuration with gcc 4.9.

In the same way as commit acdad8fb4a15 ("powerpc: Force inlining of
mmu_has_feature to fix build failure"), for inlining of
cpu_has_feature().

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/b231dfa040ce4cc37f702f5c3a595fdeabfe0462.1615378209.git.christophe.leroy@csgroup.eu
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/include/asm/cpu_has_feature.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/cpu_has_feature.h b/arch/powerpc/include/asm/cpu_has_feature.h
index 7897d16e0990..727d4b321937 100644
--- a/arch/powerpc/include/asm/cpu_has_feature.h
+++ b/arch/powerpc/include/asm/cpu_has_feature.h
@@ -7,7 +7,7 @@
 #include <linux/bug.h>
 #include <asm/cputable.h>
 
-static inline bool early_cpu_has_feature(unsigned long feature)
+static __always_inline bool early_cpu_has_feature(unsigned long feature)
 {
 	return !!((CPU_FTRS_ALWAYS & feature) ||
 		  (CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature));
@@ -46,7 +46,7 @@ static __always_inline bool cpu_has_feature(unsigned long feature)
 	return static_branch_likely(&cpu_feature_keys[i]);
 }
 #else
-static inline bool cpu_has_feature(unsigned long feature)
+static __always_inline bool cpu_has_feature(unsigned long feature)
 {
 	return early_cpu_has_feature(feature);
 }
-- 
2.30.1


^ permalink raw reply related

* [PATCH AUTOSEL 5.10 21/39] powerpc: Force inlining of cpu_has_feature() to avoid build failure
From: Sasha Levin @ 2021-03-25 11:25 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Sasha Levin, linuxppc-dev
In-Reply-To: <20210325112558.1927423-1-sashal@kernel.org>

From: Christophe Leroy <christophe.leroy@csgroup.eu>

[ Upstream commit eed5fae00593ab9d261a0c1ffc1bdb786a87a55a ]

The code relies on constant folding of cpu_has_feature() based
on possible and always true values as defined per
CPU_FTRS_ALWAYS and CPU_FTRS_POSSIBLE.

Build failure is encountered with for instance
book3e_all_defconfig on kisskb in the AMDGPU driver which uses
cpu_has_feature(CPU_FTR_VSX_COMP) to decide whether calling
kernel_enable_vsx() or not.

The failure is due to cpu_has_feature() not being inlined with
that configuration with gcc 4.9.

In the same way as commit acdad8fb4a15 ("powerpc: Force inlining of
mmu_has_feature to fix build failure"), for inlining of
cpu_has_feature().

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/b231dfa040ce4cc37f702f5c3a595fdeabfe0462.1615378209.git.christophe.leroy@csgroup.eu
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/include/asm/cpu_has_feature.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/cpu_has_feature.h b/arch/powerpc/include/asm/cpu_has_feature.h
index 7897d16e0990..727d4b321937 100644
--- a/arch/powerpc/include/asm/cpu_has_feature.h
+++ b/arch/powerpc/include/asm/cpu_has_feature.h
@@ -7,7 +7,7 @@
 #include <linux/bug.h>
 #include <asm/cputable.h>
 
-static inline bool early_cpu_has_feature(unsigned long feature)
+static __always_inline bool early_cpu_has_feature(unsigned long feature)
 {
 	return !!((CPU_FTRS_ALWAYS & feature) ||
 		  (CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature));
@@ -46,7 +46,7 @@ static __always_inline bool cpu_has_feature(unsigned long feature)
 	return static_branch_likely(&cpu_feature_keys[i]);
 }
 #else
-static inline bool cpu_has_feature(unsigned long feature)
+static __always_inline bool cpu_has_feature(unsigned long feature)
 {
 	return early_cpu_has_feature(feature);
 }
-- 
2.30.1


^ permalink raw reply related

* [PATCH AUTOSEL 5.4 15/24] powerpc: Force inlining of cpu_has_feature() to avoid build failure
From: Sasha Levin @ 2021-03-25 11:26 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: Sasha Levin, linuxppc-dev
In-Reply-To: <20210325112651.1927828-1-sashal@kernel.org>

From: Christophe Leroy <christophe.leroy@csgroup.eu>

[ Upstream commit eed5fae00593ab9d261a0c1ffc1bdb786a87a55a ]

The code relies on constant folding of cpu_has_feature() based
on possible and always true values as defined per
CPU_FTRS_ALWAYS and CPU_FTRS_POSSIBLE.

Build failure is encountered with for instance
book3e_all_defconfig on kisskb in the AMDGPU driver which uses
cpu_has_feature(CPU_FTR_VSX_COMP) to decide whether calling
kernel_enable_vsx() or not.

The failure is due to cpu_has_feature() not being inlined with
that configuration with gcc 4.9.

In the same way as commit acdad8fb4a15 ("powerpc: Force inlining of
mmu_has_feature to fix build failure"), for inlining of
cpu_has_feature().

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/b231dfa040ce4cc37f702f5c3a595fdeabfe0462.1615378209.git.christophe.leroy@csgroup.eu
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/include/asm/cpu_has_feature.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/cpu_has_feature.h b/arch/powerpc/include/asm/cpu_has_feature.h
index 7897d16e0990..727d4b321937 100644
--- a/arch/powerpc/include/asm/cpu_has_feature.h
+++ b/arch/powerpc/include/asm/cpu_has_feature.h
@@ -7,7 +7,7 @@
 #include <linux/bug.h>
 #include <asm/cputable.h>
 
-static inline bool early_cpu_has_feature(unsigned long feature)
+static __always_inline bool early_cpu_has_feature(unsigned long feature)
 {
 	return !!((CPU_FTRS_ALWAYS & feature) ||
 		  (CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature));
@@ -46,7 +46,7 @@ static __always_inline bool cpu_has_feature(unsigned long feature)
 	return static_branch_likely(&cpu_feature_keys[i]);
 }
 #else
-static inline bool cpu_has_feature(unsigned long feature)
+static __always_inline bool cpu_has_feature(unsigned long feature)
 {
 	return early_cpu_has_feature(feature);
 }
-- 
2.30.1


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox