[PATCH] powerpc/mm/radix: Fix checkstops caused by invalid tlbiel

2018-04-11 Thread Michael Ellerman
In tlbiel_radix_set_isa300() we use the PPC_TLBIEL() macro to construct tlbiel instructions. The instruction takes 5 fields, two of which are registers, and the others are constants. But because it's constructed with inline asm the compiler doesn't know that. We got the constraint wrong on the

Re: [PATCH v2 2/2] powerpc/fadump: Do not use hugepages when fadump is active

2018-04-11 Thread Mahesh Jagannath Salgaonkar
On 04/10/2018 07:11 PM, Hari Bathini wrote: > FADump capture kernel boots in restricted memory environment preserving > the context of previous kernel to save vmcore. Supporting hugepages in > such environment makes things unnecessarily complicated, as hugepages > need memory set aside for them.

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-11 Thread Linus Torvalds
On Wed, Apr 11, 2018 at 6:34 PM, Dmitry V. Levin wrote: > > There is a clear pattern of sneaking in ABI changes using innocently > looking commit messages. Yes, this siginfo stuff has been a mess. Eric - this needs to stop. Or we need to revert all that garbage entirely.

Re: sparc/ppc/arm compat siginfo ABI regressions: sending SIGFPE via kill() returns wrong values in si_pid and si_uid

2018-04-11 Thread Dmitry V. Levin
Hi, On Mon, Apr 09, 2018 at 06:22:53PM +0300, Dmitry V. Levin wrote: > There seems to be a regression in v4.16 on ppc compat very similar > to sparc compat regression reported earlier at > https://marc.info/?l=linux-sparc=151501500704383 . > > The symptoms are exactly the same: the same

[PATCH v2 07/10] block/swim: Rename macros to avoid inconsistent inverted logic

2018-04-11 Thread Finn Thain
The Sony drive status bits use active-low logic. The swim_readbit() function converts that to 'C' logic for readability. Hence, the sense of the names of the status bit macros should not be inverted. Mostly they are correct. However, the TWOMEG_DRIVE, MFM_MODE and TWOMEG_MEDIA macros have

Re: [GIT PULL] asm-generic fixes for v4.17-rc1

2018-04-11 Thread Linus Torvalds
On Wed, Apr 11, 2018 at 8:40 AM, Arnd Bergmann wrote: > > are available in the git repository at: > > > git+ssh://gitol...@ra.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git > tags/asm-generic Yeah, no they aren't available there at all. That tag is some old tag from

[GIT PULL] asm-generic fixes for v4.17-rc1

2018-04-11 Thread Arnd Bergmann
The following changes since commit 0adb32858b0bddf4ada5f364a84ed60b196dbcda: Linux 4.16 (2018-04-01 14:20:27 -0700) are available in the git repository at: git+ssh://gitol...@ra.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git tags/asm-generic for you to fetch changes up to

Re: powerpc/modules: Fix crashes by adding CONFIG_RELOCATABLE to vermagic

2018-04-11 Thread Ard Biesheuvel
On 11 April 2018 at 16:49, Michael Ellerman wrote: > On Tue, 2018-04-10 at 01:22:06 UTC, Michael Ellerman wrote: >> If you build the kernel with CONFIG_RELOCATABLE=n, then install the >> modules, rebuild the kernel with CONFIG_RELOCATABLE=y and leave the >> old

Re: [3/3] powerpc/powernv: Fix OPAL NVRAM driver OPAL_BUSY loops

2018-04-11 Thread Michael Ellerman
On Tue, 2018-04-10 at 11:49:33 UTC, Nicholas Piggin wrote: > The OPAL NVRAM driver does not sleep in case it gets OPAL_BUSY or > OPAL_BUSY_EVENT from firmware, which causes large scheduling > latencies, and various lockup errors to trigger (again, BMC reboot > can cause it). > > Fix this by

Re: [1/3] powerpc/powernv: define a standard delay for OPAL_BUSY type retry loops

2018-04-11 Thread Michael Ellerman
On Tue, 2018-04-10 at 11:49:31 UTC, Nicholas Piggin wrote: > This is the start of an effort to tidy up and standardise all the > delays. Existing loops have a range of delay/sleep periods from 1ms > to 20ms, and some have no delay. They all loop forever except rtc, > which times out after 10

Re: powerpc/8xx: Build fix with Hugetlbfs enabled

2018-04-11 Thread Michael Ellerman
On Tue, 2018-04-10 at 08:51:26 UTC, "Aneesh Kumar K.V" wrote: > 8xx use slice code when hugetlbfs is enabled. We missed a header include on > 8xx which resulted in the below build failure. > > config: mpc885_ads_defconfig + CONFIG_HUGETLBFS > >CC arch/powerpc/mm/slice.o >

Re: powerpc/modules: Fix crashes by adding CONFIG_RELOCATABLE to vermagic

2018-04-11 Thread Michael Ellerman
On Tue, 2018-04-10 at 01:22:06 UTC, Michael Ellerman wrote: > If you build the kernel with CONFIG_RELOCATABLE=n, then install the > modules, rebuild the kernel with CONFIG_RELOCATABLE=y and leave the > old modules installed, we crash something like: > > Unable to handle kernel paging request

Re: [1/2] KVM: PPC: Book3S HV: trace_tlbie must not be called in realmode

2018-04-11 Thread Michael Ellerman
On Thu, 2018-04-05 at 17:56:30 UTC, Nicholas Piggin wrote: > This crashes with a "Bad real address for load" attempting to load > from the vmalloc region in realmode (faulting address is in DAR). > > Oops: Bad interrupt in KVM entry/exit code, sig: 6 [#1] > LE SMP NR_CPUS=2048 NUMA PowerNV >

Re: powerpc/64s: Fix section mismatch warnings from setup_rfi_flush()

2018-04-11 Thread Michael Ellerman
On Thu, 2018-04-05 at 12:49:13 UTC, Michael Ellerman wrote: > The recent LPM changes to setup_rfi_flush() are causing some section > mismatch warnings because we removed the __init annotation on > setup_rfi_flush(): > > The function setup_rfi_flush() references > the function __init

Re: [V2] powerpc/fscr: Enable interrupts earlier before calling get_user()

2018-04-11 Thread Michael Ellerman
On Thu, 2018-03-29 at 06:23:37 UTC, Anshuman Khandual wrote: > The function get_user() can sleep while trying to fetch instruction > from user address space and causes the following warning from the > scheduler. > > BUG: sleeping function called from invalid context > > Though interrupts get

Re: [PATCH v2] powerpc/config: powernv_defconfig updates

2018-04-11 Thread Nicholas Piggin
On Wed, 11 Apr 2018 22:24:06 +1000 Balbir Singh wrote: > On Wed, Apr 11, 2018 at 8:42 PM, Nicholas Piggin wrote: > > On Wed, 11 Apr 2018 20:04:45 +1000 > > Balbir Singh wrote: > > > >> On Wed, Apr 11, 2018 at 7:12 PM, Nicholas

Re: [PATCH v2] powerpc/config: powernv_defconfig updates

2018-04-11 Thread Balbir Singh
On Wed, Apr 11, 2018 at 8:42 PM, Nicholas Piggin wrote: > On Wed, 11 Apr 2018 20:04:45 +1000 > Balbir Singh wrote: > >> On Wed, Apr 11, 2018 at 7:12 PM, Nicholas Piggin wrote: >> > For consideration: >> > >> > * Add IPv6 support built

Re: [PATCH 2/2] powerpc/mm/memtrace: Let the arch hotunplug code flush cache

2018-04-11 Thread Balbir Singh
On Wed, Apr 11, 2018 at 9:05 PM, Michael Ellerman wrote: > Balbir Singh writes: > >> Don't do this via custom code, instead now that we have support >> in the arch hotplug/hotunplug code, rely on those routines >> to do the right thing. >> >> Fixes:

Re: [PATCH v3 2/2] mm: remove odd HAVE_PTE_SPECIAL

2018-04-11 Thread Michal Hocko
On Wed 11-04-18 12:32:07, Laurent Dufour wrote: [...] > Andrew, should I send a v4 or could you wipe the 2 __maybe_unsued when > applying > the patch ? A follow $patch-fix should be better rather than post this again and spam people with more emails. -- Michal Hocko SUSE Labs

Re: [PATCH 2/2] powerpc/mm/memtrace: Let the arch hotunplug code flush cache

2018-04-11 Thread Michael Ellerman
Balbir Singh writes: > Don't do this via custom code, instead now that we have support > in the arch hotplug/hotunplug code, rely on those routines > to do the right thing. > > Fixes: 9d5171a8f248 ("powerpc/powernv: Enable removal of memory for in memory > tracing")

Re: [PATCH v2] powerpc/config: powernv_defconfig updates

2018-04-11 Thread Nicholas Piggin
On Wed, 11 Apr 2018 20:04:45 +1000 Balbir Singh wrote: > On Wed, Apr 11, 2018 at 7:12 PM, Nicholas Piggin wrote: > > For consideration: > > > > * Add IPv6 support built in + additional modules - Because it's 2018 maan. > > * Add

Re: [PATCH v3 2/2] mm: remove odd HAVE_PTE_SPECIAL

2018-04-11 Thread Laurent Dufour
On 11/04/2018 11:09, Christophe LEROY wrote: > > > Le 11/04/2018 à 11:03, Laurent Dufour a écrit : >> >> >> On 11/04/2018 10:58, Christophe LEROY wrote: >>> >>> >>> Le 11/04/2018 à 10:03, Laurent Dufour a écrit : Remove the additional define HAVE_PTE_SPECIAL and rely directly on

Re: [PATCH v2] powerpc/config: powernv_defconfig updates

2018-04-11 Thread Balbir Singh
On Wed, Apr 11, 2018 at 7:12 PM, Nicholas Piggin wrote: > For consideration: > > * Add IPv6 support built in + additional modules - Because it's 2018 maan. > * Add DEFERRED_STRUCT_PAGE_INIT - Let's see what breaks. We did not find any benefits with this on a P8 in terms of

[PATCH v2] powerpc/config: powernv_defconfig updates

2018-04-11 Thread Nicholas Piggin
For consideration: * Add IPv6 support built in + additional modules - Because it's 2018 maan. * Add DEFERRED_STRUCT_PAGE_INIT - Let's see what breaks. * Add PPC_MEMTRACE - Small powernv debugfs driver for getting hardware traces. * Add MEMORY_FAILURE - Machine check exceptions can now drive

Re: [PATCH v3 2/2] mm: remove odd HAVE_PTE_SPECIAL

2018-04-11 Thread Christophe LEROY
Le 11/04/2018 à 10:41, Laurent Dufour a écrit : On 11/04/2018 10:33, Michal Hocko wrote: On Wed 11-04-18 10:03:36, Laurent Dufour wrote: @@ -881,7 +876,8 @@ struct page *_vm_normal_page(struct vm_area_struct *vma, unsigned long addr, if (is_zero_pfn(pfn)) return NULL;

Re: [PATCH v3 2/2] mm: remove odd HAVE_PTE_SPECIAL

2018-04-11 Thread Christophe LEROY
Le 11/04/2018 à 11:03, Laurent Dufour a écrit : On 11/04/2018 10:58, Christophe LEROY wrote: Le 11/04/2018 à 10:03, Laurent Dufour a écrit : Remove the additional define HAVE_PTE_SPECIAL and rely directly on CONFIG_ARCH_HAS_PTE_SPECIAL. There is no functional change introduced by this

Re: [PATCH v3 2/2] mm: remove odd HAVE_PTE_SPECIAL

2018-04-11 Thread Laurent Dufour
On 11/04/2018 10:58, Christophe LEROY wrote: > > > Le 11/04/2018 à 10:03, Laurent Dufour a écrit : >> Remove the additional define HAVE_PTE_SPECIAL and rely directly on >> CONFIG_ARCH_HAS_PTE_SPECIAL. >> >> There is no functional change introduced by this patch >> >> Signed-off-by: Laurent

Re: [PATCH v3 2/2] mm: remove odd HAVE_PTE_SPECIAL

2018-04-11 Thread Christophe LEROY
Le 11/04/2018 à 10:03, Laurent Dufour a écrit : Remove the additional define HAVE_PTE_SPECIAL and rely directly on CONFIG_ARCH_HAS_PTE_SPECIAL. There is no functional change introduced by this patch Signed-off-by: Laurent Dufour --- mm/memory.c | 19

Re: [PATCH v3 2/2] mm: remove odd HAVE_PTE_SPECIAL

2018-04-11 Thread Michal Hocko
On Wed 11-04-18 10:41:23, Laurent Dufour wrote: > On 11/04/2018 10:33, Michal Hocko wrote: > > On Wed 11-04-18 10:03:36, Laurent Dufour wrote: > >> @@ -881,7 +876,8 @@ struct page *_vm_normal_page(struct vm_area_struct > >> *vma, unsigned long addr, > >> > >>if (is_zero_pfn(pfn)) > >>

Re: [PATCH v3 2/2] mm: remove odd HAVE_PTE_SPECIAL

2018-04-11 Thread Laurent Dufour
On 11/04/2018 10:33, Michal Hocko wrote: > On Wed 11-04-18 10:03:36, Laurent Dufour wrote: >> @@ -881,7 +876,8 @@ struct page *_vm_normal_page(struct vm_area_struct *vma, >> unsigned long addr, >> >> if (is_zero_pfn(pfn)) >> return NULL; >> -check_pfn: >> + >> +check_pfn:

Re: [PATCH v3 1/2] mm: introduce ARCH_HAS_PTE_SPECIAL

2018-04-11 Thread Michal Hocko
On Wed 11-04-18 10:03:35, Laurent Dufour wrote: > Currently the PTE special supports is turned on in per architecture header > files. Most of the time, it is defined in arch/*/include/asm/pgtable.h > depending or not on some other per architecture static definition. > > This patch introduce a new

Re: [PATCH v3 2/2] mm: remove odd HAVE_PTE_SPECIAL

2018-04-11 Thread Michal Hocko
On Wed 11-04-18 10:03:36, Laurent Dufour wrote: > @@ -881,7 +876,8 @@ struct page *_vm_normal_page(struct vm_area_struct *vma, > unsigned long addr, > > if (is_zero_pfn(pfn)) > return NULL; > -check_pfn: > + > +check_pfn: __maybe_unused > if (unlikely(pfn >

[PATCH v3 1/2] mm: introduce ARCH_HAS_PTE_SPECIAL

2018-04-11 Thread Laurent Dufour
Currently the PTE special supports is turned on in per architecture header files. Most of the time, it is defined in arch/*/include/asm/pgtable.h depending or not on some other per architecture static definition. This patch introduce a new configuration variable to manage this directly in the

[PATCH v3 2/2] mm: remove odd HAVE_PTE_SPECIAL

2018-04-11 Thread Laurent Dufour
Remove the additional define HAVE_PTE_SPECIAL and rely directly on CONFIG_ARCH_HAS_PTE_SPECIAL. There is no functional change introduced by this patch Signed-off-by: Laurent Dufour --- mm/memory.c | 19 --- 1 file changed, 8 insertions(+), 11

[PATCH v3 0/2] move __HAVE_ARCH_PTE_SPECIAL in Kconfig

2018-04-11 Thread Laurent Dufour
The per architecture __HAVE_ARCH_PTE_SPECIAL is defined statically in the per architecture header files. This doesn't allow to make other configuration dependent on it. The first patch of this series is replacing __HAVE_ARCH_PTE_SPECIAL by CONFIG_ARCH_HAS_PTE_SPECIAL defined into the Kconfig

[PATCH] powerpc/config: powernv_defconfig updates

2018-04-11 Thread Nicholas Piggin
For consideration * Add PPC_MEMTRACE - Small powernv debugfs driver for getting hardware traces. * Remove IDE - Deprecated and replaced with ATA. * Add MEMORY_FAILURE - Machine check exceptions can now drive memory failure. * Turn on FANOTIFY - This is the current filesystem notification feature.

[PATCH v2 6/6] fsl_pmc: update device bindings

2018-04-11 Thread Ran Wang
From: Li Yang Signed-off-by: Li Yang Signed-off-by: Zhao Chenhui Signed-off-by: Ran Wang --- Changes in v2: - new file .../devicetree/bindings/powerpc/fsl/pmc.txt| 59 +++ 1 files

[PATCH v2 4/6] powerpc/pm: add sleep and deep sleep on QorIQ SoCs

2018-04-11 Thread Ran Wang
In sleep mode, the clocks of CPU core and unused IP blocks are turned off (IP blocks allowed to wake up system will running). Some QorIQ SoCs like MPC8536, P1022 and T104x, have deep sleep PM mode in addtion to the sleep PM mode. While in deep sleep mode, additionally, the power supply is removed

[PATCH v2 5/6] powerpc:dts:pm: add power management node

2018-04-11 Thread Ran Wang
Enable Power Management feature on device tree, including MPC8536, MPC8544, MPC8548, MPC8572, P1010, P1020, P1021, P1022, P2020, P2041, P3041, T104X, T1024. Signed-off-by: Zhao Chenhui Signed-off-by: Ran Wang --- Changes in v2: - no change

[PATCH v2 3/6] powerpc/cache: add cache flush operation for various e500

2018-04-11 Thread Ran Wang
Various e500 core have different cache architecture, so they need different cache flush operations. Therefore, add a callback function cpu_flush_caches to the struct cpu_spec. The cache flush operation for the specific kind of e500 is selected at init time. The callback function will flush all

[PATCH v2 2/6] drivers/soc/fsl: add EPU FSM configuration for deep sleep

2018-04-11 Thread Ran Wang
In the last stage of deep sleep, software will trigger a Finite State Machine (FSM) to control the hardware procedure, such a board isolation, killing PLLs, removing power, and so on. When the system is waked up by an interrupt, the FSM controls the hardware to complete the early resume

[PATCH v2 1/6] powerpc/pm: Fix suspend=n in menuconfig for e500mc platforms.

2018-04-11 Thread Ran Wang
Also, unselect FSL_PMC which is for older platfroms instead. Signed-off-by: Ran Wang --- Changes in v2: - no change arch/powerpc/Kconfig |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index

[PATCH 2/2] powernv/npu: Prevent overwriting of pnv_npu2_init_contex() callback parameters

2018-04-11 Thread Alistair Popple
There is a single npu context per set of callback parameters. Callers should be prevented from overwriting existing callback values so instead return an error if different parameters are passed. Signed-off-by: Alistair Popple --- arch/powerpc/include/asm/powernv.h |

[PATCH 1/2] powernv/npu: Add lock to prevent race in concurrent context init/destroy

2018-04-11 Thread Alistair Popple
The pnv_npu2_init_context() and pnv_npu2_destroy_context() functions are used to allocate/free contexts to allow address translation and shootdown by the NPU on a particular GPU. Context initialisation is implicitly safe as it is protected by the requirement mmap_sem be held in write mode, however