qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v4 10/36] i386/kvm: Move architectural CPUID leaf generat


From: Xiaoyao Li
Subject: Re: [RFC PATCH v4 10/36] i386/kvm: Move architectural CPUID leaf generation to separate helper
Date: Fri, 13 May 2022 08:37:19 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.8.1

On 5/13/2022 1:48 AM, Isaku Yamahata wrote:
On Thu, May 12, 2022 at 11:17:37AM +0800,
Xiaoyao Li <xiaoyao.li@intel.com> wrote:

diff --git a/target/i386/kvm/kvm_i386.h b/target/i386/kvm/kvm_i386.h
index b434feaa6b1d..5c7972f617e8 100644
--- a/target/i386/kvm/kvm_i386.h
+++ b/target/i386/kvm/kvm_i386.h
@@ -24,6 +24,10 @@
  #define kvm_ioapic_in_kernel() \
      (kvm_irqchip_in_kernel() && !kvm_irqchip_is_split())
+#define KVM_MAX_CPUID_ENTRIES 100

In Linux side, the value was bumped to 256.  Opportunistically let's make it
same.

3f4e3eb417b1 KVM: x86: bump KVM_MAX_CPUID_ENTRIES

I don't think so.

In KVM, KVM_MAX_CPUID_ENTRIES is used to guard IOCTL KVM_SET_CPUID/KVM_SET_CPUID2/KVM_GET_SUPPORTED_CPUID/KVM_GET_EMULATED_CPUID, that KVM handles at most
the number of KVM_MAX_CPUID_ENTRIES entries.

However, in QEMU, KVM_MAX_CPUID_ENTRIES is used as the maximum total number of CPUID entries that generated by QEMU. It's used to guard the number in kvm_x86_arch_cpuid().

I think we can increase the number when we actually hit the check in kvm_x86_arch_cupid().

+uint32_t kvm_x86_arch_cpuid(CPUX86State *env, struct kvm_cpuid_entry2 *entries,
+                            uint32_t cpuid_i);
+
  #else
#define kvm_pit_in_kernel() 0
--
2.27.0







reply via email to

[Prev in Thread] Current Thread [Next in Thread]