Re: [PATCH v9] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-05-27 Thread Shaoqin Huang
Hi Zhao, Thanks for your proposed idea. If you are willing to take the PMU Filter Enabling work, you can do it. I won't update this series anymore due to the QAPI restriction. I really appreciate if you can implement that. Thanks, Shaoqin On 5/13/24 14:52, Zhao Liu wrote: Hi Daniel,

Re: [PATCH v9] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-05-07 Thread Shaoqin Huang
Hi Daniel, On 4/16/24 01:29, Daniel P. Berrangé wrote: On Mon, Apr 08, 2024 at 10:49:40PM -0400, Shaoqin Huang wrote: The KVM_ARM_VCPU_PMU_V3_FILTER provides the ability to let the VMM decide which PMU events are provided to the guest. Add a new option `kvm-pmu-filter` as -cpu sub-option

Re: [PATCH v9] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-04-09 Thread Shaoqin Huang
Hi Thmoas, On 4/9/24 13:33, Thomas Huth wrote: +    assert_has_feature(qts, "host", "kvm-pmu-filter"); So you assert here that the feature is available ...   assert_has_feature(qts, "host", "kvm-steal-time");   assert_has_feature(qts, "host", "sve");   resp =

[PATCH v9] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-04-08 Thread Shaoqin Huang
we can see, the cycle counter has been disabled in the guest, but other pmu events do still work. Signed-off-by: Shaoqin Huang --- v8->v9: - Replace the warn_report to error_setg in some places. - Merge the check condition to make code more clean. - Try to use the QAPI format for the PMU Fi

Re: [PATCH v8] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-04-08 Thread Shaoqin Huang
Hi Eric, On 3/19/24 23:23, Eric Auger wrote: +if (kvm_supports_pmu_filter) { +assert_set_feature_str(qts, "host", "kvm-pmu-filter", ""); +assert_set_feature_str(qts, "host", "kvm-pmu-filter", + "A:0x11-0x11"); +

Re: [PATCH v8] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-04-08 Thread Shaoqin Huang
Hi Kevin, On 4/2/24 21:01, Kevin Wolf wrote: Maybe I'm wrong. So I want to double check with if the -cpu option support json format nowadays? As far as I can see, -cpu doesn't support JSON yet. But even if it did, your command line would be invalid because the 'host,' part isn't JSON.

Re: [PATCH v8] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-03-28 Thread Shaoqin Huang
Hi Daniel, On 3/25/24 16:55, Daniel P. Berrangé wrote: On Mon, Mar 25, 2024 at 01:35:58PM +0800, Shaoqin Huang wrote: Hi Daniel, Thanks for your reviewing. I see your comments in the v7. I have some doubts about what you said about the QAPI. Do you want me to convert the current design

Re: [PATCH v8] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-03-24 Thread Shaoqin Huang
? Thanks, Shaoqin On 3/22/24 22:53, Daniel P. Berrangé wrote: On Tue, Mar 12, 2024 at 03:48:49AM -0400, Shaoqin Huang wrote: The KVM_ARM_VCPU_PMU_V3_FILTER provides the ability to let the VMM decide which PMU events are provided to the guest. Add a new option `kvm-pmu-filter` as -cpu sub-option

[PATCH v8] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-03-12 Thread Shaoqin Huang
we can see, the cycle counter has been disabled in the guest, but other pmu events do still work. Signed-off-by: Shaoqin Huang --- v7->v8: - Add qtest for kvm-pmu-filter. - Do the kvm-pmu-filter syntax checking up-front in the kvm_pmu_filter_set() function. And store the filter information a

Re: [PATCH v7] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-02-28 Thread Shaoqin Huang
Hi Peter, On 2/22/24 22:28, Peter Maydell wrote: On Wed, 21 Feb 2024 at 06:34, Shaoqin Huang wrote: The KVM_ARM_VCPU_PMU_V3_FILTER provides the ability to let the VMM decide which PMU events are provided to the guest. Add a new option `kvm-pmu-filter` as -cpu sub-option to set the PMU Event

[PATCH v7] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-02-20 Thread Shaoqin Huang
we can see, the cycle counter has been disabled in the guest, but other pmu events do still work. Reviewed-by: Sebastian Ott Signed-off-by: Shaoqin Huang --- v6->v7: - Check return value of sscanf. - Improve the check condition. v5->v6: - Commit message improvement. - Remove

Re: [PATCH v6] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-02-20 Thread Shaoqin Huang
Hi Eric, On 2/15/24 17:13, Eric Auger wrote: Hi Shaoqin, On 2/1/24 09:51, Shaoqin Huang wrote: The KVM_ARM_VCPU_PMU_V3_FILTER provides the ability to let the VMM decide which PMU events are provided to the guest. Add a new option `kvm-pmu-filter` as -cpu sub-option to set the PMU Event

[PATCH v6] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-02-01 Thread Shaoqin Huang
we can see, the cycle counter has been disabled in the guest, but other pmu events do still work. Reviewed-by: Sebastian Ott Signed-off-by: Shaoqin Huang --- v5->v6: - Commit message improvement. - Remove some unused code. - Collect Reviewed-by, thanks Sebastian. - Use g_auto(Gstr

Re: [PATCH v5] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-01-25 Thread Shaoqin Huang
Hi Eric, On 1/17/24 20:59, Eric Auger wrote: Hi Shaoqin, On 1/15/24 09:01, Shaoqin Huang wrote: The KVM_ARM_VCPU_PMU_V3_FILTER provides the ability to let the VMM decide which PMU events are provided to the guest. Add a new option `kvm-pmu-filter` as -cpu sub-option to set the PMU Event

Re: [PATCH v5] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-01-18 Thread Shaoqin Huang
Hi Eric, On 1/17/24 20:59, Eric Auger wrote: Hi Shaoqin, On 1/15/24 09:01, Shaoqin Huang wrote: The KVM_ARM_VCPU_PMU_V3_FILTER provides the ability to let the VMM decide which PMU events are provided to the guest. Add a new option `kvm-pmu-filter` as -cpu sub-option to set the PMU Event

[PATCH v5] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2024-01-15 Thread Shaoqin Huang
sys As we can see, the cycle counter has been disabled in the guest, but other pmu events are still work. Signed-off-by: Shaoqin Huang --- v4->v5: - Change the kvm-pmu-filter as a -cpu sub-option. [Eric] - Comment tweak. [Gavin] - Rebase to the lates

[PATCH v4] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2023-12-07 Thread Shaoqin Huang
As we can see, the cycle counter has been disabled in the guest, but other pmu events are still work. Signed-off-by: Shaoqin Huang --- v3->v4: - Fix the wrong check for pmu_filter_init.[Sebastian] - Fix multiple alignment issue. [Gavin] - Report error by warn_repo

Re: [PATCH v3] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2023-12-06 Thread Shaoqin Huang
Hi Gavin, On 12/1/23 13:37, Gavin Shan wrote: Hi Shaoqin, On 11/29/23 14:08, Shaoqin Huang wrote: The KVM_ARM_VCPU_PMU_V3_FILTER provide the ability to let the VMM decide which PMU events are provided to the guest. Add a new option `pmu-filter` as -accel sub-option to set the PMU Event

Re: [PATCH v3] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2023-12-06 Thread Shaoqin Huang
On 12/1/23 00:55, Sebastian Ott wrote: On Tue, 28 Nov 2023, Shaoqin Huang wrote: +static void kvm_arm_pmu_filter_init(CPUState *cs) +{ +    static bool pmu_filter_init = false; +    struct kvm_pmu_event_filter filter; +    struct kvm_device_attr attr = { +    .group

[PATCH v3] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2023-11-28 Thread Shaoqin Huang
As we can see, the cycle counter has been disabled in the guest, but other pmu events are still work. Signed-off-by: Shaoqin Huang --- v2->v3: - Improve commits message, use kernel doc wording, add more explaination on filter example, fix some typo error.[Eric] - Add g_free() in kv

Re: [PATCH v2] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2023-11-27 Thread Shaoqin Huang
Hi Eric, On 11/25/23 02:24, Eric Auger wrote: Hi, On 11/17/23 07:08, Shaoqin Huang wrote: The KVM_ARM_VCPU_PMU_V3_FILTER provide the ability to let the VMM decide which PMU events are provided to the guest. Add a new option `pmu-filter` as -accel sub-option to set the PMU Event Filtering

Re: [PATCH v2] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2023-11-27 Thread Shaoqin Huang
Hi Eric, On 11/24/23 18:40, Eric Auger wrote: Hi Shaoqin, On 11/17/23 07:08, Shaoqin Huang wrote: The KVM_ARM_VCPU_PMU_V3_FILTER provide the ability to let the VMM decide which PMU events are provided to the guest. Add a new option `pmu-filter` as -accel sub-option to set the PMU Event

Re: [PATCH V7 8/8] docs/specs/acpi_hw_reduced_hotplug: Add the CPU Hotplug Event Bit

2023-11-21 Thread Shaoqin Huang
event. Signed-off-by: Salil Mehta Reviewed-by: Shaoqin Huang --- docs/specs/acpi_hw_reduced_hotplug.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/specs/acpi_hw_reduced_hotplug.rst b/docs/specs/acpi_hw_reduced_hotplug.rst index 0bd3f9399f..3acd6fcd8b 100644

[PATCH v2] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2023-11-16 Thread Shaoqin Huang
conds time elapsed 0.001752000 seconds user 0.0 seconds sys As we can see, the cycle counter has been disabled in the guest, but other pmu events are still work. Signed-off-by: Shaoqin Huang --- v1->v2: - Add more description for allow and deny meaning in

Re: [PATCH v1] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2023-11-16 Thread Shaoqin Huang
Hi Sebastian, On 11/15/23 20:17, Sebastian Ott wrote: Hi, On Mon, 13 Nov 2023, Shaoqin Huang wrote: +    ``pmu-filter={A,D}:start-end[;...]`` +    KVM implements pmu event filtering to prevent a guest from being able to +    sample certain events. It has the following format: + +    pmu

[PATCH v1] arm/kvm: Enable support for KVM_ARM_VCPU_PMU_V3_FILTER

2023-11-13 Thread Shaoqin Huang
branches 1.002492480 seconds time elapsed 0.001752000 seconds user 0.0 seconds sys As we can see, the cycle counter has been disabled in the guest, but other pmu events are still work. Signed-off-by: Shaoqin Huang --- include/sysemu/kvm_int.h | 1 + qemu-option

Re: [PATCH V6 0/9] Add architecture agnostic code to support vCPU Hotplug

2023-10-19 Thread Shaoqin Huang
On 10/19/23 17:34, Salil Mehta wrote: Hi Shaoqin, From: Shaoqin Huang Sent: Thursday, October 19, 2023 10:05 AM To: Salil Mehta ; qemu-devel@nongnu.org; qemu- a...@nongnu.org Cc: m...@kernel.org; jean-phili...@linaro.org; Jonathan Cameron ; lpieral...@kernel.org; peter.mayd...@linaro.org

Re: [PATCH V6 0/9] Add architecture agnostic code to support vCPU Hotplug

2023-10-19 Thread Shaoqin Huang
kvm.h | 16 +++ system/physmem.c | 29 15 files changed, 184 insertions(+), 27 deletions(-) Hi salil, All patches looks good to me. Thanks for you effort to update it so actively. No issues being found by simply testing and several daily use.

Re: [PATCH V5 4/9] hw/acpi: Init GED framework with CPU hotplug events

2023-10-15 Thread Shaoqin Huang
of CPU hotplug event initialization in the existing GED framework. Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Reviewed-by: David Hildenbrand Tested-by: Vishnu Pajjuri Reviewed-by: Shaoqin Huang

Re: [PATCH V5 1/9] accel/kvm: Extract common KVM vCPU {creation, parking} code

2023-10-15 Thread Shaoqin Huang
in the Host KVM is not destroyed and its representative KVM vCPU object/context in Qemu is parked. Refactor common logic so that some APIs could be reused by vCPU Hotplug code. Signed-off-by: Salil Mehta Reviewed-by: Gavin Shan Tested-by: Vishnu Pajjuri Reviewed-by: Shaoqin Huang --- accel/kvm

Re: [PATCH V5 1/9] accel/kvm: Extract common KVM vCPU {creation, parking} code

2023-10-15 Thread Shaoqin Huang
in the Host KVM is not destroyed and its representative KVM vCPU object/context in Qemu is parked. Refactor common logic so that some APIs could be reused by vCPU Hotplug code. Signed-off-by: Salil Mehta Reviewed-by: Gavin Shan Tested-by: Vishnu Pajjuri Reviewed-by: Shaoqin Huang --- accel/kvm

Re: [PATCH V4 07/10] hw/acpi: Update ACPI GED framework to support vCPU Hotplug

2023-10-10 Thread Shaoqin Huang
-by: Keqian Zhu Signed-off-by: Salil Mehta Reviewed-by: Jonathan Cameron Reviewed-by: Gavin Shan Reviewed-by: Shaoqin Huang --- hw/acpi/generic_event_device.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index

Re: [PATCH V4 03/10] hw/acpi: Add ACPI CPU hotplug init stub

2023-10-10 Thread Shaoqin Huang
Reviewed-by: Gavin Shan Reviewed-by: Shaoqin Huang --- hw/acpi/acpi-cpu-hotplug-stub.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/acpi/acpi-cpu-hotplug-stub.c b/hw/acpi/acpi-cpu-hotplug-stub.c index 3fc4b14c26..c6c61bb9cd 100644 --- a/hw/acpi/acpi-cpu-hotplug-stub.c +++ b

Re: [PATCH V4 02/10] hw/acpi: Move CPU ctrl-dev MMIO region len macro to common header file

2023-10-10 Thread Shaoqin Huang
-by: Jonathan Cameron Reviewed-by: Gavin Shan Reviewed-by: David Hildenbrand Reviewed-by: Shaoqin Huang --- hw/acpi/cpu.c | 2 +- include/hw/acpi/cpu_hotplug.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 19c154d78f

Re: [PATCH RFC V2 03/37] hw/arm/virt: Move setting of common CPU properties in a function

2023-10-10 Thread Shaoqin Huang
On 9/26/23 18:04, Salil Mehta via wrote: Factor out CPU properties code common for {hot,cold}-plugged CPUs. This allows code reuse. Signed-off-by: Salil Mehta --- hw/arm/virt.c | 220 ++ include/hw/arm/virt.h | 4 + 2 files changed, 140

Re: [PATCH v1 0/5] target/arm: Handle psci calls in userspace

2023-06-26 Thread Shaoqin Huang
Hi Salil, On 6/26/23 21:42, Salil Mehta wrote: From: Shaoqin Huang Sent: Monday, June 26, 2023 7:49 AM To: qemu-devel@nongnu.org; qemu-...@nongnu.org Cc: oliver.up...@linux.dev; Salil Mehta ; james.mo...@arm.com; gs...@redhat.com; Shaoqin Huang ; Cornelia Huck ; k...@vger.kernel.org; Michael S

[PATCH v1 5/5] arm/kvm: add support for userspace psci calls handling

2023-06-26 Thread Shaoqin Huang
when reset vcpu, we need to mark it as dirty to force the vcpu to sync its register to kvm, and when reset gicv3, we need to pause all vcpus to grab the all vcpu locks, thus when handling the psci CPU_ON call, the vcpu can be successfuly boot up. Signed-off-by: Shaoqin Huang --- hw/intc

[PATCH v1 3/5] target/arm: make psci call can be used by kvm

2023-06-26 Thread Shaoqin Huang
Now the psci call can only be used when tcg_enabled, we want to reuse it when kvm_enabled, which will be used in subsequent patch which enable the psci handling in userspace. Signed-off-by: Shaoqin Huang --- target/arm/helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v1 2/5] linux-headers: Import arm-smccc.h from Linux v6.4-rc7

2023-06-26 Thread Shaoqin Huang
Copy in the SMCCC definitions from the kernel, which will be used to implement SMCCC handling in userspace. Signed-off-by: Shaoqin Huang --- linux-headers/linux/arm-smccc.h | 240 1 file changed, 240 insertions(+) create mode 100644 linux-headers/linux/arm

[PATCH v1 1/5] linux-headers: Update to v6.4-rc7

2023-06-26 Thread Shaoqin Huang
Update to commit 45a3e24f65e9 ("Linux 6.4-rc7"). Signed-off-by: Shaoqin Huang --- include/standard-headers/linux/const.h| 2 +- include/standard-headers/linux/virtio_blk.h | 18 +++ .../standard-headers/linux/virtio_config.h| 6 +++ include/standard-hea

[PATCH v1 4/5] arm/kvm: add skeleton implementation for userspace SMCCC call handling

2023-06-26 Thread Shaoqin Huang
-by: Shaoqin Huang --- docs/system/arm/virt.rst | 4 +++ hw/arm/virt.c| 21 include/hw/arm/virt.h| 1 + target/arm/kvm.c | 54 4 files changed, 80 insertions(+) diff --git a/docs/system/arm/virt.rst b/docs/system

[PATCH v1 0/5] target/arm: Handle psci calls in userspace

2023-06-26 Thread Shaoqin Huang
] lore.kernel.org/20230203135043.409192-1-james.mo...@arm.com 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

[PATCH v2] hw: Fix format for comments

2023-06-19 Thread Shaoqin Huang
Simply fix the #vcpus_count to @vcpus_count in CPUArchId comments. Whlie at it, reorder the parameters in comments to match the sequence of parameters which defined in the CPUArchId. Reviewed-by: Igor Mammedov Signed-off-by: Shaoqin Huang --- include/hw/boards.h | 4 ++-- 1 file changed, 2

Re: [PATCH] machine: do not crash if default RAM backend name has been stollen

2023-05-23 Thread Shaoqin Huang
' to object (type 'container') Aborted (core dumped) Instead of abort, check for the conflicting 'id' and exit with an error, suggesting how to remedy the issue. Signed-off-by: Igor Mammedov CC: th...@redhat.com Reviewed-by: Shaoqin Huang --- hw/core/machine.c | 8 1 file changed, 8

[PATCH] hw: Fix format for comments

2023-05-15 Thread Shaoqin Huang
Simply fix the #vcpus_count to @vcpus_count in CPUArchId comments. Since we are at here, resort the parameters in comments to match the sequence of parameters which defined in the CPUArchId. CC: Igor Mammedov Signed-off-by: Shaoqin Huang --- include/hw/boards.h | 4 ++-- 1 file changed, 2

[PATCH] hw: Fix format for comments

2023-05-05 Thread Shaoqin Huang
Simply fix the #vcpus_count to @vcpus_count in CPUArchId comments. Since we are at here, resort the parameters in comments to match the sequence of parameters which defined in the CPUArchId. Signed-off-by: Shaoqin Huang --- include/hw/boards.h | 4 ++-- 1 file changed, 2 insertions(+), 2