Re: [PATCH] powerpc/xive: Fix bogus error code returned by OPAL

2019-09-23 Thread Greg KH
On Mon, Sep 23, 2019 at 08:29:40AM +0200, Greg Kurz wrote: > There's a bug in skiboot that causes the OPAL_XIVE_ALLOCATE_IRQ call > to return the 32-bit value 0x when OPAL has run out of IRQs. > Unfortunatelty, OPAL return values are signed 64-bit entities and > errors are supposed to be ne

[PATCH v2 rebased] powerpc/fadump: when fadump is supported register the fadump sysfs files.

2019-09-23 Thread Michal Suchanek
Currently it is not possible to distinguish the case when fadump is supported by firmware and disabled in kernel and completely unsupported using the kernel sysfs interface. User can investigate the devicetree but it is more reasonable to provide sysfs files in case we get some fadumpv2 in the fu

Re: [PATCH 1/3] powernv/pci: Use pnv_phb as the private data for debugfs entries

2019-09-23 Thread Alexey Kardashevskiy
On 12/09/2019 15:29, Oliver O'Halloran wrote: > Use the pnv_phb structure as the private data pointer for the debugfs > files. This lets us delete some code and an open-coded use of > hose->private_data. > > Signed-off-by: Oliver O'Halloran Reviewed-by: Alexey Kardashevskiy > --- > arc

Re: [PATCH 3/3] powernv/pci: Add a debugfs entry to dump PHB's IODA PE state

2019-09-23 Thread Alexey Kardashevskiy
On 12/09/2019 15:29, Oliver O'Halloran wrote: > Add a debugfs entry to dump the state of the active IODA PEs. The IODA PE > state reflects how the PHB's internal concept of a PE is configured. This > is separate to the EEH PE state and is managed power the PowerNV PCI > backend rather than the E

Re: [PATCH 4/5] ocxl: Add functions to map/unmap LPC memory

2019-09-23 Thread Frederic Barrat
diff --git a/drivers/misc/ocxl/link.c b/drivers/misc/ocxl/link.c index 2874811a4398..9e303a5f4d85 100644 --- a/drivers/misc/ocxl/link.c +++ b/drivers/misc/ocxl/link.c @@ -738,7 +738,7 @@ int ocxl_link_add_lpc_mem(void *link_handle, u64 size) } EXPORT_SYMBOL_GPL(ocxl_link_add_lpc_mem);

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-23 Thread Peter Zijlstra
On Tue, Sep 17, 2019 at 08:48:54PM +0800, Yunsheng Lin wrote: > When passing the return value of dev_to_node() to cpumask_of_node() > without checking if the device's node id is NUMA_NO_NODE, there is > global-out-of-bounds detected by KASAN. > > From the discussion [1], NUMA_NO_NODE really means

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-23 Thread Michal Hocko
On Mon 23-09-19 17:15:19, Peter Zijlstra wrote: > On Tue, Sep 17, 2019 at 08:48:54PM +0800, Yunsheng Lin wrote: > > When passing the return value of dev_to_node() to cpumask_of_node() > > without checking if the device's node id is NUMA_NO_NODE, there is > > global-out-of-bounds detected by KASAN.

[PATCH 0/6] KVM: PPC: Book3S: HV: XIVE: Allocate less VPs in OPAL

2019-09-23 Thread Greg Kurz
Each vCPU of a VM allocates a XIVE VP in OPAL which is associated with 8 event queue (EQ) descriptors, one for each priority. A POWER9 socket can handle a maximum of 1M event queues. The powernv platform allocates NR_CPUS (== 2048) VPs for the hypervisor, and each XIVE KVM device allocates KVM_MAX

[PATCH 1/6] KVM: PPC: Book3S HV: XIVE: initialize private pointer when VPs are allocated

2019-09-23 Thread Greg Kurz
From: Cédric Le Goater Do not assign the device private pointer before making sure the XIVE VPs are allocated in OPAL and test pointer validity when releasing the device. Fixes: 5422e95103cf ("KVM: PPC: Book3S HV: XIVE: Replace the 'destroy' method by a 'release' method") Signed-off-by: Cédric

[PATCH 2/6] KVM: PPC: Book3S HV: XIVE: Set kvm->arch.xive when VPs are allocated

2019-09-23 Thread Greg Kurz
If we cannot allocate the XIVE VPs in OPAL, the creation of a XIVE or XICS-on-XIVE device is aborted as expected, but we leave kvm->arch.xive set forever since the relase method isn't called in this case. Any subsequent tentative to create a XIVE or XICS-on-XIVE for this VM will thus always fail. T

[PATCH 3/6] KVM: PPC: Book3S HV: XIVE: Ensure VP isn't already in use

2019-09-23 Thread Greg Kurz
We currently prevent userspace to connect a new vCPU if we already have one with the same vCPU id. This is good but unfortunately not enough, because VP ids derive from the packed vCPU ids, and kvmppc_pack_vcpu_id() can return colliding values. For examples, 348 stays unchanged since it is < KVM_MA

[PATCH 4/6] KVM: PPC: Book3S HV: XIVE: Compute the VP id in a common helper

2019-09-23 Thread Greg Kurz
Reduce code duplication by consolidating the checking of vCPU ids and VP ids to a common helper used by both legacy and native XIVE KVM devices. And explain the magic with a comment. Signed-off-by: Greg Kurz --- arch/powerpc/kvm/book3s_xive.c| 42 ++--- arch

[PATCH 5/6] KVM: PPC: Book3S HV: XIVE: Make VP block size configurable

2019-09-23 Thread Greg Kurz
The XIVE VP is an internal structure which allow the XIVE interrupt controller to maintain the interrupt context state of vCPUs non dispatched on HW threads. When a guest is started, the XIVE KVM device allocates a block of XIVE VPs in OPAL, enough to accommodate the highest possible vCPU id KVM_M

[PATCH 6/6] KVM: PPC: Book3S HV: XIVE: Allow userspace to set the # of VPs

2019-09-23 Thread Greg Kurz
Add a new attribute to both legacy and native XIVE KVM devices so that userspace can require less interrupt servers than the current default (KVM_MAX_VCPUS, 2048). This will allow to allocate less VPs in OPAL, and likely increase the number of VMs that can run with an in-kernel XIVE implementation.

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-23 Thread Peter Zijlstra
On Mon, Sep 23, 2019 at 05:28:56PM +0200, Michal Hocko wrote: > On Mon 23-09-19 17:15:19, Peter Zijlstra wrote: > > > diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c > > > index 4123100e..9859acb 100644 > > > --- a/arch/x86/mm/numa.c > > > +++ b/arch/x86/mm/numa.c > > > @@ -861,6 +861,9 @@ vo

Re: [PATCH 6/6] KVM: PPC: Book3S HV: XIVE: Allow userspace to set the # of VPs

2019-09-23 Thread Cédric Le Goater
On 23/09/2019 17:44, Greg Kurz wrote: > Add a new attribute to both legacy and native XIVE KVM devices so that > userspace can require less interrupt servers than the current default > (KVM_MAX_VCPUS, 2048). This will allow to allocate less VPs in OPAL, > and likely increase the number of VMs that

Re: [PATCH 3/6] KVM: PPC: Book3S HV: XIVE: Ensure VP isn't already in use

2019-09-23 Thread Cédric Le Goater
On 23/09/2019 17:43, Greg Kurz wrote: > We currently prevent userspace to connect a new vCPU if we already have > one with the same vCPU id. This is good but unfortunately not enough, > because VP ids derive from the packed vCPU ids, and kvmppc_pack_vcpu_id() > can return colliding values. For exam

Re: [PATCH 2/6] KVM: PPC: Book3S HV: XIVE: Set kvm->arch.xive when VPs are allocated

2019-09-23 Thread Cédric Le Goater
On 23/09/2019 17:43, Greg Kurz wrote: > If we cannot allocate the XIVE VPs in OPAL, the creation of a XIVE or > XICS-on-XIVE device is aborted as expected, but we leave kvm->arch.xive > set forever since the relase method isn't called in this case. Any release > subsequent tentative to create a X

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-23 Thread Michal Hocko
On Mon 23-09-19 17:48:52, Peter Zijlstra wrote: > On Mon, Sep 23, 2019 at 05:28:56PM +0200, Michal Hocko wrote: > > On Mon 23-09-19 17:15:19, Peter Zijlstra wrote: > > > > > diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c > > > > index 4123100e..9859acb 100644 > > > > --- a/arch/x86/mm/numa.c

Re: [PATCH v2 11/11] powerpc/mm/book3s64/pgtable: Uses counting method to skip serializing

2019-09-23 Thread Leonardo Bras
On Fri, 2019-09-20 at 17:48 -0700, John Hubbard wrote: > [...] > So it seems that full memory barriers (not just compiler barriers) are > required. > If the irq enable/disable somehow provides that, then your new code just goes > along for the ride and Just Works. (You don't have any memory barri

Re: [PATCH v5 05/12] powerpc/eeh: EEH for pSeries hot plug

2019-09-23 Thread Nathan Lynch
Sam Bobroff writes: > Thanks, this does look like a bug to me. I couldn't replicate your crash > (even with CONFIG_SLUB_DEBUG_ON) but I think I do see a bug there. > > Does the below patch also fix it for you? Yes, this works as well, thanks. > diff --git a/arch/powerpc/kernel/eeh.c b/arch/powe

Re: [PATCH v2 11/11] powerpc/mm/book3s64/pgtable: Uses counting method to skip serializing

2019-09-23 Thread John Hubbard
On 9/23/19 10:25 AM, Leonardo Bras wrote: > On Fri, 2019-09-20 at 17:48 -0700, John Hubbard wrote: >> > [...] >> So it seems that full memory barriers (not just compiler barriers) are >> required. >> If the irq enable/disable somehow provides that, then your new code just goes >> along for the rid

Re: [PATCH 1/1] powerpc: kvm: Reduce calls to get current->mm by storing the value locally

2019-09-23 Thread Leonardo Bras
On Thu, 2019-09-19 at 23:47 -0300, Leonardo Bras wrote: > Hello Paul, > I sent this patch, but I have a question: > > > + mm = current->mm; > > Here, current->mm is not always the same as kvm->mm? > Thanks I have contacted Paul, who said it is equivalent. But I think I will deal with that o

[PATCH 0/3] Replace current->mm by kvm->mm on powerpc/kvm

2019-09-23 Thread Leonardo Bras
By replacing, we would reduce the use of 'global' current on code, relying more in the contents of kvm struct. On code, I found that in kvm_create_vm() there is: kvm->mm = current->mm; And that on every kvm_*_ioctl we have tests like that: if (kvm->mm != current->mm) return -EIO; So this

[PATCH 1/3] powerpc/kvm/book3s: Replace current->mm by kvm->mm

2019-09-23 Thread Leonardo Bras
Given that in kvm_create_vm() there is: kvm->mm = current->mm; And that on every kvm_*_ioctl we have: if (kvm->mm != current->mm) return -EIO; I see no reason to keep using current->mm instead of kvm->mm. By doing so, we would reduce the use of 'global' variables on code, relying more in

[PATCH 2/3] powerpc/kvm/book3e: Replace current->mm by kvm->mm

2019-09-23 Thread Leonardo Bras
Given that in kvm_create_vm() there is: kvm->mm = current->mm; And that on every kvm_*_ioctl we have: if (kvm->mm != current->mm) return -EIO; I see no reason to keep using current->mm instead of kvm->mm. By doing so, we would reduce the use of 'global' variables on code, relying more in

[PATCH 3/3] powerpc/kvm/e500: Replace current->mm by kvm->mm

2019-09-23 Thread Leonardo Bras
Given that in kvm_create_vm() there is: kvm->mm = current->mm; And that on every kvm_*_ioctl we have: if (kvm->mm != current->mm) return -EIO; I see no reason to keep using current->mm instead of kvm->mm. By doing so, we would reduce the use of 'global' variables on code, relying more in

Re: [PATCH 1/1] powerpc: kvm: Reduce calls to get current->mm by storing the value locally

2019-09-23 Thread Leonardo Bras
On Mon, 2019-09-23 at 15:35 -0300, Leonardo Bras wrote: > Could you please provide feedback on this patch? I have done a very simple comparison with gcc disassemble: By applying this patch, there was a reduction in the function size from 882 to 878 instructions. signature.asc Description: This i

Re: [PATCH v2 11/11] powerpc/mm/book3s64/pgtable: Uses counting method to skip serializing

2019-09-23 Thread Leonardo Bras
On Mon, 2019-09-23 at 11:14 -0700, John Hubbard wrote: > On 9/23/19 10:25 AM, Leonardo Bras wrote: > [...] > That part is all fine, but there are no run-time memory barriers in the > atomic_inc() and atomic_dec() additions, which means that this is not > safe, because memory operations on CPU 1 ca

[PATCH trivial 1/3] treewide: drivers: Fix Kconfig indentation

2019-09-23 Thread Krzysztof Kozlowski
Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^/\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski --- drivers/acpi/Kconfig | 8 +- drivers/ata/Kconfig | 12 +-- dri

[PATCH trivial 2/3] treewide: Fix Kconfig indentation

2019-09-23 Thread Krzysztof Kozlowski
Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^/\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski --- certs/Kconfig | 14 ++--- init/Kconfig | 28 +-

[PATCH trivial 3/3] treewide: arch: Fix Kconfig indentation

2019-09-23 Thread Krzysztof Kozlowski
Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^/\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski --- arch/Kconfig | 4 ++-- arch/alpha/Kconfig | 2 +- arch/arm/Kconfig

[PATCH] selftests/powerpc: Handle Makefile for unrecognized option

2019-09-23 Thread Harish
On older distributions like Sles12SP5 gcc does not recognize -no-pie option making the powerpc selftests build to fail Fixes the following: gcc: error: unrecognized command line option ‘-no-pie’ Signed-off-by: Harish --- tools/testing/selftests/powerpc/pmu/ebb/Makefile | 7 ++- 1 file chang

Re: [PATCH v2 11/11] powerpc/mm/book3s64/pgtable: Uses counting method to skip serializing

2019-09-23 Thread John Hubbard
On 9/23/19 12:40 PM, Leonardo Bras wrote: > On Mon, 2019-09-23 at 11:14 -0700, John Hubbard wrote: >> On 9/23/19 10:25 AM, Leonardo Bras wrote: >> [...] >> That part is all fine, but there are no run-time memory barriers in the >> atomic_inc() and atomic_dec() additions, which means that this is n

Re: [PATCH v2 11/11] powerpc/mm/book3s64/pgtable: Uses counting method to skip serializing

2019-09-23 Thread Leonardo Bras
On Mon, 2019-09-23 at 12:58 -0700, John Hubbard wrote: > > CPU 0CPU 1 > -- -- >READ(pte) (re-ordered at run time) >atomic_inc(val) (no run-time memory barrier!) >

Re: [PATCH v2 11/11] powerpc/mm/book3s64/pgtable: Uses counting method to skip serializing

2019-09-23 Thread John Hubbard
On 9/23/19 1:23 PM, Leonardo Bras wrote: > On Mon, 2019-09-23 at 12:58 -0700, John Hubbard wrote: >> >> CPU 0CPU 1 >> -- -- >>READ(pte) (re-ordered at run time) >>atom

Re: [PATCH v2 03/11] mm/gup: Applies counting method to monitor gup_pgd_range

2019-09-23 Thread John Hubbard
On 9/20/19 12:50 PM, Leonardo Bras wrote: > As decribed, gup_pgd_range is a lockless pagetable walk. So, in order to > monitor against THP split/collapse with the couting method, it's necessary > to bound it with {start,end}_lockless_pgtbl_walk. > > There are dummy functions, so it is not going to

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-23 Thread Peter Zijlstra
On Mon, Sep 23, 2019 at 06:52:35PM +0200, Michal Hocko wrote: > On Mon 23-09-19 17:48:52, Peter Zijlstra wrote: > To the NUMA_NO_NODE itself. Your earlier email noted: > : > + > : > if ((unsigned)node >= nr_node_ids) { > : > printk(KERN_WARNING > : > "cpumask_of_node(

Re: [PATCH v2 02/11] asm-generic/pgtable: Adds dummy functions to monitor lockless pgtable walks

2019-09-23 Thread John Hubbard
On 9/20/19 12:50 PM, Leonardo Bras wrote: > There is a need to monitor lockless pagetable walks, in order to avoid > doing THP splitting/collapsing during them. > > Some methods rely on local_irq_{save,restore}, but that can be slow on > cases with a lot of cpus are used for the process. > > In o

Re: [PATCH v2 01/11] powerpc/mm: Adds counting method to monitor lockless pgtable walks

2019-09-23 Thread John Hubbard
On 9/20/19 12:50 PM, Leonardo Bras wrote: > It's necessary to monitor lockless pagetable walks, in order to avoid doing > THP splitting/collapsing during them. > > Some methods rely on local_irq_{save,restore}, but that can be slow on > cases with a lot of cpus are used for the process. > > In or

Re: [PATCH v2 08/11] powerpc/kvm/book3s_hv: Applies counting method to monitor lockless pgtbl walks

2019-09-23 Thread John Hubbard
On 9/20/19 12:50 PM, Leonardo Bras wrote: > Applies the counting-based method for monitoring all book3s_hv related > functions that do lockless pagetable walks. > > Signed-off-by: Leonardo Bras > --- > arch/powerpc/kvm/book3s_hv_nested.c | 8 > arch/powerpc/kvm/book3s_hv_rm_mmu.c | 9 ++

Re: [PATCH v2 02/11] asm-generic/pgtable: Adds dummy functions to monitor lockless pgtable walks

2019-09-23 Thread Leonardo Bras
Thanks for the feedback, On Mon, 2019-09-23 at 13:39 -0700, John Hubbard wrote: > Please remember to include linux-mm if there is a v2. Sure, I will include on v3. > Nit: seems like it would be nicer to just put it all in one place, and use > positive logic, and also I think people normally don'

Re: [PATCH v2 01/11] powerpc/mm: Adds counting method to monitor lockless pgtable walks

2019-09-23 Thread Leonardo Bras
On Mon, 2019-09-23 at 13:42 -0700, John Hubbard wrote: > Somewhere, there should be a short comment that explains how the following > functions > are meant to be used. And it should include the interaction with irqs, so > maybe > if you end up adding that combined wrapper function that does both,

Re: [PATCH v2 00/11] Introduces new count-based method for monitoring lockless pagetable wakls

2019-09-23 Thread John Hubbard
On 9/20/19 1:12 PM, Leonardo Bras wrote: ... >> arch/powerpc/include/asm/book3s/64/mmu.h | 3 +++ >> arch/powerpc/include/asm/book3s/64/pgtable.h | 5 + >> arch/powerpc/kernel/mce_power.c | 13 ++--- >> arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 ++ >> arch/po

Re: [PATCH v2 02/11] asm-generic/pgtable: Adds dummy functions to monitor lockless pgtable walks

2019-09-23 Thread John Hubbard
On 9/23/19 1:48 PM, Leonardo Bras wrote: > Thanks for the feedback, > > On Mon, 2019-09-23 at 13:39 -0700, John Hubbard wrote: >> Please remember to include linux-mm if there is a v2. > > Sure, I will include on v3. > >> Nit: seems like it would be nicer to just put it all in one place, and use

Re: [PATCH v2 00/11] Introduces new count-based method for monitoring lockless pagetable wakls

2019-09-23 Thread Leonardo Bras
On Mon, 2019-09-23 at 13:51 -0700, John Hubbard wrote: > Also, which tree do these patches apply to, please? > > thanks, They should apply on top of v5.3 + one patch: https://patchwork.ozlabs.org/patch/1164925/ I was working on top of this patch, because I thought it would be merged fast. But

Re: [PATCH v2 03/11] mm/gup: Applies counting method to monitor gup_pgd_range

2019-09-23 Thread Leonardo Bras
On Mon, 2019-09-23 at 13:27 -0700, John Hubbard wrote: > I'd also like a second opinion from the "core" -mm maintainers, but it seems > like > there is now too much code around the gup_pgd_range() call. Especially since > there > are two places where it's called--did you forget the other one in

Re: [PATCH v2 03/11] mm/gup: Applies counting method to monitor gup_pgd_range

2019-09-23 Thread John Hubbard
On 9/23/19 2:01 PM, Leonardo Bras wrote: > On Mon, 2019-09-23 at 13:27 -0700, John Hubbard wrote: >> I'd also like a second opinion from the "core" -mm maintainers, but it seems >> like >> there is now too much code around the gup_pgd_range() call. Especially since >> there >> are two places wher

Re: "Pick the right alignment default when creating dax devices" failed to build on powerpc

2019-09-23 Thread Dan Williams
On Sun, Sep 22, 2019 at 5:04 AM Michael Ellerman wrote: > > > > On 21 September 2019 4:31:16 am AEST, Dan Williams > wrote: > >On Fri, Sep 20, 2019 at 11:18 AM Qian Cai wrote: > >> > >> On Fri, 2019-09-20 at 19:55 +0530, Aneesh Kumar K.V wrote: > >> > Qian Cai writes: > >> > > >> > > The linux

[PATCH 1/1] powerpc: kvm: Reduce calls to get current->mm by storing the value locally

2019-09-23 Thread Leonardo Bras
Reduces the number of calls to get_current() in order to get the value of current->mm by doing it once and storing the value, since it is not supposed to change inside the same process). Signed-off-by: Leonardo Bras --- Re-sending to all lists involved. (I missed kvm ones) arch/powerpc/kvm/book

Re: [PATCH v2] KVM: PPC: Book3S HV: use smp_mb() when setting/clearing host_ipi flag

2019-09-23 Thread Paul Mackerras
On Wed, Sep 11, 2019 at 05:31:55PM -0500, Michael Roth wrote: > On a 2-socket Power9 system with 32 cores/128 threads (SMT4) and 1TB > of memory running the following guest configs: > > guest A: > - 224GB of memory > - 56 VCPUs (sockets=1,cores=28,threads=2), where: > VCPUs 0-1 are

Re: [PATCH 1/1] powerpc: kvm: Reduce calls to get current->mm by storing the value locally

2019-09-23 Thread Leonardo Bras
I have done a very simple comparison with gdb disassemble: By applying this patch, there was a reduction in the function size from 882 to 878 instructions. (It's a resend, due to not having all the correct lists on my previous mail) On Mon, 2019-09-23 at 18:30 -0300, Leonardo Bras wrote: > Reduc

Re: [PATCH v6] numa: make node_to_cpumask_map() NUMA_NO_NODE aware

2019-09-23 Thread Yunsheng Lin
On 2019/9/24 4:34, Peter Zijlstra wrote: > On Mon, Sep 23, 2019 at 06:52:35PM +0200, Michal Hocko wrote: >> On Mon 23-09-19 17:48:52, Peter Zijlstra wrote: > >> To the NUMA_NO_NODE itself. Your earlier email noted: >> : > + >> : > if ((unsigned)node >= nr_node_ids) { >> : >

[PATCH v4 00/11] Add the multiple PF support for DWC and Layerscape

2019-09-23 Thread Xiaowei Bao
Add the PCIe EP multiple PF support for DWC and Layerscape, add the doorbell MSIX function for DWC, use list to manage the PF of one PCIe controller, and refactor the Layerscape EP driver due to some platforms difference. Xiaowei Bao (11): PCI: designware-ep: Add multiple PFs support for DWC P

[PATCH v4 01/11] PCI: designware-ep: Add multiple PFs support for DWC

2019-09-23 Thread Xiaowei Bao
Add multiple PFs support for DWC, due to different PF have different config space, we use func_conf_select callback function to access the different PF's config space, the different chip company need to implement this callback function when use the DWC IP core and intend to support multiple PFs fea

[PATCH v4 03/11] PCI: designware-ep: Move the function of getting MSI capability forward

2019-09-23 Thread Xiaowei Bao
Move the function of getting MSI capability to the front of init function, because the init function of the EP platform driver will use the return value by the function of getting MSI capability. Signed-off-by: Xiaowei Bao Reviewed-by: Andrew Murray --- v2: - No change. v3: - No change. v4: -

[PATCH v4 04/11] PCI: designware-ep: Modify MSI and MSIX CAP way of finding

2019-09-23 Thread Xiaowei Bao
Each PF of EP device should have it's own MSI or MSIX capabitily struct, so create a dw_pcie_ep_func struct and remove the msi_cap and msix_cap to this struct from dw_pcie_ep, and manage the PFs with a list. Signed-off-by: Xiaowei Bao --- v3: - This is a new patch, to fix the issue of MSI and MS

[PATCH v4 02/11] PCI: designware-ep: Add the doorbell mode of MSI-X in EP mode

2019-09-23 Thread Xiaowei Bao
Add the doorbell mode of MSI-X in DWC EP driver. Signed-off-by: Xiaowei Bao Reviewed-by: Andrew Murray --- v2: - Remove the macro of no used. v3: - No change. v4: - Modify the commit message. drivers/pci/controller/dwc/pcie-designware-ep.c | 14 ++ drivers/pci/controller/dwc/pci

[PATCH v4 05/11] dt-bindings: pci: layerscape-pci: Add compatible strings for ls1088a and ls2088a

2019-09-23 Thread Xiaowei Bao
Add compatible strings for ls1088a and ls2088a. Signed-off-by: Xiaowei Bao --- v2: - No change. v3: - Use one valid combination of compatible strings. v4: - Add the comma between the two compatible. Documentation/devicetree/bindings/pci/layerscape-pci.txt | 2 ++ 1 file changed, 2 insertions

[PATCH v4 06/11] PCI: layerscape: Fix some format issue of the code

2019-09-23 Thread Xiaowei Bao
Fix some format issue of the code in EP driver. Signed-off-by: Xiaowei Bao Reviewed-by: Andrew Murray --- v2: - No change. v3: - No change. v4: - No change. drivers/pci/controller/dwc/pci-layerscape-ep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/con

[PATCH v4 08/11] PCI: layerscape: Modify the MSIX to the doorbell mode

2019-09-23 Thread Xiaowei Bao
dw_pcie_ep_raise_msix_irq was never called in the exisitng driver before, because the ls1046a platform don't support the MSIX feature and msix_capable was always set to false. Now that add the ls1088a platform with MSIX support, but the existing dw_pcie_ep_raise_msix_irq doesn't work, so use the do

[PATCH v4 07/11] PCI: layerscape: Modify the way of getting capability with different PEX

2019-09-23 Thread Xiaowei Bao
The different PCIe controller in one board may be have different capability of MSI or MSIX, so change the way of getting the MSI capability, make it more flexible. Signed-off-by: Xiaowei Bao --- v2: - Remove the repeated assignment code. v3: - Use ep_func msi_cap and msix_cap to decide the msi_

[PATCH v4 10/11] arm64: dts: layerscape: Add PCIe EP node for ls1088a

2019-09-23 Thread Xiaowei Bao
Add PCIe EP node for ls1088a to support EP mode. Signed-off-by: Xiaowei Bao --- v2: - Remove the pf-offset proparty. v3: - No change. v4: - No change. arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 31 ++ 1 file changed, 31 insertions(+) diff --git a/arch/arm64/bo

[PATCH v4 09/11] PCI: layerscape: Add EP mode support for ls1088a and ls2088a

2019-09-23 Thread Xiaowei Bao
Add PCIe EP mode support for ls1088a and ls2088a, there are some difference between LS1 and LS2 platform, so refactor the code of the EP driver. Signed-off-by: Xiaowei Bao --- v2: - This is a new patch for supporting the ls1088a and ls2088a platform. v3: - Adjust the some struct assignment ord

[PATCH v4 11/11] misc: pci_endpoint_test: Add LS1088a in pci_device_id table

2019-09-23 Thread Xiaowei Bao
Add LS1088a in pci_device_id table so that pci-epf-test can be used for testing PCIe EP in LS1088a. Signed-off-by: Xiaowei Bao --- v2: - No change. v3: - No change. v4: - Use a maco to define the LS1088a device ID. drivers/misc/pci_endpoint_test.c | 2 ++ 1 file changed, 2 insertions(+) di

[v3,1/3] soc: fsl: handle RCPM errata A-008646 on SoC LS1021A

2019-09-23 Thread Biwen Li
Description: - Reading configuration register RCPM_IPPDEXPCR1 always return zero Workaround: - Save register RCPM_IPPDEXPCR1's value to register SCFG_SPARECR8.(uboot's psci also need reading value from the register SCFG_SPARECR8 to set regist

[v3, 2/3] arm: dts: ls1021a: fix that FlexTimer cannot wakeup system in deep sleep

2019-09-23 Thread Biwen Li
The patch fix a bug that FlexTimer cannot wakeup system in deep sleep. Signed-off-by: Biwen Li --- Change in v3: - update property name fsl,rcpm-scfg -> fsl,ippdexpcr-alt-addr Change in v2: - None arch/arm/boot/dts/ls1021a.dtsi | 1 + 1 file changed

[v3, 3/3] Documentation: dt: binding: fsl: Add 'fsl, ippdexpcr-alt-addr' property

2019-09-23 Thread Biwen Li
The 'fsl,ippdexpcr-alt-addr' property is used to handle an errata A-008646 on LS1021A Signed-off-by: Biwen Li --- Change in v3: - rename property name fsl,rcpm-scfg -> fsl,ippdexpcr-alt-addr Change in v2: - update desc of the property 'fsl,rcpm-scfg' Documentation/dev

[PATCH 1/4] powerpc/book3s64/mm: Don't do tlbie fixup for some hardware revisions

2019-09-23 Thread Aneesh Kumar K.V
The store ordering vs tlbie issue mentioned in commit a5d4b5891c2f ("powerpc/mm: Fixup tlbie vs store ordering issue on POWER9") is fixed for Nimbus 2.3 and Cumulus 1.3 revisions. We don't need to apply the fixup if we are running on them We can only do this on PowerNV. On pseries guest with kvm w

[PATCH 2/4] powerpc/book3s64/radix: Rename CPU_FTR_P9_TLBIE_BUG feature flag

2019-09-23 Thread Aneesh Kumar K.V
Rename the #define to indicate this is related to store vs tlbie ordering issue. In the next patch, we will be adding another feature flag that is used to handles ERAT flush vs tlbie ordering issue. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/cputable.h| 4 ++-- arch/powerpc

[PATCH 4/4] powerpc/mm/selftest: Add test case for tlbie vs mtpidr ordering issue

2019-09-23 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- tools/testing/selftests/powerpc/mm/Makefile | 3 + .../testing/selftests/powerpc/mm/tlbie_test.c | 739 ++ 2 files changed, 742 insertions(+) create mode 100644 tools/testing/selftests/powerpc/mm/tlbie_test.c diff --git a/tools/testing/sel

[PATCH 3/4] powerpc/mm: Fixup tlbie vs mtpidr/mtlpidr ordering issue on POWER9

2019-09-23 Thread Aneesh Kumar K.V
On POWER9, under some circumstances, a broadcast TLB invalidation will fail to invalidate the ERAT cache on some threads when there are parallel mtpidr/mtlpidr happening on other threads of the same core. This can cause stores to continue to go to a page after it's unmapped. The workaround is to f

Re: [PATCH 00/11] opencapi: enable card reset and link retraining

2019-09-23 Thread Alexey Kardashevskiy
Hi Fred, what is this made against of? It does not apply on the master. Thanks, On 10/09/2019 01:45, Frederic Barrat wrote: > This is the linux part of the work to use the PCI hotplug framework to > control an opencapi card so that it can be reset and re-read after > flashing a new FPGA image. I

[PATCH] powerpc/book3s64: Export has_transparent_hugepage() related functions.

2019-09-23 Thread Aneesh Kumar K.V
In later patch, we want to use hash_transparent_hugepage() in a kernel module. Export two related functions. Acked-by: Michael Ellerman Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/radix.h | 8 +++- arch/powerpc/mm/book3s64/hash_pgtable.c| 2 ++ arch/powerpc/mm

Re: [PATCH 1/6] KVM: PPC: Book3S HV: XIVE: initialize private pointer when VPs are allocated

2019-09-23 Thread Paul Mackerras
On Mon, Sep 23, 2019 at 05:43:37PM +0200, Greg Kurz wrote: > From: Cédric Le Goater > > Do not assign the device private pointer before making sure the XIVE > VPs are allocated in OPAL and test pointer validity when releasing > the device. > > Fixes: 5422e95103cf ("KVM: PPC: Book3S HV: XIVE: Rep

Re: [PATCH v7 00/12] implement KASLR for powerpc/fsl_booke/32

2019-09-23 Thread Jason Yan
Hi Scott, Can you test v7 to see if it works to load a kernel at a non-zero address? Thanks, On 2019/9/20 17:45, Jason Yan wrote: This series implements KASLR for powerpc/fsl_booke/32, as a security feature that deters exploit attempts relying on knowledge of the location of kernel internals.

Re: [PATCH 3/6] KVM: PPC: Book3S HV: XIVE: Ensure VP isn't already in use

2019-09-23 Thread Paul Mackerras
On Mon, Sep 23, 2019 at 05:43:48PM +0200, Greg Kurz wrote: > We currently prevent userspace to connect a new vCPU if we already have > one with the same vCPU id. This is good but unfortunately not enough, > because VP ids derive from the packed vCPU ids, and kvmppc_pack_vcpu_id() > can return colli

Re: [PATCH 00/11] opencapi: enable card reset and link retraining

2019-09-23 Thread Frederic Barrat
Le 24/09/2019 à 06:24, Alexey Kardashevskiy a écrit : Hi Fred, what is this made against of? It does not apply on the master. Thanks, It applies on v5.3. And I can see there's a conflict with the current state in the merge window. I'll resubmit. Fred On 10/09/2019 01:45, Frederic B

Re: [v3,1/3] soc: fsl: handle RCPM errata A-008646 on SoC LS1021A

2019-09-23 Thread Biwen Li
Hi all, the linux patches depended by RCPM driver,FlexTimer driver and FlexTimer dts, need apply these patches as follows: 1. RCPM driver: https://patchwork.kernel.org/series/162731/mbox/(https://patchwork.kernel.org/patch/11105279/) 2. FlexTimer dts: https://lore.kernel.org/patchwork/series/4