Re: [RFC PATCH for 4.18 09/16] powerpc: Add syscall detection for restartable sequences

2018-06-04 Thread Michael Ellerman
Mathieu Desnoyers writes: > From: Boqun Feng > > Syscalls are not allowed inside restartable sequences, so add a call to > rseq_syscall() at the very beginning of system call exiting path for > CONFIG_DEBUG_RSEQ=y kernel. This could help us to detect whether there > is a syscall issued inside

Re: [RFC PATCH for 4.18 10/16] powerpc: Wire up restartable sequences system call

2018-06-04 Thread Michael Ellerman
Mathieu Desnoyers writes: > From: Boqun Feng > > Wire up the rseq system call on powerpc. > > This provides an ABI improving the speed of a user-space getcpu > operation on powerpc by skipping the getcpu system call on the fast > path, as well as improving the speed of user-space operations on

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

2018-06-04 Thread Christoph Hellwig
On Tue, Jun 05, 2018 at 09:26:56AM +1000, Benjamin Herrenschmidt wrote: > Sorry Michael, that doesn't click. Yes of course virtio is implemented > in qemu, but the problem we are trying to solve is *not* a qemu problem > (the fact that the Linux drivers bypass the DMA API is wrong, needs > fixing,

Re: [PATCH v7 0/5] powerpc/64: memcmp() optimization

2018-06-04 Thread Simon Guo
Hi Michael, On Tue, Jun 05, 2018 at 12:16:22PM +1000, Michael Ellerman wrote: > Hi Simon, > > wei.guo.si...@gmail.com writes: > > From: Simon Guo > > > > There is some room to optimize memcmp() in powerpc 64 bits version for > > following 2 cases: > > (1) Even src/dst addresses are not aligned

Re: [PATCH] cpuidle:powernv: Make the snooze timeout dynamic.

2018-06-04 Thread Stewart Smith
Michael Ellerman writes: > "Gautham R. Shenoy" writes: > >> From: "Gautham R. Shenoy" >> >> The commit 78eaa10f027c ("cpuidle: powernv/pseries: Auto-promotion of >> snooze to deeper idle state") introduced a timeout for the snooze idle >> state so that it could be eventually be promoted to a

RE: [PATCH 09/10] dpaa_eth: add support for hardware timestamping

2018-06-04 Thread Y.b. Lu
Hi Richard, > -Original Message- > From: Richard Cochran [mailto:richardcoch...@gmail.com] > Sent: Monday, June 4, 2018 9:49 PM > To: Y.b. Lu > Cc: net...@vger.kernel.org; Madalin-cristian Bucur > ; Rob Herring ; Shawn Guo > ; David S . Miller ; > devicet...@vger.kernel.org;

Re: [PATCH v7 0/5] powerpc/64: memcmp() optimization

2018-06-04 Thread Michael Ellerman
Hi Simon, wei.guo.si...@gmail.com writes: > From: Simon Guo > > There is some room to optimize memcmp() in powerpc 64 bits version for > following 2 cases: > (1) Even src/dst addresses are not aligned with 8 bytes at the beginning, > memcmp() can align them and go with .Llong comparision mode

[PATCH 5/5] powerpc/pkeys: make protection key 0 less special

2018-06-04 Thread Ram Pai
Applications need the ability to associate an address-range with some key and latter revert to its initial default key. Pkey-0 comes close to providing this function but falls short, because the current implementation disallows applications to explicitly associate pkey-0 to the address range.

[PATCH 4/5] powerpc/pkeys: Preallocate execute-only key

2018-06-04 Thread Ram Pai
execute-only key is allocated dynamically. This is a problem. When a thread implicitly creates a execute-only key, and resets UAMOR for that key, the UAMOR value does not percolate to all the other threads. Any other thread may ignorantly change the permissions on the key. This can cause the

[PATCH 3/5] powerpc/pkeys: fix calculation of total pkeys.

2018-06-04 Thread Ram Pai
Total number of pkeys calculation is off by 1. Fix it. CC: Florian Weimer CC: Michael Ellerman CC: Thiago Jung Bauermann Signed-off-by: Ram Pai --- arch/powerpc/mm/pkeys.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/mm/pkeys.c

[PATCH 1/5] powerpc/pkeys: Enable all user-allocatable pkeys at init.

2018-06-04 Thread Ram Pai
In a multithreaded application, a key allocated by one thread must be activate and usable on all threads. Currently this is not the case, because the UAMOR bits for all keys are disabled by default. When a new key is allocated in one thread, though the corresponding UAMOR bits for that thread get

[PATCH 2/5] powerpc/pkeys: Save the pkey registers before fork

2018-06-04 Thread Ram Pai
When a thread forks the contents of AMR, IAMR, UAMOR registers in the newly forked thread are not inherited. Save the registers before forking, for content of those registers to be automatically copied into the new thread. CC: Michael Ellerman CC: Florian Weimer CC: Andy Lutomirski CC: Thiago

[PATCH 0/5] powerpc/pkeys: fixes to pkeys

2018-06-04 Thread Ram Pai
Assortment of fixes to pkey. Patch 1 makes pkey consumable in multithreaded applications. Patch 2 fixes fork behavior to inherit the key attributes. Patch 3 A off-by-one bug made one key unusable. Fixes it. Patch 4 Makes pkey-0 less special. Ram Pai (5): powerpc/pkeys: Enable all

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

2018-06-04 Thread David Gibson
On Mon, Jun 04, 2018 at 07:48:54PM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2018-06-04 at 18:57 +1000, David Gibson wrote: > > > > > - First qemu doesn't know that the guest will switch to "secure mode" > > > in advance. There is no difference between a normal and a secure > > > partition

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

2018-06-04 Thread Michael S. Tsirkin
On Tue, Jun 05, 2018 at 09:26:56AM +1000, Benjamin Herrenschmidt wrote: > I would like to keep however the ability to bypass the iommu for > performance reasons So that's easy, clear the IOMMU flag and this means "bypass the IOMMU". -- MST

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

2018-06-04 Thread Benjamin Herrenschmidt
On Mon, 2018-06-04 at 19:21 +0300, Michael S. Tsirkin wrote: > > > > > - First qemu doesn't know that the guest will switch to "secure mode" > > > > in advance. There is no difference between a normal and a secure > > > > partition until the partition does the magic UV call to "enter secure > > >

Re: [PATCH net-next] wan/fsl_ucc_hdlc: use dma_zalloc_coherent instead of allocator/memset

2018-06-04 Thread David Miller
From: YueHaibing Date: Mon, 4 Jun 2018 21:07:59 +0800 > Use dma_zalloc_coherent instead of dma_alloc_coherent > followed by memset 0. > > Signed-off-by: YueHaibing Applied.

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

2018-06-04 Thread Florian Weimer
On 06/04/2018 09:02 PM, Ram Pai wrote: On Mon, Jun 04, 2018 at 07:57:46PM +0200, Florian Weimer wrote: On 06/04/2018 04:01 PM, Ram Pai wrote: On Mon, Jun 04, 2018 at 12:12:07PM +0200, Florian Weimer wrote: On 06/03/2018 10:18 PM, Ram Pai wrote: On Mon, May 21, 2018 at 01:29:11PM +0200,

Re: [1/5] powerpc/embedded6xx: Remove C2K board support

2018-06-04 Thread Mark Greer
On Tue, Jun 05, 2018 at 12:10:31AM +1000, Michael Ellerman wrote: > On Fri, 2018-04-06 at 01:17:16 UTC, Mark Greer wrote: > > The C2K platform appears to be orphaned so remove code supporting it. > > > > CC: Remi Machet > > Signed-off-by: Mark Greer > > Acked-by: Remi Machet > > Signed-off-by:

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

2018-06-04 Thread Ram Pai
On Mon, Jun 04, 2018 at 07:57:46PM +0200, Florian Weimer wrote: > On 06/04/2018 04:01 PM, Ram Pai wrote: > >On Mon, Jun 04, 2018 at 12:12:07PM +0200, Florian Weimer wrote: > >>On 06/03/2018 10:18 PM, Ram Pai wrote: > >>>On Mon, May 21, 2018 at 01:29:11PM +0200, Florian Weimer wrote: > On

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

2018-06-04 Thread Florian Weimer
On 06/04/2018 04:01 PM, Ram Pai wrote: On Mon, Jun 04, 2018 at 12:12:07PM +0200, Florian Weimer wrote: On 06/03/2018 10:18 PM, Ram Pai wrote: On Mon, May 21, 2018 at 01:29:11PM +0200, Florian Weimer wrote: On 05/20/2018 09:11 PM, Ram Pai wrote: Florian, Does the following patch fix

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

2018-06-04 Thread Michael S. Tsirkin
On Mon, Jun 04, 2018 at 11:14:36PM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2018-06-04 at 05:55 -0700, Christoph Hellwig wrote: > > On Mon, Jun 04, 2018 at 03:43:09PM +0300, Michael S. Tsirkin wrote: > > > Another is that given the basic functionality is in there, optimizations > > > can

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

2018-06-04 Thread Michael S. Tsirkin
On Mon, Jun 04, 2018 at 11:11:52PM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2018-06-04 at 15:43 +0300, Michael S. Tsirkin wrote: > > On Thu, May 24, 2018 at 08:27:04AM +1000, Benjamin Herrenschmidt wrote: > > > On Wed, 2018-05-23 at 21:50 +0300, Michael S. Tsirkin wrote: > > > > > > > I

[RFC PATCH -tip v5 24/27] bpf: error-inject: kprobes: Clear current_kprobe and enable preempt in kprobe

2018-06-04 Thread Masami Hiramatsu
Clear current_kprobe and enable preemption in kprobe even if pre_handler returns !0. This simplifies function override using kprobes. Jprobe used to require to keep the preemption disabled and keep current_kprobe until it returned to original function entry. For this reason kprobe_int3_handler()

[RFC PATCH -tip v5 18/27] powerpc/kprobes: Don't call the ->break_handler() in arm kprobes code

2018-06-04 Thread Masami Hiramatsu
Don't call the ->break_handler() from the arm kprobes code, because it was only used by jprobes which got removed. This also makes skip_singlestep() a static function since only ftrace-kprobe.c is using this function. Signed-off-by: Masami Hiramatsu Cc: Benjamin Herrenschmidt Cc: Paul

[RFC PATCH -tip v5 07/27] powerpc/kprobes: Remove jprobe powerpc implementation

2018-06-04 Thread Masami Hiramatsu
Remove arch dependent setjump/longjump functions and unused fields in kprobe_ctlblk for jprobes from arch/powerpc. This also reverts commits related __is_active_jprobe() function. Signed-off-by: Masami Hiramatsu Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: "Naveen

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

2018-06-04 Thread Benjamin Herrenschmidt
On Mon, 2018-06-04 at 05:55 -0700, Christoph Hellwig wrote: > On Mon, Jun 04, 2018 at 03:43:09PM +0300, Michael S. Tsirkin wrote: > > Another is that given the basic functionality is in there, optimizations > > can possibly wait until per-device quirks in DMA API are supported. > > We have had

Re: [v4, 1/7] powerpc/64s/radix: do not flush TLB when relaxing access

2018-06-04 Thread Michael Ellerman
On Fri, 2018-06-01 at 10:01:15 UTC, Nicholas Piggin wrote: > Radix flushes the TLB when updating ptes to increase permissiveness > of protection (increase access authority). Book3S does not require > TLB flushing in this case, and it is not done on hash. This patch > avoids the flush for radix. >

Re: powerpc/mm/hugetlb: Update hugetlb related locks

2018-06-04 Thread Michael Ellerman
On Fri, 2018-06-01 at 08:24:24 UTC, "Aneesh Kumar K.V" wrote: > With split pmd page table lock enabled, we don't use mm->page_table_lock when > updating pmd entries. This patch update hugetlb path to use the right lock > when inserting huge page directory entries into page table. > > ex: if we

Re: powerpc/mm/hash: hard disable irq in the SLB insert path

2018-06-04 Thread Michael Ellerman
On Fri, 2018-06-01 at 08:24:02 UTC, "Aneesh Kumar K.V" wrote: > When inserting SLB entries for EA above 512TB, we need to hard disable irq. > This will make sure we don't take a PMU interrupt that can possibly touch > user space address via a stack dump. To prevent this, we need to hard disable >

Re: [v2,20/21] powerpc/xmon: use match_string() helper

2018-06-04 Thread Michael Ellerman
On Thu, 2018-05-31 at 11:11:25 UTC, Yisheng Xie wrote: > match_string() returns the index of an array for a matching string, > which can be used instead of open coded variant. > > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc: linuxppc-dev@lists.ozlabs.org >

Re: powerpc/mm/hash: Add missing update in slb update sequence.

2018-06-04 Thread Michael Ellerman
On Wed, 2018-05-30 at 13:18:04 UTC, "Aneesh Kumar K.V" wrote: > >From ISA > > "For data accesses, the context synchronizing instruction before the slbie, > slbieg, slbia, slbmte, tlbie, or tlbiel instruction ensures that all preceding > instructions that access data storage have completed to a

Re: [v5, 2/4] powerpc/kbuild: remove CROSS32 defines from top level powerpc Makefile

2018-06-04 Thread Michael Ellerman
On Wed, 2018-05-30 at 12:19:20 UTC, Nicholas Piggin wrote: > Switch VDSO32 build over to use CROSS32_COMPILE directly, and have > it pass in -m32 after the standard c_flags. This allows endianness > overrides to be removed and the endian and bitness flags moved into > standard flags variables. >

Re: [v5, 3/4] powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS

2018-06-04 Thread Michael Ellerman
On Wed, 2018-05-30 at 12:19:21 UTC, Nicholas Piggin wrote: > The powerpc toolchain can compile combinations of 32/64 bit and > big/little endian, so it's convenient to consider, e.g., > > `CC -m64 -mbig-endian` > > To be the C compiler for the purpose of invoking it to build target >

Re: [kernel] powerpc/powernv/ioda2: Remove redundand free of TCE pages

2018-06-04 Thread Michael Ellerman
On Wed, 2018-05-30 at 09:22:50 UTC, Alexey Kardashevskiy wrote: > When IODA2 creates a PE, it creates an IOMMU table with it_ops::free > set to pnv_ioda2_table_free() which calls pnv_pci_ioda2_table_free_pages(). > > Since iommu_tce_table_put() calls it_ops::free when the last reference > to the

Re: powerpc/64s: Fix compiler store ordering to SLB shadow area

2018-06-04 Thread Michael Ellerman
On Wed, 2018-05-30 at 10:31:22 UTC, Nicholas Piggin wrote: > The stores to update the SLB shadow area must be made as they appear > in the C code, so that the hypervisor does not see an entry with > mismatched vsid and esid. Use WRITE_ONCE for this. > > GCC has been observed to elide the first

Re: [v5, 1/4] powerpc/kbuild: set default generic machine type for 32-bit compile

2018-06-04 Thread Michael Ellerman
On Wed, 2018-05-30 at 12:19:19 UTC, Nicholas Piggin wrote: > Some 64-bit toolchains uses the wrong ISA variant for compiling 32-bit > kernels, even with -m32. Debian's powerpc64le is one such case, and > that is because it is built with --with-cpu=power8. > > So when cross compiling a 32-bit

Re: [v3] powerpc: fix build failure by disabling attribute-alias warning

2018-06-04 Thread Michael Ellerman
On Tue, 2018-05-29 at 16:06:41 UTC, Christophe Leroy wrote: > Latest GCC version emit the following warnings > > As arch/powerpc code is built with -Werror, this breaks build with > GCC 8.1 > > This patch inhibits those warnings > > CC arch/powerpc/kernel/syscalls.o > In file included

Re: [v3,1/3] powerpc/time: inline arch_vtime_task_switch()

2018-06-04 Thread Michael Ellerman
On Tue, 2018-05-29 at 16:19:14 UTC, Christophe Leroy wrote: > arch_vtime_task_switch() is a small function which is called > only from vtime_common_task_switch(), so it is worth inlining > > Signed-off-by: Christophe Leroy Applied to powerpc next, thanks.

Re: [v6,1/2] powerpc/lib: optimise 32 bits __clear_user()

2018-06-04 Thread Michael Ellerman
On Wed, 2018-05-30 at 07:06:13 UTC, Christophe Leroy wrote: > Rewrite clear_user() on the same principle as memset(0), making use > of dcbz to clear complete cache lines. > > This code is a copy/paste of memset(), with some modifications > in order to retrieve remaining number of bytes to be

Re: powerpc/ptrace: Use copy_{from, to}_user() rather than open-coding

2018-06-04 Thread Michael Ellerman
On Tue, 2018-05-29 at 12:57:38 UTC, Michael Ellerman wrote: > From: Al Viro > > In PPC_PTRACE_GETHWDBGINFO and PPC_PTRACE_SETHWDEBUG we do an > access_ok() check and then __copy_{from,to}_user(). > > Instead we should just use copy_{from,to}_user() which does all that > for us and is less error

Re: [V2, 1/4] powerpc/mm/hugetlb: Update huge_ptep_set_access_flags to call __ptep_set_access_flags directly

2018-06-04 Thread Michael Ellerman
On Tue, 2018-05-29 at 14:28:38 UTC, "Aneesh Kumar K.V" wrote: > In a later patch, we want to update __ptep_set_access_flags take page size > arg. This makes ptep_set_access_flags only work with mmu_virtual_psize. > To simplify the code make huge_ptep_set_access_flags directly call >

Re: powerpc/64s: Enhance the information in cpu_show_spectre_v1()

2018-06-04 Thread Michael Ellerman
On Mon, 2018-05-28 at 13:19:14 UTC, Michal Suchanek wrote: > We now have barrier_nospec as mitigation so print it in > cpu_show_spectre_v1 when enabled. > > Signed-off-by: Michal Suchanek Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/a377514519b9a20fa1ea9adddbb412 cheers

Re: [v2] powerpc/64: Fix build failure with GCC 8.1

2018-06-04 Thread Michael Ellerman
On Tue, 2018-05-29 at 06:03:53 UTC, Christophe Leroy wrote: > CC arch/powerpc/kernel/nvram_64.o > arch/powerpc/kernel/nvram_64.c: In function 'nvram_create_partition': > arch/powerpc/kernel/nvram_64.c:1042:2: error: 'strncpy' specified bound 12 > equals destination size

Re: [v2] selftests/powerpc: Add perf breakpoint test

2018-06-04 Thread Michael Ellerman
On Mon, 2018-05-28 at 23:22:38 UTC, Michael Neuling wrote: > This tests perf hardware breakpoints (ie PERF_TYPE_BREAKPOINT) on > powerpc. > > Signed-off-by: Michael Neuling Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/9c2d72d497a32788bf90f05610319a cheers

Re: powerpc/Makefile: set -mcpu=860 flag for the 8xx

2018-06-04 Thread Michael Ellerman
On Mon, 2018-05-28 at 06:08:34 UTC, Christophe Leroy wrote: > When compiled with GCC 8.1, vmlinux is significantly bigger than > with GCC 4.8. > > When looking at the generated code with objdump, we notice that > all functions and loops when a 16 bytes alignment. This significantly > increases

Re: [v4] powerpc: Implement csum_ipv6_magic in assembly

2018-06-04 Thread Michael Ellerman
On Thu, 2018-05-24 at 11:33:18 UTC, Christophe Leroy wrote: > The generic csum_ipv6_magic() generates a pretty bad result > > : (PPC32) >0: 81 23 00 00 lwz r9,0(r3) >4: 81 03 00 04 lwz r8,4(r3) >8: 7c e7 4a 14 add r7,r7,r9 >c: 7d 29 38 10 subfc

Re: [v2, 01/13] powerpc/eeh: Add eeh_max_freezes to initial EEH log line

2018-06-04 Thread Michael Ellerman
On Fri, 2018-05-25 at 03:11:28 UTC, Sam Bobroff wrote: > The current failure message includes the number of failures that have > occurred in the last hour (for a device) but it does not indicate > how many failures will be tolerated before the device is permanently > disabled. > > Include the

Re: [v2] powerpc/lib: Adjust .balign inside string functions for PPC32

2018-06-04 Thread Michael Ellerman
On Fri, 2018-05-18 at 13:01:16 UTC, Christophe Leroy wrote: > commit 87a156fb18fe1 ("Align hot loops of some string functions") > degraded the performance of string functions by adding useless > nops > > A simple benchmark on an 8xx calling 10x a memchr() that > matches the first byte runs in

Re: powerpc/32: Optimise __csum_partial()

2018-06-04 Thread Michael Ellerman
On Thu, 2018-05-24 at 11:22:27 UTC, Christophe Leroy wrote: > Improve __csum_partial by interleaving loads and adds. > > On a 8xx, it brings neither improvement nor degradation. > On a 83xx, it brings a 25% improvement. > > Signed-off-by: Christophe Leroy > Reviewed-by: Segher Boessenkool

Re: [1/3] powerpc/sstep: Introduce GETTYPE macro

2018-06-04 Thread Michael Ellerman
On Mon, 2018-05-21 at 04:21:06 UTC, Ravi Bangoria wrote: > Replace 'op->type & INSTR_TYPE_MASK' expression with GETTYPE(op->type) > macro. > > Signed-off-by: Ravi Bangoria Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/e6684d07e4308430b9b6497265781a cheers

Re: [v2,1/4] powerpc/perf: Rearrange memory freeing in imc init

2018-06-04 Thread Michael Ellerman
On Tue, 2018-05-22 at 09:12:34 UTC, Anju T Sudhakar wrote: > When any of the IMC (In-Memory Collection counter) devices fail > to initialize, imc_common_mem_free() frees set of memory. In doing so, > pmu_ptr pointer is also freed. But pmu_ptr pointer is used in subsequent > function

Re: [1/2] powerpc: Rename thread_struct.fs to addr_limit

2018-06-04 Thread Michael Ellerman
On Mon, 2018-05-14 at 13:03:15 UTC, Michael Ellerman wrote: > It's called 'fs' for historical reasons, it's named after the x86 'FS' > register. But we don't have to use that name for the member of > thread_struct, and in fact arch/x86 doesn't even call it 'fs' anymore. > > So rename it to

Re: powerpc/xive: Remove (almost) unused macros

2018-06-04 Thread Michael Ellerman
On Fri, 2018-05-11 at 08:03:13 UTC, Russell Currey wrote: > The GETFIELD and SETFIELD macros in xive-regs.h aren't used except for a > single instance of GETFIELD, so replace that and remove them. > > These macros are also defined in vas.h, so either those should be > eventually replaced or the

Re: [v5,1/7] powerpc: Add TIDR CPU feature for POWER9

2018-06-04 Thread Michael Ellerman
On Fri, 2018-05-11 at 06:12:57 UTC, "Alastair D'Silva" wrote: > From: Alastair D'Silva > > This patch adds a CPU feature bit to show whether the CPU has > the TIDR register available, enabling as_notify/wait in userspace. > > Signed-off-by: Alastair D'Silva > Reviewed-by: Frederic Barrat >

Re: powerpc/powernv: process all OPAL event interrupts with kopald

2018-06-04 Thread Michael Ellerman
On Thu, 2018-05-10 at 17:20:05 UTC, Nicholas Piggin wrote: > Using irq_work for processing OPAL event interrupts is not necessary. > irq_work is typically used to schedule work from NMI context, a > softirq may be more appropriate. However OPAL events are not > particularly performance or latency

Re: powerpc/powernv: call OPAL_QUIESCE before OPAL_SIGNAL_SYSTEM_RESET

2018-06-04 Thread Michael Ellerman
On Thu, 2018-05-10 at 12:21:48 UTC, Nicholas Piggin wrote: > Although it is often possible to recover a CPU that was interrupted > from OPAL with a system reset NMI, it's undesirable to interrupt them > for a few reasons. Firstly because dump/debug code itself needs to > call firmware, so it could

Re: [1/2] powerpc/pmu/fsl: fix is_nmi test for irq mask change

2018-06-04 Thread Michael Ellerman
On Thu, 2018-05-10 at 01:04:23 UTC, Nicholas Piggin wrote: > When soft enabled was changed to irq disabled mask, this test missed > being converted (although the equivalent book3s test was converted). > > The PMU drivers consider it an NMI when they take a PMI while general > interrupts are

Re: powerpc: cpm_gpio: Remove owner assignment from platform_driver

2018-06-04 Thread Michael Ellerman
On Sat, 2018-05-05 at 03:01:25 UTC, Fabio Estevam wrote: > From: Fabio Estevam > > Structure platform_driver does not need to set the owner field, as this > will be populated by the driver core. > > Generated by scripts/coccinelle/api/platform_no_drv_owner.cocci. > > Signed-off-by: Fabio

Re: [RFC, 1/4] powerpc/64: Save stack pointer when we hard disable interrupts

2018-06-04 Thread Michael Ellerman
On Wed, 2018-05-02 at 13:07:26 UTC, Michael Ellerman wrote: > A CPU that gets stuck with interrupts hard disable can be difficult to > debug, as on some platforms we have no way to interrupt the CPU to > find out what it's doing. > > A stop-gap is to have the CPU save it's stack pointer (r1) in

Re: [01/11] powerpc/64: irq_work avoid interrupt when called with hardware irqs enabled

2018-06-04 Thread Michael Ellerman
On Fri, 2018-05-04 at 17:19:25 UTC, Nicholas Piggin wrote: > irq_work_raise should not cause a decrementer exception unless it is > called from NMI context. Doing so often just results in an immediate > masked decrementer interrupt: > ><...>-55090d...4us : update_curr_rt

Re: powerpc/xics: add missing of_node_put() in error path

2018-06-04 Thread Michael Ellerman
On Wed, 2018-04-25 at 11:27:07 UTC, YueHaibing wrote: > The device node obtained with of_find_compatible_node() should be > released by calling of_node_put(). But it was not released when > of_get_property() failed. > > Signed-off-by: YueHaibing Applied to powerpc next, thanks.

Re: [1/6] powerpc/64s: Add barrier_nospec

2018-06-04 Thread Michael Ellerman
On Tue, 2018-04-24 at 04:15:54 UTC, Michael Ellerman wrote: > From: Michal Suchanek > > A no-op form of ori (or immediate of 0 into r31 and the result stored > in r31) has been re-tasked as a speculation barrier. The instruction > only acts as a barrier on newer machines with appropriate

Re: [v2] powerpc/signal32: Use fault_in_pages_readable() to prefault user context

2018-06-04 Thread Michael Ellerman
On Tue, 2018-04-24 at 16:04:25 UTC, Christophe Leroy wrote: > Use fault_in_pages_readable() to prefault user context > instead of open coding > > Signed-off-by: Christophe Leroy > Reviewed-by: Mathieu Malaterre Applied to powerpc next, thanks.

Re: powerpc/8xx: Remove RTC clock on 88x

2018-06-04 Thread Michael Ellerman
On Tue, 2018-04-17 at 12:47:35 UTC, Christophe Leroy wrote: > The 885 familly processors don't have the Real Time Clock > > Signed-off-by: Christophe Leroy Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/d04f11d2713e736a3740361f8b5bb4 cheers

Re: [1/5] powerpc: always enable RTC_LIB

2018-06-04 Thread Michael Ellerman
On Mon, 2018-04-23 at 08:36:38 UTC, Arnd Bergmann wrote: > In order to use the rtc_tm_to_time64() and rtc_time64_to_tm() > helper functions in later patches, we have to ensure that > CONFIG_RTC_LIB is always built-in. > > Note that this symbol only controls a couple of helper functions, > not the

Re: powerpc/boot: remove unused variable in mpc8xx

2018-06-04 Thread Michael Ellerman
On Tue, 2018-04-17 at 12:36:45 UTC, Christophe Leroy wrote: > Variable div is set but never used. Remove it. > > Signed-off-by: Christophe Leroy Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/169f438a7e369226a452e0ac4a54db cheers

Re: powerpc/misc: merge reloc_offset() and add_reloc_offset()

2018-06-04 Thread Michael Ellerman
On Tue, 2018-04-17 at 11:23:10 UTC, Christophe Leroy wrote: > reloc_offset() is the same as add_reloc_offset(0) > > Signed-off-by: Christophe Leroy Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/0cc377d16e565b90b43b7550cdf5b3 cheers

Re: powerpc/64: optimises from64to32()

2018-06-04 Thread Michael Ellerman
On Tue, 2018-04-10 at 06:34:35 UTC, Christophe Leroy wrote: > The current implementation of from64to32() gives a poor result: > > 0270 <.from64to32>: > 270: 38 00 ff ff li r0,-1 > 274: 78 69 00 22 rldicl r9,r3,32,32 > 278: 78 00 00 20 clrldi r0,r0,32 > 27c: 7c

Re: [1/5] powerpc/embedded6xx: Remove C2K board support

2018-06-04 Thread Michael Ellerman
On Fri, 2018-04-06 at 01:17:16 UTC, Mark Greer wrote: > The C2K platform appears to be orphaned so remove code supporting it. > > CC: Remi Machet > Signed-off-by: Mark Greer > Acked-by: Remi Machet > Signed-off-by: Mark Greer Series applied to powerpc next, thanks.

Re: hvc_opal: don't set tb_ticks_per_usec in udbg_init_opal_common()

2018-06-04 Thread Michael Ellerman
On Thu, 2018-03-29 at 06:02:46 UTC, Stewart Smith wrote: > time_init() will set up tb_ticks_per_usec based on reality. > time_init() is called *after* udbg_init_opal_common() during boot. > > from arch/powerpc/kernel/time.c: > unsigned long tb_ticks_per_usec = 100; /* sane default */ > >

Re: [1/4] powerpc/mm: constify FIRST_CONTEXT in mmu_context_nohash

2018-06-04 Thread Michael Ellerman
On Wed, 2018-03-21 at 14:07:47 UTC, Christophe Leroy wrote: > First context is now 1 for all supported platforms, so it > can be made a constant. > > Signed-off-by: Christophe Leroy Series applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/8820a44738308a8a1644c6c3d04b47 cheers

Re: powerpc/dma: remove unnecessary BUG()

2018-06-04 Thread Michael Ellerman
On Wed, 2018-02-28 at 18:21:45 UTC, Christophe Leroy wrote: > Direction is already checked in all calling functions in > include/linux/dma-mapping.h and also in called function __dma_sync() > > So really no need to check it once more here. > > Signed-off-by: Christophe Leroy Applied to powerpc

Re: SB600 for the Nemo board has non-zero devices on non-root bus

2018-06-04 Thread Michael Ellerman
On Wed, 2017-12-06 at 11:03:52 UTC, Christian Zigotzky wrote: > On 06 December 2017 at 09:37AM, Christian Zigotzky wrote: > > On 03 December 2017 at 10:43AM, Christian Zigotzky wrote: > > > > > > On 3. Dec 2017, at 00:02, Olof Johansson wrote: > > >> > > >> Typo, should be ';', not ':'. I

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

2018-06-04 Thread Ram Pai
On Mon, Jun 04, 2018 at 12:12:07PM +0200, Florian Weimer wrote: > On 06/03/2018 10:18 PM, Ram Pai wrote: > >On Mon, May 21, 2018 at 01:29:11PM +0200, Florian Weimer wrote: > >>On 05/20/2018 09:11 PM, Ram Pai wrote: > >>>Florian, > >>> > >>> Does the following patch fix the problem for you? Just

Re: [PATCH 09/10] dpaa_eth: add support for hardware timestamping

2018-06-04 Thread Richard Cochran
On Mon, Jun 04, 2018 at 03:08:36PM +0800, Yangbo Lu wrote: > +if FSL_DPAA_ETH > +config FSL_DPAA_ETH_TS > + bool "DPAA hardware timestamping support" > + select PTP_1588_CLOCK_QORIQ > + default n > + help > + Enable DPAA hardware timestamping support. > + This option

Re: [PATCH] fsl/qe: ucc: copy and paste bug in ucc_get_tdm_sync_shift()

2018-06-04 Thread Julia Lawall
On Mon, 4 Jun 2018, Dan Carpenter wrote: > On Mon, Jun 04, 2018 at 10:25:14PM +0900, Julia Lawall wrote: > > > > > > On Mon, 4 Jun 2018, Dan Carpenter wrote: > > > > > There is a copy and paste bug so we accidentally use the RX_ shift when > > > we're in TX_ mode. > > > > > > Fixes:

Re: [PATCH] fsl/qe: ucc: copy and paste bug in ucc_get_tdm_sync_shift()

2018-06-04 Thread Dan Carpenter
On Mon, Jun 04, 2018 at 10:25:14PM +0900, Julia Lawall wrote: > > > On Mon, 4 Jun 2018, Dan Carpenter wrote: > > > There is a copy and paste bug so we accidentally use the RX_ shift when > > we're in TX_ mode. > > > > Fixes: bb8b2062aff3 ("fsl/qe: setup clock source for TDM mode") > >

Re: [PATCH] fsl/qe: ucc: copy and paste bug in ucc_get_tdm_sync_shift()

2018-06-04 Thread Julia Lawall
On Mon, 4 Jun 2018, Dan Carpenter wrote: > There is a copy and paste bug so we accidentally use the RX_ shift when > we're in TX_ mode. > > Fixes: bb8b2062aff3 ("fsl/qe: setup clock source for TDM mode") > Signed-off-by: Dan Carpenter > --- > Static analysis work. Not tested. This affects

[PATCH net-next] wan/fsl_ucc_hdlc: use dma_zalloc_coherent instead of allocator/memset

2018-06-04 Thread YueHaibing
Use dma_zalloc_coherent instead of dma_alloc_coherent followed by memset 0. Signed-off-by: YueHaibing --- drivers/net/wan/fsl_ucc_hdlc.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c index

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

2018-06-04 Thread Christoph Hellwig
On Mon, Jun 04, 2018 at 03:43:09PM +0300, Michael S. Tsirkin wrote: > Another is that given the basic functionality is in there, optimizations > can possibly wait until per-device quirks in DMA API are supported. We have had per-device dma_ops for quite a while.

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

2018-06-04 Thread Benjamin Herrenschmidt
On Mon, 2018-06-04 at 15:43 +0300, Michael S. Tsirkin wrote: > On Thu, May 24, 2018 at 08:27:04AM +1000, Benjamin Herrenschmidt wrote: > > On Wed, 2018-05-23 at 21:50 +0300, Michael S. Tsirkin wrote: > > > > > I re-read that discussion and I'm still unclear on the > > > original question, since I

Re: [RFC PATCH v2 00/14] Remove unneccessary included headers

2018-06-04 Thread Michael Ellerman
Christophe Leroy writes: > The purpose of this serie is to limit the number of includes to > only the necessary ones in order to reduce the number of files > recompiled everytime a header file is modified. > > This is the start of the work, please provide feedback if any so > that I don't go in

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

2018-06-04 Thread Michael S. Tsirkin
On Mon, Jun 04, 2018 at 07:48:54PM +1000, Benjamin Herrenschmidt wrote: > On Mon, 2018-06-04 at 18:57 +1000, David Gibson wrote: > > > > > - First qemu doesn't know that the guest will switch to "secure mode" > > > in advance. There is no difference between a normal and a secure > > > partition

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

2018-06-04 Thread Michael S. Tsirkin
On Thu, May 24, 2018 at 08:27:04AM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2018-05-23 at 21:50 +0300, Michael S. Tsirkin wrote: > > > I re-read that discussion and I'm still unclear on the > > original question, since I got several apparently > > conflicting answers. > > > > I asked: > >

Re: [PATCH] fsl/qe: ucc: copy and paste bug in ucc_get_tdm_sync_shift()

2018-06-04 Thread Mathieu Malaterre
Where did the original go ? https://patchwork.ozlabs.org/patch/868158/ On Mon, Jun 4, 2018 at 2:02 PM Dan Carpenter wrote: > > There is a copy and paste bug so we accidentally use the RX_ shift when > we're in TX_ mode. > > Fixes: bb8b2062aff3 ("fsl/qe: setup clock source for TDM mode") >

Re: [PATCH 10/11] macintosh/via-pmu: Clean up interrupt statistics

2018-06-04 Thread Geert Uytterhoeven
Hi Finn, On Sat, Jun 2, 2018 at 5:27 AM, Finn Thain wrote: > Replace an open-coded ffs() with the function call. > Simplify an if-else cascade using a switch statement. > Correct a typo and an indentation issue. > > Tested-by: Stan Johnson > Signed-off-by: Finn Thain Thanks for your patch!

[PATCH] fsl/qe: ucc: copy and paste bug in ucc_get_tdm_sync_shift()

2018-06-04 Thread Dan Carpenter
There is a copy and paste bug so we accidentally use the RX_ shift when we're in TX_ mode. Fixes: bb8b2062aff3 ("fsl/qe: setup clock source for TDM mode") Signed-off-by: Dan Carpenter --- Static analysis work. Not tested. This affects the success path, so we should probably test it. diff

Re: [PATCH 08/11] macintosh/via-pmu: Replace via-pmu68k driver with via-pmu driver

2018-06-04 Thread Geert Uytterhoeven
Hi Finn, On Sat, Jun 2, 2018 at 5:27 AM, Finn Thain wrote: > Now that the PowerMac via-pmu driver supports m68k PowerBooks, > switch over to that driver and remove the via-pmu68k driver. Thanks! > Don't call pmu_shutdown() or pmu_restart() on early PowerBooks: > the PMU device found in these

Re: [PATCH 03/11] macintosh/via-pmu: Don't clear shift register interrupt flag twice

2018-06-04 Thread Geert Uytterhoeven
On Sat, Jun 2, 2018 at 5:27 AM, Finn Thain wrote: > Clearing the interrupt flag twice in succession creates a theoretical > race condition. Fix this. I would add that the caller of pmu_sr_intr() has already cleared the flag, so the casual reviewer doesn't have to hunt for it. > Tested-by: Stan

Re: [PATCH 02/11] macintosh/via-pmu: Add missing mmio accessors

2018-06-04 Thread Geert Uytterhoeven
On Sat, Jun 2, 2018 at 5:27 AM, Finn Thain wrote: > Add missing in_8() accessors to init_pmu() and pmu_sr_intr(). > > This fixes several sparse warnings: > drivers/macintosh/via-pmu.c:536:29: warning: dereference of noderef expression > drivers/macintosh/via-pmu.c:537:33: warning: dereference of

Re: [PATCH v2] cpuidle/powernv : Add Description for cpuidle state

2018-06-04 Thread Akshay Adiga
On Mon, Jun 04, 2018 at 07:04:14PM +1000, Benjamin Herrenschmidt wrote: > Is this a new property ? I'm not fan of adding yet another of those > silly arrays. > > I would say this is the right time now to switch over to a node per > state instead, as we discussed with Vaidy. I posted the node

Re: [PATCH 01/11] macintosh/via-pmu: Fix section mismatch warning

2018-06-04 Thread Geert Uytterhoeven
Hi Finn, On Sat, Jun 2, 2018 at 5:27 AM, Finn Thain wrote: > The pmu_init() function has the __init qualifier, but the ops struct > that holds a pointer to it does not. This causes a build warning. > The driver works fine because the pointer is only dereferenced early. > > The function is so

Re: [PATCH] cpuidle:powernv: Make the snooze timeout dynamic.

2018-06-04 Thread Michael Ellerman
"Gautham R. Shenoy" writes: > From: "Gautham R. Shenoy" > > The commit 78eaa10f027c ("cpuidle: powernv/pseries: Auto-promotion of > snooze to deeper idle state") introduced a timeout for the snooze idle > state so that it could be eventually be promoted to a deeper idle > state. The snooze

Re: linux-next: Signed-off-by missing for commit in the powerpc tree

2018-06-04 Thread Michael Ellerman
Stephen Rothwell writes: > Hi all, > > Commit > > cb3d6759a93c ("powerpc/64s: Enable barrier_nospec based on firmware > settings") > > is missing a Signed-off-by from its author. Sorry my fault. cheers

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

2018-06-04 Thread Florian Weimer
On 06/03/2018 10:18 PM, Ram Pai wrote: On Mon, May 21, 2018 at 01:29:11PM +0200, Florian Weimer wrote: On 05/20/2018 09:11 PM, Ram Pai wrote: Florian, Does the following patch fix the problem for you? Just like x86 I am enabling all keys in the UAMOR register during

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

2018-06-04 Thread Benjamin Herrenschmidt
On Mon, 2018-06-04 at 18:57 +1000, David Gibson wrote: > > > - First qemu doesn't know that the guest will switch to "secure mode" > > in advance. There is no difference between a normal and a secure > > partition until the partition does the magic UV call to "enter secure > > mode" and qemu

Re: [PATCH v2 07/13] powerpc/eeh: Clean up pci_ers_result handling

2018-06-04 Thread Michael Ellerman
Sam Bobroff writes: > On Sat, Jun 02, 2018 at 01:40:46AM +1000, Michael Ellerman wrote: >> Sam Bobroff writes: >> >> > As EEH event handling progresses, a cumulative result of type >> > pci_ers_result is built up by (some of) the eeh_report_*() functions >> > using either: >> >if (rc ==

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

2018-06-04 Thread David Gibson
On Thu, May 24, 2018 at 08:27:04AM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2018-05-23 at 21:50 +0300, Michael S. Tsirkin wrote: > > > I re-read that discussion and I'm still unclear on the > > original question, since I got several apparently > > conflicting answers. > > > > I asked: > >

Re: powerpc/powernv: copy/paste - Mask XERS0 bit in CR

2018-06-04 Thread Michael Ellerman
Haren Myneni writes: > On 06/03/2018 03:48 AM, Michael Ellerman wrote: >> Haren Myneni writes: >>> NX can set 3rd bit in CR register for XER[SO] (Summation overflow) >>> which is not related to paste request. The current paste function >>> returns failure for the successful request when this bit

  1   2   >