Re: [PATCH V3 09/10] powerpc/mm: Lower the max real address to 53 bits

2017-03-27 Thread Paul Mackerras
On Tue, Mar 21, 2017 at 10:59:59PM +0530, Aneesh Kumar K.V wrote: > Max value supported by hardware is 51 bits address. Radix page table define > a slot of 57 bits for future expansion. We restrict the value supported in > linux kernel 53 bits, so that we can use the bits between 57-53 for storing

Re: [PATCH V3 10/10] powerpc/mm: Move hash specific pte bits to be top bits of RPN

2017-03-27 Thread Paul Mackerras
On Tue, Mar 21, 2017 at 11:00:00PM +0530, Aneesh Kumar K.V wrote: > We don't support the full 57 bits of physical address and hence can overload > the top bits of RPN as hash specific pte bits. > > Signed-off-by: Aneesh Kumar K.V Reviewed-by: Paul Mackerras

Re: [PATCH 12/12] powerpc/kvm: Native usage of the XIVE interrupt controller

2017-03-27 Thread Paul Mackerras
On Mon, Mar 20, 2017 at 05:49:14PM +1100, Benjamin Herrenschmidt wrote: > This patch makes KVM capable of using the XIVE interrupt controller > to provide the standard PAPR "XICS" style hypercalls. It is necessary > for proper operations when the host uses XIVE natively. > > This has been lightly

[PATCH kernel] powerpc/iommu: Do not call PageTransHuge() on tail pages

2017-03-27 Thread Alexey Kardashevskiy
The CMA pages migration code does not support compound pages at the moment so it performs few tests before proceeding to actual page migration. One of the tests - PageTransHuge() - has VM_BUG_ON_PAGE(PageTail()) as it should be called on head pages. Since we also test for PageCompound(), and it

[PATCH kernel] powerpc/powernv/iommu: Fix compile breakage in iommu_tce_xchg_rm

2017-03-27 Thread Alexey Kardashevskiy
Signed-off-by: Alexey Kardashevskiy --- Please squash it into: [02/10] powerpc/powernv/iommu: Add real mode version of iommu_table_ops::exchange() --- arch/powerpc/kernel/iommu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/kernel/iommu.c

Re: [PATCH v5 08/13] powerpc/perf: PMU functions for Core IMC and hotplugging

2017-03-27 Thread Madhavan Srinivasan
On Thursday 23 March 2017 06:39 PM, Gautham R Shenoy wrote: Hi Maddy, Hemant, Anju, On Thu, Mar 16, 2017 at 01:05:02PM +0530, Madhavan Srinivasan wrote: [..snip..] + +static void core_imc_change_cpu_context(int old_cpu, int new_cpu) +{ + if (!core_imc_pmu) + return; +

Re: [PATCH 1/5] powerpc/smp: use cpu_to_chip_id() to find siblings

2017-03-27 Thread Oliver O'Halloran
On Tue, Mar 28, 2017 at 2:03 PM, Michael Ellerman wrote: > Oliver O'Halloran writes: >> On Wed, Mar 15, 2017 at 10:18 PM, Michael Ellerman >> wrote: >>> Oliver O'Halloran writes: + /* threads that share a

Re: [PATCH 01/12] powerpc: Disable HFSCR:TM if TM not supported

2017-03-27 Thread Sam Bobroff
On Mon, Mar 20, 2017 at 05:49:03PM +1100, Benjamin Herrenschmidt wrote: > Otherwise KVM guests might mess with it even when told not > to causing bad thing interrupts in the host > > Signed-off-by: Benjamin Herrenschmidt I've tested this on a P8, with a kernel and QEMU

Re: [kernel-hardening] [PATCH v5 1/4] gcc-plugins: Add the initify gcc plugin

2017-03-27 Thread Andrew Donnellan
On 27/03/17 18:38, Andrew Donnellan wrote: On 01/02/17 07:24, Kees Cook wrote: From: Emese Revfy The kernel already has a mechanism to free up code and data memory that is only used during kernel or module initialization. This plugin will teach the compiler to find more

Re: [PATCH 1/5] powerpc/smp: use cpu_to_chip_id() to find siblings

2017-03-27 Thread Michael Ellerman
Oliver O'Halloran writes: > On Wed, Mar 15, 2017 at 10:18 PM, Michael Ellerman > wrote: >> Oliver O'Halloran writes: >>> + /* threads that share a chip-id are considered siblings (same die) */ >> >> Also "Threads" :) > > The cpus

Re: [PATCH 2/5] powerpc/smp: add set_cpus_related()

2017-03-27 Thread Michael Ellerman
Oliver O'Halloran writes: > On Wed, Mar 15, 2017 at 10:18 PM, Michael Ellerman > wrote: >> Oliver O'Halloran writes: >>> diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c >>> index dfe0e1d9cd06..1c531887ca51 100644 >>>

Re: [PATCH 4/5] powerpc/smp: add cpu_cache_mask

2017-03-27 Thread Michael Ellerman
Oliver O'Halloran writes: > On Wed, Mar 15, 2017 at 10:26 PM, Michael Ellerman > wrote: >> Oliver O'Halloran writes: >> >>> Traditionally we have only ever tracked which CPUs are in the same core >>> (cpu_sibling_mask) and on the same

Re: [PATCH 1/2] powerpc: string: implement optimized memset variants

2017-03-27 Thread Michael Ellerman
"Naveen N. Rao" writes: > diff --git a/arch/powerpc/lib/mem_64.S b/arch/powerpc/lib/mem_64.S > index 85fa9869aec5..ec531de6 100644 > --- a/arch/powerpc/lib/mem_64.S > +++ b/arch/powerpc/lib/mem_64.S > @@ -13,6 +13,23 @@ > #include > #include > >

Re: [PATCH kernel] KVM: PPC: Preserve storage control bits

2017-03-27 Thread David Gibson
On Fri, Mar 24, 2017 at 05:49:22PM +1100, Alexey Kardashevskiy wrote: > PR KVM page fault handler performs eaddr to pte translation for a guest, > however kvmppc_mmu_book3s_64_xlate() does not preserve WIMG bits > (storage control) in the kvmppc_pte struct. If PR KVM is running as > a second level

Re: [PATCH net-next] net: ibmvnic: Remove unused net_stats member from struct ibmvnic_adapter

2017-03-27 Thread David Miller
From: Tobias Klauser Date: Mon, 27 Mar 2017 08:56:59 +0200 > The ibmvnic driver keeps its statistics in net_device->stats, so the > net_stats member in struct ibmvnic_adapter is unused. Remove it. > > Signed-off-by: Tobias Klauser Applied.

Re: [PATCH net-next] net: ibmveth: Remove unused stats member from struct ibmveth_adapter

2017-03-27 Thread David Miller
From: Tobias Klauser Date: Mon, 27 Mar 2017 08:56:15 +0200 > The ibmveth driver keeps its statistics in net_device->stats, so the > stats member in struct ibmveth_adapter is unused. Remove it. > > Signed-off-by: Tobias Klauser Applied.

[PATCH 2/2] powerpc: bpf: use memset32() to pre-fill traps in BPF page(s)

2017-03-27 Thread Naveen N. Rao
Use the newly introduced memset32() to pre-fill BPF page(s) with trap instructions. Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit_comp64.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/powerpc/net/bpf_jit_comp64.c

[PATCH 1/2] powerpc: string: implement optimized memset variants

2017-03-27 Thread Naveen N. Rao
Based on Matthew Wilcox's patches for other architectures. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/string.h | 24 arch/powerpc/lib/mem_64.S | 19 ++- 2 files changed, 42 insertions(+), 1

Re: Optimised memset64/memset32 for powerpc

2017-03-27 Thread Naveen N. Rao
On 2017/03/22 12:30PM, Matthew Wilcox wrote: > On Wed, Mar 22, 2017 at 06:18:05AM -0700, Matthew Wilcox wrote: > > There's one other potential user I've been wondering about, which are the > > various console drivers. They use 'memsetw' to blank the entire console > > or lines of the console when

[PATCH v2] powerpc: make /proc/self/stack always print the current stack

2017-03-27 Thread Thadeu Lima de Souza Cascardo
For the current task, the kernel stack would only tell the last time the process was rescheduled, if ever. Use the current stack pointer for the current task. Otherwise, every once in a while, the stacktrace printed when reading /proc/self/stack would look like the process is running in

Re: Build failure -- powerpc/boot: Add OPAL console to epapr wrappers

2017-03-27 Thread Daniel Walker
On 03/24/2017 07:16 PM, Oliver O'Halloran wrote: On Sat, Mar 25, 2017 at 4:00 AM, Daniel Walker wrote: I get this build failure, In file included from arch/powerpc/boot/fdt.c:51: ../arch/powerpc/boot/libfdt_env.h:9: error: redefinition of typedef 'uint32_t'

tty/hvc: possible irq lock inversion dependency detected

2017-03-27 Thread Denis Kirjanov
Hi, Ok, now we have a new locking issue with interrupts which I found on my P8 box. I haven't found where we take the console_lock, only in hvc_remove. BTW, Ben, looks like it's a bug in hvc_remove: we take spin_lock and then semaphore lock. [178327.461954]

Re: [v3 PATCH 2/4] powernv:smp: Add busy-wait loop as fall back for CPU-Hotplug

2017-03-27 Thread Michael Ellerman
"Gautham R. Shenoy" writes: > diff --git a/arch/powerpc/platforms/powernv/idle.c > b/arch/powerpc/platforms/powernv/idle.c > index 419edff..f335e0f 100644 > --- a/arch/powerpc/platforms/powernv/idle.c > +++ b/arch/powerpc/platforms/powernv/idle.c > @@ -283,8 +283,16 @@

Re: [v7] powerpc/powernv: add hdat attribute to sysfs

2017-03-27 Thread Michael Ellerman
Hi Matt, Sorry if you're getting sick of this at v7, but here's a few more comments :D Matt Brown writes: > The HDAT data area is consumed by skiboot and turned into a device-tree. > In some cases we would like to look directly at the HDAT, so this patch > adds a

Re: [RESEND PATCH v4 5/5] powerpc/fadump: update documentation about crashkernel parameter reuse

2017-03-27 Thread Michael Ellerman
Hari Bathini writes: > As we are reusing crashkernel parameter instead of fadump_reserve_mem > parameter to specify the memory to reserve for fadump's crash kernel, > update the documentation accordingly. > > Signed-off-by: Hari Bathini

Re: [RESEND PATCH v4 4/5] powerpc/fadump: reuse crashkernel parameter for fadump memory reservation

2017-03-27 Thread Michael Ellerman
Hari Bathini writes: > fadump supports specifying memory to reserve for fadump's crash kernel > with fadump_reserve_mem kernel parameter. This parameter currently > supports passing a fixed memory size, like fadump_reserve_mem= > only. This patch aims to add support

Re: [RESEND PATCH v4 3/5] powerpc/fadump: remove dependency with CONFIG_KEXEC

2017-03-27 Thread Michael Ellerman
Hari Bathini writes: > Now that crashkernel parameter parsing and vmcoreinfo related code is > moved under CONFIG_CRASH_CORE instead of CONFIG_KEXEC_CORE, remove > dependency with CONFIG_KEXEC for CONFIG_FA_DUMP. While here, get rid > of definitions of

Re: [PATCH v2 1/2] powerpc/powernv/cpuidle: Pass correct drv->cpumask for registration

2017-03-27 Thread Michael Ellerman
"Rafael J. Wysocki" writes: > On Thu, Mar 23, 2017 at 4:22 PM, Vaidyanathan Srinivasan > wrote: >> drv->cpumask defaults to cpu_possible_mask in __cpuidle_driver_init(). >> On PowerNV platform cpu_present could be less than cpu_possible in cases >>

Re: [PATCH 12/13] powerpc/perf: Thread imc cpuhotplug support

2017-03-27 Thread Anju T Sudhakar
On Thursday 23 March 2017 10:45 PM, Gautham R Shenoy wrote: Hi Maddy, Anju, On Thu, Mar 16, 2017 at 01:05:06PM +0530, Madhavan Srinivasan wrote: From: Anju T Sudhakar This patch adds support for thread IMC on cpuhotplug. When a cpu goes offline, the LDBAR for that

Re: [PATCH v5 06/13] powerpc/perf: IMC pmu cpumask and cpu hotplug support

2017-03-27 Thread Anju T Sudhakar
Hi Gautham, Thank you for reviewing the patch. On Thursday 23 March 2017 05:22 PM, Gautham R Shenoy wrote: Hi Hemant, Maddy, On Thu, Mar 16, 2017 at 01:05:00PM +0530, Madhavan Srinivasan wrote: From: Hemant Kumar Adds cpumask attribute to be used by each IMC

Re: [PATCH v9 2/3] PCI: Add a macro to set default alignment for all PCI devices

2017-03-27 Thread Benjamin Herrenschmidt
On Mon, 2017-03-27 at 21:17 +1100, Michael Ellerman wrote: > > If so, is it acceptable to force that kernel to user 64K alignment > > even > > when it's running on non-PowerNV systems? > > Probably, but I'm not sure TBH. Benh will know, I'll try and get his > attention. Can we make the alignment

Re: [PATCH v9 2/3] PCI: Add a macro to set default alignment for all PCI devices

2017-03-27 Thread Michael Ellerman
Bjorn Helgaas writes: > > I don't know how powerpc kernels are built: can you build a kernel > that will run on PowerNV as well as on different powerpc systems? Yes you can. But there are some restrictions. You can only build a 64-bit OR a 32-bit kernel. And within 64-bit

Re: [PATCH kernel v11 02/10] powerpc/powernv/iommu: Add real mode version of iommu_table_ops::exchange()

2017-03-27 Thread Michael Ellerman
Alexey Kardashevskiy writes: > diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c > index 5f202a566ec5..9bace5df05d5 100644 > --- a/arch/powerpc/kernel/iommu.c > +++ b/arch/powerpc/kernel/iommu.c > @@ -1004,6 +1004,29 @@ long iommu_tce_xchg(struct iommu_table

[PATCH] kvm: powerpc: book3s: Disable preemption while accessing paca xics_phys filed

2017-03-27 Thread Denis Kirjanov
With CONFIG_DEBUG_PREEMPT enabled we see the following trace: [ 129.314426] BUG: using smp_processor_id() in preemptible [] code: modprobe/5459 [ 129.314580] caller is .kvmppc_book3s_init_hv+0x184/0x350 [kvm_hv] [ 129.314697] CPU: 11 PID: 5459 Comm: modprobe Not tainted

[PATCH kernel v2] powerpc/powernv: Check kzalloc() return value in pnv_pci_table_alloc

2017-03-27 Thread Alexey Kardashevskiy
pnv_pci_table_alloc() ignores possible failure from kzalloc_node(), this adds a check. There are 2 callers of pnv_pci_table_alloc(), one already checks for tbl!=NULL, this adds WARN_ON() to the other path which only happens during boot time in IODA1 and not expected to fail. Signed-off-by: Alexey

Re: [PATCH kernel] powerpc/powernv: Check kzalloc() return in pnv_pci_table_alloc

2017-03-27 Thread Michael Ellerman
Alexey Kardashevskiy writes: > pnv_pci_table_alloc() ignores posible failure from kzalloc_node(), > this adds a check. There are 2 callers of pnv_pci_table_alloc(), > one already checks for tbl!=NULL, this adds BUG_ON() to the other path > which only happens during boot time in

[PATCH net-next] net: ibmvnic: Remove unused net_stats member from struct ibmvnic_adapter

2017-03-27 Thread Tobias Klauser
The ibmvnic driver keeps its statistics in net_device->stats, so the net_stats member in struct ibmvnic_adapter is unused. Remove it. Signed-off-by: Tobias Klauser --- drivers/net/ethernet/ibm/ibmvnic.h | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH net-next] net: ibmveth: Remove unused stats member from struct ibmveth_adapter

2017-03-27 Thread Tobias Klauser
The ibmveth driver keeps its statistics in net_device->stats, so the stats member in struct ibmveth_adapter is unused. Remove it. Signed-off-by: Tobias Klauser --- drivers/net/ethernet/ibm/ibmveth.h | 1 - 1 file changed, 1 deletion(-) diff --git

Re: [PATCH kernel] KVM: PPC: Check kzalloc() return

2017-03-27 Thread David Gibson
On Mon, Mar 27, 2017 at 02:19:27PM +1100, Alexey Kardashevskiy wrote: > This adds missing check for failed kzalloc(). > > Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson > --- > > This is a followup change for: > [PATCH kernel v11

Re: [PATCH kernel] powerpc/powernv: Check kzalloc() return in pnv_pci_table_alloc

2017-03-27 Thread David Gibson
On Mon, Mar 27, 2017 at 02:28:03PM +1100, Alexey Kardashevskiy wrote: > pnv_pci_table_alloc() ignores posible failure from kzalloc_node(), > this adds a check. There are 2 callers of pnv_pci_table_alloc(), > one already checks for tbl!=NULL, this adds BUG_ON() to the other path > which only

Re: [v2 5/5] mm: teach platforms not to zero struct pages memory

2017-03-27 Thread Heiko Carstens
On Fri, Mar 24, 2017 at 03:19:52PM -0400, Pavel Tatashin wrote: > If we are using deferred struct page initialization feature, most of > "struct page"es are getting initialized after other CPUs are started, and > hence we are benefiting from doing this job in parallel. However, we are > still