[PATCH v1 2/2] system/cpus: Fix resume_all_vcpus() under vCPU hotplug condition

2024-03-17 Thread Keqian Zhu via
For vCPU being hotplugged, qemu_init_vcpu() is called. In this function, we set vcpu state as stopped, and then wait vcpu thread to be created. As the vcpu state is stopped, it will inform us it has been created and then wait on halt_cond. After we has realized vcpu object, we will resume the

[PATCH v1 1/2] system/cpus: Fix pause_all_vcpus() under concurrent environment

2024-03-17 Thread Keqian Zhu via
Both main loop thread and vCPU thread are allowed to call pause_all_vcpus(), and in general resume_all_vcpus() is called after it. Two issues live in pause_all_vcpus(): 1. There is possibility that during thread T1 waits on qemu_pause_cond with bql unlocked, other thread has called

[PATCH v1 0/2] Some fixes for pause and resume all vcpus

2024-03-17 Thread Keqian Zhu via
I hit these bugs when I test the RFC patch of ARM vCPU hotplug feature. This patch has been verified valid. Keqian Zhu (2): system/cpus: Fix pause_all_vcpus() under concurrent environment system/cpus: Fix resume_all_vcpus() under vCPU hotplug condition system/cpus.c | 32

[PATCH] virtio-gpu: Optimize 2D resource data transfer

2023-06-11 Thread Keqian Zhu via
The following points sometimes can reduce much data to copy: 1. When width matches, we can transfer data with one call of iov_to_buf(). 2. Only the required height need to transfer, not whole image. Signed-off-by: Keqian Zhu --- hw/display/virtio-gpu.c | 22 +++--- 1 file

[PATCH v2] hw/acpi: Add ospm_status hook implementation for acpi-ged

2022-08-16 Thread Keqian Zhu via
Setup an ARM virtual machine of machine virt and execute qmp "query-acpi-ospm-status" causes segmentation fault with following dumpstack: #1 0xab64235c in qmp_query_acpi_ospm_status (errp=errp@entry=0xf030) at ../monitor/qmp-cmds.c:312 #2 0xabfc4e20 in

[PATCH] acpi_ged: Add ospm_status hook implementation

2022-08-16 Thread Keqian Zhu via
This fixes a bug that causes segmentation fault with following dumpstack: #1 0xab64235c in qmp_query_acpi_ospm_status (errp=errp@entry=0xf030) at ../monitor/qmp-cmds.c:312 #2 0xabfc4e20 in qmp_marshal_query_acpi_ospm_status (args=, ret=0xea4ffe90,