Re: C vdso

2020-09-24 Thread Christophe Leroy
Hi Michael Le 17/09/2020 à 14:33, Michael Ellerman a écrit : Hi Christophe, Christophe Leroy writes: Hi Michael, What is the status with the generic C vdso merge ? In some mail, you mentionned having difficulties getting it working on ppc64, any progress ? What's the problem ? Can I help

Re: [PATCH v2] i2c: cpm: Fix i2c_ram structure

2020-09-23 Thread Christophe Leroy
Le 23/09/2020 à 18:08, Wolfram Sang a écrit : On Wed, Sep 23, 2020 at 04:08:40PM +0200, nico.vi...@gmail.com wrote: From: Nicolas VINCENT the i2c_ram structure is missing the sdmatmp field mentionned in datasheet for MPC8272 at paragraph 36.5. With this field missing, the hardware would

Re: [PATCH] i2c: cpm: Fix i2c_ram structure

2020-09-23 Thread Christophe Leroy
Le 23/09/2020 à 14:55, Vincent Nicolas a écrit : From: Christophe Leroy Sent: Wednesday, 23 September 2020 10:01 To: Vincent Nicolas; joc...@scram.de Cc: linuxppc-dev@lists.ozlabs.org; linux-...@vger.kernel.org Subject: Re: [PATCH] i2c: cpm: Fix

Re: [PATCH] i2c: cpm: Fix i2c_ram structure

2020-09-23 Thread Christophe Leroy
Le 23/09/2020 à 09:18, Vincent Nicolas a écrit : From: Christophe Leroy Sent: Tuesday, 22 September 2020 14:38 To: Vincent Nicolas ; joc...@scram.de Cc: linuxppc-dev@lists.ozlabs.org ; linux-...@vger.kernel.org Subject: Re: [PATCH] i2c: cpm: Fix i2c_ram structure Le 22/09/2020 à

Re: [PATCH] i2c: cpm: Fix i2c_ram structure

2020-09-22 Thread Christophe Leroy
Le 22/09/2020 à 11:04, nico.vi...@gmail.com a écrit : From: Nicolas VINCENT the i2c_ram structure is missing the sdmatmp field mentionned in datasheet for MPC8272 at paragraph 36.5. With this field missing, the hardware would write past the allocated memory done through cpm_muram_alloc for

Re: [PATCH v3 1/2] powerpc/64: Set up a kernel stack for secondaries before cpu_restore()

2020-09-22 Thread Christophe Leroy
Le 22/09/2020 à 07:53, Jordan Niethe a écrit : Currently in generic_secondary_smp_init(), cur_cpu_spec->cpu_restore() is called before a stack has been set up in r1. This was previously fine as the cpu_restore() functions were implemented in assembly and did not use a stack. However commit

Re: [PATCH v2 2/7] powerpc/prom: Introduce early_reserve_mem_old()

2020-09-15 Thread Christophe Leroy
-variable] __be64 *reserve_map; ^~~ cc1: all warnings being treated as errors Cc: Christophe Leroy @csgroup.eu instead of @c-s.fr please Signed-off-by: Cédric Le Goater --- arch/powerpc/kernel/prom.c | 37 - 1 file changed, 20 insertions

Re: [PATCH] powerpc/powermac: Fix low_sleep_handler with KUAP and KUEP

2020-09-11 Thread Christophe Leroy
Le 11/09/2020 à 01:56, Michael Ellerman a écrit : Christophe Leroy writes: low_sleep_handler() has an hardcoded restore of segment registers that doesn't take KUAP and KUEP into account. Use head_32's load_segment_registers() routine instead. Signed-off-by: Christophe Leroy Fixes

[PATCH v2] powerpc/powermac: Fix low_sleep_handler with KUAP and KUEP

2020-09-11 Thread Christophe Leroy
low_sleep_handler() has an hardcoded restore of segment registers that doesn't take KUAP and KUEP into account. Use head_32's load_segment_registers() routine instead. Signed-off-by: Christophe Leroy Fixes: a68c31fc01ef ("powerpc/32s: Implement Kernel Userspace Access Protection&qu

Re: [PATCH] powerpc/traps: fix recoverability of machine check handling on book3s/32

2020-09-11 Thread Christophe Leroy
02:11:24PM +, Christophe Leroy wrote: Looks like book3s/32 doesn't set RI on machine check, so checking RI before calling die() will always be fatal allthought this is not an issue in most cases. Fixes: b96672dd840f ("powerpc: Machine check interrupt is a non-maskable interrupt")

Re: [PATCH 3/7] powerpc/sstep: Fix W=1 compile warning

2020-09-11 Thread Christophe Leroy
Le 11/09/2020 à 07:59, Cédric Le Goater a écrit : On 9/11/20 7:38 AM, Christophe Leroy wrote: Le 10/09/2020 à 23:02, Cédric Le Goater a écrit : ../arch/powerpc/lib/sstep.c: In function ‘mlsd_8lsd_ea’: ../arch/powerpc/lib/sstep.c:225:3: error: suggest braces around empty body

Re: [PATCH 7/7] powerpc/32: Fix W=1 compile warning

2020-09-10 Thread Christophe Leroy
) ^~~~ A small sentence explaining how this is fixed would be welcome, so that you don't need to read the code the know what the commit does to fix the warning. Also the subject should be more explicit. Cc: Christophe Leroy Reviewed-by: Christophe Leroy Fixes: 3978eb78517c ("po

Re: [PATCH 6/7] powerpc/perf: Fix W=1 compile warning

2020-09-10 Thread Christophe Leroy
Reviewed-by: Christophe Leroy --- arch/powerpc/perf/imc-pmu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 62d0b54086f8..9ed4fcccf8a9 100644 --- a/arch/powerpc/perf/imc-pmu.c +++ b/arch/powerpc/perf/imc-pmu.c @@ -1426,8

Re: [PATCH 5/7] powerpc/powernv/pci: Fix W=1 compile warning

2020-09-10 Thread Christophe Leroy
O'Halloran Signed-off-by: Cédric Le Goater Reviewed-by: Christophe Leroy --- arch/powerpc/platforms/powernv/pci-ioda.c | 8 1 file changed, 8 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 023a4f987bb2..2b4ceb5e6ce4

Re: [PATCH 4/7] powerpc/xive: Fix W=1 compile warning

2020-09-10 Thread Christophe Leroy
log. Signed-off-by: Cédric Le Goater Reviewed-by: Christophe Leroy --- arch/powerpc/sysdev/xive/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c index f591be9f01f4..a80440af491a 100644

Re: [PATCH 3/7] powerpc/sstep: Fix W=1 compile warning

2020-09-10 Thread Christophe Leroy
Le 10/09/2020 à 23:02, Cédric Le Goater a écrit : ../arch/powerpc/lib/sstep.c: In function ‘mlsd_8lsd_ea’: ../arch/powerpc/lib/sstep.c:225:3: error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body] ; /* Invalid form. Should already be checked for by caller! */

Re: [PATCH 2/7] powerpc/prom: Fix W=1 compile warning

2020-09-10 Thread Christophe Leroy
being treated as errors A small sentence explaining how this is fixes would be welcome, so that you don't need to read the code the know what the commit does to fix the warning. Also the subject should be more explicit. Cc: Christophe Leroy Signed-off-by: Cédric Le Goater --- arch

Re: [PATCH 1/7] powerpc/sysfs: Fix W=1 compile warning

2020-09-10 Thread Christophe Leroy
ke "remove unused err variable" Cc: Madhavan Srinivasan Signed-off-by: Cédric Le Goater Reviewed-by: Christophe Leroy --- arch/powerpc/kernel/sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/

[PATCH] powerpc/kasan: Fix CONFIG_KASAN_VMALLOC for 8xx

2020-09-10 Thread Christophe Leroy
creates final shadow memory for linear mem. Fixes: 41ea93cf7ba4 ("powerpc/kasan: Fix shadow pages allocation failure") Signed-off-by: Christophe Leroy --- arch/powerpc/mm/kasan/kasan_init_32.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/powerp

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-10 Thread Christophe Leroy
Le 10/09/2020 à 10:04, David Laight a écrit : From: Linus Torvalds Sent: 09 September 2020 22:34 On Wed, Sep 9, 2020 at 11:42 AM Segher Boessenkool wrote: It will not work like this in GCC, no. The LLVM people know about that. I do not know why they insist on pushing this, being

Re: [RFC PATCH v2 2/3] mm: make pXd_addr_end() functions page-table entry aware

2020-09-09 Thread Christophe Leroy
On Tue, 2020-09-08 at 16:15 +0200, Alexander Gordeev wrote: > On Tue, Sep 08, 2020 at 10:16:49AM +0200, Christophe Leroy wrote: > > >Yes, and also two more sources :/ > > > arch/powerpc/mm/kasan/8xx.c > > > arch/powerpc/mm/kasan/kasan_init_32.c > > > &

Re: [PATCH v1 4/5] powerpc/fault: Avoid heavy search_exception_tables() verification

2020-09-09 Thread Christophe Leroy
Le 09/09/2020 à 08:04, Aneesh Kumar K.V a écrit : Christophe Leroy writes: search_exception_tables() is an heavy operation, we have to avoid it. When KUAP is selected, we'll know the fault has been blocked by KUAP. Otherwise, it behaves just as if the address was already in the TLBs

Re: [RFC PATCH v2 3/3] mm: make generic pXd_addr_end() macros inline functions

2020-09-08 Thread Christophe Leroy
Le 08/09/2020 à 17:48, Alexander Gordeev a écrit : On Tue, Sep 08, 2020 at 07:19:38AM +0200, Christophe Leroy wrote: [...] diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 67ebc22cf83d..d9e7d16c2263 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h

Re: [PATCH] powerpc/64: Make VDSO32 track COMPAT on 64-bit

2020-09-08 Thread Christophe Leroy
, they will now also get VDSO32. If they've enabled COMPAT in order to run 32-bit binaries they presumably also want the 32-bit VDSO. Signed-off-by: Michael Ellerman Reviewed-by: Christophe Leroy Michael, please note that christophe.le...@c-s.fr is a deprecated address that will one day not work

Re: [RFC PATCH v2 1/3] mm/gup: fix gup_fast with dynamic page table folding

2020-09-08 Thread Christophe Leroy
Le 08/09/2020 à 14:09, Christian Borntraeger a écrit : On 08.09.20 07:06, Christophe Leroy wrote: Le 07/09/2020 à 20:00, Gerald Schaefer a écrit : From: Alexander Gordeev Commit 1a42010cdc26 ("s390/mm: convert to the generic get_user_pages_fast code") introduced a subtle

Re: [PATCH v1 1/5] powerpc/mm: sanity_check_fault() should work for all, not only BOOK3S

2020-09-08 Thread Christophe Leroy
it should not be limited to BOOK3S. Make the BOOK3S version of sanity_check_fault() the one for all, and bail out earlier if not BOOK3S. Fixes: 374f3f5979f9 ("powerpc/mm/hash: Handle user access of kernel address gracefully") Signed-off-by: Christophe Leroy --- arch/powerpc/mm/fault.c |

Re: [RFC PATCH 02/12] powerpc: remove arguments from interrupt handler functions

2020-09-08 Thread Christophe Leroy
Le 08/09/2020 à 10:29, Christophe Leroy a écrit : Le 08/09/2020 à 09:48, Nicholas Piggin a écrit : Excerpts from Christophe Leroy's message of September 7, 2020 9:34 pm: On Mon, 2020-09-07 at 11:20 +0200, Christophe Leroy wrote: Le 05/09/2020 à 19:43, Nicholas Piggin a écrit : Make

Re: [RFC PATCH 02/12] powerpc: remove arguments from interrupt handler functions

2020-09-08 Thread Christophe Leroy
Le 08/09/2020 à 09:48, Nicholas Piggin a écrit : Excerpts from Christophe Leroy's message of September 7, 2020 9:34 pm: On Mon, 2020-09-07 at 11:20 +0200, Christophe Leroy wrote: Le 05/09/2020 à 19:43, Nicholas Piggin a écrit : Make interrupt handlers all just take the pt_regs * argument

Re: [RFC PATCH v2 2/3] mm: make pXd_addr_end() functions page-table entry aware

2020-09-08 Thread Christophe Leroy
Le 08/09/2020 à 09:46, Alexander Gordeev a écrit : On Tue, Sep 08, 2020 at 07:14:38AM +0200, Christophe Leroy wrote: You forgot arch/powerpc/mm/book3s64/subpage_prot.c it seems. Yes, and also two more sources :/ arch/powerpc/mm/kasan/8xx.c arch/powerpc/mm/kasan

Re: [RFC PATCH v2 0/3] mm/gup: fix gup_fast with dynamic page table folding

2020-09-07 Thread Christophe Leroy
Le 07/09/2020 à 22:12, Mike Rapoport a écrit : On Mon, Sep 07, 2020 at 08:00:55PM +0200, Gerald Schaefer wrote: This is v2 of an RFC previously discussed here: https://lore.kernel.org/lkml/20200828140314.8556-1-gerald.schae...@linux.ibm.com/ Patch 1 is a fix for a regression in gup_fast on

Re: [RFC PATCH v2 3/3] mm: make generic pXd_addr_end() macros inline functions

2020-09-07 Thread Christophe Leroy
Le 07/09/2020 à 20:00, Gerald Schaefer a écrit : From: Alexander Gordeev Since pXd_addr_end() macros take pXd page-table entry as a parameter it makes sense to check the entry type on compile. Even though most archs do not make use of page-table entries in pXd_addr_end() calls, checking the

Re: [RFC PATCH v2 2/3] mm: make pXd_addr_end() functions page-table entry aware

2020-09-07 Thread Christophe Leroy
Le 07/09/2020 à 20:00, Gerald Schaefer a écrit : From: Alexander Gordeev Unlike all other page-table abstractions pXd_addr_end() do not take into account a particular table entry in which context the functions are called. On architectures with dynamic page-tables folding that might lead to

Re: [RFC PATCH v2 1/3] mm/gup: fix gup_fast with dynamic page table folding

2020-09-07 Thread Christophe Leroy
Le 07/09/2020 à 20:00, Gerald Schaefer a écrit : From: Alexander Gordeev Commit 1a42010cdc26 ("s390/mm: convert to the generic get_user_pages_fast code") introduced a subtle but severe bug on s390 with gup_fast, due to dynamic page table folding. The question "What would it require for the

Re: [RFC PATCH v2 0/3] mm/gup: fix gup_fast with dynamic page table folding

2020-09-07 Thread Christophe Leroy
Le 07/09/2020 à 20:00, Gerald Schaefer a écrit : This is v2 of an RFC previously discussed here: https://lore.kernel.org/lkml/20200828140314.8556-1-gerald.schae...@linux.ibm.com/ Patch 1 is a fix for a regression in gup_fast on s390, after our conversion to common gup_fast code. It will

[PATCH 2/2] powerpc/32: Fix vmap stack - Properly set r1 before activating MMU

2020-09-07 Thread Christophe Leroy
everything to use r1 instead of r11 all the way when CONFIG_VMAP_STACK is set, but the effort is probably not worth it. Fixes: 028474876f47 ("powerpc/32: prepare for CONFIG_VMAP_STACK") Cc: sta...@vger.kernel.org Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head

[PATCH 1/2] powerpc/32: Fix vmap stack - Do not activate MMU before reading task struct

2020-09-07 Thread Christophe Leroy
ill don't have r1 correct yet when we activate MMU. It is done in following patch. Fixes: 028474876f47 ("powerpc/32: prepare for CONFIG_VMAP_STACK") Cc: sta...@vger.kernel.org Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 6 -- arch/powerpc/kernel/h

Re: [RFC PATCH 02/12] powerpc: remove arguments from interrupt handler functions

2020-09-07 Thread Christophe Leroy
On Mon, 2020-09-07 at 11:20 +0200, Christophe Leroy wrote: > > Le 05/09/2020 à 19:43, Nicholas Piggin a écrit : > > Make interrupt handlers all just take the pt_regs * argument and load > > DAR/DSISR etc from that. Make those that return a value return long. > > I l

Re: [RFC PATCH 02/12] powerpc: remove arguments from interrupt handler functions

2020-09-07 Thread Christophe Leroy
Le 05/09/2020 à 19:43, Nicholas Piggin a écrit : Make interrupt handlers all just take the pt_regs * argument and load DAR/DSISR etc from that. Make those that return a value return long. I like this, it will likely simplify a bit the VMAP_STACK mess. Not sure it is that easy. My board is

Re: [RFC PATCH 09/12] powerpc: move NMI entry/exit code into wrapper

2020-09-07 Thread Christophe Leroy
On 9/5/20 5:43 PM, Nicholas Piggin wrote: This moves the common NMI entry and exit code into the interrupt handler wrappers. This changes the behaviour of soft-NMI (watchdog) and HMI interrupts, and also MCE interrupts on 64e, by adding missing parts of the NMI entry to them. Signed-off-by:

Re: [PATCH -next] powerpc/book3s64: fix link error with CONFIG_PPC_RADIX_MMU=n

2020-09-07 Thread Christophe Leroy
Le 07/09/2020 à 03:51, Yang Yingliang a écrit : On 2020/9/6 14:50, Christophe Leroy wrote: Le 05/09/2020 à 13:25, Yang Yingliang a écrit : Fix link error when CONFIG_PPC_RADIX_MMU is disabled: powerpc64-linux-gnu-ld: arch/powerpc/platforms/pseries/lpar.o:(.toc+0x0): undefined reference

Re: [RFC PATCH 12/12] powerpc/64s: power4 nap fixup in C

2020-09-06 Thread Christophe Leroy
Le 07/09/2020 à 06:02, Nicholas Piggin a écrit : Excerpts from Christophe Leroy's message of September 6, 2020 5:32 pm: Le 05/09/2020 à 19:43, Nicholas Piggin a écrit : There is no need for this to be in asm, use the new intrrupt entry wrapper. Signed-off-by: Nicholas Piggin ---

Re: [RFC PATCH 12/12] powerpc/64s: power4 nap fixup in C

2020-09-06 Thread Christophe Leroy
Le 05/09/2020 à 19:43, Nicholas Piggin a écrit : There is no need for this to be in asm, use the new intrrupt entry wrapper. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/interrupt.h | 14 arch/powerpc/include/asm/processor.h | 1 +

Re: [PATCH -next] powerpc/eeh: fix compile warning with CONFIG_PROC_FS=n

2020-09-06 Thread Christophe Leroy
Le 05/09/2020 à 13:17, Yang Yingliang a écrit : Fix the compile warning: arch/powerpc/kernel/eeh.c:1639:12: error: 'proc_eeh_show' defined but not used [-Werror=unused-function] static int proc_eeh_show(struct seq_file *m, void *v) Reported-by: Hulk Robot Signed-off-by: Yang Yingliang

Re: [PATCH -next] powerpc/book3s64: fix link error with CONFIG_PPC_RADIX_MMU=n

2020-09-06 Thread Christophe Leroy
Le 05/09/2020 à 13:25, Yang Yingliang a écrit : Fix link error when CONFIG_PPC_RADIX_MMU is disabled: powerpc64-linux-gnu-ld: arch/powerpc/platforms/pseries/lpar.o:(.toc+0x0): undefined reference to `mmu_pid_bits' Reported-by: Hulk Robot Signed-off-by: Yang Yingliang ---

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v3

2020-09-05 Thread Christophe Leroy
Le 04/09/2020 à 23:01, David Laight a écrit : From: Alexey Dobriyan Sent: 04 September 2020 18:58 On Fri, Sep 04, 2020 at 08:00:24AM +0200, Ingo Molnar wrote: * Christoph Hellwig wrote: this series removes the last set_fs() used to force a kernel address space for the uaccess code in the

[PATCH 3/3] powerpc/uaccess: Remove __put_user_asm() and __put_user_asm2()

2020-09-04 Thread Christophe Leroy
__put_user_asm() and __put_user_asm2() are not used anymore. Remove them. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/uaccess.h | 41 -- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/arch/powerpc/include/asm/uaccess.h b/arch

[PATCH 2/3] powerpc/uaccess: Switch __patch_instruction() to __put_user_asm_goto()

2020-09-04 Thread Christophe Leroy
__patch_instruction() is the only user of __put_user_asm() outside of asm/uaccess.h Switch to the new __put_user_asm_goto() to enable retirement of __put_user_asm() in a later patch. Signed-off-by: Christophe Leroy --- arch/powerpc/lib/code-patching.c | 17 +++-- 1 file changed, 7

[PATCH 1/3] powerpc/uaccess: Switch __put_user_size_allowed() to __put_user_asm_goto()

2020-09-04 Thread Christophe Leroy
addir4,r4,4 14c4: 42 00 ff dc bdnz14a0 <.save_general_regs+0x10> 14c8: 38 60 00 00 li r3,0 14cc: 4e 80 00 20 blr 14d0: 38 60 ff f2 li r3,-14 14d4: 4e 80 00 20 blr Signed-off-by: Christophe Leroy --- ar

[PATCH] powerpc/uaccess: Add pre-update addressing to __put_user_asm_goto()

2020-09-04 Thread Christophe Leroy
Enable pre-update addressing mode in __put_user_asm_goto() Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h index 7c2427f237e1

Re: [PATCH 1/2] dma-mapping: introduce dma_get_seg_boundary_nr_pages()

2020-09-03 Thread Christophe Leroy
Le 03/09/2020 à 18:12, Christoph Hellwig a écrit : On Thu, Sep 03, 2020 at 01:57:39PM +0300, Andy Shevchenko wrote: +{ + if (!dev) + return (U32_MAX >> page_shift) + 1; + return (dma_get_seg_boundary(dev) >> page_shift) + 1; Can it be better to do something like

Re: [PATCH 14/14] powerpc: remove address space overrides using set_fs()

2020-09-03 Thread Christophe Leroy
Le 03/09/2020 à 17:56, Christoph Hellwig a écrit : On Thu, Sep 03, 2020 at 05:49:09PM +0200, Christoph Hellwig wrote: On Thu, Sep 03, 2020 at 05:43:25PM +0200, Christophe Leroy wrote: Le 03/09/2020 à 16:22, Christoph Hellwig a écrit : Stop providing the possibility to override

Re: [PATCH 14/14] powerpc: remove address space overrides using set_fs()

2020-09-03 Thread Christophe Leroy
Le 03/09/2020 à 16:22, Christoph Hellwig a écrit : Stop providing the possibility to override the address space using set_fs() now that there is no need for that any more. Signed-off-by: Christoph Hellwig --- -static inline int __access_ok(unsigned long addr, unsigned long size, -

Re: [PATCH 10/10] powerpc: remove address space overrides using set_fs()

2020-09-03 Thread Christophe Leroy
Le 03/09/2020 à 09:11, Christoph Hellwig a écrit : Except that we do not actually have such a patch. For normal user writes we only use ->write_iter if ->write is not present. But what shows up in the profile is that /dev/zero only has a read_iter op and not a normal read. I've added a

Re: [PATCH 10/10] powerpc: remove address space overrides using set_fs()

2020-09-03 Thread Christophe Leroy
Le 03/09/2020 à 09:11, Christoph Hellwig a écrit : On Wed, Sep 02, 2020 at 11:02:22AM -0700, Linus Torvalds wrote: I don't see why this change would make any difference. Me neither, but while looking at a different project I did spot places that actually do an access_ok with len 0, that's

Re: [PATCH 10/10] powerpc: remove address space overrides using set_fs()

2020-09-03 Thread Christophe Leroy
Le 02/09/2020 à 20:02, Linus Torvalds a écrit : On Wed, Sep 2, 2020 at 8:17 AM Christophe Leroy wrote: With this fix, I get root@vgoippro:~# time dd if=/dev/zero of=/dev/null count=1M 536870912 bytes (512.0MB) copied, 6.776327 seconds, 75.6MB/s That's still far from the 91.7MB/s I get

Re: [PATCH 1/2] powerpc/vdso64: link vdso64 with linker

2020-09-02 Thread Christophe Leroy
Le 02/09/2020 à 19:41, Nick Desaulniers a écrit : On Wed, Sep 2, 2020 at 5:14 AM Michael Ellerman wrote: Nick Desaulniers writes: Fixes: commit f2af201002a8 ("powerpc/build: vdso linker warning for orphan sections") I think I'll just revert that for v5.9 ? SGTM; you'll probably

Re: [PATCH 2/2] powerpc/vdso32: link vdso64 with linker

2020-09-02 Thread Christophe Leroy
Hi, Le 02/09/2020 à 16:14, Segher Boessenkool a écrit : Hi! On Wed, Sep 02, 2020 at 06:46:45AM +, Christophe Leroy wrote: ld crashes: LD arch/powerpc/kernel/vdso32/vdso32.so.dbg /bin/sh: line 1: 23780 Segmentation fault (core dumped) ppc-linux-ld -EB -m elf32ppc -shared

Re: [PATCH 10/10] powerpc: remove address space overrides using set_fs()

2020-09-02 Thread Christophe Leroy
Le 02/09/2020 à 14:36, Christoph Hellwig a écrit : On Wed, Sep 02, 2020 at 08:15:12AM +0200, Christophe Leroy wrote: - return 0; - return (size == 0 || size - 1 <= seg.seg - addr); + if (addr >= TASK_SIZE_MAX) + return false; + if (siz

Re: [PATCH 10/10] powerpc: remove address space overrides using set_fs()

2020-09-02 Thread Christophe Leroy
Le 02/09/2020 à 15:51, David Laight a écrit : From: Christophe Leroy Sent: 02 September 2020 14:25 Le 02/09/2020 à 15:13, David Laight a écrit : From: Christoph Hellwig Sent: 02 September 2020 13:37 On Wed, Sep 02, 2020 at 08:15:12AM +0200, Christophe Leroy wrote: - return

Re: [PATCH 10/10] powerpc: remove address space overrides using set_fs()

2020-09-02 Thread Christophe Leroy
Le 02/09/2020 à 15:13, David Laight a écrit : From: Christoph Hellwig Sent: 02 September 2020 13:37 On Wed, Sep 02, 2020 at 08:15:12AM +0200, Christophe Leroy wrote: - return 0; - return (size == 0 || size - 1 <= seg.seg - addr); + if (addr >= TASK_SI

Re: [PATCH v4 04/13] mm/debug_vm_pgtables/hugevmap: Use the arch helper to identify huge vmap support.

2020-09-02 Thread Christophe Leroy
Le 02/09/2020 à 13:42, Aneesh Kumar K.V a écrit : ppc64 supports huge vmap only with radix translation. Hence use arch helper to determine the huge vmap support. Signed-off-by: Aneesh Kumar K.V --- mm/debug_vm_pgtable.c | 14 -- 1 file changed, 12 insertions(+), 2

Re: [PATCH v4 02/13] powerpc/mm: Move setting pte specific flags to pfn_pte

2020-09-02 Thread Christophe Leroy
() to catch the usage of calling set_pte_at() without setting _PAGE_PTE bit. We will remove that after a few releases. With respect to huge pmd entries, pmd_mkhuge() takes care of adding the _PAGE_PTE bit. Signed-off-by: Aneesh Kumar K.V Reviewed-by: Christophe Leroy Small nit below

Re: [PATCH 2/2] powerpc/vdso32: link vdso64 with linker

2020-09-02 Thread Christophe Leroy
On 9/1/20 10:25 PM, Nick Desaulniers wrote: Rather than invoke the compiler as the driver, use the linker. That way we can check --orphan-handling=warn support correctly, as cc-ldoption was removed in commit 055efab3120b ("kbuild: drop support for cc-ldoption"). Requires dropping the .got

Re: [PATCH] powerpc: Fix random segfault when freeing hugetlb range

2020-09-02 Thread Christophe Leroy
Le 02/09/2020 à 05:23, Aneesh Kumar K.V a écrit : Christophe Leroy writes: The following random segfault is observed from time to time with map_hugetlb selftest: root@localhost:~# ./map_hugetlb 1 19 524288 kB hugepages Mapping 1 Mbytes Segmentation fault [ 31.219972] map_hugetlb[365

Re: [PATCH 2/2] powerpc/vdso32: link vdso64 with linker

2020-09-02 Thread Christophe Leroy
On 9/1/20 10:25 PM, Nick Desaulniers wrote: Rather than invoke the compiler as the driver, use the linker. That way we can check --orphan-handling=warn support correctly, as cc-ldoption was removed in commit 055efab3120b ("kbuild: drop support for cc-ldoption"). Requires dropping the .got

Re: [PATCH 2/2] powerpc/vdso32: link vdso64 with linker

2020-09-02 Thread Christophe Leroy
On 09/01/2020 10:25 PM, Nick Desaulniers wrote: Rather than invoke the compiler as the driver, use the linker. That way we can check --orphan-handling=warn support correctly, as cc-ldoption was removed in commit 055efab3120b ("kbuild: drop support for cc-ldoption"). Requires dropping the

Re: [PATCH 10/10] powerpc: remove address space overrides using set_fs()

2020-09-02 Thread Christophe Leroy
Le 27/08/2020 à 17:00, Christoph Hellwig a écrit : Stop providing the possibility to override the address space using set_fs() now that there is no need for that any more. Signed-off-by: Christoph Hellwig --- arch/powerpc/Kconfig | 1 -

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v2

2020-09-01 Thread Christophe Leroy
Le 01/09/2020 à 19:25, Al Viro a écrit : On Tue, Sep 01, 2020 at 07:13:00PM +0200, Christophe Leroy wrote: 10.92% dd [kernel.kallsyms] [k] iov_iter_zero Interesting... Could you get an instruction-level profile inside iov_iter_zero(), along with the disassembly

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v2

2020-09-01 Thread Christophe Leroy
Le 01/09/2020 à 19:25, Al Viro a écrit : On Tue, Sep 01, 2020 at 07:13:00PM +0200, Christophe Leroy wrote: 10.92% dd [kernel.kallsyms] [k] iov_iter_zero Interesting... Could you get an instruction-level profile inside iov_iter_zero(), along with the disassembly

Re: remove the last set_fs() in common code, and remove it for x86 and powerpc v2

2020-09-01 Thread Christophe Leroy
Hi Christoph, Le 27/08/2020 à 17:00, Christoph Hellwig a écrit : Hi all, this series removes the last set_fs() used to force a kernel address space for the uaccess code in the kernel read/write/splice code, and then stops implementing the address space overrides entirely for x86 and powerpc.

Re: [PATCH] powerpc/mm: Remove DEBUG_VM_PGTABLE support on ppc64

2020-09-01 Thread Christophe Leroy
Le 01/09/2020 à 10:15, Christophe Leroy a écrit : Le 01/09/2020 à 10:12, Aneesh Kumar K.V a écrit : On 9/1/20 1:40 PM, Christophe Leroy wrote: Le 01/09/2020 à 10:02, Aneesh Kumar K.V a écrit : The test is broken w.r.t page table update rules and results in kernel crash as below

Re: [PATCH] powerpc/mm: Remove DEBUG_VM_PGTABLE support on ppc64

2020-09-01 Thread Christophe Leroy
Le 01/09/2020 à 10:12, Aneesh Kumar K.V a écrit : On 9/1/20 1:40 PM, Christophe Leroy wrote: Le 01/09/2020 à 10:02, Aneesh Kumar K.V a écrit : The test is broken w.r.t page table update rules and results in kernel crash as below. Disable the support untill we get the tests updated

Re: [PATCH] powerpc/mm: Remove DEBUG_VM_PGTABLE support on ppc64

2020-09-01 Thread Christophe Leroy
Le 01/09/2020 à 10:02, Aneesh Kumar K.V a écrit : The test is broken w.r.t page table update rules and results in kernel crash as below. Disable the support untill we get the tests updated. Signed-off-by: Aneesh Kumar K.V Any Fixes: tag ? --- arch/powerpc/Kconfig | 1 - 1 file

Re: [PATCH v2 00/13] mm/debug_vm_pgtable fixes

2020-09-01 Thread Christophe Leroy
+ Christophe Leroy Please don't use anymore the above address. Only use the one below. + Christophe Leroy + Vineet Gupta + Mike Rapoport + Qian Cai Thanks Christophe

Re: [PATCH v3 12/13] mm/debug_vm_pgtable/hugetlb: Disable hugetlb test on ppc64

2020-09-01 Thread Christophe Leroy
Le 01/09/2020 à 08:30, Aneesh Kumar K.V a écrit : I actually wanted to add #ifdef BROKEN. That test is completely broken. Infact I would suggest to remove that test completely. #ifdef will not be required here as there would be a stub definition for hugetlb_advanced_tests() when

Re: [PATCH v3 08/13] mm/debug_vm_pgtable/thp: Use page table depost/withdraw with THP

2020-09-01 Thread Christophe Leroy
Le 01/09/2020 à 09:40, Aneesh Kumar K.V a écrit : On 9/1/20 12:20 PM, Christophe Leroy wrote: Le 01/09/2020 à 08:25, Aneesh Kumar K.V a écrit : On 9/1/20 8:52 AM, Anshuman Khandual wrote: There is a checkpatch.pl warning here. WARNING: Possible unwrapped commit description (prefer

[PATCH] powerpc/powermac: Fix low_sleep_handler with KUAP and KUEP

2020-09-01 Thread Christophe Leroy
low_sleep_handler() has an hardcoded restore of segment registers that doesn't take KUAP and KUEP into account. Use head_32's load_segment_registers() routine instead. Signed-off-by: Christophe Leroy Fixes: a68c31fc01ef ("powerpc/32s: Implement Kernel Userspace Access Protection&qu

Re: [PATCH v11] Fixup for "powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32"

2020-09-01 Thread Christophe Leroy
+, Christophe Leroy wrote: Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/vdso/gettimeofday.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/include/asm/vdso/gettimeofday.h b/arch/powerpc/include/asm/vdso/gettimeofday.h index 59a609a48b63..8da84722729b

Re: [PATCH v3 08/13] mm/debug_vm_pgtable/thp: Use page table depost/withdraw with THP

2020-09-01 Thread Christophe Leroy
Le 01/09/2020 à 08:25, Aneesh Kumar K.V a écrit : On 9/1/20 8:52 AM, Anshuman Khandual wrote: There is a checkpatch.pl warning here. WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) #7: Architectures like ppc64 use deposited page table while updating

[PATCH v11] Fixup for "powerpc/vdso: Provide __kernel_clock_gettime64() on vdso32"

2020-08-31 Thread Christophe Leroy
Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/vdso/gettimeofday.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/include/asm/vdso/gettimeofday.h b/arch/powerpc/include/asm/vdso/gettimeofday.h index 59a609a48b63..8da84722729b 100644 --- a/arch/powerpc/include

[PATCH 1/2] powerpc/8xx: Refactor calculation of number of entries per PTE in page tables

2020-08-31 Thread Christophe Leroy
, the val param is unused. It will be used by following patch. Instead of opencoding is_hugepd(), use hugepd_ok() with a forward declaration. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 18 -- arch/powerpc/mm/pgtable.c| 6

[PATCH 2/2] powerpc/8xx: Support 16k hugepages with 4k pages

2020-08-31 Thread Christophe Leroy
_PAGE_HUGE. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/hugetlb-8xx.h | 14 ++ arch/powerpc/include/asm/nohash/32/pgtable.h | 2 ++ arch/powerpc/mm/hugetlbpage.c| 2 +- arch/powerpc/mm/nohash/tlb.c | 4 arch

[PATCH] selftests/vm: Fix display of page size in map_hugetlb

2020-08-31 Thread Christophe Leroy
The displayed size is in bytes while the text says it is in kB. Shift it by 10 to really display kBytes. Fixes: fa7b9a805c79 ("tools/selftest/vm: allow choosing mem size and page size in map_hugetlb") Cc: sta...@vger.kernel.org Signed-off-by: Christophe Leroy --- tools/testing/se

[PATCH] powerpc: Fix random segfault when freeing hugetlb range

2020-08-31 Thread Christophe Leroy
as standard pages.") Cc: sta...@vger.kernel.org Signed-off-by: Christophe Leroy --- arch/powerpc/mm/hugetlbpage.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 26292544630f..e7a

Re: [PATCH] fsldma: fsl_ioread64*() do not need lower_32_bits()

2020-08-29 Thread Christophe Leroy
Le 29/08/2020 à 17:05, Guenter Roeck a écrit : On Sat, Aug 29, 2020 at 02:45:38PM +0200, Luc Van Oostenryck wrote: For ppc32, the functions fsl_ioread64() & fsl_ioread64be() use lower_32_bits() as a fancy way to cast the pointer to u32 in order to do non-atomic 64-bit IO. But the pointer is

[PATCH v2 5/5] powerpc/vdso: Declare vdso_patches[] as __initdata

2020-08-28 Thread Christophe Leroy
vdso_patches[] table is used only at init time. Mark it __initdata. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/vdso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index 4ad042995ccc..dfa08a7b4e7c 100644

[PATCH v2 4/5] powerpc/vdso: Declare constant vars as __ro_after_init

2020-08-28 Thread Christophe Leroy
To avoid any risk of modification of vital VDSO variables, declare them __ro_after_init. vdso32_kbase and vdso64_kbase could be made 'const', but it would have high impact on all functions using them as the compiler doesn't expect const property to be discarded. Signed-off-by: Christophe Leroy

[PATCH v2 3/5] powerpc/vdso: Initialise vdso32_kbase at compile time

2020-08-28 Thread Christophe Leroy
Initialise vdso32_kbase at compile time like vdso64_kbase. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/vdso.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index 8f245e988a8a..fb393266b9cb 100644

[PATCH v2 1/5] powerpc/vdso: Remove DBG()

2020-08-28 Thread Christophe Leroy
. Just remove them. If one day someone need such messages back, use a standard pr_debug() or equivalent. Signed-off-by: Christophe Leroy --- This is a follow up series, applying on top of the series that switches powerpc VDSO to _install_special_mapping(), rebased on today's powerpc/next-test

[PATCH v2 2/5] powerpc/vdso: Don't rely on vdso_pages being 0 for failure

2020-08-28 Thread Christophe Leroy
If vdso initialisation failed, vdso_ready is not set. Otherwise, vdso_pages is only 0 when it is a 32 bits task and CONFIG_VDSO32 is not selected. As arch_setup_additional_pages() now bails out directly in that case, we don't need to set vdso_pages to 0. Signed-off-by: Christophe Leroy

Re: [PATCH v1 4/9] powerpc/vdso: Remove unnecessary ifdefs in vdso_pagelist initialization

2020-08-27 Thread Christophe Leroy
Le 28/08/2020 à 07:40, Christophe Leroy a écrit : Le 27/08/2020 à 15:19, Michael Ellerman a écrit : Christophe Leroy writes: On 08/26/2020 02:58 PM, Michael Ellerman wrote: Christophe Leroy writes: diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index daef14a284a3

Re: [PATCH v1 4/9] powerpc/vdso: Remove unnecessary ifdefs in vdso_pagelist initialization

2020-08-27 Thread Christophe Leroy
Le 27/08/2020 à 15:19, Michael Ellerman a écrit : Christophe Leroy writes: On 08/26/2020 02:58 PM, Michael Ellerman wrote: Christophe Leroy writes: diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index daef14a284a3..bbb69832fd46 100644 --- a/arch/powerpc/kernel

[PATCH v2] powerpc/32s: Disable VMAP stack which CONFIG_ADB_PMU

2020-08-27 Thread Christophe Leroy
Signed-off-by: Christophe Leroy --- v2: Argh, went too quick. CONFIG_ADB_PMU ==> ADB_PMU --- arch/powerpc/platforms/Kconfig.cputype | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 87737ec86d39..1dc9d3

Re: kernel since 5.6 do not boot anymore on Apple PowerBook

2020-08-27 Thread Christophe Leroy
Le 27/08/2020 à 16:37, Giuseppe Sacco a écrit : Il giorno gio, 27/08/2020 alle 12.39 +0200, Christophe Leroy ha scritto: Hi, Le 27/08/2020 à 10:28, Giuseppe Sacco a écrit : [...] Sorry, I made a mistake. The real problem is down, on the same function, when it calls low_sleep_handler

[PATCH] powerpc/32s: Disable VMAP stack which CONFIG_ADB_PMU

2020-08-27 Thread Christophe Leroy
Signed-off-by: Christophe Leroy --- arch/powerpc/platforms/Kconfig.cputype | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype index 87737ec86d39..c12768242c17 100644 --- a/arch/powerpc/platforms/Kconfig.cputype

Re: [PATCH v2 25/25] powerpc/signal32: Transform save_user_regs() and save_tm_user_regs() in 'unsafe' version

2020-08-27 Thread Christophe Leroy
. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Christophe-Leroy/powerpc-Switch-signal-32-to-using-unsafe_put_user-and-friends/20200819-012411 base: https://git.kernel.org/pub/scm/linux

[PATCH v1 6/6] powerpc/vdso: Declare vdso_patches[] as __initdata

2020-08-27 Thread Christophe Leroy
vdso_patches[] table is used only at init time. Mark it __initdata. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/vdso.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index 600df1164a0b..efaaee94f273 100644

[PATCH v1 4/6] powerpc/vdso: Initialise vdso32_kbase at compile time

2020-08-27 Thread Christophe Leroy
Initialise vdso32_kbase at compile time like vdso64_kbase. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/vdso.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c index c173c70ca7d2..6390a37dacea 100644

[PATCH v1 3/6] powerpc/vdso: Don't rely on vdso_pages being 0 for failure

2020-08-27 Thread Christophe Leroy
If vdso initialisation failed, vdso_ready is not set. Otherwise, vdso_pages is only 0 when it is a 32 bits task and CONFIG_VDSO32 is not selected. As arch_setup_additional_pages() now bails out directly in that case, we don't need to set vdso_pages to 0. Signed-off-by: Christophe Leroy

[PATCH v1 5/6] powerpc/vdso: Declare constant vars as __ro_after_init

2020-08-27 Thread Christophe Leroy
To avoid any risk of modification of vital VDSO variables, declare them __ro_after_init. vdso32_kbase and vdso64_kbase could be made 'const', but it would have high impact on all functions using them as the compiler doesn't expect const property to be discarded. Signed-off-by: Christophe Leroy

  1   2   3   4   5   6   7   8   9   10   >