[PATCH v2 0/3] powernv:stop: Use psscr_val,mask provided by firmware

2016-10-27 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Hi, This is the second iteration of the patchset to use the psscr_val and psscr_mask provided by the firmware for each of the stop states. The previous version can be found here: https://lkml.org/lkml/2016/9/29/45 The main changes in this version are: 1) Add a helpe

[PATCH v2 1/3] powernv:idle: Add IDLE_STATE_ENTER_SEQ_NORET macro

2016-10-27 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" Currently all the low-power idle states are expected to wake up at reset vector 0x100. Which is why the macro IDLE_STATE_ENTER_SEQ that puts the CPU to an idle state and never returns. On ISA_300, when the ESL and EC bits in the PSSCR are zero, the CPU is expected to wa

[PATCH v2 2/3] cpuidle:powernv: Add helper function to populate powernv idle states.

2016-10-27 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" In the current code for powernv_add_idle_states, there is a lot of code duplication while initializing an idle state in powernv_states table. Add an inline helper function to populate the powernv_states[] table for a given idle state. Invoke this for populating the "Nap

[PATCH v2 3/3] powernv: Pass PSSCR value and mask to power9_idle_stop

2016-10-27 Thread Gautham R. Shenoy
From: "Gautham R. Shenoy" The power9_idle_stop method currently takes only the requested stop level as a parameter and picks up the rest of the PSSCR bits from a hand-coded macro. This is not a very flexible design, especially when the firmware has the capability to communicate the psscr value an

Re: [PATCH 2/2] powerpc/kvm: Update kvmppc_set_arch_compat() for ISA v3.00

2016-10-27 Thread Michael Ellerman
Suraj Jitindar Singh writes: > diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c > index 3686471..f9ae3fb 100644 > --- a/arch/powerpc/kvm/book3s_hv.c > +++ b/arch/powerpc/kvm/book3s_hv.c > @@ -311,24 +311,38 @@ static int kvmppc_set_arch_compat(struct kvm_vcpu > *vcpu, u32

Re: powerpc/64s: relocation, register save fixes for system reset interrupt

2016-10-27 Thread Michael Ellerman
On Thu, 2016-13-10 at 02:17:14 UTC, Nicholas Piggin wrote: > This patch does a couple of things. First of all, powernv immediately > explodes when running a relocated kernel, because the system reset > exception for handling sleeps does not do correct relocated branches. > > Secondly, the sleep ha

Re: powerpc/mm: Use tlbiel only if we ever ran on the current cpu

2016-10-27 Thread Michael Ellerman
On Mon, 2016-24-10 at 03:20:43 UTC, "Aneesh Kumar K.V" wrote: > Before this patch, we used tlbiel, if we ever ran only on this core. > That was mostly derived from the nohash usage of the same. But the > ISA 3.0 clarifies tlbiel such that > > "All TLB entries that have all of the following propert

Re: [PATCH v6 1/3] powerpc/pseries: Correct possible read beyond dlpar sysfs buffer

2016-10-27 Thread John Allen
On 10/18/2016 12:20 PM, Nathan Fontenot wrote: > The pasrsing of data written to the dlpar file in sysfs does not correctly > account for the possibility of reading past the end of the buffer. Correct > this by updating the buffer parsing code to make a local copy and use the > strsep() and sysfs_s

Re: [PATCH v6 3/3] powerpc/pseries: Implement indexed-count hotplug memory remove

2016-10-27 Thread John Allen
On 10/18/2016 12:21 PM, Nathan Fontenot wrote: > From: Sahil Mehta > > Indexed-count remove for memory hotplug guarantees that a contiguous block > of lmbs beginning at a specified will be unassigned (NOT > that lmbs will be removed). Because of Qemu's per-DIMM memory > management, the removal

Re: [PATCH v6 2/3] powerpc/pseries: Implement indexed-count hotplug memory add

2016-10-27 Thread John Allen
On 10/18/2016 12:20 PM, Nathan Fontenot wrote: > From: Sahil Mehta > > Indexed-count add for memory hotplug guarantees that a contiguous block > of lmbs beginning at a specified will be assigned (NOT > that lmbs will be added). Because of Qemu's per-DIMM memory > management, the addition of a

[PATCH V8 2/8] powerpc/memory: Parse new memory property to register blocks.

2016-10-27 Thread Michael Bringmann
powerpc/memory: Add parallel routines to parse the new property "ibm,dynamic-memory-v2" property when it is present, and then to register the relevant memory blocks with the operating system. This property format is intended to provide a more compact representation of memory when communicating with

[PATCH V8 6/8] hotplug/drc-info: Add code to search new devtree properties

2016-10-27 Thread Michael Bringmann
rpadlpar_core.c: Provide parallel routines to search the older device- tree properties ("ibm,drc-indexes", "ibm,drc-names", "ibm,drc-types" and "ibm,drc-power-domains"), or the new property "ibm,drc-info". The interface to examine the DRC information is changed from a "get" function that returns v

[PATCH V8 1/8] powerpc/firmware: Add definitions for new firmware features.

2016-10-27 Thread Michael Bringmann
Firmware Features: Define new bit flags representing the presence of new device tree properties "ibm,drc-info", and "ibm,dynamic-memory-v2". These flags are used to tell the front end processor when the Linux kernel supports the new properties, and by the front end processor to tell the Linux kerne

[PATCH V8 5/8] pseries/drc-info: Search new DRC properties for CPU indexes

2016-10-27 Thread Michael Bringmann
pseries/drc-info: Provide parallel routines to convert between drc_index and CPU numbers at runtime, using the older device-tree properties ("ibm,drc-indexes", "ibm,drc-names", "ibm,drc-types" and "ibm,drc-power-domains"), or the new property "ibm,drc-info". [V2: Revise contant names.] [V3: No cha

[PATCH V8 3/8] powerpc/memory: Parse new memory property to initialize structures.

2016-10-27 Thread Michael Bringmann
powerpc/memory: Add parallel routines to parse the new property "ibm,dynamic-memory-v2" property when it is present, and then to finish initialization of the relevant memory structures with the operating system. This code is shared between the boot-time initialization functions and the runtime fun

[PATCH V8 0/8] powerpc/devtree: Add support for 2 new DRC properties

2016-10-27 Thread Michael Bringmann
Several properties in the DRC device tree format are replaced by more compact representations to allow, for example, for the encoding of vast amounts of memory, and or reduced duplication of information in related data structures. "ibm,drc-info": This property, when present, replaces the following

[PATCH V8 4/8] pseries/hotplug init: Convert new DRC memory property for hotplug runtime

2016-10-27 Thread Michael Bringmann
hotplug_init: Simplify the code needed for runtime memory hotplug and maintenance with a conversion routine that transforms the compressed property "ibm,dynamic-memory-v2" to the form of "ibm,dynamic-memory" within the "ibm,dynamic-reconfiguration-memory" property. Thus only a single set of routin

[PATCH V8 7/8] powerpc: Check arch.vec earlier during boot for memory features

2016-10-27 Thread Michael Bringmann
architecture.vec5 features: The boot-time memory management needs to know the form of the "ibm,dynamic-memory-v2" property early during scanning of the flattened device tree. This patch moves execution of the function pseries_probe_fw_features() early enough to be before the scanning of the memory

Re: [PATCH net-next] ibmveth: v1 calculate correct gso_size and set gso_type

2016-10-27 Thread Thomas Falcon
On 10/25/2016 07:09 PM, Jon Maxwell wrote: > We recently encountered a bug where a few customers using ibmveth on the > same LPAR hit an issue where a TCP session hung when large receive was > enabled. Closer analysis revealed that the session was stuck because the > one side was advertising a ze

[PATCH V8 8/8] powerpc: Enable support for new DRC devtree properties

2016-10-27 Thread Michael Bringmann
prom_init.c: Enable support for new DRC device tree properties "ibm,drc-info" and "ibm,dynamic-memory-v2" in initial handshake between the Linux kernel and the front end processor. [V2: Revise constant names.] [V3: No change.] [V4: Update comments] [V5: Resynchronize/resubmit] [V6: Resynchronize t

[PATCH V8 5/8] pseries/drc-info: Search new DRC properties for CPU indexes

2016-10-27 Thread Michael Bringmann
pseries/drc-info: Provide parallel routines to convert between drc_index and CPU numbers at runtime, using the older device-tree properties ("ibm,drc-indexes", "ibm,drc-names", "ibm,drc-types" and "ibm,drc-power-domains"), or the new property "ibm,drc-info". [V2: Revise contant names.] [V3: No cha

[PATCH V8 0/8] powerpc/devtree: Add support for 2 new DRC properties

2016-10-27 Thread Michael Bringmann
Several properties in the DRC device tree format are replaced by more compact representations to allow, for example, for the encoding of vast amounts of memory, and or reduced duplication of information in related data structures. "ibm,drc-info": This property, when present, replaces the following

[PATCH V8 0/8] powerpc/devtree: Add support for 2 new DRC properties

2016-10-27 Thread Michael Bringmann
Several properties in the DRC device tree format are replaced by more compact representations to allow, for example, for the encoding of vast amounts of memory, and or reduced duplication of information in related data structures. "ibm,drc-info": This property, when present, replaces the following

[PATCH V8 3/8] powerpc/memory: Parse new memory property to initialize structures.

2016-10-27 Thread Michael Bringmann
powerpc/memory: Add parallel routines to parse the new property "ibm,dynamic-memory-v2" property when it is present, and then to finish initialization of the relevant memory structures with the operating system. This code is shared between the boot-time initialization functions and the runtime fun

[PATCH V8 8/8] powerpc: Enable support for new DRC devtree properties

2016-10-27 Thread Michael Bringmann
prom_init.c: Enable support for new DRC device tree properties "ibm,drc-info" and "ibm,dynamic-memory-v2" in initial handshake between the Linux kernel and the front end processor. [V2: Revise constant names.] [V3: No change.] [V4: Update comments] [V5: Resynchronize/resubmit] [V6: Resynchronize t

[PATCH V8 6/8] hotplug/drc-info: Add code to search new devtree properties

2016-10-27 Thread Michael Bringmann
rpadlpar_core.c: Provide parallel routines to search the older device- tree properties ("ibm,drc-indexes", "ibm,drc-names", "ibm,drc-types" and "ibm,drc-power-domains"), or the new property "ibm,drc-info". The interface to examine the DRC information is changed from a "get" function that returns v

[PATCH V8 2/8] powerpc/memory: Parse new memory property to register blocks.

2016-10-27 Thread Michael Bringmann
powerpc/memory: Add parallel routines to parse the new property "ibm,dynamic-memory-v2" property when it is present, and then to register the relevant memory blocks with the operating system. This property format is intended to provide a more compact representation of memory when communicating with

[PATCH V8 4/8] pseries/hotplug init: Convert new DRC memory property for hotplug runtime

2016-10-27 Thread Michael Bringmann
hotplug_init: Simplify the code needed for runtime memory hotplug and maintenance with a conversion routine that transforms the compressed property "ibm,dynamic-memory-v2" to the form of "ibm,dynamic-memory" within the "ibm,dynamic-reconfiguration-memory" property. Thus only a single set of routin

[PATCH V8 7/8] powerpc: Check arch.vec earlier during boot for memory features

2016-10-27 Thread Michael Bringmann
architecture.vec5 features: The boot-time memory management needs to know the form of the "ibm,dynamic-memory-v2" property early during scanning of the flattened device tree. This patch moves execution of the function pseries_probe_fw_features() early enough to be before the scanning of the memory

[PATCH V8 0/8] powerpc/devtree: Add support for 2 new DRC properties

2016-10-27 Thread Michael Bringmann
Several properties in the DRC device tree format are replaced by more compact representations to allow, for example, for the encoding of vast amounts of memory, and or reduced duplication of information in related data structures. "ibm,drc-info": This property, when present, replaces the following

[PATCH V8 1/8] powerpc/firmware: Add definitions for new firmware features.

2016-10-27 Thread Michael Bringmann
Firmware Features: Define new bit flags representing the presence of new device tree properties "ibm,drc-info", and "ibm,dynamic-memory-v2". These flags are used to tell the front end processor when the Linux kernel supports the new properties, and by the front end processor to tell the Linux kerne

[PATCH V8 0/8] powerpc/devtree: Add support for 2 new DRC properties

2016-10-27 Thread Michael Bringmann
Several properties in the DRC device tree format are replaced by more compact representations to allow, for example, for the encoding of vast amounts of memory, and or reduced duplication of information in related data structures. "ibm,drc-info": This property, when present, replaces the following

[PATCH V8 0/8] powerpc/devtree: Add support for 2 new DRC properties

2016-10-27 Thread Michael Bringmann
Several properties in the DRC device tree format are replaced by more compact representations to allow, for example, for the encoding of vast amounts of memory, and or reduced duplication of information in related data structures. "ibm,drc-info": This property, when present, replaces the following

[PATCH V8 0/8] powerpc/devtree: Add support for 2 new DRC properties

2016-10-27 Thread Michael Bringmann
Several properties in the DRC device tree format are replaced by more compact representations to allow, for example, for the encoding of vast amounts of memory, and or reduced duplication of information in related data structures. "ibm,drc-info": This property, when present, replaces the following

[PATCH V8 0/8] powerpc/devtree: Add support for 2 new DRC properties

2016-10-27 Thread Michael Bringmann
Several properties in the DRC device tree format are replaced by more compact representations to allow, for example, for the encoding of vast amounts of memory, and or reduced duplication of information in related data structures. "ibm,drc-info": This property, when present, replaces the following

[PATCH V8 0/8] powerpc/devtree: Add support for 2 new DRC properties

2016-10-27 Thread Michael Bringmann
Several properties in the DRC device tree format are replaced by more compact representations to allow, for example, for the encoding of vast amounts of memory, and or reduced duplication of information in related data structures. "ibm,drc-info": This property, when present, replaces the following

Re: [PATCH net-next] ibmveth: v1 calculate correct gso_size and set gso_type

2016-10-27 Thread Eric Dumazet
On Wed, 2016-10-26 at 11:09 +1100, Jon Maxwell wrote: > We recently encountered a bug where a few customers using ibmveth on the > same LPAR hit an issue where a TCP session hung when large receive was > enabled. Closer analysis revealed that the session was stuck because the > one side was adver

[PATCH V8 0/8] powerpc/devtree: Add support for 2 new DRC properties

2016-10-27 Thread Michael Bringmann
Several properties in the DRC device tree format are replaced by more compact representations to allow, for example, for the encoding of vast amounts of memory, and or reduced duplication of information in related data structures. "ibm,drc-info": This property, when present, replaces the following

[PATCHv3 0/8] powerpc/mm: refactor vDSO mapping code

2016-10-27 Thread Dmitry Safonov
Changes since v1, v2: - use vdso64_pages only under CONFIG_PPC64 (32-bit build fix) - remove arch_vma_name helper as not needed anymore, simplify vdso_base pointer initializing in map_vdso() Cleanup patches for vDSO on powerpc. Originally, I wanted to add vDSO remapping on arm/aarch64 and I deci

[PATCHv3 1/8] powerpc/vdso: unify return paths in setup_additional_pages

2016-10-27 Thread Dmitry Safonov
Impact: cleanup Rename `rc' variable which doesn't seems to mean anything into kernel-known `ret'. Combine two function returns into one as it's also easier to read. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Andy Lutomirski Cc: Oleg Nesterov Cc: linuxppc-dev@list

[PATCHv3 4/8] powerpc/vdso: introduce init_vdso{32,64}_pagelist

2016-10-27 Thread Dmitry Safonov
Impact: cleanup Move allocation/initialization of vDSO's pagelist for 32/64-bit vDSO into common vdso code, introducing a function for that. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Andy Lutomirski Cc: Oleg Nesterov Cc: linuxppc-dev@lists.ozlabs.org Cc: linux...

[PATCHv3 3/8] powerpc/vdso: separate common code in vdso_common

2016-10-27 Thread Dmitry Safonov
Impact: cleanup There are common functions for handeling 32-bit and 64-bit vDSO ELF files: find_section{32,64}, find_symbol{32,64}, find_function{32,64}, vdso_do_func_patch{32,64}, vdso_do_find_sections{32,64}, vdso_fixup_datapag{32,64}, vdso_fixup_features{32,64}, vdso_setup{32,64} which all do t

[PATCHv3 5/8] powerpc/vdso: split map_vdso from arch_setup_additional_pages

2016-10-27 Thread Dmitry Safonov
Impact: cleanup I'll be easier to introduce vm_special_mapping struct in a smaller map_vdso() function (see the next patches). The same way it's handeled on x86. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Andy Lutomirski Cc: Oleg Nesterov Cc: linuxppc-dev@lists.oz

[PATCHv3 6/8] powerpc/vdso: switch from legacy_special_mapping_vmops

2016-10-27 Thread Dmitry Safonov
This will allow to handle vDSO vma like special_mapping, that has it's name and hooks. Needed for mremap hook, which will replace arch_mremap helper, also for removing arch_vma_name. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Andy Lutomirski Cc: Oleg Nesterov Cc: l

[PATCHv3 2/8] powerpc/vdso: remove unused params in vdso_do_func_patch{32, 64}

2016-10-27 Thread Dmitry Safonov
Impact: cleanup vdso_do_func_patch{32,64} only use {v32,v64} parameter accordingly. Remove not needed parameters. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Andy Lutomirski Cc: Oleg Nesterov Cc: linuxppc-dev@lists.ozlabs.org Cc: linux...@kvack.org Signed-off-by: D

[PATCHv3 8/8] powerpc/vdso: remove arch_vma_name

2016-10-27 Thread Dmitry Safonov
It's not needed since vdso is inserted with vm_special_mapping which contains vma name. This also reverts commit f2053f1a7bf6 ("powerpc/perf_counter: Fix vdso detection") as not needed anymore. See also commit f7b6eb3fa072 ("x86: Set context.vdso before installing the mapping"). Cc: Benjamin Herre

[PATCHv3 7/8] mm: kill arch_mremap

2016-10-27 Thread Dmitry Safonov
This reverts commit 4abad2ca4a4d ("mm: new arch_remap() hook") and commit 2ae416b142b6 ("mm: new mm hook framework"). It also keeps the same functionality of mremapping vDSO blob with introducing vm_special_mapping mremap op for powerpc. The same way it's being handled on x86. Cc: Laurent Dufour

Re: [PATCH net-next] ibmveth: v1 calculate correct gso_size and set gso_type

2016-10-27 Thread Thomas Falcon
On 10/27/2016 10:26 AM, Eric Dumazet wrote: > On Wed, 2016-10-26 at 11:09 +1100, Jon Maxwell wrote: >> We recently encountered a bug where a few customers using ibmveth on the >> same LPAR hit an issue where a TCP session hung when large receive was >> enabled. Closer analysis revealed that the se

Re: [PATCH net-next] ibmveth: v1 calculate correct gso_size and set gso_type

2016-10-27 Thread Eric Dumazet
On Thu, 2016-10-27 at 12:54 -0500, Thomas Falcon wrote: > On 10/27/2016 10:26 AM, Eric Dumazet wrote: > > On Wed, 2016-10-26 at 11:09 +1100, Jon Maxwell wrote: > >> We recently encountered a bug where a few customers using ibmveth on the > >> same LPAR hit an issue where a TCP session hung when la

Re: [PATCH 0/7] powerpc/mm: refactor vDSO mapping code

2016-10-27 Thread Dmitry Safonov
2016-10-25 18:50 GMT+03:00 Dmitry Safonov : > Cleanup patches for vDSO on powerpc. > Originally, I wanted to add vDSO remapping on arm/aarch64 and > I decided to cleanup that part on powerpc. > I've add a hook for vm_ops for vDSO just like I did for x86. > Other changes - reduce exhaustive code dup

[v13, 1/8] dt: bindings: update Freescale DCFG compatible

2016-10-27 Thread Yangbo Lu
Update Freescale DCFG compatible with 'fsl,-dcfg' instead of 'fsl,ls1021a-dcfg' to include more chips such as ls1021a, ls1043a, and ls2080a. Signed-off-by: Yangbo Lu Acked-by: Rob Herring Signed-off-by: Scott Wood --- Changes for v8: - Added this patch Changes for v9: - Added a

[v13, 0/8] Fix eSDHC host version register bug

2016-10-27 Thread Yangbo Lu
This patchset is used to fix a host version register bug in the T4240-R1.0-R2.0 eSDHC controller. To match the SoC version and revision, 10 previous version patchsets had tried many methods but all of them were rejected by reviewers. Such as - dts compatible method - syscon method

[v13, 2/8] ARM64: dts: ls2080a: add device configuration node

2016-10-27 Thread Yangbo Lu
Add the dts node for device configuration unit that provides general purpose configuration and status for the device. Signed-off-by: Yangbo Lu Acked-by: Scott Wood --- Changes for v5: - Added this patch Changes for v6: - None Changes for v7: - None Changes for v8:

[v13, 3/8] dt: bindings: move guts devicetree doc out of powerpc directory

2016-10-27 Thread Yangbo Lu
Move guts devicetree doc to Documentation/devicetree/bindings/soc/fsl/ since it's used by not only PowerPC but also ARM. And add a specification for 'little-endian' property. Signed-off-by: Yangbo Lu Acked-by: Rob Herring Acked-by: Scott Wood --- Changes for v4: - Added this patch Chang

[v13, 4/8] powerpc/fsl: move mpc85xx.h to include/linux/fsl

2016-10-27 Thread Yangbo Lu
Move mpc85xx.h to include/linux/fsl and rename it to svr.h as a common header file. This SVR numberspace is used on some ARM chips as well as PPC, and even to check for a PPC SVR multi-arch drivers would otherwise need to ifdef the header inclusion and all references to the SVR symbols. Signed-of

[v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms

2016-10-27 Thread Yangbo Lu
The global utilities block controls power management, I/O device enabling, power-onreset(POR) configuration monitoring, alternate function selection for multiplexed signals,and clock control. This patch adds a driver to manage and access global utilities block. Initially only reading SVR and regis

[v13, 6/8] MAINTAINERS: add entry for Freescale SoC drivers

2016-10-27 Thread Yangbo Lu
Add maintainer entry for Freescale SoC drivers including the QE library and the GUTS driver now. Also add maintainer for QE library. Signed-off-by: Yangbo Lu Acked-by: Scott Wood Acked-by: Qiang Zhao --- Changes for v8: - Added this patch Changes for v9: - Added linux-arm mail l

[v13, 7/8] base: soc: introduce soc_device_match() interface

2016-10-27 Thread Yangbo Lu
From: Arnd Bergmann We keep running into cases where device drivers want to know the exact version of the a SoC they are currently running on. In the past, this has usually been done through a vendor specific API that can be called by a driver, or by directly accessing some kind of version regist

[v13, 8/8] mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0

2016-10-27 Thread Yangbo Lu
The eSDHC of T4240-R1.0-R2.0 has incorrect vender version and spec version. Acturally the right version numbers should be VVN=0x13 and SVN = 0x1. This patch adds the GUTS driver support for eSDHC driver to match SoC. And fix host version to avoid that incorrect version numbers break down the ADMA d

[PATCH v6 00/11] implement vcpu preempted check

2016-10-27 Thread Pan Xinhui
change from v5: spilt x86/kvm patch into guest/host part. introduce kvm_write_guest_offset_cached. fix some typos. rebase patch onto 4.9.2 change from v4: spilt x86 kvm vcpu preempted check into two patches. add documentation patch. add x86 vc

[PATCH v6 01/11] kernel/sched: introduce vcpu preempted check interface

2016-10-27 Thread Pan Xinhui
This patch support to fix lock holder preemption issue. For kernel users, we could use bool vcpu_is_preempted(int cpu) to detech if one vcpu is preempted or not. The default implementation is a macro defined by false. So compiler can wrap it out if arch dose not support such vcpu pteempted check.

[PATCH v6 02/11] locking/osq: Drop the overload of osq_lock()

2016-10-27 Thread Pan Xinhui
An over-committed guest with more vCPUs than pCPUs has a heavy overload in osq_lock(). This is because vCPU A hold the osq lock and yield out, vCPU B wait per_cpu node->locked to be set. IOW, vCPU B wait vCPU A to run and unlock the osq lock. Kernel has an interface bool vcpu_is_preempted(int cpu

[PATCH v6 03/11] kernel/locking: Drop the overload of {mutex, rwsem}_spin_on_owner

2016-10-27 Thread Pan Xinhui
An over-committed guest with more vCPUs than pCPUs has a heavy overload in the two spin_on_owner. This blames on the lock holder preemption issue. Kernel has an interface bool vcpu_is_preempted(int cpu) to see if a vCPU is currently running or not. So break the spin loops on true condition. test-

[PATCH v6 04/11] powerpc/spinlock: support vcpu preempted check

2016-10-27 Thread Pan Xinhui
This is to fix some lock holder preemption issues. Some other locks implementation do a spin loop before acquiring the lock itself. Currently kernel has an interface of bool vcpu_is_preempted(int cpu). It takes the cpu as parameter and return true if the cpu is preempted. Then kernel can break the

[PATCH v6 05/11] s390/spinlock: Provide vcpu_is_preempted

2016-10-27 Thread Pan Xinhui
From: Christian Borntraeger this implements the s390 backend for commit "kernel/sched: introduce vcpu preempted check interface" by reworking the existing smp_vcpu_scheduled into arch_vcpu_is_preempted. We can then also get rid of the local cpu_is_preempted function by moving the CIF_ENABLED_WAIT

[PATCH v6 06/11] x86, paravirt: Add interface to support kvm/xen vcpu preempted check

2016-10-27 Thread Pan Xinhui
This is to fix some lock holder preemption issues. Some other locks implementation do a spin loop before acquiring the lock itself. Currently kernel has an interface of bool vcpu_is_preempted(int cpu). It takes the cpu as parameter and return true if the cpu is preempted. Then kernel can break the

[PATCH v6 07/11] KVM: Introduce kvm_write_guest_offset_cached

2016-10-27 Thread Pan Xinhui
It allows us to update some status or field of one struct partially. We can also save one kvm_read_guest_cached if we just update one filed of the struct regardless of its current value. Signed-off-by: Pan Xinhui --- include/linux/kvm_host.h | 2 ++ virt/kvm/kvm_main.c | 20 ++

[PATCH v6 08/11] x86, kvm/x86.c: support vcpu preempted check

2016-10-27 Thread Pan Xinhui
Support the vcpu_is_preempted() functionality under KVM. This will enhance lock performance on overcommitted hosts (more runnable vcpus than physical cpus in the system) as doing busy waits for preempted vcpus will hurt system performance far worse than early yielding. Use one field of struct kvm_

[PATCH v6 09/11] x86, kernel/kvm.c: support vcpu preempted check

2016-10-27 Thread Pan Xinhui
Support the vcpu_is_preempted() functionality under KVM. This will enhance lock performance on overcommitted hosts (more runnable vcpus than physical cpus in the system) as doing busy waits for preempted vcpus will hurt system performance far worse than early yielding. struct kvm_steal_time::preem

[PATCH v6 10/11] x86, xen: support vcpu preempted check

2016-10-27 Thread Pan Xinhui
From: Juergen Gross Support the vcpu_is_preempted() functionality under Xen. This will enhance lock performance on overcommitted hosts (more runnable vcpus than physical cpus in the system) as doing busy waits for preempted vcpus will hurt system performance far worse than early yielding. A quic

[PATCH v6 11/11] Documentation: virtual: kvm: Support vcpu preempted check

2016-10-27 Thread Pan Xinhui
Commit ("x86, kvm: support vcpu preempted check") add one field "__u8 preempted" into struct kvm_steal_time. This field tells if one vcpu is running or not. It is zero if 1) some old KVM deos not support this filed. 2) the vcpu is not preempted. Other values means the vcpu has been preempted. Sig

Re: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms

2016-10-27 Thread Scott Wood
On Fri, 2016-10-28 at 11:32 +0800, Yangbo Lu wrote: > + guts->regs = of_iomap(np, 0); > + if (!guts->regs) > + return -ENOMEM; > + > + /* Register soc device */ > + machine = of_flat_dt_get_machine_name(); > + if (machine) > + soc_dev_attr.machine = devm_

[v14, 0/8] Fix eSDHC host version register bug

2016-10-27 Thread Yangbo Lu
This patchset is used to fix a host version register bug in the T4240-R1.0-R2.0 eSDHC controller. To match the SoC version and revision, 10 previous version patchsets had tried many methods but all of them were rejected by reviewers. Such as - dts compatible method - syscon method

[v14, 1/8] dt: bindings: update Freescale DCFG compatible

2016-10-27 Thread Yangbo Lu
Update Freescale DCFG compatible with 'fsl,-dcfg' instead of 'fsl,ls1021a-dcfg' to include more chips such as ls1021a, ls1043a, and ls2080a. Signed-off-by: Yangbo Lu Acked-by: Rob Herring Signed-off-by: Scott Wood --- Changes for v8: - Added this patch Changes for v9: - Added a

[v14, 2/8] ARM64: dts: ls2080a: add device configuration node

2016-10-27 Thread Yangbo Lu
Add the dts node for device configuration unit that provides general purpose configuration and status for the device. Signed-off-by: Yangbo Lu Acked-by: Scott Wood --- Changes for v5: - Added this patch Changes for v6: - None Changes for v7: - None Changes for v8:

[v14, 3/8] dt: bindings: move guts devicetree doc out of powerpc directory

2016-10-27 Thread Yangbo Lu
Move guts devicetree doc to Documentation/devicetree/bindings/soc/fsl/ since it's used by not only PowerPC but also ARM. And add a specification for 'little-endian' property. Signed-off-by: Yangbo Lu Acked-by: Rob Herring Acked-by: Scott Wood --- Changes for v4: - Added this patch Chang

[v14, 4/8] powerpc/fsl: move mpc85xx.h to include/linux/fsl

2016-10-27 Thread Yangbo Lu
Move mpc85xx.h to include/linux/fsl and rename it to svr.h as a common header file. This SVR numberspace is used on some ARM chips as well as PPC, and even to check for a PPC SVR multi-arch drivers would otherwise need to ifdef the header inclusion and all references to the SVR symbols. Signed-of

[v14, 5/8] soc: fsl: add GUTS driver for QorIQ platforms

2016-10-27 Thread Yangbo Lu
The global utilities block controls power management, I/O device enabling, power-onreset(POR) configuration monitoring, alternate function selection for multiplexed signals,and clock control. This patch adds a driver to manage and access global utilities block. Initially only reading SVR and regis

[v14, 6/8] MAINTAINERS: add entry for Freescale SoC drivers

2016-10-27 Thread Yangbo Lu
Add maintainer entry for Freescale SoC drivers including the QE library and the GUTS driver now. Also add maintainer for QE library. Signed-off-by: Yangbo Lu Acked-by: Scott Wood Acked-by: Qiang Zhao --- Changes for v8: - Added this patch Changes for v9: - Added linux-arm mail l

[v14, 7/8] base: soc: introduce soc_device_match() interface

2016-10-27 Thread Yangbo Lu
From: Arnd Bergmann We keep running into cases where device drivers want to know the exact version of the a SoC they are currently running on. In the past, this has usually been done through a vendor specific API that can be called by a driver, or by directly accessing some kind of version regist

[v14, 8/8] mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0

2016-10-27 Thread Yangbo Lu
The eSDHC of T4240-R1.0-R2.0 has incorrect vender version and spec version. Acturally the right version numbers should be VVN=0x13 and SVN = 0x1. This patch adds the GUTS driver support for eSDHC driver to match SoC. And fix host version to avoid that incorrect version numbers break down the ADMA d

RE: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms

2016-10-27 Thread Y.B. Lu
> -Original Message- > From: linux-mmc-ow...@vger.kernel.org [mailto:linux-mmc- > ow...@vger.kernel.org] On Behalf Of Scott Wood > Sent: Friday, October 28, 2016 12:46 PM > To: Y.B. Lu; linux-...@vger.kernel.org; ulf.hans...@linaro.org; Arnd > Bergmann > Cc: linuxppc-dev@lists.ozlabs.org;

RE: [v13, 5/8] soc: fsl: add GUTS driver for QorIQ platforms

2016-10-27 Thread Y.B. Lu
> -Original Message- > From: Y.B. Lu > Sent: Friday, October 28, 2016 2:00 PM > To: 'Scott Wood'; linux-...@vger.kernel.org; ulf.hans...@linaro.org; Arnd > Bergmann > Cc: linuxppc-dev@lists.ozlabs.org; devicet...@vger.kernel.org; linux-arm- > ker...@lists.infradead.org; linux-ker...@vger.ke

[PATCH] powerpc/64: Used named initialisers for ibm_pa_features

2016-10-27 Thread Michael Ellerman
The ibm_pa_features array consists of structures that describe which bit and byte in the ibm,pa-features property toggles one or more flags in either the CPU, MMU, or user visible feature flags. Each one consists of 7 values, which are all unsigned long, int or char, meaning the compiler gives us