Re: [PATCH kernel 2/6] powerpc/powernv: Move TCE manupulation code to its own file

2018-06-08 Thread David Gibson
On Fri, Jun 08, 2018 at 03:46:29PM +1000, Alexey Kardashevskiy wrote: > Right now we have allocation code in pci-ioda.c and traversing code in > pci.c, let's keep them toghether. However both files are big enough > already so let's move this business to a new file. > > While we at it, move the

Re: [PATCH kernel 1/6] powerpc/powernv: Remove useless wrapper

2018-06-08 Thread David Gibson
On Fri, Jun 08, 2018 at 03:46:28PM +1000, Alexey Kardashevskiy wrote: > This gets rid of a useless wrapper around > pnv_pci_ioda2_table_free_pages(). > > Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson > --- > arch/powerpc/platforms/powernv/pci-ioda.c | 7 +-- > 1 file

Re: [PATCH v5 3/4] powerpc/lib: implement strlen() in assembly

2018-06-08 Thread Segher Boessenkool
Hi! On Fri, Jun 08, 2018 at 01:27:39PM +, Christophe Leroy wrote: > --- > Not tested on PPC64. > +#ifdef CPU_LITTLE_ENDIAN > + rldicl. r8, r9, 0, 56 > + beq 20f > + rldicl. r8, r9, 56, 56 > + beq 21f > + rldicl. r8, r9, 48, 56 > + beq 22f > + rldicl.

Re: pkeys on POWER: Access rights not reset on execve

2018-06-08 Thread Michal Suchánek
On Fri, 8 Jun 2018 15:51:03 +0200 Florian Weimer wrote: > On 06/08/2018 03:49 PM, Michal Suchánek wrote: > > On Fri, 8 Jun 2018 14:57:06 +0200 > > Florian Weimer wrote: > > > >> On 06/08/2018 02:54 PM, Michal Suchánek wrote: > >>> On Fri, 8 Jun 2018 12:44:53 +0200 > >>> Florian Weimer

Re: pkeys on POWER: Access rights not reset on execve

2018-06-08 Thread Florian Weimer
On 06/08/2018 03:49 PM, Michal Suchánek wrote: On Fri, 8 Jun 2018 14:57:06 +0200 Florian Weimer wrote: On 06/08/2018 02:54 PM, Michal Suchánek wrote: On Fri, 8 Jun 2018 12:44:53 +0200 Florian Weimer wrote: On 06/08/2018 12:15 PM, Michal Suchánek wrote: On Fri, 8 Jun 2018 07:53:51

Re: pkeys on POWER: Access rights not reset on execve

2018-06-08 Thread Michal Suchánek
On Fri, 8 Jun 2018 14:57:06 +0200 Florian Weimer wrote: > On 06/08/2018 02:54 PM, Michal Suchánek wrote: > > On Fri, 8 Jun 2018 12:44:53 +0200 > > Florian Weimer wrote: > > > >> On 06/08/2018 12:15 PM, Michal Suchánek wrote: > >>> On Fri, 8 Jun 2018 07:53:51 +0200 > >>> Florian Weimer

[PATCH v5 4/4] selftests/powerpc: update strlen() test to test the new assembly function

2018-06-08 Thread Christophe Leroy
This patch modifies the test for testing the new assembly strlen() instead of the generic strlen() Signed-off-by: Christophe Leroy --- v5: no change v4: new tools/testing/selftests/powerpc/stringloops/Makefile | 3 +-- .../selftests/powerpc/stringloops/asm/cache.h| 1 +

[PATCH v5 1/4] selftests/powerpc: add test for 32 bits memcmp

2018-06-08 Thread Christophe Leroy
This patch renames memcmp test to memcmp_64 and adds a memcmp_32 test for testing the 32 bits version of memcmp() Signed-off-by: Christophe Leroy --- v5: no change v4: new tools/testing/selftests/powerpc/stringloops/Makefile| 14 +++---

[PATCH v5 2/4] selftests/powerpc: Add test for strlen()

2018-06-08 Thread Christophe Leroy
This patch adds a test for strlen() string.c contains a copy of strlen() from lib/string.c The test first tests the correctness of strlen() by comparing the result with libc strlen(). It tests all cases of alignment. It them tests the duration of an aligned strlen() on a 4 bytes string, on a 16

[PATCH v5 3/4] powerpc/lib: implement strlen() in assembly

2018-06-08 Thread Christophe Leroy
The generic implementation of strlen() reads strings byte per byte. This patch implements strlen() in assembly based on a read of entire words, in the same spirit as what some other arches and glibc do. On a 8xx the time spent in strlen is reduced by 2/3 for long strings. strlen() selftest on

Re: pkeys on POWER: Access rights not reset on execve

2018-06-08 Thread Florian Weimer
On 06/08/2018 02:54 PM, Michal Suchánek wrote: On Fri, 8 Jun 2018 12:44:53 +0200 Florian Weimer wrote: On 06/08/2018 12:15 PM, Michal Suchánek wrote: On Fri, 8 Jun 2018 07:53:51 +0200 Florian Weimer wrote: On 06/08/2018 04:34 AM, Ram Pai wrote: So the remaining question at this point

Re: pkeys on POWER: Access rights not reset on execve

2018-06-08 Thread Michal Suchánek
On Fri, 8 Jun 2018 12:44:53 +0200 Florian Weimer wrote: > On 06/08/2018 12:15 PM, Michal Suchánek wrote: > > On Fri, 8 Jun 2018 07:53:51 +0200 > > Florian Weimer wrote: > > > >> On 06/08/2018 04:34 AM, Ram Pai wrote: > > So the remaining question at this point is whether the

Re: [PATCH v4 3/4] powerpc/lib: implement strlen() in assembly

2018-06-08 Thread Segher Boessenkool
On Fri, Jun 08, 2018 at 01:45:13PM +0200, Gabriel Paubert wrote: > On Fri, Jun 08, 2018 at 10:20:41AM +, Christophe Leroy wrote: > > + rlwinm. r8, r9, 0, 0xff00 > > + beq 20f > > + rlwinm. r8, r9, 0, 0x00ff > > + beq 21f > > + rlwinm. r8, r9, 0, 0xff00 > > + beq

Re: [PATCH v4 3/4] powerpc/lib: implement strlen() in assembly

2018-06-08 Thread Gabriel Paubert
On Fri, Jun 08, 2018 at 10:20:41AM +, Christophe Leroy wrote: > The generic implementation of strlen() reads strings byte per byte. > > This patch implements strlen() in assembly based on a read of entire > words, in the same spirit as what some other arches and glibc do. > > On a 8xx the

Re: pkeys on POWER: Access rights not reset on execve

2018-06-08 Thread Florian Weimer
On 06/08/2018 12:15 PM, Michal Suchánek wrote: On Fri, 8 Jun 2018 07:53:51 +0200 Florian Weimer wrote: On 06/08/2018 04:34 AM, Ram Pai wrote: So the remaining question at this point is whether the Intel behavior (default-deny instead of default-allow) is preferable. Florian, remind me

Re: [v3 PATCH 2/5] powerpc/pseries: Fix endainness while restoring of r3 in MCE handler.

2018-06-08 Thread Mahesh Jagannath Salgaonkar
On 06/08/2018 12:20 PM, Michael Ellerman wrote: > Mahesh J Salgaonkar writes: >> From: Mahesh Salgaonkar >> >> During Machine Check interrupt on pseries platform, register r3 points >> RTAS extended event log passed by hypervisor. Since hypervisor uses r3 >> to pass pointer to rtas log, it

[PATCH v4 4/4] selftests/powerpc: update strlen() test to test the new assembly function

2018-06-08 Thread Christophe Leroy
This patch modifies the test for testing the new assembly strlen() instead of the generic strlen() Signed-off-by: Christophe Leroy --- v4: new tools/testing/selftests/powerpc/stringloops/Makefile | 3 +-- .../selftests/powerpc/stringloops/asm/cache.h| 1 +

[PATCH v4 1/4] selftests/powerpc: add test for 32 bits memcmp

2018-06-08 Thread Christophe Leroy
This patch renames memcmp test to memcmp_64 and adds a memcmp_32 test for testing the 32 bits version of memcmp() Signed-off-by: Christophe Leroy --- v4: new tools/testing/selftests/powerpc/stringloops/Makefile| 14 +++--- tools/testing/selftests/powerpc/stringloops/memcmp_32 |

[PATCH v4 3/4] powerpc/lib: implement strlen() in assembly

2018-06-08 Thread Christophe Leroy
The generic implementation of strlen() reads strings byte per byte. This patch implements strlen() in assembly based on a read of entire words, in the same spirit as what some other arches and glibc do. On a 8xx the time spent in strlen is reduced by 2/3 for long strings. strlen() selftest on

[PATCH v4 2/4] selftests/powerpc: Add test for strlen()

2018-06-08 Thread Christophe Leroy
This patch adds a test for strlen() string.c contains a copy of strlen() from lib/string.c The test first tests the correctness of strlen() by comparing the result with libc strlen(). It tests all cases of alignment. It them tests the duration of an aligned strlen() on a 4 bytes string, on a 16

Re: pkeys on POWER: Access rights not reset on execve

2018-06-08 Thread Michal Suchánek
On Fri, 8 Jun 2018 07:53:51 +0200 Florian Weimer wrote: > On 06/08/2018 04:34 AM, Ram Pai wrote: > >> > >> So the remaining question at this point is whether the Intel > >> behavior (default-deny instead of default-allow) is preferable. > > > > Florian, remind me what behavior needs to fixed?

[PATCH] media: fsl-viu: Use proper check for presence of {out, in}_be32()

2018-06-08 Thread Geert Uytterhoeven
When compile-testing on m68k or microblaze: drivers/media/platform/fsl-viu.c:41:1: warning: "out_be32" redefined drivers/media/platform/fsl-viu.c:42:1: warning: "in_be32" redefined Fix this by replacing the check for PowerPC by checks for the presence of {out,in}_be32(). As PowerPC

Re: [v3, 07/10] fsl/fman_port: support getting timestamp

2018-06-08 Thread kbuild test robot
Hi Yangbo, I love your patch! Perhaps something to improve: [auto build test WARNING on net-next/master] [also build test WARNING on next-20180608] [cannot apply to v4.17] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https

Re: [RFC V2] virtio: Add platform specific DMA API translation for virito devices

2018-06-08 Thread Christoph Hellwig
On Thu, Jun 07, 2018 at 07:28:35PM +0300, Michael S. Tsirkin wrote: > Let me restate it: DMA API has support for a wide range of hardware, and > hardware based virtio implementations likely won't benefit from all of > it. That is completely wrong. All aspects of the DMA API are about the system

Re: [PATCH v3] powerpc: Add support for function error injection

2018-06-08 Thread Samuel Mendoza-Jonas
On Thu, 2018-06-07 at 15:22 +0530, Naveen N. Rao wrote: > We implement regs_set_return_value() and override_function_with_return() > for this purpose. > > On powerpc, a return from a function (blr) just branches to the location > contained in the link register. So, we can just update pt_regs

Re: [v3 PATCH 2/5] powerpc/pseries: Fix endainness while restoring of r3 in MCE handler.

2018-06-08 Thread Michael Ellerman
Mahesh J Salgaonkar writes: > From: Mahesh Salgaonkar > > During Machine Check interrupt on pseries platform, register r3 points > RTAS extended event log passed by hypervisor. Since hypervisor uses r3 > to pass pointer to rtas log, it stores the original r3 value at the > start of the memory

Re: [v3 PATCH 5/5] powerpc/pseries: Display machine check error details.

2018-06-08 Thread Mahesh Jagannath Salgaonkar
On 06/08/2018 07:21 AM, Nicholas Piggin wrote: > On Thu, 07 Jun 2018 22:59:04 +0530 > Mahesh J Salgaonkar wrote: > >> From: Mahesh Salgaonkar >> >> Extract the MCE error details from RTAS extended log and display it to >> console. >> >> With this patch you should now see mce logs like below: >>

Re: [v3 PATCH 4/5] powerpc/pseries: Dump and flush SLB contents on SLB MCE errors.

2018-06-08 Thread Mahesh Jagannath Salgaonkar
On 06/08/2018 07:18 AM, Nicholas Piggin wrote: > On Thu, 07 Jun 2018 22:58:55 +0530 > Mahesh J Salgaonkar wrote: > >> From: Mahesh Salgaonkar >> >> If we get a machine check exceptions due to SLB errors then dump the >> current SLB contents which will be very much helpful in debugging the >>

Re: [v3 PATCH 1/5] powerpc/pseries: convert rtas_log_buf to linear allocation.

2018-06-08 Thread Mahesh Jagannath Salgaonkar
On 06/08/2018 07:01 AM, Nicholas Piggin wrote: > On Thu, 07 Jun 2018 22:58:11 +0530 > Mahesh J Salgaonkar wrote: > >> From: Mahesh Salgaonkar >> >> rtas_log_buf is a buffer to hold RTAS event data that are communicated >> to kernel by hypervisor. This buffer is then used to pass RTAS event >>

Re: pkeys on POWER: Access rights not reset on execve

2018-06-08 Thread Florian Weimer
On 06/08/2018 04:34 AM, Ram Pai wrote: So the remaining question at this point is whether the Intel behavior (default-deny instead of default-allow) is preferable. Florian, remind me what behavior needs to fixed? See the other thread. The Intel register equivalent to the AMR by default

[PATCH kernel 6/6] powerpc/powernv/ioda: Allocate indirect TCE levels on demand

2018-06-08 Thread Alexey Kardashevskiy
At the moment we allocate the entire TCE table, twice (hardware part and userspace translation cache). This normally works as we normally have contigous memory and the guest will map entire RAM for 64bit DMA. However if we have sparse RAM (one example is a memory device), then we will allocate