1. 09 2月, 2021 1 次提交
    • V
      KVM: Raise the maximum number of user memslots · 4fc096a9
      Vitaly Kuznetsov 提交于
      Current KVM_USER_MEM_SLOTS limits are arch specific (512 on Power, 509 on x86,
      32 on s390, 16 on MIPS) but they don't really need to be. Memory slots are
      allocated dynamically in KVM when added so the only real limitation is
      'id_to_index' array which is 'short'. We don't have any other
      KVM_MEM_SLOTS_NUM/KVM_USER_MEM_SLOTS-sized statically defined structures.
      
      Low KVM_USER_MEM_SLOTS can be a limiting factor for some configurations.
      In particular, when QEMU tries to start a Windows guest with Hyper-V SynIC
      enabled and e.g. 256 vCPUs the limit is hit as SynIC requires two pages per
      vCPU and the guest is free to pick any GFN for each of them, this fragments
      memslots as QEMU wants to have a separate memslot for each of these pages
      (which are supposed to act as 'overlay' pages).
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20210127175731.2020089-3-vkuznets@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4fc096a9
  2. 26 1月, 2021 1 次提交
  3. 22 12月, 2020 3 次提交
  4. 04 12月, 2020 2 次提交
  5. 01 12月, 2020 1 次提交
    • M
      KVM: arm64: Advertise ID_AA64PFR0_EL1.CSV3=1 if the CPUs are Meltdown-safe · 4f1df628
      Marc Zyngier 提交于
      Cores that predate the introduction of ID_AA64PFR0_EL1.CSV3 to
      the ARMv8 architecture have this field set to 0, even of some of
      them are not affected by the vulnerability.
      
      The kernel maintains a list of unaffected cores (A53, A55 and a few
      others) so that it doesn't impose an expensive mitigation uncessarily.
      
      As we do for CSV2, let's expose the CSV3 property to guests that run
      on HW that is effectively not vulnerable. This can be reset to zero
      by writing to the ID register from userspace, ensuring that VMs can
      be migrated despite the new property being set.
      Reported-by: NWill Deacon <will@kernel.org>
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      4f1df628
  6. 28 11月, 2020 3 次提交
  7. 27 11月, 2020 1 次提交
  8. 13 11月, 2020 1 次提交
  9. 10 11月, 2020 8 次提交
  10. 30 10月, 2020 1 次提交
  11. 30 9月, 2020 1 次提交
  12. 29 9月, 2020 4 次提交
    • M
      KVM: arm64: Get rid of kvm_arm_have_ssbd() · 73114677
      Marc Zyngier 提交于
      kvm_arm_have_ssbd() is now completely unused, get rid of it.
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      Signed-off-by: NWill Deacon <will@kernel.org>
      73114677
    • W
      arm64: Rewrite Spectre-v2 mitigation code · d4647f0a
      Will Deacon 提交于
      The Spectre-v2 mitigation code is pretty unwieldy and hard to maintain.
      This is largely due to it being written hastily, without much clue as to
      how things would pan out, and also because it ends up mixing policy and
      state in such a way that it is very difficult to figure out what's going
      on.
      
      Rewrite the Spectre-v2 mitigation so that it clearly separates state from
      policy and follows a more structured approach to handling the mitigation.
      Signed-off-by: NWill Deacon <will@kernel.org>
      d4647f0a
    • M
      KVM: arm64: Add PMU event filtering infrastructure · d7eec236
      Marc Zyngier 提交于
      It can be desirable to expose a PMU to a guest, and yet not want the
      guest to be able to count some of the implemented events (because this
      would give information on shared resources, for example.
      
      For this, let's extend the PMUv3 device API, and offer a way to setup a
      bitmap of the allowed events (the default being no bitmap, and thus no
      filtering).
      
      Userspace can thus allow/deny ranges of event. The default policy
      depends on the "polarity" of the first filter setup (default deny if the
      filter allows events, and default allow if the filter denies events).
      This allows to setup exactly what is allowed for a given guest.
      
      Note that although the ioctl is per-vcpu, the map of allowed events is
      global to the VM (it can be setup from any vcpu until the vcpu PMU is
      initialized).
      Reviewed-by: NAndrew Jones <drjones@redhat.com>
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      d7eec236
    • M
      KVM: arm64: Use event mask matching architecture revision · fd65a3b5
      Marc Zyngier 提交于
      The PMU code suffers from a small defect where we assume that the event
      number provided by the guest is always 16 bit wide, even if the CPU only
      implements the ARMv8.0 architecture. This isn't really problematic in
      the sense that the event number ends up in a system register, cropping
      it to the right width, but still this needs fixing.
      
      In order to make it work, let's probe the version of the PMU that the
      guest is going to use. This is done by temporarily creating a kernel
      event and looking at the PMUVer field that has been saved at probe time
      in the associated arm_pmu structure. This in turn gets saved in the kvm
      structure, and subsequently used to compute the event mask that gets
      used throughout the PMU code.
      Signed-off-by: NMarc Zyngier <maz@kernel.org>
      fd65a3b5
  13. 16 9月, 2020 3 次提交
  14. 11 9月, 2020 2 次提交
  15. 22 8月, 2020 1 次提交
    • W
      KVM: Pass MMU notifier range flags to kvm_unmap_hva_range() · fdfe7cbd
      Will Deacon 提交于
      The 'flags' field of 'struct mmu_notifier_range' is used to indicate
      whether invalidate_range_{start,end}() are permitted to block. In the
      case of kvm_mmu_notifier_invalidate_range_start(), this field is not
      forwarded on to the architecture-specific implementation of
      kvm_unmap_hva_range() and therefore the backend cannot sensibly decide
      whether or not to block.
      
      Add an extra 'flags' parameter to kvm_unmap_hva_range() so that
      architectures are aware as to whether or not they are permitted to block.
      
      Cc: <stable@vger.kernel.org>
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
      Cc: James Morse <james.morse@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      Message-Id: <20200811102725.7121-2-will@kernel.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fdfe7cbd
  16. 21 8月, 2020 2 次提交
  17. 28 7月, 2020 1 次提交
  18. 10 7月, 2020 3 次提交
  19. 07 7月, 2020 1 次提交