1. 11 7月, 2012 1 次提交
  2. 10 7月, 2012 1 次提交
  3. 30 4月, 2012 1 次提交
  4. 08 4月, 2012 2 次提交
  5. 09 3月, 2012 1 次提交
    • B
      powerpc: Call do_page_fault() with interrupts off · a546498f
      Benjamin Herrenschmidt 提交于
      We currently turn interrupts back to their previous state before
      calling do_page_fault(). This can be annoying when debugging as
      a bad fault will potentially have lost some processor state before
      getting into the debugger.
      
      We also end up calling some generic code with interrupts enabled
      such as notify_page_fault() with interrupts enabled, which could
      be unexpected.
      
      This changes our code to behave more like other architectures,
      and make the assembly entry code call into do_page_faults() with
      interrupts disabled. They are conditionally re-enabled from
      within do_page_fault() in the same spot x86 does it.
      
      While there, add the might_sleep() test in the case of a successful
      trylock of the mmap semaphore, again like x86.
      
      Also fix a bug in the existing assembly where r12 (_MSR) could get
      clobbered by C calls (the DTL accounting in the exception common
      macro and DISABLE_INTS) in some cases.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ---
      
      v2. Add the r12 clobber fix
      a546498f
  6. 20 12月, 2011 1 次提交
    • S
      powerpc: Rename mapping based RELOCATABLE to DYNAMIC_MEMSTART for BookE · 0f890c8d
      Suzuki Poulose 提交于
      The current implementation of CONFIG_RELOCATABLE in BookE is based
      on mapping the page aligned kernel load address to KERNELBASE. This
      approach however is not enough for platforms, where the TLB page size
      is large (e.g, 256M on 44x). So we are renaming the RELOCATABLE used
      currently in BookE to DYNAMIC_MEMSTART to reflect the actual method.
      
      The CONFIG_RELOCATABLE for PPC32(BookE) based on processing of the
      dynamic relocations will be introduced in the later in the patch series.
      
      This change would allow the use of the old method of RELOCATABLE for
      platforms which can afford to enforce the page alignment (platforms with
      smaller TLB size).
      
      Changes since v3:
      
      * Introduced a new config, NONSTATIC_KERNEL, to denote a kernel which is
        either a RELOCATABLE or DYNAMIC_MEMSTART(Suggested by: Josh Boyer)
      Suggested-by: NScott Wood <scottwood@freescale.com>
      Tested-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NSuzuki K. Poulose <suzuki@in.ibm.com>
      Cc: Scott Wood <scottwood@freescale.com>
      Cc: Kumar Gala <galak@kernel.crashing.org>
      Cc: Josh Boyer <jwboyer@gmail.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: linux ppc dev <linuxppc-dev@lists.ozlabs.org>
      Signed-off-by: NJosh Boyer <jwboyer@gmail.com>
      0f890c8d
  7. 04 11月, 2011 1 次提交
  8. 20 9月, 2011 2 次提交
    • S
      powerpc/32: Pass device tree address as u64 to machine_init · 6dece0eb
      Scott Wood 提交于
      u64 is used rather than phys_addr_t to keep things simple, as
      this is called from assembly code.
      
      Update callers to pass a 64-bit address in r3/r4.  Other unused
      register assignments that were once parameters to machine_init
      are dropped.
      
      For FSL BookE, look up the physical address of the device tree from the
      effective address passed in r3 by the loader.  This is required for
      situations where memory does not start at zero (due to AMP or IOMMU-less
      virtualization), and thus the IMA doesn't start at zero, and thus the
      device tree effective address does not equal the physical address.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      6dece0eb
    • B
      powerpc: Hugetlb for BookE · 41151e77
      Becky Bruce 提交于
      Enable hugepages on Freescale BookE processors.  This allows the kernel to
      use huge TLB entries to map pages, which can greatly reduce the number of
      TLB misses and the amount of TLB thrashing experienced by applications with
      large memory footprints.  Care should be taken when using this on FSL
      processors, as the number of large TLB entries supported by the core is low
      (16-64) on current processors.
      
      The supported set of hugepage sizes include 4m, 16m, 64m, 256m, and 1g.
      Page sizes larger than the max zone size are called "gigantic" pages and
      must be allocated on the command line (and cannot be deallocated).
      
      This is currently only fully implemented for Freescale 32-bit BookE
      processors, but there is some infrastructure in the code for
      64-bit BooKE.
      Signed-off-by: NBecky Bruce <beckyb@kernel.crashing.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      41151e77
  9. 12 7月, 2011 2 次提交
  10. 23 6月, 2011 1 次提交
  11. 31 3月, 2011 1 次提交
  12. 29 11月, 2010 1 次提交
  13. 14 10月, 2010 1 次提交
  14. 25 5月, 2010 3 次提交
  15. 17 5月, 2010 1 次提交
    • L
      powerpc/fsl-booke: Fix InstructionTLBError execute permission check · 78e2e68a
      Li Yang 提交于
      In CONFIG_PTE_64BIT the PTE format has unique permission bits for user
      and supervisor execute.  However on !CONFIG_PTE_64BIT we overload the
      supervisor bit to imply user execute with _PAGE_USER set.  This allows
      us to use the same permission check mask for user or supervisor code on
      !CONFIG_PTE_64BIT.
      
      However, on CONFIG_PTE_64BIT we map _PAGE_EXEC to _PAGE_BAP_UX so we
      need a different permission mask based on the fault coming from a kernel
      address or user space.
      
      Without unique permission masks we see issues like the following with
      modules:
      
      Unable to handle kernel paging request for instruction fetch
      Faulting instruction address: 0xf938d040
      Oops: Kernel access of bad area, sig: 11 [#1]
      Signed-off-by: NLi Yang <leoli@freescale.com>
      Signed-off-by: NJin Qing <b24347@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      78e2e68a
  16. 14 5月, 2010 1 次提交
    • L
      powerpc/fsl-booke: Fix InstructionTLBError execute permission check · fa6bd996
      Li Yang 提交于
      In CONFIG_PTE_64BIT the PTE format has unique permission bits for user
      and supervisor execute.  However on !CONFIG_PTE_64BIT we overload the
      supervisor bit to imply user execute with _PAGE_USER set.  This allows
      us to use the same permission check mask for user or supervisor code on
      !CONFIG_PTE_64BIT.
      
      However, on CONFIG_PTE_64BIT we map _PAGE_EXEC to _PAGE_BAP_UX so we
      need a different permission mask based on the fault coming from a kernel
      address or user space.
      
      Without unique permission masks we see issues like the following with
      modules:
      
      Unable to handle kernel paging request for instruction fetch
      Faulting instruction address: 0xf938d040
      Oops: Kernel access of bad area, sig: 11 [#1]
      Signed-off-by: NLi Yang <leoli@freescale.com>
      Signed-off-by: NJin Qing <b24347@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      fa6bd996
  17. 19 3月, 2010 1 次提交
  18. 17 3月, 2010 1 次提交
  19. 18 2月, 2010 1 次提交
  20. 21 11月, 2009 1 次提交
  21. 02 9月, 2009 1 次提交
  22. 27 8月, 2009 1 次提交
    • B
      powerpc/mm: Cleanup handling of execute permission · ea3cc330
      Benjamin Herrenschmidt 提交于
      This is an attempt at cleaning up a bit the way we handle execute
      permission on powerpc. _PAGE_HWEXEC is gone, _PAGE_EXEC is now only
      defined by CPUs that can do something with it, and the myriad of
      #ifdef's in the I$/D$ coherency code is reduced to 2 cases that
      hopefully should cover everything.
      
      The logic on BookE is a little bit different than what it was though
      not by much. Since now, _PAGE_EXEC will be set by the generic code
      for executable pages, we need to filter out if they are unclean and
      recover it. However, I don't expect the code to be more bloated than
      it already was in that area due to that change.
      
      I could boast that this brings proper enforcing of per-page execute
      permissions to all BookE and 40x but in fact, we've had that now for
      some time as a side effect of my previous rework in that area (and
      I didn't even know it :-) We would only enable execute permission if
      the page was cache clean and we would only cache clean it if we took
      and exec fault. Since we now enforce that the later only work if
      VM_EXEC is part of the VMA flags, we de-fact already enforce per-page
      execute permissions... Unless I missed something
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ea3cc330
  23. 20 8月, 2009 1 次提交
    • B
      powerpc: Use names rather than numbers for SPRGs (v2) · ee43eb78
      Benjamin Herrenschmidt 提交于
      The kernel uses SPRG registers for various purposes, typically in
      low level assembly code as scratch registers or to hold per-cpu
      global infos such as the PACA or the current thread_info pointer.
      
      We want to be able to easily shuffle the usage of those registers
      as some implementations have specific constraints realted to some
      of them, for example, some have userspace readable aliases, etc..
      and the current choice isn't always the best.
      
      This patch should not change any code generation, and replaces the
      usage of SPRN_SPRGn everywhere in the kernel with a named replacement
      and adds documentation next to the definition of the names as to
      what those are used for on each processor family.
      
      The only parts that still use the original numbers are bits of KVM
      or suspend/resume code that just blindly needs to save/restore all
      the SPRGs.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ee43eb78
  24. 27 4月, 2009 1 次提交
  25. 23 2月, 2009 1 次提交
  26. 13 2月, 2009 1 次提交
    • K
      powerpc/fsl-booke: Add new ISA 2.06 page sizes and MAS defines · d66c82ea
      Kumar Gala 提交于
      The Power ISA 2.06 added power of two page sizes to the embedded MMU
      architecture.  Its done it such a way to be code compatiable with the
      existing HW.  Made the minor code changes to support both power of two
      and power of four page sizes.  Also added some new MAS bits and macros
      that are defined as part of the 2.06 ISA.  Renamed some things to use
      the 'Book-3e' concept to convey the new MMU that is based on the
      Freescale Book-E MMU programming model.
      
      Note, its still invalid to try and use a page size that isn't supported
      by cpu.
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      d66c82ea
  27. 29 1月, 2009 1 次提交
    • K
      powerpc/fsl-booke: Cleanup init/exception setup to be runtime · 105c31df
      Kumar Gala 提交于
      We currently have a few variants of fsl-booke processors (e500v1, e500v2,
      e500mc, and e200).  They all have minor differences that we had previously
      been handling via ifdefs.
      
      To move towards having this support the following changes have been made:
      
      * PID1, PID2 only exist on e500v1 & e500v2 and should not be accessed on
        e500mc or e200.  We use MMUCFG[NPIDS] to determine which case we are
        since we only touch PID1/2 in extremely early init code.
      
      * Not all IVORs exist on all the processors so introduce cpu_setup
        functions for each variant to setup the proper IVORs that are either
        unique or exist but have some variations between the processors
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      105c31df
  28. 14 1月, 2009 1 次提交
  29. 08 1月, 2009 2 次提交
  30. 21 12月, 2008 1 次提交
  31. 03 12月, 2008 4 次提交
    • K
      powerpc/85xx: Add support for SMP initialization · d5b26db2
      Kumar Gala 提交于
      Added 85xx specifc smp_ops structure.  We use ePAPR style boot release
      and the MPIC for IPIs at this point.
      
      Additionally added routines for secondary cpu entry and initializtion.
      Signed-off-by: NAndy Fleming <afleming@freescale.com>
      Signed-off-by: NTrent Piepho <tpiepho@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      d5b26db2
    • K
      powerpc/85xx: minor head_fsl_booke.S cleanup · 06b90969
      Kumar Gala 提交于
      Removed unused branch labels
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      06b90969
    • T
      powerpc: Better setup of boot page TLB entry · b3898895
      Trent Piepho 提交于
      The initial TLB mapping for the kernel boot didn't set the memory coherent
      attribute, MAS2[M], in SMP mode.
      
      If this code supported booting a secondary processor, which it doesn't yet,
      but if it did, then when a secondary processor boots, it would probably signal
      the primary processor by setting a variable called something like
      __secondary_hold_acknowledge.  However, due to the lack of the M bit, the
      primary processor would not snoop the transaction (even if a transaction were
      broadcast).  If primary CPU's L1 D-cache had a copy, it would not be flushed
      and the CPU would never see the ack.  Which would have resulted in the primary
      CPU spinning for a long time, perhaps a full second before it gives up, while
      it would have waited for the ack from the secondary CPU that it wouldn't have
      been able to see because of the stale cache.
      
      The value of MAS2 for the boot page TLB1 entry is a compile time constant,
      so there is no need to calculate it in powerpc assembly language.
      
      Also, from the MPC8572 manual section 6.12.5.3, "Bits that represent
      offsets within a page are ignored and should be cleared." Existing code
      didn't clear them, this code does.
      
      The same when the page of KERNELBASE is found; we don't need to use asm to
      mask the lower 12 bits off.
      
      In the code that computes the address to rfi from, don't hard code the
      offset to 24 bytes, but have the assembler figure that out for us.
      Signed-off-by: NTrent Piepho <tpiepho@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      b3898895
    • L
      powerpc: Add SPE/EFP math emulation for E500v1/v2 processors. · 6a800f36
      Liu Yu 提交于
      This patch add the handlers of SPE/EFP exceptions.
      The code is used to emulate float point arithmetic,
      when MSR(SPE) is enabled and receive EFP data interrupt or EFP round interrupt.
      
      This patch has no conflict with or dependence on FP math-emu.
      
      The code has been tested by TestFloat.
      
      Now the code doesn't support SPE/EFP instructions emulation
      (it won't be called when receive program interrupt),
      but it could be easily added.
      Signed-off-by: NLiu Yu <yu.liu@freescale.com>
      Signed-off-by: NKumar Gala <galak@kernel.crashing.org>
      6a800f36