1. 16 1月, 2018 3 次提交
    • J
      KVM: arm64: Handle RAS SErrors from EL1 on guest exit · 3368bd80
      James Morse 提交于
      We expect to have firmware-first handling of RAS SErrors, with errors
      notified via an APEI method. For systems without firmware-first, add
      some minimal handling to KVM.
      
      There are two ways KVM can take an SError due to a guest, either may be a
      RAS error: we exit the guest due to an SError routed to EL2 by HCR_EL2.AMO,
      or we take an SError from EL2 when we unmask PSTATE.A from __guest_exit.
      
      For SError that interrupt a guest and are routed to EL2 the existing
      behaviour is to inject an impdef SError into the guest.
      
      Add code to handle RAS SError based on the ESR. For uncontained and
      uncategorized errors arm64_is_fatal_ras_serror() will panic(), these
      errors compromise the host too. All other error types are contained:
      For the fatal errors the vCPU can't make progress, so we inject a virtual
      SError. We ignore contained errors where we can make progress as if
      we're lucky, we may not hit them again.
      
      If only some of the CPUs support RAS the guest will see the cpufeature
      sanitised version of the id registers, but we may still take RAS SError
      on this CPU. Move the SError handling out of handle_exit() into a new
      handler that runs before we can be preempted. This allows us to use
      this_cpu_has_cap(), via arm64_is_ras_serror().
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      3368bd80
    • J
      KVM: arm/arm64: mask/unmask daif around VHE guests · 4f5abad9
      James Morse 提交于
      Non-VHE systems take an exception to EL2 in order to world-switch into the
      guest. When returning from the guest KVM implicitly restores the DAIF
      flags when it returns to the kernel at EL1.
      
      With VHE none of this exception-level jumping happens, so KVMs
      world-switch code is exposed to the host kernel's DAIF values, and KVM
      spills the guest-exit DAIF values back into the host kernel.
      On entry to a guest we have Debug and SError exceptions unmasked, KVM
      has switched VBAR but isn't prepared to handle these. On guest exit
      Debug exceptions are left disabled once we return to the host and will
      stay this way until we enter user space.
      
      Add a helper to mask/unmask DAIF around VHE guests. The unmask can only
      happen after the hosts VBAR value has been synchronised by the isb in
      __vhe_hyp_call (via kvm_call_hyp()). Masking could be as late as
      setting KVMs VBAR value, but is kept here for symmetry.
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NJames Morse <james.morse@arm.com>
      Reviewed-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      4f5abad9
    • K
      KVM: arm/arm64: fix HYP ID map extension to 52 bits · 98732d1b
      Kristina Martsenko 提交于
      Commit fa2a8445 incorrectly masks the index of the HYP ID map pgd
      entry, causing a non-VHE kernel to hang during boot. This happens when
      VA_BITS=48 and the ID map text is in 52-bit physical memory. In this
      case we don't need an extra table level but need more entries in the
      top-level table, so we need to map into hyp_pgd and need to use
      __kvm_idmap_ptrs_per_pgd to mask in the extra bits. However,
      __create_hyp_mappings currently masks by PTRS_PER_PGD instead.
      
      Fix it so that we always use __kvm_idmap_ptrs_per_pgd for the HYP ID
      map. This ensures that we use the larger mask for the top-level ID map
      table when it has more entries. In all other cases, PTRS_PER_PGD is used
      as normal.
      
      Fixes: fa2a8445 ("arm64: allow ID map to be extended to 52 bits")
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NKristina Martsenko <kristina.martsenko@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      98732d1b
  2. 13 1月, 2018 1 次提交
  3. 12 1月, 2018 1 次提交
  4. 11 1月, 2018 1 次提交
  5. 09 1月, 2018 1 次提交
  6. 23 12月, 2017 2 次提交
  7. 18 12月, 2017 5 次提交
  8. 06 12月, 2017 1 次提交
  9. 05 12月, 2017 1 次提交
  10. 04 12月, 2017 1 次提交
  11. 01 12月, 2017 2 次提交
  12. 30 11月, 2017 2 次提交
  13. 29 11月, 2017 8 次提交
  14. 28 11月, 2017 3 次提交
  15. 10 11月, 2017 8 次提交