1. 20 12月, 2021 1 次提交
  2. 21 10月, 2021 1 次提交
    • M
      arm64/sve: Put system wide vector length information into structs · b5bc00ff
      Mark Brown 提交于
      With the introduction of SME we will have a second vector length in the
      system, enumerated and configured in a very similar fashion to the
      existing SVE vector length.  While there are a few differences in how
      things are handled this is a relatively small portion of the overall
      code so in order to avoid code duplication we factor out
      
      We create two structs, one vl_info for the static hardware properties
      and one vl_config for the runtime configuration, with an array
      instantiated for each and update all the users to reference these. Some
      accessor functions are provided where helpful for readability, and the
      write to set the vector length is put into a function since the system
      register being updated needs to be chosen at compile time.
      
      This is a mostly mechanical replacement, further work will be required
      to actually make things generic, ensuring that we handle those places
      where there are differences properly.
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Link: https://lore.kernel.org/r/20211019172247.3045838-8-broonie@kernel.orgSigned-off-by: NWill Deacon <will@kernel.org>
      b5bc00ff
  3. 17 10月, 2021 1 次提交
  4. 19 8月, 2021 1 次提交
  5. 18 8月, 2021 1 次提交
  6. 11 8月, 2021 2 次提交
  7. 22 6月, 2021 1 次提交
  8. 27 5月, 2021 1 次提交
  9. 10 4月, 2021 1 次提交
    • M
      KVM: arm64: Fully zero the vcpu state on reset · 85d70374
      Marc Zyngier 提交于
      On vcpu reset, we expect all the registers to be brought back
      to their initial state, which happens to be a bunch of zeroes.
      
      However, some recent commit broke this, and is now leaving a bunch
      of registers (such as the FP state) with whatever was left by the
      guest. My bad.
      
      Zero the reset of the state (32bit SPSRs and FPSIMD state).
      
      Cc: stable@vger.kernel.org
      Fixes: e47c2055 ("KVM: arm64: Make struct kvm_regs userspace-only")
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      85d70374
  10. 19 3月, 2021 1 次提交
  11. 18 3月, 2021 1 次提交
  12. 12 3月, 2021 1 次提交
    • M
      KVM: arm64: Reject VM creation when the default IPA size is unsupported · 7d717558
      Marc Zyngier 提交于
      KVM/arm64 has forever used a 40bit default IPA space, partially
      due to its 32bit heritage (where the only choice is 40bit).
      
      However, there are implementations in the wild that have a *cough*
      much smaller *cough* IPA space, which leads to a misprogramming of
      VTCR_EL2, and a guest that is stuck on its first memory access
      if userspace dares to ask for the default IPA setting (which most
      VMMs do).
      
      Instead, blundly reject the creation of such VM, as we can't
      satisfy the requirements from userspace (with a one-off warning).
      Also clarify the boot warning, and document that the VM creation
      will fail when an unsupported IPA size is provided.
      
      Although this is an ABI change, it doesn't really change much
      for userspace:
      
      - the guest couldn't run before this change, but no error was
        returned. At least userspace knows what is happening.
      
      - a memory slot that was accepted because it did fit the default
        IPA space now doesn't even get a chance to be registered.
      
      The other thing that is left doing is to convince userspace to
      actually use the IPA space setting instead of relying on the
      antiquated default.
      
      Fixes: 233a7cb2 ("kvm: arm64: Allow tuning the physical address size for VM")
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      Cc: stable@vger.kernel.org
      Reviewed-by: NAndrew Jones <drjones@redhat.com>
      Reviewed-by: NEric Auger <eric.auger@redhat.com>
      Link: https://lore.kernel.org/r/20210311100016.3830038-2-maz@kernel.org
      7d717558
  13. 10 3月, 2021 1 次提交
  14. 28 11月, 2020 1 次提交
  15. 27 11月, 2020 1 次提交
  16. 10 11月, 2020 1 次提交
  17. 29 9月, 2020 1 次提交
  18. 11 9月, 2020 1 次提交
  19. 07 7月, 2020 1 次提交
  20. 22 6月, 2020 2 次提交
  21. 29 5月, 2020 1 次提交
  22. 28 5月, 2020 1 次提交
  23. 21 5月, 2020 1 次提交
  24. 20 5月, 2020 1 次提交
  25. 16 5月, 2020 1 次提交
  26. 28 4月, 2020 1 次提交
  27. 28 1月, 2020 2 次提交
  28. 19 6月, 2019 1 次提交
  29. 24 4月, 2019 2 次提交
    • A
      KVM: arm64: Add capability to advertise ptrauth for guest · a243c16d
      Amit Daniel Kachhap 提交于
      This patch advertises the capability of two cpu feature called address
      pointer authentication and generic pointer authentication. These
      capabilities depend upon system support for pointer authentication and
      VHE mode.
      
      The current arm64 KVM partially implements pointer authentication and
      support of address/generic authentication are tied together. However,
      separate ABI requirements for both of them is added so that any future
      isolated implementation will not require any ABI changes.
      Signed-off-by: NAmit Daniel Kachhap <amit.kachhap@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Christoffer Dall <christoffer.dall@arm.com>
      Cc: kvmarm@lists.cs.columbia.edu
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      a243c16d
    • A
      KVM: arm64: Add userspace flag to enable pointer authentication · a22fa321
      Amit Daniel Kachhap 提交于
      Now that the building blocks of pointer authentication are present, lets
      add userspace flags KVM_ARM_VCPU_PTRAUTH_ADDRESS and
      KVM_ARM_VCPU_PTRAUTH_GENERIC. These flags will enable pointer
      authentication for the KVM guest on a per-vcpu basis through the ioctl
      KVM_ARM_VCPU_INIT.
      
      This features will allow the KVM guest to allow the handling of
      pointer authentication instructions or to treat them as undefined
      if not set.
      
      Necessary documentations are added to reflect the changes done.
      Reviewed-by: NDave Martin <Dave.Martin@arm.com>
      Signed-off-by: NAmit Daniel Kachhap <amit.kachhap@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Christoffer Dall <christoffer.dall@arm.com>
      Cc: kvmarm@lists.cs.columbia.edu
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      a22fa321
  30. 19 4月, 2019 2 次提交
  31. 29 3月, 2019 3 次提交
    • D
      KVM: arm64: Add a capability to advertise SVE support · 555f3d03
      Dave Martin 提交于
      To provide a uniform way to check for KVM SVE support amongst other
      features, this patch adds a suitable capability KVM_CAP_ARM_SVE,
      and reports it as present when SVE is available.
      Signed-off-by: NDave Martin <Dave.Martin@arm.com>
      Reviewed-by: NJulien Thierry <julien.thierry@arm.com>
      Tested-by: Nzhang.lei <zhang.lei@jp.fujitsu.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      555f3d03
    • D
      KVM: arm64/sve: Allow userspace to enable SVE for vcpus · 9a3cdf26
      Dave Martin 提交于
      Now that all the pieces are in place, this patch offers a new flag
      KVM_ARM_VCPU_SVE that userspace can pass to KVM_ARM_VCPU_INIT to
      turn on SVE for the guest, on a per-vcpu basis.
      
      As part of this, support for initialisation and reset of the SVE
      vector length set and registers is added in the appropriate places,
      as well as finally setting the KVM_ARM64_GUEST_HAS_SVE vcpu flag,
      to turn on the SVE support code.
      
      Allocation of the SVE register storage in vcpu->arch.sve_state is
      deferred until the SVE configuration is finalized, by which time
      the size of the registers is known.
      
      Setting the vector lengths supported by the vcpu is considered
      configuration of the emulated hardware rather than runtime
      configuration, so no support is offered for changing the vector
      lengths available to an existing vcpu across reset.
      Signed-off-by: NDave Martin <Dave.Martin@arm.com>
      Reviewed-by: NJulien Thierry <julien.thierry@arm.com>
      Tested-by: Nzhang.lei <zhang.lei@jp.fujitsu.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      9a3cdf26
    • D
      KVM: arm64/sve: Add pseudo-register for the guest's vector lengths · 9033bba4
      Dave Martin 提交于
      This patch adds a new pseudo-register KVM_REG_ARM64_SVE_VLS to
      allow userspace to set and query the set of vector lengths visible
      to the guest.
      
      In the future, multiple register slices per SVE register may be
      visible through the ioctl interface.  Once the set of slices has
      been determined we would not be able to allow the vector length set
      to be changed any more, in order to avoid userspace seeing
      inconsistent sets of registers.  For this reason, this patch adds
      support for explicit finalization of the SVE configuration via the
      KVM_ARM_VCPU_FINALIZE ioctl.
      
      Finalization is the proper place to allocate the SVE register state
      storage in vcpu->arch.sve_state, so this patch adds that as
      appropriate.  The data is freed via kvm_arch_vcpu_uninit(), which
      was previously a no-op on arm64.
      
      To simplify the logic for determining what vector lengths can be
      supported, some code is added to KVM init to work this out, in the
      kvm_arm_init_arch_resources() hook.
      
      The KVM_REG_ARM64_SVE_VLS pseudo-register is not exposed yet.
      Subsequent patches will allow SVE to be turned on for guest vcpus,
      making it visible.
      Signed-off-by: NDave Martin <Dave.Martin@arm.com>
      Reviewed-by: NJulien Thierry <julien.thierry@arm.com>
      Tested-by: Nzhang.lei <zhang.lei@jp.fujitsu.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      9033bba4
  32. 20 3月, 2019 1 次提交
    • M
      KVM: arm64: Reset the PMU in preemptible context · ebff0b0e
      Marc Zyngier 提交于
      We've become very cautious to now always reset the vcpu when nothing
      is loaded on the physical CPU. To do so, we now disable preemption
      and do a kvm_arch_vcpu_put() to make sure we have all the state
      in memory (and that it won't be loaded behind out back).
      
      This now causes issues with resetting the PMU, which calls into perf.
      Perf itself uses mutexes, which clashes with the lack of preemption.
      It is worth realizing that the PMU is fully emulated, and that
      no PMU state is ever loaded on the physical CPU. This means we can
      perfectly reset the PMU outside of the non-preemptible section.
      
      Fixes: e761a927 ("KVM: arm/arm64: Reset the VCPU without preemption and vcpu state loaded")
      Reported-by: NJulien Grall <julien.grall@arm.com>
      Tested-by: NJulien Grall <julien.grall@arm.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      ebff0b0e
  33. 07 2月, 2019 1 次提交