linux-stable/arch
Vitaly Kuznetsov 255cbecfe0 KVM: x86: allocate vcpu->arch.cpuid_entries dynamically
The current limit for guest CPUID leaves (KVM_MAX_CPUID_ENTRIES, 80)
is reported to be insufficient but before we bump it let's switch to
allocating vcpu->arch.cpuid_entries[] array dynamically. Currently,
'struct kvm_cpuid_entry2' is 40 bytes so vcpu->arch.cpuid_entries is
3200 bytes which accounts for 1/4 of the whole 'struct kvm_vcpu_arch'
but having it pre-allocated (for all vCPUs which we also pre-allocate)
gives us no real benefits.

Another plus of the dynamic allocation is that we now do kvm_check_cpuid()
check before we assign anything to vcpu->arch.cpuid_nent/cpuid_entries so
no changes are made in case the check fails.

Opportunistically remove unneeded 'out' labels from
kvm_vcpu_ioctl_set_cpuid()/kvm_vcpu_ioctl_set_cpuid2() and return
directly whenever possible.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20201001130541.1398392-3-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
2020-10-21 17:36:33 -04:00
..
alpha treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
arc ARC fixes for 5.9-rc4 2020-09-05 13:46:14 -07:00
arm A set of fixes for lockdep, tracing and RCU: 2020-08-30 11:43:50 -07:00
arm64 KVM/arm64 updates for Linux 5.10 2020-10-20 08:14:25 -04:00
c6x treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
csky treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
h8300 treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
hexagon treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
ia64 ia64: fix min_low_pfn/max_low_pfn build errors 2020-09-01 19:34:11 +03:00
m68k treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
microblaze microblaze: fix min_low_pfn/max_low_pfn build errors 2020-08-31 19:52:50 +03:00
mips KVM: MIPS: clean up redundant kvm_run parameters in assembly 2020-09-28 07:57:21 -04:00
nds32 A set of fixes for lockdep, tracing and RCU: 2020-08-30 11:43:50 -07:00
nios2 mm/nios2: use general page fault accounting 2020-08-12 10:58:03 -07:00
openrisc treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
parisc treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
powerpc PPC KVM update for 5.10 2020-09-22 08:18:16 -04:00
riscv treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
s390 s390: update defconfigs 2020-09-02 13:17:05 +02:00
sh treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
sparc treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
um treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
x86 KVM: x86: allocate vcpu->arch.cpuid_entries dynamically 2020-10-21 17:36:33 -04:00
xtensa treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
.gitignore
Kconfig A set oftimekeeping/VDSO updates: 2020-08-14 14:26:08 -07:00