1. 04 5月, 2020 1 次提交
  2. 22 2月, 2020 1 次提交
  3. 16 1月, 2020 2 次提交
  4. 10 9月, 2019 1 次提交
  5. 05 7月, 2019 1 次提交
    • D
      KVM: arm64: Migrate _elx sysreg accessors to msr_s/mrs_s · fdec2a9e
      Dave Martin 提交于
      Currently, the {read,write}_sysreg_el*() accessors for accessing
      particular ELs' sysregs in the presence of VHE rely on some local
      hacks and define their system register encodings in a way that is
      inconsistent with the core definitions in <asm/sysreg.h>.
      
      As a result, it is necessary to add duplicate definitions for any
      system register that already needs a definition in sysreg.h for
      other reasons.
      
      This is a bit of a maintenance headache, and the reasons for the
      _el*() accessors working the way they do is a bit historical.
      
      This patch gets rid of the shadow sysreg definitions in
      <asm/kvm_hyp.h>, converts the _el*() accessors to use the core
      __msr_s/__mrs_s interface, and converts all call sites to use the
      standard sysreg #define names (i.e., upper case, with SYS_ prefix).
      
      This patch will conflict heavily anyway, so the opportunity
      to clean up some bad whitespace in the context of the changes is
      taken.
      
      The change exposes a few system registers that have no sysreg.h
      definition, due to msr_s/mrs_s being used in place of msr/mrs:
      additions are made in order to fill in the gaps.
      Signed-off-by: NDave Martin <Dave.Martin@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christoffer Dall <christoffer.dall@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Link: https://www.spinics.net/lists/kvm-arm/msg31717.html
      [Rebased to v4.21-rc1]
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      [Rebased to v5.2-rc5, changelog updates]
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      fdec2a9e
  6. 19 6月, 2019 1 次提交
  7. 25 4月, 2019 1 次提交
    • K
      arm64: sysreg: Make mrs_s and msr_s macros work with Clang and LTO · be604c61
      Kees Cook 提交于
      Clang's integrated assembler does not allow assembly macros defined
      in one inline asm block using the .macro directive to be used across
      separate asm blocks. LLVM developers consider this a feature and not a
      bug, recommending code refactoring:
      
        https://bugs.llvm.org/show_bug.cgi?id=19749
      
      As binutils doesn't allow macros to be redefined, this change uses
      UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros
      in-place and workaround gcc and clang limitations on redefining macros
      across different assembler blocks.
      
      Specifically, the current state after preprocessing looks like this:
      
      asm volatile(".macro mXX_s ... .endm");
      void f()
      {
      	asm volatile("mXX_s a, b");
      }
      
      With GCC, it gives macro redefinition error because sysreg.h is included
      in multiple source files, and assembler code for all of them is later
      combined for LTO (I've seen an intermediate file with hundreds of
      identical definitions).
      
      With clang, it gives macro undefined error because clang doesn't allow
      sharing macros between inline asm statements.
      
      I also seem to remember catching another sort of undefined error with
      GCC due to reordering of macro definition asm statement and generated
      asm code for function that uses the macro.
      
      The solution with defining and undefining for each use, while certainly
      not elegant, satisfies both GCC and clang, LTO and non-LTO.
      Co-developed-by: NAlex Matveev <alxmtvv@gmail.com>
      Co-developed-by: NYury Norov <ynorov@caviumnetworks.com>
      Co-developed-by: NSami Tolvanen <samitolvanen@google.com>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      be604c61
  8. 29 3月, 2019 1 次提交
  9. 20 2月, 2019 1 次提交
    • C
      KVM: arm/arm64: Factor out VMID into struct kvm_vmid · e329fb75
      Christoffer Dall 提交于
      In preparation for nested virtualization where we are going to have more
      than a single VMID per VM, let's factor out the VMID data into a
      separate VMID data structure and change the VMID allocator to operate on
      this new structure instead of using a struct kvm.
      
      This also means that udate_vttbr now becomes update_vmid, and that the
      vttbr itself is generated on the fly based on the stage 2 page table
      base address and the vmid.
      
      We cache the physical address of the pgd when allocating the pgd to
      avoid doing the calculation on every entry to the guest and to avoid
      calling into potentially non-hyp-mapped code from hyp/EL2.
      
      If we wanted to merge the VMID allocator with the arm64 ASID allocator
      at some point in the future, it should actually become easier to do that
      after this patch.
      
      Note that to avoid mapping the kvm_vmid_bits variable into hyp, we
      simply forego the masking of the vmid value in kvm_get_vttbr and rely on
      update_vmid to always assign a valid vmid value (within the supported
      range).
      Reviewed-by: NMarc Zyngier <marc.zyngier@arm.com>
      [maz: minor cleanups]
      Reviewed-by: NJulien Thierry <julien.thierry@arm.com>
      Signed-off-by: NChristoffer Dall <christoffer.dall@arm.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      e329fb75
  10. 10 12月, 2018 1 次提交
  11. 01 10月, 2018 2 次提交
  12. 19 3月, 2018 7 次提交
  13. 08 1月, 2018 1 次提交
  14. 06 11月, 2017 1 次提交
    • C
      KVM: arm/arm64: Move timer save/restore out of the hyp code · 688c50aa
      Christoffer Dall 提交于
      As we are about to be lazy with saving and restoring the timer
      registers, we prepare by moving all possible timer configuration logic
      out of the hyp code.  All virtual timer registers can be programmed from
      EL1 and since the arch timer is always a level triggered interrupt we
      can safely do this with interrupts disabled in the host kernel on the
      way to the guest without taking vtimer interrupts in the host kernel
      (yet).
      
      The downside is that the cntvoff register can only be programmed from
      hyp mode, so we jump into hyp mode and back to program it.  This is also
      safe, because the host kernel doesn't use the virtual timer in the KVM
      code.  It may add a little performance performance penalty, but only
      until following commits where we move this operation to vcpu load/put.
      Signed-off-by: NChristoffer Dall <cdall@linaro.org>
      Reviewed-by: NMarc Zyngier <marc.zyngier@arm.com>
      688c50aa
  15. 15 6月, 2017 1 次提交
  16. 08 9月, 2016 2 次提交
  17. 04 7月, 2016 2 次提交
  18. 29 3月, 2016 1 次提交
  19. 01 3月, 2016 6 次提交
  20. 14 12月, 2015 6 次提交