Re: [RFC PATCH kernel] vfio/spapr_tce: Get rid of possible infinite loop

2018-10-01 Thread David Gibson
On Tue, Oct 02, 2018 at 01:22:31PM +1000, Alexey Kardashevskiy wrote: > As a part of cleanup, the SPAPR TCE IOMMU subdriver releases preregistered > memory. If there is a bug in memory release, the loop in > tce_iommu_release() becomes infinite; this actually happened to me. > > This makes the

[RFC PATCH kernel] vfio/spapr_tce: Get rid of possible infinite loop

2018-10-01 Thread Alexey Kardashevskiy
As a part of cleanup, the SPAPR TCE IOMMU subdriver releases preregistered memory. If there is a bug in memory release, the loop in tce_iommu_release() becomes infinite; this actually happened to me. This makes the loop finite and prints a warning on every failure to make the code more bug prone.

[PATCH kernel v2] powerpc/ioda/npu: Call skiboot's hot reset hook when disabling NPU2

2018-10-01 Thread Alexey Kardashevskiy
The skiboot firmware has a hot reset handler which fences the NVIDIA V100 GPU RAM on Witherspoons and makes accesses no-op instead of throwing HMIs: https://github.com/open-power/skiboot/commit/fca2b2b839a67 Now we are going to pass V100 via VFIO which most certainly involves KVM guests which are

Re: [PATCH] driver core: device: add BUS_ATTR_WO macro

2018-10-01 Thread Greg KH
On Mon, Oct 01, 2018 at 06:32:52PM +0300, Ioana Ciornei wrote: > Add BUS_ATTR_WO macro to make it easier to add attributes without > auditing the mode settings. Also, use the newly added macro where > appropriate. > > Signed-off-by: Ioana Ciornei > --- > arch/powerpc/platforms/pseries/ibmebus.c

Re: [PATCH 2/2] powerpc/tm: Avoid SPR flush if TM is disabled

2018-10-01 Thread Michael Neuling
On Mon, 2018-10-01 at 16:47 -0300, Breno Leitao wrote: > There is a bug in the flush_tmregs_to_thread() function, where it forces > TM SPRs to be saved to the thread even if the TM facility is disabled. > > This bug could be reproduced using a simple test case: > > mtspr(SPRN_TEXASR, XX); >

Re: [PATCH 2/2] powerpc/64: Increase stack redzone for 64-bit kernel to 512 bytes

2018-10-01 Thread Nicholas Piggin
On Mon, 1 Oct 2018 20:41:19 +0800 Bin Meng wrote: > Hi Nick, > > On Mon, Oct 1, 2018 at 10:23 AM Nicholas Piggin wrote: > > > > On Mon, 1 Oct 2018 09:11:04 +0800 > > Bin Meng wrote: > > > > > Hi Nick, > > > > > > On Mon, Oct 1, 2018 at 7:27 AM Nicholas Piggin wrote: > > > > > > > > > >

Re: [PATCH 2/2] powerpc/64: Increase stack redzone for 64-bit kernel to 512 bytes

2018-10-01 Thread Nicholas Piggin
On Mon, 1 Oct 2018 03:51:21 -0500 Segher Boessenkool wrote: > Hi! > > On Mon, Oct 01, 2018 at 12:22:56PM +1000, Nicholas Piggin wrote: > > On Mon, 1 Oct 2018 09:11:04 +0800 > > Bin Meng wrote: > > > On Mon, Oct 1, 2018 at 7:27 AM Nicholas Piggin wrote: > > > > > > > On Sat, 29 Sep 2018

Re: [PATCH] powerpc: remove leftover code of old GCC version checks

2018-10-01 Thread Nicholas Piggin
On Mon, 1 Oct 2018 15:10:24 +0900 Masahiro Yamada wrote: > Clean up the leftover of commit f2910f0e6835 ("powerpc: remove old > GCC version checks"). > > Signed-off-by: Masahiro Yamada > --- > > My patch had been sent earlier, with more clean-ups: >

Re: [PATCH] migration/mm: Add WARN_ON to try_offline_node

2018-10-01 Thread Tyrel Datwyler
On 10/01/2018 01:27 PM, Michal Hocko wrote: > On Mon 01-10-18 13:56:25, Michael Bringmann wrote: >> In some LPAR migration scenarios, device-tree modifications are >> made to the affinity of the memory in the system. For instance, >> it may occur that memory is installed to nodes 0,3 on a source

Re: [PATCH] migration/mm: Add WARN_ON to try_offline_node

2018-10-01 Thread Tyrel Datwyler
On 10/01/2018 01:27 PM, Michal Hocko wrote: > On Mon 01-10-18 13:56:25, Michael Bringmann wrote: >> In some LPAR migration scenarios, device-tree modifications are >> made to the affinity of the memory in the system. For instance, >> it may occur that memory is installed to nodes 0,3 on a source

Re: [PATCH] powerpc/lib: fix book3s/32 boot failure due to code patching

2018-10-01 Thread Michael Neuling
On Mon, 2018-10-01 at 12:21 +, Christophe Leroy wrote: > Commit 51c3c62b58b3 ("powerpc: Avoid code patching freed init > sections") accesses 'init_mem_is_free' flag too early, before the > kernel is relocated. This provokes early boot failure (before the > console is active). > > As it is not

Re: [PATCH] kdb: print real address of pointers instead of hashed addresses

2018-10-01 Thread Jason Wessel
On 09/27/2018 12:17 PM, Christophe Leroy wrote: Since commit ad67b74d2469 ("printk: hash addresses printed with %p"), all pointers printed with %p are printed with hashed addresses instead of real addresses in order to avoid leaking addresses in dmesg and syslog. But this applies to kdb too,

[PATCH 2/2] powerpc/time: Add set_state_oneshot_stopped decrementer callback

2018-10-01 Thread Anton Blanchard
If CONFIG_PPC_WATCHDOG is enabled we always cap the decrementer to 0x7fff: if (IS_ENABLED(CONFIG_PPC_WATCHDOG)) set_dec(0x7fff); else set_dec(decrementer_max); If there are no future events, we don't reprogram the decrementer after this and

[PATCH 1/2] powerpc/time: Use clockevents_register_device(), fixing an issue with large decrementer

2018-10-01 Thread Anton Blanchard
We currently cap the decrementer clockevent at 4 seconds, even on systems with large decrementer support. Fix this by converting the code to use clockevents_register_device() which calculates the upper bound based on the max_delta passed in. Signed-off-by: Anton Blanchard ---

Re: [PATCH] kdb: use correct pointer when 'btc' calls 'btt'

2018-10-01 Thread Jason Wessel
On 09/28/2018 07:57 AM, Michael Ellerman wrote: Christophe LEROY writes: Le 27/09/2018 à 13:09, Michael Ellerman a écrit : Christophe LEROY writes: Le 26/09/2018 à 13:11, Daniel Thompson a écrit : The Fixes: and now your Reviewed-by: appear automatically in patchwork

Re: [PATCH 2/2] powerpc/time: Only cap decrementer when watchdog is enabled

2018-10-01 Thread Anton Blanchard
Hi Nick, > Thanks for tracking this down. It's a fix for my breakage > > a7cba02deced ("powerpc: allow soft-NMI watchdog to cover timer > interrupts with large decrementers") > > Taking another look... what I had expected here is the timer subsystem > would have stopped the decrementer device

Re: [v4] powerpc: Avoid code patching freed init sections

2018-10-01 Thread Michael Neuling
On Mon, 2018-10-01 at 13:25 +0200, Christophe LEROY wrote: > > Le 21/09/2018 à 13:59, Michael Ellerman a écrit : > > On Fri, 2018-09-14 at 01:14:11 UTC, Michael Neuling wrote: > > > This stops us from doing code patching in init sections after they've > > > been freed. > > > > > > In this chain:

Re: [PATCH] powerpc: signedness bug in update_flash_db()

2018-10-01 Thread Geoff Levand
On 10/01/2018 09:44 AM, Dan Carpenter wrote: > The "count < sizeof(struct os_area_db)" comparison is type promoted to > size_t so negative values of "count" are treated as very high values and > we accidentally return success instead of a negative error code. > > This doesn't really change

Re: [PATCH v2 0/5] soc/fsl/qbman: DPAA QBMan fixes and additions

2018-10-01 Thread Li Yang
On Fri, Sep 28, 2018 at 3:44 AM Madalin Bucur wrote: > Applied 1-4 to for-next while waiting for clarification on 5/5. And updated the prefix to "soc: fsl:" style to be aligned with arm-soc convention. Please try to use that style in the future for soc/fsl patches. > This patch set brings a

Re: [PATCH v3 4/6] drivers: clk-qoriq: Add clockgen support for lx2160a

2018-10-01 Thread Stephen Boyd
Same subject comment. Quoting Vabhav Sharma (2018-09-23 17:08:59) > From: Yogesh Gaur > > Add clockgen support for lx2160a.

Re: [PATCH v3 3/6] drivers: clk-qoriq: increase array size of cmux_to_group

2018-10-01 Thread Stephen Boyd
Subject should be "clk: qoriq: increase array size ..."

Re: [PATCH v2 5/5] soc/fsl_qbman: export coalesce change API

2018-10-01 Thread Li Yang
On Fri, Sep 28, 2018 at 3:45 AM Madalin Bucur wrote: > > Export the API required to control the QMan portal interrupt coalescing > settings. These are new APIs not just old APIs being exported. What is the user of these APIs? Is the user being submitted? We cannot have APIs in kernel that has

Re: dma mask related fixups (including full bus_dma_mask support) v2

2018-10-01 Thread Benjamin Herrenschmidt
On Mon, 2018-10-01 at 16:32 +0200, Christoph Hellwig wrote: > FYI, I've pulled this into the dma-mapping tree to make forward > progress. All but oatch 4 had formal ACKs, and for that one Robin > was fine even without and explicit ack. I'll also send a patch to > better document the zone

Re: [PATCH v4 6/9] kbuild: consolidate Devicetree dtb build rules

2018-10-01 Thread Masahiro Yamada
2018年10月2日(火) 0:26 Rob Herring : > > There is nothing arch specific about building dtb files other than their > location under /arch/*/boot/dts/. Keeping each arch aligned is a pain. > The dependencies and supported targets are all slightly different. > Also, a cross-compiler for each arch is

Re: [PATCH] migration/mm: Add WARN_ON to try_offline_node

2018-10-01 Thread Michal Hocko
On Mon 01-10-18 13:56:25, Michael Bringmann wrote: > In some LPAR migration scenarios, device-tree modifications are > made to the affinity of the memory in the system. For instance, > it may occur that memory is installed to nodes 0,3 on a source > system, and to nodes 0,2 on a target system.

Re: [PATCH] migration/mm: Add WARN_ON to try_offline_node

2018-10-01 Thread Kees Cook
On Mon, Oct 1, 2018 at 11:56 AM, Michael Bringmann wrote: > In some LPAR migration scenarios, device-tree modifications are > made to the affinity of the memory in the system. For instance, > it may occur that memory is installed to nodes 0,3 on a source > system, and to nodes 0,2 on a target

[PATCH 2/2] powerpc/tm: Avoid SPR flush if TM is disabled

2018-10-01 Thread Breno Leitao
There is a bug in the flush_tmregs_to_thread() function, where it forces TM SPRs to be saved to the thread even if the TM facility is disabled. This bug could be reproduced using a simple test case: mtspr(SPRN_TEXASR, XX); sleep until load_tm == 0 cause a coredump read SPRN_TEXASR in the

[PATCH 1/2] powerpc/tm: Move tm_enable definition

2018-10-01 Thread Breno Leitao
The goal of this patch is to move function tm_enabled() to tm.h in order to allow this function to be used by other files as an inline function. This patch also removes the double inclusion of tm.h in the traps.c source code. One inclusion is inside a CONFIG_PPC64 ifdef block, and another one is

Re: [PATCH] powerpc: signedness bug in update_flash_db()

2018-10-01 Thread Dan Carpenter
On Mon, Oct 01, 2018 at 10:02:54PM +0300, Dan Carpenter wrote: > On Mon, Oct 01, 2018 at 08:22:01PM +0200, christophe leroy wrote: > > > > > > Le 01/10/2018 à 18:44, Dan Carpenter a écrit : > > > The "count < sizeof(struct os_area_db)" comparison is type promoted to > > > size_t so negative

Re: [PATCH] powerpc: signedness bug in update_flash_db()

2018-10-01 Thread Dan Carpenter
On Mon, Oct 01, 2018 at 08:22:01PM +0200, christophe leroy wrote: > > > Le 01/10/2018 à 18:44, Dan Carpenter a écrit : > > The "count < sizeof(struct os_area_db)" comparison is type promoted to > > size_t so negative values of "count" are treated as very high values and > > we accidentally

[PATCH] migration/mm: Add WARN_ON to try_offline_node

2018-10-01 Thread Michael Bringmann
In some LPAR migration scenarios, device-tree modifications are made to the affinity of the memory in the system. For instance, it may occur that memory is installed to nodes 0,3 on a source system, and to nodes 0,2 on a target system. Node 2 may not have been initialized/allocated on the target

[PATCH] powerpc/mobility: Extend start/stop topology update scope

2018-10-01 Thread Michael Bringmann
The PPC mobility code may receive RTAS requests to perform PRRN topology changes at any time, including during LPAR migration operations. In some configurations where the affinity of CPUs or memory is being changed on that platform, the PRRN requests may apply or refer to outdated information

Re: [PATCH] powerpc: signedness bug in update_flash_db()

2018-10-01 Thread christophe leroy
Le 01/10/2018 à 18:44, Dan Carpenter a écrit : The "count < sizeof(struct os_area_db)" comparison is type promoted to size_t so negative values of "count" are treated as very high values and we accidentally return success instead of a negative error code. This doesn't really change runtime

[PATCH] driver core: device: add BUS_ATTR_WO macro

2018-10-01 Thread Ioana Ciornei
Add BUS_ATTR_WO macro to make it easier to add attributes without auditing the mode settings. Also, use the newly added macro where appropriate. Signed-off-by: Ioana Ciornei --- arch/powerpc/platforms/pseries/ibmebus.c | 12 drivers/block/rbd.c | 48

Re: [RFC PATCH 11/11] selftests/powerpc: Adapt the test

2018-10-01 Thread Breno Leitao
Hi Mikey, On 09/28/2018 02:25 AM, Michael Neuling wrote: >> Perfect, and if the transaction fail, the CPU will rollback the changes and >> restore the checkpoint registers (replacing the r3 that contains the pid >> value), thus, it will be like "getpid" system call didn't execute. > > No. If we

[PATCH] powerpc: signedness bug in update_flash_db()

2018-10-01 Thread Dan Carpenter
The "count < sizeof(struct os_area_db)" comparison is type promoted to size_t so negative values of "count" are treated as very high values and we accidentally return success instead of a negative error code. This doesn't really change runtime much but it fixes a static checker warning.

Re: [PATCH RFC] mm/memory_hotplug: Introduce memory block types

2018-10-01 Thread Dave Hansen
> How should a policy in user space look like when new memory gets added > - on s390x? Not onlining paravirtualized memory is very wrong. Because we're going to balloon it away in a moment anyway? We have auto-onlining. Why isn't that being used on s390? > So the type of memory is very

[PATCH v4 7/9] powerpc: enable building all dtbs

2018-10-01 Thread Rob Herring
Enable the 'dtbs' target for powerpc. This allows building all the dts files in arch/powerpc/boot/dts/ when COMPILE_TEST and OF_ALL_DTBS are enabled. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring ---

[PATCH v4 6/9] kbuild: consolidate Devicetree dtb build rules

2018-10-01 Thread Rob Herring
There is nothing arch specific about building dtb files other than their location under /arch/*/boot/dts/. Keeping each arch aligned is a pain. The dependencies and supported targets are all slightly different. Also, a cross-compiler for each arch is needed, but really the host compiler

[PATCH v4 1/9] powerpc: build .dtb files in dts directory

2018-10-01 Thread Rob Herring
Align powerpc with other architectures which build the dtb files in the same directory as the dts files. This is also in line with most other build targets which are located in the same directory as the source. This move will help enable the 'dtbs' target which builds all the dtbs regardless of

[PATCH v4 0/9] Devicetree build consolidation

2018-10-01 Thread Rob Herring
This series addresses a couple of issues I have with building dts files. First, the ability to build all the dts files in the tree. This has been supported on most arches for some time with powerpc being the main exception. The reason powerpc wasn't supported was it needed a change in the

Re: [PATCH v2] powerpc/rtas: Fix a potential race between CPU-Offline & Migration

2018-10-01 Thread Nathan Fontenot
On 10/01/2018 05:40 AM, Gautham R. Shenoy wrote: > From: "Gautham R. Shenoy" > > Live Partition Migrations require all the present CPUs to execute the > H_JOIN call, and hence rtas_ibm_suspend_me() onlines any offline CPUs > before initiating the migration for this purpose. > > The commit

Re: [PATCH v3 6/9] kbuild: consolidate Devicetree dtb build rules

2018-10-01 Thread Masahiro Yamada
Hi Rob, 2018年10月1日(月) 22:26 Rob Herring : > > On Mon, Oct 1, 2018 at 12:49 AM Masahiro Yamada > wrote: > > > > Hi Rob, > > > > > > 2018年9月29日(土) 0:43 Rob Herring : > > > > > +# > > > --- > > > +# Devicetree files > > > + >

Re: dma mask related fixups (including full bus_dma_mask support) v2

2018-10-01 Thread Christoph Hellwig
FYI, I've pulled this into the dma-mapping tree to make forward progress. All but oatch 4 had formal ACKs, and for that one Robin was fine even without and explicit ack. I'll also send a patch to better document the zone selection as it confuses even well versed people like Ben.

Re: [PATCH ppc-next] powerpc/fsl-booke: don't load early TLB at once

2018-10-01 Thread David Lamparter
On Sat, Sep 22, 2018 at 12:45:16AM -0500, Scott Wood wrote: > I don't suppose you're running a relocatable kernel at a non-zero # CONFIG_RELOCATABLE is not set > address, and/or are running in an environment that sets > HID0[EN_L2MMU_MHD] (neither standard U-boot nor Linux sets this bit, It's

Re: [PATCH v9 0/3] powerpc: Detection and scheduler optimization for POWER9 bigcore

2018-10-01 Thread Dave Hansen
On 10/01/2018 06:16 AM, Gautham R. Shenoy wrote: > > Patch 3: Creates a pair of sysfs attributes named > /sys/devices/system/cpu/cpuN/topology/smallcore_thread_siblings > and > /sys/devices/system/cpu/cpuN/topology/smallcore_thread_siblings_list > exposing the

Re: [PATCH v3 6/9] kbuild: consolidate Devicetree dtb build rules

2018-10-01 Thread Rob Herring
On Mon, Oct 1, 2018 at 12:49 AM Masahiro Yamada wrote: > > Hi Rob, > > > 2018年9月29日(土) 0:43 Rob Herring : > > > +# > > --- > > +# Devicetree files > > + > > +ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),) > >

Re: [PATCH ppc-next] powerpc/fsl-booke: don't load early TLB at once

2018-10-01 Thread David Lamparter
(Sorry about the delay on my end, deadlines ...) On Fri, Sep 21, 2018 at 06:07:48PM +, York Sun wrote: > On 09/21/2018 10:47 AM, Scott Wood wrote: > > On Fri, 2018-09-21 at 17:40 +, York Sun wrote: > >> On 09/20/2018 05:31 PM, Scott Wood wrote: > >>> On Fri, 2018-09-21 at 00:48 +0200,

Re: [PATCH] powerpc/numa: Skip onlining a offline node in kdump path

2018-10-01 Thread Hari Bathini
Thanks for the fix, Srikar.. On Friday 28 September 2018 09:17 AM, Srikar Dronamraju wrote: With Commit 2ea626306810 ("powerpc/topology: Get topology for shared processors at boot"), kdump kernel on shared lpar may crash. The necessary conditions are - Shared Lpar with atleast 2 nodes having

[PATCH v9 3/3] powerpc/sysfs: Add topology/smallcore_thread_siblings[_list]

2018-10-01 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" This patch adds two sysfs attributes named smallcore_thread_siblings and smallcore_thread_siblings_list to the "topology" attribute group for each CPU device. The read-only attributes /sys/device/system/cpu/cpuN/topology/smallcore_thread_siblings and

[PATCH v9 1/3] powerpc: Detect the presence of big-cores via "ibm, thread-groups"

2018-10-01 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" On IBM POWER9, the device tree exposes a property array identifed by "ibm,thread-groups" which will indicate which groups of threads share a particular set of resources. As of today we only have one form of grouping identifying the group of threads in the core that

[PATCH v9 0/3] powerpc: Detection and scheduler optimization for POWER9 bigcore

2018-10-01 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Hi, This is the ninth iteration of the patchset to add support for big-core on POWER9. This patch also optimizes the task placement on such big-core systems. The previous versions can be found here: v8: https://lkml.org/lkml/2018/9/20/899 v7:

[PATCH v9 2/3] powerpc: Use cpu_smallcore_sibling_mask at SMT level on bigcores

2018-10-01 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" POWER9 SMT8 cores consist of two groups of threads, where threads in each group shares L1-cache. The scheduler is not aware of this distinction as the current sched-domain hierarchy has all the threads of the core defined at the SMT domain. SMT [Thread

[PATCH v03 1/5] powerpc/drmem: Export 'dynamic-memory' loader

2018-10-01 Thread Michael Bringmann
powerpc/drmem: Export many of the functions of DRMEM to parse "ibm,dynamic-memory" and "ibm,dynamic-memory-v2" during hotplug operations and for Post Migration events. Also modify the DRMEM initialization code to allow it to, * Be called after system initialization * Provide a separate user copy

[PATCH v03 2/5] powerpc/drmem: Add internal_flags feature

2018-10-01 Thread Michael Bringmann
powerpc/drmem: Add internal_flags field to each LMB to allow marking of kernel software-specific operations that need not be exported to other users. For instance, if information about selected LMBs needs to be maintained for subsequent passes through the system, it can be encoded into the LMB

[PATCH v03 0/5] powerpc/migration: Affinity fix for memory

2018-10-01 Thread Michael Bringmann
The migration of LPARs across Power systems affects many attributes including that of the associativity of memory blocks. The patches in this set execute when a system is coming up fresh upon a migration target. They are intended to, * Recognize changes to the associativity of memory recorded

[PATCH v03 4/5] migration/memory: Evaluate LMB assoc changes

2018-10-01 Thread Michael Bringmann
migration/memory: This patch adds code that recognizes changes to the associativity of memory blocks described by the device-tree properties in order to drive equivalent 'hotplug' operations to update local and general kernel data structures to reflect those changes. These differences may

[PATCH v03 3/5] migration/memory: Add hotplug READD_MULTIPLE

2018-10-01 Thread Michael Bringmann
migration/memory: This patch adds a new pseries hotplug action for CPU and memory operations, PSERIES_HP_ELOG_ACTION_READD_MULTIPLE. This is a variant of the READD operation which performs the action upon multiple instances of the resource at one time. The operation is to be triggered by

[PATCH v03 5/5] migration/memory: Support 'ibm,dynamic-memory-v2'

2018-10-01 Thread Michael Bringmann
migration/memory: This patch adds recognition for changes to the associativity of memory blocks described by 'ibm,dynamic-memory-v2'. If the associativity of an LMB has changed, it should be readded to the system in order to update local and general kernel data structures. This patch builds upon

Re: [PATCH 2/2] powerpc/64: Increase stack redzone for 64-bit kernel to 512 bytes

2018-10-01 Thread Bin Meng
Hi Nick, On Mon, Oct 1, 2018 at 10:23 AM Nicholas Piggin wrote: > > On Mon, 1 Oct 2018 09:11:04 +0800 > Bin Meng wrote: > > > Hi Nick, > > > > On Mon, Oct 1, 2018 at 7:27 AM Nicholas Piggin wrote: > > > > > > On Sat, 29 Sep 2018 23:25:20 -0700 > > > Bin Meng wrote: > > > > > > > commit

[RFC PATCH v3 7/7] powerpc/64: Modify CURRENT_THREAD_INFO()

2018-10-01 Thread Christophe Leroy
CURRENT_THREAD_INFO() now uses the PACA to retrieve 'current' pointer, it doesn't use 'sp' anymore. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/exception-64s.h | 4 ++-- arch/powerpc/include/asm/thread_info.h | 2 +- arch/powerpc/kernel/entry_64.S

[RFC PATCH v3 6/7] powerpc/32: Remove CURRENT_THREAD_INFO and rename TI_CPU

2018-10-01 Thread Christophe Leroy
Now that thread_info is similar to task_struct, it's address is in r2 so CURRENT_THREAD_INFO() macro is useless. This patch removes it. At the same time, as the 'cpu' field is not anymore in thread_info, this patch renames it to TASK_CPU. Signed-off-by: Christophe Leroy ---

[RFC PATCH v3 4/7] powerpc: regain entire stack space

2018-10-01 Thread Christophe Leroy
thread_info is not anymore in the stack, so the entire stack can now be used. In the meantime, all pointers to the stacks are not anymore pointers to thread_info so this patch changes them to void* Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/irq.h | 10 +-

[RFC PATCH v3 5/7] powerpc: 'current_set' is now a table of task_struct pointers

2018-10-01 Thread Christophe Leroy
The table of pointers 'current_set' has been used for retrieving the stack and current. They used to be thread_info pointers as they were pointing to the stack and current was taken from the 'task' field of the thread_info. Now, the pointers of 'current_set' table are now both pointers to

[RFC PATCH v3 3/7] powerpc: Activate CONFIG_THREAD_INFO_IN_TASK

2018-10-01 Thread Christophe Leroy
This patch activates CONFIG_THREAD_INFO_IN_TASK which moves the thread_info into task_struct. Moving thread_info into task_struct has the following advantages: - It protects thread_info from corruption in the case of stack overflows. - Its address is harder to determine if stack addresses are

[RFC PATCH v3 2/7] powerpc: Prepare for moving thread_info into task_struct

2018-10-01 Thread Christophe Leroy
This patch cleans the powerpc kernel before activating CONFIG_THREAD_INFO_IN_TASK: - The purpose of the pointer given to call_do_softirq() and call_do_irq() is to point the new stack ==> change it to void* - Don't use CURRENT_THREAD_INFO() to locate the stack. - Fixed a few comments. - TI_CPU is

[RFC PATCH v3 1/7] book3s/64: avoid circular header inclusion in mmu-hash.h

2018-10-01 Thread Christophe Leroy
When activating CONFIG_THREAD_INFO_IN_TASK, linux/sched.h includes asm/current.h. This generates a circular dependency. To avoid that, asm/processor.h shall not be included in mmu-hash.h In order to do that, this patch moves into a new header called asm/task_size.h the information from

[RFC PATCH v3 0/7] powerpc: Switch to CONFIG_THREAD_INFO_IN_TASK

2018-10-01 Thread Christophe Leroy
The purpose of this serie is to activate CONFIG_THREAD_INFO_IN_TASK which moves the thread_info into task_struct. Moving thread_info into task_struct has the following advantages: - It protects thread_info from corruption in the case of stack overflows. - Its address is harder to determine if

RE: [PATCH v3 6/6] arm64: dts: add LX2160ARDB board support

2018-10-01 Thread Vabhav Sharma
> -Original Message- > From: devicetree-ow...@vger.kernel.org > On Behalf Of Li Yang > Sent: Saturday, September 29, 2018 1:07 AM > To: Vabhav Sharma > Cc: Sudeep Holla ; Scott Wood ; > lkml ; open list:OPEN FIRMWARE AND > FLATTENED DEVICE TREE BINDINGS ; Rob Herring > ; Mark Rutland ;

[PATCH] powerpc/lib: fix book3s/32 boot failure due to code patching

2018-10-01 Thread Christophe Leroy
Commit 51c3c62b58b3 ("powerpc: Avoid code patching freed init sections") accesses 'init_mem_is_free' flag too early, before the kernel is relocated. This provokes early boot failure (before the console is active). As it is not necessary to do this verification that early, this patch moves the

Re: [PATCH 1/2] powerpc/64: Remove duplicated -mabi=elfv2 for little endian targets

2018-10-01 Thread Bin Meng
On Mon, Oct 1, 2018 at 4:59 PM Segher Boessenkool wrote: > > On Sat, Sep 29, 2018 at 11:25:19PM -0700, Bin Meng wrote: > > The -mabi=elfv2 is currently specified twice in the makefile. Remove > > the one that does not test compiler. > > This was > > ifdef CONFIG_PPC64 >

RE: [PATCH v3 5/6] arm64: dts: add QorIQ LX2160A SoC support

2018-10-01 Thread Vabhav Sharma
> -Original Message- > From: linux-kernel-ow...@vger.kernel.org ow...@vger.kernel.org> On Behalf Of Li Yang > Sent: Saturday, September 29, 2018 2:11 AM > To: Vabhav Sharma > Cc: Sudeep Holla ; Scott Wood ; > lkml ; open list:OPEN FIRMWARE AND > FLATTENED DEVICE TREE BINDINGS ; Rob

Re: [v4] powerpc: Avoid code patching freed init sections

2018-10-01 Thread Christophe LEROY
Le 21/09/2018 à 13:59, Michael Ellerman a écrit : On Fri, 2018-09-14 at 01:14:11 UTC, Michael Neuling wrote: This stops us from doing code patching in init sections after they've been freed. In this chain: kvm_guest_init() -> kvm_use_magic_page() -> fault_in_pages_readable()

[PATCH v2] powerpc/rtas: Fix a potential race between CPU-Offline & Migration

2018-10-01 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Live Partition Migrations require all the present CPUs to execute the H_JOIN call, and hence rtas_ibm_suspend_me() onlines any offline CPUs before initiating the migration for this purpose. The commit 85a88cabad57 ("powerpc/pseries: Disable CPU hotplug across

Re: [PATCH RFC] mm/memory_hotplug: Introduce memory block types

2018-10-01 Thread David Hildenbrand
On 01/10/2018 10:40, Michal Hocko wrote: > On Fri 28-09-18 17:03:57, David Hildenbrand wrote: > [...] > > I haven't read the patch itself but I just wanted to note one thing > about this part > >> For paravirtualized devices it is relevant that memory is onlined as >> quickly as possible after

Re: [PATCH RFC] mm/memory_hotplug: Introduce memory block types

2018-10-01 Thread David Hildenbrand
On 28/09/2018 19:02, Dave Hansen wrote: > It's really nice if these kinds of things are broken up. First, replace > the old want_memblock parameter, then add the parameter to the > __add_page() calls. Definitely, once we agree that is is not nuts, I will split it up for the next version :) >

Re: [PATCH 2/2] powerpc/64: Increase stack redzone for 64-bit kernel to 512 bytes

2018-10-01 Thread Segher Boessenkool
On Sat, Sep 29, 2018 at 11:25:20PM -0700, Bin Meng wrote: > /* > - * Size of redzone that userspace is allowed to use below the stack > + * Size of redzone that kernel/userspace is allowed to use below the stack > * pointer. This is 288 in the 64-bit big-endian ELF ABI, and 512 in > * the

Re: [PATCH 1/2] powerpc/64: Remove duplicated -mabi=elfv2 for little endian targets

2018-10-01 Thread Segher Boessenkool
On Sat, Sep 29, 2018 at 11:25:19PM -0700, Bin Meng wrote: > The -mabi=elfv2 is currently specified twice in the makefile. Remove > the one that does not test compiler. This was ifdef CONFIG_PPC64 cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1)

Re: [PATCH 2/2] powerpc/64: Increase stack redzone for 64-bit kernel to 512 bytes

2018-10-01 Thread Segher Boessenkool
Hi! On Mon, Oct 01, 2018 at 12:22:56PM +1000, Nicholas Piggin wrote: > On Mon, 1 Oct 2018 09:11:04 +0800 > Bin Meng wrote: > > On Mon, Oct 1, 2018 at 7:27 AM Nicholas Piggin wrote: > > > On Sat, 29 Sep 2018 23:25:20 -0700 > > > Bin Meng wrote: > > > > commit 573ebfa6601f ("powerpc: Increase

Re: [PATCH RFC] mm/memory_hotplug: Introduce memory block types

2018-10-01 Thread Michal Hocko
On Fri 28-09-18 17:03:57, David Hildenbrand wrote: [...] I haven't read the patch itself but I just wanted to note one thing about this part > For paravirtualized devices it is relevant that memory is onlined as > quickly as possible after adding - and that it is added to the NORMAL > zone.

Re: [PATCH v3 6/9] kbuild: consolidate Devicetree dtb build rules

2018-10-01 Thread Geert Uytterhoeven
On Fri, Sep 28, 2018 at 8:42 PM Rob Herring wrote: > On Fri, Sep 28, 2018 at 12:21 PM Andreas Färber wrote: > > Am 13.09.18 um 17:51 schrieb Geert Uytterhoeven: > > > On Wed, Sep 12, 2018 at 3:02 AM Masahiro Yamada > > > wrote: > > >> Even x86 can enable OF and OF_UNITTEST. > > >> > > >>

Re: [PATCH] powerpc/rtas: Fix a potential race between CPU-Offline & Migration

2018-10-01 Thread Gautham R Shenoy
On Fri, Sep 28, 2018 at 03:36:08PM -0500, Nathan Fontenot wrote: > On 09/28/2018 02:02 AM, Gautham R Shenoy wrote: > > Hi Nathan, > > > > On Thu, Sep 27, 2018 at 12:31:34PM -0500, Nathan Fontenot wrote: > >> On 09/27/2018 11:51 AM, Gautham R. Shenoy wrote: > >>> From: "Gautham R. Shenoy" > >>> >

[PATCH] powerpc/nohash: fix undefined behaviour when testing page size support

2018-10-01 Thread Daniel Axtens
When enumerating page size definitions to check hardware support, we construct a constant which is (1U << (def->shift - 10)). However, the array of page size definitions is only initalised for various MMU_PAGE_* constants, so it contains a number of 0-initialised elements with def->shift == 0.

[PATCH] powerpc: remove leftover code of old GCC version checks

2018-10-01 Thread Masahiro Yamada
Clean up the leftover of commit f2910f0e6835 ("powerpc: remove old GCC version checks"). Signed-off-by: Masahiro Yamada --- My patch had been sent earlier, with more clean-ups: https://lore.kernel.org/patchwork/patch/977805/ Anyway, this cleans up the left-over of the Nicholas' one.