[PATCH] QE: Use GFP_ATOMIC while spin_lock_irqsave is held

2016-01-24 Thread Saurabh Sengar
cpm_muram_alloc_common is called twice and both the times spin_lock_irqsave is held. Using GFP_KERNEL can sleep in spin_lock_irqsave context and cause deadlock Signed-off-by: Saurabh Sengar --- Let me know if there is any other way to fix it. Also, I would say this function should be static as it

Re: [PATCH v3 06/17] arch: Set IORESOURCE_SYSTEM_RAM to System RAM

2016-01-24 Thread Borislav Petkov
Adding the respective arch MLs to CC, as an FYI. On Tue, Jan 05, 2016 at 11:54:30AM -0700, Toshi Kani wrote: > Set IORESOURCE_SYSTEM_RAM to 'flags' of resource ranges with > "System RAM", "Kernel code", "Kernel data", and "Kernel bss". > > Note that: > - IORESOURCE_SYSRAM (i.e. modifier bit) is

Re: [PATCH kernel v2 2/6] KVM: PPC: Use RCU for arch.spapr_tce_tables

2016-01-24 Thread David Gibson
On Thu, Jan 21, 2016 at 06:39:33PM +1100, Alexey Kardashevskiy wrote: > At the moment spapr_tce_tables is not protected against races. That's not really true - it's protected by the kvm->lock mutex. > This makes > use of RCU-variants of list helpers. As some bits are executed in real > mode, this

Re: [PATCH kernel v2 1/6] KVM: PPC: Rework H_PUT_TCE/H_GET_TCE handlers

2016-01-24 Thread David Gibson
On Fri, Jan 22, 2016 at 12:59:47PM +1100, Alexey Kardashevskiy wrote: > On 01/22/2016 11:42 AM, David Gibson wrote: > >On Thu, Jan 21, 2016 at 06:39:32PM +1100, Alexey Kardashevskiy wrote: > >>This reworks the existing H_PUT_TCE/H_GET_TCE handlers to have following > >>patches applied nicer. > >> >

Re: [PATCH v3 4/9] powerpc: Explicitly disable math features when copying thread

2016-01-24 Thread Balbir Singh
On Thu, 21 Jan 2016 11:55:44 +1100 Cyril Bur wrote: > Currently when threads get scheduled off they always giveup the FPU, > Altivec (VMX) and Vector (VSX) units if they were using them. When they are > scheduled back on a fault is then taken to enable each facility and load > registers. As a res

Re: [PATCH kernel v2 3/6] KVM: PPC: Account TCE-containing pages in locked_vm

2016-01-24 Thread David Gibson
On Thu, Jan 21, 2016 at 06:39:34PM +1100, Alexey Kardashevskiy wrote: > At the moment pages used for TCE tables (in addition to pages addressed > by TCEs) are not counted in locked_vm counter so a malicious userspace > tool can call ioctl(KVM_CREATE_SPAPR_TCE) as many times as RLIMIT_NOFILE and > l

Re: [PATCH kernel v2 5/6] KVM: PPC: Move reusable bits of H_PUT_TCE handler to helpers

2016-01-24 Thread David Gibson
On Thu, Jan 21, 2016 at 06:39:36PM +1100, Alexey Kardashevskiy wrote: > Upcoming multi-tce support (H_PUT_TCE_INDIRECT/H_STUFF_TCE hypercalls) > will validate TCE (not to have unexpected bits) and IO address > (to be within the DMA window boundaries). > > This introduces helpers to validate TCE an

Re: [PATCH kernel v2 5/6] KVM: PPC: Move reusable bits of H_PUT_TCE handler to helpers

2016-01-24 Thread David Gibson
On Mon, Jan 25, 2016 at 11:12:36AM +1100, David Gibson wrote: > On Thu, Jan 21, 2016 at 06:39:36PM +1100, Alexey Kardashevskiy wrote: > > Upcoming multi-tce support (H_PUT_TCE_INDIRECT/H_STUFF_TCE hypercalls) > > will validate TCE (not to have unexpected bits) and IO address > > (to be within the D

Re: [PATCH kernel v2 6/6] KVM: PPC: Add support for multiple-TCE hcalls

2016-01-24 Thread David Gibson
On Thu, Jan 21, 2016 at 06:39:37PM +1100, Alexey Kardashevskiy wrote: > This adds real and virtual mode handlers for the H_PUT_TCE_INDIRECT and > H_STUFF_TCE hypercalls for user space emulated devices such as IBMVIO > devices or emulated PCI. These calls allow adding multiple entries > (up to 512)

Re: [PATCH kernel v2 6/6] KVM: PPC: Add support for multiple-TCE hcalls

2016-01-24 Thread Alexey Kardashevskiy
On 01/25/2016 11:44 AM, David Gibson wrote: On Thu, Jan 21, 2016 at 06:39:37PM +1100, Alexey Kardashevskiy wrote: This adds real and virtual mode handlers for the H_PUT_TCE_INDIRECT and H_STUFF_TCE hypercalls for user space emulated devices such as IBMVIO devices or emulated PCI. These calls al

Re: [PATCH V10 2/4] perf/powerpc: add support for sampling intr machine state

2016-01-24 Thread Madhavan Srinivasan
On Wednesday 20 January 2016 04:10 PM, Michael Ellerman wrote: > On Mon, 2016-01-11 at 15:58 +0530, Anju T wrote: >> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig >> index 9a7057e..c4ce60d 100644 >> --- a/arch/powerpc/Kconfig >> +++ b/arch/powerpc/Kconfig >> @@ -119,6 +119,7 @@ config

Re: [PATCH kernel v2 6/6] KVM: PPC: Add support for multiple-TCE hcalls

2016-01-24 Thread David Gibson
On Mon, Jan 25, 2016 at 12:24:29PM +1100, Alexey Kardashevskiy wrote: > On 01/25/2016 11:44 AM, David Gibson wrote: > >On Thu, Jan 21, 2016 at 06:39:37PM +1100, Alexey Kardashevskiy wrote: > >>This adds real and virtual mode handlers for the H_PUT_TCE_INDIRECT and > >>H_STUFF_TCE hypercalls for use

Re: [PATCH kernel 1/4] KVM: PPC: Reserve KVM_CAP_SPAPR_TCE_64 capability number

2016-01-24 Thread David Gibson
On Thu, Jan 21, 2016 at 07:15:23PM +1100, Alexey Kardashevskiy wrote: > This adds a capability number for 64-bit TCE tables support. > > Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson > --- > include/uapi/linux/kvm.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/inc

Re: [PATCH kernel 2/4] KVM: PPC: Add @page_shift to kvmppc_spapr_tce_table

2016-01-24 Thread David Gibson
On Thu, Jan 21, 2016 at 07:15:24PM +1100, Alexey Kardashevskiy wrote: > At the moment the kvmppc_spapr_tce_table struct can only describe > 4GB windows and handle fixed size (4K) pages. Dynamic DMA windows > support more so these limits need to be extended. > > This replaces window_size (in bytes,

Re: [PATCH kernel 3/4] KVM: PPC: Add @offset to kvmppc_spapr_tce_table

2016-01-24 Thread David Gibson
On Thu, Jan 21, 2016 at 07:15:25PM +1100, Alexey Kardashevskiy wrote: > This enables userspace view of TCE tables to start from non-zero offset > on a bus. This will be used for huge DMA windows. Again I'd like the commit message adjusted to clarify the fact that this has internal changes only whi

Re: [PATCH kernel 4/4] KVM: PPC: Add support for 64bit TCE windows

2016-01-24 Thread David Gibson
On Thu, Jan 21, 2016 at 07:15:26PM +1100, Alexey Kardashevskiy wrote: > The existing KVM_CREATE_SPAPR_TCE only supports 32bit windows which is not > enough for directly mapped windows as the guest can get more than 4GB. > > This adds KVM_CREATE_SPAPR_TCE_64 ioctl and advertises it > via KVM_CAP_SP

Re: [PATCH v6 2/5] cpufreq: powernv: Remove cpu_to_chip_id() from hot-path

2016-01-24 Thread Gautham R Shenoy
Hello Balbir, On Sat, Jan 23, 2016 at 07:59:20PM +1100, Balbir Singh wrote: > On Fri, 22 Jan 2016 12:49:02 +0530 > Shilpasri G Bhat wrote: > > > cpu_to_chip_id() does a DT walk through to find out the chip id by > > taking a contended device tree lock. This adds an unnecessary overhead > > in a

Re: [v6, 5/5] cpufreq: powernv: Add sysfs attributes to show throttle stats

2016-01-24 Thread Michael Ellerman
On Fri, 2016-22-01 at 07:19:05 UTC, Shilpasri G Bhat wrote: > Create sysfs attributes to export throttle information in > /sys/devices/system/cpu/cpufreq/chipN. The newly added sysfs files are as > follows: > > 1)/sys/devices/system/cpu/cpufreq/chip0/throttle_frequencies .. > 2)/sys/devices/system

Re: [kernel] powerpc: Make vmalloc_to_phys() public

2016-01-24 Thread Michael Ellerman
On Thu, 2016-21-01 at 07:35:08 UTC, Alexey Kardashevskiy wrote: > This makes vmalloc_to_phys() public as there will be another user > (in-kernel VFIO acceleration) for it soon. > > As a part of future little optimization, this changes the helper to call > vmalloc_to_pfn() instead of vmalloc_to_pag

Re: [PATCH v6 1/5] cpufreq: powernv: Hot-plug safe the kworker thread

2016-01-24 Thread Viresh Kumar
On 22-01-16, 12:49, Shilpasri G Bhat wrote: > In the kworker_thread powernv_cpufreq_work_fn(), we can end up > sending an IPI to a cpu going offline. This is a rare corner case > which is fixed using {get/put}_online_cpus(). Along with this fix, > this patch adds changes to do oneshot cpumask_{clea

Re: [PATCH v6 2/5] cpufreq: powernv: Remove cpu_to_chip_id() from hot-path

2016-01-24 Thread Viresh Kumar
On 22-01-16, 12:49, Shilpasri G Bhat wrote: > cpu_to_chip_id() does a DT walk through to find out the chip id by > taking a contended device tree lock. This adds an unnecessary overhead > in a hot path. So instead of calling cpu_to_chip_id() everytime cache > the chip ids for all cores in the array

Re: [PATCH v6 4/5] cpufreq: powernv: Replace pr_info with trace print for throttle event

2016-01-24 Thread Viresh Kumar
On 22-01-16, 12:49, Shilpasri G Bhat wrote: > Currently we use printk message to notify the throttle event. But this > can flood the console if the cpu is throttled frequently. So replace the > printk with the tracepoint to notify the throttle event. And also events > like throttle below nominal fr

Re: [kernel] powerpc: Make vmalloc_to_phys() public

2016-01-24 Thread Anshuman Khandual
On 01/25/2016 11:16 AM, Michael Ellerman wrote: > On Thu, 2016-21-01 at 07:35:08 UTC, Alexey Kardashevskiy wrote: >> > This makes vmalloc_to_phys() public as there will be another user >> > (in-kernel VFIO acceleration) for it soon. >> > >> > As a part of future little optimization, this changes t

Re: [PATCH v6 5/5] cpufreq: powernv: Add sysfs attributes to show throttle stats

2016-01-24 Thread Shilpasri G Bhat
Hi, On 01/23/2016 02:10 PM, Balbir Singh wrote: > On Fri, 22 Jan 2016 12:49:05 +0530 > Shilpasri G Bhat wrote: > >> Create sysfs attributes to export throttle information in >> /sys/devices/system/cpu/cpufreq/chipN. The newly added sysfs files are as >> follows: >> >> 1)/sys/devices/system/cpu/c

[PATCH] Fix fall-through from case 30 (rld*) to case 31

2016-01-24 Thread Oliver O'Halloran
I think this bug can only be triggered if the instruction to simulate is malformed. The switch in the else case only handles the zero and one case, but it extracts bits 4:1 from the instruction word so it may be other values. It's pretty minor, but a bug is a bug. Signed-off-by: Oliver O'Halloran