1. 13 Oct, 2008 32 commits
  2. 12 Oct, 2008 5 commits
  3. 10 Oct, 2008 3 commits
    • Benjamin Herrenschmidt's avatar
      Merge commit 'jk/jk-merge' · bb3d55e2
      Benjamin Herrenschmidt authored
      bb3d55e2
    • Jon Tollefson's avatar
      powerpc: Reserve in bootmem lmb reserved regions that cross NUMA nodes · 8f64e1f2
      Jon Tollefson authored
      If there are multiple reserved memory blocks via lmb_reserve() that are
      contiguous addresses and on different NUMA nodes we are losing track of which
      address ranges to reserve in bootmem on which node.  I discovered this
      when I recently got to try 16GB huge pages on a system with more then 2 nodes.
      
      When scanning the device tree in early boot we call lmb_reserve() with
      the addresses of the 16G pages that we find so that the memory doesn't
      get used for something else.  For example the addresses for the pages
      could be 4000000000, 4400000000, 4800000000, 4C00000000, etc - 8 pages,
      one on each of eight nodes.  In the lmb after all the pages have been
      reserved it will look something like the following:
      
      lmb_dump_all:
          memory.cnt            = 0x2
          memory.size           = 0x3e80000000
          memory.region[0x0].base       = 0x0
                            .size     = 0x1e80000000
          memory.region[0x1].base       = 0x4000000000
                            .size     = 0x2000000000
          reserved.cnt          = 0x5
          reserved.size         = 0x3e80000000
          reserved.region[0x0].base       = 0x0
                            .size     = 0x7b5000
          reserved.region[0x1].base       = 0x2a00000
                            .size     = 0x78c000
          reserved.region[0x2].base       = 0x328c000
                            .size     = 0x43000
          reserved.region[0x3].base       = 0xf4e8000
                            .size     = 0xb18000
          reserved.region[0x4].base       = 0x4000000000
                            .size     = 0x2000000000
      
      The reserved.region[0x4] contains the 16G pages.  In
      arch/powerpc/mm/num.c: do_init_bootmem() we loop through each of the
      node numbers looking for the reserved regions that belong to the
      particular node.  It is not able to identify region 0x4 as being a part
      of each of the 8 nodes.  It is assuming that a reserved region is only
      on a single node.
      
      This patch takes out the reserved region loop from inside
      the loop that goes over each node.  It looks up the active region containing
      the start of the reserved region.  If it extends past that active region then
      it adjusts the size and gets the next active region containing it.
      Signed-off-by: default avatarJon Tollefson <kniht@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8f64e1f2
    • Paul Mackerras's avatar
      powerpc: Sync RPA note in zImage with kernel's RPA note · 91a00302
      Paul Mackerras authored
      Commit 9b09c6d9 ("powerpc: Change the
      default link address for pSeries zImage kernels") changed the
      real-base value in the CHRP note added by the addnote program from
      12MB to 32MB to give more space for Open Firmware to load the zImage.
      (The real-base value says where we want OF to position itself in
      memory.)  However, this change was ineffective on most pSeries
      machines, because the RPA note added by addnote has the "ignore me"
      flag set to 1.  This was intended to tell OF to ignore just the RPA
      note, but has the side effect of also making OF ignore the CHRP note
      (at least on most pSeries machines).
      
      To solve this we have to set the "ignore me" flag to 0 in the RPA
      note.  (We can't just omit the RPA note because that is equivalent to
      having an RPA note with default values, and the default values are not
      what we want.)  However, then we have to make sure the values in the
      zImage's RPA note match up with the values that the kernel supplies
      later in prom_init.c with either the ibm,client-architecture-support
      call or the process-elf-header call in prom_send_capabilities().
      
      So this sets the "ignore me" flag in the RPA note in addnote to 0, and
      adjusts the RPA note values in addnote.c and in prom_init.c to be
      consistent with each other and with the values in ibm_architecture_vec.
      
      However, since the wrapper is independent of the kernel, this doesn't
      ensure that the notes will stay consistent.  To ensure that, this adds
      code to addnote.c so that it can extract the kernel's RPA note from
      the kernel binary and put that in the zImage.  To that end, we put the
      kernel's fake ELF header (which contains the kernel's RPA note) into
      its own section, and arrange for wrapper to pull out that section with
      objcopy and pass it to addnote, which then extracts the RPA note from
      it and transfers it to the zImage.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      91a00302