From ce1f07126f88b896b2119989fae20d514f469c06 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 5 Jan 2021 23:19:42 +0100 Subject: [PATCH] Enable memory and CPU hotplugging for virtual machines (#1156) (#1158) Use udev rules to set the CPU online. For memory, we let the kernel bring memory online automatically. This is preferred as udev rule processing might be delayed in a low memory situation, see: https://lwn.net/Articles/668944/ --- buildroot-external/board/intel/ova/kernel.config | 5 +++++ .../rootfs-overlay/usr/lib/udev/rules.d/80-hotplug-cpu.rules | 1 + 2 files changed, 6 insertions(+) create mode 100644 buildroot-external/rootfs-overlay/usr/lib/udev/rules.d/80-hotplug-cpu.rules diff --git a/buildroot-external/board/intel/ova/kernel.config b/buildroot-external/board/intel/ova/kernel.config index 543fed10f..18b3f8c63 100644 --- a/buildroot-external/board/intel/ova/kernel.config +++ b/buildroot-external/board/intel/ova/kernel.config @@ -1,5 +1,10 @@ CONFIG_EFI_STUB=y +CONFIG_HOTPLUG_CPU=y +CONFIG_MEMORY_HOTPLUG=y +CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE=y +CONFIG_MEMORY_HOTREMOVE=y + CONFIG_VMXNET3=y CONFIG_VMWARE_PVSCSI=y CONFIG_VMWARE_VMCI_VSOCKETS=y diff --git a/buildroot-external/rootfs-overlay/usr/lib/udev/rules.d/80-hotplug-cpu.rules b/buildroot-external/rootfs-overlay/usr/lib/udev/rules.d/80-hotplug-cpu.rules new file mode 100644 index 000000000..38c16f9eb --- /dev/null +++ b/buildroot-external/rootfs-overlay/usr/lib/udev/rules.d/80-hotplug-cpu.rules @@ -0,0 +1 @@ +SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0", ATTR{online}="1"