[PATCH] powerpc/paravirt: correct preempt debug splat in vcpu_is_preempted()

2021-09-20 Thread Nathan Lynch
vcpu_is_preempted() can be used outside of preempt-disabled critical sections, yielding warnings such as: BUG: using smp_processor_id() in preemptible [] code: systemd-udevd/185 caller is rwsem_spin_on_owner+0x1cc/0x2d0 CPU: 1 PID: 185 Comm: systemd-udevd Not tainted 5.15.0-rc2+ #33 Call

Re: [PATCH 1/2] powerpc/perf: Expose instruction and data address registers as part of extended regs

2021-09-20 Thread Athira Rajeev
> On 20-Sep-2021, at 12:43 PM, Michael Ellerman wrote: > > Athira Rajeev writes: >>> On 08-Sep-2021, at 10:47 AM, Michael Ellerman wrote: >>> >>> Athira Rajeev writes: Patch adds support to include Sampled Instruction Address Register (SIAR) and Sampled Data Address Register

Re: [PATCH 3/3] powerpc/pseries/cpuhp: delete add/remove_by_count code

2021-09-20 Thread Nathan Lynch
Daniel Henrique Barboza writes: > On 9/20/21 10:55, Nathan Lynch wrote: >> The core DLPAR code supports two actions (add and remove) and three >> subtypes of action: >> >> * By DRC index: the action is attempted on a single specified resource. >>This is the usual case for processors. >> *

Re: [PATCH] powerpc/476: Fix sparse report

2021-09-20 Thread Alistair Popple
Thanks, looks reasonable. Reviewed-by: Alistair Popple On Saturday, 18 September 2021 7:22:32 PM AEST Christophe Leroy wrote: > arch/powerpc/platforms/44x/ppc476.c:236:17: warning: cast removes > address space '__iomem' of expression > arch/powerpc/platforms/44x/ppc476.c:241:34:

Re: [PATCH] KVM: PPC: Replace zero-length array with flexible array member

2021-09-20 Thread Gustavo A. R. Silva
On 9/18/21 09:21, Len Baker wrote: > There is a regular need in the kernel to provide a way to declare having > a dynamically sized set of trailing elements in a structure. Kernel code > should always use "flexible array members" [1] for these cases. The > older style of one-element or

Re: [PATCH 3/3] powerpc/pseries/cpuhp: delete add/remove_by_count code

2021-09-20 Thread Daniel Henrique Barboza
On 9/20/21 10:55, Nathan Lynch wrote: The core DLPAR code supports two actions (add and remove) and three subtypes of action: * By DRC index: the action is attempted on a single specified resource. This is the usual case for processors. * By indexed count: the action is attempted on a

Re: [PATCH 2/3] powerpc/cpuhp: BUG -> WARN conversion in offline path

2021-09-20 Thread Daniel Henrique Barboza
On 9/20/21 10:55, Nathan Lynch wrote: If, due to bugs elsewhere, we get into unregister_cpu_online() with a CPU that isn't marked hotpluggable, we can emit a warning and return an appropriate error instead of crashing. Signed-off-by: Nathan Lynch --- As mentioned by Christophe this will

Re: [PATCH 1/3] powerpc/pseries/cpuhp: cache node corrections

2021-09-20 Thread Daniel Henrique Barboza
On 9/20/21 10:55, Nathan Lynch wrote: On pseries, cache nodes in the device tree can be added and removed by the CPU DLPAR code as well as the partition migration (mobility) code. PowerVM partitions in dedicated processor mode typically have L2 and L3 cache nodes. The CPU DLPAR code has the

Re: [PATCH v4 1/3] powerpc/bitops: Use immediate operand when possible

2021-09-20 Thread Segher Boessenkool
Hi! On Mon, Sep 20, 2021 at 10:31:17AM +0200, Christophe Leroy wrote: > Today we get the following code generation for bitops like > set or clear bit: > > c0009fe0: 39 40 08 00 li r10,2048 > c0009fe4: 7c e0 40 28 lwarx r7,0,r8 > c0009fe8: 7c e7

[PATCH] ASoC: fsl: Constify static snd_soc_ops

2021-09-20 Thread Rikard Falkeborn
These are only assigned to the ops field in the snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn --- sound/soc/fsl/imx-audmix.c | 4 ++-- sound/soc/fsl/imx-card.c | 4

Re: [PATCH v3 5/8] x86/sme: Replace occurrences of sme_active() with cc_platform_has()

2021-09-20 Thread Kirill A. Shutemov
On Wed, Sep 08, 2021 at 05:58:36PM -0500, Tom Lendacky wrote: > diff --git a/arch/x86/mm/mem_encrypt_identity.c > b/arch/x86/mm/mem_encrypt_identity.c > index 470b20208430..eff4d19f9cb4 100644 > --- a/arch/x86/mm/mem_encrypt_identity.c > +++ b/arch/x86/mm/mem_encrypt_identity.c > @@ -30,6 +30,7

Re: [PATCH] agp: define proper stubs for empty helpers

2021-09-20 Thread Helge Deller
On 9/20/21 2:17 PM, Arnd Bergmann wrote: From: Arnd Bergmann The empty unmap_page_from_agp() macro causes a warning when building with 'make W=1' on a couple of architectures: drivers/char/agp/generic.c: In function 'agp_generic_destroy_page': drivers/char/agp/generic.c:1265:28: error:

Re: [PATCH] agp: define proper stubs for empty helpers

2021-09-20 Thread Sam Ravnborg
On Mon, Sep 20, 2021 at 02:17:19PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann > > The empty unmap_page_from_agp() macro causes a warning when > building with 'make W=1' on a couple of architectures: > > drivers/char/agp/generic.c: In function 'agp_generic_destroy_page': >

[PATCH] powerpc/pseries: delete scanlog

2021-09-20 Thread Nathan Lynch
Remove the pseries scanlog driver. This code supports functions from Power4-era servers that are not present on targets currently supported by arch/powerpc. System manuals from this time have this description: Scan Dump data is a set of chip data that the service processor gathers after a

[PATCH 5.4 107/260] hvsi: dont panic on tty_register_driver failure

2021-09-20 Thread Greg Kroah-Hartman
From: Jiri Slaby [ Upstream commit 7ccbdcc4d08a6d7041e4849219bbb12ffa45db4c ] The alloc_tty_driver failure is handled gracefully in hvsi_init. But tty_register_driver is not. panic is called if that one fails. So handle the failure of tty_register_driver gracefully too. This will keep at least

[PATCH 4.19 198/293] hvsi: dont panic on tty_register_driver failure

2021-09-20 Thread Greg Kroah-Hartman
From: Jiri Slaby [ Upstream commit 7ccbdcc4d08a6d7041e4849219bbb12ffa45db4c ] The alloc_tty_driver failure is handled gracefully in hvsi_init. But tty_register_driver is not. panic is called if that one fails. So handle the failure of tty_register_driver gracefully too. This will keep at least

[PATCH 4.14 154/217] hvsi: dont panic on tty_register_driver failure

2021-09-20 Thread Greg Kroah-Hartman
From: Jiri Slaby [ Upstream commit 7ccbdcc4d08a6d7041e4849219bbb12ffa45db4c ] The alloc_tty_driver failure is handled gracefully in hvsi_init. But tty_register_driver is not. panic is called if that one fails. So handle the failure of tty_register_driver gracefully too. This will keep at least

[PATCH 4.9 127/175] hvsi: dont panic on tty_register_driver failure

2021-09-20 Thread Greg Kroah-Hartman
From: Jiri Slaby [ Upstream commit 7ccbdcc4d08a6d7041e4849219bbb12ffa45db4c ] The alloc_tty_driver failure is handled gracefully in hvsi_init. But tty_register_driver is not. panic is called if that one fails. So handle the failure of tty_register_driver gracefully too. This will keep at least

[PATCH 4.4 103/133] hvsi: dont panic on tty_register_driver failure

2021-09-20 Thread Greg Kroah-Hartman
From: Jiri Slaby [ Upstream commit 7ccbdcc4d08a6d7041e4849219bbb12ffa45db4c ] The alloc_tty_driver failure is handled gracefully in hvsi_init. But tty_register_driver is not. panic is called if that one fails. So handle the failure of tty_register_driver gracefully too. This will keep at least

[PATCH] pseries/eeh: fix the kdump kernel crash during eeh_pseries_init

2021-09-20 Thread Mahesh Salgaonkar
On pseries lpar when an empty slot is assigned to partition OR on single lpar mode, kdump kernel crashes during issuing PHB reset. In the kdump scenario, we traverse all PHBs and issue reset using the pe_config_addr of first child device present under each PHB. However the code assumes that none

[Bug 213803] G5 kernel build (v5.14-rc2) fails at linking stage - ld: arch/powerpc/mm/pgtable.o: in function `.__ptep_set_access_flags': /usr/src/linux-stable/./arch/powerpc/include/asm/book3s/64/pgta

2021-09-20 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=213803 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Status|NEW |RESOLVED

Re: [PATCH v3] lib/zlib_inflate/inffast: Check config in C to avoid unused function warning

2021-09-20 Thread Nathan Chancellor
On Mon, Sep 20, 2021 at 10:43:33AM +0200, Paul Menzel wrote: > Building Linux for ppc64le with Ubuntu clang version 12.0.0-3ubuntu1~21.04.1 > shows the warning below. > > arch/powerpc/boot/inffast.c:20:1: warning: unused function > 'get_unaligned16' [-Wunused-function] >

Re: Build regressions/improvements in v5.15-rc2

2021-09-20 Thread Geert Uytterhoeven
On Mon, 20 Sep 2021, Geert Uytterhoeven wrote: JFYI, when comparing v5.15-rc2[1] to v5.15-rc1[3], the summaries are: - build errors: +9/-49 + /kisskb/src/arch/sparc/lib/iomap.c: error: redefinition of 'pci_iounmap': => 22:6 sparc64/sparc64-allnoconfig +

Re: [PATCH 2/3] powerpc/cpuhp: BUG -> WARN conversion in offline path

2021-09-20 Thread Nathan Lynch
Christophe Leroy writes: > Le 20/09/2021 à 15:55, Nathan Lynch a écrit : >> If, due to bugs elsewhere, we get into unregister_cpu_online() with a CPU >> that isn't marked hotpluggable, we can emit a warning and return an >> appropriate error instead of crashing. > > Is it only a bug situation,

Re: [PATCH 2/3] powerpc/cpuhp: BUG -> WARN conversion in offline path

2021-09-20 Thread Christophe Leroy
Le 20/09/2021 à 15:55, Nathan Lynch a écrit : If, due to bugs elsewhere, we get into unregister_cpu_online() with a CPU that isn't marked hotpluggable, we can emit a warning and return an appropriate error instead of crashing. Is it only a bug situation, or is it something that can happen

[PATCH 3/3] powerpc/pseries/cpuhp: delete add/remove_by_count code

2021-09-20 Thread Nathan Lynch
The core DLPAR code supports two actions (add and remove) and three subtypes of action: * By DRC index: the action is attempted on a single specified resource. This is the usual case for processors. * By indexed count: the action is attempted on a range of resources beginning at the specified

[PATCH 2/3] powerpc/cpuhp: BUG -> WARN conversion in offline path

2021-09-20 Thread Nathan Lynch
If, due to bugs elsewhere, we get into unregister_cpu_online() with a CPU that isn't marked hotpluggable, we can emit a warning and return an appropriate error instead of crashing. Signed-off-by: Nathan Lynch --- arch/powerpc/kernel/sysfs.c | 3 ++- 1 file changed, 2 insertions(+), 1

[PATCH 1/3] powerpc/pseries/cpuhp: cache node corrections

2021-09-20 Thread Nathan Lynch
On pseries, cache nodes in the device tree can be added and removed by the CPU DLPAR code as well as the partition migration (mobility) code. PowerVM partitions in dedicated processor mode typically have L2 and L3 cache nodes. The CPU DLPAR code has the following shortcomings: * Cache nodes

[PATCH 0/3] CPU DLPAR/hotplug for v5.16

2021-09-20 Thread Nathan Lynch
Fixes for some vintage bugs in handling cache node addition and removal, a miscellaneous BUG->WARN conversion, and removal of the fragile "by count" CPU DLPAR code that probably has no users. Nathan Lynch (3): powerpc/pseries/cpuhp: cache node corrections powerpc/cpuhp: BUG -> WARN conversion

Re: [PATCH v2 3/8] bpf powerpc: refactor JIT compiler code

2021-09-20 Thread Hari Bathini
Hi Christophe, Thanks for reviewing the series. On 17/09/21 9:40 pm, Christophe Leroy wrote: Le 17/09/2021 à 17:30, Hari Bathini a écrit : Refactor powerpc JITing. This simplifies adding BPF_PROBE_MEM support. Could you describe a bit more what you are refactoring exactly ? I am trying

Re: [PATCH v2 1/3] powerpc/inst: Refactor ___get_user_instr()

2021-09-20 Thread kernel test robot
Hi Christophe, I love your patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v5.15-rc2 next-20210920] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented

[PATCH] agp: define proper stubs for empty helpers

2021-09-20 Thread Arnd Bergmann
From: Arnd Bergmann The empty unmap_page_from_agp() macro causes a warning when building with 'make W=1' on a couple of architectures: drivers/char/agp/generic.c: In function 'agp_generic_destroy_page': drivers/char/agp/generic.c:1265:28: error: suggest braces around empty body in an 'if'

[powerpc:merge] BUILD SUCCESS 044c2d99d9f43c6d6fde8bed00672517dd9a5a57

2021-09-20 Thread kernel test robot
-20210920 arm randconfig-c002-20210920 i386 randconfig-c001-20210920 x86_64 randconfig-c001-20210919 i386 randconfig-c001-20210919 arm randconfig-c002-20210919 ia64 allmodconfig ia64

Re: [PATCH v2] lib/zlib_inflate/inffast: Check config in C to avoid unused function warning

2021-09-20 Thread Paul Menzel
Dear Christophe, Thank you for the review. Am 20.09.21 um 10:36 schrieb Christophe Leroy: Le 20/09/2021 à 09:46, Paul Menzel a écrit : Building Linux for ppc64le with Ubuntu clang version 12.0.0-3ubuntu1~21.04.1 shows the warning below. arch/powerpc/boot/inffast.c:20:1: warning:

[PATCH v3] lib/zlib_inflate/inffast: Check config in C to avoid unused function warning

2021-09-20 Thread Paul Menzel
Building Linux for ppc64le with Ubuntu clang version 12.0.0-3ubuntu1~21.04.1 shows the warning below. arch/powerpc/boot/inffast.c:20:1: warning: unused function 'get_unaligned16' [-Wunused-function] get_unaligned16(const unsigned short *p) ^ 1 warning generated. Fix it, by

Re: [PATCH v2] lib/zlib_inflate/inffast: Check config in C to avoid unused function warning

2021-09-20 Thread Christophe Leroy
Le 20/09/2021 à 09:46, Paul Menzel a écrit : Building Linux for ppc64le with Ubuntu clang version 12.0.0-3ubuntu1~21.04.1 shows the warning below. arch/powerpc/boot/inffast.c:20:1: warning: unused function 'get_unaligned16' [-Wunused-function] get_unaligned16(const unsigned short

[PATCH v4 3/3] powerpc/atomics: Remove atomic_inc()/atomic_dec() and friends

2021-09-20 Thread Christophe Leroy
Now that atomic_add() and atomic_sub() handle immediate operands, atomic_inc() and atomic_dec() have no added value compared to the generic fallback which calls atomic_add(1) and atomic_sub(1). Also remove atomic_inc_not_zero() which fallsback to atomic_add_unless() which itself fallsback to

[PATCH v4 2/3] powerpc/atomics: Use immediate operand when possible

2021-09-20 Thread Christophe Leroy
Today we get the following code generation for atomic operations: c001bb2c: 39 20 00 01 li r9,1 c001bb30: 7d 40 18 28 lwarx r10,0,r3 c001bb34: 7d 09 50 50 subfr8,r9,r10 c001bb38: 7d 00 19 2d stwcx. r8,0,r3

[PATCH v4 1/3] powerpc/bitops: Use immediate operand when possible

2021-09-20 Thread Christophe Leroy
Today we get the following code generation for bitops like set or clear bit: c0009fe0: 39 40 08 00 li r10,2048 c0009fe4: 7c e0 40 28 lwarx r7,0,r8 c0009fe8: 7c e7 53 78 or r7,r7,r10 c0009fec: 7c e0 41 2d stwcx.

[PATCH v2] lib/zlib_inflate/inffast: Check config in C to avoid unused function warning

2021-09-20 Thread Paul Menzel
Building Linux for ppc64le with Ubuntu clang version 12.0.0-3ubuntu1~21.04.1 shows the warning below. arch/powerpc/boot/inffast.c:20:1: warning: unused function 'get_unaligned16' [-Wunused-function] get_unaligned16(const unsigned short *p) ^ 1 warning generated. Fix it, by

Re: [PATCH 1/2] powerpc/perf: Expose instruction and data address registers as part of extended regs

2021-09-20 Thread Michael Ellerman
Athira Rajeev writes: >> On 08-Sep-2021, at 10:47 AM, Michael Ellerman wrote: >> >> Athira Rajeev writes: >>> Patch adds support to include Sampled Instruction Address Register >>> (SIAR) and Sampled Data Address Register (SDAR) SPRs as part of extended >>> registers. Update the definition of

Re: [PATCH 0/2] powerpc/perf: Add instruction and data address registers to extended regs

2021-09-20 Thread Michael Ellerman
Arnaldo Carvalho de Melo writes: > Em Mon, Sep 06, 2021 at 08:13:13AM +0530, Athira Rajeev escreveu: >> > On 02-Sep-2021, at 1:04 PM, kajoljain wrote: >> > On 6/20/21 8:15 PM, Athira Rajeev wrote: >> >> Patch set adds PMU registers namely Sampled Instruction Address Register >> >> (SIAR) and

[PATCH v2 2/3] powerpc/inst: Define ppc_inst_t

2021-09-20 Thread Christophe Leroy
In order to stop using 'struct ppc_inst' on PPC32, define a ppc_inst_t typedef. Signed-off-by: Christophe Leroy --- v2: Anonymise the structure so that only the typedef can be used --- arch/powerpc/include/asm/code-patching.h | 18 +++ arch/powerpc/include/asm/hw_breakpoint.h | 4

[PATCH v2 3/3] powerpc/inst: Define ppc_inst_t as u32 on PPC32

2021-09-20 Thread Christophe Leroy
Unlike PPC64 ABI, PPC32 uses the stack to pass a parameter defined as a struct, even when the struct has a single simple element. To avoid that, define ppc_inst_t as u32 on PPC32. Keep it as 'struct ppc_inst' when __CHECKER__ is defined so that sparse can perform type checking. Also revert

[PATCH v2 1/3] powerpc/inst: Refactor ___get_user_instr()

2021-09-20 Thread Christophe Leroy
PPC64 version of ___get_user_instr() can be used for PPC32 as well, by simply disabling the suffix part with IS_ENABLED(CONFIG_PPC64). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/inst.h | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git