1. 08 5月, 2019 1 次提交
  2. 31 7月, 2018 1 次提交
    • W
      arm64: sdei: Mark sdei stack helper functions as static · eab1cecc
      Will Deacon 提交于
      The SDEI stack helper functions are only used by _on_sdei_stack() and
      refer to symbols (e.g. sdei_stack_normal_ptr) that are only defined if
      CONFIG_VMAP_STACK=y.
      
      Mark these functions as static, so we don't run into errors at link-time
      due to references to undefined symbols. Stick all the parameters onto
      the same line whilst we're passing through.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      eab1cecc
  3. 26 7月, 2018 1 次提交
  4. 15 1月, 2018 1 次提交
    • J
      arm64: sdei: Add trampoline code for remapping the kernel · 79e9aa59
      James Morse 提交于
      When CONFIG_UNMAP_KERNEL_AT_EL0 is set the SDEI entry point and the rest
      of the kernel may be unmapped when we take an event. If this may be the
      case, use an entry trampoline that can switch to the kernel page tables.
      
      We can't use the provided PSTATE to determine whether to switch page
      tables as we may have interrupted the kernel's entry trampoline, (or a
      normal-priority event that interrupted the kernel's entry trampoline).
      Instead test for a user ASID in ttbr1_el1.
      
      Save a value in regs->addr_limit to indicate whether we need to restore
      the original ASID when returning from this event. This value is only used
      by do_page_fault(), which we don't call with the SDEI regs.
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      79e9aa59
  5. 13 1月, 2018 1 次提交
    • J
      arm64: kernel: Add arch-specific SDEI entry code and CPU masking · f5df2696
      James Morse 提交于
      The Software Delegated Exception Interface (SDEI) is an ARM standard
      for registering callbacks from the platform firmware into the OS.
      This is typically used to implement RAS notifications.
      
      Such notifications enter the kernel at the registered entry-point
      with the register values of the interrupted CPU context. Because this
      is not a CPU exception, it cannot reuse the existing entry code.
      (crucially we don't implicitly know which exception level we interrupted),
      
      Add the entry point to entry.S to set us up for calling into C code. If
      the event interrupted code that had interrupts masked, we always return
      to that location. Otherwise we pretend this was an IRQ, and use SDEI's
      complete_and_resume call to return to vbar_el1 + offset.
      
      This allows the kernel to deliver signals to user space processes. For
      KVM this triggers the world switch, a quick spin round vcpu_run, then
      back into the guest, unless there are pending signals.
      
      Add sdei_mask_local_cpu() calls to the smp_send_stop() code, this covers
      the panic() code-path, which doesn't invoke cpuhotplug notifiers.
      
      Because we can interrupt entry-from/exit-to another EL, we can't trust the
      value in sp_el0 or x29, even if we interrupted the kernel, in this case
      the code in entry.S will save/restore sp_el0 and use the value in
      __entry_task.
      
      When we have VMAP stacks we can interrupt the stack-overflow test, which
      stirs x0 into sp, meaning we have to have our own VMAP stacks. For now
      these are allocated when we probe the interface. Future patches will add
      refcounting hooks to allow the arch code to allocate them lazily.
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      f5df2696