1. 20 11月, 2007 2 次提交
  2. 13 11月, 2007 2 次提交
    • S
      [POWERPC] Silence an annoying boot message · 6548d83a
      Stephen Rothwell 提交于
      vmemmap_populate will printk (with KERN_WARNING) for a lot of pages
      if CONFIG_SPARSEMEM_VMEMMAP is enabled (at least it does on iSeries).
      Use pr_debug for it instead.
      
      Replace the only other use of DBG in this file with pr_debug as well.
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      6548d83a
    • O
      [POWERPC] Fix CONFIG_SMP=n build error on ppc64 · 9bafbb0c
      Olof Johansson 提交于
      The patch "KVM: fix !SMP build error" change the way smp_call_function()
      actually uses the passed in function names on non-SMP builds.  So
      previously it was never caught that the function passed in was never
      actually defined.
      
      This causes a build error on ppc64_defconfig + CONFIG_SMP=n:
      
      arch/powerpc/mm/tlb_64.c: In function 'pgtable_free_now':
      arch/powerpc/mm/tlb_64.c:71: error: 'pte_free_smp_sync' undeclared (first use in this function)
      arch/powerpc/mm/tlb_64.c:71: error: (Each undeclared identifier is reported only once
      arch/powerpc/mm/tlb_64.c:71: error: for each function it appears in.)
      
      So we need to define it even if CONFIG_SMP is off. Either that or ifdef
      out the smp_call_function() call, but that's ugly.
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      9bafbb0c
  3. 08 11月, 2007 2 次提交
  4. 01 11月, 2007 3 次提交
    • G
      [POWERPC] ppc405 Fix arithmatic rollover bug when memory size under 16M · bd942ba3
      Grant Likely 提交于
      mmu_mapin_ram() loops over total_lowmem to setup page tables.  However, if
      total_lowmem is less that 16M, the subtraction rolls over and results in
      a number just under 4G (because total_lowmem is an unsigned value).
      
      This patch rejigs the loop from countup to countdown to eliminate the
      bug.
      
      Special thanks to Magnus Hjorth who wrote the original patch to fix this
      bug.  This patch improves on his by making the loop code simpler (which
      also eliminates the possibility of another rollover at the high end)
      and also applies the change to arch/powerpc.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NJosh Boyer <jwboyer@linux.vnet.ibm.com>
      bd942ba3
    • B
      [POWERPC] 4xx: Deal with 44x virtually tagged icache · b98ac05d
      Benjamin Herrenschmidt 提交于
      The 44x family has an interesting "feature" which is a virtually
      tagged instruction cache (yuck !). So far, we haven't dealt with
      it properly, which means we've been mostly lucky or people didn't
      report the problems, unless people have been running custom patches
      in their distro...
      
      This is an attempt at fixing it properly. I chose to do it by
      setting a global flag whenever we change a PTE that was previously
      marked executable, and flush the entire instruction cache upon
      return to user space when that happens.
      
      This is a bit heavy handed, but it's hard to do more fine grained
      flushes as the icbi instruction, on those processor, for some very
      strange reasons (since the cache is virtually mapped) still requires
      a valid TLB entry for reading in the target address space, which
      isn't something I want to deal with.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NJosh Boyer <jwboyer@linux.vnet.ibm.com>
      b98ac05d
    • B
      [POWERPC] 4xx: Fix 4xx flush_tlb_page() · e701d269
      Benjamin Herrenschmidt 提交于
      On 4xx CPUs, the current implementation of flush_tlb_page() uses
      a low level _tlbie() assembly function that only works for the
      current PID. Thus, invalidations caused by, for example, a COW
      fault triggered by get_user_pages() from a different context will
      not work properly, causing among other things, gdb breakpoints
      to fail.
      
      This patch adds a "pid" argument to _tlbie() on 4xx processors,
      and uses it to flush entries in the right context. FSL BookE
      also gets the argument but it seems they don't need it (their
      tlbivax form ignores the PID when invalidating according to the
      document I have).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NKumar Gala <galak@kernel.crashing.org>
      Signed-off-by: NJosh Boyer <jwboyer@linux.vnet.ibm.com>
      e701d269
  5. 29 10月, 2007 1 次提交
    • B
      [POWERPC] powerpc: Fix demotion of segments to 4K pages · f6ab0b92
      Benjamin Herrenschmidt 提交于
      When demoting a process to use 4K HW pages (instead of 64K), which
      happens under various circumstances such as doing cache inhibited
      mappings on machines that do not support 64K CI pages, the assembly
      hash code calls back into the C function flush_hash_page().  This
      function prototype was recently changed to accomodate for 1T segments
      but the assembly call site was not updated, causing applications that
      do demotion to hang.  In addition, when updating the per-CPU PACA for
      the new sizes, we didn't properly update the slice "map", thus causing
      the SLB miss code to re-insert segments for the wrong size.
      
      This fixes both and adds a warning comment next to the C
      implementation to try to avoid problems next time someone changes it.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      f6ab0b92
  6. 20 10月, 2007 1 次提交
    • S
      pid namespaces: define is_global_init() and is_container_init() · b460cbc5
      Serge E. Hallyn 提交于
      is_init() is an ambiguous name for the pid==1 check.  Split it into
      is_global_init() and is_container_init().
      
      A cgroup init has it's tsk->pid == 1.
      
      A global init also has it's tsk->pid == 1 and it's active pid namespace
      is the init_pid_ns.  But rather than check the active pid namespace,
      compare the task structure with 'init_pid_ns.child_reaper', which is
      initialized during boot to the /sbin/init process and never changes.
      
      Changelog:
      
      	2.6.22-rc4-mm2-pidns1:
      	- Use 'init_pid_ns.child_reaper' to determine if a given task is the
      	  global init (/sbin/init) process. This would improve performance
      	  and remove dependence on the task_pid().
      
      	2.6.21-mm2-pidns2:
      
      	- [Sukadev Bhattiprolu] Changed is_container_init() calls in {powerpc,
      	  ppc,avr32}/traps.c for the _exception() call to is_global_init().
      	  This way, we kill only the cgroup if the cgroup's init has a
      	  bug rather than force a kernel panic.
      
      [akpm@linux-foundation.org: fix comment]
      [sukadev@us.ibm.com: Use is_global_init() in arch/m32r/mm/fault.c]
      [bunk@stusta.de: kernel/pid.c: remove unused exports]
      [sukadev@us.ibm.com: Fix capability.c to work with threaded init]
      Signed-off-by: NSerge E. Hallyn <serue@us.ibm.com>
      Signed-off-by: NSukadev Bhattiprolu <sukadev@us.ibm.com>
      Acked-by: NPavel Emelianov <xemul@openvz.org>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: Cedric Le Goater <clg@fr.ibm.com>
      Cc: Dave Hansen <haveblue@us.ibm.com>
      Cc: Herbert Poetzel <herbert@13thfloor.at>
      Cc: Kirill Korotaev <dev@sw.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b460cbc5
  7. 17 10月, 2007 8 次提交
  8. 12 10月, 2007 1 次提交
    • P
      [POWERPC] Use 1TB segments · 1189be65
      Paul Mackerras 提交于
      This makes the kernel use 1TB segments for all kernel mappings and for
      user addresses of 1TB and above, on machines which support them
      (currently POWER5+, POWER6 and PA6T).
      
      We detect that the machine supports 1TB segments by looking at the
      ibm,processor-segment-sizes property in the device tree.
      
      We don't currently use 1TB segments for user addresses < 1T, since
      that would effectively prevent 32-bit processes from using huge pages
      unless we also had a way to revert to using 256MB segments.  That
      would be possible but would involve extra complications (such as
      keeping track of which segment size was used when HPTEs were inserted)
      and is not addressed here.
      
      Parts of this patch were originally written by Ben Herrenschmidt.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      1189be65
  9. 08 10月, 2007 1 次提交
    • D
      [POWERPC] 85xx: Failure with odd memory sizes and CONFIG_HIGHMEM · 873553b3
      Dale Farnsworth 提交于
      The CONFIG_FSL_BOOKE mmu setup code fails when CONFIG_HIGHMEM=y
      and the 3 fixed TLB entries cannot exactly map the lowmem size.
      Each TLB entry can map 4MB, 16MB, 64MB or 256MB, so the failure
      is observed when the kernel lowmem size is not equal to the
      sum of up to 3 of those values.
      
      Normally, memory is sized in nice numbers, but I observed this
      problem while testing a crash dump kernel.  The failure can
      also be observed by artificially reducing the kernel's main
      memory via the mem= kernel command line parameter.
      
      This commit fixes the problem by setting __initial_memory_limit
      in adjust_total_lowmem().
      Signed-off-by: NDale Farnsworth <dale@farnsworth.org>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      873553b3
  10. 04 10月, 2007 1 次提交
  11. 03 10月, 2007 2 次提交
  12. 19 9月, 2007 1 次提交
  13. 13 9月, 2007 1 次提交
  14. 25 8月, 2007 1 次提交
    • P
      [POWERPC] Fix SLB initialization at boot time · 175587cc
      Paul Mackerras 提交于
      This partially reverts edd0622b.
      
      It turns out that the part of that commit that aimed to ensure that we
      created an SLB entry for the kernel stack on secondary CPUs when
      starting the CPU didn't achieve its aim, and in fact caused a
      regression, because get_paca()->kstack is not initialized at the point
      where slb_initialize is called.
      
      This therefore just reverts that part of that commit, while keeping
      the change to slb_flush_and_rebolt, which is correct and necessary.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      175587cc
  15. 20 8月, 2007 2 次提交
  16. 17 8月, 2007 4 次提交
  17. 10 8月, 2007 2 次提交
    • B
      [POWERPC] Fix size check for hugetlbfs · d1f5a77f
      Benjamin Herrenschmidt 提交于
      My "slices" address space management code that was added in the 2.6.22
      implementation of get_unmapped_area() doesn't properly check that the
      size is a multiple of the requested page size.  This allows userland to
      create VMAs that aren't a multiple of the huge page size with hugetlbfs
      (since hugetlbfs entirely relies on get_unmapped_area() to do that
      checking) which leads to a kernel BUG() when such areas are torn down.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      d1f5a77f
    • P
      [POWERPC] Fix potential duplicate entry in SLB shadow buffer · edd0622b
      Paul Mackerras 提交于
      We were getting a duplicate entry in the SLB shadow buffer in
      slb_flush_and_rebolt() if the kernel stack was in the same segment
      as PAGE_OFFSET, which on POWER6 causes the hypervisor to terminate
      the partition with an error.  This fixes it.
      
      Also we were not creating an SLB entry (or an SLB shadow buffer
      entry) for the kernel stack on secondary CPUs when starting the
      CPU.  This isn't a major problem, since an appropriate entry will
      be created on demand, but this fixes that also for consistency.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      edd0622b
  18. 03 8月, 2007 3 次提交
  19. 26 7月, 2007 1 次提交
  20. 22 7月, 2007 1 次提交
    • P
      [POWERPC] Allow exec faults on readable areas on classic 32-bit PowerPC · 08ae6cc1
      Paul Mackerras 提交于
      Classic 32-bit PowerPC CPUs, and the early 64-bit PowerPC CPUs, don't
      provide a way to prevent execution from readable pages, that is, the
      MMU doesn't distinguish between data reads and instruction reads,
      although a different exception is taken for faults in data accesses
      and instruction accesses.
      
      Commit 9ba4ace3, in the course of
      fixing another bug, added a check that meant that a page fault due
      to an instruction access would fail if the vma did not have the
      VM_EXEC flag set.  This gives an inconsistent enforcement on these
      CPUs of the no-execute status of the vma (since reading from the page
      is sufficient to allow subsequent execution from it), and causes old
      versions of ppc32 glibc (2.2 and earlier) to fail, since they rely
      on executing the word before the GOT but don't have it marked
      executable.
      
      This fixes the problem by allowing execution from readable (or writable)
      areas on CPUs which do not provide separate control over data and
      instruction reads.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Acked-by: NJon Loeliger <jdl@freescale.com>
      08ae6cc1