1. 10 7月, 2012 1 次提交
    • W
      ARM: 7445/1: mm: update CONTEXTIDR register to contain PID of current process · 575320d6
      Will Deacon 提交于
      This patch introduces a new Kconfig option which, when enabled, causes
      the kernel to write the PID of the current task into the PROCID field
      of the CONTEXTIDR on context switch. This is useful when analysing
      hardware trace, since writes to this register can be configured to emit
      an event into the trace stream.
      
      The thread notifier for writing the PID is deliberately kept separate
      from the ASID-writing code so that we can support newer processors using
      LPAE, where the ASID is stored in TTBR0. As such, the switch_mm code is
      updated to perform a read-modify-write sequence to ensure that we don't
      clobber the PID on CPUs using the classic 2-level page tables.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      575320d6
  2. 17 4月, 2012 2 次提交
    • C
      ARM: Remove __ARCH_WANT_INTERRUPTS_ON_CTXSW on ASID-capable CPUs · 7fec1b57
      Catalin Marinas 提交于
      Since the ASIDs must be unique to an mm across all the CPUs in a system,
      the __new_context() function needs to broadcast a context reset event to
      all the CPUs during ASID allocation if a roll-over occurred. Such IPIs
      cannot be issued with interrupts disabled and ARM had to define
      __ARCH_WANT_INTERRUPTS_ON_CTXSW.
      
      This patch changes the check_context() function to
      check_and_switch_context() called from switch_mm(). In case of
      ASID-capable CPUs (ARMv6 onwards), if a new ASID is needed and the
      interrupts are disabled, it defers the __new_context() and
      cpu_switch_mm() calls to the post-lock switch hook where the interrupts
      are enabled. Setting the reserved TTBR0 was also moved to
      check_and_switch_context() from cpu_v7_switch_mm().
      Reviewed-by: NWill Deacon <will.deacon@arm.com>
      Tested-by: NWill Deacon <will.deacon@arm.com>
      Reviewed-by: NFrank Rowand <frank.rowand@am.sony.com>
      Tested-by: NMarc Zyngier <Marc.Zyngier@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      7fec1b57
    • W
      ARM: Use TTBR1 instead of reserved context ID · 3c5f7e7b
      Will Deacon 提交于
      On ARMv7 CPUs that cache first level page table entries (like the
      Cortex-A15), using a reserved ASID while changing the TTBR or flushing
      the TLB is unsafe.
      
      This is because the CPU may cache the first level entry as the result of
      a speculative memory access while the reserved ASID is assigned. After
      the process owning the page tables dies, the memory will be reallocated
      and may be written with junk values which can be interpreted as global,
      valid PTEs by the processor. This will result in the TLB being populated
      with bogus global entries.
      
      This patch avoids the use of a reserved context ID in the v7 switch_mm
      and ASID rollover code by temporarily using the swapper_pg_dir pointed
      at by TTBR1, which contains only global entries that are not tagged
      with ASIDs.
      Reviewed-by: NFrank Rowand <frank.rowand@am.sony.com>
      Tested-by: NMarc Zyngier <Marc.Zyngier@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      [catalin.marinas@arm.com: add LPAE support]
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      3c5f7e7b
  3. 08 12月, 2011 1 次提交