Re: [RFC PATCH kernel] powerpc: Fix early setup to make early_ioremap work

2021-05-19 Thread Alexey Kardashevskiy
On 20/05/2021 15:46, Christophe Leroy wrote: Le 20/05/2021 à 05:29, Alexey Kardashevskiy a écrit : The immediate problem is that after 0bd3f9e953bd ("powerpc/legacy_serial: Use early_ioremap()") the kernel silently reboots. The reason is that early_ioremap() returns broken addresses as it

Re: Conflict between arch/powerpc/include/asm/disassemble.h and drivers/staging/rtl8723bs/include/wifi.h

2021-05-19 Thread Greg KH
On Thu, May 20, 2021 at 07:30:49AM +0200, Christophe Leroy wrote: > Hello, > > I was trying to include powerpc asm/disassemble.h in some more widely used > headers in order to reduce open coding, and I'm facing the following > problem: > > drivers/staging/rtl8723bs/include/wifi.h:237:30: error:

Re: [RFC PATCH kernel] powerpc: Fix early setup to make early_ioremap work

2021-05-19 Thread Christophe Leroy
Le 20/05/2021 à 05:29, Alexey Kardashevskiy a écrit : The immediate problem is that after 0bd3f9e953bd ("powerpc/legacy_serial: Use early_ioremap()") the kernel silently reboots. The reason is that early_ioremap() returns broken addresses as it uses slot_virt[] array which initialized with

Re: [RFC PATCH kernel] powerpc: Fix early setup to make early_ioremap work

2021-05-19 Thread Christophe Leroy
Le 20/05/2021 à 05:33, Alexey Kardashevskiy a écrit : Hm, my thunderbird says it is not cc:'ed but git sendmail says it did cc: Server: localhost MAIL FROM: RCPT TO: RCPT TO: RCPT TO: RCPT TO: From: Alexey Kardashevskiy To: linuxppc-dev@lists.ozlabs.org Cc: Alexey Kardashevskiy ,    

Conflict between arch/powerpc/include/asm/disassemble.h and drivers/staging/rtl8723bs/include/wifi.h

2021-05-19 Thread Christophe Leroy
Hello, I was trying to include powerpc asm/disassemble.h in some more widely used headers in order to reduce open coding, and I'm facing the following problem: drivers/staging/rtl8723bs/include/wifi.h:237:30: error: conflicting types for 'get_ra'

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Nicholas Piggin
Excerpts from Dmitry V. Levin's message of May 20, 2021 1:06 pm: > On Thu, May 20, 2021 at 12:40:36PM +1000, Nicholas Piggin wrote: > [...] >> > Looks like struct pt_regs.trap already contains the information that could >> > be used to tell 'sc' from 'scv': if (pt_regs.trap & ~0xf) == 0x3000, then

Re: [PATCH v14 6/9] powerpc/bpf: Write protect JIT code

2021-05-19 Thread Jordan Niethe
On Mon, May 17, 2021 at 4:40 PM Christophe Leroy wrote: > > > > Le 17/05/2021 à 05:28, Jordan Niethe a écrit : > > Add the necessary call to bpf_jit_binary_lock_ro() to remove write and > > add exec permissions to the JIT image after it has finished being > > written. > > > > Without

Re: [PATCH v14 7/9] powerpc: Set ARCH_HAS_STRICT_MODULE_RWX

2021-05-19 Thread Jordan Niethe
On Mon, May 17, 2021 at 4:49 PM Christophe Leroy wrote: > > > > Le 17/05/2021 à 05:28, Jordan Niethe a écrit : > > From: Russell Currey > > > > To enable strict module RWX on powerpc, set: > > > > CONFIG_STRICT_MODULE_RWX=y > > > > You should also have CONFIG_STRICT_KERNEL_RWX=y set to have

Re: [PATCH v8 27/30] powerpc/kprobes: Don't allow breakpoints on suffixes

2021-05-19 Thread Jordan Niethe
On Wed, May 19, 2021 at 6:11 PM Naveen N. Rao wrote: > > Christophe Leroy wrote: > > > > > > Le 06/05/2020 à 05:40, Jordan Niethe a écrit : > >> Do not allow inserting breakpoints on the suffix of a prefix instruction > >> in kprobes. > >> > >> Signed-off-by: Jordan Niethe > >> --- > >> v8: Add

Re: [PATCH v3 0/4] P2040/P2041 i2c recovery erratum

2021-05-19 Thread Chris Packham
On 13/05/21 3:01 am, w...@kernel.org wrote: >>> I've been doing my recent work with a P2040 and prior to that I did test >>> out the recovery on a T2081 (which isn't documented to have this >>> erratum) when I was re-working the driver. The "new" recovery actually >>> seems better but I don't

Re: [RFC PATCH kernel] powerpc: Fix early setup to make early_ioremap work

2021-05-19 Thread Alexey Kardashevskiy
Hm, my thunderbird says it is not cc:'ed but git sendmail says it did cc: Server: localhost MAIL FROM: RCPT TO: RCPT TO: RCPT TO: RCPT TO: From: Alexey Kardashevskiy To: linuxppc-dev@lists.ozlabs.org Cc: Alexey Kardashevskiy , Michael Ellerman , Christophe Leroy Subject: [RFC

[RFC PATCH kernel] powerpc: Fix early setup to make early_ioremap work

2021-05-19 Thread Alexey Kardashevskiy
The immediate problem is that after 0bd3f9e953bd ("powerpc/legacy_serial: Use early_ioremap()") the kernel silently reboots. The reason is that early_ioremap() returns broken addresses as it uses slot_virt[] array which initialized with offsets from FIXADDR_TOP == IOREMAP_END+FIXADDR_SIZE ==

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Dmitry V. Levin
On Thu, May 20, 2021 at 12:40:36PM +1000, Nicholas Piggin wrote: [...] > > Looks like struct pt_regs.trap already contains the information that could > > be used to tell 'sc' from 'scv': if (pt_regs.trap & ~0xf) == 0x3000, then > > it's scv. Is my reading of arch/powerpc/include/asm/ptrace.h

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Dmitry V. Levin
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 06:09:25PM +, Joakim Tjernlund wrote: > > [...] > >> > W.r.t

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Nicholas Piggin
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 06:09:25PM +, Joakim Tjernlund wrote: > [...] >> > W.r.t breaking ABI, isn't that what PowerPC is trying to do with the new >> > syscall

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Nicholas Piggin
Excerpts from Dmitry V. Levin's message of May 20, 2021 9:27 am: > On Thu, May 20, 2021 at 08:51:53AM +1000, Nicholas Piggin wrote: >> Excerpts from Dmitry V. Levin's message of May 19, 2021 11:26 pm: >> > On Wed, May 19, 2021 at 08:59:05PM +1000, Nicholas Piggin wrote: >> >> Excerpts from Dmitry

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

2021-05-19 Thread Peter Xu
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 assume that > >>

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Dmitry V. Levin
On Wed, May 19, 2021 at 07:48:47PM -0400, Rich Felker wrote: > On Wed, May 19, 2021 at 06:09:25PM +, Joakim Tjernlund wrote: [...] > > W.r.t breaking ABI, isn't that what PowerPC is trying to do with the new > > syscall I/F? > > No, it's a new independent interface. Unfortunately, being a

Re: [musl] Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Rich Felker
On Wed, May 19, 2021 at 06:09:25PM +, Joakim Tjernlund wrote: > On Wed, 2021-05-19 at 10:22 -0500, Segher Boessenkool wrote: > > On Wed, May 19, 2021 at 03:06:49PM +, Joakim Tjernlund wrote: > > > On Wed, 2021-05-19 at 09:38 -0500, Segher Boessenkool wrote: > > > > On Wed, May 19, 2021 at

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Dmitry V. Levin
On Thu, May 20, 2021 at 08:51:53AM +1000, Nicholas Piggin wrote: > Excerpts from Dmitry V. Levin's message of May 19, 2021 11:26 pm: > > On Wed, May 19, 2021 at 08:59:05PM +1000, Nicholas Piggin wrote: > >> Excerpts from Dmitry V. Levin's message of May 19, 2021 8:24 pm: > >> > On Wed, May 19,

Re: [FSL P50x0] KVM HV doesn't work anymore

2021-05-19 Thread Nicholas Piggin
Excerpts from Christian Zigotzky's message of May 19, 2021 9:52 pm: > On 19 May 2021 at 09:57 am, Nicholas Piggin wrote: >> Excerpts from Christian Zigotzky's message of May 17, 2021 7:42 pm: >>> On 17 May 2021 at 09:42am, Nicholas Piggin wrote: Excerpts from Christian Zigotzky's message of

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Nicholas Piggin
Excerpts from Dmitry V. Levin's message of May 19, 2021 11:26 pm: > On Wed, May 19, 2021 at 08:59:05PM +1000, Nicholas Piggin wrote: >> Excerpts from Dmitry V. Levin's message of May 19, 2021 8:24 pm: >> > On Wed, May 19, 2021 at 12:50:24PM +1000, Nicholas Piggin wrote: >> > [...] >> >> With this

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

2021-05-19 Thread Richard Guy Briggs
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-kernel/issues/67 Signed-off-by: Richard Guy Briggs Link:

[PATCH v4 0/3] audit: add support for openat2

2021-05-19 Thread Richard Guy Briggs
The openat2(2) syscall was added in v5.6. Add support for openat2 to the audit syscall classifier and for recording openat2 parameters that cannot be captured in the syscall parameters of the SYSCALL record. Supporting userspace code can be found in

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

2021-05-19 Thread Richard Guy Briggs
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 compat code, causing redefinition warnings. Signed-off-by: Richard Guy Briggs

Re: [PATCH v7 02/15] swiotlb: Refactor swiotlb_create_debugfs

2021-05-19 Thread Florian Fainelli
On 5/17/2021 11:42 PM, Claire Chang wrote: > Split the debugfs creation to make the code reusable for supporting > different bounce buffer pools, e.g. restricted DMA pool. > > Signed-off-by: Claire Chang Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH v7 07/15] swiotlb: Update is_swiotlb_active to add a struct device argument

2021-05-19 Thread Florian Fainelli
On 5/17/2021 11:42 PM, Claire Chang wrote: > Update is_swiotlb_active to add a struct device argument. This will be > useful later to allow for restricted DMA pool. > > Signed-off-by: Claire Chang Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH v7 06/15] swiotlb: Update is_swiotlb_buffer to add a struct device argument

2021-05-19 Thread Florian Fainelli
On 5/17/2021 11:42 PM, Claire Chang wrote: > Update is_swiotlb_buffer to add a struct device argument. This will be > useful later to allow for restricted DMA pool. > > Signed-off-by: Claire Chang Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH v7 05/15] swiotlb: Add a new get_io_tlb_mem getter

2021-05-19 Thread Florian Fainelli
On 5/17/2021 11:42 PM, Claire Chang wrote: > Add a new getter, get_io_tlb_mem, to help select the io_tlb_mem struct. > The restricted DMA pool is preferred if available. > > Signed-off-by: Claire Chang Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH net-next] ibmveth: fix kobj_to_dev.cocci warnings

2021-05-19 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (refs/heads/master): On Wed, 19 May 2021 10:28:49 +0800 you wrote: > Use kobj_to_dev() instead of container_of() > > Generated by: scripts/coccinelle/api/kobj_to_dev.cocci > > Signed-off-by: YueHaibing > --- >

Re: [PATCH v7 03/15] swiotlb: Add DMA_RESTRICTED_POOL

2021-05-19 Thread Florian Fainelli
On 5/17/2021 11:42 PM, Claire Chang wrote: > Add a new kconfig symbol, DMA_RESTRICTED_POOL, for restricted DMA pool. > > Signed-off-by: Claire Chang Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH v7 11/15] dma-direct: Add a new wrapper __dma_direct_free_pages()

2021-05-19 Thread Florian Fainelli
On 5/17/2021 11:42 PM, Claire Chang wrote: > Add a new wrapper __dma_direct_free_pages() that will be useful later > for swiotlb_free(). > > Signed-off-by: Claire Chang Reviewed-by: Florian Fainelli -- Florian

Re: [PATCH v7 04/15] swiotlb: Add restricted DMA pool initialization

2021-05-19 Thread Florian Fainelli
On 5/17/2021 11:42 PM, Claire Chang wrote: > Add the initialization function to create restricted DMA pools from > matching reserved-memory nodes. > > Signed-off-by: Claire Chang > --- > include/linux/device.h | 4 +++ > include/linux/swiotlb.h | 3 +- > kernel/dma/swiotlb.c| 76

Re: [PATCH v7 01/15] swiotlb: Refactor swiotlb init functions

2021-05-19 Thread Florian Fainelli
On 5/17/2021 11:42 PM, Claire Chang wrote: > Add a new function, swiotlb_init_io_tlb_mem, for the io_tlb_mem struct > initialization to make the code reusable. > > Note that we now also call set_memory_decrypted in swiotlb_init_with_tbl. > > Signed-off-by: Claire Chang > --- >

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Joakim Tjernlund
On Wed, 2021-05-19 at 10:22 -0500, Segher Boessenkool wrote: > On Wed, May 19, 2021 at 03:06:49PM +, Joakim Tjernlund wrote: > > On Wed, 2021-05-19 at 09:38 -0500, Segher Boessenkool wrote: > > > On Wed, May 19, 2021 at 06:42:40PM +1000, Nicholas Piggin wrote: > > > > Excerpts from Joakim

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

2021-05-19 Thread Nathan Chancellor
On 5/18/2021 9:46 PM, Aneesh Kumar K.V wrote: Nathan Chancellor writes: Hi Aneesh, 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 assume that

Re: [musl] Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Rich Felker
On Wed, May 19, 2021 at 10:22:05AM -0500, Segher Boessenkool wrote: > On Wed, May 19, 2021 at 03:06:49PM +, Joakim Tjernlund wrote: > > On Wed, 2021-05-19 at 09:38 -0500, Segher Boessenkool wrote: > > > On Wed, May 19, 2021 at 06:42:40PM +1000, Nicholas Piggin wrote: > > > > Excerpts from

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

2021-05-19 Thread Guenter Roeck
On Wed, May 19, 2021 at 09:20:38AM -0500, Segher Boessenkool wrote: > On Wed, May 19, 2021 at 06:37:44AM -0700, Guenter Roeck wrote: > > On 5/19/21 5:03 AM, Segher Boessenkool wrote: > > >On Tue, May 18, 2021 at 07:45:14PM -0500, Segher Boessenkool wrote: > > >>And it actually explicitly is

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Segher Boessenkool
On Wed, May 19, 2021 at 03:06:49PM +, Joakim Tjernlund wrote: > On Wed, 2021-05-19 at 09:38 -0500, Segher Boessenkool wrote: > > On Wed, May 19, 2021 at 06:42:40PM +1000, Nicholas Piggin wrote: > > > Excerpts from Joakim Tjernlund's message of May 19, 2021 6:08 pm: > > > > I always figured the

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Joakim Tjernlund
On Wed, 2021-05-19 at 09:38 -0500, Segher Boessenkool wrote: > On Wed, May 19, 2021 at 06:42:40PM +1000, Nicholas Piggin wrote: > > Excerpts from Joakim Tjernlund's message of May 19, 2021 6:08 pm: > > > I always figured the ppc way was superior. It begs the question if not > > > the other archs

Re: [PATCH v2 2/2] powerpc/legacy_serial: Use early_ioremap()

2021-05-19 Thread Alexey Kardashevskiy
On 20/04/2021 23:32, Christophe Leroy wrote: From: Christophe Leroy [0.00] ioremap() called early from find_legacy_serial_ports+0x3cc/0x474. Use early_ioremap() instead find_legacy_serial_ports() is called early from setup_arch(), before paging_init(). vmalloc is not available

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

2021-05-19 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

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

2021-05-19 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

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

2021-05-19 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

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

2021-05-19 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

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

2021-05-19 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 v1 08/12] powerpc: Don't use 'struct ppc_inst' to reference instruction location

2021-05-19 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

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

2021-05-19 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

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

2021-05-19 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

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

2021-05-19 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

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

2021-05-19 Thread Christophe Leroy
Use get_op() instead of open coding, and remove unneeded line splits. And remove unneeded local variable initialisation. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/inst.h | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git

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

2021-05-19 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

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

2021-05-19 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

[PATCH v1 00/12] Cleanup use of 'struct ppc_inst'

2021-05-19 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

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Segher Boessenkool
On Wed, May 19, 2021 at 06:42:40PM +1000, Nicholas Piggin wrote: > Excerpts from Joakim Tjernlund's message of May 19, 2021 6:08 pm: > > I always figured the ppc way was superior. It begs the question if not the > > other archs should > > change instead? > > It is superior in some ways, not

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

2021-05-19 Thread Segher Boessenkool
On Wed, May 19, 2021 at 06:37:44AM -0700, Guenter Roeck wrote: > On 5/19/21 5:03 AM, Segher Boessenkool wrote: > >On Tue, May 18, 2021 at 07:45:14PM -0500, Segher Boessenkool wrote: > >>And it actually explicitly is undefined behaviour in C90 already > >>(3.6.6.4 in C90, 6.8.6.4 in C99 and later).

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

2021-05-19 Thread Guenter Roeck
On 5/19/21 5:03 AM, Segher Boessenkool wrote: 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() { return

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Dmitry V. Levin
On Wed, May 19, 2021 at 08:59:05PM +1000, Nicholas Piggin wrote: > Excerpts from Dmitry V. Levin's message of May 19, 2021 8:24 pm: > > On Wed, May 19, 2021 at 12:50:24PM +1000, Nicholas Piggin wrote: > > [...] > >> With this patch, I think the ptrace ABI should mostly be fixed. I think > >> a

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Tulio Magno Quites Machado Filho
Nicholas Piggin via Libc-alpha writes: > As a more hacky thing you could make a syscall with -1 and see how > the error looks, and then assume all syscalls will be the same. I'm not sure this would work. Even in glibc, it's expected that early syscalls will use sc while scv is used later in the

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

2021-05-19 Thread Segher Boessenkool
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() > > > { > > > return f2(); > > >

Re: [PATCH v3 5/6] sched/fair: Consider SMT in ASYM_PACKING load balance

2021-05-19 Thread Srikar Dronamraju
* Peter Zijlstra [2021-05-19 11:59:48]: > On Tue, May 18, 2021 at 12:07:40PM -0700, Ricardo Neri wrote: > > On Fri, May 14, 2021 at 07:14:15PM -0700, Ricardo Neri wrote: > > > On Fri, May 14, 2021 at 11:47:45AM +0200, Peter Zijlstra wrote: > > > > > So I'm thinking that this is a property of

[PATCH v2 4/4] powerpc: wii_defconfig: Enable OTP by default

2021-05-19 Thread Emmanuel Gil Peyrot
This selects the nintendo-otp module when building for this platform, if CONFIG_NVMEM is also selected. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/configs/wii_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/configs/wii_defconfig

[PATCH v2 3/4] powerpc: wii.dts: Expose the OTP on this platform

2021-05-19 Thread Emmanuel Gil Peyrot
This can be used by the newly-added nintendo-otp nvmem module. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/boot/dts/wii.dts | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/boot/dts/wii.dts b/arch/powerpc/boot/dts/wii.dts index aaa381da1906..7837c4a3f09c 100644 ---

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

2021-05-19 Thread Emmanuel Gil Peyrot
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 Gil Peyrot --- .../devicetree/bindings/nvmem/nintendo-otp.txt | 14

[PATCH v2 1/4] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-05-19 Thread Emmanuel Gil Peyrot
This OTP is read-only and contains various keys used by the console to decrypt, encrypt or verify various pieces of storage. Its size depends on the console, it is 128 bytes on the Wii and 1024 bytes on the Wii U (split into eight 128 bytes banks). It can be used directly by writing into one

[PATCH v2 0/4] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-05-19 Thread Emmanuel Gil Peyrot
The OTP is a read-only memory area which contains various keys and signatures used to decrypt, encrypt or verify various pieces of storage. Its size depends on the console, it is 128 bytes on the Wii and 1024 bytes on the Wii U (split into eight 128 bytes banks). It can be used directly by

[PATCH 3/4] powerpc: wii.dts: Expose the OTP on this platform

2021-05-19 Thread Emmanuel Gil Peyrot
This can be used by the newly-added nintendo-otp nvmem module. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/boot/dts/wii.dts | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/boot/dts/wii.dts b/arch/powerpc/boot/dts/wii.dts index aaa381da1906..7837c4a3f09c 100644 ---

[PATCH 4/4] powerpc: wii_defconfig: Enable OTP by default

2021-05-19 Thread Emmanuel Gil Peyrot
This selects the nintendo-otp module when building for this platform, if CONFIG_NVMEM is also selected. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/configs/wii_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/configs/wii_defconfig

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

2021-05-19 Thread Emmanuel Gil Peyrot
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 Gil Peyrot --- .../devicetree/bindings/nvmem/nintendo-otp.txt | 14

[PATCH 1/4] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-05-19 Thread Emmanuel Gil Peyrot
This OTP is read-only and contains various keys used by the console to decrypt, encrypt or verify various pieces of storage. Its size depends on the console, it is 128 bytes on the Wii and 1024 bytes on the Wii U (split into eight 128 bytes banks). It can be used directly by writing into one

[PATCH 0/4] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-05-19 Thread Emmanuel Gil Peyrot
The OTP is a read-only memory area which contains various keys and signatures used to decrypt, encrypt or verify various pieces of storage. Its size depends on the console, it is 128 bytes on the Wii and 1024 bytes on the Wii U (split into eight 128 bytes banks). It can be used directly by

[PATCH 1/4] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-05-19 Thread Emmanuel Gil Peyrot
This OTP is read-only and contains various keys used by the console to decrypt, encrypt or verify various pieces of storage. Its size depends on the console, it is 128 bytes on the Wii and 1024 bytes on the Wii U (split into eight 128 bytes banks). It can be used directly by writing into one

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

2021-05-19 Thread Emmanuel Gil Peyrot
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 Gil Peyrot --- .../devicetree/bindings/nvmem/nintendo-otp.txt | 14

[PATCH 4/4] powerpc: wii_defconfig: Enable OTP by default

2021-05-19 Thread Emmanuel Gil Peyrot
This selects the nintendo-otp module when building for this platform, if CONFIG_NVMEM is also selected. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/configs/wii_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/configs/wii_defconfig

[PATCH 0/4] nvmem: nintendo-otp: Add new driver for the Wii and Wii U OTP

2021-05-19 Thread Emmanuel Gil Peyrot
The OTP is a read-only memory area which contains various keys and signatures used to decrypt, encrypt or verify various pieces of storage. Its size depends on the console, it is 128 bytes on the Wii and 1024 bytes on the Wii U (split into eight 128 bytes banks). It can be used directly by

[PATCH 3/4] powerpc: wii.dts: Expose the OTP on this platform

2021-05-19 Thread Emmanuel Gil Peyrot
This can be used by the newly-added nintendo-otp nvmem module. Signed-off-by: Emmanuel Gil Peyrot --- arch/powerpc/boot/dts/wii.dts | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/boot/dts/wii.dts b/arch/powerpc/boot/dts/wii.dts index aaa381da1906..7837c4a3f09c 100644 ---

Re: [FSL P50x0] KVM HV doesn't work anymore

2021-05-19 Thread Christian Zigotzky
On 19 May 2021 at 09:57 am, Nicholas Piggin wrote: Excerpts from Christian Zigotzky's message of May 17, 2021 7:42 pm: On 17 May 2021 at 09:42am, Nicholas Piggin wrote: Excerpts from Christian Zigotzky's message of May 15, 2021 11:46 pm: I tried it but it doesn't solve the issue. The uImage

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Nicholas Piggin
Excerpts from Nicholas Piggin's message of May 19, 2021 6:42 pm: > Excerpts from Joakim Tjernlund's message of May 19, 2021 6:08 pm: >> On Wed, 2021-05-19 at 17:55 +1000, Nicholas Piggin wrote: >>> Excerpts from Joakim Tjernlund's message of May 19, 2021 5:33 pm: >>> > On Wed, 2021-05-19 at 02:13

Re: [PATCH v3 5/6] sched/fair: Consider SMT in ASYM_PACKING load balance

2021-05-19 Thread Nicholas Piggin
Excerpts from Peter Zijlstra's message of May 19, 2021 7:59 pm: > On Tue, May 18, 2021 at 12:07:40PM -0700, Ricardo Neri wrote: >> On Fri, May 14, 2021 at 07:14:15PM -0700, Ricardo Neri wrote: >> > On Fri, May 14, 2021 at 11:47:45AM +0200, Peter Zijlstra wrote: > >> > > So I'm thinking that this

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Nicholas Piggin
Excerpts from Dmitry V. Levin's message of May 19, 2021 8:24 pm: > On Wed, May 19, 2021 at 12:50:24PM +1000, Nicholas Piggin wrote: > [...] >> With this patch, I think the ptrace ABI should mostly be fixed. I think >> a problem remains with applications that look at system call return >>

[PATCH 5/5] powerpc/kprobes: Warn if instruction patching failed

2021-05-19 Thread Naveen N. Rao
When arming and disarming probes, we currently assume that instruction patching can never fail, and don't have a mechanism to surface errors. Add a warning in case instruction patching ever fails. Signed-off-by: Naveen N. Rao --- arch/powerpc/kernel/kprobes.c | 4 ++-- 1 file changed, 2

[PATCH 4/5] powerpc/kprobes: Refactor arch_prepare_kprobe()

2021-05-19 Thread Naveen N. Rao
Clean up the function to look sane: - return immediately on error, rather than pointlessly setting the return value - pr_info() instead of printk() - check return value of patch_instruction() - and to top it all of: a reverse christmas tree! Signed-off-by: Naveen N. Rao ---

[PATCH 3/5] powerpc/kprobes: Check instruction validity during kprobe registration

2021-05-19 Thread Naveen N. Rao
In trap-based (classic) kprobes, we try to emulate the probed instruction so as to avoid having to single step it. We use a flag to determine if the probed instruction was successfully emulated, so that we can speed up subsequent probe hits. However, emulate_step() doesn't differentiate between

[PATCH 2/5] powerpc/kprobes: Roll IS_RFI() macro into IS_RFID()

2021-05-19 Thread Naveen N. Rao
In kprobes and xmon, we should exclude both 32-bit and 64-bit variants of mtmsr and rfi instructions from being stepped. Have IS_RFID() also detect a rfi instruction similar to IS_MTMSRD(). Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/sstep.h | 7 +++

[PATCH 1/5] powerpc/kprobes: Fix validation of prefixed instructions across page boundary

2021-05-19 Thread Naveen N. Rao
When checking if the probed instruction is the suffix of a prefixed instruction, we access the instruction at the previous word. If the probed instruction is the very first word of a module, we can end up trying to access an invalid page. Fix this by skipping the check for all instructions at the

[PATCH 0/5] powerpc/kprobes: fixes and cleanups

2021-05-19 Thread Naveen N. Rao
Various fixes and some code refactoring for kprobes on powerpc. The first patch fixes an invalid access if probing the first instruction in a kernel module. The rest are small cleanups. More details in the individual patches. - Naveen Naveen N. Rao (5): powerpc/kprobes: Fix validation of

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Dmitry V. Levin
On Wed, May 19, 2021 at 12:50:24PM +1000, Nicholas Piggin wrote: [...] > With this patch, I think the ptrace ABI should mostly be fixed. I think > a problem remains with applications that look at system call return > registers directly and have powerpc specific error cases. Those probably > will

Re: [PATCH v3 5/6] sched/fair: Consider SMT in ASYM_PACKING load balance

2021-05-19 Thread Peter Zijlstra
On Tue, May 18, 2021 at 12:07:40PM -0700, Ricardo Neri wrote: > On Fri, May 14, 2021 at 07:14:15PM -0700, Ricardo Neri wrote: > > On Fri, May 14, 2021 at 11:47:45AM +0200, Peter Zijlstra wrote: > > > So I'm thinking that this is a property of having ASYM_PACKING at a core > > > level, rather than

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Nicholas Piggin
Excerpts from Joakim Tjernlund's message of May 19, 2021 6:08 pm: > On Wed, 2021-05-19 at 17:55 +1000, Nicholas Piggin wrote: >> Excerpts from Joakim Tjernlund's message of May 19, 2021 5:33 pm: >> > On Wed, 2021-05-19 at 02:13 +0300, Dmitry V. Levin wrote: >> > > Hi, >> > > >> > > On Thu, Jun

Re: [PATCH v8 27/30] powerpc/kprobes: Don't allow breakpoints on suffixes

2021-05-19 Thread Naveen N. Rao
Christophe Leroy wrote: Le 06/05/2020 à 05:40, Jordan Niethe a écrit : Do not allow inserting breakpoints on the suffix of a prefix instruction in kprobes. Signed-off-by: Jordan Niethe --- v8: Add this back from v3 --- arch/powerpc/kernel/kprobes.c | 13 + 1 file changed, 13

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Joakim Tjernlund
On Wed, 2021-05-19 at 17:55 +1000, Nicholas Piggin wrote: > Excerpts from Joakim Tjernlund's message of May 19, 2021 5:33 pm: > > On Wed, 2021-05-19 at 02:13 +0300, Dmitry V. Levin wrote: > > > Hi, > > > > > > On Thu, Jun 11, 2020 at 06:12:01PM +1000, Nicholas Piggin wrote: > > > [...] > > > > -

Re: [FSL P50x0] KVM HV doesn't work anymore

2021-05-19 Thread Nicholas Piggin
Excerpts from Christian Zigotzky's message of May 17, 2021 7:42 pm: > On 17 May 2021 at 09:42am, Nicholas Piggin wrote: >> Excerpts from Christian Zigotzky's message of May 15, 2021 11:46 pm: >>> On 15 May 2021 at 12:08pm Christophe Leroy wrote: Le 15/05/2021 à 11:48, Christian Zigotzky

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Nicholas Piggin
Excerpts from Joakim Tjernlund's message of May 19, 2021 5:33 pm: > On Wed, 2021-05-19 at 02:13 +0300, Dmitry V. Levin wrote: >> Hi, >> >> On Thu, Jun 11, 2020 at 06:12:01PM +1000, Nicholas Piggin wrote: >> [...] >> > - Error handling: The consensus among kernel, glibc, and musl is to move to >>

Re: Linux powerpc new system call instruction and ABI

2021-05-19 Thread Joakim Tjernlund
On Wed, 2021-05-19 at 02:13 +0300, Dmitry V. Levin wrote: > Hi, > > On Thu, Jun 11, 2020 at 06:12:01PM +1000, Nicholas Piggin wrote: > [...] > > - Error handling: The consensus among kernel, glibc, and musl is to move to > >   using negative return values in r3 rather than CR0[SO]=1 to indicate

Re: [PATCH v3] powerpc/papr_scm: Reduce error severity if nvdimm stats inaccessible

2021-05-19 Thread kajoljain
On 5/8/21 10:06 AM, Vaibhav Jain wrote: > Currently drc_pmem_qeury_stats() generates a dev_err in case > "Enable Performance Information Collection" feature is disabled from > HMC or performance stats are not available for an nvdimm. The error is > of the form below: > > papr_scm