1. 27 4月, 2021 1 次提交
    • V
      KVM: selftests: Speed up set_memory_region_test · 3bf0fcd7
      Vitaly Kuznetsov 提交于
      After commit 4fc096a9 ("KVM: Raise the maximum number of user memslots")
      set_memory_region_test may take too long, reports are that the default
      timeout value we have (120s) may not be enough even on a physical host.
      
      Speed things up a bit by throwing away vm_userspace_mem_region_add() usage
      from test_add_max_memory_regions(), we don't really need to do the majority
      of the stuff it does for the sake of this test.
      
      On my AMD EPYC 7401P, # time ./set_memory_region_test
      pre-patch:
       Testing KVM_RUN with zero added memory regions
       Allowed number of memory slots: 32764
       Adding slots 0..32763, each memory region with 2048K size
       Testing MOVE of in-use region, 10 loops
       Testing DELETE of in-use region, 10 loops
      
       real	0m44.917s
       user	0m7.416s
       sys	0m34.601s
      
      post-patch:
       Testing KVM_RUN with zero added memory regions
       Allowed number of memory slots: 32764
       Adding slots 0..32763, each memory region with 2048K size
       Testing MOVE of in-use region, 10 loops
       Testing DELETE of in-use region, 10 loops
      
       real	0m20.714s
       user	0m0.109s
       sys	0m18.359s
      Reported-by: Nkernel test robot <oliver.sang@intel.com>
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20210426130121.758229-1-vkuznets@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3bf0fcd7
  2. 26 4月, 2021 35 次提交
  3. 23 4月, 2021 4 次提交
    • S
      KVM: x86: Fix implicit enum conversion goof in scattered reverse CPUID code · 462f8dde
      Sean Christopherson 提交于
      Take "enum kvm_only_cpuid_leafs" in scattered specific CPUID helpers
      (which is obvious in hindsight), and use "unsigned int" for leafs that
      can be the kernel's standard "enum cpuid_leaf" or the aforementioned
      KVM-only variant.  Loss of the enum params is a bit disapponting, but
      gcc obviously isn't providing any extra sanity checks, and the various
      BUILD_BUG_ON() assertions ensure the input is in range.
      
      This fixes implicit enum conversions that are detected by clang-11:
      
      arch/x86/kvm/cpuid.c:499:29: warning: implicit conversion from enumeration type 'enum kvm_only_cpuid_leafs' to different enumeration type 'enum cpuid_leafs' [-Wenum-conversion]
              kvm_cpu_cap_init_scattered(CPUID_12_EAX,
              ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~
      arch/x86/kvm/cpuid.c:837:31: warning: implicit conversion from enumeration type 'enum kvm_only_cpuid_leafs' to different enumeration type 'enum cpuid_leafs' [-Wenum-conversion]
                      cpuid_entry_override(entry, CPUID_12_EAX);
                      ~~~~~~~~~~~~~~~~~~~~        ^~~~~~~~~~~~
      2 warnings generated.
      
      Fixes: 4e66c0cb ("KVM: x86: Add support for reverse CPUID lookup of scattered features")
      Cc: Kai Huang <kai.huang@intel.com>
      Signed-off-by: NSean Christopherson <seanjc@google.com>
      Message-Id: <20210421010850.3009718-1-seanjc@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      462f8dde
    • I
      KVM: VMX: use EPT_VIOLATION_GVA_TRANSLATED instead of 0x100 · 10835602
      Isaku Yamahata 提交于
      Use symbolic value, EPT_VIOLATION_GVA_TRANSLATED, instead of 0x100
      in handle_ept_violation().
      Signed-off-by: NYao Yuan <yuan.yao@intel.com>
      Signed-off-by: NIsaku Yamahata <isaku.yamahata@intel.com>
      Message-Id: <724e8271ea301aece3eb2afe286a9e2e92a70b18.1619136576.git.isaku.yamahata@intel.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      10835602
    • P
      Merge tag 'kvmarm-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD · c4f71901
      Paolo Bonzini 提交于
      KVM/arm64 updates for Linux 5.13
      
      New features:
      
      - Stage-2 isolation for the host kernel when running in protected mode
      - Guest SVE support when running in nVHE mode
      - Force W^X hypervisor mappings in nVHE mode
      - ITS save/restore for guests using direct injection with GICv4.1
      - nVHE panics now produce readable backtraces
      - Guest support for PTP using the ptp_kvm driver
      - Performance improvements in the S2 fault handler
      - Alexandru is now a reviewer (not really a new feature...)
      
      Fixes:
      - Proper emulation of the GICR_TYPER register
      - Handle the complete set of relocation in the nVHE EL2 object
      - Get rid of the oprofile dependency in the PMU code (and of the
        oprofile body parts at the same time)
      - Debug and SPE fixes
      - Fix vcpu reset
      c4f71901
    • P
      Merge branch 'kvm-sev-cgroup' into HEAD · fd49e8ee
      Paolo Bonzini 提交于
      fd49e8ee