1. 09 Apr, 2017 6 commits
  2. 27 Jun, 2016 1 commit
    • Geoff Levand's avatar
      arm64: Add back cpu reset routines · f9076ecf
      Geoff Levand authored
      Commit 68234df4 ("arm64: kill flush_cache_all()") removed the global
      arm64 routines cpu_reset() and cpu_soft_restart() needed by the arm64
      kexec and kdump support.  Add back a simplified version of
      cpu_soft_restart() with some changes needed for kexec in the new files
      cpu_reset.S, and cpu_reset.h.
      
      When a CPU is reset it needs to be put into the exception level it had when
      it entered the kernel. Update cpu_soft_restart() to accept an argument
      which signals if the reset address should be entered at EL1 or EL2, and
      add a new hypercall HVC_SOFT_RESTART which is used for the EL2 switch.
      Signed-off-by: default avatarGeoff Levand <geoff@infradead.org>
      Reviewed-by: default avatarJames Morse <james.morse@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      f9076ecf
  3. 28 Apr, 2016 3 commits
    • James Morse's avatar
      arm64: hyp/kvm: Make hyp-stub reject kvm_call_hyp() · c94b0cf2
      James Morse authored
      A later patch implements kvm_arch_hardware_disable(), to remove kvm
      from el2, and re-instate the hyp-stub.
      
      This can happen while guests are running, particularly when kvm_reboot()
      calls kvm_arch_hardware_disable() on each cpu. This can interrupt a guest,
      remove kvm, then allow the guest to be scheduled again. This causes
      kvm_call_hyp() to be run against the hyp-stub.
      
      Change the hyp-stub to return a new exception type when this happens,
      and add code to kvm's handle_exit() to tell userspace we failed to
      enter the guest.
      Signed-off-by: default avatarJames Morse <james.morse@arm.com>
      Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      c94b0cf2
    • Geoff Levand's avatar
      arm64: hyp/kvm: Make hyp-stub extensible · ad72e59f
      Geoff Levand authored
      The existing arm64 hcall implementations are limited in that they only
      allow for two distinct hcalls; with the x0 register either zero or not
      zero.  Also, the API of the hyp-stub exception vector routines and the
      KVM exception vector routines differ; hyp-stub uses a non-zero value in
      x0 to implement __hyp_set_vectors, whereas KVM uses it to implement
      kvm_call_hyp.
      
      To allow for additional hcalls to be defined and to make the arm64 hcall
      API more consistent across exception vector routines, change the hcall
      implementations to reserve all x0 values below 0xfff for hcalls such
      as {s,g}et_vectors().
      
      Define two new preprocessor macros HVC_GET_VECTORS, and HVC_SET_VECTORS
      to be used as hcall type specifiers and convert the existing
      __hyp_get_vectors() and __hyp_set_vectors() routines to use these new
      macros when executing an HVC call.  Also, change the corresponding
      hyp-stub and KVM el1_sync exception vector routines to use these new
      macros.
      Signed-off-by: default avatarGeoff Levand <geoff@infradead.org>
      [Merged two hcall patches, moved immediate value from esr to x0, use lr
       as a scratch register, changed limit to 0xfff]
      Signed-off-by: default avatarJames Morse <james.morse@arm.com>
      Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      ad72e59f
    • James Morse's avatar
      arm64: kvm: Move lr save/restore from do_el2_call into EL1 · 00a44cda
      James Morse authored
      Today the 'hvc' calling KVM or the hyp-stub is expected to preserve all
      registers. KVM saves/restores the registers it needs on the EL2 stack using
      do_el2_call(). The hyp-stub has no stack, later patches need to be able to
      be able to clobber the link register.
      
      Move the link register save/restore to the the call sites.
      Signed-off-by: default avatarJames Morse <james.morse@arm.com>
      Acked-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      00a44cda
  4. 08 Jul, 2014 1 commit
  5. 05 Dec, 2012 1 commit