[PATCH V4 3/3] skiboot: Update IMC PMU node names for power10

2023-03-05 Thread Athira Rajeev
The nest IMC (In Memory Collection) Performance Monitoring Unit(PMU) node names are saved as "struct nest_pmus_struct" in the "hw/imc.c" IMC code. Not all the IMC PMUs listed in the device tree may be available. Nest IMC PMU names along with their bit values is represented in imc availability

[PATCH V4 2/3] skiboot: Update IMC code to use dt_find_by_name_substr for checking dt nodes

2023-03-05 Thread Athira Rajeev
The nest IMC (In Memory Collection) Performance Monitoring Unit(PMU) node names are saved in nest_pmus[] array in the "hw/imc.c" IMC code. Not all the IMC PMUs listed in the device tree may be available. Nest IMC PMU names along with their bit values is represented in imc availability vector. The

[PATCH V4 1/3] core/device: Add function to return child node using name at substring "@"

2023-03-05 Thread Athira Rajeev
Add a function dt_find_by_name_substr() that returns the child node if it matches till first occurence at "@" of a given name, otherwise NULL. This is helpful for cases with node name like: "name@addr". In scenarios where nodes are added with "name@addr" format and if the value of "addr" is not

[PATCH 10/10] perf/ring_buffer: use local_try_cmpxchg in __perf_output_begin

2023-03-05 Thread Uros Bizjak
Use local_try_cmpxchg instead of local_cmpxchg (*ptr, old, new) == old in __perf_output_begin. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg. Also, local_try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails. There is no need

[PATCH 09/10] locking/x86: Enable local{,64}_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Enable local_try_cmpxchg and also local64_try_cmpxchg for x86_64. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Signed-off-by: Uros Bizjak --- arch/x86/include/asm/cmpxchg.h | 6 ++ 1 file changed, 6 insertions(+) diff --git

[PATCH 08/10] locking/generic: Wire up local{,64}_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Implement generic support for local{,64}_try_cmpxchg. Cc: Arnd Bergmann Signed-off-by: Uros Bizjak --- include/asm-generic/local.h | 1 + include/asm-generic/local64.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h index

[PATCH 06/10] locking/powerpc: Wire up local_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Implement target specific support for local_try_cmpxchg. Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Signed-off-by: Uros Bizjak Signed-off-by: Uros Bizjak --- arch/powerpc/include/asm/local.h | 11 +++ 1 file changed, 11 insertions(+) diff --git

[PATCH 07/10] locking/x86: Wire up local_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Implement target specific support for local_try_cmpxchg. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Signed-off-by: Uros Bizjak --- arch/x86/include/asm/local.h | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH 05/10] locking/mips: Wire up local_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Implement target specific support for local_try_cmpxchg. Cc: Thomas Bogendoerfer Signed-off-by: Uros Bizjak --- arch/mips/include/asm/local.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/include/asm/local.h b/arch/mips/include/asm/local.h index 08366b1fd273..b611361a760b

[PATCH 04/10] locking/loongarch: Wire up local_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Implement target specific support for local_try_cmpxchg. Cc: Huacai Chen Cc: WANG Xuerui Cc: Jiaxun Yang Cc: Jun Yi Signed-off-by: Uros Bizjak --- arch/loongarch/include/asm/local.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/loongarch/include/asm/local.h

[PATCH 03/10] locking/alpha: Wire up local_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Implement target specific support for local_try_cmpxchg. Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Signed-off-by: Uros Bizjak --- arch/alpha/include/asm/local.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/alpha/include/asm/local.h

[PATCH 02/10] locking/atomic: Add generic try_cmpxchg{,64}_local support

2023-03-05 Thread Uros Bizjak
Add generic support for try_cmpxchg{,64}_local and their falbacks. Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland Signed-off-by: Uros Bizjak --- include/linux/atomic/atomic-arch-fallback.h | 24 - include/linux/atomic/atomic-instrumented.h | 20

[PATCH 01/10] locking/atomic: Add missing cast to try_cmpxchg() fallbacks

2023-03-05 Thread Uros Bizjak
Cast _oldp to the type of _ptr to avoid incompatible-pointer-types warning. Fixes: 29f006fdefe6 ("asm-generic/atomic: Add try_cmpxchg() fallbacks") Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: Mark Rutland Signed-off-by: Uros Bizjak --- include/linux/atomic/atomic-arch-fallback.h |

[PATCH 00/10] locking: Introduce local{,64}_try_cmpxchg

2023-03-05 Thread Uros Bizjak
Add generic and target specific support for local{,64}_try_cmpxchg and wire up support for all targets that use local_t infrastructure. The patch enables x86 targets to emit special instruction for local_try_cmpxchg and also local64_try_cmpxchg for x86_64. The last patch changes

Re: [PATCH v3 2/2] arch/*/io.h: remove ioremap_uc in some architectures

2023-03-05 Thread Arnd Bergmann
On Sun, Mar 5, 2023, at 10:29, Geert Uytterhoeven wrote: > > On Sun, Mar 5, 2023 at 10:23 AM Michael Ellerman wrote: >> Maybe that exact code path is only reachable on x86/ia64? But if so >> please explain why. >> >> Otherwise it looks like this series could break that driver on powerpc >> at

[PATCH AUTOSEL 4.14 4/6] macintosh: windfarm: Use unsigned type for 1-bit bitfields

2023-03-05 Thread Sasha Levin
From: Nathan Chancellor [ Upstream commit 748ea32d2dbd813d3bd958117bde5191182f909a ] Clang warns: drivers/macintosh/windfarm_lm75_sensor.c:63:14: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]

[PATCH AUTOSEL 4.19 4/6] macintosh: windfarm: Use unsigned type for 1-bit bitfields

2023-03-05 Thread Sasha Levin
From: Nathan Chancellor [ Upstream commit 748ea32d2dbd813d3bd958117bde5191182f909a ] Clang warns: drivers/macintosh/windfarm_lm75_sensor.c:63:14: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]

[PATCH AUTOSEL 5.4 5/7] macintosh: windfarm: Use unsigned type for 1-bit bitfields

2023-03-05 Thread Sasha Levin
From: Nathan Chancellor [ Upstream commit 748ea32d2dbd813d3bd958117bde5191182f909a ] Clang warns: drivers/macintosh/windfarm_lm75_sensor.c:63:14: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]

[PATCH AUTOSEL 5.4 3/7] powerpc: Check !irq instead of irq == NO_IRQ and remove NO_IRQ

2023-03-05 Thread Sasha Levin
From: Christophe Leroy [ Upstream commit bab537805a10bdbf55b31324ba4a9599e0651e5e ] NO_IRQ is a relic from the old days. It is not used anymore in core functions. By the way, function irq_of_parse_and_map() returns value 0 on error. In some drivers, NO_IRQ is erroneously used to check the

[PATCH AUTOSEL 5.10 6/8] macintosh: windfarm: Use unsigned type for 1-bit bitfields

2023-03-05 Thread Sasha Levin
From: Nathan Chancellor [ Upstream commit 748ea32d2dbd813d3bd958117bde5191182f909a ] Clang warns: drivers/macintosh/windfarm_lm75_sensor.c:63:14: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]

[PATCH AUTOSEL 5.10 4/8] powerpc/kcsan: Exclude udelay to prevent recursive instrumentation

2023-03-05 Thread Sasha Levin
From: Rohan McLure [ Upstream commit 2a7ce82dc46c591c9244057d89a6591c9639b9b9 ] In order for KCSAN to increase its likelihood of observing a data race, it sets a watchpoint on memory accesses and stalls, allowing for detection of conflicting accesses by other kernel threads or interrupts.

[PATCH AUTOSEL 5.10 3/8] powerpc: Check !irq instead of irq == NO_IRQ and remove NO_IRQ

2023-03-05 Thread Sasha Levin
From: Christophe Leroy [ Upstream commit bab537805a10bdbf55b31324ba4a9599e0651e5e ] NO_IRQ is a relic from the old days. It is not used anymore in core functions. By the way, function irq_of_parse_and_map() returns value 0 on error. In some drivers, NO_IRQ is erroneously used to check the

[PATCH AUTOSEL 5.15 7/9] macintosh: windfarm: Use unsigned type for 1-bit bitfields

2023-03-05 Thread Sasha Levin
From: Nathan Chancellor [ Upstream commit 748ea32d2dbd813d3bd958117bde5191182f909a ] Clang warns: drivers/macintosh/windfarm_lm75_sensor.c:63:14: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]

[PATCH AUTOSEL 5.15 5/9] powerpc/kcsan: Exclude udelay to prevent recursive instrumentation

2023-03-05 Thread Sasha Levin
From: Rohan McLure [ Upstream commit 2a7ce82dc46c591c9244057d89a6591c9639b9b9 ] In order for KCSAN to increase its likelihood of observing a data race, it sets a watchpoint on memory accesses and stalls, allowing for detection of conflicting accesses by other kernel threads or interrupts.

[PATCH AUTOSEL 5.15 4/9] powerpc/iommu: fix memory leak with using debugfs_lookup()

2023-03-05 Thread Sasha Levin
From: Greg Kroah-Hartman [ Upstream commit b505063910c134778202dfad9332dfcecb76bab3 ] When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things simpler, just call debugfs_lookup_and_remove() instead which handles all of the

[PATCH AUTOSEL 5.15 3/9] powerpc: Check !irq instead of irq == NO_IRQ and remove NO_IRQ

2023-03-05 Thread Sasha Levin
From: Christophe Leroy [ Upstream commit bab537805a10bdbf55b31324ba4a9599e0651e5e ] NO_IRQ is a relic from the old days. It is not used anymore in core functions. By the way, function irq_of_parse_and_map() returns value 0 on error. In some drivers, NO_IRQ is erroneously used to check the

[PATCH AUTOSEL 6.1 13/15] macintosh: windfarm: Use unsigned type for 1-bit bitfields

2023-03-05 Thread Sasha Levin
From: Nathan Chancellor [ Upstream commit 748ea32d2dbd813d3bd958117bde5191182f909a ] Clang warns: drivers/macintosh/windfarm_lm75_sensor.c:63:14: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]

[PATCH AUTOSEL 6.1 11/15] powerpc/kcsan: Exclude udelay to prevent recursive instrumentation

2023-03-05 Thread Sasha Levin
From: Rohan McLure [ Upstream commit 2a7ce82dc46c591c9244057d89a6591c9639b9b9 ] In order for KCSAN to increase its likelihood of observing a data race, it sets a watchpoint on memory accesses and stalls, allowing for detection of conflicting accesses by other kernel threads or interrupts.

[PATCH AUTOSEL 6.1 10/15] powerpc/64: Move paca allocation to early_setup()

2023-03-05 Thread Sasha Levin
From: Nicholas Piggin [ Upstream commit dc222fa7737212fe0da513e5b8937c156d02225d ] The early paca and boot cpuid dance is complicated and currently does not quite work as expected for boot cpuid != 0 cases. early_init_devtree() currently allocates the paca_ptrs and boot cpuid paca, but until

[PATCH AUTOSEL 6.1 08/15] powerpc/bpf/32: Only set a stack frame when necessary

2023-03-05 Thread Sasha Levin
From: Christophe Leroy [ Upstream commit d084dcf256bc4565b4b1af9b00297ac7b51c7049 ] Until now a stack frame was set at all time due to the need to keep tail call counter in the stack. But since commit 89d21e259a94 ("powerpc/bpf/32: Fix Oops on tail call tests") the tail call counter is passed

[PATCH AUTOSEL 6.1 09/15] powerpc/64: Fix task_cpu in early boot when booting non-zero cpuid

2023-03-05 Thread Sasha Levin
From: Nicholas Piggin [ Upstream commit 9fa24404f5044967753a6cd3e5e36f57686bec6e ] powerpc/64 can boot on a non-zero SMP processor id. Initially, the boot CPU is said to be "assumed to be 0" until early_init_devtree() discovers the id from the device tree. That is not a good description because

[PATCH AUTOSEL 6.1 06/15] powerpc/iommu: fix memory leak with using debugfs_lookup()

2023-03-05 Thread Sasha Levin
From: Greg Kroah-Hartman [ Upstream commit b505063910c134778202dfad9332dfcecb76bab3 ] When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things simpler, just call debugfs_lookup_and_remove() instead which handles all of the

[PATCH AUTOSEL 6.1 04/15] powerpc/64: Don't recurse irq replay

2023-03-05 Thread Sasha Levin
From: Nicholas Piggin [ Upstream commit 5746ca131e2496ccd5bb4d7a0244d6c38070cbf5 ] Interrupt handlers called by soft-pending irq replay code can run softirqs, softirq replay enables and disables local irqs, which allows interrupts to come in including soft-masked interrupts, and it can cause

[PATCH AUTOSEL 6.1 03/15] powerpc: Check !irq instead of irq == NO_IRQ and remove NO_IRQ

2023-03-05 Thread Sasha Levin
From: Christophe Leroy [ Upstream commit bab537805a10bdbf55b31324ba4a9599e0651e5e ] NO_IRQ is a relic from the old days. It is not used anymore in core functions. By the way, function irq_of_parse_and_map() returns value 0 on error. In some drivers, NO_IRQ is erroneously used to check the

[PATCH AUTOSEL 6.2 14/16] macintosh: windfarm: Use unsigned type for 1-bit bitfields

2023-03-05 Thread Sasha Levin
From: Nathan Chancellor [ Upstream commit 748ea32d2dbd813d3bd958117bde5191182f909a ] Clang warns: drivers/macintosh/windfarm_lm75_sensor.c:63:14: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]

[PATCH AUTOSEL 6.2 12/16] powerpc/kcsan: Exclude udelay to prevent recursive instrumentation

2023-03-05 Thread Sasha Levin
From: Rohan McLure [ Upstream commit 2a7ce82dc46c591c9244057d89a6591c9639b9b9 ] In order for KCSAN to increase its likelihood of observing a data race, it sets a watchpoint on memory accesses and stalls, allowing for detection of conflicting accesses by other kernel threads or interrupts.

[PATCH AUTOSEL 6.2 11/16] powerpc/64: Move paca allocation to early_setup()

2023-03-05 Thread Sasha Levin
From: Nicholas Piggin [ Upstream commit dc222fa7737212fe0da513e5b8937c156d02225d ] The early paca and boot cpuid dance is complicated and currently does not quite work as expected for boot cpuid != 0 cases. early_init_devtree() currently allocates the paca_ptrs and boot cpuid paca, but until

[PATCH AUTOSEL 6.2 10/16] powerpc/64: Fix task_cpu in early boot when booting non-zero cpuid

2023-03-05 Thread Sasha Levin
From: Nicholas Piggin [ Upstream commit 9fa24404f5044967753a6cd3e5e36f57686bec6e ] powerpc/64 can boot on a non-zero SMP processor id. Initially, the boot CPU is said to be "assumed to be 0" until early_init_devtree() discovers the id from the device tree. That is not a good description because

[PATCH AUTOSEL 6.2 09/16] powerpc/bpf/32: Only set a stack frame when necessary

2023-03-05 Thread Sasha Levin
From: Christophe Leroy [ Upstream commit d084dcf256bc4565b4b1af9b00297ac7b51c7049 ] Until now a stack frame was set at all time due to the need to keep tail call counter in the stack. But since commit 89d21e259a94 ("powerpc/bpf/32: Fix Oops on tail call tests") the tail call counter is passed

[PATCH AUTOSEL 6.2 08/16] powerpc: Remove __kernel_text_address() in show_instructions()

2023-03-05 Thread Sasha Levin
From: Christophe Leroy [ Upstream commit d9ab6da64fd15608c9feb20d769d8df1a32fe212 ] That test was introducted in 2006 by commit 00ae36de49cc ("[POWERPC] Better check in show_instructions"). At that time, there was no BPF progs. As seen in message of commit 89d21e259a94 ("powerpc/bpf/32: Fix

[PATCH AUTOSEL 6.2 06/16] powerpc/iommu: fix memory leak with using debugfs_lookup()

2023-03-05 Thread Sasha Levin
From: Greg Kroah-Hartman [ Upstream commit b505063910c134778202dfad9332dfcecb76bab3 ] When calling debugfs_lookup() the result must have dput() called on it, otherwise the memory will leak over time. To make things simpler, just call debugfs_lookup_and_remove() instead which handles all of the

[PATCH AUTOSEL 6.2 04/16] powerpc/64: Don't recurse irq replay

2023-03-05 Thread Sasha Levin
From: Nicholas Piggin [ Upstream commit 5746ca131e2496ccd5bb4d7a0244d6c38070cbf5 ] Interrupt handlers called by soft-pending irq replay code can run softirqs, softirq replay enables and disables local irqs, which allows interrupts to come in including soft-masked interrupts, and it can cause

[PATCH AUTOSEL 6.2 03/16] powerpc: Check !irq instead of irq == NO_IRQ and remove NO_IRQ

2023-03-05 Thread Sasha Levin
From: Christophe Leroy [ Upstream commit bab537805a10bdbf55b31324ba4a9599e0651e5e ] NO_IRQ is a relic from the old days. It is not used anymore in core functions. By the way, function irq_of_parse_and_map() returns value 0 on error. In some drivers, NO_IRQ is erroneously used to check the

Re: [PATCH v3 2/2] arch/*/io.h: remove ioremap_uc in some architectures

2023-03-05 Thread Geert Uytterhoeven
Hi Michael, On Sun, Mar 5, 2023 at 10:23 AM Michael Ellerman wrote: > Baoquan He writes: > > ioremap_uc() is only meaningful on old x86-32 systems with the PAT > > extension, and on ia64 with its slightly unconventional ioremap() > > behavior, everywhere else this is the same as ioremap()

Re: [PATCH v3 2/2] arch/*/io.h: remove ioremap_uc in some architectures

2023-03-05 Thread Michael Ellerman
Baoquan He writes: > ioremap_uc() is only meaningful on old x86-32 systems with the PAT > extension, and on ia64 with its slightly unconventional ioremap() > behavior, everywhere else this is the same as ioremap() anyway. > > Here, remove the ioremap_uc() definition in architecutures other > than