Re: Linux powerpc new system call instruction and ABI

2021-05-20 Thread Nicholas Piggin
Excerpts from Dmitry V. Levin's message of May 20, 2021 12:59 pm: > On Thu, May 20, 2021 at 12:45:57PM +1000, Nicholas Piggin wrote: >> Excerpts from Dmitry V. Levin's message of May 20, 2021 11:06 am: >> > On Wed, May 19, 2021 at 07:48:47PM -0400, Rich Felker wrote: >> >> On Wed, May 19, 2021 at 0

[PATCH] powerpc/kprobes: Pass ppc_inst as a pointer to emulate_step() on ppc32

2021-05-20 Thread Naveen N. Rao
Trying to use a kprobe on ppc32 results in the below splat: BUG: Unable to handle kernel data access on read at 0x7c0802a6 Faulting instruction address: 0xc002e9f0 Oops: Kernel access of bad area, sig: 11 [#1] BE PAGE_SIZE=4K PowerPC 44x Platform Modules linked in: CPU: 0 PI

Re: [PATCH v5 5/9] powerpc/mm/book3s64: Update tlb flush routines to take a page walk cache flush argument

2021-05-20 Thread Michael Ellerman
Segher Boessenkool writes: > On Tue, May 18, 2021 at 07:45:14PM -0500, Segher Boessenkool wrote: >> On Wed, May 19, 2021 at 10:26:22AM +1000, Michael Ellerman wrote: >> > Guenter Roeck writes: >> > > Ah, sorry. I wasn't aware that the following is valid C code >> > > >> > > void f1() >> > > { >>

Re: [PATCH v4 1/3] audit: replace magic audit syscall class numbers with macros

2021-05-20 Thread Christian Brauner
On Wed, May 19, 2021 at 04:00:20PM -0400, Richard Guy Briggs wrote: > Replace audit syscall class magic numbers with macros. > > This required putting the macros into new header file > include/linux/auditsc_classmacros.h since the syscall macros were > included for both 64 bit and 32 bit in any co

Re: [PATCH v4 2/3] audit: add support for the openat2 syscall

2021-05-20 Thread Christian Brauner
On Wed, May 19, 2021 at 04:00:21PM -0400, Richard Guy Briggs wrote: > The openat2(2) syscall was added in kernel v5.6 with commit fddb5d430ad9 > ("open: introduce openat2(2) syscall") > > Add the openat2(2) syscall to the audit syscall classifier. > > Link: https://github.com/linux-audit/audit-ke

Re: [PATCH 6/9] tty: hvc_console: Fix coding style issues of block comments

2021-05-20 Thread Johan Hovold
On Tue, May 18, 2021 at 12:01:22PM +0800, Xiaofei Tan wrote: > Hi Johan, > > Thanks for reviewing this patch. > > On 2021/5/17 22:15, Johan Hovold wrote: > > On Mon, May 17, 2021 at 02:37:10PM +0800, Xiaofei Tan wrote: > >> Fix coding style issues of block comments, reported by checkpatch.pl. > >

Re: [PATCH v5 3/9] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-05-20 Thread Aneesh Kumar K.V
On 5/20/21 7:48 AM, Peter Xu wrote: On Wed, May 19, 2021 at 10:16:07AM +0530, Aneesh Kumar K.V wrote: On Thu, Apr 22, 2021 at 11:13:17AM +0530, Aneesh Kumar K.V wrote: pmd/pud_populate is the right interface to be used to set the respective page table entries. Some architectures like ppc64 do a

Re: [PATCH v2 1/2] kprobes: Allow architectures to override optinsn page allocation

2021-05-20 Thread Naveen N. Rao
Christophe Leroy wrote: Some architectures like powerpc require a non standard allocation of optinsn page, because module pages are too far from the kernel for direct branches. Define weak alloc_optinsn_page() and free_optinsn_page(), that fall back on alloc_insn_page() and free_insn_page() when

[PATCH 0/3] Rid W=1 warnings from Crypto

2021-05-20 Thread Lee Jones
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 (3): crypto: cavium: Fix a bunch of kernel-doc related issues crypto: nx: nx-aes-gcm: Kernel-doc formatting should not be used for

[PATCH 2/3] crypto: nx: nx-aes-gcm: Kernel-doc formatting should not be used for headers

2021-05-20 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/crypto/nx/nx-aes-gcm.c:26: warning: Function parameter or member 'tfm' not described in 'gcm_aes_nx_set_key' drivers/crypto/nx/nx-aes-gcm.c:26: warning: Function parameter or member 'in_key' not described in 'gcm_aes_nx_set_key' drivers

Re: [PATCH] powerpc/kprobes: Pass ppc_inst as a pointer to emulate_step() on ppc32

2021-05-20 Thread Christophe Leroy
Le 20/05/2021 à 09:29, Naveen N. Rao a écrit : Trying to use a kprobe on ppc32 results in the below splat: BUG: Unable to handle kernel data access on read at 0x7c0802a6 Faulting instruction address: 0xc002e9f0 Oops: Kernel access of bad area, sig: 11 [#1] BE PAGE_SIZE=4K P

[PATCH v1 01/12] powerpc: Rework PPC_RAW_xxx() macros for prefixed instructions

2021-05-20 Thread Christophe Leroy
At the time being, we have PPC_RAW_PLXVP() and PPC_RAW_PSTXVP() which provide a 64 bits value, and then it gets split by open coding to format it into a 'struct ppc_inst' instruction. Instead, define a PPC_RAW_xxx_P() and a PPC_RAW_xxx_S() to be used as is. Signed-off-by: Christophe Leroy --- a

[PATCH v1 02/12] powerpc/opcodes: Add shorter macros for registers for use with PPC_RAW_xx()

2021-05-20 Thread Christophe Leroy
Today we have __REG_Rx macros . They are mainly meant for internal use by macros __PPC_RA() and friends macros which allows uses like __PPC_RA(R12). When used with PPC_RAW_xx() macros, it gives a result which is not very readable. Add shorter macros _Rx in order to improve readability when used w

[PATCH v1 03/12] powerpc/lib/code-patching: Use PPC_RAW_() macros

2021-05-20 Thread Christophe Leroy
Instead of open coding with PPC_INST_ defines, use PPC_RAW_() macros. It improves readability. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/code-patching.h | 12 +--- arch/powerpc/kernel/trace/ftrace.c | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff

[PATCH v1 04/12] powerpc/signal: Use PPC_RAW_xx() macros

2021-05-20 Thread Christophe Leroy
To improve readability, use PPC_RAW_xx() macros instead of open coding. Those macros are self-explanatory so the comments can go as well. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc-opcode.h | 5 +++-- arch/powerpc/kernel/signal_32.c | 11 --- arch/powerpc/ker

[PATCH v1 05/12] powerpc/modules: Use PPC_RAW_xx() macros

2021-05-20 Thread Christophe Leroy
To improve readability, use PPC_RAW_xx() macros instead of open coding. Those macros are self-explanatory so the comments can go as well. Signed-off-by: Christophe Leroy --- PPC_INST_ADDIS can also be removed once optprobes.c is fixed (Via another series) --- arch/powerpc/include/asm/ppc-opcode

[PATCH v1 06/12] powerpc/security: Use PPC_RAW_BLR() and PPC_RAW_NOP()

2021-05-20 Thread Christophe Leroy
On the road to remove all use of PPC_INST_xxx, replace PPC_INST_BLR by PPC_RAW_BLR(). Same for PPC_INST_NOP. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc-opcode.h | 3 +-- arch/powerpc/kernel/security.c| 12 ++-- 2 files changed, 7 insertions(+), 8 deletions(

[PATCH v1 07/12] powerpc/ftrace: Use PPC_RAW_MFLR() and PPC_RAW_NOP()

2021-05-20 Thread Christophe Leroy
Use PPC_RAW_MFLR() instead of open coding with PPC_INST_MFLR. Same for PPC_INST_NOP. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/trace/ftrace.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/k

[PATCH v1 08/12] powerpc/ebpf64: Use PPC_RAW_MFLR()

2021-05-20 Thread Christophe Leroy
Use PPC_RAW_MFLR() instead of open coding with PPC_INST_MFLR. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc-opcode.h | 3 +-- arch/powerpc/net/bpf_jit_comp64.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/a

[PATCH v1 09/12] powerpc/ebpf32: Use _Rx macros instead of __REG_Rx ones

2021-05-20 Thread Christophe Leroy
To increase readability, use _Rx macros instead of __REG_Rx. Signed-off-by: Christophe Leroy --- arch/powerpc/net/bpf_jit_comp32.c | 218 +++--- 1 file changed, 109 insertions(+), 109 deletions(-) diff --git a/arch/powerpc/net/bpf_jit_comp32.c b/arch/powerpc/net/bpf_jit

[PATCH v1 10/12] powerpc/lib/feature-fixups: Use PPC_RAW_xxx() macros

2021-05-20 Thread Christophe Leroy
Use PPC_RAW_xxx() macros instead of open coding assembly opcodes. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc-opcode.h | 4 + arch/powerpc/include/asm/reg.h| 1 + arch/powerpc/lib/feature-fixups.c | 121 +- 3 files changed, 65 insertio

[PATCH v1 11/12] powerpc/traps: Start using PPC_RAW_xx() macros

2021-05-20 Thread Christophe Leroy
Start using PPC_RAW_xx() macros where relevant. PPC_INST_SYNC is used to both represent the 'sync' instruction and the family of synchronisation instructions. Keep it for the later, maybe we'll change the name in the future to avoid confusion. Signed-off-by: Christophe Leroy --- arch/powerpc/in

[PATCH v1 12/12] powerpc: Replace PPC_INST_NOP by PPC_RAW_NOP()

2021-05-20 Thread Christophe Leroy
On the road to removing all PPC_INST_xx defines in asm/ppc-opcodes.h, change PPC_INST_NOP to PPC_RAW_NOP(). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc-opcode.h | 3 +-- arch/powerpc/kernel/crash_dump.c | 2 +- arch/powerpc/kernel/jump_label.c | 2 +- arch/powerpc/

RE: [PATCH v1 12/12] powerpc: Replace PPC_INST_NOP by PPC_RAW_NOP()

2021-05-20 Thread David Laight
From: Christophe Leroy > Sent: 20 May 2021 11:23 > > On the road to removing all PPC_INST_xx defines in > asm/ppc-opcodes.h, change PPC_INST_NOP to PPC_RAW_NOP(). ... > @@ -475,7 +474,7 @@ > #define PPC_RAW_ADD_DOT(t, a, b) (PPC_INST_ADD | ___PPC_RT(t) | > ___PPC_RA(a) | ___PPC_RB(b) | 0x1)

Re: [PATCH] powerpc/kprobes: Pass ppc_inst as a pointer to emulate_step() on ppc32

2021-05-20 Thread Naveen N. Rao
Christophe Leroy wrote: Le 20/05/2021 à 09:29, Naveen N. Rao a écrit : Trying to use a kprobe on ppc32 results in the below splat: BUG: Unable to handle kernel data access on read at 0x7c0802a6 Faulting instruction address: 0xc002e9f0 Oops: Kernel access of bad area, sig: 11 [#1

[PATCH 2/2] powerpc/64s/syscall: Fix ptrace syscall info with scv syscalls

2021-05-20 Thread Nicholas Piggin
The scv implementation missed updating syscall return value and error value get/set functions to deal with the changed register ABI. This broke ptrace PTRACE_GET_SYSCALL_INFO as well as some kernel auditing and tracing functions. Fix. tools/testing/selftests/ptrace/get_syscall_info now passes when

[PATCH 1/2] powerpc/64s/syscall: Use pt_regs.trap to distinguish syscall ABI difference between sc and scv syscalls

2021-05-20 Thread Nicholas Piggin
The sc and scv 0 system calls have different ABI conventions, and ptracers need to know which system call type is being used if it wants to look at the syscall registers. Document that pt_regs.trap can be used for this, and fix one in-tree user to work with scv 0 syscalls. Fixes: 7fa95f9adaee ("p

Re: [PATCH v5 5/9] powerpc/mm/book3s64: Update tlb flush routines to take a page walk cache flush argument

2021-05-20 Thread Michael Ellerman
Guenter Roeck writes: > On 5/18/21 5:26 PM, Michael Ellerman wrote: > [ ... ] That was the generic header change in the patch. I was commenting about the ppc64 specific change causing build failures. >>> >>> Ah, sorry. I wasn't aware that the following is valid C code >>> >>> void f1() >

Re: [PATCH 1/2] powerpc/64s/syscall: Use pt_regs.trap to distinguish syscall ABI difference between sc and scv syscalls

2021-05-20 Thread Dmitry V. Levin
On Thu, May 20, 2021 at 09:19:30PM +1000, Nicholas Piggin wrote: > The sc and scv 0 system calls have different ABI conventions, and > ptracers need to know which system call type is being used if it wants > to look at the syscall registers. typo: s/if it wants/if they want/ > Document that pt_re

Re: [PATCH 2/2] powerpc/64s/syscall: Fix ptrace syscall info with scv syscalls

2021-05-20 Thread Dmitry V. Levin
On Thu, May 20, 2021 at 09:19:31PM +1000, Nicholas Piggin wrote: > The scv implementation missed updating syscall return value and error > value get/set functions to deal with the changed register ABI. This > broke ptrace PTRACE_GET_SYSCALL_INFO as well as some kernel auditing > and tracing functio

Re: [PATCH v5 5/9] powerpc/mm/book3s64: Update tlb flush routines to take a page walk cache flush argument

2021-05-20 Thread Guenter Roeck
On 5/20/21 4:38 AM, Michael Ellerman wrote: Guenter Roeck writes: On 5/18/21 5:26 PM, Michael Ellerman wrote: [ ... ] That was the generic header change in the patch. I was commenting about the ppc64 specific change causing build failures. Ah, sorry. I wasn't aware that the following is vali

[PATCH 00/16] Rid W=1 warnings from Char

2021-05-20 Thread Lee Jones
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 (16): char: pcmcia: cm4000_cs: Remove unused variable 'tmp' char: pcmcia: cm4040_cs: Remove unused variable 'uc' char: random: Inclu

[PATCH 15/16] char: hw_random: pseries-rng: Demote non-conformant kernel-doc header

2021-05-20 Thread Lee Jones
Fixes the following W=1 kernel build warning(s): drivers/char/hw_random/pseries-rng.c:42: warning: Function parameter or member 'vdev' not described in 'pseries_rng_get_desired_dma' Cc: Matt Mackall Cc: Herbert Xu Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Lijun

Re: [PATCH 15/31] KVM: PPC: Book3S HV: XIVE: Fix mapping of passthrough interrupts

2021-05-20 Thread Cédric Le Goater
On 5/15/21 12:40 PM, Marc Zyngier wrote: > On Fri, 14 May 2021 21:51:51 +0100, > Thomas Gleixner wrote: >> >> On Fri, Apr 30 2021 at 10:03, Cédric Le Goater wrote: >> >> CC: +Marc > > Thanks Thomas. > >> >>> PCI MSI interrupt numbers are now mapped in a PCI-MSI domain but the >>> underlying call

Re: [PATCH 1/1] powerpc/ps3: Fix error return code in ps3_register_devices()

2021-05-20 Thread Michael Ellerman
Zhen Lei writes: > When call ps3_start_probe_thread() failed, further initialization should > be stopped and the returned error code should be propagated. It's not clear to me that's a good change. > diff --git a/arch/powerpc/platforms/ps3/device-init.c > b/arch/powerpc/platforms/ps3/device-ini

Re: [PATCH v5 5/9] powerpc/mm/book3s64: Update tlb flush routines to take a page walk cache flush argument

2021-05-20 Thread Segher Boessenkool
Hi! On Thu, May 20, 2021 at 05:37:20PM +1000, Michael Ellerman wrote: > Segher Boessenkool writes: > > On Tue, May 18, 2021 at 07:45:14PM -0500, Segher Boessenkool wrote: > >> On Wed, May 19, 2021 at 10:26:22AM +1000, Michael Ellerman wrote: > >> > Guenter Roeck writes: > >> > > Ah, sorry. I was

Re: [PATCH v5 3/9] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-05-20 Thread Peter Xu
On Thu, May 20, 2021 at 01:56:54PM +0530, Aneesh Kumar K.V wrote: > > This seems to work at least for my userfaultfd test on shmem, however I > > don't > > fully understand the commit message [1] on: How do we guarantee we're not > > moving a thp pte? > > > > move_page_tables() checks for pmd_tr

Re: [PATCH 31/31] genirq: Improve "hwirq" output in /proc and /sys/

2021-05-20 Thread Thomas Gleixner
On Thu, May 20 2021 at 14:27, Cédric Le Goater wrote: > On 5/14/21 10:49 PM, Thomas Gleixner wrote: >> On Fri, Apr 30 2021 at 10:04, Cédric Le Goater wrote: >>> The HW IRQ numbers generated by the PCI MSI layer can be quite large >>> on a pSeries machine when running under the IBM Hypervisor and th

Re: [PATCH 00/16] Rid W=1 warnings from Char

2021-05-20 Thread Arnd Bergmann
On Thu, May 20, 2021 at 2:13 PM 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 (16): > char: pcmcia: cm4000_cs: Remove unused variable 'tmp' > char: pcm

Re: [PATCH 09/31] powerpc/pseries/pci: Add a msi_free() handler to clear XIVE data

2021-05-20 Thread Cédric Le Goater
Adding Marc. On 4/30/21 10:03 AM, Cédric Le Goater wrote: > The MSI domain clears the IRQ with msi_domain_free(), which calls > irq_domain_free_irqs_top(), which clears the handler data. This is a > problem for the XIVE controller since we need to unmap MMIO pages and > free a specific XIVE struct

Re: [PATCH 6/9] tty: hvc_console: Fix coding style issues of block comments

2021-05-20 Thread Xiaofei Tan
Hi Johan, On 2021/5/20 16:21, Johan Hovold wrote: On Tue, May 18, 2021 at 12:01:22PM +0800, Xiaofei Tan wrote: Hi Johan, Thanks for reviewing this patch. On 2021/5/17 22:15, Johan Hovold wrote: On Mon, May 17, 2021 at 02:37:10PM +0800, Xiaofei Tan wrote: Fix coding style issues of block com

Re: [PATCH v5 3/9] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-05-20 Thread Aneesh Kumar K.V
On 5/20/21 6:16 PM, Peter Xu wrote: On Thu, May 20, 2021 at 01:56:54PM +0530, Aneesh Kumar K.V wrote: This seems to work at least for my userfaultfd test on shmem, however I don't fully understand the commit message [1] on: How do we guarantee we're not moving a thp pte? move_page_tables() ch

Re: [PATCH v5 3/9] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-05-20 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V" writes: > On 5/20/21 6:16 PM, Peter Xu wrote: >> On Thu, May 20, 2021 at 01:56:54PM +0530, Aneesh Kumar K.V wrote: This seems to work at least for my userfaultfd test on shmem, however I don't fully understand the commit message [1] on: How do we guarantee we're

Re: [PATCH] powerpc/kprobes: Pass ppc_inst as a pointer to emulate_step() on ppc32

2021-05-20 Thread Christophe Leroy
Le 20/05/2021 à 12:54, Naveen N. Rao a écrit : Christophe Leroy wrote: Le 20/05/2021 à 09:29, Naveen N. Rao a écrit : Trying to use a kprobe on ppc32 results in the below splat: BUG: Unable to handle kernel data access on read at 0x7c0802a6 Faulting instruction address: 0xc002e9f

[PATCH v2 00/12] powerpc: Cleanup use of 'struct ppc_inst'

2021-05-20 Thread Christophe Leroy
This series is a cleanup of the use of 'struct ppc_inst'. A confusion is made between internal representation of powerpc instructions with 'struct ppc_inst' and in-memory code which is and will always be an array of 'unsigned int'. This series cleans it up. First patch is fixing detection of mis

[PATCH v2 01/12] powerpc/inst: Fix sparse detection on get_user_instr()

2021-05-20 Thread Christophe Leroy
get_user_instr() lacks sparse detection for the __user tag. This is because __gui_ptr is assigned with a cast. Fix that by adding a __chk_user_ptr() Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/inst.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arc

[PATCH v2 02/12] powerpc/inst: Reduce casts in get_user_instr()

2021-05-20 Thread Christophe Leroy
Declare __gui_ptr as 'unsigned int *' instead of casting it at each use. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/inst.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/inst.h b/arch/powerpc/include/asm/inst.h index 887ef150

[PATCH v2 03/12] powerpc/inst: Improve readability of get_user_instr() and friends

2021-05-20 Thread Christophe Leroy
Remove unneeded line splits. And remove unneeded local variable initialisation. Signed-off-by: Christophe Leroy --- v2: Don't use get_op() for now as including asm/disassemble.h conflicts with drivers/staging/rtl8723bs/include/wifi.h --- arch/powerpc/include/asm/inst.h | 16 ++-- 1

[PATCH v2 05/12] powerpc: Do not dereference code as 'struct ppc_inst' (uprobe, code-patching, feature-fixups)

2021-05-20 Thread Christophe Leroy
'struct ppc_inst' is an internal structure to represent an instruction, it is not directly the representation of that instruction in text code. It is not meant to map and dereference code. Dereferencing code directly through 'struct ppc_inst' has two main issues: - On powerpc, structs are expected

[PATCH v2 04/12] powerpc/inst: Avoid pointer dereferencing in ppc_inst_equal()

2021-05-20 Thread Christophe Leroy
Avoid casting/dereferencing ppc_inst() as u64* , check each member of the struct when relevant. And remove the 0xff initialisation of the suffix for non prefixed instruction. An instruction with 0xff as a suffix might be invalid, but still is a prefixed instruction and has to be considered as this

[PATCH v2 06/12] powerpc/lib/code-patching: Make instr_is_branch_to_addr() static

2021-05-20 Thread Christophe Leroy
instr_is_branch_to_addr() is only used in code-patching.c Make it static. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/code-patching.h | 1 - arch/powerpc/lib/code-patching.c | 18 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/p

[PATCH v2 07/12] powerpc/lib/code-patching: Don't use struct 'ppc_inst' for runnable code in tests.

2021-05-20 Thread Christophe Leroy
'struct ppc_inst' is meant to represent an instruction internally, it is not meant to dereference code in memory. For testing code patching, use patch_instruction() to properly write into memory the code to be tested. Signed-off-by: Christophe Leroy --- arch/powerpc/lib/code-patching.c | 95 +++

[PATCH v2 08/12] powerpc: Don't use 'struct ppc_inst' to reference instruction location

2021-05-20 Thread Christophe Leroy
'struct ppc_inst' is an internal representation of an instruction, but in-memory instructions are and will remain a table of 'unsigned int' forever. Replace all 'struct ppc_inst *' used for locating an instruction in memory by 'unsigned int *'. This removes a lot of undue casts to 'struct ppc_inst

[PATCH v2 09/12] powerpc/inst: Refactor PPC32 and PPC64 versions

2021-05-20 Thread Christophe Leroy
ppc_inst() ppc_inst_prefixed() ppc_inst_swab() can easily be made common to both PPC32 and PPC64. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/inst.h | 49 + 1 file changed, 13 insertions(+), 36 deletions(-) diff --git a/arch/powerpc/include/asm/i

[PATCH v2 10/12] powerpc/optprobes: Minimise casts

2021-05-20 Thread Christophe Leroy
nip is already an unsigned long, no cast needed. op_callback_addr and emulate_step_addr are kprobe_opcode_t *. There value is obtained with ppc_kallsyms_lookup_name() which returns 'unsigned long', and there values are used create_branch() which expects 'unsigned long'. So change them to 'unsigned

[PATCH v2 11/12] powerpc/optprobes: Compact code source a bit.

2021-05-20 Thread Christophe Leroy
Now that lines can be up to 100 chars long, minimise the amount of split lines to increase readability. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/optprobes.c | 33 +++-- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/arch/powerpc/kernel/

Re: [PATCH 6/9] tty: hvc_console: Fix coding style issues of block comments

2021-05-20 Thread Johan Hovold
On Thu, May 20, 2021 at 09:21:25PM +0800, Xiaofei Tan wrote: > > Checkpatch already has too many checks IMO and I'm a bit surprised that > > it doesn't check this already. Perhaps it's because you used the -f to > > run checkpatch on in-kernel code, which you should not. > > > >>> Second, that sen

[PATCH v2 12/12] powerpc/optprobes: use PPC_RAW_ macros

2021-05-20 Thread Christophe Leroy
Use PPC_RAW_ macros to simplify the code. And use PPC_LO/PPC_HI instead of IMM_L/IMM_H which are for internal use inside ppc-opcode.h Those macros are self explanatory, comments can go as well. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc-opcode.h | 11 arch/powerp

[PATCH] selftests/powerpc: Fix "no_handler" EBB selftest for ISA v3.1

2021-05-20 Thread Athira Rajeev
The "no_handler_test" in ebb selftests attempts to read the PMU registers after closing of the event via helper function "dump_ebb_state". With the MMCR0 control bit (PMCCEXT) in ISA v3.1, read access to group B registers is restricted when MMCR0 PMCC=0b00. Hence the call to dump_ebb_state after cl

Re: [PATCH 31/31] genirq: Improve "hwirq" output in /proc and /sys/

2021-05-20 Thread Cédric Le Goater
On 5/14/21 10:49 PM, Thomas Gleixner wrote: > On Fri, Apr 30 2021 at 10:04, Cédric Le Goater wrote: >> The HW IRQ numbers generated by the PCI MSI layer can be quite large >> on a pSeries machine when running under the IBM Hypervisor and they >> appear as negative. Use '%u' to show them correctly.

Re: [PATCH v5 3/9] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-05-20 Thread Peter Xu
On Thu, May 20, 2021 at 07:07:57PM +0530, Aneesh Kumar K.V wrote: > "Aneesh Kumar K.V" writes: > > > On 5/20/21 6:16 PM, Peter Xu wrote: > >> On Thu, May 20, 2021 at 01:56:54PM +0530, Aneesh Kumar K.V wrote: > This seems to work at least for my userfaultfd test on shmem, however I > do

Re: [PATCH 0/9] tty: hvc_console: Fix some coding style issues

2021-05-20 Thread Greg KH
On Mon, May 17, 2021 at 02:37:04PM +0800, Xiaofei Tan wrote: > Fix some issues reported by checkpatch.pl. All of them are > coding style issues, no function changes. > > Xiaofei Tan (9): > tty: hvc_console: Fix spaces required around that '=' > tty: hvc_console: Fix "foo * bar" should be "foo

Re: [PATCH 6/9] tty: hvc_console: Fix coding style issues of block comments

2021-05-20 Thread Joe Perches
On Thu, 2021-05-20 at 10:21 +0200, Johan Hovold wrote: > On Tue, May 18, 2021 at 12:01:22PM +0800, Xiaofei Tan wrote: > > On 2021/5/17 22:15, Johan Hovold wrote: > > > On Mon, May 17, 2021 at 02:37:10PM +0800, Xiaofei Tan wrote: > > > > Fix coding style issues of block comments, reported by checkpa

Re: [PATCH v5 7/9] mm/mremap: Move TLB flush outside page table lock

2021-05-20 Thread Aneesh Kumar K.V
On 4/22/21 11:13 AM, Aneesh Kumar K.V wrote: Move TLB flush outside page table lock so that kernel does less with page table lock held. Releasing the ptl with old TLB contents still valid will behave such that such access happened before the level3 or level2 entry update. Ok this break the pa

[PATCH 1/3] sched/topology: Allow archs to populate distance map

2021-05-20 Thread Srikar Dronamraju
Currently scheduler populates the distance map by looking at distance of each node from all other nodes. This should work for most architectures and platforms. However there are some architectures like POWER that may not expose the distance of nodes that are not yet onlined because those resources

[PATCH 0/3] Skip numa distance for offline nodes

2021-05-20 Thread Srikar Dronamraju
Geetika reported yet another trace while doing a dlpar CPU add operation. This was true even on top of a recent commit 6980d13f0dd1 ("powerpc/smp: Set numa node before updating mask") which fixed a similar trace. WARNING: CPU: 40 PID: 2954 at kernel/sched/topology.c:2088 build_sched_domains+0x6e8

[PATCH 2/3] powerpc/numa: Populate distance map correctly

2021-05-20 Thread Srikar Dronamraju
As per PAPR that defines the OS to hypervisor interface on POWER, there is no way to calculate the node_distance between 2 nodes, when either of the nodes are offline. However scheduler needs the distance map to be populated at boot time. On POWER, this information is provided within the distance_r

[PATCH 3/3] sched/topology: Skip updating masks for non-online nodes

2021-05-20 Thread Srikar Dronamraju
Currently scheduler doesn't check if node is online before adding CPUs to the node mask. However on some architectures, node distance is only available for nodes that are online. Its not sure how much to rely on the node distance, when one of the nodes is offline. If said node distance is fake (si

Re: [PATCH v5 7/9] mm/mremap: Move TLB flush outside page table lock

2021-05-20 Thread Aneesh Kumar K.V
On 5/20/21 8:56 PM, Aneesh Kumar K.V wrote: On 4/22/21 11:13 AM, Aneesh Kumar K.V wrote: Move TLB flush outside page table lock so that kernel does less with page table lock held. Releasing the ptl with old TLB contents still valid will behave such that such access happened before the level3 or

Re: [PATCH 07/31] powerpc/xive: Fix xive_irq_set_affinity for MSI

2021-05-20 Thread Cédric Le Goater
On 5/14/21 10:48 PM, Thomas Gleixner wrote: > On Fri, Apr 30 2021 at 10:03, Cédric Le Goater wrote: >> The MSI affinity is automanaged and it can be set before starting the >> associated IRQ. >> >> ( Should we simply remove the irqd_is_started() test ? ) > > If the hardware can handle it properly.

Re: [PATCH 1/3] sched/topology: Allow archs to populate distance map

2021-05-20 Thread Peter Zijlstra
On Thu, May 20, 2021 at 09:14:25PM +0530, Srikar Dronamraju wrote: > Currently scheduler populates the distance map by looking at distance > of each node from all other nodes. This should work for most > architectures and platforms. > > However there are some architectures like POWER that may not

Re: [PATCH v5 3/9] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-05-20 Thread Zi Yan
On 20 May 2021, at 10:57, Peter Xu wrote: > On Thu, May 20, 2021 at 07:07:57PM +0530, Aneesh Kumar K.V wrote: >> "Aneesh Kumar K.V" writes: >> >>> On 5/20/21 6:16 PM, Peter Xu wrote: On Thu, May 20, 2021 at 01:56:54PM +0530, Aneesh Kumar K.V wrote: >> This seems to work at least for my u

Re: [PATCH v5 3/9] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-05-20 Thread Peter Xu
On Thu, May 20, 2021 at 03:06:30PM -0400, Zi Yan wrote: > On 20 May 2021, at 10:57, Peter Xu wrote: > > > On Thu, May 20, 2021 at 07:07:57PM +0530, Aneesh Kumar K.V wrote: > >> "Aneesh Kumar K.V" writes: > >> > >>> On 5/20/21 6:16 PM, Peter Xu wrote: > On Thu, May 20, 2021 at 01:56:54PM +053

Re: [PATCH v2 net-next resend] ibmvnic: remove default label from to_string switch

2021-05-20 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Thu, 20 May 2021 08:50:34 +0200 you wrote: > This way the compiler warns when a new value is added to the enum but > not to the string translation like: > > drivers/net/ethernet/ibm/ibmvnic.c: In function 'adapter_state

Re: [PATCH v5 3/9] mm/mremap: Use pmd/pud_poplulate to update page table entries

2021-05-20 Thread Kalesh Singh
On Thu, May 20, 2021 at 4:01 PM Peter Xu wrote: > > On Thu, May 20, 2021 at 03:06:30PM -0400, Zi Yan wrote: > > On 20 May 2021, at 10:57, Peter Xu wrote: > > > > > On Thu, May 20, 2021 at 07:07:57PM +0530, Aneesh Kumar K.V wrote: > > >> "Aneesh Kumar K.V" writes: > > >> > > >>> On 5/20/21 6:16 PM

Re: [PATCH v2 2/4] dt-bindings: nintendo-otp: Document the Wii and Wii U OTP support

2021-05-20 Thread Rob Herring
On Wed, May 19, 2021 at 11:50:42AM +0200, Emmanuel Gil Peyrot wrote: > Both of these consoles use the exact same two registers, even at the > same address, but the Wii U has eight banks of 128 bytes memory while > the Wii only has one, hence the two compatible strings. > > Signed-off-by: Emmanuel

Re: [PATCH 0/9] tty: hvc_console: Fix some coding style issues

2021-05-20 Thread Xiaofei Tan
Hi Greg, On 2021/5/20 23:11, Greg KH wrote: On Mon, May 17, 2021 at 02:37:04PM +0800, Xiaofei Tan wrote: Fix some issues reported by checkpatch.pl. All of them are coding style issues, no function changes. Xiaofei Tan (9): tty: hvc_console: Fix spaces required around that '=' tty: hvc_cons

Re: [PATCH 6/9] tty: hvc_console: Fix coding style issues of block comments

2021-05-20 Thread Xiaofei Tan
Hi Johan, On 2021/5/20 21:52, Johan Hovold wrote: On Thu, May 20, 2021 at 09:21:25PM +0800, Xiaofei Tan wrote: Checkpatch already has too many checks IMO and I'm a bit surprised that it doesn't check this already. Perhaps it's because you used the -f to run checkpatch on in-kernel code, whic

Re: [PATCH 1/3] sched/topology: Allow archs to populate distance map

2021-05-20 Thread Srikar Dronamraju
* Peter Zijlstra [2021-05-20 20:56:31]: > On Thu, May 20, 2021 at 09:14:25PM +0530, Srikar Dronamraju wrote: > > Currently scheduler populates the distance map by looking at distance > > of each node from all other nodes. This should work for most > > architectures and platforms. > > > > However

Re: [PATCH v5 7/9] mm/mremap: Move TLB flush outside page table lock

2021-05-20 Thread Linus Torvalds
On Thu, May 20, 2021 at 6:57 AM Aneesh Kumar K.V wrote: > > Wondering whether this is correct considering we are holding mmap_sem in > write mode in mremap. Right. So *normally* the rule is to EITHER - hold the mmap_sem for writing OR - hold the page table lock and that the TLB flush needs

[PATCH RESEND] tty: hvc_console: Remove the repeated words 'no' and 'from'

2021-05-20 Thread Xiaofei Tan
Remove the repeated words 'no' and 'from', reported by checkpatch.pl. Signed-off-by: Xiaofei Tan --- drivers/tty/hvc/hvc_console.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index cdcc64e..bdd8d2b 100644 -

Re: [PATCH v5 7/9] mm/mremap: Move TLB flush outside page table lock

2021-05-20 Thread Aneesh Kumar K.V
On 5/21/21 8:10 AM, Linus Torvalds wrote: On Thu, May 20, 2021 at 6:57 AM Aneesh Kumar K.V wrote: Wondering whether this is correct considering we are holding mmap_sem in write mode in mremap. Right. So *normally* the rule is to EITHER - hold the mmap_sem for writing OR - hold the pag

[powerpc:fixes-test] BUILD SUCCESS d72500f992849d31ebae8f821a023660ddd0dcc2

2021-05-20 Thread kernel test robot
allnoconfig x86_64 randconfig-a001-20210520 x86_64 randconfig-a003-20210520 x86_64 randconfig-a002-20210520 x86_64 randconfig-a006-20210520 x86_64 randconfig-a005-20210520 x86_64 randconfig-a004

[powerpc:next-test] BUILD SUCCESS 8554e45273f0bf09a6efaa32f9f772335e19f429

2021-05-20 Thread kernel test robot
powerpc allyesconfig powerpc allmodconfig powerpc allnoconfig x86_64 randconfig-a001-20210520 x86_64 randconfig-a006-20210520 x86_64 randconfig-a005-20210520 x86_64

[powerpc:merge] BUILD SUCCESS 258eb1f3aaa9face35e613c229c1337263491ea0

2021-05-20 Thread kernel test robot
ig powerpc allnoconfig x86_64 randconfig-a001-20210520 x86_64 randconfig-a006-20210520 x86_64 randconfig-a005-20210520 x86_64 randconfig-a003-20210520 x86_64 randconfig-a004-20210520 x86_64 randconfig-a00

Re: [PATCH v5 7/9] mm/mremap: Move TLB flush outside page table lock

2021-05-20 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V" writes: > On 5/21/21 8:10 AM, Linus Torvalds wrote: >> On Thu, May 20, 2021 at 6:57 AM Aneesh Kumar K.V >> wrote: >>> >>> Wondering whether this is correct considering we are holding mmap_sem in >>> write mode in mremap. >> >> Right. So *normally* the rule is to EITHER >> >>

[PATCH 01/26] block: refactor device number setup in __device_add_disk

2021-05-20 Thread Christoph Hellwig
Untangle the mess around blk_alloc_devt by moving the check for the used allocation scheme into the callers. Signed-off-by: Christoph Hellwig --- block/blk.h | 4 +- block/genhd.c | 96 - block/partitions/core.c | 15 +-- 3 files

simplify gendisk and request_queue allocation for bio based drivers

2021-05-20 Thread Christoph Hellwig
Hi all, this series is the first part of cleaning up lifetimes and allocation of the gendisk and request_queue structure. It adds a new interface to allocate the disk and queue together for bio based drivers, and a helper for cleanup/free them when a driver is unloaded or a device is removed. To

simplify gendisk and request_queue allocation for bio based drivers

2021-05-20 Thread Christoph Hellwig
Hi all, this series is the first part of cleaning up lifetimes and allocation of the gendisk and request_queue structure. It adds a new interface to allocate the disk and queue together for bio based drivers, and a helper for cleanup/free them when a driver is unloaded or a device is removed. To

[PATCH 02/26] block: move the DISK_MAX_PARTS sanity check into __device_add_disk

2021-05-20 Thread Christoph Hellwig
Keep this together with the first place that actually looks at ->minors and prepare for not passing a minors argument to alloc_disk. Signed-off-by: Christoph Hellwig --- block/genhd.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/block/genhd.c b/block/genhd.c

[PATCH 04/26] block: add a flag to make put_disk on partially initalized disks safer

2021-05-20 Thread Christoph Hellwig
Add a flag to indicate that __device_add_disk did grab a queue reference so that disk_release only drops it if we actually had it. This sort out one of the major pitfals with partially initialized gendisk that a lot of drivers did get wrong or still do. Signed-off-by: Christoph Hellwig --- bloc

[PATCH 05/26] block: add blk_alloc_disk and blk_cleanup_disk APIs

2021-05-20 Thread Christoph Hellwig
Add two new APIs to allocate and free a gendisk including the request_queue for use with BIO based drivers. This is to avoid boilerplate code in drivers. Signed-off-by: Christoph Hellwig --- block/genhd.c | 35 +++ include/linux/genhd.h | 22 +

[PATCH 03/26] block: automatically enable GENHD_FL_EXT_DEVT

2021-05-20 Thread Christoph Hellwig
Automatically set the GENHD_FL_EXT_DEVT flag for all disks allocated without an explicit number of minors. This is what all new block drivers should do, so make sure it is the default without boilerplate code. Signed-off-by: Christoph Hellwig --- block/genhd.c| 2 +- block/p

[PATCH 06/26] brd: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-20 Thread Christoph Hellwig
Convert the brd driver to use the blk_alloc_disk and blk_cleanup_disk helpers to simplify gendisk and request_queue allocation. This also allows to remove the request_queue pointer in struct request_queue, and to simplify the initialization as blk_cleanup_disk can be called on any disk returned fr

[PATCH 07/26] drbd: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-20 Thread Christoph Hellwig
Convert the drbd driver to use the blk_alloc_disk and blk_cleanup_disk helpers to simplify gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/drbd/drbd_main.c | 23 --- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/driver

[PATCH 08/26] pktcdvd: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-20 Thread Christoph Hellwig
Convert the pktcdvd driver to use the blk_alloc_disk and blk_cleanup_disk helpers to simplify gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/pktcdvd.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/block/pktcdvd.c

[PATCH 09/26] rsxx: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-20 Thread Christoph Hellwig
Convert the rsxx driver to use the blk_alloc_disk and blk_cleanup_disk helpers to simplify gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/rsxx/dev.c | 39 +- drivers/block/rsxx/rsxx_priv.h | 1 - 2 files changed, 15

[PATCH 10/26] zram: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-20 Thread Christoph Hellwig
Convert the zram driver to use the blk_alloc_disk and blk_cleanup_disk helpers to simplify gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/block/zram/zram_drv.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/blo

[PATCH 11/26] lightnvm: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-20 Thread Christoph Hellwig
Convert the lightnvm driver to use the blk_alloc_disk and blk_cleanup_disk helpers to simplify gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/lightnvm/core.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/l

[PATCH 12/26] bcache: convert to blk_alloc_disk/blk_cleanup_disk

2021-05-20 Thread Christoph Hellwig
Convert the bcache driver to use the blk_alloc_disk and blk_cleanup_disk helpers to simplify gendisk and request_queue allocation. Signed-off-by: Christoph Hellwig --- drivers/md/bcache/super.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/md/bcache

  1   2   >