The userspace SMCCC call filtering[1] provides the ability to forward the SMCCC calls to the userspace. The vCPU hotplug[2] would be the first legitimate use case to handle the psci calls in userspace, thus the vCPU hotplug can deny the PSCI_ON call if the vCPU is not present now. This series try to enable the userspace SMCCC call filtering, thus can handle the SMCCC call in userspace. The first enabled SMCCC call is psci call, by using the new added option 'user-smccc', we can enable handle psci calls in userspace. qemu-system-aarch64 -machine virt,user-smccc=on This series reuse the qemu implementation of the psci handling, thus the handling process is very simple. But when handling psci in userspace when using kvm, the reset vcpu process need to be taking care, the detail is included in the patch05. [1] lore.kernel.org/20230404154050.2270077-1-oliver.upton@xxxxxxxxx [2] lore.kernel.org/20230203135043.409192-1-james.morse@xxxxxxx Shaoqin Huang (5): linux-headers: Update to v6.4-rc7 linux-headers: Import arm-smccc.h from Linux v6.4-rc7 target/arm: make psci call can be used by kvm arm/kvm: add skeleton implementation for userspace SMCCC call handling arm/kvm: add support for userspace psci calls handling docs/system/arm/virt.rst | 4 + hw/arm/virt.c | 21 ++ hw/intc/arm_gicv3_kvm.c | 10 + include/hw/arm/virt.h | 1 + include/standard-headers/linux/const.h | 2 +- include/standard-headers/linux/virtio_blk.h | 18 +- .../standard-headers/linux/virtio_config.h | 6 + include/standard-headers/linux/virtio_net.h | 1 + linux-headers/asm-arm64/kvm.h | 33 +++ linux-headers/asm-riscv/kvm.h | 53 +++- linux-headers/asm-riscv/unistd.h | 9 + linux-headers/asm-s390/unistd_32.h | 1 + linux-headers/asm-s390/unistd_64.h | 1 + linux-headers/asm-x86/kvm.h | 3 + linux-headers/linux/arm-smccc.h | 240 ++++++++++++++++++ linux-headers/linux/const.h | 2 +- linux-headers/linux/kvm.h | 12 +- linux-headers/linux/psp-sev.h | 7 + linux-headers/linux/userfaultfd.h | 17 +- target/arm/helper.c | 3 +- target/arm/kvm.c | 146 +++++++++++ 21 files changed, 573 insertions(+), 17 deletions(-) create mode 100644 linux-headers/linux/arm-smccc.h base-commit: e3660cc1e3cb136af50c0eaaeac27943c2438d1d -- 2.39.1