Re: [PATCH 3/3] spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM

2016-07-04 Thread David Gibson
On Tue, Jul 05, 2016 at 03:19:24PM +1000, Sam Bobroff wrote: > Advertise HTM support in ibm, pa-features if KVM indicates support when > queried via a new capability (KVM_CAP_PPC_HTM). > > If KVM returns false for the capability (which may indicate that the > host kernel doesn't support the capabi

Re: [PATCH 2/3] Add KVM_CAP_PPC_HTM to linux/kvm.h

2016-07-04 Thread David Gibson
On Tue, Jul 05, 2016 at 03:19:23PM +1000, Sam Bobroff wrote: > Signed-off-by: Sam Bobroff Ok, so the usual procedure for updates to linux-headers is this: 1. Get the change merged on the kernel side 2. Use scripts/update-linux-headers.sh to update the whole linux-headers subtree to t

[PATCH 3/3] powerpc/configs: remove old symbols from defconfigs

2016-07-04 Thread Andrew Donnellan
Update defconfigs to remove old symbols and comments referencing old symbols. Dropped: * AVERAGE * INET_LRO * EXT3_DEFAULTS_TO_ORDERED * EXT3_FS_XATTR * I2O * INFINIBAND_AMSO1100 * INFINIBAND_EHCA * IP1000 Replaced: * BLK_DEV_XIP -> BLK_DEV_RAM_DAX * CLK_PPC_CORENET -> CLK_QORIQ * EXT2_FS_XIP -

[PATCH 2/3] powerpc: fix typo in comment reference to CONFIG_TRACE_IRQFLAGS

2016-07-04 Thread Andrew Donnellan
Signed-off-by: Andrew Donnellan --- arch/powerpc/kernel/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 3cb46a3..58217ae 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -250,7 +250,7 @@

[PATCH 1/3] powerpc/ps3: fix typo in comment reference to CONFIG_PS3_REPOSITORY_WRITE

2016-07-04 Thread Andrew Donnellan
Signed-off-by: Andrew Donnellan --- arch/powerpc/platforms/ps3/repository.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c index bfccdc7..814a7ea 100644 --- a/arch/powerpc/platforms/ps3/reposit

Re: [2/2] tty/hvc: Use opal irqchip interface if available

2016-07-04 Thread Samuel Mendoza-Jonas
On Tue, 2016-07-05 at 15:31 +1000, Michael Ellerman wrote: > On Tue, 2016-28-06 at 03:11:39 UTC, Sam Mendoza-Jonas wrote: > > diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c > > index b7cd0ae..8c53f5b 100644 > > --- a/drivers/tty/hvc/hvc_opal.c > > +++ b/drivers/tty/hvc/hvc_opa

Re: [PATCH 1/3] spapr: Disable ibm, pa-features HTM bit

2016-07-04 Thread David Gibson
On Tue, Jul 05, 2016 at 03:19:22PM +1000, Sam Bobroff wrote: > There are a few issues with our handling of the ibm,pa-features > HTM bit: > > - We don't support transactional memory in PR KVM, so don't tell > the OS that we do. > > - In full emulation we have a minimal implementation of HTM tha

Re: [RESEND, v2] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-04 Thread Michael Ellerman
On Wed, 2016-06-04 at 07:00:12 UTC, Simon Guo wrote: > These 2 fields track whether user process has used Altivec/VSX > registers or not. They are used by kernel to setup signal frame > on user stack correctly regarding vector part. > > CRIU(Checkpoint and Restore In User space) builds signal fram

Re: [1/2] tty/hvc: Use IRQF_SHARED for OPAL hvc consoles

2016-07-04 Thread Michael Ellerman
On Tue, 2016-28-06 at 03:11:38 UTC, Sam Mendoza-Jonas wrote: > Commit 2def86a7200c > ("hvc: Convert to using interrupts instead of opal events") > enabled the use of interrupts in the hvc_driver for OPAL platforms. > However on machines with more than one hvc console, any console after > the first

[PATCH 22/41] powerpc/mm: Move hash table ops to a separate structure

2016-07-04 Thread Benjamin Herrenschmidt
Moving probe_machine() to after mmu init will cause the ppc_md fields relative to the hash table management to be overwritten. Since we have essentially disconnected the machine type from the hash backend ops, finish the job by moving them to a different structure. The only callback that didn't q

[PATCH 11/41] powerpc/dart: Use a cachable DART

2016-07-04 Thread Benjamin Herrenschmidt
Instead of punching a hole in the linear mapping, just use normal cachable memory, and apply the flush sequence documented in the CPC625 (aka U3) user manual. This allows us to remove quite a bit of code related to the early allocation of the DART and the hole in the linear mapping. We can also ge

[PATCH 12/41] powerpc: Move FW feature probing out of pseries probe()

2016-07-04 Thread Benjamin Herrenschmidt
We move the function itself to pseries/firmware.c and call it along with almost all other flat device-tree parsers from early_init_devtree() Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/firmware.h | 4 +++ arch/powerpc/kernel/prom.c| 6 + arch/po

[PATCH 33/41] powerpc/64: Move the content of setup_system() to setup_arch()

2016-07-04 Thread Benjamin Herrenschmidt
And kill setup_system() Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/head_64.S | 5 +- arch/powerpc/kernel/setup_64.c | 137 +++-- 2 files changed, 64 insertions(+), 78 deletions(-) diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc

[PATCH 14/41] powerpc/pmac: Remove early allocation of the SMU command buffer

2016-07-04 Thread Benjamin Herrenschmidt
The SMU command buffer needs to be allocated below 2G using memblock. In the past, this had to be done very early from the arch code as memblock wasn't available past that point. That is no longer the case though, smu_init() is called from setup_arch() when memblock is still functional these days.

[PATCH 31/41] powerpc/64: Move the boot time info banner to a separate function

2016-07-04 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup_64.c | 66 ++ 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index a49cb17..d8f5f48 100644 --- a/arch/powerp

[PATCH 16/41] powerpc/pasemi: Remove IOBMAP allocation from platform probe()

2016-07-04 Thread Benjamin Herrenschmidt
These days, memblocks is available later, so we can just allocate it as part of iob_init. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/platforms/pasemi/iommu.c | 15 +-- arch/powerpc/platforms/pasemi/pasemi.h | 1 - arch/powerpc/platforms/pasemi/setup.c | 2 -- 3 files

[PATCH 34/41] powerpc/32: Move cache info inits to a separate function

2016-07-04 Thread Benjamin Herrenschmidt
Matches 64-bit. Also move the call to the same spot as ppc64 Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup_32.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c

[PATCH 23/41] powerpc: Ensure that ppc_md is empty before probing for machine type

2016-07-04 Thread Benjamin Herrenschmidt
Anything in there will be overwritten, so it helps catching nasty bugs if we check that it's indeed full of NULL's before we do so. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup-common.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/powerpc/kernel/se

[PATCH 20/41] powerpc/mm/hash64: Don't test for machine type to detect HEA special case

2016-07-04 Thread Benjamin Herrenschmidt
Instead, check for FW_FEATURE_SPLPAR. This should be roughtly equivalent as all pseries machiens that can have an HEA also support SPLPAR and no other machine type does. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/mm/hash_utils_64.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deleti

[PATCH 10/41] powerpc: Add comment explaining the purpose of setup_kdump_trampoline()

2016-07-04 Thread Benjamin Herrenschmidt
Anything in early_setup() needs to be justified to be there, in this case, we need the trampolines before we can take exceptions and thus before we turn on the MMU. Also remove a pretty meaningless and misplaced debug message Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup_6

[PATCH 26/41] powerpc/85xx/ge_imp3a: Don't use the flat device-tree after boot

2016-07-04 Thread Benjamin Herrenschmidt
ge_imp3a_pic_init() is called way beyond the unflattening of the tree, it shouldn't be using of_flat_dt_* Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/platforms/85xx/ge_imp3a.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/85xx/ge_imp3a.c

[PATCH 27/41] powerpc/85xx/mpc85xx_ds: Don't use the flat device-tree after boot

2016-07-04 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/platforms/85xx/mpc85xx_ds.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index f858306..64a7e8c 100644 --- a/arch/powerpc/platforms

Re: [2/2] tty/hvc: Use opal irqchip interface if available

2016-07-04 Thread Michael Ellerman
On Tue, 2016-28-06 at 03:11:39 UTC, Sam Mendoza-Jonas wrote: > diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c > index b7cd0ae..8c53f5b 100644 > --- a/drivers/tty/hvc/hvc_opal.c > +++ b/drivers/tty/hvc/hvc_opal.c > @@ -214,7 +216,15 @@ static int hvc_opal_probe(struct platform_

[PATCH 3/3] spapr: Set ibm, pa-features HTM from KVM_CAP_PPC_HTM

2016-07-04 Thread Sam Bobroff
Advertise HTM support in ibm, pa-features if KVM indicates support when queried via a new capability (KVM_CAP_PPC_HTM). If KVM returns false for the capability (which may indicate that the host kernel doesn't support the capability itself) attempt to determine availability using a fallback method

[PATCH 0/3] Rework spapr: Better handling of ibm, pa-features TM bit

2016-07-04 Thread Sam Bobroff
Hi David, Anton asked me to have a look at this, so here is an attempt at a re-implementation of his: "spapr: Better handling of ibm, pa-features TM bit" addressing your comments and those from Paul Mackerras. I've broken the patch into one to unconditionally disable the HTM bit in pa-features a

[PATCH 2/3] Add KVM_CAP_PPC_HTM to linux/kvm.h

2016-07-04 Thread Sam Bobroff
Signed-off-by: Sam Bobroff --- linux-headers/linux/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index e60e21b..37cb3e8 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -866,6 +866,7 @@ struct kvm_ppc_smmu_

[PATCH 1/3] spapr: Disable ibm, pa-features HTM bit

2016-07-04 Thread Sam Bobroff
There are a few issues with our handling of the ibm,pa-features HTM bit: - We don't support transactional memory in PR KVM, so don't tell the OS that we do. - In full emulation we have a minimal implementation of HTM that always fails, so for performance reasons lets not tell the OS that we

Re: [v2,1/2] refactor code parsing size based on memory range

2016-07-04 Thread Michael Ellerman
> On 06/24/2016 10:56 AM, Michael Ellerman wrote: >> On Wed, 2016-22-06 at 19:25:26 UTC, Hari Bathini wrote: ... > While the code is moved to kernel/params.c file, there is no change in logic > for crashkernel parameter parsing as the moved code is invoked with function > calls at appropriate plac

Re: [PATCH 36/41] powerpc: Re-order setup_panic()

2016-07-04 Thread Benjamin Herrenschmidt
On Tue, 2016-07-05 at 15:04 +1000, Benjamin Herrenschmidt wrote: > Do it right after probe_machine() since it's about testing ppc_md, > and put the test in the common code. Ignore the second copy of that patch,  they are identical, my SSH tunnel broke down half way through sending the series. Che

Re: [PATCH] powerpc/pci: Fix build with PCI_IOV=y and EEH=n

2016-07-04 Thread Benjamin Herrenschmidt
On Tue, 2016-07-05 at 14:30 +1000, Russell Currey wrote: > On Tue, 2016-07-05 at 14:13 +1000, Michael Ellerman wrote: > > Despite attempting to fix this in commit fb36e9073693 > ("powerpc/pci: Fix > > SRIOV not building without EEH enabled"), the build is still broken > when > > PCI_IOV=y and EEH=n

[PATCH 41/41] powerpc: Fix build with CONFIG_MEMORY_HOTPLUG on some configs

2016-07-04 Thread Benjamin Herrenschmidt
For memory hotplug to work, the MMU code needs to provide the functions create_section_mapping() and remove_section_mapping() to respectively map and unmap portions of the linear mapping. At the moment only hash64 provides these, so we provide weak stubs that just error out. This fixes the build w

[PATCH 40/41] powerpc/pci: Fix build of Book3E/64 without EEH

2016-07-04 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/pci_dn.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index ecdccce..4fc6ede 100644 --- a/arch/powerpc/kernel/pci_dn.c +++ b/arch/powerpc/ke

[PATCH 39/41] powerpc/mm: Fix build of Book3E/64 with 64K pages

2016-07-04 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/nohash/64/pgtable-64k.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/include/asm/nohash/64/pgtable-64k.h b/arch/powerpc/include/asm/nohash/64/pgtable-64k.h index 570fb30..9083245 100644 --- a/arch/powerpc/incl

[PATCH 38/41] powerpc: Merge 32-bit and 64-bit setup_arch()

2016-07-04 Thread Benjamin Herrenschmidt
There is little enough differences now. Use a few __weak stubs for functions that may not be around in order to avoid too many ifdefs. Signed-off-by: Benjamin Herrenschmidt --- v2. Fix include problems with kvm_ppc.h on some CPU archs v3. Give up on fixing include problems and move the prototype

[PATCH 37/41] powerpc/64: Make a few boot functions __init

2016-07-04 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup_64.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index bb1b65e..46787d9 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/

[PATCH 36/41] powerpc: Re-order setup_panic()

2016-07-04 Thread Benjamin Herrenschmidt
Do it right after probe_machine() since it's about testing ppc_md, and put the test in the common code. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup-common.c | 2 ++ arch/powerpc/kernel/setup_32.c | 5 ++--- arch/powerpc/kernel/setup_64.c | 5 ++--- 3 files changed

Re: [PATCH 2/2] qe/ic: refactor qe_ic to simplify

2016-07-04 Thread Jason Cooper
Hi Zhao Qiang, Same comment as previous patch regarding the subject line. On Tue, Jul 05, 2016 at 09:46:59AM +0800, Zhao Qiang wrote: > there are init_qe_ic_sysfs and qeic_of_init, refactor > them. Same comment from previous patch about commit log. > > Signed-off-by: Zhao Qiang > --- > drive

[PATCH 36/41] powerpc: Re-order setup_panic()

2016-07-04 Thread Benjamin Herrenschmidt
Do it right after probe_machine() since it's about testing ppc_md, and put the test in the common code. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup-common.c | 2 ++ arch/powerpc/kernel/setup_32.c | 5 ++--- arch/powerpc/kernel/setup_64.c | 5 ++--- 3 files changed

[PATCH 35/41] powerpc: Re-order the call to smp_setup_cpu_maps()

2016-07-04 Thread Benjamin Herrenschmidt
It makes more sense to do it before intializing xmon() as xmon might use the info in there. We do want to register the console early though in case we want some functioning printk's in the cpu map setup. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup_32.c | 4 ++-- arch/powe

[PATCH 29/41] powerpc: Move 32-bit probe() machine to later in the boot process

2016-07-04 Thread Benjamin Herrenschmidt
This converts all the 32-bit platforms to use the expanded device-tree which is a pretty mechanical change. Unlike 64-bit, the 32-bit kernel didn't rely on platform initializations to setup the MMU since it sets it up entirely before probe_machine() so the move has comparatively less consequences t

[PATCH 32/41] powerpc/64: Move setting of {i, d}cache_bsize to initialize_cache_info()

2016-07-04 Thread Benjamin Herrenschmidt
Also remove the completely osbolete comment. We *do* look in the device-tree. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup_64.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c

[PATCH 30/41] powerpc: Get rid of ppc_md.init_early()

2016-07-04 Thread Benjamin Herrenschmidt
It is now called right after platform probe, so the probe function can just do the job. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/machdep.h| 1 - arch/powerpc/kernel/setup_32.c| 3 --- arch/powerpc/kernel/setup_64.c| 8 -

[PATCH 25/41] powerpc/cell: Don't use flat device-tree after boot

2016-07-04 Thread Benjamin Herrenschmidt
Some bit of SPU code was using the FDT rather than the expanded device-tree. Fix it. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/platforms/cell/spu_manage.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/p

[PATCH 28/41] powerpc/85xx/mpc85xx_rdb: Don't use the flat device-tree after boot

2016-07-04 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c index 3f4dad1..761e504 100644 --- a/arch/powerpc/platfor

[PATCH 24/41] powerpc: Move 64-bit probe_machine() to later in the boot process

2016-07-04 Thread Benjamin Herrenschmidt
We no long need the machine type that early, so we can move probe_machine() to after the device-tree has been expanded. This will allow further consolidation. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup_64.c | 6 +++--- arch/powerpc/platforms/cell/setup.c | 6

[PATCH 21/41] powerpc/pmac: Remove spurrious machine type test

2016-07-04 Thread Benjamin Herrenschmidt
pmac_declare_of_platform_devices() is already a machine initcall, thus it won't be called on a non-powermac machine. Testing for chrp there is pointless. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/platforms/powermac/setup.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/p

[PATCH 19/41] powerpc: Don't test for machine type in smp_setup_cpu_maps()

2016-07-04 Thread Benjamin Herrenschmidt
The subsequent test for RTAS along with the LPAR test are sufficient Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 8ca

[PATCH 15/41] powerpc/64: Move MMU backend selection out of platform code

2016-07-04 Thread Benjamin Herrenschmidt
We move it into early_mmu_init() based on firmware features. For PS3, we have to move the setting of these into early_init_devtree(). Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/ps3.h | 2 ++ arch/powerpc/kernel/prom.c | 7 +++ arch/powerpc/mm/h

[PATCH 17/41] powerpc/mm/hash: Don't use machine_is() early during boot

2016-07-04 Thread Benjamin Herrenschmidt
Use the device-tree instead as we'll be moving probe_machine() out of early_setup Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/mm/hash_utils_64.c | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerp

[PATCH 18/41] powerpc/rtas: Don't test for machine type in rtas_initialize()

2016-07-04 Thread Benjamin Herrenschmidt
The test is unnecessary, the FW_FEATURE_LPAR is sufficient as there exist no other LPAR type that has RTAS. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/rtas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rt

[PATCH 13/41] powerpc: Put exception configuration in a common place

2016-07-04 Thread Benjamin Herrenschmidt
The various calls to establish exception endianness and AIL are now done from a single point using already established CPU and FW feature bits to decide what to do. Signed-off-by: Benjamin Herrenschmidt --- v3: Rework a bit, move error handling in the functions themselves and fix a few more case

[PATCH 07/41] powerpc: Move 64-bit memory reserves to setup_arch()

2016-07-04 Thread Benjamin Herrenschmidt
There is really no need to do them that early, early_setup() runs before MMU is on, we should do the strict minimum there to get the MMU going. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/setup_64.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-)

[PATCH 09/41] powerpc: Update obsolete comments in setup_32.c about entry conditions

2016-07-04 Thread Benjamin Herrenschmidt
early_init() is called in-place before kernel relocation and using whatever MMU setup exists at the point the kernel is entered. machine_init() is called after relocation and after some initial mapping of PAGE_OFFSET has been established (typically using BATs on 6xx/7xx/7xxx processors or some for

[PATCH 08/41] powerpc: Move epapr_paravirt_early_init() to early_init_devtree()

2016-07-04 Thread Benjamin Herrenschmidt
The function is called by both 32-bit and 64-bit early setup right after early_init_devtree(). All it does is run yet another early DT parser which is precisely what early_init_devtree() is about, so move it in there. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom.c | 2 +

[PATCH 03/41] powerpc/prom_init: PTRRELOC is not needed

2016-07-04 Thread Benjamin Herrenschmidt
There's one line of code still using PTRRELOC in prom_init, it shouldn't be necessary since that code is relocatable. Take it out. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/pro

[PATCH 06/41] powerpc: Move 64-bit feature fixup earlier

2016-07-04 Thread Benjamin Herrenschmidt
Make it part of early_setup() as we really want the feature fixups to be applied before we turn on the MMU since they can have an impact on the various assembly path related to MMU management and interrupts. This makes 64-bit match what 32-bit does. Signed-off-by: Benjamin Herrenschmidt --- arc

[PATCH 05/41] powerpc: Factor do_feature_fixup calls

2016-07-04 Thread Benjamin Herrenschmidt
32 and 64-bit do a similar set of calls early on, we move it all to a single common function to make the boot code more readable. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/feature-fixups.h | 4 arch/powerpc/include/asm/synch.h | 1 - arch/powerpc/kernel/s

[PATCH 04/41] powerpc: Make PTRRELOC() 32-bit only

2016-07-04 Thread Benjamin Herrenschmidt
PTRRELOC is only used by 32-bit code since on 32-bit systems, early_init can be run with relocation off and running at an offset. Define it to identity on 64-bit Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/setup.h | 4 1 file changed, 4 insertions(+) diff --git a/arc

[PATCH 01/41] dt: Add of_device_compatible_match()

2016-07-04 Thread Benjamin Herrenschmidt
This provides an equivalent of of_fdt_match() for non-flat trees. This is more practical than matching an array of of_device_id structs when converting a bunch of existing users of of_fdt_match(). Signed-off-by: Benjamin Herrenschmidt --- drivers/of/base.c | 22 ++ include/

[PATCH 02/41] drm: Fix broken use of _PAGE_NO_CACHE on powerpc

2016-07-04 Thread Benjamin Herrenschmidt
That constant no longer exist. Use the proper accessor instead Signed-off-by: Benjamin Herrenschmidt --- drivers/gpu/drm/drm_memory.c | 2 +- drivers/gpu/drm/drm_scatter.c | 2 +- drivers/gpu/drm/drm_vm.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/

[PATCH v2 00/41] Reorganize setup code and merge 32 and 64-bit setup_arch()

2016-07-04 Thread Benjamin Herrenschmidt
This series reorganizes the setup code, moving probe_machine() later than when it's currently done, and sync'ing 32-bit and 64-bit enough to merge their implementations of setup_arch(). We get rid of ppc64 setup_system() which is subsumed by the new setup_arch(). Note: The first 2 patches could go

Re: [PATCH] powerpc/pci: Fix build with PCI_IOV=y and EEH=n

2016-07-04 Thread Russell Currey
On Tue, 2016-07-05 at 14:13 +1000, Michael Ellerman wrote: > Despite attempting to fix this in commit fb36e9073693 ("powerpc/pci: Fix > SRIOV not building without EEH enabled"), the build is still broken when > PCI_IOV=y and EEH=n (eg. g5_defconfig with PCI_IOV=y): > >   arch/powerpc/kernel/pci_dn

Re: [PATCH 1/2] qe/ic: move qe_ic_init from platforms to irqchip

2016-07-04 Thread Jason Cooper
Hi Zhao Qiang, Please reword your subject line to conform to the standard in irqchip (since that's where the code is added). Also, please adjust the subject line to express *why* the change is being made. On Tue, Jul 05, 2016 at 09:46:58AM +0800, Zhao Qiang wrote: > The codes of qe_ic_init in pl

[PATCH 2/2] qe/ic: refactor qe_ic to simplify

2016-07-04 Thread Zhao Qiang
there are init_qe_ic_sysfs and qeic_of_init, refactor them. Signed-off-by: Zhao Qiang --- drivers/irqchip/qe_ic.c| 83 +- include/soc/fsl/qe/qe_ic.h | 7 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/drivers/irqchip/qe_ic.c

[PATCH] powerpc/pci: Fix build with PCI_IOV=y and EEH=n

2016-07-04 Thread Michael Ellerman
Despite attempting to fix this in commit fb36e9073693 ("powerpc/pci: Fix SRIOV not building without EEH enabled"), the build is still broken when PCI_IOV=y and EEH=n (eg. g5_defconfig with PCI_IOV=y): arch/powerpc/kernel/pci_dn.c: In function ‘remove_dev_pci_data’: arch/powerpc/kernel/pci_dn.c

Re: [PATCH v2] cxl: Refine slice error debug messages

2016-07-04 Thread Ian Munsie
I agree with Mikey - this needs a description. But otherwise it looks good to me, and I'll be happy if it stops any more AFU developers from reporting their bugs to us, so happy to add this now: Acked-by: Ian Munsie Excerpts from Philippe Bergheaud's message of 2016-07-04 17:07:36 +0200: > Signe

Re: [PATCH 5/6] powerpc/perf: Power9 PMU support

2016-07-04 Thread Madhavan Srinivasan
On Tuesday 05 July 2016 06:30 AM, Michael Neuling wrote: > On Sun, 2016-06-26 at 23:07 +0530, Madhavan Srinivasan wrote: > > There is still identical code here between power8 and power9. Any reason > you can't merge these too? The two bhrb functions seem to be the same. In PowerISA v3.0, more bh

Re: [PATCH] powerpc: fix oops in pcibios_release_device() after pcibios_free_controller()

2016-07-04 Thread Benjamin Herrenschmidt
On Mon, 2016-07-04 at 22:44 -0300, Mauricio Faria de Oliveira wrote: > It's possible to hit an oops/crash if pcibios_release_device() accesses the > phb struct and it had been freed earlier -- by pcibios_free_controller() -- > as the memory it pointed to can be reused. > > If after reuse 'phb->con

[PATCH 1/2] qe/ic: move qe_ic_init from platforms to irqchip

2016-07-04 Thread Zhao Qiang
The codes of qe_ic_init in platforms are redundant, move them to qe_ic under irqchip Signed-off-by: Zhao Qiang --- arch/powerpc/platforms/83xx/misc.c| 15 --- arch/powerpc/platforms/85xx/corenet_generic.c | 9 - arch/powerpc/platforms/85xx/mpc85xx_mds.c | 14

Re: [PATCH 5/6] powerpc/perf: Power9 PMU support

2016-07-04 Thread Michael Neuling
On Sun, 2016-06-26 at 23:07 +0530, Madhavan Srinivasan wrote: > There is still identical code here between power8 and power9. Any reason you can't merge these too?  The two bhrb functions seem to be the same. Mikey > This patch adds base enablement for the power9 PMU. > > Signed-off-by: Madha

Re: [PATCH 04/14] cxl: Move cxl_afu_get / cxl_afu_put to base

2016-07-04 Thread Andrew Donnellan
On 04/07/16 23:22, Ian Munsie wrote: From: Ian Munsie The Mellanox CX4 uses a model where the AFU is one physical function of the device, and is used by other peer physical functions of the same device. This will require those other devices to grab a reference on the AFU when they are initialis

Re: [PATCH V2] powerpc/mm: Add validation for platform reserved memory ranges

2016-07-04 Thread Michael Ellerman
Anshuman Khandual writes: > For partition running on PHYP, there can be a adjunct partition > which shares the virtual address range with the operating system. > Virtual address ranges which can be used by the adjunct partition > are communicated with virtual device node of the device tree with >

[PATCH] powerpc: fix oops in pcibios_release_device() after pcibios_free_controller()

2016-07-04 Thread Mauricio Faria de Oliveira
It's possible to hit an oops/crash if pcibios_release_device() accesses the phb struct and it had been freed earlier -- by pcibios_free_controller() -- as the memory it pointed to can be reused. If after reuse 'phb->controller_ops.release_device' is non-NULL it will be called, but it points to an

[PATCH v2] powerpc/mm: Add a parameter to disable 1TB segs

2016-07-04 Thread Oliver O'Halloran
This patch adds the kernel command line parameter "no_tb_segs" which forces the kernel to use 256MB rather than 1TB segments. Forcing the use of 256MB segments makes it considerably easier to test code that depends on an SLB miss occurring. Suggested-by: Michael Neuling Suggested-by: Michael Elle

Re: [PATCH v3 3/4] perf annotate: add powerpc support

2016-07-04 Thread Ravi Bangoria
Hi Michael, On Friday 01 July 2016 02:13 PM, Ravi Bangoria wrote: Thanks Michael for your suggestion. On Thursday 30 June 2016 11:51 AM, Michael Ellerman wrote: On Thu, 2016-06-30 at 11:44 +0530, Ravi Bangoria wrote: diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 3

Re: [RFC] arm64: kexec_file_load support

2016-07-04 Thread Dave Young
On 07/04/16 at 03:58pm, AKASHI Takahiro wrote: > Hi, > > On Fri, Jul 01, 2016 at 12:46:31PM -0300, Thiago Jung Bauermann wrote: > > Am Freitag, 01 Juli 2016, 14:11:12 schrieb AKASHI Takahiro: > > > I'm not sure whether there is any demand for kexec_file_load > > > support on arm64, but anyhow I'm

Re: [PATCH 12/14] PCI/hotplug: pnv_php: export symbols and move struct types needed by cxl

2016-07-04 Thread Andrew Donnellan
On 05/07/16 10:03, Gavin Shan wrote: Andrew/Ian, it seems HOTPLUG_PCI_POWERNV_BASE isn't defined and we needn't it. Argh, thanks for picking that up! I removed that option and all its occurrences in the code based on your earlier private feedback but forgot to drop this. Will fix in V2. --

Re: [PATCH v3 2/9] kexec_file: Generalize kexec_add_buffer.

2016-07-04 Thread Dave Young
On 07/01/16 at 05:31pm, Thiago Jung Bauermann wrote: > Am Freitag, 01 Juli 2016, 17:02:23 schrieb Thiago Jung Bauermann: > > Am Freitag, 01 Juli 2016, 14:36:02 schrieb Dave Young: > > > On 07/01/16 at 02:51pm, Thiago Jung Bauermann wrote: > > > > Am Donnerstag, 30 Juni 2016, 17:43:57 schrieb Dave Y

Re: powerpc/mm: Add a parameter to disable 1TB segs

2016-07-04 Thread oliver
On Tue, Jul 5, 2016 at 10:24 AM, Michael Neuling wrote: > On Mon, 2016-07-04 at 16:09 +1000, Michael Ellerman wrote: >> On Mon, 2016-04-07 at 00:44:04 UTC, Oliver O'Halloran wrote: >> > >> > This patch adds the kernel command line parameter "no_tb_segs" which >> > forces the kernel to use 256MB ra

Re: powerpc/mm: Add a parameter to disable 1TB segs

2016-07-04 Thread Michael Neuling
On Mon, 2016-07-04 at 16:09 +1000, Michael Ellerman wrote: > On Mon, 2016-04-07 at 00:44:04 UTC, Oliver O'Halloran wrote: > > > > This patch adds the kernel command line parameter "no_tb_segs" which > > forces the kernel to use 256MB rather than 1TB segments. Forcing the > > use > > of 256MB segme

Re: [PATCH 12/14] PCI/hotplug: pnv_php: export symbols and move struct types needed by cxl

2016-07-04 Thread Gavin Shan
On Mon, Jul 04, 2016 at 11:22:10PM +1000, Ian Munsie wrote: >From: Andrew Donnellan > >The cxl driver will use infrastructure from pnv_php to handle device tree >updates when switching bi-modal CAPI cards into CAPI mode. > >To enable this, export pnv_php_find_slot() and >pnv_php_set_slot_power_sta

Re: [PATCH v2] cxl: Refine slice error debug messages

2016-07-04 Thread Michael Neuling
This needs a description.  How are you "refining it? Mikey On Mon, 2016-07-04 at 17:07 +0200, Philippe Bergheaud wrote: > Signed-off-by: Philippe Bergheaud > --- > Changes since v1: >   - Rebased on Ian's patch > "cxl: Abstract the differences between the PSL and XSL" > >  drivers/misc/cxl

Re: [RFC] arm64: kexec_file_load support

2016-07-04 Thread Thiago Jung Bauermann
Hello, Am Montag, 04 Juli 2016, 15:58:15 schrieb AKASHI Takahiro: > On Fri, Jul 01, 2016 at 12:46:31PM -0300, Thiago Jung Bauermann wrote: > > I agree that it would be better if we could have a system call where a > > > custom device tree could be passed. One suggestion is: > For powerpc, you mig

Re: [PATCH] perf/core: Fix the mask in perf_output_sample_regs

2016-07-04 Thread Arnaldo Carvalho de Melo
Em Mon, Jul 04, 2016 at 10:19:06AM +0300, Yury Norov escreveu: > On Sun, Jul 03, 2016 at 11:31:58PM +0530, Madhavan Srinivasan wrote: > > When decoding the perf_regs mask in perf_output_sample_regs(), > > we loop through the mask using find_first_bit and find_next_bit functions. > > While the exisi

Re: [PATCH v2] cxl: Refine slice error debug messages

2016-07-04 Thread Frederic Barrat
Le 04/07/2016 17:07, Philippe Bergheaud a écrit : Signed-off-by: Philippe Bergheaud --- Changes since v1: - Rebased on Ian's patch "cxl: Abstract the differences between the PSL and XSL" Thanks! Reviewed-by: Frederic Barrat ___ Linuxppc-d

RE: [PATCH][v2] driver/memory: Update dependency of IFC for Layerscape

2016-07-04 Thread Raghav Dogra
Scott uses the updated email id and is already added. Regards, Raghav > -Original Message- > From: Benjamin Herrenschmidt [mailto:b...@kernel.crashing.org] > Sent: Monday, July 04, 2016 3:19 PM > To: Boris Brezillon ; Raghav Dogra > ; Paul Mackerras ; Michael > Ellerman ; Scott Wood >

[PATCH v2] cxl: Refine slice error debug messages

2016-07-04 Thread Philippe Bergheaud
Signed-off-by: Philippe Bergheaud --- Changes since v1: - Rebased on Ian's patch "cxl: Abstract the differences between the PSL and XSL" drivers/misc/cxl/cxl.h| 15 +++ drivers/misc/cxl/guest.c | 9 ++--- drivers/misc/cxl/irq.c| 29 + d

[PATCH 10/14] cxl: Add support for interrupts on the Mellanox CX4

2016-07-04 Thread Ian Munsie
From: Ian Munsie The Mellanox CX4 in cxl mode uses a hybrid interrupt model, where interrupts are routed from the networking hardware to the XSL using the MSIX table, and from there will be transformed back into an MSIX interrupt using the cxl style interrupts (i.e. using IVTE entries and ranges

[PATCH 04/14] cxl: Move cxl_afu_get / cxl_afu_put to base

2016-07-04 Thread Ian Munsie
From: Ian Munsie The Mellanox CX4 uses a model where the AFU is one physical function of the device, and is used by other peer physical functions of the same device. This will require those other devices to grab a reference on the AFU when they are initialised to make sure that it does not go awa

[PATCH 02/14] cxl: Add cxl_slot_is_supported API

2016-07-04 Thread Ian Munsie
From: Ian Munsie This extends the check that the adapter is in a CAPI capable slot so that it may be called by external users in the kernel API. This will be used by the upcoming Mellanox CX4 support, which needs to know ahead of time if the card can be switched to cxl mode so that it can leave i

[PATCH 14/14] cxl: Add cxl_check_and_switch_mode() API to switch bi-modal cards

2016-07-04 Thread Ian Munsie
From: Andrew Donnellan Add a new API, cxl_check_and_switch_mode() to allow for switching of bi-modal CAPI cards, such as the Mellanox CX-4 network card. When a driver requests to switch a card to CAPI mode, use PCI hotplug infrastructure to remove all PCI devices underneath the slot. We then wri

[PATCH 13/14] PCI/hotplug: pnv_php: handle OPAL_PCI_SLOT_OFFLINE power state

2016-07-04 Thread Ian Munsie
From: Andrew Donnellan When calling pnv_php_set_slot_power_state() with state == OPAL_PCI_SLOT_OFFLINE, remove devices from the device tree as if we're dealing with OPAL_PCI_SLOT_POWER_OFF. Cc: Gavin Shan Cc: linux-...@vger.kernel.org Cc: Bjorn Helgaas Signed-off-by: Andrew Donnellan Acked-by

[PATCH 12/14] PCI/hotplug: pnv_php: export symbols and move struct types needed by cxl

2016-07-04 Thread Ian Munsie
From: Andrew Donnellan The cxl driver will use infrastructure from pnv_php to handle device tree updates when switching bi-modal CAPI cards into CAPI mode. To enable this, export pnv_php_find_slot() and pnv_php_set_slot_power_state(), and add corresponding declarations, as well as the definition

[PATCH 11/14] cxl: Workaround PE=0 hardware limitation in Mellanox CX4

2016-07-04 Thread Ian Munsie
From: Ian Munsie The CX4 card cannot cope with a context with PE=0 due to a hardware limitation, resulting in: [ 34.166577] command failed, status limits exceeded(0x8), syndrome 0x5a7939 [ 34.166580] mlx5_core :01:00.1: Failed allocating uar, aborting Since the kernel API allocates a de

[PATCH 09/14] cxl: Add preliminary workaround for CX4 interrupt limitation

2016-07-04 Thread Ian Munsie
From: Ian Munsie The Mellanox CX4 has a hardware limitation where only 4 bits of the AFU interrupt number can be passed to the XSL when sending an interrupt, limiting it to only 15 interrupts per context (AFU interrupt number 0 is invalid). In order to overcome this, we will allocate additional

[PATCH 08/14] cxl: Add kernel APIs to get & set the max irqs per context

2016-07-04 Thread Ian Munsie
From: Ian Munsie These APIs will be used by the Mellanox CX4 support. While they function standalone to configure existing behaviour, their primary purpose is to allow the Mellanox driver to inform the cxl driver of a hardware limitation, which will be used in a future patch. Signed-off-by: Ian

[PATCH 07/14] cxl: Add support for using the kernel API with a real PHB

2016-07-04 Thread Ian Munsie
From: Ian Munsie This hooks up support for using the kernel API with a real PHB. After the AFU initialisation has completed it calls into the PHB code to pass it the AFU that will be used by other peer physical functions on the adapter. The cxl_pci_to_afu API is extended to work with peer PCI de

[PATCH 06/14] powerpc/powernv: Add support for the cxl kernel api on the real phb

2016-07-04 Thread Ian Munsie
From: Ian Munsie This adds support for the peer model of the cxl kernel api to the PowerNV PHB, and exports APIs to enable the mode, check if a PCI device is attached to a PHB in this mode, and to set and get the peer AFU for this mode. The cxl driver will enable this mode for supported cards by

[PATCH 05/14] cxl: Allow a default context to be associated with an external pci_dev

2016-07-04 Thread Ian Munsie
From: Ian Munsie The cxl kernel API has a concept of a default context associated with each PCI device under the virtual PHB. The Mellanox CX4 will also use the cxl kernel API, but it does not use a virtual PHB - rather, the AFU appears as a physical function as a peer to the networking functions

[PATCH 03/14] cxl: Enable bus mastering for devices using CAPP DMA mode

2016-07-04 Thread Ian Munsie
From: Ian Munsie Devices that use CAPP DMA mode (such as the Mellanox CX4) require bus master to be enabled in order for the CAPI traffic to flow. This should be harmless to enable for other cxl devices, so unconditionally enable it in the adapter init flow. Signed-off-by: Ian Munsie --- drive

  1   2   >