Re: [PATCH 1/3] powerpc: Relocate prom_init.c on 64bit

2012-12-04 Thread Benjamin Herrenschmidt
On Wed, 2012-12-05 at 11:07 +1100, Anton Blanchard wrote: > Hi Ben, > > > My only potential objection was that it might have been cleaner to > > actually build prom_init.c as a separate binary alltogether and piggy > > back it... > > Yeah, I went through a number of options before settling on thi

Re: [linuxppc-release][PATCH] powerpc/pci-hotplug: fix init issue of rescanned pci device

2012-12-04 Thread Benjamin Herrenschmidt
On Wed, 2012-12-05 at 10:31 +0800, Yuanquan Chen wrote: > On powerpc arch, some fixup work of PCI/PCI-e device is just done during the > first scan at booting time. For the PCI/PCI-e device rescanned after linux OS > booting up, the fixup work won't be done, which leads to dma_set_mask error or > i

Understanding how kernel updates MMU hash table

2012-12-04 Thread Pegasus11
Hello. Ive been trying to understand how an hash PTE is updated. Im on a PPC970MP machine which using the IBM PowerPC 604e core. My Linux version is 2.6.10 (I am sorry I cannot migrate at the moment. Management issues and I can't help :-(( ) Now onto the problem: hpte_update is invoked to sync t

Re: [Patch v4 08/12] memory-hotplug: remove memmap of sparse-vmemmap

2012-12-04 Thread Jianguo Wu
Hi Tang, On 2012/12/5 10:07, Tang Chen wrote: > Hi Wu, > > On 12/04/2012 08:20 PM, Jianguo Wu wrote: > (snip) >>> >>> Seems that we have different ways to handle pages allocated by bootmem >>> or by regular allocator. Is the checking way in [PATCH 09/12] available >>> here ? >>> >>> +/* boot

[linuxppc-release][PATCH] powerpc/pci-hotplug: fix init issue of rescanned pci device

2012-12-04 Thread Yuanquan Chen
On powerpc arch, some fixup work of PCI/PCI-e device is just done during the first scan at booting time. For the PCI/PCI-e device rescanned after linux OS booting up, the fixup work won't be done, which leads to dma_set_mask error or irq related issue in rescanned PCI/PCI-e device's driver. So, it

Re: [Patch v4 08/12] memory-hotplug: remove memmap of sparse-vmemmap

2012-12-04 Thread Tang Chen
Hi Wu, On 12/04/2012 08:20 PM, Jianguo Wu wrote: (snip) Seems that we have different ways to handle pages allocated by bootmem or by regular allocator. Is the checking way in [PATCH 09/12] available here ? +/* bootmem page has reserved flag */ +if (PageReserved(page)) { .. +}

Re: [PATCH 1/3] powerpc: Relocate prom_init.c on 64bit

2012-12-04 Thread Anton Blanchard
Hi Ben, > My only potential objection was that it might have been cleaner to > actually build prom_init.c as a separate binary alltogether and piggy > back it... Yeah, I went through a number of options before settling on this one. Move prom_init.c into arch/powerpc/boot Pros: - 32 bit enviro

Re: [PATCH 3/4 v5] iommu/fsl: Add iommu domain attributes required by fsl PAMU driver.

2012-12-04 Thread Scott Wood
On 12/04/2012 05:53:33 AM, Sethi Varun-B16395 wrote: > -Original Message- > From: Wood Scott-B07421 > Sent: Monday, December 03, 2012 10:34 PM > To: Sethi Varun-B16395 > Cc: Joerg Roedel; linux-ker...@vger.kernel.org; iommu@lists.linux- > foundation.org; Wood Scott-B07421; linuxppc-dev@

Re: [PATCH 1/2] vfio powerpc: enabled on powernv platform

2012-12-04 Thread Alex Williamson
On Tue, 2012-12-04 at 19:12 +1100, Alexey Kardashevskiy wrote: > On 04/12/12 04:35, Alex Williamson wrote: > > On Mon, 2012-12-03 at 13:52 +1100, Alexey Kardashevskiy wrote: > >> This patch initializes IOMMU groups based on the IOMMU > >> configuration discovered during the PCI scan on POWERNV > >>

Re: [PATCH] powerpc/pci-hotplug: fix the rescanned pci device's dma_set_mask issue

2012-12-04 Thread Kumar Gala
On Nov 28, 2012, at 11:34 AM, Kumar Gala wrote: > > On Nov 27, 2012, at 8:34 PM, Chen Yuanquan-B41889 wrote: > >> On 11/25/2012 08:41 PM, Kumar Gala wrote: >>> On Nov 22, 2012, at 10:29 PM, Yuanquan Chen wrote: >>> On powerpc arch, dma_ops of rescanned pci device after system's booting up

Re: [PATCH 2/4] powerpc: enable ARCH_USE_BUILTIN_BSWAP

2012-12-04 Thread David Woodhouse
On Tue, 2012-12-04 at 22:02 +1100, Stephen Rothwell wrote: > > +config ARCH_USE_BUILTIN_BSWAP > > + def_bool y > > + > > This should be defined as bool in arch/Kconfig (probably in the previous > patch) and then selected from appropriate architectures. Thanks. Updated series at git://git.

Re: [PATCH 4/4 v6] iommu/fsl: Freescale PAMU driver and IOMMU API implementation.

2012-12-04 Thread Tabi Timur-B04825
Sethi Varun-B16395 wrote: > This would in any case change with the new LIODN allocation scheme. I > intend on introducing the new scheme as a separate patch. At the very least, you should detect when an LIODN is too large and print an error message. -- Timur Tabi Linux kernel developer at Free

Re: [Patch v4 08/12] memory-hotplug: remove memmap of sparse-vmemmap

2012-12-04 Thread Jianguo Wu
Hi Tang, Thanks for your review and comments, Please see below for my reply. On 2012/12/4 17:13, Tang Chen wrote: > Hi Wu, > > Sorry to make noise here. Please see below. :) > > On 12/03/2012 10:23 AM, Jianguo Wu wrote: >> Signed-off-by: Jianguo Wu >> Signed-off-by: Jiang Liu >> --- >> inclu

RE: [PATCH 4/4 v6] iommu/fsl: Freescale PAMU driver and IOMMU API implementation.

2012-12-04 Thread Sethi Varun-B16395
> -Original Message- > From: Tabi Timur-B04825 > Sent: Tuesday, December 04, 2012 1:33 AM > To: Sethi Varun-B16395 > Cc: joerg.roe...@amd.com; io...@lists.linux-foundation.org; linuxppc- > d...@lists.ozlabs.org; linux-ker...@vger.kernel.org; Wood Scott-B07421 > Subject: Re: [PATCH 4/4 v6]

RE: [PATCH 3/4 v5] iommu/fsl: Add iommu domain attributes required by fsl PAMU driver.

2012-12-04 Thread Sethi Varun-B16395
> -Original Message- > From: Wood Scott-B07421 > Sent: Monday, December 03, 2012 10:34 PM > To: Sethi Varun-B16395 > Cc: Joerg Roedel; linux-ker...@vger.kernel.org; iommu@lists.linux- > foundation.org; Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; Tabi > Timur-B04825 > Subject: Re: [P

Re: [PATCH 2/4] powerpc: enable ARCH_USE_BUILTIN_BSWAP

2012-12-04 Thread Stephen Rothwell
Hi David, On Tue, 4 Dec 2012 10:15:28 + David Woodhouse wrote: > > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index a902a5c..b4ea516 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -78,6 +78,9 @@ config ARCH_HAS_ILOG2_U64 > bool > default y i

Re: [Patch v4 03/12] memory-hotplug: remove redundant codes

2012-12-04 Thread Tang Chen
On 12/04/2012 05:22 PM, Tang Chen wrote: On 11/27/2012 06:00 PM, Wen Congyang wrote: offlining memory blocks and checking whether memory blocks are offlined are very similar. This patch introduces a new function to remove redundant codes. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Chris

[PATCH 2/4] powerpc: enable ARCH_USE_BUILTIN_BSWAP

2012-12-04 Thread David Woodhouse
From: David Woodhouse By using the compiler intrinsics instead of hand-crafted opaque inline assembler for byte-swapping, we let the compiler see what's actually happening and it gets to use lwbrx/stwbrx instructions instead of a normal load/store coupled with a sequence of rlwimi instructions to

[PATCH 4/4] x86: add CONFIG_X86_MOVBE option

2012-12-04 Thread David Woodhouse
From: David Woodhouse Currently depends only on CONFIG_MATOM. This will change because big-core CPUs are getting movbe too... Signed-off-by: David Woodhouse --- arch/x86/Kconfig.cpu | 4 arch/x86/Makefile| 1 + 2 files changed, 5 insertions(+) diff --git a/arch/x86/Kconfig.cpu b/arch

[PATCH 1/4] byteorder: allow arch to opt to use GCC intrinsics for byteswapping

2012-12-04 Thread David Woodhouse
From: David Woodhouse Since GCC 4.4, there have been __builtin_bswap32() and __builtin_bswap16() intrinsics. A __builtin_bswap16() came a little later (4.6 for PowerPC, 48 for other platforms). By using these instead of the inline assembler that most architectures have in their __arch_swabXX() m

[PATCH 0/4] Use compiler intrinsics for byteswapping

2012-12-04 Thread David Woodhouse
This series of patches enables the __builtin_bswapXX() series of functions that have been supported since GCC 4.4. It allows GCC to emit load-and-swap or store-and-swap instructions on architectures which support that. -- David WoodhouseOpen Source Technology Centre da

[PATCH 3/4] x86: enable ARCH_USE_BUILTIN_BSWAP

2012-12-04 Thread David Woodhouse
From: David Woodhouse With -mmovbe enabled (implicit with -march=atom), this allows the compiler to use the movbe instruction. This doesn't have a significant effect on code size (unlike on PowerPC), because the movbe instruction actually takes as many bytes to encode as a simple mov and a bswap.

Re: [Patch v4 12/12] memory-hotplug: free node_data when a node is offlined

2012-12-04 Thread Tang Chen
On 11/27/2012 06:00 PM, Wen Congyang wrote: We call hotadd_new_pgdat() to allocate memory to store node_data. So we should free it when removing a node. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew M

Re: [Patch v4 11/12] memory-hotplug: remove sysfs file of node

2012-12-04 Thread Tang Chen
On 11/27/2012 06:00 PM, Wen Congyang wrote: This patch introduces a new function try_offline_node() to remove sysfs file of node when all memory sections of this node are removed. If some memory sections of this node are not removed, this function does nothing. CC: David Rientjes CC: Jiang Liu C

Re: [Patch v4 10/12] memory-hotplug: memory_hotplug: clear zone when removing the memory

2012-12-04 Thread Tang Chen
On 11/27/2012 06:00 PM, Wen Congyang wrote: From: Yasuaki Ishimatsu When a memory is added, we update zone's and pgdat's start_pfn and spanned_pages in the function __add_zone(). So we should revert them when the memory is removed. The patch adds a new function __remove_zone() to do this. CC:

Re: [Patch v4 08/12] memory-hotplug: remove memmap of sparse-vmemmap

2012-12-04 Thread Tang Chen
On 11/27/2012 06:00 PM, Wen Congyang wrote: static int __remove_section(struct zone *zone, struct mem_section *ms) { unsigned long flags; @@ -330,9 +317,9 @@ static int __remove_section(struct zone *zone, struct mem_section *ms) pgdat_resize_lock(pgdat,&flags); sparse

Re: [Patch v4 06/12] memory-hotplug: unregister memory section on SPARSEMEM_VMEMMAP

2012-12-04 Thread Tang Chen
On 11/27/2012 06:00 PM, Wen Congyang wrote: From: Yasuaki Ishimatsu Currently __remove_section for SPARSEMEM_VMEMMAP does nothing. But even if we use SPARSEMEM_VMEMMAP, we can unregister the memory_section. So the patch add unregister_memory_section() into __remove_section(). CC: David Rientje

Re: [Patch v4 05/12] memory-hotplug: introduce new function arch_remove_memory() for removing page table depends on architecture

2012-12-04 Thread Tang Chen
On 11/27/2012 06:00 PM, Wen Congyang wrote: For removing memory, we need to remove page table. But it depends on architecture. So the patch introduce arch_remove_memory() for removing page table. Now it only calls __remove_pages(). Note: __remove_pages() for some archtecuture is not implemented

Re: [Patch v4 03/12] memory-hotplug: remove redundant codes

2012-12-04 Thread Tang Chen
On 11/27/2012 06:00 PM, Wen Congyang wrote: offlining memory blocks and checking whether memory blocks are offlined are very similar. This patch introduces a new function to remove redundant codes. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Mo

Re: [Patch v4 02/12] memory-hotplug: check whether all memory blocks are offlined or not when removing memory

2012-12-04 Thread Tang Chen
On 11/27/2012 06:00 PM, Wen Congyang wrote: From: Yasuaki Ishimatsu We remove the memory like this: 1. lock memory hotplug 2. offline a memory block 3. unlock memory hotplug 4. repeat 1-3 to offline all memory blocks 5. lock memory hotplug 6. remove memory(TODO) 7. unlock memory hotplug All mem

Re: [Patch v4 01/12] memory-hotplug: try to offline the memory twice to avoid dependence

2012-12-04 Thread Tang Chen
On 11/27/2012 06:00 PM, Wen Congyang wrote: memory can't be offlined when CONFIG_MEMCG is selected. For example: there is a memory device on node 1. The address range is [1G, 1.5G). You will find 4 new directories memory8, memory9, memory10, and memory11 under the directory /sys/devices/system/me

Re: [Patch v4 08/12] memory-hotplug: remove memmap of sparse-vmemmap

2012-12-04 Thread Tang Chen
Hi Wu, Sorry to make noise here. Please see below. :) On 12/03/2012 10:23 AM, Jianguo Wu wrote: Signed-off-by: Jianguo Wu Signed-off-by: Jiang Liu --- include/linux/mm.h |1 + mm/sparse-vmemmap.c | 231 +++ mm/sparse.c |3 +-

Re: [PATCH 1/2] vfio powerpc: enabled on powernv platform

2012-12-04 Thread Alexey Kardashevskiy
On 04/12/12 04:35, Alex Williamson wrote: On Mon, 2012-12-03 at 13:52 +1100, Alexey Kardashevskiy wrote: This patch initializes IOMMU groups based on the IOMMU configuration discovered during the PCI scan on POWERNV (POWER non virtualized) platform. The IOMMU groups are to be used later by VFIO