Re: [PATCH V4 11/18] powerpc/mm: Hugetlbfs is book3s_64 and fsl_book3e (32 or 64)

2016-02-26 Thread Aneesh Kumar K.V
Paul Mackerras writes: > On Tue, Feb 23, 2016 at 10:18:13AM +0530, Aneesh Kumar K.V wrote: >> We move large part of fsl related code to hugetlbpage-book3e.c. >> Only code movement. This also avoid #ifdef in the code. >> >> Eventhough we allow hugetlbfs only for book3s 64 and fsl book3e, I am >>

Re: [PATCH V4 15/18] powerpc/mm: Move hash page table related functions to pgtable-hash64.c

2016-02-26 Thread Aneesh Kumar K.V
Scott Wood writes: Hi Scott, Thanks for testing this series. > On Tue, 2016-02-23 at 10:18 +0530, Aneesh Kumar K.V wrote: >> >> diff --git a/arch/powerpc/mm/pgtable-book3e.c b/arch/powerpc/mm/pgtable >> -book3e.c >> new file mode 100644 >> index ..bdaa4376f838 >> --- /dev/null >>

Re: Problems with swapping in v4.5-rc on POWER

2016-02-26 Thread Hugh Dickins via Linuxppc-dev
On Thu, 25 Feb 2016, Hugh Dickins wrote: > On Wed, 24 Feb 2016, Hugh Dickins wrote: > > On Thu, 25 Feb 2016, Aneesh Kumar K.V wrote: > > > > > > Can you test the impact of the merge listed below ?(ie, revert the merge > > > and see if > > > we can reproduce and also verify with merge applied). Th

Re: [PATCH 07/12] powerpc/ftrace: FTRACE_WITH_REGS implementation for ppc64le

2016-02-26 Thread Michael Ellerman
On Thu, 2016-02-25 at 16:11 +0100, Torsten Duwe wrote: > On Thu, Feb 25, 2016 at 11:48:59AM +1100, Balbir Singh wrote: > > > @@ -608,6 +621,9 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, > > > return -ENOENT; > > > if (!restore_r2((u32

Re: [PATCH 04/12] powerpc/ftrace: Prepare for -mprofile-kernel

2016-02-26 Thread Michael Ellerman
On Thu, 2016-02-25 at 14:52 +0100, Torsten Duwe wrote: > On Thu, Feb 25, 2016 at 01:28:27AM +1100, Michael Ellerman wrote: > > @@ -450,17 +448,44 @@ static unsigned long stub_for_addr(const Elf64_Shdr > > *sechdrs, > > return (unsigned long)&stubs[i]; > > } > > > > +#ifdef CC_USING_MPROFILE

Re: [PATCH 03/12] powerpc/module: Create a special stub for ftrace_caller()

2016-02-26 Thread Michael Ellerman
On Thu, 2016-02-25 at 14:31 +0100, Torsten Duwe wrote: > On Thu, Feb 25, 2016 at 11:08:54AM +1100, Balbir Singh wrote: > > How about some comments on r2 > > r2 is still pointing to the module's toc, will be saved by ftrace_caller > > and restored by the instruction following bl ftrace_caller (af

Re: [PATCH 02/12] powerpc/module: Mark module stubs with a magic value

2016-02-26 Thread Michael Ellerman
On Thu, 2016-02-25 at 14:17 +0100, Torsten Duwe wrote: > On Thu, Feb 25, 2016 at 01:28:25AM +1100, Michael Ellerman wrote: > > > > We can make that process easier by marking the generated stubs with a > > magic value, and then looking for that magic value. Altough this is not > > as rigorous as th

[PATCH v10 0/2] cpufreq: powernv: Export throttle stat attributes and a bug fix

2016-02-26 Thread Shilpasri G Bhat
Patch[1] solves a bug in the module{init/exit} path and Patch[2] exports the throttle stats for the chip. This patchset is on top of linux-pm/linux-next. Changes from v9: - Patch[1/2] is newly added to correctly handle error path in powernv_cpufreq_init() and unregistration path in powernv_cpu

[PATCH v10 1/2] cpufreq: powernv: Fix bugs in powernv_cpufreq_{init/exit}

2016-02-26 Thread Shilpasri G Bhat
Unregister the notifiers if cpufreq_driver_register() fails in powernv_cpufreq_init(). Re-arrange the unregistration and cleanup routines in powernv_cpufreq_exit() to free all the resources after the driver has unregistered. Signed-off-by: Shilpasri G Bhat --- drivers/cpufreq/powernv-cpufreq.c |

[PATCH v10 2/2] cpufreq: powernv: Add sysfs attributes to show throttle stats

2016-02-26 Thread Shilpasri G Bhat
Create sysfs attributes to export throttle information in /sys/devices/system/cpu/cpuX/cpufreq/throttle_stats directory. The newly added sysfs files are as follows: 1)/sys/devices/system/cpu/cpuX/cpufreq/throttle_stats/turbo_stat 2)/sys/devices/system/cpu/cpuX/cpufreq/throttle_stats/sub-turbo_stat

Re: [PATCH v10 1/2] cpufreq: powernv: Fix bugs in powernv_cpufreq_{init/exit}

2016-02-26 Thread Viresh Kumar
On 26-02-16, 16:06, Shilpasri G Bhat wrote: > Unregister the notifiers if cpufreq_driver_register() fails in > powernv_cpufreq_init(). Re-arrange the unregistration and cleanup routines > in powernv_cpufreq_exit() to free all the resources after the driver > has unregistered. > > Signed-off-by: Sh

Re: [PATCH V3] cpufreq: qoriq: Register cooling device based on device tree

2016-02-26 Thread Li Yang
On Fri, Dec 18, 2015 at 4:32 PM, Arnd Bergmann wrote: > On Tuesday 15 December 2015 00:58:26 Rafael J. Wysocki wrote: >> On Thursday, November 26, 2015 05:21:11 PM Jia Hongtao wrote: >> > Register the qoriq cpufreq driver as a cooling device, based on the >> > thermal device tree framework. When t

Re: [PATCH v3 5/5] cpufreq: qoriq: Don't look at clock implementation details

2016-02-26 Thread Li Yang
On Fri, Sep 25, 2015 at 4:50 PM, Rafael J. Wysocki wrote: > On Friday, September 25, 2015 04:17:07 PM Scott Wood wrote: >> On Fri, 2015-09-25 at 23:42 +0200, Rafael J. Wysocki wrote: >> > On Tuesday, September 22, 2015 12:46:54 PM Viresh Kumar wrote: >> > > On 19-09-15, 23:29, Scott Wood wrote: >>

Re: [PATCH v3 5/5] cpufreq: qoriq: Don't look at clock implementation details

2016-02-26 Thread Scott Wood
On Fri, 2016-02-26 at 12:14 -0600, Li Yang wrote: > On Fri, Sep 25, 2015 at 4:50 PM, Rafael J. Wysocki > wrote: > > On Friday, September 25, 2015 04:17:07 PM Scott Wood wrote: > > > On Fri, 2015-09-25 at 23:42 +0200, Rafael J. Wysocki wrote: > > > > On Tuesday, September 22, 2015 12:46:54 PM Vires

[PATCH 01/14] powerpc: Add simple cache inhibited MMIO accessors

2016-02-26 Thread Suresh Warrier
Add simple cache inhibited accessors for memory mapped I/O. Unlike the accessors built from the DEF_MMIO_* macros, these don't include any hardware memory barriers, callers need to manage memory barriers on their own. These can only be called in hypervisor mode. Signed-off-by: Suresh Warrier ---

[PATCH 05/14] KVM: PPC: Book3S HV: Enable IRQ bypass

2016-02-26 Thread Suresh Warrier
Add the irq_bypass_add_producer and irq_bypass_del_producer functions. These functions get called whenever a GSI is being defined for a guest. They create/remove the mapping between host real IRQ numbers and the guest GSI. Add the following helper functions to manage the passthrough IRQ map. kvmp

[PATCH 00/14] PCI Passthrough Interrupt Optimizations

2016-02-26 Thread Suresh Warrier
This patch set adds support for handling interrupts for PCI adapters entirely in the guest under the right conditions. When an interrupt is received by KVM in real mode, if the interrupt is from a PCI passthrough adapter owned by the guest, KVM will update the virtual ICP for the VCPU that is the t

[PATCH 06/14] KVM: PPC: Book3S HV: Caching for passthrough IRQ map

2016-02-26 Thread Suresh Warrier
Add the following functions to support caching of the IRQ mapped entries: kvmppc_cache_passthru_irq() Caches an existing mapping in the cached array. _uncache_passthru_irq() Uncaches a cached entry. This is an internal function and is only invoked when unmapping a passthrough IRQ mapping.

[PATCH 02/14] KVM: PPC: Book3S HV: Convert kvmppc_read_intr to a C function

2016-02-26 Thread Suresh Warrier
Modify kvmppc_read_intr to make it a C function. This also adds in the optimization of clearing saved_xirr in the case where we completely handle and EOI an IPI. Without this, the next device interrupt will require two trips through the host interrupt handling code. Signed-off-by: Suresh Warrier

[PATCH 04/14] KVM: PPC: Book3S HV: Introduce kvmppc_passthru_irqmap

2016-02-26 Thread Suresh Warrier
This patch introduces an IRQ mapping structure, the kvmppc_passthru_irqmap structure that is to be used to map the real hardware IRQ in the host with the virtual hardware IRQ (gsi) that is injected into a guest by KVM for passthrough adapters. Currently, we assume a separate IRQ mapping structure

[PATCH 03/14] KVM: PPC: select IRQ_BYPASS_MANAGER

2016-02-26 Thread Suresh Warrier
Select IRQ_BYPASS_MANAGER for PPC when CONFIG_KVM is set. Add the PPC producer functions for add and del producer. Signed-off-by: Suresh Warrier --- arch/powerpc/include/asm/kvm_ppc.h | 4 arch/powerpc/kvm/Kconfig | 2 ++ arch/powerpc/kvm/book3s.c | 32 +

[PATCH 08/14] KVM: PPC: Book3S HV: Complete passthrough interrupt in host

2016-02-26 Thread Suresh Warrier
In existing real mode ICP code, when updating the virtual ICP state, if there is a required action that cannot be completely handled in real mode, as for instance, a VCPU needs to be woken up, flags are set in the ICP to indicate the required action. This is checked when returning from hypercalls t

[PATCH 07/14] KVM: PPC: Book3S HV: Handle passthrough interrupts in guest

2016-02-26 Thread Suresh Warrier
Currently, KVM switches back to the host to handle any external interrupt (when the interrupt is received while running in the guest). This patch updates real-mode KVM to check if an interrupt is generated by a passthrough adapter that is owned by this guest. If so, the real mode KVM will directly

[PATCH 09/14] KVM: PPC: Book3S HV: Enable KVM real mode handling of passthrough IRQs

2016-02-26 Thread Suresh Warrier
The KVM real mode passthrough handling code only searches for "cached" IRQ maps in the passthrough IRQ map when checking for passthrough IRQs that can be redirected to the guest. This patch enables KVM real mode handling of passthrough IRQs by turning on caching of selected passthrough IRQs. Curren

[PATCH 10/14] KVM: PPC: Book3S HV: Dump irqmap in debugfs

2016-02-26 Thread Suresh Warrier
Dump the passthrough irqmap structure associated with a guest as part of /sys/kernel/debug/powerpc/kvm-xics-*. Signed-off-by: Suresh Warrier --- arch/powerpc/kvm/book3s_xics.c | 17 + 1 file changed, 17 insertions(+) diff --git a/arch/powerpc/kvm/book3s_xics.c b/arch/powerpc/kvm

[PATCH 12/14] KVM: PPC: Book3S HV: Update irq stats for IRQs handled in real mode

2016-02-26 Thread Suresh Warrier
When a passthrough IRQ is handled completely within KVM real mode code, it has to also update the IRQ stats since this does not go through the generic IRQ handling code. However, the per CPU kstat_irqs field is an allocated (not static) field and so cannot be directly accessed in real mode safely.

[PATCH 13/14] KVM: PPC: Book3S HV: Change affinity for passthrough IRQ

2016-02-26 Thread Suresh Warrier
Change the affinity in the host for a passthrough interrupt to the hardware thread running the VCPU which has affinity to this interrupt in the guest. Since the cores run in single threaded mode on a PowerKVM host, the affinity is actually changed to the hardware thread's first sibling thread in it

[PATCH 14/14] KVM: PPC: Book3S HV: Counters for passthrough IRQ stats

2016-02-26 Thread Suresh Warrier
Add VCPU stat counters to track affinity for passthrough interrupts. pthru_all: Counts all passthrough interrupts whose IRQ mappings have been cached in the kvmppc_passthru_irq_map cache. pthru_host: Counts all cached passthrough interrupts that were injected from the host t

[PATCH 11/14] KVM: PPC: Book3S HV: Tunable to disable KVM IRQ bypass

2016-02-26 Thread Suresh Warrier
Add a module parameter kvm_irq_bypass for kvm_hv.ko to disable IRQ bypass for passthrough interrupts. The default value of this tunable is 1 - that is enable the feature. Since the tunable is used by built-in kernel code, we use the module_param_cb macro to achieve this. Signed-off-by: Suresh Wa

Re: [PATCH 00/14] KVM: PPC: Book3S HV: PCI Passthrough Interrupt Optimizations

2016-02-26 Thread Suresh E. Warrier
On 02/26/2016 12:40 PM, Suresh Warrier wrote: > This patch set adds support for handling interrupts for PCI adapters > entirely in the guest under the right conditions. When an interrupt > is received by KVM in real mode, if the interrupt is from a PCI > passthrough adapter owned by the guest, KV

Re: [PATCH V3] cpufreq: qoriq: Register cooling device based on device tree

2016-02-26 Thread Arnd Bergmann
On Friday 26 February 2016 12:04:59 Li Yang wrote: > On Fri, Dec 18, 2015 at 4:32 PM, Arnd Bergmann wrote: > > On Tuesday 15 December 2015 00:58:26 Rafael J. Wysocki wrote: > >> On Thursday, November 26, 2015 05:21:11 PM Jia Hongtao wrote: > >> > Register the qoriq cpufreq driver as a cooling devi

Re: [PATCH v3 5/5] cpufreq: qoriq: Don't look at clock implementation details

2016-02-26 Thread Li Yang
On Fri, Feb 26, 2016 at 12:16 PM, Scott Wood wrote: > On Fri, 2016-02-26 at 12:14 -0600, Li Yang wrote: >> On Fri, Sep 25, 2015 at 4:50 PM, Rafael J. Wysocki >> wrote: >> > On Friday, September 25, 2015 04:17:07 PM Scott Wood wrote: >> > > On Fri, 2015-09-25 at 23:42 +0200, Rafael J. Wysocki wrot

Re: [PATCH v3 5/5] cpufreq: qoriq: Don't look at clock implementation details

2016-02-26 Thread Scott Wood
On Fri, 2016-02-26 at 15:01 -0600, Li Yang wrote: > On Fri, Feb 26, 2016 at 12:16 PM, Scott Wood wrote: > > On Fri, 2016-02-26 at 12:14 -0600, Li Yang wrote: > > > On Fri, Sep 25, 2015 at 4:50 PM, Rafael J. Wysocki > > > wrote: > > > > On Friday, September 25, 2015 04:17:07 PM Scott Wood wrote: >

Re: [PATCH V3] cpufreq: qoriq: Register cooling device based on device tree

2016-02-26 Thread Li Yang
On Fri, Feb 26, 2016 at 2:20 PM, Arnd Bergmann wrote: > On Friday 26 February 2016 12:04:59 Li Yang wrote: >> On Fri, Dec 18, 2015 at 4:32 PM, Arnd Bergmann wrote: >> > On Tuesday 15 December 2015 00:58:26 Rafael J. Wysocki wrote: >> >> On Thursday, November 26, 2015 05:21:11 PM Jia Hongtao wrote

Re: [PATCH V3] cpufreq: qoriq: Register cooling device based on device tree

2016-02-26 Thread Arnd Bergmann
On Friday 26 February 2016 17:07:09 Li Yang wrote: > > I don't have a perfect solution either. But I think this is still > better than making cpufreq not usable. The cpufreq driver will print > out an error message if thermal is not reachable. Maybe this can > relief the confusion a little bit?

Re: [PATCH V3] cpufreq: qoriq: Register cooling device based on device tree

2016-02-26 Thread Li Yang
On Fri, Feb 26, 2016 at 5:16 PM, Arnd Bergmann wrote: > On Friday 26 February 2016 17:07:09 Li Yang wrote: >> >> I don't have a perfect solution either. But I think this is still >> better than making cpufreq not usable. The cpufreq driver will print >> out an error message if thermal is not rea

Re: [PATCH V3] cpufreq: qoriq: Register cooling device based on device tree

2016-02-26 Thread Li Yang
On Fri, Feb 26, 2016 at 5:31 PM, Li Yang wrote: > On Fri, Feb 26, 2016 at 5:16 PM, Arnd Bergmann wrote: >> On Friday 26 February 2016 17:07:09 Li Yang wrote: >>> >>> I don't have a perfect solution either. But I think this is still >>> better than making cpufreq not usable. The cpufreq driver w

Re: [PATCH v10 1/2] cpufreq: powernv: Fix bugs in powernv_cpufreq_{init/exit}

2016-02-26 Thread Rafael J. Wysocki
On Friday, February 26, 2016 04:15:00 PM Viresh Kumar wrote: > On 26-02-16, 16:06, Shilpasri G Bhat wrote: > > Unregister the notifiers if cpufreq_driver_register() fails in > > powernv_cpufreq_init(). Re-arrange the unregistration and cleanup routines > > in powernv_cpufreq_exit() to free all the

Re: [PATCH V3] cpufreq: qoriq: Register cooling device based on device tree

2016-02-26 Thread Scott Wood
On Fri, 2016-02-26 at 18:04 -0600, Li Yang wrote: > On Fri, Feb 26, 2016 at 5:31 PM, Li Yang wrote: > > On Fri, Feb 26, 2016 at 5:16 PM, Arnd Bergmann wrote: > > > On Friday 26 February 2016 17:07:09 Li Yang wrote: > > > > > > > > I don't have a perfect solution either. But I think this is stil

Re: [PATCH V3] cpufreq: qoriq: Register cooling device based on device tree

2016-02-26 Thread Li Yang
On Fri, Feb 26, 2016 at 6:08 PM, Scott Wood wrote: > On Fri, 2016-02-26 at 18:04 -0600, Li Yang wrote: >> On Fri, Feb 26, 2016 at 5:31 PM, Li Yang wrote: >> > On Fri, Feb 26, 2016 at 5:16 PM, Arnd Bergmann wrote: >> > > On Friday 26 February 2016 17:07:09 Li Yang wrote: >> > > > >> > > > I don't