From: Jean-Philippe Brucker [mailto:jean-philippe@linaro.org] Sent: Thursday, May 20, 2021 2:19 PM To: linaro-open-discussions@op-lists.linaro.org Cc: Salil Mehta salil.mehta@huawei.com; Jonathan Cameron jonathan.cameron@huawei.com; james.morse@arm.com; lorenzo.pieralisi@arm.com; Jean-Philippe Brucker jean-philippe@linaro.org Subject: [RFC qemu 0/4] target/arm/kvm: Implement PSCI in userspace
Enable new KVM capabilities to handle PSCI calls in QEMU rather than KVM. This work is part of the larger vCPU hot-add prototype for arm64, which can be found at [1]. I rebased Salil's work [2], with small changes to hide unavailable CPUs in ACPI. These four patches move PSCI to userspace so we can differentiate nonexistent from unavailable CPUs (See patch 4, associated to Linux patch "arm64: psci: Ignore NOT_PRESENT CPUs").
Hi Jean, Many thanks for this. I could see from your repository that you have used most of the earlier QEMU patches[2]. There are some patches related to the ACPI/GED, we might not need them anymore as we are not conveying the vcpu hotplug events through ACPI/Hotplug channel to guest now.
There are lots of places in QEMU we still need to work maybe along with the community to finally create a refined solution at QEMU level.
But good to see that we have worked out an *kind-of* acceptable prototype. Will further go through these over next couple of days.
Thanks Salil.
My testing commands are roughly:
qemu-system-aarch64 -cpu host -enable-kvm -M virt -M 'gic-version=3' -bios QEMU_EFI.fd -smp 'cpus=2,maxcpus=4' -m 1G -kernel ... device_add host-arm-cpu,id=core2,core-id=2 # QEMU monitor echo 1 > /sys/devices/system/cpu/cpu2/online # Guest device_del core2
[1] https://jpbrucker.net/git/qemu/log/?h=cpuhp/devel https://jpbrucker.net/git/linux/log/?h=cpuhp/devel [2] https://lore.kernel.org/qemu-devel/20200613213629.21984-1-salil.mehta@huawe i.com/
Jean-Philippe Brucker (4): target/arm/kvm: Write CPU state back to KVM on reset target/arm: Support PSCI CPU_SUSPEND for KVM target/arm/kvm: Handle PSCI calls target/arm/arm-powerctl: Handle unplugged CPUs
target/arm/arm-powerctl.h | 1 + target/arm/cpu.h | 3 ++ target/arm/internals.h | 2 +- target/arm/arm-powerctl.c | 44 ++++++++++++++++++----- target/arm/kvm.c | 75 +++++++++++++++++++++++++++++++++++---- target/arm/kvm64.c | 5 ++- target/arm/psci.c | 14 +++++--- 7 files changed, 120 insertions(+), 24 deletions(-)
-- 2.31.1