Re: [PATCH 1/3] powerpc/powernv/pci: Track largest available TCE order per PHB

2018-07-02 Thread Russell Currey
On Mon, 2018-07-02 at 17:34 +1000, Alexey Kardashevskiy wrote: > On Mon, 2 Jul 2018 17:32:56 +1000 > Alexey Kardashevskiy wrote: > > > On Fri, 29 Jun 2018 17:34:35 +1000 > > Russell Currey wrote: > > > > > Knowing the largest possible TCE size of a PHB is useful, so get > > > it > > > out of

Re: [PATCH v2 1/2] powernv/cpuidle: Parse dt idle properties into global structure

2018-07-02 Thread kbuild test robot
Hi Akshay, Thank you for the patch! Yet something to improve: [auto build test ERROR on powerpc/next] [also build test ERROR on v4.18-rc3 next-20180702] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux

Re: [PATCH] kbuild: move bin2c back to scripts/ from scripts/basic/

2018-07-02 Thread Masahiro Yamada
2018-06-26 1:40 GMT+09:00 Masahiro Yamada : > Commit 8370edea81e3 ("bin2c: move bin2c in scripts/basic") moved bin2c > to the scripts/basic/ directory, incorrectly stating "Kexec wants to > use bin2c and it wants to use it really early in the build process. > See arch/x86/purgatory/ code in later

Re: [PATCH v2 2/2] powernv/cpuidle: Use parsed device tree values for cpuidle_init

2018-07-02 Thread Nicholas Piggin
On Mon, 2 Jul 2018 19:53:21 +0530 Akshay Adiga wrote: > Export pnv_idle_states and nr_pnv_idle_states so that its accessible to > cpuidle driver. Use properties from pnv_idle_states structure for powernv > cpuidle_init. > > Signed-off-by: Akshay Adiga Reviewed-by: Nicholas Piggin

Re: [PATCH 2/2] powerpc/ptrace-pkeys: execute-permission on keys are disabled by default

2018-07-02 Thread Thiago Jung Bauermann
Ram Pai writes: > The test case assumes execute-permissions of unallocated keys are > enabled by default. > > Signed-off-by: Ram Pai > --- > .../testing/selftests/powerpc/ptrace/ptrace-pkey.c |5 + > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git

Re: [PATCH v2 1/2] powernv/cpuidle: Parse dt idle properties into global structure

2018-07-02 Thread Nicholas Piggin
On Mon, 2 Jul 2018 19:53:20 +0530 Akshay Adiga wrote: > Device-tree parsing happens twice, once while deciding idle state to be > used for hotplug and once during cpuidle init. Hence, parsing the device > tree and caching it will reduce code duplication. Parsing code has been > moved to

Re: [PATCH 1/2] powerpc/core-pkeys: execute-permission on keys are disabled by default

2018-07-02 Thread Thiago Jung Bauermann
Ram Pai writes: > Only when the key is allocated, its permission are enabled. > > Signed-off-by: Ram Pai > --- > tools/testing/selftests/powerpc/ptrace/core-pkey.c |4 > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git

Re: [PATCH v5 2/7] powerpc/pseries: Defer the logging of rtas error to irq work queue.

2018-07-02 Thread Nicholas Piggin
On Mon, 02 Jul 2018 11:16:29 +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 > data to user through proc fs. This buffer is allocated

Re: [PATCH] powerpc: mpc5200: Remove VLA usage

2018-07-02 Thread Michael Ellerman
Segher Boessenkool writes: > On Mon, Jul 02, 2018 at 11:33:32AM +1000, Michael Ellerman wrote: >> What if we write it: >> >>char saved_0x500[0x600 - 0x500]; >> >> Hopefully the compiler is smart enough not to generate a VLA for that :) > > It is a VLA if the array size is not an integer

Re: [PATCH kernel v2 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-02 Thread David Gibson
On Mon, Jul 02, 2018 at 04:32:27PM +1000, Alexey Kardashevskiy wrote: > On Mon, 2 Jul 2018 14:52:43 +1000 > David Gibson wrote: > > > On Mon, Jul 02, 2018 at 02:33:30PM +1000, Alexey Kardashevskiy wrote: > > > On Mon, 2 Jul 2018 14:08:52 +1000 > > > David Gibson wrote: > > > > > > > On Fri,

Re: [PATCH 2/2] powerpc/pkeys: key allocation/deallocation must not change pkey registers

2018-07-02 Thread Thiago Jung Bauermann
Ram Pai writes: > Key allocation and deallocation has the side effect of programming the > UAMOR/AMR/IAMR registers. This is wrong, since its the responsibility of > the application and not that of the kernel, to modify the permission on > the key. > > Do not modify the pkey registers at key

[PATCH] mm: allow arch to supply p??_free_tlb functions

2018-07-02 Thread Nicholas Piggin
The mmu_gather APIs keep track of the invalidated address range including the span covered by invalidated page table pages. Ranges covered by page tables but not ptes (and therefore no TLBs) still need to be invalidated because some architectures (x86) can cache intermediate page table entries,

Re: [PATCH v5 5/7] powerpc/pseries: flush SLB contents on SLB MCE errors.

2018-07-02 Thread Nicholas Piggin
On Mon, 02 Jul 2018 11:17:06 +0530 Mahesh J Salgaonkar wrote: > From: Mahesh Salgaonkar > > On pseries, as of today system crashes if we get a machine check > exceptions due to SLB errors. These are soft errors and can be fixed by > flushing the SLBs so the kernel can continue to function

Re: [Update] Regression in 4.18 - 32-bit PowerPC crashes on boot - bisected to commit 1d40a5ea01d5

2018-07-02 Thread Larry Finger
On 07/01/2018 11:16 PM, Michael Ellerman wrote: Linus Torvalds writes: On Fri, Jun 29, 2018 at 1:42 PM Larry Finger wrote: I have more information regarding this BUG. Line 700 of page-flags.h is the macro PAGE_TYPE_OPS(Table, table). For further debugging, I manually expanded the macro, and

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

2018-07-02 Thread Michal Suchánek
On Fri, 8 Jun 2018 11:51:36 +1000 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

Re: [PATCH 0/9] Fix references for some missing documentation files

2018-07-02 Thread Jonathan Corbet
On Tue, 26 Jun 2018 06:49:02 -0300 Mauro Carvalho Chehab wrote: > Having nothing to do while waiting for my plane to arrive while > returning back from Japan, I ended by writing a small series of > patches meant to reduce the number of bad Documentation/* > links that are detected by: >

Re: [PATCH] powerpc: mpc5200: Remove VLA usage

2018-07-02 Thread Segher Boessenkool
On Mon, Jul 02, 2018 at 11:33:32AM +1000, Michael Ellerman wrote: > What if we write it: > >char saved_0x500[0x600 - 0x500]; > > Hopefully the compiler is smart enough not to generate a VLA for that :) It is a VLA if the array size is not an integer constant expression. This is defined

[PATCH v2] powerpc: mpc5200: Remove VLA usage

2018-07-02 Thread Kees Cook
In the quest to remove all stack VLA usage from the kernel[1], this switches to using a stack size large enough for the saved routine and adds a sanity check making sure the routine doesn't overflow into the 0x600 exception handler. [1]

Re: [PATCH] powerpc: mpc5200: Remove VLA usage

2018-07-02 Thread Kees Cook
On Sun, Jul 1, 2018 at 6:33 PM, Michael Ellerman wrote: > Kees Cook writes: > >> On Fri, Jun 29, 2018 at 2:02 PM, Arnd Bergmann wrote: >>> On Fri, Jun 29, 2018 at 8:53 PM, Kees Cook wrote: In the quest to remove all stack VLA usage from the kernel[1], this switches to using a stack

[PATCH v2 2/2] powernv/cpuidle: Use parsed device tree values for cpuidle_init

2018-07-02 Thread Akshay Adiga
Export pnv_idle_states and nr_pnv_idle_states so that its accessible to cpuidle driver. Use properties from pnv_idle_states structure for powernv cpuidle_init. Signed-off-by: Akshay Adiga --- arch/powerpc/include/asm/cpuidle.h | 2 + drivers/cpuidle/cpuidle-powernv.c | 143

[PATCH v2 1/2] powernv/cpuidle: Parse dt idle properties into global structure

2018-07-02 Thread Akshay Adiga
Device-tree parsing happens twice, once while deciding idle state to be used for hotplug and once during cpuidle init. Hence, parsing the device tree and caching it will reduce code duplication. Parsing code has been moved to pnv_parse_cpuidle_dt() from pnv_probe_idle_states(). In addition to the

[PATCH v2 0/2] powernv/cpuidle Device-tree parsing cleanup

2018-07-02 Thread Akshay Adiga
Device-tree parsed multiple time in powernv cpuidle and powernv hotplug code. First to identify supported flags. Second time, to identify deepest_state and first deep state. Third time, during cpuidle init to find the available idle states. Any change in device-tree format will lead to make

[PATCH] powerpc: hwrng; fix missing of_node_put()

2018-07-02 Thread Nicholas Mc Guire
64.h:16:36: warning: Unknown escape '(' ./arch/powerpc/include/asm/head-64.h:19:36: warning: Unknown escape '(' Patch is aginst 4.18-rc2 (localversion-next is next-20180702) arch/powerpc/platforms/pseries/rng.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/pseries/rng

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

2018-07-02 Thread Finn Thain
On Mon, 2 Jul 2018, Mathieu Malaterre wrote: > On Mon, Jul 2, 2018 at 10:25 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

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

2018-07-02 Thread Mathieu Malaterre
On Mon, Jul 2, 2018 at 10:25 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 small that

Re: [PATCH v11 00/26] Speculative page faults

2018-07-02 Thread Laurent Dufour
On 11/06/2018 09:49, Song, HaiyanX wrote: > Hi Laurent, > > Regression test for v11 patch serials have been run, some regression is found > by LKP-tools (linux kernel performance) > tested on Intel 4s skylake platform. This time only test the cases which have > been run and found regressions on

Re: [PATCH kernel 1/2] powerpc/powernv: Reuse existing TCE code for sketchy bypass

2018-07-02 Thread Alexey Kardashevskiy
On Sat, 16 Jun 2018 11:04:32 +1000 Benjamin Herrenschmidt wrote: > On Fri, 2018-06-01 at 18:10 +1000, Alexey Kardashevskiy wrote: > > The existing sketchy bypass ignores the existing default 32bit TCE table > > (created by default for every PE at boot time or after being used by > > VFIO) and it

Re: [PATCH 2/3] powerpc/powernv: DMA operations for discontiguous allocation

2018-07-02 Thread Alexey Kardashevskiy
On Fri, 29 Jun 2018 17:34:36 +1000 Russell Currey wrote: > DMA pseudo-bypass is a new set of DMA operations that solve some issues for > devices that want to address more than 32 bits but can't address the 59 > bits required to enable direct DMA. > > The previous implementation for POWER8/PHB3

[PATCH v4 09/11] macintosh/via-pmu: Replace via-pmu68k driver with via-pmu driver

2018-07-02 Thread Finn Thain
Now that the PowerMac via-pmu driver supports m68k PowerBooks, switch over to that driver and remove the via-pmu68k driver. Cc: Geert Uytterhoeven Tested-by: Stan Johnson Signed-off-by: Finn Thain --- arch/m68k/configs/mac_defconfig | 2 +- arch/m68k/configs/multi_defconfig | 2 +-

[PATCH v4 11/11] macintosh/via-pmu: Disambiguate interrupt statistics

2018-07-02 Thread Finn Thain
Some of the event counters are overloaded which makes it very difficult to interpret their values. Counter 0 is supposed to report CB1 interrupts but it can also count PMU_INT_WAITING_CHARGER events. Counter 1 is supposed to report GPIO interrupts but it can also count other events (depending

[PATCH v4 06/11] macintosh/via-pmu: Add support for m68k PowerBooks

2018-07-02 Thread Finn Thain
Put #ifdefs around the Open Firmware, xmon, interrupt dispatch, battery and suspend code. Add the necessary interrupt handling to support m68k PowerBooks. The pmu_kind value is available to userspace using the PMU_IOC_GET_MODEL ioctl. It is not clear yet what hardware classes are be needed to

[PATCH v4 08/11] macintosh/via-pmu68k: Don't load driver on unsupported hardware

2018-07-02 Thread Finn Thain
Don't load the via-pmu68k driver on early PowerBooks. The M50753 PMU device found in those models was never supported by this driver. Attempting to load the driver usually causes a boot hang. Cc: Geert Uytterhoeven Signed-off-by: Finn Thain Reviewed-by: Michael Schmitz ---

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

2018-07-02 Thread Finn Thain
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 Reviewed-by: Geert Uytterhoeven --- drivers/macintosh/via-pmu.c | 39

[PATCH v4 07/11] macintosh/via-pmu: Explicitly specify CONFIG_PPC_PMAC dependencies

2018-07-02 Thread Finn Thain
At present, CONFIG_ADB_PMU depends on CONFIG_PPC_PMAC. When this gets relaxed to CONFIG_PPC_PMAC || CONFIG_MAC, those Kconfig symbols with implicit deps on PPC_PMAC will need explicit deps. Add them now. No functional change. Tested-by: Stan Johnson Signed-off-by: Finn Thain ---

[PATCH v4 05/11] macintosh/via-pmu: Replace via pointer with via1 and via2 pointers

2018-07-02 Thread Finn Thain
On most PowerPC Macs, the PMU driver uses the shift register and IO port B from a single VIA chip. On 68k and early PowerPC PowerBooks, the driver uses the shift register from one VIA chip together with IO port B from another. Replace via with via1 and via2 to accommodate this. For the

[PATCH v4 04/11] macintosh/via-pmu: Enhance state machine with new 'uninitialized' state

2018-07-02 Thread Finn Thain
On 68k Macs, the via/vias pointer can't be used to determine whether the PMU driver has been initialized. For portability, add a new state to indicate that via_find_pmu() succeeded. After via_find_pmu() executes, testing vias == NULL is equivalent to testing via == NULL. Replace these tests with

[PATCH v4 00/11] macintosh: Resolve various PMU driver problems

2018-07-02 Thread Finn Thain
This series of patches has the following aims. 1) Eliminate duplicated code. Linux presently has two drivers for the 68HC05-based PMU devices found in Macs: via-pmu and via-pmu68k. There's no value in having separate PMU drivers for each architecture. 2) Avoid further work on via-pmu68k

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

2018-07-02 Thread Finn Thain
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 noderef expression drivers/macintosh/via-pmu.c:1455:17:

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

2018-07-02 Thread Finn Thain
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 small that there's negligible benefit from using the __init qualifier.

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

2018-07-02 Thread Finn Thain
The shift register interrupt flag gets cleared in via_pmu_interrupt() and once again in pmu_sr_intr(). Fix this theoretical race condition. Tested-by: Stan Johnson Signed-off-by: Finn Thain Reviewed-by: Geert Uytterhoeven --- drivers/macintosh/via-pmu.c | 1 - 1 file changed, 1 deletion(-)

[PATCH kernel] powerpc/powernv/ioda2: Add 256M IOMMU page size to the default POWER8 case

2018-07-02 Thread Alexey Kardashevskiy
The sketchy bypass uses 256M pages so add this page size as well. This should cause no behavioral change but will be used later. Fixes: 477afd6ea6 "powerpc/ioda: Use ibm,supported-tce-sizes for IOMMU page size mask" Signed-off-by: Alexey Kardashevskiy ---

Re: [PATCH 1/3] powerpc/powernv/pci: Track largest available TCE order per PHB

2018-07-02 Thread Alexey Kardashevskiy
On Mon, 2 Jul 2018 17:32:56 +1000 Alexey Kardashevskiy wrote: > On Fri, 29 Jun 2018 17:34:35 +1000 > Russell Currey wrote: > > > Knowing the largest possible TCE size of a PHB is useful, so get it > > out of the device tree. This relies on the property being added in > > OPAL. > > > > It is

Re: [PATCH 1/3] powerpc/powernv/pci: Track largest available TCE order per PHB

2018-07-02 Thread Alexey Kardashevskiy
On Fri, 29 Jun 2018 17:34:35 +1000 Russell Currey wrote: > Knowing the largest possible TCE size of a PHB is useful, so get it out > of the device tree. This relies on the property being added in OPAL. > > It is assumed that any PHB4 or later machine would be running firmware > that

Re: [PATCH kernel v2 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-02 Thread Alexey Kardashevskiy
On Mon, 2 Jul 2018 14:52:43 +1000 David Gibson wrote: > On Mon, Jul 02, 2018 at 02:33:30PM +1000, Alexey Kardashevskiy wrote: > > On Mon, 2 Jul 2018 14:08:52 +1000 > > David Gibson wrote: > > > > > On Fri, Jun 29, 2018 at 05:07:47PM +1000, Alexey Kardashevskiy wrote: > > > > On Fri, 29 Jun

[PATCH v5 7/7] powerpc/pseries: Dump the SLB contents on SLB MCE errors.

2018-07-02 Thread Mahesh J Salgaonkar
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 root cause of SLB errors. Introduce an exclusive buffer per cpu to hold faulty SLB entries. In real mode mce handler saves the old