[PATCH v4 6/9] powerpc: 'current_set' is now a table of task_struct pointers

2018-10-04 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

[PATCH] powerpc/xmon/ppc-opc: Use ARRAY_SIZE macro

2018-10-04 Thread Gustavo A. R. Silva
Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva --- arch/powerpc/xmon/ppc-opc.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git

[PATCH] powerpc/migration: Init nodes before remove memory

2018-10-04 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 v4 2/9] powerpc: Only use task_struct 'cpu' field on SMP

2018-10-04 Thread Christophe Leroy
When moving to CONFIG_THREAD_INFO_IN_TASK, the thread_info 'cpu' field gets moved into task_struct and only defined when CONFIG_SMP is set. This patch ensures that TI_CPU is only used when CONFIG_SMP is set and that task_struct 'cpu' field is not used directly out of SMP code. Signed-off-by:

[PATCH v4 9/9] powerpc: clean stack pointers naming

2018-10-04 Thread Christophe Leroy
Some stack pointers used to also be thread_info pointers and were called tp. Now that they are only stack pointers, rename them sp. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/irq.c | 17 +++-- arch/powerpc/kernel/setup_64.c | 20 ++-- 2 files

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

2018-10-04 Thread Michal Suchánek
On Thu, 4 Oct 2018 17:45:13 +0200 David Hildenbrand wrote: > On 04/10/2018 17:28, Michal Suchánek wrote: > > > > The state of the art is to determine what to do with hotplugged > > memory in userspace based on platform and virtualization type. > > Exactly. > > > > > Changing the default

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

2018-10-04 Thread Michal Suchánek
On Thu, 4 Oct 2018 10:13:48 +0200 David Hildenbrand wrote: ok, so what is the problem here? Handling the hotplug in userspace through udev may be suboptimal and kernel handling might be faster but that's orthogonal to the problem at hand. The state of the art is to determine what to do with

[PATCH v4 3/9] powerpc: Prepare for moving thread_info into task_struct

2018-10-04 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* and rename it 'sp' - Don't use CURRENT_THREAD_INFO() to locate the stack. - Fix a few

[PATCH v4 8/9] powerpc/64: Remove CURRENT_THREAD_INFO

2018-10-04 Thread Christophe Leroy
Now that current_thread_info is located at the beginning of 'current' task struct, CURRENT_THREAD_INFO macro is not really needed any more. This patch replaces it by loads of the value at PACACURRENT(r13). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/exception-64s.h | 4

Re: [PATCH] dma-direct: Fix return value of dma_direct_supported

2018-10-04 Thread Alexander Duyck
On Thu, Oct 4, 2018 at 4:25 AM Robin Murphy wrote: > > On 04/10/18 00:48, Alexander Duyck wrote: > > It appears that in commit 9d7a224b463e ("dma-direct: always allow dma mask > > <= physiscal memory size") the logic of the test was changed from a "<" to > > a ">=" however I don't see any reason

[PATCH v4 1/9] book3s/64: avoid circular header inclusion in mmu-hash.h

2018-10-04 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_user64.h the information from

[PATCH v4 4/9] powerpc: Activate CONFIG_THREAD_INFO_IN_TASK

2018-10-04 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

[PATCH v4 5/9] powerpc: regain entire stack space

2018-10-04 Thread Christophe Leroy
thread_info is not anymore in the stack, so the entire stack can now be used. In the meantime, with the previous patch 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

[PATCH v4 7/9] powerpc/32: Remove CURRENT_THREAD_INFO and rename TI_CPU

2018-10-04 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 ---

[PATCH v4 0/9] powerpc: Switch to CONFIG_THREAD_INFO_IN_TASK

2018-10-04 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 RFC] mm/memory_hotplug: Introduce memory block types

2018-10-04 Thread David Hildenbrand
On 04/10/2018 17:28, Michal Suchánek wrote: > On Thu, 4 Oct 2018 10:13:48 +0200 > David Hildenbrand wrote: > > ok, so what is the problem here? > > Handling the hotplug in userspace through udev may be suboptimal and > kernel handling might be faster but that's orthogonal to the problem at >

Re: [PATCH] powerpc/xmon/ppc-opc: Use ARRAY_SIZE macro

2018-10-04 Thread Tyrel Datwyler
On 10/04/2018 10:10 AM, Gustavo A. R. Silva wrote: > Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element. > > This code was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Tyrel Datwyler

[PATCH] memblock: stop using implicit alignement to SMP_CACHE_BYTES

2018-10-04 Thread Mike Rapoport
When a memblock allocation APIs are called with align = 0, the alignment is implicitly set to SMP_CACHE_BYTES. Replace all such uses of memblock APIs with the 'align' parameter explicitly set to SMP_CACHE_BYTES and stop implicit alignment assignment in the memblock internal allocation functions.

Re: [PATCH v4 4/6] clk: qoriq: Add clockgen support for lx2160a

2018-10-04 Thread Viresh Kumar
On 04-10-18, 06:33, Vabhav Sharma wrote: > diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c > index 3d773f6..83921b7 100644 > --- a/drivers/cpufreq/qoriq-cpufreq.c > +++ b/drivers/cpufreq/qoriq-cpufreq.c > @@ -295,6 +295,7 @@ static const struct of_device_id

[PATCH 05/16] of: overlay: use prop add changeset entry for property in new nodes

2018-10-04 Thread frowand . list
From: Frank Rowand The changeset entry 'update property' was used for new properties in an overlay instead of 'add property'. The decision of whether to use 'update property' was based on whether the property already exists in the subtree where the node is being spliced into. At the top level

[PATCH 15/16] of: unittest: initialize args before calling of_irq_parse_one()

2018-10-04 Thread frowand . list
From: Frank Rowand Callers of of_irq_parse_one() blindly use the pointer args.np without checking whether of_irq_parse_one() had an error and thus did not set the value of args.np. Initialize args to zero so that using the format "%pOF" to show the value of args.np will show "(null)" when

Re: [PATCH v4 22/32] KVM: PPC: Book3S HV: Introduce rmap to track nested guest mappings

2018-10-04 Thread David Gibson
On Thu, Oct 04, 2018 at 09:55:59PM +1000, Paul Mackerras wrote: > From: Suraj Jitindar Singh > > When a host (L0) page which is mapped into a (L1) guest is in turn > mapped through to a nested (L2) guest we keep a reverse mapping (rmap) > so that these mappings can be retrieved later. > >

[PATCH 03/16] of: overlay: add missing of_node_get() in __of_attach_node_sysfs

2018-10-04 Thread frowand . list
From: Frank Rowand There is a matching of_node_put() in __of_detach_node_sysfs() Remove misleading comment from function header comment for of_detach_node(). This patch may result in memory leaks from code that directly calls the dynamic node add and delete functions directly instead of using

[PATCH 04/16] powerpc/pseries: add of_node_put() in dlpar_detach_node()

2018-10-04 Thread frowand . list
From: Frank Rowand "of: overlay: add missing of_node_get() in __of_attach_node_sysfs" added a missing of_node_get() to __of_attach_node_sysfs(). This results in a refcount imbalance for nodes attached with dlpar_attach_node(). The calling sequence from dlpar_attach_node() to

[PATCH 10/16] of: overlay: make all pr_debug() and pr_err() messages unique

2018-10-04 Thread frowand . list
From: Frank Rowand Make overlay.c debug and error messages unique so that they can be unambiguously found by grep. Signed-off-by: Frank Rowand --- drivers/of/overlay.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c

[PATCH 16/16] of: unittest: find overlays[] entry by name instead of index

2018-10-04 Thread frowand . list
From: Frank Rowand One accessor of overlays[] was using a hard coded index value to find the correct array entry instead of searching for the entry containing the correct name. Signed-off-by: Frank Rowand --- drivers/of/unittest.c | 21 + 1 file changed, 17 insertions(+),

Re: [PATCH v3 22/33] KVM: PPC: Book3S HV: Handle page fault for a nested guest

2018-10-04 Thread David Gibson
On Thu, Oct 04, 2018 at 07:21:20PM +1000, Paul Mackerras wrote: > On Wed, Oct 03, 2018 at 03:39:13PM +1000, David Gibson wrote: > > On Tue, Oct 02, 2018 at 09:31:21PM +1000, Paul Mackerras wrote: > > > From: Suraj Jitindar Singh > > > @@ -367,7 +367,9 @@ struct kvmppc_pte { > > > bool may_write

[PATCH 08/16] of: overlay: reorder fields in struct fragment

2018-10-04 Thread frowand . list
From: Frank Rowand Order the fields of struct fragment in the same order as struct of_overlay_notify_data. The order in struct fragment is not significant. If both structs are ordered the same then when examining the data in a debugger or dump the human involved does not have to remember which

[PATCH 13/16] of: overlay: check prevents multiple fragments touching same property

2018-10-04 Thread frowand . list
From: Frank Rowand Add test case of two fragments updating the same property. After adding the test case, the system hangs at end of boot, after after slub stack dumps from kfree() in crypto modprobe code. Multiple overlay fragments adding, modifying, or deleting the same property is not

Re: [PATCH v4 32/32] KVM: PPC: Book3S HV: Add a VM capability to enable nested virtualization

2018-10-04 Thread David Gibson
On Thu, Oct 04, 2018 at 09:56:09PM +1000, Paul Mackerras wrote: > With this, userspace can enable a KVM-HV guest to run nested guests > under it. > > The administrator can control whether any nested guests can be run; > setting the "nested" module parameter to false prevents any guests > becoming

Re: [PATCH v4 30/32] KVM: PPC: Book3S HV: Allow HV module to load without hypervisor mode

2018-10-04 Thread David Gibson
On Thu, Oct 04, 2018 at 09:56:07PM +1000, Paul Mackerras wrote: > With this, the KVM-HV module can be loaded in a guest running under > KVM-HV, and if the hypervisor supports nested virtualization, this > guest can now act as a nested hypervisor and run nested guests. > > This also adds some

Re: [PATCH v3 33/33] KVM: PPC: Book3S HV: Add a VM capability to enable nested virtualization

2018-10-04 Thread David Gibson
On Thu, Oct 04, 2018 at 07:48:26PM +1000, Paul Mackerras wrote: > On Wed, Oct 03, 2018 at 04:21:44PM +1000, David Gibson wrote: > > On Tue, Oct 02, 2018 at 09:31:32PM +1000, Paul Mackerras wrote: > > > With this, userspace can enable a KVM-HV guest to run nested guests > > > under it. > [snip] > >

[PATCH 09/16] of: overlay: validate overlay properties #address-cells and #size-cells

2018-10-04 Thread frowand . list
From: Frank Rowand If overlay properties #address-cells or #size-cells are already in the live devicetree for any given node, then the values in the overlay must match the values in the live tree. If the properties are already in the live tree then there is no need to create a changeset entry

[PATCH 11/16] of: overlay: test case of two fragments adding same node

2018-10-04 Thread frowand . list
From: Frank Rowand Multiple overlay fragments adding or deleting the same node is not supported. An attempt to do so results in an incorrect devicetree. The node name will be munged for the second add. After adding this patch, the unittest messages will show: Duplicate name in motor-1,

[PATCH 2/2] fsl: add i2c controlled qixis driver

2018-10-04 Thread Pankaj Bansal
FPGA on LX2160AQDS/LX2160ARDB connected on I2C bus, so add qixis driver which is basically an i2c client driver to control FPGA. Signed-off-by: Wang Dongsheng Signed-off-by: Pankaj Bansal --- drivers/soc/fsl/Kconfig| 9 drivers/soc/fsl/Makefile | 1 +

Re: [PATCH v4 23/32] KVM: PPC: Book3S HV: Implement H_TLB_INVALIDATE hcall

2018-10-04 Thread David Gibson
On Thu, Oct 04, 2018 at 09:56:00PM +1000, Paul Mackerras wrote: 11;rgb://> From: Suraj Jitindar Singh > > When running a nested (L2) guest the guest (L1) hypervisor will use > the H_TLB_INVALIDATE hcall when it needs to change the partition > scoped page tables or the partition table

[PATCH 00/16] of: overlay: validation checks, subsequent fixes

2018-10-04 Thread frowand . list
From: Frank Rowand Add checks to (1) overlay apply process and (2) memory freeing triggered by overlay release. The checks are intended to detect possible memory leaks and invalid overlays. The checks revealed bugs in existing code. Fixed the bugs. While fixing bugs, noted other issues,

[PATCH 06/16] of: overlay: do not duplicate properties from overlay for new nodes

2018-10-04 Thread frowand . list
From: Frank Rowand When allocating a new node, add_changeset_node() was duplicating the properties from the respective node in the overlay instead of allocating a node with no properties. When this patch is applied the errors reported by the devictree unittest from patch "of: overlay: add tests

[PATCH 14/16] of: unittest: remove unused of_unittest_apply_overlay() argument

2018-10-04 Thread frowand . list
From: Frank Rowand Argument unittest_nr is not used in of_unittest_apply_overlay(), remove it. Signed-off-by: Frank Rowand --- drivers/of/unittest.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index

[PATCH 01/16] of: overlay: add tests to validate kfrees from overlay removal

2018-10-04 Thread frowand . list
From: Frank Rowand Add checks: - attempted kfree due to refcount reaching zero before overlay is removed - properties linked to an overlay node when the node is removed - node refcount > one during node removal in a changeset destroy, if the node was created by the changeset After

[PATCH 07/16] of: dynamic: change type of of_{at, de}tach_node() to void

2018-10-04 Thread frowand . list
From: Frank Rowand of_attach_node() and of_detach_node() always return zero, so their return value is meaningless. Change their type to void and fix all callers to ignore return value. Signed-off-by: Frank Rowand --- Powerpc files not tested arch/powerpc/platforms/pseries/dlpar.c| 13

Re: [PATCH v3 30/33] KVM: PPC: Book3S HV: Allow HV module to load without hypervisor mode

2018-10-04 Thread David Gibson
On Thu, Oct 04, 2018 at 01:03:21PM +1000, Paul Mackerras wrote: > On Wed, Oct 03, 2018 at 04:15:15PM +1000, David Gibson wrote: > > On Tue, Oct 02, 2018 at 09:31:29PM +1000, Paul Mackerras wrote: > > > With this, the KVM-HV module can be loaded in a guest running under > > > KVM-HV, and if the

Re: lib/xz: Put CRC32_POLY_LE in xz_private.h

2018-10-04 Thread Michael Ellerman
On Fri, 2018-09-21 at 02:54:31 UTC, Joel Stanley wrote: > This fixes a regression introduced by faa16bc404d72a5 ("lib: Use > existing define with polynomial"). > > The cleanup added a dependency on include/linux, which broke the PowerPC > boot wrapper/decompresser when KERNEL_XZ is enabled: > >

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

2018-10-04 Thread Michael Ellerman
On Mon, 2018-10-01 at 12:21:10 UTC, 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

Re: [PATCH] memblock: stop using implicit alignement to SMP_CACHE_BYTES

2018-10-04 Thread Benjamin Herrenschmidt
On Fri, 2018-10-05 at 00:07 +0300, Mike Rapoport wrote: > When a memblock allocation APIs are called with align = 0, the alignment is > implicitly set to SMP_CACHE_BYTES. > > Replace all such uses of memblock APIs with the 'align' parameter explicitly > set to SMP_CACHE_BYTES and stop implicit

[PATCH 02/16] of: overlay: add missing of_node_put() after add new node to changeset

2018-10-04 Thread frowand . list
From: Frank Rowand The refcount of a newly added overlay node decrements to one (instead of zero) when the overlay changeset is destroyed. This change will cause the final decrement be to zero. After applying this patch, new validation warnings will be reported from the devicetree unittest

[PATCH 12/16] of: overlay: check prevents multiple fragments add or delete same node

2018-10-04 Thread frowand . list
From: Frank Rowand Multiple overlay fragments adding or deleting the same node is not supported. Replace code comment of such, with check to detect the attempt and fail the overlay apply. Devicetree unittest where multiple fragments added the same node was added in the previous patch in the

[PATCH 0/2] add i2c controlled qixis driver

2018-10-04 Thread Pankaj Bansal
FPGA on LX2160AQDS/LX2160ARDB connected on I2C bus, so add qixis driver which is basically an i2c client driver to control FPGA. This driver is essential to control MDIO mux multiplexing. Cc: Varun Sethi Pankaj Bansal (2): dt-bindings: soc: fsl: Document Qixis FPGA usage fsl: add i2c

[PATCH 1/2] dt-bindings: soc: fsl: Document Qixis FPGA usage

2018-10-04 Thread Pankaj Bansal
an FPGA-based system controller, called “Qixis”, which manages several critical system features, including: • Reset sequencing • Power supply configuration • Board configuration • hardware configuration The qixis registers are accessible over one or more system-specific interfaces, typically I2C,

Re: [PATCH v4 24/32] KVM: PPC: Book3S HV: Use hypercalls for TLB invalidation when nested

2018-10-04 Thread David Gibson
On Thu, Oct 04, 2018 at 09:56:01PM +1000, Paul Mackerras wrote: > This adds code to call the H_TLB_INVALIDATE hypercall when running as > a guest, in the cases where we need to invalidate TLBs (or other MMU > caches) as part of managing the mappings for a nested guest. Calling > H_TLB_INVALIDATE

Re: [PATCH v4 25/32] KVM: PPC: Book3S HV: Invalidate TLB when nested vcpu moves physical cpu

2018-10-04 Thread David Gibson
On Thu, Oct 04, 2018 at 09:56:02PM +1000, Paul Mackerras wrote: > From: Suraj Jitindar Singh > > This is only done at level 0, since only level 0 knows which physical > CPU a vcpu is running on. This does for nested guests what L0 already > did for its own guests, which is to flush the TLB on a

Re: [PATCH v4 25/32] KVM: PPC: Book3S HV: Invalidate TLB when nested vcpu moves physical cpu

2018-10-04 Thread David Gibson
On Fri, Oct 05, 2018 at 02:23:50PM +1000, Paul Mackerras wrote: > On Fri, Oct 05, 2018 at 02:09:08PM +1000, David Gibson wrote: > > On Thu, Oct 04, 2018 at 09:56:02PM +1000, Paul Mackerras wrote: > > > From: Suraj Jitindar Singh > > > > > > This is only done at level 0, since only level 0 knows

Re: [PATCH v4 06/32] KVM: PPC: Book3S HV: Simplify real-mode interrupt handling

2018-10-04 Thread David Gibson
On Thu, Oct 04, 2018 at 09:55:43PM +1000, Paul Mackerras wrote: > This streamlines the first part of the code that handles a hypervisor > interrupt that occurred in the guest. With this, all of the real-mode > handling that occurs is done before the "guest_exit_cont" label; once > we get to that

Re: [PATCH v4 17/32] KVM: PPC: Book3S HV: Framework and hcall stubs for nested virtualization

2018-10-04 Thread David Gibson
On Thu, Oct 04, 2018 at 09:55:54PM +1000, Paul Mackerras wrote: > This starts the process of adding the code to support nested HV-style > virtualization. It defines a new H_SET_PARTITION_TABLE hypercall which > a nested hypervisor can use to set the base address and size of a > partition table in

Re: linux-next: Tree for Oct 4

2018-10-04 Thread Stephen Rothwell
Hi Guenter, On Thu, 4 Oct 2018 18:33:02 -0700 Guenter Roeck wrote: > > Most of the boot failures are hopefully fixed with > https://lore.kernel.org/patchwork/patch/995254/ I have added that commit to linux-next today. -- Cheers, Stephen Rothwell pgpGh31TN9eMx.pgp Description: OpenPGP

Re: [PATCH v4 25/32] KVM: PPC: Book3S HV: Invalidate TLB when nested vcpu moves physical cpu

2018-10-04 Thread Paul Mackerras
On Fri, Oct 05, 2018 at 02:09:08PM +1000, David Gibson wrote: > On Thu, Oct 04, 2018 at 09:56:02PM +1000, Paul Mackerras wrote: > > From: Suraj Jitindar Singh > > > > This is only done at level 0, since only level 0 knows which physical > > CPU a vcpu is running on. This does for nested guests

Re: [PATCH v4 25/32] KVM: PPC: Book3S HV: Invalidate TLB when nested vcpu moves physical cpu

2018-10-04 Thread Paul Mackerras
On Fri, Oct 05, 2018 at 02:54:28PM +1000, David Gibson wrote: > On Fri, Oct 05, 2018 at 02:23:50PM +1000, Paul Mackerras wrote: > > On Fri, Oct 05, 2018 at 02:09:08PM +1000, David Gibson wrote: > > > On Thu, Oct 04, 2018 at 09:56:02PM +1000, Paul Mackerras wrote: > > > > From: Suraj Jitindar Singh

Re: drivers binding to device node with multiple compatible strings

2018-10-04 Thread Grant Likely
On Fri, Sep 28, 2018 at 10:01 PM Li Yang wrote: > > On Fri, Sep 28, 2018 at 3:07 PM Rob Herring wrote: > > > > On Thu, Sep 27, 2018 at 5:25 PM Li Yang wrote: > > > > > > Hi Rob and Grant, > > > > > > Various device tree specs are recommending to include all the > > > potential compatible

Re: Looking for architecture papers

2018-10-04 Thread Gabriel Paubert
On Thu, Oct 04, 2018 at 10:41:13AM +0300, Raz wrote: > Frankly, the more I read the more perplexed I get. For example, > according to BOOK III-S, chapter 3, > the MSR bits are differ from the ones described in > arch/powerpc/include/asm/reg.h. > Bit zero, is LE, but in the book it is 64-bit mode.

Re: [PATCH v3 22/33] KVM: PPC: Book3S HV: Handle page fault for a nested guest

2018-10-04 Thread Paul Mackerras
On Wed, Oct 03, 2018 at 03:39:13PM +1000, David Gibson wrote: > On Tue, Oct 02, 2018 at 09:31:21PM +1000, Paul Mackerras wrote: > > From: Suraj Jitindar Singh > > @@ -367,7 +367,9 @@ struct kvmppc_pte { > > bool may_write : 1; > > bool may_execute: 1; > > unsigned

Re: [PATCH v3 29/33] KVM: PPC: Book3S HV: Handle differing endianness for H_ENTER_NESTED

2018-10-04 Thread Paul Mackerras
On Wed, Oct 03, 2018 at 04:13:36PM +1000, David Gibson wrote: > On Tue, Oct 02, 2018 at 09:31:28PM +1000, Paul Mackerras wrote: > > From: Suraj Jitindar Singh > > > > The hcall H_ENTER_NESTED takes as the two parameters the address in > > L1 guest memory of a hv_regs struct and a pt_regs struct

Re: drivers binding to device node with multiple compatible strings

2018-10-04 Thread Grant Likely
On 04/10/2018 10:32, Grant Likely wrote: On Fri, Sep 28, 2018 at 10:01 PM Li Yang wrote: On Fri, Sep 28, 2018 at 3:07 PM Rob Herring wrote: On Thu, Sep 27, 2018 at 5:25 PM Li Yang wrote: Hi Rob and Grant, Various device tree specs are recommending to include all the potential

[PATCH v2 -next] powerpc/pseries/memory-hotplug: Fix return value type of find_aa_index

2018-10-04 Thread YueHaibing
'aa_index' is defined as an unsigned value, but find_aa_index may return -1 when dlpar_clone_property fails. So we use an rc value to track the validation of finding the aa_index instead of the 'aa_index' value itself Fixes: c05a5a40969e ("powerpc/pseries: Dynamic add entires to associativity

Re: [PATCH v3 33/33] KVM: PPC: Book3S HV: Add a VM capability to enable nested virtualization

2018-10-04 Thread Paul Mackerras
On Wed, Oct 03, 2018 at 04:21:44PM +1000, David Gibson wrote: > On Tue, Oct 02, 2018 at 09:31:32PM +1000, Paul Mackerras wrote: > > With this, userspace can enable a KVM-HV guest to run nested guests > > under it. [snip] > > +/* If set, guests are allowed to create and control nested guests */ > >

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

2018-10-04 Thread David Hildenbrand
On 01/10/2018 18:24, Dave Hansen wrote: >> 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? No, rether somebody wanted this VM to have more

Re: Looking for architecture papers

2018-10-04 Thread Raz
Frankly, the more I read the more perplexed I get. For example, according to BOOK III-S, chapter 3, the MSR bits are differ from the ones described in arch/powerpc/include/asm/reg.h. Bit zero, is LE, but in the book it is 64-bit mode. Would someone be kind to explain what I do not understand?

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

2018-10-04 Thread David Hildenbrand
On 04/10/2018 08:19, Michal Hocko wrote: > On Wed 03-10-18 19:14:05, David Hildenbrand wrote: >> On 03/10/2018 16:34, Vitaly Kuznetsov wrote: >>> Dave Hansen writes: >>> On 10/03/2018 06:52 AM, Vitaly Kuznetsov wrote: > It is more than just memmaps (e.g. forking udev process doing memory

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

2018-10-04 Thread Christophe LEROY
Le 03/10/2018 à 06:24, Nicholas Piggin a écrit : On Mon, 1 Oct 2018 12:30:19 + (UTC) Christophe Leroy wrote: 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

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

2018-10-04 Thread Aneesh Kumar K.V
On 10/4/18 1:50 PM, Christophe LEROY wrote: Le 03/10/2018 à 06:24, Nicholas Piggin a écrit : On Mon,  1 Oct 2018 12:30:19 + (UTC) Christophe Leroy wrote: When activating CONFIG_THREAD_INFO_IN_TASK, linux/sched.h includes asm/current.h. This generates a circular dependency. To avoid

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

2018-10-04 Thread Christophe LEROY
Le 04/10/2018 à 10:23, Aneesh Kumar K.V a écrit : On 10/4/18 1:50 PM, Christophe LEROY wrote: Le 03/10/2018 à 06:24, Nicholas Piggin a écrit : On Mon,  1 Oct 2018 12:30:19 + (UTC) Christophe Leroy wrote: When activating CONFIG_THREAD_INFO_IN_TASK, linux/sched.h includes

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

2018-10-04 Thread Michal Hocko
On Wed 03-10-18 19:00:29, David Hildenbrand wrote: [...] > Let me rephrase: You state that user space has to make the decision and > that user should be able to set/reconfigure rules. That is perfectly fine. > > But then we should give user space access to sufficient information to > make a

Re: [PATCH V3 0/2] mm/kvm/vfio/ppc64: Migrate compound pages out of CMA region

2018-10-04 Thread Aneesh Kumar K.V
Hi Andrew, "Aneesh Kumar K.V" writes: > ppc64 use CMA area for the allocation of guest page table (hash page table). > We won't > be able to start guest if we fail to allocate hash page table. We have > observed > hash table allocation failure because we failed to migrate pages out of CMA

Re: Looking for architecture papers

2018-10-04 Thread Segher Boessenkool
On Thu, Oct 04, 2018 at 10:41:13AM +0300, Raz wrote: > Frankly, the more I read the more perplexed I get. For example, > according to BOOK III-S, chapter 3, > the MSR bits are differ from the ones described in > arch/powerpc/include/asm/reg.h. > Bit zero, is LE, but in the book it is 64-bit mode.

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

2018-10-04 Thread David Hildenbrand
On 04/10/2018 08:28, Michal Hocko wrote: > On Wed 03-10-18 19:00:29, David Hildenbrand wrote: > [...] >> Let me rephrase: You state that user space has to make the decision and >> that user should be able to set/reconfigure rules. That is perfectly fine. >> >> But then we should give user space

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

2018-10-04 Thread David Hildenbrand
On 03/10/2018 16:24, Michal Hocko wrote: > On Wed 03-10-18 15:52:24, Vitaly Kuznetsov wrote: > [...] >>> As David said some of the memory cannot be onlined without further steps >>> (e.g. when it is standby as David called it) and then I fail to see how >>> eBPF help in any way. >> >> and also, we

Re: powerpc: cell: use irq_of_parse_and_map helper

2018-10-04 Thread Michael Ellerman
On Thu, 2018-01-04 at 22:45:41 UTC, Rob Herring wrote: > Instead of calling both of_irq_parse_one and irq_create_of_mapping, call > of_irq_parse_and_map instead which does the same thing. This gets us closer > to making the former 2 functions static. > > Cc: Arnd Bergmann > Cc: Benjamin

Re: [v3] powerpc/powernv: Make possible for user to force a full ipl cec reboot

2018-10-04 Thread Michael Ellerman
On Fri, 2018-09-07 at 07:34:48 UTC, Vaibhav Jain wrote: > Ever since fast reboot is enabled by default in opal, > opal_cec_reboot() will use fast-reset instead of full IPL to perform > system reboot. This leaves the user with no direct way to force a full > IPL reboot except changing an nvram

Re: [v3] macintosh: Convert to using %pOFn instead of device_node.name

2018-10-04 Thread Michael Ellerman
On Tue, 2018-09-04 at 21:27:44 UTC, Rob Herring wrote: > In preparation to remove the node name pointer from struct device_node, > convert printf users to use the %pOFn format specifier. > > Cc: Benjamin Herrenschmidt > Cc: linuxppc-dev@lists.ozlabs.org > Signed-off-by: Rob Herring Applied to

Re: [v2] powerpc/traps: merge unrecoverable_exception() and nonrecoverable_exception()

2018-10-04 Thread Michael Ellerman
On Tue, 2018-09-25 at 14:10:04 UTC, Christophe Leroy wrote: > PPC32 uses nonrecoverable_exception() while PPC64 uses > unrecoverable_exception(). > > Both functions are doing almost the same thing. > > This patch removes nonrecoverable_exception() > > Signed-off-by: Christophe Leroy Applied

Re: powerpc: xive: Move a dereference below a NULL test

2018-10-04 Thread Michael Ellerman
On Wed, 2018-09-26 at 12:09:32 UTC, zhong jiang wrote: > It is safe to move dereference below a NULL test. > > Signed-off-by: zhong jiang Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/cd5ff94577e004e0a4457e70d0ef3a cheers

Re: [1/2] powerpc/pseries: Fix DTL buffer registration

2018-10-04 Thread Michael Ellerman
On Thu, 2018-09-27 at 08:10:57 UTC, "Naveen N. Rao" wrote: > When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set, we register the DTL > buffer for a cpu when the associated file under powerpc/dtl in debugfs > is opened. When doing so, we need to set the size of the buffer being > registered in the

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

2018-10-04 Thread Michal Hocko
On Wed 03-10-18 19:14:05, David Hildenbrand wrote: > On 03/10/2018 16:34, Vitaly Kuznetsov wrote: > > Dave Hansen writes: > > > >> On 10/03/2018 06:52 AM, Vitaly Kuznetsov wrote: > >>> It is more than just memmaps (e.g. forking udev process doing memory > >>> onlining also needs memory) but yes,

Re: powerpc: Convert to using %pOFn instead of device_node.name

2018-10-04 Thread Michael Ellerman
On Tue, 2018-08-28 at 01:52:07 UTC, Rob Herring wrote: > In preparation to remove the node name pointer from struct device_node, > convert printf users to use the %pOFn format specifier. > > Cc: Benjamin Herrenschmidt > Cc: Paul Mackerras > Cc: Michael Ellerman > Cc: Arnd Bergmann > Cc:

Re: [1/3] powerpc: Redefine TIF_32BITS thread flag

2018-10-04 Thread Michael Ellerman
On Thu, 2018-09-20 at 16:45:05 UTC, Breno Leitao wrote: > Moving TIF_32BIT to use bit 20 instead of 4 in the task flag field. > > This change is making room for an upcoming new task macro > (_TIF_SYSCALL_EMU) which is preferred to set a bit in the lower 16-bits > part of the word. > > This

Re: powerpc/perf: Add missing break in power7_marked_instr_event()

2018-10-04 Thread Michael Ellerman
On Thu, 2018-09-20 at 09:41:11 UTC, Michael Ellerman wrote: > In power7_marked_instr_event() there is a switch case that is missing > a break or an explicit fallthrough, it's not immediately clear which > it should be. > > The function determines based on the PMU event code, whether the event >

Re: powerpc/64s: consolidate MCE counter increment.

2018-10-04 Thread Michael Ellerman
On Wed, 2018-09-26 at 12:24:30 UTC, Michal Suchanek wrote: > The code in machine_check_exception excludes 64s hvmode when > incrementing the MCE counter only to call opal_machine_check to > increment it specifically for this case. > > Remove the exclusion and special case. > > Fixes:

Re: [v5,1/2] powerpc/32: add stack protector support

2018-10-04 Thread Michael Ellerman
On Thu, 2018-09-27 at 07:05:53 UTC, Christophe Leroy wrote: > This functionality was tentatively added in the past > (commit 6533b7c16ee5 ("powerpc: Initial stack protector > (-fstack-protector) support")) but had to be reverted > (commit f2574030b0e3 ("powerpc: Revert the initial stack >

Re: powerpc/tm: Reformat comments

2018-10-04 Thread Michael Ellerman
On Thu, 2018-09-27 at 05:05:15 UTC, Michael Neuling wrote: > The comments in this file don't conform to the coding style so take > them to "Comment Formatting Re-Education Camp" > > Suggested-by: Michael "Camp Drill Sargent" Ellerman > Signed-off-by: Michael Neuling Applied to powerpc next,

Re: [PATCH] powerpc: Add doorbell tracepoints

2018-10-04 Thread Anton Blanchard
Hi Russell, > snowpatch builds failed for this patch on all 64-bit configurations > (ppc64e, ppc64 and ppc64le) with the following: Thanks! Stupid bug on my part, need more quilt ref. Update to follow. Anton > arch/powerpc/kernel/dbell.c:85:9: error: undefined identifier >

Re: powerpc/mm: Don't report hugepage tables as memory leaks when using kmemleak

2018-10-04 Thread Michael Ellerman
On Mon, 2018-08-13 at 13:19:52 UTC, Christophe Leroy wrote: > When a process allocates a hugepage, the following leak is > reported by kmemleak. This is a false positive which is > due to the pointer to the table being stored in the PGD > as physical memory address and not virtual memory pointer.

Re: [V3, 1/6] powerpc/mm/book3s: Update pmd_present to look at _PAGE_PRESENT bit

2018-10-04 Thread Michael Ellerman
On Thu, 2018-09-20 at 18:09:42 UTC, "Aneesh Kumar K.V" wrote: > With this patch we use 0x8000UL (_PAGE_PRESENT) to indicate a > valid > pgd/pud/pmd entry. We also switch the p**_present() to look at this bit. > > With pmd_present, we have a special case. We need to make sure we

Re: powerpc/powernv: Mark function as __noreturn

2018-10-04 Thread Michael Ellerman
On Tue, 2018-09-25 at 14:29:33 UTC, Breno Leitao wrote: > There is a mismatch between function pnv_platform_error_reboot() definition > and declaration regarding function modifiers. In the declaration part, it > contains the function attribute __noreturn, while function definition > itself lacks

Re: [1/1] powerpc/config: Enable CONFIG_PRINTK_TIME

2018-10-04 Thread Michael Ellerman
On Wed, 2018-09-26 at 14:10:56 UTC, Petr Vorel wrote: > for 64bit configs which use for CONFIG_LOG_BUF_SHIFT the same > or higher value than the default (currently 17). > > Signed-off-by: Petr Vorel Applied to powerpc next, thanks.

Re: [v2] powerpc: pseries: use of_irq_get helper in request_event_sources_irqs

2018-10-04 Thread Michael Ellerman
On Thu, 2018-02-01 at 17:59:22 UTC, Rob Herring wrote: > Instead of calling both of_irq_parse_one and irq_create_of_mapping, call > of_irq_get instead which does essentially the same thing. of_irq_get > also calls irq_find_host for deferred probe support, but this should be > fine as

Re: [v2] powerpc/tm: Print 64-bits MSR

2018-10-04 Thread Michael Ellerman
On Tue, 2018-08-07 at 13:35:00 UTC, Breno Leitao wrote: > On a kernel TM Bad thing program exception, the Machine State Register > (MSR) is not being properly displayed. The exception code dumps a 32-bits > value but MSR is a 64 bits register for all platforms that have HTM > enabled. > > This

Re: [v3] powerpc/tm: Remove msr_tm_active()

2018-10-04 Thread Michael Ellerman
On Thu, 2018-08-16 at 17:21:07 UTC, Breno Leitao wrote: > Currently msr_tm_active() is a wrapper around MSR_TM_ACTIVE() if > CONFIG_PPC_TRANSACTIONAL_MEM is set, or it is just a function that > returns false if CONFIG_PPC_TRANSACTIONAL_MEM is not set. > > This function is not necessary, since

Re: [-next] powerpc: Remove duplicated include from pci_32.c

2018-10-04 Thread Michael Ellerman
On Sun, 2018-09-23 at 08:12:08 UTC, YueHaibing wrote: > Remove duplicated include. > > Signed-off-by: YueHaibing > Reviewed-by: Stephen Rothwell Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/01b9870ea614518d48b6d2c787284b cheers

Re: [v3] powerpc: wire up memtest

2018-10-04 Thread Michael Ellerman
On Fri, 2018-09-28 at 15:39:20 UTC, Christophe Leroy wrote: > Add call to early_memtest() so that kernel compiled with > CONFIG_MEMTEST really perform memtest at startup when requested > via 'memtest' boot parameter. > > Tested-by: Daniel Axtens > Signed-off-by: Christophe Leroy Applied to

[PATCH] powerpc: Add doorbell tracepoints

2018-10-04 Thread Anton Blanchard
When analysing sources of OS jitter, I noticed that doorbells cannot be traced. Signed-off-by: Anton Blanchard --- arch/powerpc/include/asm/trace.h | 16 arch/powerpc/kernel/dbell.c | 3 +++ 2 files changed, 19 insertions(+) diff --git a/arch/powerpc/include/asm/trace.h

[PATCH v4 04/32] KVM: PPC: Book3S HV: Move interrupt delivery on guest entry to C code

2018-10-04 Thread Paul Mackerras
This is based on a patch by Suraj Jitindar Singh. This moves the code in book3s_hv_rmhandlers.S that generates an external, decrementer or privileged doorbell interrupt just before entering the guest to C code in book3s_hv_builtin.c. This is to make future maintenance and modification easier.

  1   2   >