Re: [PATCH-for-9.0 04/16] target/arm/kvm: Have kvm_arm_sve_set_vls take a ARMCPU argument

2023-11-26 Thread Gavin Shan
target/arm/kvm.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 05/16] target/arm/kvm: Have kvm_arm_sve_get_vls take a ARMCPU argument

2023-11-26 Thread Gavin Shan
Hi Phil, On 11/24/23 05:35, Philippe Mathieu-Daudé wrote: Unify the "kvm_arm.h" API: All functions related to ARM vCPUs take a ARMCPU* argument. Use the CPU() QOM cast macro When calling the generic vCPU API from "sysemu/kvm.h". Signed-off-by: Philippe Mathieu-Daudé --- target/arm/kvm_arm.h

Re: [PATCH-for-9.0 06/16] target/arm/kvm: Have kvm_arm_set_device_attr take a ARMCPU argument

2023-11-26 Thread Gavin Shan
arget/arm/kvm.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 07/16] target/arm/kvm: Have kvm_arm_pvtime_init take a ARMCPU argument

2023-11-26 Thread Gavin Shan
et/arm/kvm_arm.h | 6 +++--- hw/arm/virt.c| 5 +++-- target/arm/kvm.c | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 08/16] target/arm/kvm: Have kvm_arm_pmu_init take a ARMCPU argument

2023-11-26 Thread Gavin Shan
target/arm/kvm_arm.h | 4 ++-- hw/arm/virt.c| 2 +- target/arm/kvm.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) One nit below, but I guess it doesn't matter. Reviewed-by: Gavin Shan diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h index 0e12a008ab

Re: [PATCH-for-9.0 09/16] target/arm/kvm: Have kvm_arm_pmu_set_irq take a ARMCPU argument

2023-11-26 Thread Gavin Shan
et/arm/kvm_arm.h | 4 ++-- hw/arm/virt.c| 2 +- target/arm/kvm.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 10/16] target/arm/kvm: Have kvm_arm_vcpu_init take a ARMCPU argument

2023-11-26 Thread Gavin Shan
arget/arm/kvm.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 11/16] target/arm/kvm: Have kvm_arm_vcpu_finalize take a ARMCPU argument

2023-11-26 Thread Gavin Shan
target/arm/kvm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 10/16] target/arm/kvm: Have kvm_arm_vcpu_init take a ARMCPU argument

2023-11-26 Thread Gavin Shan
arget/arm/kvm.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 12/16] target/arm/kvm: Have kvm_arm_[get|put]_virtual_time take ARMCPU argument

2023-11-26 Thread Gavin Shan
arget/arm/kvm.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 13/16] target/arm/kvm: Have kvm_arm_verify_ext_dabt_pending take a ARMCPU arg

2023-11-26 Thread Gavin Shan
target/arm/kvm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 14/16] target/arm/kvm: Have kvm_arm_handle_dabt_nisv take a ARMCPU argument

2023-11-26 Thread Gavin Shan
arget/arm/kvm.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 15/16] target/arm/kvm: Have kvm_arm_handle_debug take a ARMCPU argument

2023-11-26 Thread Gavin Shan
target/arm/kvm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 16/16] target/arm/kvm: Have kvm_arm_hw_debug_active take a ARMCPU argument

2023-11-26 Thread Gavin Shan
target/arm/kvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) With the following comments addressed: Reviewed-by: Gavin Shan diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 1f6da5529f..cbfea689cc 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -145

Re: [PATCH v7 0/8] Unified CPU type check

2023-11-27 Thread Gavin Shan
On 11/27/23 21:10, Marcin Juszkiewicz wrote: W dniu 27.11.2023 o 00:12, Gavin Shan pisze: After the series is applied:    [gshan@gshan q]$ ./build/qemu-system-aarch64 -M virt -cpu cortex-a8    qemu-system-aarch64: Invalid CPU type: cortex-a8    The valid types are: cortex-a7, cortex-a15

Re: [PATCH v7 5/8] hw/arm/virt: Check CPU type in machine_run_board_init()

2023-11-27 Thread Gavin Shan
On 11/27/23 21:13, Marcin Juszkiewicz wrote: W dniu 27.11.2023 o 00:12, Gavin Shan pisze: @@ -2939,6 +2900,28 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)   {   MachineClass *mc = MACHINE_CLASS(oc);   HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc

Re: [PATCH v7 1/8] machine: Use error handling when CPU type is checked

2023-11-28 Thread Gavin Shan
Hi Phil, On 11/28/23 20:43, Philippe Mathieu-Daudé wrote: On 27/11/23 00:12, Gavin Shan wrote: QEMU will be terminated if the specified CPU type isn't supported in machine_run_board_init(). The list of supported CPU type names is tracked by mc->valid_cpu_types. The error handling can

Re: [PATCH v7 2/8] machine: Introduce helper is_cpu_type_supported()

2023-11-28 Thread Gavin Shan
Hi Phil, On 11/28/23 20:38, Philippe Mathieu-Daudé wrote: On 27/11/23 00:12, Gavin Shan wrote: The logic, to check if the specified CPU type is supported in machine_run_board_init(), is independent enough. Factor it out into helper is_cpu_type_supported(). machine_run_board_init() looks a bit

Re: [PATCH v7 3/8] machine: Print CPU model name instead of CPU type

2023-11-28 Thread Gavin Shan
Hi Phil, On 11/28/23 20:55, Philippe Mathieu-Daudé wrote: On 27/11/23 00:12, Gavin Shan wrote: The names of supported CPU models instead of CPU types should be printed when the user specified CPU type isn't supported, to be consistent with the output from '-cpu ?'. Correct the

[PATCH v8 0/9] Unified CPU type check

2023-11-28 Thread Gavin Shan
* Clearer hint if only one CPU type is supported and have 'const MachineState *' in is_cpu_type_supported() (Phil) * Move valid_cpu_types[] to board's class_init() function (Phil) Gavin Shan (9): machine: Use error handling when CPU type is checked mach

[PATCH v8 1/9] machine: Use error handling when CPU type is checked

2023-11-28 Thread Gavin Shan
tions in the same function. No functional change intended. Suggested-by: Igor Mammedov Signed-off-by: Gavin Shan --- v8: Drop @local_err and use @errp to be compatible with ERRP_GUARD() (Phil) --- hw/core/machine.c | 13 +++-- 1 file ch

[PATCH v8 6/9] hw/arm/virt: Check CPU type in machine_run_board_init()

2023-11-28 Thread Gavin Shan
Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do the check by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/vir

[PATCH v8 3/9] machine: Improve is_cpu_type_supported()

2023-11-28 Thread Gavin Shan
ry. Besides, enumeration on mc->valid_cpu_types[0] when we have mutiple valid entries there is avoided to increase the code readability, as suggested by Philippe Mathieu-Daudé. Signed-off-by: Gavin Shan --- hw/core/machine.c | 18 -- 1 file changed, 12 insertions(+), 6 dele

[PATCH v8 4/9] machine: Print CPU model name instead of CPU type

2023-11-28 Thread Gavin Shan
The names of supported CPU models instead of CPU types should be printed when the user specified CPU type isn't supported, to be consistent with the output from '-cpu ?'. Correct the error messages to print CPU model names instead of CPU type names. Signed-off-by: Gavin Sh

[PATCH v8 8/9] hw/arm: Check CPU type in machine_run_board_init()

2023-11-28 Thread Gavin Shan
Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do it by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/arm/bananapi_m2u.c | 12 ++--

[PATCH v8 2/9] machine: Introduce helper is_cpu_type_supported()

2023-11-28 Thread Gavin Shan
nning of code. The comments are tweaked a bit either. No functional change intended. Signed-off-by: Gavin Shan --- v8: Move the precise message hint to PATCH[v8 3/9](Gavin) --- hw/core/machine.c | 83 +-- 1 file changed, 45 insertions(+

[PATCH v8 5/9] hw/arm/virt: Hide host CPU model for tcg

2023-11-28 Thread Gavin Shan
, the valid CPU models can be shown. qemu-system-aarch64: Invalid CPU type: cortex-a8 The valid types are: cortex-a7, cortex-a15, cortex-a35, \ cortex-a55, cortex-a72, cortex-a76, cortex-a710, a64fx, \ neoverse-n1, neoverse-v1, neoverse-n2, cortex-a53, \ cortex-a57, max Signed-off-b

[PATCH v8 9/9] hw/riscv/shakti_c: Check CPU type in machine_run_board_init()

2023-11-28 Thread Gavin Shan
Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do it by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daudé --- hw/riscv/shakti_c.c | 13 ++--- 1 file changed, 6 insertions(+), 7 d

[PATCH v8 7/9] hw/arm/sbsa-ref: Check CPU type in machine_run_board_init()

2023-11-28 Thread Gavin Shan
Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do it by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Leif Lindholm Reviewed-by: Richard Henderson --- hw/arm/sbsa-re

Re: [PATCH v8 1/9] machine: Use error handling when CPU type is checked

2023-11-30 Thread Gavin Shan
Hi Markus, On 11/29/23 19:20, Markus Armbruster wrote: Gavin Shan writes: QEMU will be terminated if the specified CPU type isn't supported in machine_run_board_init(). The list of supported CPU type names is tracked by mc->valid_cpu_types. Suggest to drop the second sentence.

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

2023-11-30 Thread Gavin Shan
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 Filtering. Without the filter, the KVM will expose all

Re: [PATCH v8 2/9] machine: Introduce helper is_cpu_type_supported()

2023-12-03 Thread Gavin Shan
Hi Phil, On 12/1/23 20:53, Philippe Mathieu-Daudé wrote: On 29/11/23 05:20, Gavin Shan wrote: The logic, to check if the specified CPU type is supported in machine_run_board_init(), is independent enough. Factor it out into helper is_cpu_type_supported(). machine_run_board_init() looks a bit

Re: [PATCH v8 3/9] machine: Improve is_cpu_type_supported()

2023-12-03 Thread Gavin Shan
Hi Phil On 12/1/23 20:57, Philippe Mathieu-Daudé wrote: On 29/11/23 05:20, Gavin Shan wrote: It's no sense to check the CPU type when mc->valid_cpu_types[0] is NULL. This case is a programming error, right? We should simply:  assert(!mc->valid_cpu_types || *mc->valid_cpu_

Re: [PATCH v8 3/9] machine: Improve is_cpu_type_supported()

2023-12-03 Thread Gavin Shan
Hi Phil, On 12/4/23 09:20, Gavin Shan wrote: On 12/1/23 20:57, Philippe Mathieu-Daudé wrote: On 29/11/23 05:20, Gavin Shan wrote: It's no sense to check the CPU type when mc->valid_cpu_types[0] is NULL. This case is a programming error, right? We should simply:   as

[PATCH v9 1/9] machine: Use error handling when CPU type is checked

2023-12-03 Thread Gavin Shan
upport the requested CPU type. Clean this up by using error_setg() and error_append_hint() instead. No functional change, as the only caller passes &error_fatal. Suggested-by: Igor Mammedov Signed-off-by: Gavin Shan Reviewed-by: Markus Armbruster --- v9: Impro

[PATCH v9 0/9] Unified CPU type check

2023-12-03 Thread Gavin Shan
v6: * Drop PATCH[v5 01-23], queued by Phil (Phil) * Clearer hint if only one CPU type is supported and have 'const MachineState *' in is_cpu_type_supported()(Phil) * Move valid_cpu_types[] to board's class_init() function (Phil) Gavin Sha

[PATCH v9 5/9] hw/arm/virt: Hide host CPU model for tcg

2023-12-03 Thread Gavin Shan
, the valid CPU models can be shown. qemu-system-aarch64: Invalid CPU type: cortex-a8 The valid types are: cortex-a7, cortex-a15, cortex-a35, \ cortex-a55, cortex-a72, cortex-a76, cortex-a710, a64fx, \ neoverse-n1, neoverse-v1, neoverse-n2, cortex-a53, \ cortex-a57, max Signed-off-b

[PATCH v9 8/9] hw/arm: Check CPU type in machine_run_board_init()

2023-12-03 Thread Gavin Shan
Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do it by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- hw/arm/bananapi_m2u.c | 12 ++--

[PATCH v9 2/9] machine: Introduce helper is_cpu_type_supported()

2023-12-03 Thread Gavin Shan
nning of code. The comments are tweaked a bit either. No functional change intended. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daudé --- hw/core/machine.c | 83 +-- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/hw

[PATCH v9 9/9] hw/riscv/shakti_c: Check CPU type in machine_run_board_init()

2023-12-03 Thread Gavin Shan
Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do it by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daudé --- hw/riscv/shakti_c.c | 13 ++--- 1 file changed, 6 insertions(+), 7 d

[PATCH v9 7/9] hw/arm/sbsa-ref: Check CPU type in machine_run_board_init()

2023-12-03 Thread Gavin Shan
Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do it by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Leif Lindholm Reviewed-by: Richard Henderson --- hw/arm/sbsa-re

[PATCH v9 4/9] machine: Print CPU model name instead of CPU type

2023-12-03 Thread Gavin Shan
The names of supported CPU models instead of CPU types should be printed when the user specified CPU type isn't supported, to be consistent with the output from '-cpu ?'. Correct the error messages to print CPU model names instead of CPU type names. Signed-off-by: Gavin Sh

[PATCH v9 3/9] machine: Improve is_cpu_type_supported()

2023-12-03 Thread Gavin Shan
mutiple valid entries there is avoided to increase the code readability, as suggested by Philippe Mathieu-Daudé. Besides, @cc comes from machine->cpu_type or mc->default_cpu_type. For the later case, it can be NULL and it's also a program error. We should use assert() in this case. Sign

[PATCH v9 6/9] hw/arm/virt: Check CPU type in machine_run_board_init()

2023-12-03 Thread Gavin Shan
Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do the check by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/vir

Re: [PATCH-for-9.0 2/2] target/arm/kvm: Use generic kvm_supports_guest_debug()

2023-12-03 Thread Gavin Shan
On 12/2/23 00:32, Philippe Mathieu-Daudé wrote: Do not open-code the generic kvm_supports_guest_debug(). Signed-off-by: Philippe Mathieu-Daudé --- target/arm/kvm64.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 1/2] accel/kvm: Expose kvm_supports_guest_debug() prototype

2023-12-03 Thread Gavin Shan
On 12/2/23 00:32, Philippe Mathieu-Daudé wrote: kvm_supports_guest_debug() should be accessible by KVM implementations. Signed-off-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-cpus.h | 1 - include/sysemu/kvm.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Gavin

Re: [PATCH-for-9.0 01/25] memory: Have memory_region_init_ram_flags_nomigrate() return a boolean

2023-12-03 Thread Gavin Shan
clude/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) With Peter Xu's comments addressed, to replace cpu_exec_realizefn() with memory_region_init_ram_flags_nomigrate() in the commit log. Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 02/25] memory: Have memory_region_init_ram_nomigrate() handler return a boolean

2023-12-03 Thread Gavin Shan
clude/exec/memory.h | 4 +++- system/memory.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) s/cpu_exec_realizefn()/memory_region_init_ram_nomigrate() for the commit message, as mentioned by Peter Xu. Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 03/25] memory: Have memory_region_init_rom_nomigrate() handler return a boolean

2023-12-03 Thread Gavin Shan
clude/exec/memory.h | 4 +++- system/memory.c | 8 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) s/cpu_exec_realizefn()/memory_region_init_rom_nomigrate() in the commit message, mentioned by Peter Xu. With this: Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 04/25] memory: Simplify memory_region_init_rom_nomigrate() calls

2023-12-03 Thread Gavin Shan
wner, arg3, arg4, &errp) ) { ... return; } and removing the local Error variable. Signed-off-by: Philippe Mathieu-Daudé --- system/memory.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 05/25] memory: Simplify memory_region_init_ram_from_fd() calls

2023-12-03 Thread Gavin Shan
errp + !memory_region_init_ram_from_fd(mr, owner, arg3, arg4, arg5, arg6, arg7, &errp) ) { ... return; } and removing the local Error variable. Signed-off-by: Philippe Mathieu-Daudé --- system/memory.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) Reviewed-b

Re: [PATCH-for-9.0 06/25] memory: Have memory_region_init_ram() handler return a boolean

2023-12-03 Thread Gavin Shan
clude/exec/memory.h | 4 +++- system/memory.c | 6 -- 2 files changed, 7 insertions(+), 3 deletions(-) With Peter Xu's comments addressed: Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 07/25] memory: Have memory_region_init_rom() handler return a boolean

2023-12-03 Thread Gavin Shan
clude/exec/memory.h | 4 +++- system/memory.c | 6 -- 2 files changed, 7 insertions(+), 3 deletions(-) s/cpu_exec_realizefn()/memory_region_init_rom() Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 08/25] memory: Have memory_region_init_rom_device_nomigrate() return a boolean

2023-12-03 Thread Gavin Shan
clude/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) s/cpu_exec_realizefn()/memory_region_init_rom_device_nomigrate() Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 09/25] memory: Simplify memory_region_init_rom_device_nomigrate() calls

2023-12-03 Thread Gavin Shan
iewed-by: Gavin Shan

Re: [PATCH-for-9.0 10/25] memory: Have memory_region_init_rom_device() handler return a boolean

2023-12-03 Thread Gavin Shan
clude/exec/memory.h | 4 +++- system/memory.c | 6 -- 2 files changed, 7 insertions(+), 3 deletions(-) With Peter Xu's comments addressed, to s/cpu_exec_realizefn()/memory_region_init_rom_device() in the commit messages. Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 11/25] memory: Have memory_region_init_resizeable_ram() return a boolean

2023-12-03 Thread Gavin Shan
clude/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) s/cpu_exec_realizefn()/memory_region_init_resizeable_ram() Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 12/25] memory: Have memory_region_init_ram_from_file() handler return a boolean

2023-12-03 Thread Gavin Shan
clude/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) s/cpu_exec_realizefn()/memory_region_init_ram_from_file() Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 13/25] memory: Have memory_region_init_ram_from_fd() handler return a boolean

2023-12-03 Thread Gavin Shan
clude/exec/memory.h | 4 +++- system/memory.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) s/cpu_exec_realizefn()/memory_region_init_ram_from_fd() Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 14/25] backends: Use g_autofree in HostMemoryBackendClass::alloc() handlers

2023-12-03 Thread Gavin Shan
-memfd.c | 3 +-- backends/hostmem-ram.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 15/25] backends: Simplify host_memory_backend_memory_complete()

2023-12-03 Thread Gavin Shan
Signed-off-by: Philippe Mathieu-Daudé --- backends/hostmem.c | 133 +++-- 1 file changed, 67 insertions(+), 66 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 16/25] backends: Have HostMemoryBackendClass::alloc() handler return a boolean

2023-12-03 Thread Gavin Shan
deletions(-) s/cpu_exec_realizefn()/HostMemoryBackendClass::alloc() Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 17/25] backends: Reduce variable scope in host_memory_backend_memory_complete

2023-12-03 Thread Gavin Shan
On 11/21/23 07:32, Philippe Mathieu-Daudé wrote: Reduce the &local_err variable use and remove the 'out:' label. Signed-off-by: Philippe Mathieu-Daudé --- backends/hostmem.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 18/25] util/oslib: Have qemu_prealloc_mem() handler return a boolean

2023-12-03 Thread Gavin Shan
clude/qemu/osdep.h | 4 +++- util/oslib-posix.c | 7 +-- util/oslib-win32.c | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) s/cpu_exec_realizefn()/qemu_prealloc_mem() Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 19/25] misc: Simplify qemu_prealloc_mem() calls

2023-12-03 Thread Gavin Shan
On 11/21/23 07:32, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- backends/hostmem.c | 22 +++--- hw/virtio/virtio-mem.c | 6 ++ 2 files changed, 9 insertions(+), 19 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 20/25] hw: Simplify memory_region_init_ram() calls

2023-12-03 Thread Gavin Shan
l-imx6.c | 6 ++ hw/arm/integratorcp.c | 7 ++- hw/arm/nrf51_soc.c | 7 ++- hw/ppc/rs6000_mc.c | 7 ++- 8 files changed, 16 insertions(+), 35 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 22/25] hw/sparc: Simplify memory_region_init_ram_nomigrate() calls

2023-12-03 Thread Gavin Shan
iewed-by: Gavin Shan

Re: [PATCH-for-9.0 21/25] hw/arm: Simplify memory_region_init_rom() calls

2023-12-03 Thread Gavin Shan
eletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 23/25] hw/misc: Simplify memory_region_init_ram_from_fd() calls

2023-12-03 Thread Gavin Shan
iewed-by: Gavin Shan

Re: [PATCH-for-9.0 25/25] hw/pci-host/raven: Propagate error in raven_realize()

2023-12-03 Thread Gavin Shan
changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH-for-9.0 24/25] hw/nvram: Simplify memory_region_init_rom_device() calls

2023-12-03 Thread Gavin Shan
errp + !memory_region_init_rom_device(mr, owner, arg3, arg4, arg5, arg6, &errp) ) { ... return; } and removing the local Error variable. Signed-off-by: Philippe Mathieu-Daudé --- hw/nvram/nrf51_nvm.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH v9 1/9] machine: Use error handling when CPU type is checked

2024-01-07 Thread Gavin Shan
On 1/5/24 21:00, Philippe Mathieu-Daudé wrote: On 4/12/23 01:47, Gavin Shan wrote: Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. The principle is violated by machine_run_board_init() because it

Re: [PATCH v9 3/9] machine: Improve is_cpu_type_supported()

2024-01-07 Thread Gavin Shan
On 1/6/24 08:09, Philippe Mathieu-Daudé wrote: On 4/12/23 01:47, Gavin Shan wrote: It's no sense to check the CPU type when mc->valid_cpu_types[0] is NULL, which is a program error. Raise an assert on this. A precise hint for the error message is given when mc->valid_cpu_types[0]

Re: [PATCH v9 0/9] Unified CPU type check

2024-01-07 Thread Gavin Shan
Hi Phil, On 1/6/24 08:12, Philippe Mathieu-Daudé wrote: On 13/12/23 11:54, Gavin Shan wrote: On 12/13/23 20:08, Philippe Mathieu-Daudé wrote: On 12/12/23 05:55, Gavin Shan wrote: On 12/4/23 10:47, Gavin Shan wrote: This series bases on Phil's repository because the prepatory commits

[PATCH] hw/arm/virt: Consolidate valid CPU types

2024-01-10 Thread Gavin Shan
a15, cortex-a35, cortex-a55, cortex-a72, cortex-a76, cortex-a710, a64fx, neoverse-n1, neoverse-v1, neoverse-n2, cortex-a53, cortex-a57, max Reported-by: Peter Maydell Fixes: fa8c617791 ("hw/arm/virt: Check CPU type in machine_run_board_init()") Signed-off-by: Gavin Shan --- hw/arm/virt.c | 8

Re: [PULL 29/71] hw/arm/virt: Check CPU type in machine_run_board_init()

2024-01-10 Thread Gavin Shan
Hi Peter, On 1/10/24 00:33, Peter Maydell wrote: On Fri, 5 Jan 2024 at 15:46, Philippe Mathieu-Daudé wrote: From: Gavin Shan Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do the check by ourselves. Hi; af

Re: [PATCH] hw/core: Handle cpu_model_from_type() returning NULL value

2024-01-10 Thread Gavin Shan
Hi Phil, On 1/11/24 16:47, Philippe Mathieu-Daudé wrote: Per cpu_model_from_type() docstring (added in commit 445946f4dd): * Returns: CPU model name or NULL if the CPU class doesn't exist We must check the return value in order to avoid surprises, i.e.: $ qemu-system-arm -machine virt -c

Re: [PATCH] hw/core: Handle cpu_model_from_type() returning NULL value

2024-01-11 Thread Gavin Shan
Hi Phil, On 1/11/24 18:21, Philippe Mathieu-Daudé wrote: On 11/1/24 08:30, Gavin Shan wrote: On 1/11/24 16:47, Philippe Mathieu-Daudé wrote: Per cpu_model_from_type() docstring (added in commit 445946f4dd):    * Returns: CPU model name or NULL if the CPU class doesn't exist We must

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

2023-12-10 Thread Gavin Shan
Hi Shaoqin, On 12/7/23 20:36, Shaoqin Huang wrote: The KVM_ARM_VCPU_PMU_V3_FILTER provide the ability to let the VMM decide ^^^ provides which PMU events are provided to the guest. Add a new option `pmu-filter` as -accel sub

Re: [PATCH v9 0/9] Unified CPU type check

2023-12-11 Thread Gavin Shan
Hi Phil, On 12/4/23 10:47, Gavin Shan wrote: This series bases on Phil's repository because the prepatory commits have been queued to the branch. https://gitlab.com/philmd/qemu.git (branch: cpus-next) There are two places where the user specified CPU type is checked to see if

Re: [PATCH v9 0/9] Unified CPU type check

2023-12-13 Thread Gavin Shan
On 12/13/23 20:08, Philippe Mathieu-Daudé wrote: On 12/12/23 05:55, Gavin Shan wrote: On 12/4/23 10:47, Gavin Shan wrote: This series bases on Phil's repository because the prepatory commits have been queued to the branch.    https://gitlab.com/philmd/qemu.git (branch: cpus-next) Ther

Re: [PATCH v4 01/33] target/alpha: Tidy up alpha_cpu_class_by_name()

2023-11-13 Thread Gavin Shan
On 11/7/23 00:22, Igor Mammedov wrote: On Thu, 2 Nov 2023 10:24:28 +1000 Gavin Shan wrote: From: Philippe Mathieu-Daudé For target/alpha, the default CPU model name is "ev67". The default CPU model is used when no matching CPU model is found. The conditions to fall back to the d

Re: [PATCH v4 02/33] hw/cpu: Call object_class_is_abstract() once in cpu_class_by_name()

2023-11-13 Thread Gavin Shan
On 11/7/23 00:40, Igor Mammedov wrote: On Thu, 2 Nov 2023 10:24:29 +1000 Gavin Shan wrote: From: Philippe Mathieu-Daudé Let CPUClass::class_by_name() handlers to return abstract classes, and filter them once in the public cpu_class_by_name() method. Signed-off-by: Philippe Mathieu-Daudé

[PATCH v5 02/31] target/hppa: Remove object_class_is_abstract()

2023-11-14 Thread Gavin Shan
No need to check if @oc is abstract because it has been covered by cpu_class_by_name(). Signed-off-by: Gavin Shan --- target/hppa/cpu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 04de1689d7..fc4d2abad7 100644 --- a/target/hppa/cpu.c +++ b

[PATCH v5 03/31] cpu: Call object_class_dynamic_cast() once in cpu_class_by_name()

2023-11-14 Thread Gavin Shan
individual target. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan Reviewed-by: Igor Mammedov --- hw/core/cpu-common.c | 8 +--- target/alpha/cpu.c | 3 --- target/arm/cpu.c | 4 +--- target/avr/cpu.c | 8 +--- target/cris/cpu.c | 4 +--- target/hexagon

[PATCH v5 05/31] cpu: Add helper cpu_model_from_type()

2023-11-14 Thread Gavin Shan
the CPU type name to the CPU model name. Suggested-by: Igor Mammedov Signed-off-by: Gavin Shan --- cpu-target.c | 15 +++ include/hw/core/cpu.h | 12 2 files changed, 27 insertions(+) diff --git a/cpu-target.c b/cpu-target.c index 508013e23d..c078c0e91b 100644

[PATCH v5 00/31] Unified CPU type check

2023-11-14 Thread Gavin Shan
as) * g_assert() on the return value from cpu_model_from_type() in is_cpu_type_supported() (Philippe) * Collected r-bs from Philippe Mathieu-Daudé, Leif Lindholm, Bastian Koppelmann, Daniel Henrique Barboza, Cédric Le Goater, Gavin Shan

[PATCH v5 01/31] target/alpha: Remove 'ev67' CPU class

2023-11-14 Thread Gavin Shan
'ev67' CPU class will be returned to match everything, which makes no sense as mentioned in the comments. Remove the logic to fall back to 'ev67' CPU class to match everything. Signed-off-by: Gavin Shan --- target/alpha/cpu.c | 7 ++- 1 file changed, 2 insertions(+),

[PATCH v5 07/31] target/alpha: Use generic cpu_list()

2023-11-14 Thread Gavin Shan
PUs: ev4 ev5 ev56 ev6 ev67 ev68 pca56 Signed-off-by: Gavin Shan --- target/alpha/cpu.c | 17 - target/alpha/cpu.h | 3 --- 2 files changed, 20 deletions(-) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index c19257d765..cece69bfa6 100644 --- a/target/alpha/c

[PATCH v5 11/31] target/hexagon: Use generic cpu_list()

2023-11-14 Thread Gavin Shan
No changes in the output from the following command. [gshan@gshan q]$ ./build/qemu-hexagon -cpu ? Available CPUs: v67 v68 v69 v71 v73 Signed-off-by: Gavin Shan --- target/hexagon/cpu.c | 20 target/hexagon/cpu.h | 3 --- 2 files changed, 23 deletions(-) diff

[PATCH v5 08/31] target/arm: Use generic cpu_list()

2023-11-14 Thread Gavin Shan
70-a0 pxa270-a1 pxa270 pxa270-b0 pxa270-b1 pxa270-c0 pxa270-c5 sa1100 sa1110 ti925t Signed-off-by: Gavin Shan --- target/arm/cpu.h| 3 --- target/arm/helper.c | 46 - 2 files changed, 49 deletions(-) diff --git a/target/arm/cpu.h b/t

[PATCH v5 10/31] target/cris: Use generic cpu_list()

2023-11-14 Thread Gavin Shan
v9 Signed-off-by: Gavin Shan --- target/cris/cpu.c | 38 -- target/cris/cpu.h | 3 --- 2 files changed, 41 deletions(-) diff --git a/target/cris/cpu.c b/target/cris/cpu.c index a5083a0077..9ba08e8b0c 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -9

[PATCH v5 04/31] target: Remove 'oc == NULL' check

2023-11-14 Thread Gavin Shan
No need to have 'oc == NULL' since object_class_dynamic_cast() covers it. Besides, we don't expect an abstrat CPU class returned from CPUClass::cpu_class_by_name() in the middle on alpha and rx. Signed-off-by: Gavin Shan --- target/alpha/cpu.c | 3 ++- target/rx/cpu.c|

[PATCH v5 09/31] target/avr: Use generic cpu_list()

2023-11-14 Thread Gavin Shan
Before it's applied: [gshan@gshan q]$ ./build/qemu-system-avr -cpu ? avr5-avr-cpu avr51-avr-cpu avr6-avr-cpu After it's applied: [gshan@gshan q]$ ./build/qemu-system-avr -cpu ? Available CPUs: avr5 avr51 avr6 Signed-off-by: Gavin Shan --- target/avr/cpu.c | 15 -

[PATCH v5 14/31] target/m68k: Use generic cpu_list()

2023-11-14 Thread Gavin Shan
0 m68040 m68060 Signed-off-by: Gavin Shan --- target/m68k/cpu.h| 4 target/m68k/helper.c | 40 2 files changed, 44 deletions(-) diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 6cfc696d2b..d13427b0fe 100644 --- a/target/m68k/cpu.h ++

[PATCH v5 16/31] target/openrisc: Use generic cpu_list()

2023-11-14 Thread Gavin Shan
Before it's applied: [gshan@gshan q]$ ./build/qemu-or1k -cpu ? Available CPUs: or1200 any After it's applied: [gshan@gshan q]$ ./build/qemu-or1k -cpu ? Available CPUs: any or1200 Signed-off-by: Gavin Shan --- target/openrisc/

[PATCH v5 13/31] target/loongarch: Use generic cpu_list()

2023-11-14 Thread Gavin Shan
Before it's applied: [gshan@gshan q]$ ./build/qemu-system-loongarch64 -cpu ? la132-loongarch-cpu la464-loongarch-cpu max-loongarch-cpu After it's applied: [gshan@gshan q]$ ./build/qemu-system-loongarch64 -cpu ? Available CPUs: la132 la464 max Signed-off-by: Gavin Shan -

[PATCH v5 20/31] target/tricore: Use generic cpu_list()

2023-11-14 Thread Gavin Shan
No changes in the output from the following command. [gshan@gshan q]$ ./build/qemu-system-tricore -cpu ? Available CPUs: tc1796 tc1797 tc27x tc37x Signed-off-by: Gavin Shan --- target/tricore/cpu.h| 4 target/tricore/helper.c | 22 -- 2 files changed, 26

[PATCH v5 24/31] machine: Use error handling when CPU type is checked

2023-11-14 Thread Gavin Shan
tions in the same function. No functional change intended. Suggested-by: Igor Mammedov Signed-off-by: Gavin Shan --- hw/core/machine.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index 0c17398141..5b45dbbbd5 100644 --- a

[PATCH v5 28/31] hw/arm/virt: Check CPU type in machine_run_board_init()

2023-11-14 Thread Gavin Shan
Set mc->valid_cpu_types so that the user specified CPU type can be validated in machine_run_board_init(). We needn't to do the check by ourselves. Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/arm/virt.c | 21 +++--

<    4   5   6   7   8   9   10   11   >