KVM: x86: Add CONFIG_KVM_MAX_NR_VCPUS
PATCH v2 1/1 KVM: x86: Add CONFIG_KVM_MAX_NR_VCPUS
Add a Kconfig entry to set the maximum number of vCPUs per KVM guest and set the default value to 4096 when MAXSMP is enabled.
--- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/kvm/Kconfig | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-)
arch/x86/include/asm/kvm_host.h +1 -1
@@ -39,7 +39,7 @@#define __KVM_HAVE_ARCH_VCPU_DEBUGFS -#define KVM_MAX_VCPUS 1024 +#define KVM_MAX_VCPUS CONFIG_KVM_MAX_NR_VCPUS/* * In x86, the VCPU ID corresponds to the APIC ID, and APIC IDs
arch/x86/kvm/Kconfig +11 -0
@@ -141,4 +141,15 @@ config KVM_XEN config KVM_EXTERNAL_WRITE_TRACKING bool +config KVM_MAX_NR_VCPUS + int "Maximum number of vCPUs per KVM guest" + depends on KVM + range 1024 4096 + default 4096 if MAXSMP + default 1024 + help + Set the maximum number of vCPUs per KVM guest. Larger values will increase + the memory footprint of each KVM guest, regardless of how many vCPUs are + configured. + endif # VIRTUALIZATION
Signature · 1 line
2.26.2
kernel test robot
build botkernel test robot noticed the following build errors:
Hi Kyle,
kernel test robot noticed the following build errors:
[auto build test ERROR on kvm/queue]
[also build test ERROR on linus/master v6.5-rc7 next-20230823] [cannot apply to kvm/linux-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Kyle-Meyer/KVM-x86-Add-CONFIG_KVM_MAX_NR_VCPUS/20230824-034224 base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue patch link: https://lore.kernel.org/r/20230823193842.2544394-1-kyle.meyer%40hpe.com patch subject: [PATCH v2] KVM: x86: Add CONFIG_KVM_MAX_NR_VCPUS config: i386-tinyconfig (https://download.01.org/0day-ci/archive/20230824/[email protected]/config) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce: (https://download.01.org/0day-ci/archive/20230824/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
In file included from include/vdso/const.h:5,
from include/linux/const.h:4,
from include/uapi/linux/kernel.h:6,
from include/linux/cache.h:5,
from include/linux/slab.h:15,
from arch/x86/events/intel/core.c:14:
>> arch/x86/include/asm/kvm_host.h:42:23: error: 'CONFIG_KVM_MAX_NR_VCPUS' undeclared here (not in a function)
42 | #define KVM_MAX_VCPUS CONFIG_KVM_MAX_NR_VCPUS
| ^~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/const.h:34:40: note: in definition of macro '__KERNEL_DIV_ROUND_UP'
34 | #define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
| ^
arch/x86/include/asm/kvm_host.h:1120:33: note: in expansion of macro 'BITS_TO_LONGS'
1120 | unsigned long poll_mask[BITS_TO_LONGS(KVM_MAX_VCPUS)];
| ^~~~~~~~~~~~~
arch/x86/include/asm/kvm_host.h:1120:47: note: in expansion of macro 'KVM_MAX_VCPUS'
1120 | unsigned long poll_mask[BITS_TO_LONGS(KVM_MAX_VCPUS)];
| ^~~~~~~~~~~~~vim +/CONFIG_KVM_MAX_NR_VCPUS +42 arch/x86/include/asm/kvm_host.h
41
> 42 #define KVM_MAX_VCPUS CONFIG_KVM_MAX_NR_VCPUS
43 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki