KVM: x86: allow for more CPUID entries
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 5 repliesIn review
Changes since RFC from the cover letter
- "KVM: x86: disconnect kvm_check_cpuid() from vcpu->arch.cpuid_entries" added to allow running kvm_check_cpuid() before vcpu->arch.cpuid_entries/ vcpu->arch.cpuid_nent are changed [Sean Christopherson]
- Shorten local variable names in kvm_vcpu_ioctl_set_cpuid[,2] [Sean Christopherson]
- Drop unneeded 'out' labels from kvm_vcpu_ioctl_set_cpuid[,2] and return directly whenever possible [Sean Christopherson]
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | KVM: x86: disconnect kvm_check_cpuid() from vcpu->arch.cpuid_entriesarch/ | +23 | 3 replies | |
| 2/3 | KVM: x86: allocate vcpu->arch.cpuid_entries dynamicallyarch/ arch/ arch/ | +53 | 1 reply | |
| 3/3 | KVM: x86: bump KVM_MAX_CPUID_ENTRIESarch/ | +1 | 1 reply |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Maxim Levitsky |
|---|---|
| 1/3 | R-b |
| 2/3 | R-b |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/3] KVM: x86: allow for more CPUID entries
Changes since RFC:
- "KVM: x86: disconnect kvm_check_cpuid() from vcpu->arch.cpuid_entries" added to allow running kvm_check_cpuid() before vcpu->arch.cpuid_entries/ vcpu->arch.cpuid_nent are changed [Sean Christopherson]
- Shorten local variable names in kvm_vcpu_ioctl_set_cpuid[,2] [Sean Christopherson]
- Drop unneeded 'out' labels from kvm_vcpu_ioctl_set_cpuid[,2] and return directly whenever possible [Sean Christopherson]
Original description:
With QEMU and newer AMD CPUs (namely: Epyc 'Rome') the current limit for KVM_MAX_CPUID_ENTRIES(80) is reported to be hit. Last time it was raised from '40' in 2010. We can, of course, just bump it a little bit to fix the immediate issue but the report made me wonder why we need to pre- allocate vcpu->arch.cpuid_entries array instead of sizing it dynamically. This RFC is intended to feed my curiosity.
Very mildly tested with selftests/kvm-unit-tests and nothing seems to break. I also don't have access to the system where the original issue was reported but chances we're fixing it are very good IMO as just the second patch alone was reported to be sufficient.
Vitaly Kuznetsov (3):
KVM: x86: disconnect kvm_check_cpuid() from vcpu->arch.cpuid_entries
KVM: x86: allocate vcpu->arch.cpuid_entries dynamically
KVM: x86: bump KVM_MAX_CPUID_ENTRIES
arch/x86/include/asm/kvm_host.h | 4 +- arch/x86/kvm/cpuid.c | 123 +++++++++++++++++++------------- arch/x86/kvm/x86.c | 1 + 3 files changed, 75 insertions(+), 53 deletions(-)
Signature · 1 line
2.25.4