20 Dec, 2011

1 commit

  • 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: Scott Wood
    Tested-by: Scott Wood

    Signed-off-by: Suzuki K. Poulose
    Cc: Scott Wood
    Cc: Kumar Gala
    Cc: Josh Boyer
    Cc: Benjamin Herrenschmidt
    Cc: linux ppc dev
    Signed-off-by: Josh Boyer

    Suzuki Poulose
     

04 Nov, 2011

1 commit


20 Sep, 2011

2 commits

  • 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: Scott Wood
    Signed-off-by: Benjamin Herrenschmidt

    Scott Wood
     
  • 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: Becky Bruce
    Signed-off-by: David Gibson
    Signed-off-by: Benjamin Herrenschmidt

    Becky Bruce
     

26 Jul, 2011

1 commit

  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (99 commits)
    drivers/virt: add missing linux/interrupt.h to fsl_hypervisor.c
    powerpc/85xx: fix mpic configuration in CAMP mode
    powerpc: Copy back TIF flags on return from softirq stack
    powerpc/64: Make server perfmon only built on ppc64 server devices
    powerpc/pseries: Fix hvc_vio.c build due to recent changes
    powerpc: Exporting boot_cpuid_phys
    powerpc: Add CFAR to oops output
    hvc_console: Add kdb support
    powerpc/pseries: Fix hvterm_raw_get_chars to accept < 16 chars, fixing xmon
    powerpc/irq: Quieten irq mapping printks
    powerpc: Enable lockup and hung task detectors in pseries and ppc64 defeconfigs
    powerpc: Add mpt2sas driver to pseries and ppc64 defconfig
    powerpc: Disable IRQs off tracer in ppc64 defconfig
    powerpc: Sync pseries and ppc64 defconfigs
    powerpc/pseries/hvconsole: Fix dropped console output
    hvc_console: Improve tty/console put_chars handling
    powerpc/kdump: Fix timeout in crash_kexec_wait_realmode
    powerpc/mm: Fix output of total_ram.
    powerpc/cpufreq: Add cpufreq driver for Momentum Maple boards
    powerpc: Correct annotations of pmu registration functions
    ...

    Fix up trivial Kconfig/Makefile conflicts in arch/powerpc, drivers, and
    drivers/cpufreq

    Linus Torvalds
     

12 Jul, 2011

2 commits

  • Previously, these macros hardcoded THREAD_EVR0 as the base of the save
    area, relative to the base register passed. This base offset is now
    passed as a separate macro parameter, allowing reuse with other SPE
    save areas, such as used by KVM.

    Acked-by: Kumar Gala
    Signed-off-by: Scott Wood
    Signed-off-by: Alexander Graf

    Scott Wood
     
  • giveup_spe() saves the SPE state which is protected by MSR[SPE].
    However, modifying SPEFSCR does not trap when MSR[SPE]=0.
    And since SPEFSCR is already saved/restored in _switch(),
    not all the callers want to save SPEFSCR again.
    Thus, saving SPEFSCR should not belong to giveup_spe().

    This patch moves SPEFSCR saving to flush_spe_to_thread(),
    and cleans up the caller that needs to save SPEFSCR accordingly.

    Signed-off-by: Liu Yu
    Acked-by: Kumar Gala
    Signed-off-by: Scott Wood
    Signed-off-by: Alexander Graf

    yu liu
     

23 Jun, 2011

1 commit

  • We expect this is actually faster, and we end up needing more space than we
    can get from the SPRGs in some instances. This is also useful when running
    as a guest OS - SPRGs4-7 do not have guest versions.

    8 slots are allocated in thread_info for this even though we only actually
    use 4 of them - this allows space for future code to have more scratch
    space (and we know we'll need it for things like hugetlb).

    Signed-off-by: Ashish Kalra
    Signed-off-by: Becky Bruce
    Signed-off-by: Kumar Gala

    Ashish Kalra
     

31 Mar, 2011

1 commit


29 Nov, 2010

1 commit


14 Oct, 2010

1 commit

  • First we check to see if we are the first core booting up. This
    is accomplished by comparing the boot_cpuid with -1, if it is we
    assume this is the first core coming up.

    Secondly, we need to update the initial thread info structure
    to reflect the actual cpu we are running on otherwise
    smp_processor_id() and related functions will return the default
    initialization value of the struct or 0.

    Signed-off-by: Matthew McClintock
    Signed-off-by: Kumar Gala

    Matthew McClintock
     

25 May, 2010

3 commits

  • This adds support kexec on FSL-BookE where the MMU can not be simply
    switched off. The code borrows the initial MMU-setup code to create the
    identical mapping mapping. The only difference to the original boot code
    is the size of the mapping(s) and the executeable address.
    The kexec code maps the first 2 GiB of memory in 256 MiB steps. This
    should work also on e500v1 boxes.
    SMP support is still not available.

    (Kumar: Added minor change to build to ifdef CONFIG_PPC_STD_MMU_64 some
    code that was PPC64 specific)

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Kumar Gala

    Sebastian Andrzej Siewior
     
  • This patch only moves the initial entry code which setups the mapping
    from what ever to KERNELBASE into a seperate file. No code change has
    been made here.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Kumar Gala

    Sebastian Andrzej Siewior
     
  • During boot we change the mapping a few times until we have a "defined"
    mapping. During this procedure a small 4KiB mapping is created and after
    that one a 64MiB. Currently the offset of the 4KiB page in that we run
    is zero because the complete startup up code is in first page which
    starts at RPN zero.
    If the code is recycled and moved to another location then its execution
    will fail because the start address in 64 MiB mapping is computed
    wrongly. It does not consider the offset to the page from the begin of
    the memory.
    This patch fixes this. Usually (system boot) r25 is zero so this does
    not change anything unless the code is recycled.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Kumar Gala

    Sebastian Andrzej Siewior
     

17 May, 2010

1 commit

  • 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: Li Yang
    Signed-off-by: Jin Qing
    Signed-off-by: Kumar Gala

    Li Yang
     

19 Mar, 2010

1 commit


17 Mar, 2010

1 commit


18 Feb, 2010

1 commit


21 Nov, 2009

1 commit

  • Re-write the code so its more standalone and fixed some issues:
    * Bump'd # of CAM entries to 64 to support e500mc
    * Make the code handle MAS7 properly
    * Use pr_cont instead of creating a string as we go

    Signed-off-by: Kumar Gala

    Kumar Gala
     

02 Sep, 2009

1 commit

  • Switch to using the Power ISA defined PTE format when we have a 64-bit
    PTE. This makes the code handling between fsl-booke and book3e-64
    similiar for TLB faults.

    Additionally this lets use take advantage of the page size encodings and
    full permissions that the HW PTE defines.

    Also defined _PMD_PRESENT, _PMD_PRESENT_MASK, and _PMD_BAD since the
    32-bit ppc arch code expects them.

    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Kumar Gala
     

27 Aug, 2009

1 commit

  • 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: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     

20 Aug, 2009

1 commit

  • 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: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     

27 Apr, 2009

1 commit

  • This has the consequence of changing the section name use for head
    code from ".text.head" to ".head.text". Since this commit changes all
    users in the architecture, this change should be harmless.

    Signed-off-by: Tim Abbott
    Cc: Benjamin Herrenschmidt
    Acked-by: Sam Ravnborg
    Signed-off-by: Linus Torvalds

    Tim Abbott
     

23 Feb, 2009

1 commit


13 Feb, 2009

1 commit

  • 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: Kumar Gala

    Kumar Gala
     

29 Jan, 2009

1 commit

  • 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: Kumar Gala

    Kumar Gala
     

14 Jan, 2009

1 commit


08 Jan, 2009

2 commits

  • This is a global variable defined in fsl_booke_mmu.c with a value that gets
    initialized in assembly code in head_fsl_booke.S.

    It's never used.

    If some code ever does want to know the number of entries in TLB1, then
    "numcams = mfspr(SPRN_TLB1CFG) & 0xfff", is a whole lot simpler than a
    global initialized during kernel boot from assembly.

    Signed-off-by: Trent Piepho
    Signed-off-by: Kumar Gala

    Trent Piepho
     
  • Some assembly code in head_fsl_booke.S hard-coded the size of struct tlbcam
    to 20 when it indexed the TLBCAM table. Anyone changing the size of struct
    tlbcam would not know to expect that.

    The kernel already has a system to get the size of C structures into
    assembly language files, asm-offsets, so let's use it.

    The definition of the struct gets moved to a header, so that asm-offsets.c
    can include it.

    Signed-off-by: Trent Piepho
    Signed-off-by: Kumar Gala

    Trent Piepho
     

21 Dec, 2008

1 commit

  • We're soon running out of CPU features and I need to add some new
    ones for various MMU related bits, so this patch separates the MMU
    features from the CPU features. I moved over the 32-bit MMU related
    ones, added base features for MMU type families, but didn't move
    over any 64-bit only feature yet.

    Signed-off-by: Benjamin Herrenschmidt
    Acked-by: Kumar Gala
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

03 Dec, 2008

4 commits

  • 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: Andy Fleming
    Signed-off-by: Trent Piepho
    Signed-off-by: Kumar Gala

    Kumar Gala
     
  • Removed unused branch labels

    Signed-off-by: Kumar Gala

    Kumar Gala
     
  • 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: Trent Piepho
    Signed-off-by: Kumar Gala

    Trent Piepho
     
  • 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: Liu Yu
    Signed-off-by: Kumar Gala

    Liu Yu
     

14 Oct, 2008

1 commit

  • b38fd42ff46a4a31dced8533e8a6e549693500b6 added false dependencys
    to order the load of upper and lower halfs of the pte, but only
    adjusted whitespace instead of deleting the old load in the iside
    handler, letting the hardware see the non-dependent load.

    This patch removes the extra load.

    Signed-off-by: Milton Miller
    Signed-off-by: Kumar Gala

    Milton Miller
     

25 Sep, 2008

1 commit

  • This rearranges a bit of code, and adds support for
    36-bit physical addressing for configs that use a
    hashed page table. The 36b physical support is not
    enabled by default on any config - it must be
    explicitly enabled via the config system.

    This patch *only* expands the page table code to accomodate
    large physical addresses on 32-bit systems and enables the
    PHYS_64BIT config option for 86xx. It does *not*
    allow you to boot a board with more than about 3.5GB of
    RAM - for that, SWIOTLB support is also required (and
    coming soon).

    Signed-off-by: Becky Bruce
    Signed-off-by: Kumar Gala

    Becky Bruce
     

20 Sep, 2008

1 commit


17 Jul, 2008

2 commits


26 Jun, 2008

1 commit

  • The e500 core enter DOZE/NAP power-saving modes when the core go to
    cpu_idle routine.

    The power management default running mode is DOZE, If the user

    echo 1 > /proc/sys/kernel/powersave-nap

    the system will change to NAP running mode.

    Signed-off-by: Dave Liu
    Signed-off-by: Kumar Gala

    Kumar Gala