1. 29 11月, 2022 7 次提交
    • J
      KVM: x86: Advertise AVX-VNNI-INT8 CPUID to user space · 24d74b9f
      Jiaxi Chen 提交于
      AVX-VNNI-INT8 is a new set of instructions in the latest Intel platform
      Sierra Forest, aims for the platform to have superior AI capabilities.
      This instruction multiplies the individual bytes of two unsigned or
      unsigned source operands, then adds and accumulates the results into the
      destination dword element size operand.
      
      The bit definition:
      CPUID.(EAX=7,ECX=1):EDX[bit 4]
      
      AVX-VNNI-INT8 is on a new and sparse CPUID leaf and all bits on this
      leaf have no truly kernel use case for now. Given that and to save space
      for kernel feature bits, move this new leaf to KVM-only subleaf and plus
      an x86_FEATURE definition for AVX-VNNI-INT8 to direct it to the KVM
      entry.
      
      Advertise AVX-VNNI-INT8 to KVM userspace. This is safe because there are
      no new VMX controls or additional host enabling required for guests to
      use this feature.
      Signed-off-by: NJiaxi Chen <jiaxi.chen@linux.intel.com>
      Message-Id: <20221125125845.1182922-7-jiaxi.chen@linux.intel.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      24d74b9f
    • J
      x86: KVM: Advertise AVX-IFMA CPUID to user space · 5e85c4eb
      Jiaxi Chen 提交于
      AVX-IFMA is a new instruction in the latest Intel platform Sierra
      Forest. This instruction packed multiplies unsigned 52-bit integers and
      adds the low/high 52-bit products to Qword Accumulators.
      
      The bit definition:
      CPUID.(EAX=7,ECX=1):EAX[bit 23]
      
      AVX-IFMA is on an expected-dense CPUID leaf and some other bits on this
      leaf have kernel usages. Given that, define this feature bit like
      X86_FEATURE_<name> in kernel. Considering AVX-IFMA itself has no truly
      kernel usages and /proc/cpuinfo has too much unreadable flags, hide this
      one in /proc/cpuinfo.
      
      Advertise AVX-IFMA to KVM userspace. This is safe because there are no
      new VMX controls or additional host enabling required for guests to use
      this feature.
      Signed-off-by: NJiaxi Chen <jiaxi.chen@linux.intel.com>
      Acked-by: NBorislav Petkov <bp@suse.de>
      Message-Id: <20221125125845.1182922-6-jiaxi.chen@linux.intel.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5e85c4eb
    • C
      x86: KVM: Advertise AMX-FP16 CPUID to user space · af2872f6
      Chang S. Bae 提交于
      Latest Intel platform Granite Rapids has introduced a new instruction -
      AMX-FP16, which performs dot-products of two FP16 tiles and accumulates
      the results into a packed single precision tile. AMX-FP16 adds FP16
      capability and also allows a FP16 GPU trained model to run faster
      without loss of accuracy or added SW overhead.
      
      The bit definition:
      CPUID.(EAX=7,ECX=1):EAX[bit 21]
      
      AMX-FP16 is on an expected-dense CPUID leaf and some other bits on this
      leaf have kernel usages. Given that, define this feature bit like
      X86_FEATURE_<name> in kernel. Considering AMX-FP16 itself has no truly
      kernel usages and /proc/cpuinfo has too much unreadable flags, hide this
      one in /proc/cpuinfo.
      
      Advertise AMX-FP16 to KVM userspace. This is safe because there are no
      new VMX controls or additional host enabling required for guests to use
      this feature.
      Signed-off-by: NChang S. Bae <chang.seok.bae@intel.com>
      Signed-off-by: NJiaxi Chen <jiaxi.chen@linux.intel.com>
      Acked-by: NBorislav Petkov <bp@suse.de>
      Message-Id: <20221125125845.1182922-5-jiaxi.chen@linux.intel.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      af2872f6
    • J
      x86: KVM: Advertise CMPccXADD CPUID to user space · 6a19d7aa
      Jiaxi Chen 提交于
      CMPccXADD is a new set of instructions in the latest Intel platform
      Sierra Forest. This new instruction set includes a semaphore operation
      that can compare and add the operands if condition is met, which can
      improve database performance.
      
      The bit definition:
      CPUID.(EAX=7,ECX=1):EAX[bit 7]
      
      CMPccXADD is on an expected-dense CPUID leaf and some other bits on this
      leaf have kernel usages. Given that, define this feature bit like
      X86_FEATURE_<name> in kernel. Considering CMPccXADD itself has no truly
      kernel usages and /proc/cpuinfo has too much unreadable flags, hide this
      one in /proc/cpuinfo.
      
      Advertise CMPCCXADD to KVM userspace. This is safe because there are no
      new VMX controls or additional host enabling required for guests to use
      this feature.
      Signed-off-by: NJiaxi Chen <jiaxi.chen@linux.intel.com>
      Acked-by: NBorislav Petkov <bp@suse.de>
      Message-Id: <20221125125845.1182922-4-jiaxi.chen@linux.intel.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      6a19d7aa
    • S
      KVM: x86: Update KVM-only leaf handling to allow for 100% KVM-only leafs · 047c7229
      Sean Christopherson 提交于
      Rename kvm_cpu_cap_init_scattered() to kvm_cpu_cap_init_kvm_defined() in
      anticipation of adding KVM-only CPUID leafs that aren't recognized by the
      kernel and thus not scattered, i.e. for leafs that are 100% KVM-defined.
      
      Adjust/add comments to kvm_only_cpuid_leafs and KVM_X86_FEATURE to
      document how to create new kvm_only_cpuid_leafs entries for scattered
      features as well as features that are entirely unknown to the kernel.
      
      No functional change intended.
      Signed-off-by: NSean Christopherson <seanjc@google.com>
      Message-Id: <20221125125845.1182922-3-jiaxi.chen@linux.intel.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      047c7229
    • S
      KVM: x86: Add BUILD_BUG_ON() to detect bad usage of "scattered" flags · c4690d01
      Sean Christopherson 提交于
      Add a compile-time assert in the SF() macro to detect improper usage,
      i.e. to detect passing in an X86_FEATURE_* flag that isn't actually
      scattered by the kernel.  Upcoming feature flags will be 100% KVM-only
      and will have X86_FEATURE_* macros that point at a kvm_only_cpuid_leafs
      word, not a kernel-defined word.  Using SF() and thus boot_cpu_has() for
      such feature flags would access memory beyond x86_capability[NCAPINTS]
      and at best incorrectly hide a feature, and at worst leak kernel state to
      userspace.
      Signed-off-by: NSean Christopherson <seanjc@google.com>
      Message-Id: <20221125125845.1182922-2-jiaxi.chen@linux.intel.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c4690d01
    • D
  2. 24 11月, 2022 2 次提交
  3. 19 11月, 2022 28 次提交
  4. 18 11月, 2022 3 次提交
    • M
      KVM: x86: remove exit_int_info warning in svm_handle_exit · 05311ce9
      Maxim Levitsky 提交于
      It is valid to receive external interrupt and have broken IDT entry,
      which will lead to #GP with exit_int_into that will contain the index of
      the IDT entry (e.g any value).
      
      Other exceptions can happen as well, like #NP or #SS
      (if stack switch fails).
      
      Thus this warning can be user triggred and has very little value.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NMaxim Levitsky <mlevitsk@redhat.com>
      Message-Id: <20221103141351.50662-10-mlevitsk@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      05311ce9
    • M
      KVM: x86: allow L1 to not intercept triple fault · 92e7d5c8
      Maxim Levitsky 提交于
      This is SVM correctness fix - although a sane L1 would intercept
      SHUTDOWN event, it doesn't have to, so we have to honour this.
      Signed-off-by: NMaxim Levitsky <mlevitsk@redhat.com>
      Message-Id: <20221103141351.50662-8-mlevitsk@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      92e7d5c8
    • M
      KVM: x86: forcibly leave nested mode on vCPU reset · ed129ec9
      Maxim Levitsky 提交于
      While not obivous, kvm_vcpu_reset() leaves the nested mode by clearing
      'vcpu->arch.hflags' but it does so without all the required housekeeping.
      
      On SVM,	it is possible to have a vCPU reset while in guest mode because
      unlike VMX, on SVM, INIT's are not latched in SVM non root mode and in
      addition to that L1 doesn't have to intercept triple fault, which should
      also trigger L1's reset if happens in L2 while L1 didn't intercept it.
      
      If one of the above conditions happen, KVM will	continue to use vmcb02
      while not having in the guest mode.
      
      Later the IA32_EFER will be cleared which will lead to freeing of the
      nested guest state which will (correctly) free the vmcb02, but since
      KVM still uses it (incorrectly) this will lead to a use after free
      and kernel crash.
      
      This issue is assigned CVE-2022-3344
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NMaxim Levitsky <mlevitsk@redhat.com>
      Message-Id: <20221103141351.50662-5-mlevitsk@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ed129ec9
新手
引导
客服 返回
顶部