On Mon, 2 Jan 2017 23:27:50 +0300 Ozgur O Kilic <okilic1@xxxxxxxxxxxxxx> wrote: > Hi > > I am trying to understand how QEMU threads respond to set a vCPU online or offline. > > Specifically, what happens to QEMU thread if in the guest, we execute: > > echo 0 > /sys/devices/system/cpu/cpu1/online > Is the corresponding QEMU thread paused? on success CPU executes play_dead() and isn't used/scheduled by guest. However it's still possible to online it back using echo 1 > /sys/devices/system/cpu/cpu1/online If you need to prevent that happening you should use QEMU's device_del command via HMP/QMP interface. For x86 it would trigger ACPI based CPU hot-unplug action after which vCPU object in QMEU would be destroyed and corresponding KVM thread be parked and corresponding CPU object /sys/devices/system/cpu/cpuXX in guest is removed. To use that CPU again in guest, one should hotplug it back in QEMU using device_add. details of ACPI based cpu hot(un)plug qemu<->guest protocol are described in QEMU/docs/specs/acpi_cpu_hotplug.txt file. x86 ACPI based implementation is mostly contained in QEMU/hw/acpi/cpu* files. Wiki page http://wiki.qemu.org/Features/CPUHotplug is rather outdated, I'll update it to reflect currently implemented hotplug interfaces/targets. PS: cpu hot-unplug is recently new feature so one should use recent qemu/libvirt versions. > Thank you > Ozgur Ozan Kilic -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html