[PATCH kernel v2] powerpc/powernv: Fix debug macro

2016-05-02 Thread Alexey Kardashevskiy
When cfg_dbg() is enabled (i.e. mapped to printk()), gcc produces errors as the __func__ parameter is missing (pnv_pci_cfg_read() has one); this adds the missing parameter. Since cfg_dbg() is used not just for config space access, this replaces it with well-known pr_devel(). Signed-off-by: Alexey

linux-next: build failure after merge of the akpm-current tree

2016-05-02 Thread Stephen Rothwell
Hi Andrew, After merging the akpm-current tree, today's linux-next build (powerpc allyesconfig and pseries_le_defconfig) failed like this: In file included from include/linux/mm.h:394:0, from mm/huge_memory.c:10: include/linux/huge_mm.h:53:22: error: initializer element is not co

Re: [PATCH v3 00/16] genrtc removal

2016-05-02 Thread Geert Uytterhoeven
Hi Arnd, On Thu, Apr 28, 2016 at 9:48 AM, Geert Uytterhoeven wrote: > On Thu, Apr 28, 2016 at 12:34 AM, Arnd Bergmann wrote: >> I ended up stuffing the two patch series into one, as they are now >> more dependent on one another. This now thoroughly removes the >> genrtc driver including the asm/

Re: [PATCH] selftests/powerpc: Test cp_abort during context switch

2016-05-02 Thread Cyril Bur
On Mon, 2 May 2016 13:51:38 +1000 Chris Smart wrote: > Test that performing a copy paste sequence in userspace on P9 does not > result in a leak of the copy into the paste of another process. > > This is based on Anton Blanchard's context_switch benchmarking code. It > sets up two processes tied

[PATCH 1/2] powerpc/mm/subpage: Init user psize correctly

2016-05-02 Thread Aneesh Kumar K.V
Check against a context.id value of zero instead of MMU_NO_CONTEXT when doing a slice psize init. Without this patch we end up with a slice psize value of zero and we always end up using 4K hpte. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/mmu_context_book3s64.c | 10 +- 1 file c

[PATCH 2/2] powerpc/mm/subpage: Fix subpage protection with 4K hpte config

2016-05-02 Thread Aneesh Kumar K.V
With Linux page size of 64K and hardware only supporting 4K hpte, if we use subpage protection, we always fail for the subpage 0 as shown below (using the selftest subpage_prot test). 520175565: (4520111850): Failed at 0x0x3fffad4b (p=13,sp=0,w=0), want=fault, got=pass ! 4520890210: (45208264

[PATCH 2/2] powerpc/mm/subpage: Fix subpage protection with 4K hpte config

2016-05-02 Thread Aneesh Kumar K.V
With Linux page size of 64K and hardware only supporting 4K hpte, if we use subpage protection, we always fail for the subpage 0 as shown below (using the selftest subpage_prot test). 520175565: (4520111850): Failed at 0x0x3fffad4b (p=13,sp=0,w=0), want=fault, got=pass ! 4520890210: (45208264

Re: [PATCH] selftests/powerpc: Fix subpage_prot test to return !0 on failure

2016-05-02 Thread Aneesh Kumar K.V
Michael Ellerman writes: > It's helpful for automated testing if the test returns error codes back > to the calling program. > > Signed-off-by: Michael Ellerman Reviewed-by: Aneesh Kumar K.V > --- > tools/testing/selftests/powerpc/mm/subpage_prot.c | 10 ++ > 1 file changed, 6 inser

Re: linux-next: build failure after merge of the akpm-current tree

2016-05-02 Thread Aneesh Kumar K.V
Stephen Rothwell writes: > Hi Andrew, > > After merging the akpm-current tree, today's linux-next build (powerpc > allyesconfig and pseries_le_defconfig) failed like this: > > In file included from include/linux/mm.h:394:0, > from mm/huge_memory.c:10: > include/linux/huge_mm.h:53

Re: [Qemu-devel] [PATCH v2] spapr: Don't set the TM ibm, pa-features bit in PR KVM mode

2016-05-02 Thread haris iqbal
On Sat, Apr 30, 2016 at 6:18 AM, Anton Blanchard wrote: > We don't support transactional memory in PR KVM, so don't tell > the OS that we do. > > Signed-off-by: Anton Blanchard > --- > > v2: Fix build with CONFIG_KVM disabled, noticed by Alex. > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > in

[PATCH] powerpc/mm/slice: Remove slice_mm_new_context

2016-05-02 Thread Aneesh Kumar K.V
The existing usage is bogus, because we set the context.id value in the same function. The book3s 64 got removed in the old patch. Hence remove the redundant definition. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/page_64.h | 3 --- arch/powerpc/mm/mmu_context_nohash.c | 3 +--

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-05-02 Thread Josh Poimboeuf
On Fri, Apr 29, 2016 at 05:08:50PM -0700, Andy Lutomirski wrote: > On Apr 29, 2016 3:41 PM, "Josh Poimboeuf" wrote: > > > > On Fri, Apr 29, 2016 at 02:37:41PM -0700, Andy Lutomirski wrote: > > > On Fri, Apr 29, 2016 at 2:25 PM, Josh Poimboeuf > > > wrote: > > > >> I suppose we could try to rejig

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-05-02 Thread Andy Lutomirski
On Mon, May 2, 2016 at 6:52 AM, Josh Poimboeuf wrote: > On Fri, Apr 29, 2016 at 05:08:50PM -0700, Andy Lutomirski wrote: >> On Apr 29, 2016 3:41 PM, "Josh Poimboeuf" wrote: >> > >> > On Fri, Apr 29, 2016 at 02:37:41PM -0700, Andy Lutomirski wrote: >> > > On Fri, Apr 29, 2016 at 2:25 PM, Josh Poim

Re: [PATCH v5] powerpc/pci: Assign fixed PHB number based on device-tree properties

2016-05-02 Thread Bjorn Helgaas
On Thu, Apr 14, 2016 at 06:55:24PM -0300, Guilherme G. Piccoli wrote: > The domain/PHB field of PCI addresses has its value obtained from a > global variable, incremented each time a new domain (represented by > struct pci_controller) is added on the system. The domain addition > process happens du

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-05-02 Thread Josh Poimboeuf
On Mon, May 02, 2016 at 08:52:41AM -0700, Andy Lutomirski wrote: > On Mon, May 2, 2016 at 6:52 AM, Josh Poimboeuf wrote: > > On Fri, Apr 29, 2016 at 05:08:50PM -0700, Andy Lutomirski wrote: > >> On Apr 29, 2016 3:41 PM, "Josh Poimboeuf" wrote: > >> > > >> > On Fri, Apr 29, 2016 at 02:37:41PM -070

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-05-02 Thread Andy Lutomirski
On Mon, May 2, 2016 at 10:31 AM, Josh Poimboeuf wrote: > On Mon, May 02, 2016 at 08:52:41AM -0700, Andy Lutomirski wrote: >> On Mon, May 2, 2016 at 6:52 AM, Josh Poimboeuf wrote: >> > On Fri, Apr 29, 2016 at 05:08:50PM -0700, Andy Lutomirski wrote: >> >> On Apr 29, 2016 3:41 PM, "Josh Poimboeuf"

Re: [PATCH kernel] KVM: PPC: Fix debug macros

2016-05-02 Thread Thomas Huth
On 29.04.2016 06:57, Alexey Kardashevskiy wrote: > When XICS_DBG is enabled, gcc produces format errors. This fixes > formats to match passed values types. > > Signed-off-by: Alexey Kardashevskiy > --- > arch/powerpc/kvm/book3s_xics.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-05-02 Thread Ingo Molnar
* Andy Lutomirski wrote: > > Another idea to detect missing frames: for each return address on the > > stack, > > ensure there's a corresponding "call " instruction immediately > > preceding > > the return location, where matches what's on the stack. > > Hmm, interesting. > > I hope your

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-05-02 Thread Josh Poimboeuf
On Mon, May 02, 2016 at 11:12:39AM -0700, Andy Lutomirski wrote: > On Mon, May 2, 2016 at 10:31 AM, Josh Poimboeuf wrote: > > On Mon, May 02, 2016 at 08:52:41AM -0700, Andy Lutomirski wrote: > >> On Mon, May 2, 2016 at 6:52 AM, Josh Poimboeuf wrote: > >> > On Fri, Apr 29, 2016 at 05:08:50PM -0700

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-05-02 Thread Jiri Kosina
On Mon, 2 May 2016, Andy Lutomirski wrote: > FWIW, I just tried this: > > static bool is_entry_text(unsigned long addr) > { > return addr >= (unsigned long)__entry_text_start && > addr < (unsigned long)__entry_text_end; > } > > it works. So the entry code is already annotated reason

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-05-02 Thread Jiri Kosina
On Mon, 2 May 2016, Jiri Kosina wrote: > > FWIW, I just tried this: > > > > static bool is_entry_text(unsigned long addr) > > { > > return addr >= (unsigned long)__entry_text_start && > > addr < (unsigned long)__entry_text_end; > > } > > > > it works. So the entry code is already an

Re: [PATCH v8 45/45] PCI/hotplug: PowerPC PowerNV PCI hotplug driver

2016-05-02 Thread Gavin Shan
On Mon, May 02, 2016 at 04:11:53PM +1000, Alexey Kardashevskiy wrote: >On 05/02/2016 01:44 PM, Gavin Shan wrote: >>On Tue, Apr 19, 2016 at 08:36:48PM +1000, Alexey Kardashevskiy wrote: >>>On 02/17/2016 02:44 PM, Gavin Shan wrote: This adds standalone driver to support PCI hotplug for PowerPC Po

Re: [PATCH v8 45/45] PCI/hotplug: PowerPC PowerNV PCI hotplug driver

2016-05-02 Thread Gavin Shan
On Wed, Apr 20, 2016 at 11:55:56AM +1000, Alistair Popple wrote: >On Tue, 19 Apr 2016 20:36:48 Alexey Kardashevskiy wrote: >> On 02/17/2016 02:44 PM, Gavin Shan wrote: >> > This adds standalone driver to support PCI hotplug for PowerPC PowerNV >> > platform that runs on top of skiboot firmware. The

Re: [RFC PATCH v2 05/18] sched: add task flag for preempt IRQ tracking

2016-05-02 Thread Andy Lutomirski
On Mon, May 2, 2016 at 1:00 PM, Jiri Kosina wrote: > On Mon, 2 May 2016, Jiri Kosina wrote: > >> > FWIW, I just tried this: >> > >> > static bool is_entry_text(unsigned long addr) >> > { >> > return addr >= (unsigned long)__entry_text_start && >> > addr < (unsigned long)__entry_text_en

Re: [PATCH v8 45/45] PCI/hotplug: PowerPC PowerNV PCI hotplug driver

2016-05-02 Thread Alexey Kardashevskiy
On 05/03/2016 09:41 AM, Gavin Shan wrote: On Wed, Apr 20, 2016 at 11:55:56AM +1000, Alistair Popple wrote: On Tue, 19 Apr 2016 20:36:48 Alexey Kardashevskiy wrote: On 02/17/2016 02:44 PM, Gavin Shan wrote: This adds standalone driver to support PCI hotplug for PowerPC PowerNV platform that run

RE: [PATCH] vfio-pci: Allow to mmap sub-page MMIO BARs if the mmio page is exclusive

2016-05-02 Thread Tian, Kevin
> From: Yongji Xie > Sent: Wednesday, April 27, 2016 8:22 PM > > Current vfio-pci implementation disallows to mmap > sub-page(size < PAGE_SIZE) MMIO BARs because these BARs' mmio > page may be shared with other BARs. This will cause some > performance issues when we passthrough a PCI device with >

Re: [PATCH v3 12/16] rtc: powerpc: provide rtc_class_ops directly

2016-05-02 Thread Michael Ellerman
On Thu, 2016-04-28 at 00:34 +0200, Arnd Bergmann wrote: > The rtc-generic driver provides an architecture specific > wrapper on top of the generic rtc_class_ops abstraction, > and powerpc has another abstraction on top, which is a bit > silly. > > This changes the powerpc rtc-generic device to pr

Re: [PATCH V2] cxl: Check periodically the coherent platform function's state

2016-05-02 Thread Ian Munsie
Acked-by: Ian Munsie ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: powerpc: Add out of bounds check to crash_shutdown_unregister()

2016-05-02 Thread Michael Ellerman
On Thu, 2016-28-04 at 06:17:45 UTC, Suraj Jitindar Singh wrote: > When unregistering a crash_shutdown_handle in the function > crash_shutdown_unregister() the other handles are shifted down in the > array to replace the unregistered handle. The for loop assumes that the > last element in the array

Re: radeonhd and xorg issues on powerpc p5020 and G5

2016-05-02 Thread luigi burdo
hi michel, tested with sapphire 7750Hd 2gb ddr3 on Cyrus+ Amigaone X5000 P5020, with radeon selected i have a stalling of fence 0 and video binking with all glitched like on 7770hd, only fbdev video gave the desktop ok. distro is the ubuntu mate 16.04 kernels used for testing are the 4.6 rc 5 a

Re: [PATCH v2 0/5] powerpc/pm: QorIQ deep sleep

2016-05-02 Thread Scott Wood
On Tue, 2016-04-26 at 10:27 +, Chenhui Zhao wrote: > Any comment? > > Thanks, > Chenhui Leo already commented on the "add a compatible string" patch (though the threading got broken thanks to Microsoft) and you said you'd fix it. -Scott ___ Linuxp

Re: [PATCH 7/9] powerpc/powernv: Add platform support for stop instruction

2016-05-02 Thread Michael Neuling
> diff --git a/arch/powerpc/include/asm/cputable.h > b/arch/powerpc/include/asm/cputable.h > index df4fb5f..a4739a1 100644 > --- a/arch/powerpc/include/asm/cputable.h > +++ b/arch/powerpc/include/asm/cputable.h > @@ -205,6 +205,7 @@ enum { >  #define CPU_FTR_DABRX > LONG_A

RE: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt remapping is supported

2016-05-02 Thread Tian, Kevin
> From: Yongji Xie > Sent: Wednesday, April 27, 2016 8:43 PM > > This patch enables mmapping MSI-X tables if hardware supports > interrupt remapping which can ensure that a given pci device > can only shoot the MSIs assigned for it. > > With MSI-X table mmapped, we also need to expose the > read/

[PATCH v9 01/26] powerpc/pci: Cleanup on struct pci_controller_ops

2016-05-02 Thread Gavin Shan
Each PHB has one instance of "struct pci_controller_ops" that includes various callbacks called by PCI subsystem. In the definition of this struct, some callbacks have explicit names for its arguments, but the left don't have. This adds all explicit names of the arguments to the callbacks in "stru

[PATCH v9 03/26] powerpc/powernv: Drop phb->bdfn_to_pe()

2016-05-02 Thread Gavin Shan
This drops struct pnv_phb::bdfn_to_pe() as nobody uses it. Signed-off-by: Gavin Shan Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/platforms/powernv/pci-ioda.c | 9 - arch/powerpc/platforms/powernv/pci.h | 1 - 2 files changed, 10 deletions(-) diff --git a/arch/powerpc/platfo

[PATCH v9 00/26] powerpc/powernv: PCI hotplug preparation

2016-05-02 Thread Gavin Shan
The series is split from "[PATCH v8 00/45] powerpc/powernv: PCI hotplug support". The series does couple of things as below. The patches are required to support PCI hotplug on PowerNV platforms. However, the patches refactor the code with the goal: not affecting current logic. * Code cleanup an

[PATCH v9 04/26] powerpc/powernv: Reorder fields in struct pnv_phb

2016-05-02 Thread Gavin Shan
This moves those fields in struct pnv_phb that are related to PE allocation around. No logical change. Signed-off-by: Gavin Shan Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/platforms/powernv/pci.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/pla

[PATCH v9 06/26] powerpc/powernv: Data type unsigned int for PE number

2016-05-02 Thread Gavin Shan
This changes the data type of PE number from "int" to "unsigned int" in order to match the fact PE number is never negative: * The number of PE to which the specified PCI device is attached. * The PE number map for SRIOV VFs. * The returned PE number from pnv_ioda_alloc_pe(). * The ret

[PATCH v9 09/26] powerpc/powernv: IO and M32 mapping based on PCI device resources

2016-05-02 Thread Gavin Shan
Currently, the IO and M32 segments are mapped to the corresponding PE based on the windows of the parent bridge of PE's primary bus. It's not going to work when the windows of root port or upstream port of the PCIe switch behind root port are extended to PHB's apertures in order to support hotplug

[PATCH v9 24/26] powerpc/pci: Don't scan empty slot

2016-05-02 Thread Gavin Shan
In hotplug case, function pci_add_pci_devices() is called to rescan the specified PCI bus, which might not have any child devices. Access to the PCI bus's child device node will cause kernel crash without exception. This adds one more check to skip scanning PCI bus that doesn't have any subordinat

[PATCH v9 22/26] powerpc/pci: Introduce pci_remove_device_node_info()

2016-05-02 Thread Gavin Shan
This implements and exports pci_remove_device_node_info(). It's used to remove the pdn (struct pci_dn) for the indicated device node. The function is going to be used by PowerNV PCI hotplug driver. Signed-off-by: Gavin Shan Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/pci-brid

[PATCH v9 12/26] powerpc/powernv/ioda1: M64 support on P7IOC

2016-05-02 Thread Gavin Shan
This enables M64 window on P7IOC, which has been enabled on PHB3. Different from PHB3 where 16 M64 BARs are supported and each of them can be owned by one particular PE# exclusively or divided evenly to 256 segments, every P7IOC PHB has 16 M64 BARs and each of them are divided to 8 segments. So eve

[PATCH v9 17/26] powerpc/powernv: Use PE instead of number during setup and release

2016-05-02 Thread Gavin Shan
In current implementation, the PEs that are allocated or picked from the reserved list are identified by PE number. The PE instance has to be picked according to the PE number eventually. We have same issue when PE is released. For pnv_ioda_pick_m64_pe() and pnv_ioda_alloc_pe(), this returns PE in

[PATCH v9 11/26] powerpc/powernv: Rename M64 related functions

2016-05-02 Thread Gavin Shan
This renames those functions picking PE number based on consumed M64 segments, mapping M64 segments to PEs as those functions are going to be shared by IODA1/IODA2 in next patch. No logical changes introduced. Signed-off-by: Gavin Shan Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/platform

[PATCH v9 08/26] powerpc/powernv: Simplify pnv_ioda_setup_pe_seg()

2016-05-02 Thread Gavin Shan
pnv_ioda_setup_pe_seg() associates the IO and M32 segments with the owner PE. The code mapping segments should be fixed and immune from logic changes introduced to pnv_ioda_setup_pe_seg(). This moves the code mapping segments to helper pnv_ioda_setup_pe_res(). The data type for @rc is changed to "

[PATCH v9 18/26] powerpc/pci: Rename pcibios_{add, remove}_pci_devices()

2016-05-02 Thread Gavin Shan
This renames pcibios_{add,remove}_pci_devices() to avoid conflicts with names of the weak functions in PCI subsystem, which have the prefix "pcibios". No logical changes introduced. Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/pci-bridge.h | 4 ++-- arch/powerpc/kernel/eeh_driver.c

[PATCH v9 07/26] powerpc/powernv: Fix initial IO and M32 segmap

2016-05-02 Thread Gavin Shan
There are two arrays for IO and M32 segment maps on every PHB. The index of the arrays are segment number and the value stored in the corresponding element is PE number, indicating the segment is assigned to the PE. Initially, all elements in those two arrays are zeroes, meaning all segments are as

[PATCH v9 21/26] powerpc/pci: Export pci_add_device_node_info()

2016-05-02 Thread Gavin Shan
This renames update_dn_pci_info() to pci_add_device_node_info() with corresponding adjustment on the parameter type and exports it. The function is used to create pdn (struct pci_dn) for the indicated device node. Another function add_pdn(), almost wrapper of pci_add_device_node_info(), to be used

[PATCH v9 05/26] powerpc/powernv: Rename PE# fields in struct pnv_phb

2016-05-02 Thread Gavin Shan
This renames the fields related to PE number in "struct pnv_phb" for better reflecting of their usages as Alexey suggested. No logical changes introduced. Signed-off-by: Gavin Shan Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/platforms/powernv/eeh-powernv.c | 2 +- arch/powerpc/platforms

[PATCH v9 13/26] powerpc/powernv/ioda1: Rename pnv_pci_ioda_setup_dma_pe()

2016-05-02 Thread Gavin Shan
This renames pnv_pci_ioda_setup_dma_pe() to pnv_pci_ioda1_setup_dma_pe() as it's the counter-part of IODA2's pnv_pci_ioda2_setup_dma_pe(). No logical changes introduced. Signed-off-by: Gavin Shan Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/platforms/powernv/pci-ioda.c | 9 + 1 fi

[PATCH v9 15/26] powerpc/powernv: Remove DMA32 PE list

2016-05-02 Thread Gavin Shan
PEs are put into PHB DMA32 list (phb->ioda.pe_dma_list) according to their DMA32 weight. The PEs on the list are iterated to setup their TCE32 tables at system booting time. The list is used for once at boot time and no need to keep it. This moves the logic calculating DMA32 weight of PHB and PE t

[PATCH v9 14/26] powerpc/powernv/ioda1: Introduce PNV_IODA1_DMA32_SEGSIZE

2016-05-02 Thread Gavin Shan
Currently, there is one macro (TCE32_TABLE_SIZE) representing the TCE table size for one DMA32 segment. The constant representing the DMA32 segment size (1 << 28) is still used in the code. This defines PNV_IODA1_DMA32_SEGSIZE representing one DMA32 segment size. the TCE table size can be calcualt

[PATCH v9 23/26] powerpc/pci: Export pci_traverse_device_nodes()

2016-05-02 Thread Gavin Shan
This renames traverse_pci_devices() to pci_traverse_device_nodes(). The function traverses all subordinate device nodes of the specified one. Also, below cleanup applied to the function. No logical changes introduced. * Rename "pre" to "fn". * Avoid assignment in if condition reported from c

[PATCH v9 26/26] powerpc/powernv: Exclude root bus in pnv_pci_reset_secondary_bus()

2016-05-02 Thread Gavin Shan
The function pnv_pci_reset_secondary_bus() is called like below. It's impossible for call the function on root bus. So it's safe to remove the root bus case in the function. No functional changes introduced. pci_parent_bus_reset() / pci_bus_reset() / pci_try_reset_bus() pci_reset_bridge_seco

[PATCH v9 20/26] powerpc/pci: Move pci_find_bus_by_node() around

2016-05-02 Thread Gavin Shan
This moves pci_find_bus_by_node() from arch/powerpc/platforms/ pseries/pci_dlpar.c to arch/powerpc/kernel/pci-hotplug.c so that the function can be used by pSeries and PowerNV platform at the same time. Also, below cleanup applied. No functional changes introduced. * Remove variable "busdn" in

[PATCH v9 19/26] powerpc/pci: Rename pcibios_find_pci_bus()

2016-05-02 Thread Gavin Shan
This renames pcibios_find_pci_bus() to pci_find_bus_by_node() to avoid conflicts with those PCI subsystem weak function names, which have prefix "pcibios". No logical changes introduced. Signed-off-by: Gavin Shan Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/pci-bridge.h |

[PATCH v9 10/26] powerpc/powernv: Track M64 segment consumption

2016-05-02 Thread Gavin Shan
When unplugging PCI devices, their parent PEs might be offline. The consumed M64 resource by the PEs should be released at that time. As we track M32 segment consumption, this introduces an array to the PHB to track the mapping between M64 segment and PE number. Note: M64 mapping isn't covered by

[PATCH v9 25/26] powerpc/powernv: Simplify pnv_eeh_reset()

2016-05-02 Thread Gavin Shan
This drops unnecessary nested if statements in pnv_eeh_reset() to improve the code readability. After the changes, the unused local variable "ret" is dropped as well. No logical changes introduced. Signed-off-by: Gavin Shan Reviewed-by: Andrew Donnellan Reviewed-by: Alexey Kardashevskiy --- ar

Re: [PATCH kernel v4 08/11] powerpc/powernv/ioda2: Export debug helper pe_level_printk()

2016-05-02 Thread Alistair Popple
There's one call to pr_warn() in pnv_npu_disable_bypass() that could arguably be converted to pe_warn(), but we can clean that up later as the patch looks fine and I'm assuming subsequent patches make use of these. Reviewed-By: Alistair Popple On Fri, 29 Apr 2016 18:55:21 Alexey Kardashevskiy

Re: [PATCH] vfio-pci: Allow to mmap sub-page MMIO BARs if the mmio page is exclusive

2016-05-02 Thread Yongji Xie
On 2016/5/3 10:59, Tian, Kevin wrote: From: Yongji Xie Sent: Wednesday, April 27, 2016 8:22 PM Current vfio-pci implementation disallows to mmap sub-page(size < PAGE_SIZE) MMIO BARs because these BARs' mmio page may be shared with other BARs. This will cause some performance issues when we pass

Re: [PATCH] selftests/powerpc: Fix subpage_prot test to return !0 on failure

2016-05-02 Thread Aneesh Kumar K.V
"Aneesh Kumar K.V" writes: > Michael Ellerman writes: > >> It's helpful for automated testing if the test returns error codes back >> to the calling program. >> >> Signed-off-by: Michael Ellerman > > > Reviewed-by: Aneesh Kumar K.V > >> --- >> tools/testing/selftests/powerpc/mm/subpage_prot.c

Re: [PATCH kernel v4 08/11] powerpc/powernv/ioda2: Export debug helper pe_level_printk()

2016-05-02 Thread Alistair Popple
On Tue, 3 May 2016 15:46:33 Alistair Popple wrote: > There's one call to pr_warn() in pnv_npu_disable_bypass() that could arguably > be converted to pe_warn(), but we can clean that up later as the patch looks > fine and I'm assuming subsequent patches make use of these. And inevitably the next

Re: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt remapping is supported

2016-05-02 Thread Yongji Xie
On 2016/5/3 13:34, Tian, Kevin wrote: From: Yongji Xie Sent: Wednesday, April 27, 2016 8:43 PM This patch enables mmapping MSI-X tables if hardware supports interrupt remapping which can ensure that a given pci device can only shoot the MSIs assigned for it. With MSI-X table mmapped, we also n

RE: [PATCH] vfio-pci: Allow to mmap sub-page MMIO BARs if the mmio page is exclusive

2016-05-02 Thread Tian, Kevin
> From: Yongji Xie [mailto:xyj...@linux.vnet.ibm.com] > Sent: Tuesday, May 03, 2016 1:52 PM > > >> + > >> + if (!(res->start & ~PAGE_MASK)) { > >> + /* > >> + * Add shadow resource for sub-page bar whose mmio > >> + * page is exclusive

[PATCH v9 02/26] powerpc/powernv: Cleanup on pci_controller_ops instances

2016-05-02 Thread Gavin Shan
This cleans up on below data struct instances to use tab instead of space indent of statement to avoid complains from scripts/checkpatch.pl. No logical changes introduced. @pnv_pci_ioda_controller_ops @pnv_npu_ioda_controller_ops Signed-off-by: Gavin Shan Reviewed-by: Daniel Axtens Reviewed

[PATCH v9 16/26] powerpc/powernv/ioda1: Improve DMA32 segment track

2016-05-02 Thread Gavin Shan
In current implementation, the DMA32 segments required by one specific PE isn't calculated with the information hold in the PE independently. It conflicts with the PCI hotplug design: PE centralized, meaning the PE's DMA32 segments should be calculated from the information hold in the PE independen

RE: [PATCH 5/5] vfio-pci: Allow to mmap MSI-X table if interrupt remapping is supported

2016-05-02 Thread Tian, Kevin
> From: Yongji Xie [mailto:xyj...@linux.vnet.ibm.com] > Sent: Tuesday, May 03, 2016 2:08 PM > > On 2016/5/3 13:34, Tian, Kevin wrote: > > >> From: Yongji Xie > >> Sent: Wednesday, April 27, 2016 8:43 PM > >> > >> This patch enables mmapping MSI-X tables if hardware supports > >> interrupt remappi

Re: [PATCH kernel v4 09/11] powerpc/powernv/npu: Add set/unset window helpers

2016-05-02 Thread Alistair Popple
On Fri, 29 Apr 2016 18:55:22 Alexey Kardashevskiy wrote: > The upcoming NVLink passthrough support will require NPU code to cope > with two DMA windows. > > This adds a pnv_npu_set_window() helper which programs 32bit window to > the hardware. This also adds multilevel TCE support. > > This adds

Re: [PATCH 7/9] powerpc/powernv: Add platform support for stop instruction

2016-05-02 Thread Shreyas B Prabhu
On 05/03/2016 10:55 AM, Michael Neuling wrote: > >> diff --git a/arch/powerpc/include/asm/cputable.h >> b/arch/powerpc/include/asm/cputable.h >> index df4fb5f..a4739a1 100644 >> --- a/arch/powerpc/include/asm/cputable.h >> +++ b/arch/powerpc/include/asm/cputable.h >> @@ -205,6 +205,7 @@ enum {

[RFC 0/7] Enable ZONE_DEVICE on POWER

2016-05-02 Thread Anshuman Khandual
This series enables ZONE_DEVICE support on POWER. The TEST patches are just example usage of this newly enabled zone. Here are some of the logs from the example device driver. This demonstrates how struct pages can be allocated inside the device memory range itself and how usable memory will be les

[RFC 1/7] powerpc/mm: Make vmemmap_populate accommodate ZONE_DEVICE memory

2016-05-02 Thread Anshuman Khandual
Change the vmemmap_populate function to detect device memory through to_vmemmap_altmap and then call generic the __vmmemap_alloc_block_buf function instead of vmemmap_alloc_block as the earlier can allocate physical memory from the device range instead of the system RAM. Signed-off-by: Anshuman Kh

[RFC 3/7] powerpc/mm: Define TOP_ZONE as a constant

2016-05-02 Thread Anshuman Khandual
From: Oliver O'Halloran The zone that contains the top of the memory will be either ZONE_NORMAL or ZONE_HIGHMEM depending on the kernel config. There are two functions in there which require this information and both of them use an #ifdef to set a local variable (top_zone). This is a little nuts,

[RFC 2/7] powerpc/mm: Enable support for ZONE_DEVICE on PPC_BOOK3S_64 platforms

2016-05-02 Thread Anshuman Khandual
This enables support for the new ZONE_DEVCICE on PPC_BOOK3S_64 platforms which now accommodates device memory during memory hotplug operation. Signed-off-by: Oliver O'Halloran Signed-off-by: Anshuman Khandual --- arch/powerpc/Kconfig | 4 mm/Kconfig | 2 +- 2 files changed, 5 ins

[RFC 4/7] powerpc/mm: Set MAX_ZONE_PFN to 0 for all zones beyond TOP_ZONE

2016-05-02 Thread Anshuman Khandual
From: Oliver O'Halloran All the memory zones past TOP_ZONE are managed by generic mm code. Zone max PFN should be set to 0 instead of ~0UL since that's what the generic mm code expects. Without this, kernel assigns all pages into ZONE_DEVICE zone which is not part of buddy allocator, hence kernel

[RFC 5/7] mm/memremap: Export pfn_first, pfn_end, find_pagemap functions

2016-05-02 Thread Anshuman Khandual
This change exports two existing functions pfn_first, pfn_end and also defines a new one called find_pagemap. These functions are required to navigate through the memory which is hotplugged into the ZONE_DEVICE as device memory. Signed-off-by: Anshuman Khandual --- include/linux/memremap.h | 18

[RFC 6/7] TEST: Reserve system memory to be emulated as device memory

2016-05-02 Thread Anshuman Khandual
While booting, cap system memory at SYSRAM_END and start recording the memory from DEVRAM_START as reserved memory. Signed-off-by: Anshuman Khandual --- arch/powerpc/include/asm/prom.h | 15 +++ arch/powerpc/kernel/prom.c | 11 +++ 2 files changed, 26 insertions(+) diff

[RFC 7/7] TEST: Driver to test device memory through ZONE_DEVICE

2016-05-02 Thread Anshuman Khandual
This is an example driver with little bit of kernel hack to test ZONE_DEVICE based device memory management on POWER. Signed-off-by: Anshuman Khandual --- arch/powerpc/mm/init_64.c | 12 ++- arch/powerpc/platforms/pseries/Makefile | 2 +- arch/powerpc/platforms/pseries/rmem.c

Re: [PATCH 0/5] Use dma_pool_zalloc

2016-05-02 Thread Vinod Koul
On Fri, Apr 29, 2016 at 10:09:07PM +0200, Julia Lawall wrote: > Dma_pool_zalloc combines dma_pool_alloc and memset 0. The semantic patch > that makes this transformation is as follows: (http://coccinelle.lip6.fr/) Applied all dmaengine patches -- ~Vinod _