Re: [PATCH V3 1/5] powerpc, perf: Add new BHRB related instructions for POWER8

2013-04-22 Thread Anshuman Khandual
On 04/22/2013 08:20 AM, Michael Neuling wrote: > Michael Ellerman wrote: > >> On Mon, Apr 22, 2013 at 11:13:43AM +1000, Michael Neuling wrote: >>> Michael Ellerman wrote: >>> On Thu, Apr 18, 2013 at 05:56:12PM +0530, Anshuman Khandual wrote: > This patch adds new POWER8 instruction enco

Re: [PATCH V3 1/5] powerpc, perf: Add new BHRB related instructions for POWER8

2013-04-22 Thread Anshuman Khandual
On 04/22/2013 08:20 AM, Michael Neuling wrote: > Michael Ellerman wrote: > >> On Mon, Apr 22, 2013 at 11:13:43AM +1000, Michael Neuling wrote: >>> Michael Ellerman wrote: >>> On Thu, Apr 18, 2013 at 05:56:12PM +0530, Anshuman Khandual wrote: > This patch adds new POWER8 instruction enco

Re: [PATCH 0/5] of_platform_driver and OF_DEVICE removal

2013-04-22 Thread Arnd Bergmann
On Monday 22 April 2013, Rob Herring wrote: > From: Rob Herring > > This series is a relatively straight-forward removal of the last remaining > user of of_platform_driver (ibmebus) and removal of CONFIG_OF_DEVICE which > is always enabled when CONFIG_OF is enabled. > > Compile tested on powerpc

[PATCH -V6 00/27] THP support for PPC64

2013-04-22 Thread Aneesh Kumar K.V
Hi, This patchset adds transparent hugepage support for PPC64. Some numbers: The latency measurements code from Anton found at http://ozlabs.org/~anton/junkcode/latency2001.c 64K page size (With THP support) -- [root@llmp24l02 test]# ./latency2001 8G 8589934592428.

[PATCH -V6 01/27] powerpc: Use signed formatting when printing error

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" PAPR defines these errors as negative values. So print them accordingly for easy debugging. Acked-by: Paul Mackerras Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/platforms/pseries/lpar.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/p

[PATCH -V6 02/27] powerpc: Save DAR and DSISR in pt_regs on MCE

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" We were not saving DAR and DSISR on MCE. Save then and also print the values along with exception details in xmon. Acked-by: Paul Mackerras Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kernel/exceptions-64s.S |9 + arch/powerpc/xmon/xmon.c

[PATCH -V6 03/27] powerpc: Don't hard code the size of pte page

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" USE PTRS_PER_PTE to indicate the size of pte page. To support THP, later patches will be changing PTRS_PER_PTE value. Acked-by: Paul Mackerras Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/pgtable.h |6 ++ arch/powerpc/mm/hash_low_64.S |

[PATCH -V6 04/27] powerpc: Don't truncate pgd_index wrongly

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" With PGD_INDEX_SIZE set to 12 the existing macro doesn't work. Fix it to use PTRS_PER_PGD The idea originally was to have one more bit in the result of pgd_index() than PGD_INDEX_SIZE, so that if one had an address corresponding to the last PGD entry, and then incremente

[PATCH -V6 05/27] powerpc: New hugepage directory format

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" Change the hugepage directory format so that we can have leaf ptes directly at page directory avoiding the allocation of hugepage directory. With the new table format we have 3 cases for pgds and pmds: (1) invalid (all zeroes) (2) pointer to next table, as normal; bottom

[PATCH -V6 06/27] powerpc: Switch 16GB and 16MB explicit hugepages to a different page table format

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" We will be switching PMD_SHIFT to 24 bits to facilitate THP impmenetation. With PMD_SHIFT set to 24, we now have 16MB huge pages allocated at PGD level. That means with 32 bit process we cannot allocate normal pages at all, because we cover the entire address space with o

[PATCH -V6 07/27] powerpc: Reduce the PTE_INDEX_SIZE

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" This make one PMD cover 16MB range. That helps in easier implementation of THP on power. THP core code make use of one pmd entry to track the hugepage and the range mapped by a single pmd entry should be equal to the hugepage size supported by the hardware. This also swi

[PATCH -V6 08/27] powerpc: Move the pte free routines from common header

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" This patch moves the common code to 32/64 bit headers and also duplicate 4K_PAGES and 64K_PAGES section. We will later change the 64 bit 64K_PAGES version to support smaller PTE fragments. The patch doesn't introduce any functional changes. Acked-by: Paul Mackerras Sign

[PATCH -V6 10/27] powerpc: Use encode avpn where we need only avpn values

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" In all these cases we are doing something similar to HPTE_V_COMPARE(hpte_v, want_v) which ignores the HPTE_V_LARGE bit With MPSS support we would need actual page size to set HPTE_V_LARGE bit and that won't be available in most of these cases. Since we are ignoring HPTE

[PATCH -V6 11/27] powerpc: Decode the pte-lp-encoding bits correctly.

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" We look at both the segment base page size and actual page size and store the pte-lp-encodings in an array per base page size. We also update all relevant functions to take actual page size argument so that we can use the correct PTE LP encoding in HPTE. This should also

[PATCH -V6 12/27] powerpc: Fix hpte_decode to use the correct decoding for page sizes

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" As per ISA doc, we encode base and actual page size in the LP bits of PTE. The number of bit used to encode the page sizes depend on actual page size. ISA doc lists this as PTE LP actual page size rrrz >=8KB rrzz >=16KB rzzz >=32K

[PATCH -V6 14/27] powerpc: Print page size info during boot

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" This gives hint about different base and actual page size combination supported by the platform. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/hash_utils_64.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/mm/hash_ut

[PATCH -V6 15/27] powerpc: Update tlbie/tlbiel as per ISA doc

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" Encode the actual page correctly in tlbie/tlbiel. This make sure we handle multiple page size segment correctly. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/hash_native_64.c | 32 ++-- 1 file changed, 30 insertions(+), 2 deletions(

[PATCH -V6 09/27] powerpc: Reduce PTE table memory wastage

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" We allocate one page for the last level of linux page table. With THP and large page size of 16MB, that would mean we are wasting large part of that page. To map 16MB area, we only need a PTE space of 2K with 64K page size. This patch reduce the space wastage by sharing t

[PATCH -V6 13/27] powerpc: print both base and actual page size on hash failure

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/mmu-hash64.h |3 ++- arch/powerpc/mm/hash_utils_64.c | 12 +++- arch/powerpc/mm/hugetlbpage-hash64.c |2 +- 3 files changed, 10 insertions(+), 7 deletions(-)

[PATCH -V6 17/27] mm/THP: Add pmd args to pgtable deposit and withdraw APIs

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" This will be later used by powerpc THP support. In powerpc we want to use pgtable for storing the hash index values. So instead of adding them to mm_context list, we would like to store them in the second half of pmd Cc: Andrea Arcangeli Reviewed-by: David Gibson Sign

[PATCH -V6 20/27] powerpc/THP: Implement transparent hugepages for ppc64

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" We now have pmd entries covering 16MB range and the PMD table double its original size. We use the second half of the PMD table to deposit the pgtable (PTE page). The depoisted PTE page is further used to track the HPTE information. The information include [ secondary g

[PATCH -V6 23/27] powerpc: Replace find_linux_pte with find_linux_pte_or_hugepte

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" Replace find_linux_pte with find_linux_pte_or_hugepte and explicitly document why we don't need to handle transparent hugepages at callsites. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/pgtable-ppc64.h | 24 arch/powerpc/kern

[PATCH -V6 16/27] mm/THP: HPAGE_SHIFT is not a #define on some arch

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" On archs like powerpc that support different hugepage sizes, HPAGE_SHIFT and other derived values like HPAGE_PMD_ORDER are not constants. So move that to hugepage_init Cc: Andrea Arcangeli Reviewed-by: David Gibson Signed-off-by: Aneesh Kumar K.V --- include/linux/h

[PATCH -V6 18/27] mm/THP: withdraw the pgtable after pmdp related operations

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" For architectures like ppc64 we look at deposited pgtable when calling pmdp_get_and_clear. So do the pgtable_trans_huge_withdraw after finishing pmdp related operations. Cc: Andrea Arcangeli Signed-off-by: Aneesh Kumar K.V --- mm/huge_memory.c |3 ++- 1 file chang

[PATCH -V6 25/27] powerpc/THP: Add code to handle HPTE faults for large pages

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" The deposted PTE page in the second half of the PMD table is used to track the state on hash PTEs. After updating the HPTE, we mark the coresponding slot in the deposted PTE page valid. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/mmu-hash64.h | 13 ++

[PATCH -V6 26/27] powerpc/THP: Enable THP on PPC64

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" We enable only if the we support 16MB page size. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/pgtable-ppc64.h |3 +-- arch/powerpc/mm/pgtable_64.c | 28 2 files changed, 29 insertions(+), 2 deletions(-) di

[PATCH -V6 21/27] powerpc: move find_linux_pte_or_hugepte and gup_hugepte to common code

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" We will use this in the later patch for handling THP pages Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/hugetlb.h |8 +- arch/powerpc/include/asm/pgtable-ppc64.h | 11 -- arch/powerpc/mm/Makefile |2 +- arch/powerpc/mm/hu

[PATCH -V6 22/27] powerpc: Update find_linux_pte_or_hugepte to handle transparent hugepages

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/hugetlbpage.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 29d8534..a4b0fa5 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b

[PATCH -V6 19/27] powerpc/THP: Double the PMD table size for THP

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" THP code does PTE page allocation along with large page request and deposit them for later use. This is to ensure that we won't have any failures when we split hugepages to regular pages. On powerpc we want to use the deposited PTE page for storing hash pte slot and seco

[PATCH -V6 24/27] powerpc: Update gup_pmd_range to handle transparent hugepages

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/gup.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/gup.c b/arch/powerpc/mm/gup.c index 4b921af..3d36fd7 100644 --- a/arch/powerpc/mm/gup.c +++ b/arch/powerpc/mm

[PATCH -V6 27/27] powerpc: Optimize hugepage invalidate

2013-04-22 Thread Aneesh Kumar K.V
From: "Aneesh Kumar K.V" Hugepage invalidate involves invalidating multiple hpte entries. Optimize the operation using H_BULK_REMOVE on lpar platforms. On native, reduce the number of tlb flush. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/machdep.h|3 + arch/powerpc/mm

[PATCH] powerpc/fsl-pci:fix incorrect iounmap pci hose->private_data

2013-04-22 Thread Roy Zang
pci hose->private_data will be used by other function, for example, fsl_pcie_check_link(), so do not iounmap it. fix the kerenl crash on T4240: Unable to handle kernel paging request for data at address 0x880080060f14 Faulting instruction address: 0xc0032554 Oops: Kernel access of bad

[PATCH v8 3/3] of/pci: mips: convert to common of_pci_range_parser

2013-04-22 Thread Andrew Murray
This patch converts the pci_load_of_ranges function to use the new common of_pci_range_parser. Signed-off-by: Andrew Murray Signed-off-by: Liviu Dudau Signed-off-by: Gabor Juhos Reviewed-by: Rob Herring Reviewed-by: Grant Likely Tested-by: Linus Walleij --- arch/mips/pci/pci.c | 51 ++

[PATCH v8 0/3] of/pci: Provide common support for PCI DT parsing

2013-04-22 Thread Andrew Murray
This patchset factors out duplicated code associated with parsing PCI DT "ranges" properties across the architectures and introduces a "ranges" parser. This parser "of_pci_range_parser" can be used directly by ARM host bridge drivers enabling them to obtain ranges from device trees. I've included

[PATCH v8 2/3] of/pci: Provide support for parsing PCI DT ranges property

2013-04-22 Thread Andrew Murray
This patch factors out common implementation patterns to reduce overall kernel code and provide a means for host bridge drivers to directly obtain struct resources from the DT's ranges property without relying on architecture specific DT handling. This will make it easier to write archiecture indep

[PATCH v8 1/3] of/pci: Unify pci_process_bridge_OF_ranges from Microblaze and PowerPC

2013-04-22 Thread Andrew Murray
The pci_process_bridge_OF_ranges function, used to parse the "ranges" property of a PCI host device, is found in both Microblaze and PowerPC architectures. These implementations are nearly identical. This patch moves this common code to a common place. Signed-off-by: Andrew Murray Signed-off-by:

Re: [PATCH v7 3/3] of/pci: mips: convert to common of_pci_range_parser

2013-04-22 Thread Andrew Murray
On Sun, Apr 21, 2013 at 08:27:02AM +0100, Gabor Juhos wrote: > Hi Jason, > > >> Sorry I had no time earlier, but I have tested this now on MIPS. The patch > >> causes build errors unfortunately. Given the fact that this has been merged > >> already, I will send a fixup patch. > > > > Olof has dro

Re: [PATCH v2 06/15] powerpc/85xx: add support to JOG feature using cpufreq interface

2013-04-22 Thread Zhao Chenhui
On Mon, Apr 22, 2013 at 08:55:35AM +0530, Viresh Kumar wrote: > On Fri, Apr 19, 2013 at 4:17 PM, Zhao Chenhui > wrote: > > diff --git a/drivers/cpufreq/mpc85xx-cpufreq.c > > b/drivers/cpufreq/mpc85xx-cpufreq.c > > > +#include > > +#include > > +#include > > +#include > > +#include > > +#inc

Re: [PATCH v7 2/3] of/pci: Provide support for parsing PCI DT ranges property

2013-04-22 Thread Andrew Murray
On Thu, Apr 18, 2013 at 02:44:01PM +0100, Grant Likely wrote: > On Tue, 16 Apr 2013 11:18:27 +0100, Andrew Murray > wrote: > > Acked-by: Grant Likely > > But comments below... > I've updated the patchset (now v8) to reflect your feedback, after a closer look... > > - > > - pr_deb

Re: [PATCH v2 06/15] powerpc/85xx: add support to JOG feature using cpufreq interface

2013-04-22 Thread Zhao Chenhui
On Mon, Apr 22, 2013 at 01:43:29AM +0200, Rafael J. Wysocki wrote: > On Friday, April 19, 2013 07:00:57 PM Zhao Chenhui wrote: > > - Forwarded message from Zhao Chenhui - > > > > Date: Fri, 19 Apr 2013 18:47:39 +0800 > > From: Zhao Chenhui > > To: linuxppc-dev@lists.ozlabs.org > > CC: li

Re: [PATCH 3/3] powerpc/powernv: Patch MSI EOI handler on P8

2013-04-22 Thread Gavin Shan
On Mon, Apr 22, 2013 at 12:56:37PM +1000, Michael Ellerman wrote: >On Mon, Apr 22, 2013 at 09:45:33AM +0800, Gavin Shan wrote: >> On Mon, Apr 22, 2013 at 09:34:36AM +1000, Michael Ellerman wrote: >> >On Fri, Apr 19, 2013 at 05:32:45PM +0800, Gavin Shan wrote: >> >> The EOI handler of MSI/MSI-X inte

[PATCH] macintosh: use %*ph to print small buffers

2013-04-22 Thread Andy Shevchenko
Signed-off-by: Andy Shevchenko --- drivers/macintosh/smu.c | 6 +- drivers/macintosh/via-pmu.c | 5 +++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 9c6b964..b3b2d36 100644 --- a/drivers/macintosh/smu.c +++ b/driv

Re: [PATCH -V6 16/27] mm/THP: HPAGE_SHIFT is not a #define on some arch

2013-04-22 Thread Andrea Arcangeli
On Mon, Apr 22, 2013 at 03:30:50PM +0530, Aneesh Kumar K.V wrote: > From: "Aneesh Kumar K.V" > > On archs like powerpc that support different hugepage sizes, HPAGE_SHIFT > and other derived values like HPAGE_PMD_ORDER are not constants. So move > that to hugepage_init > > Cc: Andrea Arcangeli >

Re: [PATCH -V6 17/27] mm/THP: Add pmd args to pgtable deposit and withdraw APIs

2013-04-22 Thread Andrea Arcangeli
On Mon, Apr 22, 2013 at 03:30:51PM +0530, Aneesh Kumar K.V wrote: > From: "Aneesh Kumar K.V" > > This will be later used by powerpc THP support. In powerpc we want to use > pgtable for storing the hash index values. So instead of adding them to > mm_context list, we would like to store them in th

Re: [PATCH -V6 18/27] mm/THP: withdraw the pgtable after pmdp related operations

2013-04-22 Thread Andrea Arcangeli
Hi, On Mon, Apr 22, 2013 at 03:30:52PM +0530, Aneesh Kumar K.V wrote: > From: "Aneesh Kumar K.V" > > For architectures like ppc64 we look at deposited pgtable when > calling pmdp_get_and_clear. So do the pgtable_trans_huge_withdraw > after finishing pmdp related operations. > > Cc: Andrea Arcan

Re: [PATCH] perf: Power7: Make CPI stack events available in sysfs

2013-04-22 Thread Sukadev Bhattiprolu
Michael Ellerman [mich...@ellerman.id.au] wrote: | On Sat, Apr 06, 2013 at 09:48:03AM -0700, Sukadev Bhattiprolu wrote: | > From bdeacf7175241f6c79b5b2be0fa6b20b0d0b7d1c Mon Sep 17 00:00:00 2001 | > From: Sukadev Bhattiprolu | > Date: Sat, 6 Apr 2013 08:48:26 -0700 | > Subject: [PATCH] perf: Power

Re: [PATCH v8 0/3] of/pci: Provide common support for PCI DT parsing

2013-04-22 Thread Jason Cooper
On Mon, Apr 22, 2013 at 11:41:32AM +0100, Andrew Murray wrote: > This patchset factors out duplicated code associated with parsing PCI > DT "ranges" properties across the architectures and introduces a > "ranges" parser. This parser "of_pci_range_parser" can be used directly > by ARM host bridge dr

[PATCH v3 0/12] NUMA CPU Reconfiguration using PRRN

2013-04-22 Thread Nathan Fontenot
Newer firmware on Power systems can transparently reassign platform resources (CPU and Memory) in use. For instance, if a processor or memory unit is predicted to fail, the platform may transparently move the processing to an equivalent unused processor or the memory state to an equivalent unused m

[PATCH v3 1/12] Create a powerpc update_devicetree interface

2013-04-22 Thread Nathan Fontenot
Newer firmware on Power systems can transparently reassign platform resources (CPU and Memory) in use. For instance, if a processor or memory unit is predicted to fail, the platform may transparently move the processing to an equivalent unused processor or the memory state to an equivalent unused m

[PATCH v3 2/12] Correct buffer parsing in update-properties

2013-04-22 Thread Nathan Fontenot
Correct parsing of the buffer returned from ibm,update-properties. The first element is a length and the path to the property which is slightly different from the list of properties in the buffer so we need to specifically handle this. Signed-off-by: Nathan Fontenot --- arch/powerpc/platforms/ps

[PATCH v3 3/12] Add PRRN event handler

2013-04-22 Thread Nathan Fontenot
From: Jesse Larrew A PRRN event is signaled via the RTAS event-scan mechanism, which returns a Hot Plug Event message "fixed part" indicating "Platform Resource Reassignment". In response to the Hot Plug Event message, we must call ibm,update-nodes to determine which resources were reassigned and

[PATCH v3 4/12] Move architecture vector definitions to prom.h

2013-04-22 Thread Nathan Fontenot
As part of handling handling PRRN events we will need to check the vector 5 portion of the architecture bits reported in the device tree to ensure that PRRN event handling is enabled. In order to do this firmware_has_feature is updated (in a subsequent patch) to make this check. To avoid having to

[PATCH v3 5/12] Update firmware_has_feature() to check architecture bits

2013-04-22 Thread Nathan Fontenot
The firmware_has_feature() function makes it easy to check for supported features of the hypervisor. This patch extends the capability of the firmware_has_feature() function to include checking for specified bits in vector 5 of the architecture vector as is reported in the device tree. As part of

[PATCH v3 6/12] Update numa.c to use updated firmware_has_feature()

2013-04-22 Thread Nathan Fontenot
Update the numa code to use the updated firmware_has_feature() when checking for type 1 affinity. Signed-off-by: Nathan Fontenot --- arch/powerpc/mm/numa.c | 22 +++--- 1 file changed, 3 insertions(+), 19 deletions(-) Index: powerpc/arch/powerpc/mm/numa.c =

[PATCH v3 7/12] Use stop machine to update cpu maps

2013-04-22 Thread Nathan Fontenot
From: Jesse Larrew Platform events such as partition migration or the new PRRN firmware feature can cause the NUMA characteristics of a CPU to change, and these changes will be reflected in the device tree nodes for the affected CPUs. This patch registers a handler for Open Firmware device tree

[PATCH v3 8/12] Use stop machine to update cpu maps

2013-04-22 Thread Nathan Fontenot
The new PRRN firmware feature allows CPU and memory resources to be transparently reassigned across NUMA boundaries. When this happens, the kernel must update the node maps to reflect the new affinity information. Although the NUMA maps can be protected by locking primitives during the update itse

[PATCH v3 9/12] Update NUMA VDSO information

2013-04-22 Thread Nathan Fontenot
From: Jesse Larrew The following patch adds vdso_getcpu_init(), which stores the NUMA node for a cpu in SPRG3: Commit 18ad51dd34 ("powerpc: Add VDSO version of getcpu") adds vdso_getcpu_init(), which stores the NUMA node for a cpu in SPRG3. This patch ensures that this information is also updat

[PATCH v3 10/12] Re-enable Virtual Private Home Node capabilities

2013-04-22 Thread Nathan Fontenot
From: Jesse Larrew The new PRRN firmware feature provides a more convenient and event-driven interface than VPHN for notifying Linux of changes to the NUMA affinity of platform resources. However, for practical reasons, it may not be feasible for some customers to update to the latest firmware. F

[PATCH v3 11/12] Enable PRRN Event handling

2013-04-22 Thread Nathan Fontenot
The Linux kernel and platform firmware negotiate their mutual support of the PRRN option via the ibm,client-architecture-support interface. This patch simply sets the appropriate fields in the client architecture vector to indicate Linux support and will cause the firmware to begin sending PRRN eve

[PATCH v3 12/12] Add /proc interface to control topology updates

2013-04-22 Thread Nathan Fontenot
There are instances in which we do not want topology updates to occur. In order to allow this a /proc interface (/proc/powerpc/topology_updates) is introduced so that topology updates can be enabled and disabled. This patch also adds a prrn_is_enabled() call so that PRRN events are handled in the

Re: [PATCH] [RFC] powerpc: Add VDSO version of time

2013-04-22 Thread Adhemerval Zanella
On 04/18/2013 07:38 PM, Anton Blanchard wrote: > Since you are only reading one long you shouldn't need to check the > update count and loop, you will always see a consistent value. The > system call version of time() just does an unprotected load for example. Fixed. > With the above change and w

Re: [PATCH v8 0/3] of/pci: Provide common support for PCI DT parsing

2013-04-22 Thread Jason Cooper
On Mon, Apr 22, 2013 at 12:53:43PM -0400, Jason Cooper wrote: > On Mon, Apr 22, 2013 at 11:41:32AM +0100, Andrew Murray wrote: > > This patchset factors out duplicated code associated with parsing PCI > > DT "ranges" properties across the architectures and introduces a > > "ranges" parser. This par

Re: [PATCH 3/3] powerpc/powernv: Patch MSI EOI handler on P8

2013-04-22 Thread Michael Ellerman
On Mon, Apr 22, 2013 at 07:06:17PM +0800, Gavin Shan wrote: > On Mon, Apr 22, 2013 at 12:56:37PM +1000, Michael Ellerman wrote: > >On Mon, Apr 22, 2013 at 09:45:33AM +0800, Gavin Shan wrote: > >> On Mon, Apr 22, 2013 at 09:34:36AM +1000, Michael Ellerman wrote: > >> >On Fri, Apr 19, 2013 at 05:32:4

Re: [PATCH 2/3 v13] iommu/fsl: Add additional iommu attributes required by the PAMU driver.

2013-04-22 Thread Scott Wood
On 04/22/2013 12:31:55 AM, Varun Sethi wrote: Added the following domain attributes for the FSL PAMU driver: 1. Added new iommu stash attribute, which allows setting of the LIODN specific stash id parameter through IOMMU API. 2. Added an attribute for enabling/disabling DMA to a particular

Re: [PATCH v3 1/12] Create a powerpc update_devicetree interface

2013-04-22 Thread Benjamin Herrenschmidt
On Mon, 2013-04-22 at 13:30 -0500, Nathan Fontenot wrote: > This patch exposes a method for updating the device tree via > ppc_md.update_devicetree that takes a single 32-bit value as a parameter. > For pseries platforms this is the existing pseries_devicetree_update routine > which is updated to

Re: [PATCH v3 4/12] Move architecture vector definitions to prom.h

2013-04-22 Thread Benjamin Herrenschmidt
On Mon, 2013-04-22 at 13:35 -0500, Nathan Fontenot wrote: > As part of handling handling PRRN events we will need to check the > vector 5 portion of the architecture bits reported in the device tree > to ensure that PRRN event handling is enabled. In order to do this > firmware_has_feature is updat

Re: [PATCH v2 7/11] Use stop machine to update cpu maps

2013-04-22 Thread Benjamin Herrenschmidt
On Fri, 2013-04-05 at 13:22 -0500, Nathan Fontenot wrote: > Agreed, having to call stop_machine() for each cpu that gets updated is > pretty brutal. The plus side is that PRRN events should a rare occurrence > and not cause too much pain. So that doesn't happen on VPHN changes ? > The current d

Re: [Suggestion] PowerPC: kernel: memory access violation when rtas_data_buf contents are more than 1026

2013-04-22 Thread Benjamin Herrenschmidt
On Thu, 2013-04-18 at 12:45 +0800, Chen Gang wrote: > Hello Maintainers: > > > in arch/powerpc/kernel/lparcfg.c, parse_system_parameter_string() > > need set '\0' for 'local_buffer'. > > the reason is: > SPLPAR_MAXLENGTH is 1026, RTAS_DATA_BUF_SIZE is 4096 > the contents of rtas_dat

Re: [PATCH] powerpc/rtas_flash: New return code to indicate FW entitlement expiry

2013-04-22 Thread Benjamin Herrenschmidt
On Fri, 2013-04-19 at 17:14 +0530, Vasant Hegde wrote: > Add new return code to rtas_flash to indicate firmware entitlement > expiry. This will be used by the update_flash script to return > appropriate message to the user. What's the point of that patch ? It adds a definition to a private .c file

Re: [PATCH] powerpc: Add HWCAP2 aux entry

2013-04-22 Thread Benjamin Herrenschmidt
On Thu, 2013-04-18 at 13:41 +1000, Michael Neuling wrote: > akpm, > > If you're happy with this, is it something you can take in your tree? Andrew ? Or give me an ack ? :-) I'm happy to carry this, we need that rather urgently and we have the glibc folks on board. Cheers, Ben. > Mikey > > Mich

Re: [PATCH v3 7/12] Use stop machine to update cpu maps

2013-04-22 Thread Benjamin Herrenschmidt
On Mon, 2013-04-22 at 13:41 -0500, Nathan Fontenot wrote: > From: Jesse Larrew > > Platform events such as partition migration or the new PRRN firmware > feature can cause the NUMA characteristics of a CPU to change, and these > changes will be reflected in the device tree nodes for the affected

Re: [Suggestion] PowerPC: kernel: memory access violation when rtas_data_buf contents are more than 1026

2013-04-22 Thread Chen Gang
On 2013年04月23日 08:31, Benjamin Herrenschmidt wrote: > On Thu, 2013-04-18 at 12:45 +0800, Chen Gang wrote: >> Hello Maintainers: >> >> >> in arch/powerpc/kernel/lparcfg.c, parse_system_parameter_string() >> >> need set '\0' for 'local_buffer'. >> >> the reason is: >> SPLPAR_MAXLENGTH is 1026

Re: [PATCH v3 5/12] Update firmware_has_feature() to check architecture bits

2013-04-22 Thread Stephen Rothwell
Hi Nathan, On Mon, 22 Apr 2013 13:38:47 -0500 Nathan Fontenot wrote: > > -/* Option vector 5: PAPR/OF options supported */ > -#define OV5_LPAR 0x80/* logical partitioning supported */ > -#define OV5_SPLPAR 0x40/* shared-processor LPAR supported */ > +/* Option vecto

Re: [PATCH v3 5/12] Update firmware_has_feature() to check architecture bits

2013-04-22 Thread Stephen Rothwell
Hi Nathan, On Mon, 22 Apr 2013 13:38:47 -0500 Nathan Fontenot wrote: > > +/* Option vector 5: PAPR/OF options supported > + * Thses bits are also used for the platform_has_feature() call so You talk about platform_has_feature(), but that does not exist (I assume it existed in a previous version

Re: [PATCH v3 12/12] Add /proc interface to control topology updates

2013-04-22 Thread Stephen Rothwell
Hi Nathan, On Mon, 22 Apr 2013 13:47:55 -0500 Nathan Fontenot wrote: > > #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) > extern int start_topology_update(void); > extern int stop_topology_update(void); > +extern inline int prrn_is_enabled(void); You really can't do "extern inline" w

Re: [PATCH v3 12/12] Add /proc interface to control topology updates

2013-04-22 Thread Stephen Rothwell
Hi Nathan, On Mon, 22 Apr 2013 13:47:55 -0500 Nathan Fontenot wrote: > > +inline int prrn_is_enabled(void) > +{ > + return prrn_enabled; > +} We generally leave these "inline"s up to the compiler these days i.e. remove the "inline". -- Cheers, Stephen Rothwells...@canb

Re: [PATCH v3 12/12] Add /proc interface to control topology updates

2013-04-22 Thread Michael Ellerman
On Tue, Apr 23, 2013 at 12:00:26PM +1000, Stephen Rothwell wrote: > Hi Nathan, > > On Mon, 22 Apr 2013 13:47:55 -0500 Nathan Fontenot > wrote: > > > > #if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR) > > extern int start_topology_update(void); > > extern int stop_topology_update(void);

[PATCH] PowerPC: kernel: memory access violation when rtas_data_buf contents are more than 1026

2013-04-22 Thread Chen Gang
need set '\0' for 'local_buffer'. SPLPAR_MAXLENGTH is 1026, RTAS_DATA_BUF_SIZE is 4096. so the contents of rtas_data_buf may truncated in memcpy. if contents are really truncated. the splpar_strlen is more than 1026. the next while loop checking will not find the end of buffer. that will cau

[PATCH 1/2] powerpc: Move opcode definitions from kvm/emulate.c to asm/ppc-opcode.h

2013-04-22 Thread Jia Hongtao
Opcode and xopcode are useful definitions not just for KVM. Move these definitions to asm/ppc-opcode.h for public use. Signed-off-by: Jia Hongtao Signed-off-by: Li Yang --- arch/powerpc/include/asm/ppc-opcode.h | 45 +++ arch/powerpc/kvm/emulate.c| 44

[PATCH 2/2 V7] powerpc/85xx: Add machine check handler to fix PCIe erratum on mpc85xx

2013-04-22 Thread Jia Hongtao
A PCIe erratum of mpc85xx may causes a core hang when a link of PCIe goes down. when the link goes down, Non-posted transactions issued via the ATMU requiring completion result in an instruction stall. At the same time a machine-check exception is generated to the core to allow further processing b

Re: [PATCH 3/3] powerpc/powernv: Patch MSI EOI handler on P8

2013-04-22 Thread Gavin Shan
On Tue, Apr 23, 2013 at 09:34:16AM +1000, Michael Ellerman wrote: >On Mon, Apr 22, 2013 at 07:06:17PM +0800, Gavin Shan wrote: >> On Mon, Apr 22, 2013 at 12:56:37PM +1000, Michael Ellerman wrote: >> >On Mon, Apr 22, 2013 at 09:45:33AM +0800, Gavin Shan wrote: >> >> On Mon, Apr 22, 2013 at 09:34:36A

[PATCH 1/3 v2] iommu: Move swap_pci_ref function to pci.h.

2013-04-22 Thread Varun Sethi
swap_pci_ref function is used by the IOMMU API code for swapping pci device pointers, while determining the iommu group for the device. Currently this function was being implemented for different IOMMU drivers. This patch moves the function to a new file, drivers/iommu/pci.h so that the implementat

[PATCH 2/3 v14] iommu/fsl: Add additional iommu attributes required by the PAMU driver.

2013-04-22 Thread Varun Sethi
Added the following domain attributes for the FSL PAMU driver: 1. Added new iommu stash attribute, which allows setting of the LIODN specific stash id parameter through IOMMU API. 2. Added an attribute for enabling/disabling DMA to a particular memory window. 3. Added domain attribute to chec

RE: [PATCH 2/3 v13] iommu/fsl: Add additional iommu attributes required by the PAMU driver.

2013-04-22 Thread Sethi Varun-B16395
> -Original Message- > From: Wood Scott-B07421 > Sent: Tuesday, April 23, 2013 5:20 AM > To: Sethi Varun-B16395 > Cc: j...@8bytes.org; io...@lists.linux-foundation.org; linuxppc- > d...@lists.ozlabs.org; linux-ker...@vger.kernel.org; > ga...@kernel.crashing.org; b...@kernel.crashing.org;

Re: [PATCH] powerpc/rtas_flash: New return code to indicate FW entitlement expiry

2013-04-22 Thread Ananth N Mavinakayanahalli
On Tue, Apr 23, 2013 at 10:40:10AM +1000, Benjamin Herrenschmidt wrote: > On Fri, 2013-04-19 at 17:14 +0530, Vasant Hegde wrote: > > Add new return code to rtas_flash to indicate firmware entitlement > > expiry. This will be used by the update_flash script to return > > appropriate message to the u

Re: [PATCH 1/2] powerpc: Move opcode definitions from kvm/emulate.c to asm/ppc-opcode.h

2013-04-22 Thread Michael Ellerman
On Tue, Apr 23, 2013 at 10:39:35AM +0800, Jia Hongtao wrote: > Opcode and xopcode are useful definitions not just for KVM. Move these > definitions to asm/ppc-opcode.h for public use. Agreed. Though nearly everything else in ppc-opcode.h uses PPC_INST_FOO, or at least PPC_FOO, any reason not to up

Re: [PATCH] powerpc/rtas_flash: New return code to indicate FW entitlement expiry

2013-04-22 Thread Vasant Hegde
On 04/23/2013 06:10 AM, Benjamin Herrenschmidt wrote: On Fri, 2013-04-19 at 17:14 +0530, Vasant Hegde wrote: Add new return code to rtas_flash to indicate firmware entitlement expiry. This will be used by the update_flash script to return appropriate message to the user. What's the point of th

Re: [PATCH] powerpc/rtas_flash: New return code to indicate FW entitlement expiry

2013-04-22 Thread Benjamin Herrenschmidt
On Tue, 2013-04-23 at 10:35 +0530, Ananth N Mavinakayanahalli wrote: > On Tue, Apr 23, 2013 at 10:40:10AM +1000, Benjamin Herrenschmidt wrote: > > On Fri, 2013-04-19 at 17:14 +0530, Vasant Hegde wrote: > > > Add new return code to rtas_flash to indicate firmware entitlement > > > expiry. This will

[PATCH V4 4/5] powerpc, perf: Define BHRB generic functions, data and flags for POWER8

2013-04-22 Thread Anshuman Khandual
This patch populates BHRB specific data for power_pmu structure. It also implements POWER8 specific BHRB filter and configuration functions. Signed-off-by: Anshuman Khandual --- arch/powerpc/perf/power8-pmu.c | 57 +- 1 file changed, 56 insertions(+), 1 de

[PATCH V4 3/5] powerpc, perf: Add new BHRB related generic functions, data and flags

2013-04-22 Thread Anshuman Khandual
This patch adds couple of generic functions to power_pmu structure which would configure the BHRB and it's filters. It also adds representation of the number of BHRB entries present on the PMU. A new PMU flag PPMU_BHRB would indicate presence of BHRB feature. Signed-off-by: Anshuman Khandual ---

[PATCH V4 5/5] powerpc, perf: Enable branch stack sampling framework

2013-04-22 Thread Anshuman Khandual
Provides basic enablement for perf branch stack sampling framework on POWER8 processor based platforms. Adds new BHRB related elements into cpu_hw_event structure to represent current BHRB config, BHRB filter configuration, manage context and to hold output BHRB buffer during PMU interrupt before p

[PATCH V4 1/5] powerpc, perf: Add new BHRB related instructions for POWER8

2013-04-22 Thread Anshuman Khandual
This patch adds new POWER8 instruction encoding for reading and clearing Branch History Rolling Buffer entries. The new instruction 'mfbhrbe' (move from branch history rolling buffer entry) is used to read BHRB buffer entries and instruction 'clrbhrb' (clear branch history rolling buffer) is used t

[PATCH V4 2/5] powerpc, perf: Add basic assembly code to read BHRB entries on POWER8

2013-04-22 Thread Anshuman Khandual
This patch adds the basic assembly code to read BHRB buffer. BHRB entries are valid only after a PMU interrupt has happened (when MMCR0[PMAO]=1) and BHRB has been freezed. BHRB read should not be attempted when it is still enabled (MMCR0[PMAE]=1) and getting updated, as this can produce non-determi

[PATCH V4 0/5] powerpc, perf: BHRB based branch stack enablement on POWER8

2013-04-22 Thread Anshuman Khandual
Branch History Rolling Buffer (BHRB) is a new PMU feaure in IBM POWER8 processor which records the branch instructions inside the execution pipeline. This patchset enables the basic functionality of the feature through generic perf branch stack sampling framework. Sample output ---

RE: [PATCH] powerpc/fsl-pci:fix incorrect iounmap pci hose->private_data

2013-04-22 Thread Zang Roy-R61911
> -Original Message- > From: Zang Roy-R61911 > Sent: Tuesday, April 23, 2013 2:36 AM > To: linuxppc-dev@lists.ozlabs.org > Cc: ga...@kernel.crashing.org; Zang Roy-R61911; Chen Yuanquan-B41889 > Subject: [PATCH] powerpc/fsl-pci:fix incorrect iounmap pci hose- > >private_data > > pci hose-

Re: [PATCH] powerpc/rtas_flash: New return code to indicate FW entitlement expiry

2013-04-22 Thread Ananth N Mavinakayanahalli
On Tue, Apr 23, 2013 at 03:32:30PM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2013-04-23 at 10:35 +0530, Ananth N Mavinakayanahalli wrote: > > On Tue, Apr 23, 2013 at 10:40:10AM +1000, Benjamin Herrenschmidt wrote: > > > On Fri, 2013-04-19 at 17:14 +0530, Vasant Hegde wrote: > > > > Add new ret

RE: [PATCH 1/2] powerpc: Move opcode definitions from kvm/emulate.c to asm/ppc-opcode.h

2013-04-22 Thread Jia Hongtao-B38951
> -Original Message- > From: Linuxppc-dev [mailto:linuxppc-dev- > bounces+b38951=freescale@lists.ozlabs.org] On Behalf Of Michael > Ellerman > Sent: Tuesday, April 23, 2013 1:30 PM > To: Jia Hongtao-B38951 > Cc: Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org > Subject: Re: [PATCH 1/