[PATCH v4 23/33] target/nios2: Implement nios2_cpu_list()

2023-11-01 Thread Gavin Shan
Implement nios2_cpu_list() to support cpu_list(). With this applied, the available CPU model names, same to the CPU type names, are shown as below. $ ./build/qemu-system-nios2 -cpu ? Available CPUs: nios2-cpu Signed-off-by: Gavin Shan --- target/nios2/cpu.c | 20

[PATCH v4 16/33] target/riscv: Use generic helper to show CPU model names

2023-11-01 Thread Gavin Shan
-off-by: Gavin Shan Reviewed-by: Daniel Henrique Barboza --- target/riscv/cpu.c| 14 -- target/riscv/riscv-qmp-cmds.c | 3 +-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 8b4024338c..9f47379145 100644

[PATCH v4 22/33] target/microblaze: Implement microblaze_cpu_list()

2023-11-01 Thread Gavin Shan
Implement microblaze_cpu_list() to support cpu_list(). With this applied, the available CPU model names, same to the CPU type names, are shown as below. $ ./build/qemu-system-hppa -cpu ? Available CPUs: microblaze-cpu Signed-off-by: Gavin Shan --- target/microblaze/cpu.c | 20

[PATCH v4 08/33] target/cris: Use generic helper to show CPU model names

2023-11-01 Thread Gavin Shan
For target/cris, the registered CPU type name is always the combination of the CPU model name and suffix. Use cpu_model_from_type() to show the CPU model names. Signed-off-by: Gavin Shan --- target/cris/cpu.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/cris

[PATCH v4 20/33] target/tricore: Use generic helper to show CPU model names

2023-11-01 Thread Gavin Shan
For target/tricore, the registered CPU type name is always the combination of the CPU model name and suffix. Use cpu_model_from_type() to show the CPU model names. Signed-off-by: Gavin Shan Reviewed-by: Bastian Koppelmann --- target/tricore/helper.c | 13 + 1 file changed, 5

[PATCH v4 10/33] target/i386: Use generic helper to show CPU model names

2023-11-01 Thread Gavin Shan
For target/i386, the registered CPU type name is always the combination of the CPU model name and suffix. Use cpu_model_from_type() to convert the CPU type name to the CPU model name. Signed-off-by: Gavin Shan --- target/i386/cpu.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions

[PATCH v4 29/33] hw/arm/virt: Check CPU type in machine_run_board_init()

2023-11-01 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é --- hw/arm/virt.c | 21 +++-- 1 file changed, 3 insertions(+),

[PATCH v4 25/33] machine: Constify MachineClass::valid_cpu_types[i]

2023-11-01 Thread Gavin Shan
Constify MachineClass::valid_cpu_types[i], as suggested by Richard Henderson. Suggested-by: Richard Henderson Signed-off-by: Gavin Shan Reviewed-by: Philippe Mathieu-Daudé --- hw/m68k/q800.c | 2 +- include/hw/boards.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v4 21/33] target/hppa: Implement hppa_cpu_list()

2023-11-01 Thread Gavin Shan
Implement hppa_cpu_list() to support cpu_list(). With this applied, the available CPU model names, same to the CPU type names, are shown as below. $ ./build/qemu-system-hppa -cpu ? Available CPUs: hppa-cpu Signed-off-by: Gavin Shan --- target/hppa/cpu.c | 19 +++ target

[PATCH v4 13/33] target/mips: Use generic helper to show CPU model names

2023-11-01 Thread Gavin Shan
of the staticly defined array. Signed-off-by: Gavin Shan --- target/mips/cpu-defs.c.inc | 9 - target/mips/cpu.c | 18 ++ target/mips/sysemu/mips-qmp-cmds.c | 3 +-- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/target/mips/cpu-defs.c.inc b

[PATCH v4 18/33] target/s390x: Use generic helper to show CPU model names

2023-11-01 Thread Gavin Shan
For target/s390x, the registered CPU type name is always the combination of the CPU model name and suffix. Use cpu_model_from_type() to show the CPU model names. Signed-off-by: Gavin Shan --- target/s390x/cpu_models.c| 12 ++-- target/s390x/cpu_models_sysemu.c | 9 - 2

[PATCH v4 19/33] target/sh4: Use generic helper to show CPU model names

2023-11-01 Thread Gavin Shan
model name. Signed-off-by: Gavin Shan --- target/sh4/cpu.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index a8ec98b134..6097ddd52d 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -125,9 +125,10 @@ s

[PATCH v4 06/33] target/arm: Use generic helper to show CPU model names

2023-11-01 Thread Gavin Shan
For target/arm, the registered CPU type name is always the combination of the CPU model name and suffix. Use cpu_model_from_type() to show the CPU model names. In arm_cpu_list_entry(), @name is renamed to @model since it points to CPU model name instead of CPU type name. Signed-off-by: Gavin Shan

[PATCH v4 14/33] target/openrisc: Use generic helper to show CPU model names

2023-11-01 Thread Gavin Shan
For target/openrisc, the registered CPU type name is always the combination of the CPU model name and suffix. Use cpu_model_from_type() to show the CPU model names. Signed-off-by: Gavin Shan --- target/openrisc/cpu.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff

[PATCH v4 09/33] target/hexagon: Use generic helper to show CPU model names

2023-11-01 Thread Gavin Shan
For target/hexagon, the registered CPU type name is always the combination of the CPU model name and suffix. Use cpu_model_from_type() to show the CPU model names. Signed-off-by: Gavin Shan --- target/hexagon/cpu.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git

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

2023-11-01 Thread Gavin Shan
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é Reviewed-by: Gavin Shan --- hw/core/cpu-common.c | 8 +++- include/hw/core/cpu.h | 7

[PATCH v4 04/33] cpu: Add helper cpu_model_from_type()

2023-11-01 Thread Gavin Shan
the CPU type name to the CPU model name. Suggested-by: Igor Mammedov Signed-off-by: Gavin Shan --- cpu-target.c | 16 include/hw/core/cpu.h | 12 2 files changed, 28 insertions(+) diff --git a/cpu-target.c b/cpu-target.c index 876b498233..344bad5736 100644

[PATCH v4 07/33] target/avr: Use generic helper to show CPU model names

2023-11-01 Thread Gavin Shan
For target/avr, the registered CPU type name is always the combination of the CPU model name and suffix. Use cpu_model_from_type() to show the CPU model names. Besides, the conversion from CPU model name to CPU type name needs to be supported in avr_cpu_class_by_name(). Signed-off-by: Gavin Shan

[PATCH v4 05/33] target/alpha: Use generic helper to show CPU model names

2023-11-01 Thread Gavin Shan
For target/alpha, the registered CPU type name is always the combination of the CPU model name and suffix. Use cpu_model_from_type() to show the CPU model names instead of the CPU type names. Signed-off-by: Gavin Shan --- target/alpha/cpu.c | 6 -- 1 file changed, 4 insertions(+), 2

[PATCH v4 03/33] cpu: Call object_class_dynamic_cast() once in cpu_class_by_name()

2023-11-01 Thread Gavin Shan
() for individual target. In order to make CPU_RESOLVING_TYPE visible to cpu_class_by_name(), the helper has to be moved to cpu-target.c Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gavin Shan --- cpu-target.c | 15 +++ hw/core/cpu-common.c | 14 -- target/arm

[PATCH v4 00/33] Unified CPU type check

2023-11-01 Thread Gavin Shan
from Philippe Mathieu-Daudé, Leif Lindholm, Bastian Koppelmann, Daniel Henrique Barboza, Cédric Le Goater, Gavin Shan (Gavin) v3: * Generic helper cpu_model_from_type()(Igor) * Apply cpu_model_from_type() to the indiv

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

2023-11-01 Thread Gavin Shan
pe Mathieu-Daudé Reviewed-by: Gavin Shan --- target/alpha/cpu.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 51b7d8d1bf..c7ae4d6a41 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -142,13 +142,10 @@ static O

Re: [PATCH V5 8/9] physmem: Add helper function to destroy CPU AddressSpace

2023-10-11 Thread Gavin Shan
Hi Salil, On 10/12/23 10:04, Salil Mehta wrote: On 12/10/2023 00:31, Gavin Shan wrote: On 10/12/23 05:43, Salil Mehta wrote: [...] +void cpu_address_space_destroy(CPUState *cpu, int asidx) +{ +    CPUAddressSpace *cpuas; + +    assert(asidx < cpu->num_ases); +    assert(asid

Re: [PATCH V5 9/9] gdbstub: Add helper function to unregister GDB register space

2023-10-11 Thread Gavin Shan
/gdbstub.h | 5 + 2 files changed, 20 insertions(+) With the following nits addressed: Reviewed-by: Gavin Shan diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 349d348c7b..97b89e2d00 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -491,6 +491,21 @@ void

Re: [PATCH V5 8/9] physmem: Add helper function to destroy CPU AddressSpace

2023-10-11 Thread Gavin Shan
ftmmu/ directory as system/"). So please consider leveraging the respin chance to address the following minor comments. With that, Reviewed-by: Gavin Shan diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 41788c0bdd..eb56a228a2 100644 --- a/include/exec/cpu-comm

Re: [PATCH V4 01/10] accel/kvm: Extract common KVM vCPU {creation,parking} code

2023-10-11 Thread Gavin Shan
-events | 4 +++ include/sysemu/kvm.h | 16 +++ 3 files changed, 69 insertions(+), 15 deletions(-) With the following one comment addressed: Reviewed-by: Gavin Shan diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index ff1578bb32..0dcaa15276 100644 --- a/accel/kvm/kvm-all.c

Re: [PATCH 3/4] hw/cpu: Introduce CPUClass::cpu_resolving_type field

2023-10-11 Thread Gavin Shan
Hi Philippe, On 10/11/23 13:28, Philippe Mathieu-Daudé wrote: On 25/9/23 02:24, Gavin Shan wrote: On 9/12/23 08:40, Gavin Shan wrote: On 9/11/23 19:43, Philippe Mathieu-Daudé wrote: On 11/9/23 01:28, Gavin Shan wrote: On 9/8/23 21:22, Philippe Mathieu-Daudé wrote: Add a field to return

Re: [PATCH v2 3/3] arm/kvm: convert to read_sys_reg64

2023-10-10 Thread Gavin Shan
On 10/11/23 00:24, Cornelia Huck wrote: We can use read_sys_reg64 to get the SVE_VLS register instead of calling GET_ONE_REG directly. Suggested-by: Gavin Shan Signed-off-by: Cornelia Huck --- target/arm/kvm64.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) Reviewed

Re: [PATCH RFC V2 05/37] accel/kvm: Extract common KVM vCPU {creation,parking} code

2023-10-02 Thread Gavin Shan
Hi Salil, On 10/3/23 02:20, Salil Mehta wrote: From: Gavin Shan Sent: Wednesday, September 27, 2023 7:52 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 RFC V2 02/37] cpus-common: Add common CPU utility for possible vCPUs

2023-10-02 Thread Gavin Shan
Hi Salil, On 10/2/23 20:21, Salil Mehta wrote: From: Gavin Shan Sent: Wednesday, September 27, 2023 4:54 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 RFC V2 01/37] arm/virt,target/arm: Add new ARMCPU {socket,cluster,core,thread}-id property

2023-10-02 Thread Gavin Shan
Hi Salil, On 10/2/23 19:53, Salil Mehta wrote: Many thanks for taking pains to review this patch-set. No worries. From: Gavin Shan Sent: Wednesday, September 27, 2023 12:57 AM To: Salil Mehta ; qemu-devel@nongnu.org; qemu-...@nongnu.org Cc: m...@kernel.org; jean-phili...@linaro.org

Re: [PATCH V2 10/10] target/arm/kvm: Write CPU state back to KVM on reset

2023-10-02 Thread Gavin Shan
. Force mp_state synchronization. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Salil Mehta Reviewed-by: Alex Bennée --- target/arm/kvm.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) Reviewed-by: Gavin Shan

Re: [PATCH V2 09/10] gdbstub: Add helper function to unregister GDB register space

2023-10-02 Thread Gavin Shan
insertions(+) With the following nits addressed: Reviewed-by: Gavin Shan diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 349d348c7b..89ac0edfea 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -491,6 +491,20 @@ void gdb_register_coprocessor(CPUState *cpu, } } +void

Re: [PATCH V2 08/10] physmem: Add helper function to destroy CPU AddressSpace

2023-10-02 Thread Gavin Shan
On 9/30/23 10:19, Salil Mehta wrote: Virtual CPU Hot-unplug leads to unrealization of a CPU object. This also involves destruction of the CPU AddressSpace. Add common function to help destroy the CPU AddressSpace. Signed-off-by: Salil Mehta --- include/exec/cpu-common.h | 8

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

2023-10-02 Thread Gavin Shan
Signed-off-by: Salil Mehta --- hw/acpi/generic_event_device.c | 10 ++ 1 file changed, 10 insertions(+) Reviewed-by: Gavin Shan

Re: [PATCH V2 06/10] hw/acpi: Update GED _EVT method AML with cpu scan

2023-10-02 Thread Gavin Shan
method with the call to \\_SB.CPUS.CSCN which will do above. Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta --- hw/acpi/generic_event_device.c | 4 include/hw/acpi/cpu_hotplug.h | 2 ++ 2 files changed, 6 insertions(+) Reviewed-by: Gavin Shan

Re: [PATCH V2 05/10] hw/acpi: Update CPUs AML with cpu-(ctrl)dev change

2023-10-02 Thread Gavin Shan
improved to address Jonathan's comments why @event_handler_method won't be needed on aarch64: Reviewed-by: Gavin Shan diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 45defdc0e2..66a71660ec 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -338,9 +338,10 @@ const VMStateDescription

Re: [PATCH V2 04/10] hw/acpi: Init GED framework with cpu hotplug events

2023-10-02 Thread Gavin Shan
-by: Gavin Shan

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

2023-10-02 Thread Gavin Shan
-stub.c | 6 ++ 1 file changed, 6 insertions(+) Reviewed-by: Gavin Shan 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/hw/acpi/acpi-cpu-hotplug-stub.c @@ -19,6 +19,12 @@ void

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

2023-10-02 Thread Gavin Shan
| 2 +- include/hw/acpi/cpu_hotplug.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Gavin Shan

Re: [PATCH V2 01/10] accel/kvm: Extract common KVM vCPU {creation,parking} code

2023-10-02 Thread Gavin Shan
On 9/30/23 10:19, Salil Mehta wrote: KVM vCPU creation is done once during the initialization of the VM when Qemu threads are spawned. This is common to all the architectures. ^^^ thread is spawned. Hot-unplug of vCPU results in destruction of the vCPU objects in QOM but

Re: [PATCH RFC V2 35/37] hw/arm: Support hotplug capability check using _OSC method

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:36, Salil Mehta wrote: Physical CPU hotplug results in (un)setting of ACPI _STA.Present bit. AARCH64 platforms do not support physical CPU hotplug. Virtual CPU hotplug support being implemented toggles ACPI _STA.Enabled Bit to achieve hotplug functionality. This is not

Re: [PATCH RFC V2 34/37] target/arm/kvm,tcg: Register/Handle SMCCC hypercall exits to VMM/Qemu

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:36, Salil Mehta wrote: From: Author Salil Mehta Add registration and Handling of HVC/SMC hypercall exits to VMM Co-developed-by: Salil Mehta Signed-off-by: Salil Mehta Co-developed-by: Jean-Philippe Brucker Signed-off-by: Jean-Philippe Brucker Signed-off-by: Salil

Re: [PATCH RFC V2 29/37] arm/virt: Update the guest(via GED) about CPU hot-(un)plug events

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: During any vCPU hot-(un)plug, running guest VM needs to be intimated about the new vCPU being added or request the deletion of the vCPU which is already part of the guest VM. This is done using the ACPI GED event which eventually gets demultiplexed

Re: [PATCH RFC V2 25/37] arm/virt: Add/update basic hot-(un)plug framework

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: Add CPU hot-unplug hooks and update hotplug hooks with additional sanity checks for use in hotplug paths. Note, Functional contents of the hooks(now left with TODO comment) shall be gradually filled in the subsequent patches in an incremental

Re: [PATCH RFC V2 23/37] arm/virt: Release objects for *disabled* possible vCPUs after init

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: During machvirt_init(), QOM ARMCPU objects are also pre-created along with the corresponding KVM vCPUs in the host for all possible vCPUs. This necessary because of the architectural constraint, KVM restricts the deferred creation of the KVM vCPUs

Re: [PATCH RFC V2 22/37] hw/acpi: Make _MAT method optional

2023-09-28 Thread Gavin Shan
addressed: Reviewed-by: Gavin Shan diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index e1299696d3..217db99538 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -715,11 +715,13 @@ void build_cpus_aml(Aml *table, MachineState *machine, CPUHotplugFeatures opts, aml_append(dev, method

Re: [PATCH RFC V2 21/37] hw/arm: MADT Tbl change to size the guest with possible vCPUs

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: Changes required during building of MADT Table by QEMU to accomodate disabled possible vCPUs. This info shall be used by the guest kernel to size up its resources during boot time. This pre-sizing of the guest kernel done on possible vCPUs will

Re: [PATCH RFC V2 20/37] hw/acpi: Update GED _EVT method AML with cpu scan

2023-09-28 Thread Gavin Shan
changed, 6 insertions(+) Reviewed-by: Gavin Shan diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index b84602b238..ad252e6a91 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -108,6 +108,10 @@ void build_ged_aml(Aml *table, const

Re: [PATCH RFC V2 19/37] hw/acpi: ACPI/AML Changes to reflect the correct _STA.{PRES,ENA} Bits to Guest

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: ACPI AML changes to properly reflect the _STA.PRES and _STA.ENA Bits to the guest during initialzation, when CPUs are hotplugged and after CPUs are hot-unplugged. Signed-off-by: Salil Mehta --- hw/acpi/cpu.c | 49

Re: [PATCH RFC V2 18/37] arm/virt: Make ARM vCPU *present* status ACPI *persistent*

2023-09-28 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: ARM arch does not allow CPUs presence to be changed [1] after kernel has booted. Hence, firmware/ACPI/Qemu must ensure persistent view of the vCPUs to the Guest kernel even when they are not present in the QoM i.e. are unplugged or are

Re: [PATCH RFC V2 17/37] arm/virt/acpi: Build CPUs AML with CPU Hotplug support

2023-09-27 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: Support of vCPU Hotplug requires sequence of ACPI handshakes between Qemu and Guest kernel when a vCPU is plugged or unplugged. Most of the AML code to support these handshakes already exists. This AML need to be build during VM init for ARM

Re: [PATCH RFC V2 16/37] hw/acpi: Update CPUs AML with cpu-(ctrl)dev change

2023-09-27 Thread Gavin Shan
in build_cpus_aml(), as part of the generic container device (\\_SB.PCI0 or \\_SB.PRES). Adapt build_cpus_aml() so that IO region and memory region can be handled in the mean while. Reviewed-by: Gavin Shan diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index d5ba37b209..232720992d 100644 --- a/hw/acpi/cpu.c

Re: [PATCH RFC V2 15/37] arm/virt: Create GED dev before *disabled* CPU Objs are destroyed

2023-09-27 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: ACPI CPU hotplug state (is_present=_STA.PRESENT, is_enabled=_STA.ENABLED) for all the possible vCPUs MUST be initialized during machine init. This is done during the creation of the GED device. VMM/Qemu MUST expose/fake the ACPI state of the

Re: [PATCH RFC V2 14/37] arm/virt: Add cpu hotplug events to GED during creation

2023-09-27 Thread Gavin Shan
exchanges between Qemu/VMM and the guest. Signed-off-by: Salil Mehta --- hw/arm/virt.c | 5 - include/hw/arm/virt.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) The changes look good to me: Reviewed-by: Gavin Shan diff --git a/hw/arm/virt.c b/hw/arm/virt.c index

Re: [PATCH RFC V2 13/37] hw/acpi: Init GED framework with cpu hotplug events

2023-09-27 Thread Gavin Shan
changes look good to me with the following nits addressed: Reviewed-by: Gavin Shan diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index a3d31631fe..d2fa1d0e4a 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -25,6 +25,7 @@ static

Re: [PATCH RFC V2 12/37] hw/acpi: Use qemu_present_cpu() API in ACPI CPU hotplug init

2023-09-27 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: ACPI CPU Hotplug code assumes a virtual CPU is unplugged if the CPUState object is absent in the list of ths possible CPUs(CPUArchIdList *possible_cpus) maintained on per-machine basis. Use the earlier introduced qemu_present_cpu() API to check

Re: [PATCH RFC V2 11/37] hw/acpi: Add ACPI CPU hotplug init stub

2023-09-27 Thread Gavin Shan
| 6 ++ 1 file changed, 6 insertions(+) Reviewed-by: Gavin Shan 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/hw/acpi/acpi-cpu-hotplug-stub.c @@ -19,6 +19,12 @@ void

Re: [PATCH RFC V2 10/37] arm/acpi: Enable ACPI support for vcpu hotplug

2023-09-27 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: ACPI is required to interface QEMU with the guest. Roughly falls into below cases, 1. Convey the possible vcpus config at the machine init time to the guest using various DSDT tables like MADT etc. 2. Convey vcpu hotplug events to guest(using

Re: [PATCH RFC V2 09/37] hw/acpi: Move CPU ctrl-dev MMIO region len macro to common header file

2023-09-27 Thread Gavin Shan
to a header file. Signed-off-by: Salil Mehta --- hw/acpi/cpu.c | 2 +- include/hw/acpi/cpu_hotplug.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Gavin Shan diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 19c154d78f..45defdc0e2 100644 --- a/hw/acpi

Re: [PATCH RFC V2 07/37] arm/virt, gicv3: Changes to pre-size GIC with possible vcpus @machine init

2023-09-27 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: GIC needs to be pre-sized with possible vcpus at the initialization time. This is necessary because Memory regions and resources associated with GICC/GICR etc cannot be changed (add/del/modified) after VM has inited. Also, GIC_TYPER needs to be

Re: [PATCH RFC V2 06/37] arm/virt,kvm: Pre-create disabled possible vCPUs @machine init

2023-09-27 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: In ARMv8 architecture, GIC needs all the vCPUs to be created and present when it is initialized. This is because: 1. GICC and MPIDR association must be fixed at the VM initialization time. This is represented by register GIC_TYPER(mp_afffinity,

Re: [PATCH] target/arm/kvm64.c: Remove unused include

2023-09-27 Thread Gavin Shan
cleaned up the code to not depend on virt board internals but forgot to also remove the now-redundant include line. Signed-off-by: Peter Maydell --- target/arm/kvm64.c | 1 - 1 file changed, 1 deletion(-) Reviewed-by: Gavin Shan diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index

Re: [PATCH RFC V2 05/37] accel/kvm: Extract common KVM vCPU {creation,parking} code

2023-09-27 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: KVM vCPU creation is done once during the initialization of the VM when Qemu threads are spawned. This is common to all the architectures. If the architecture supports vCPU hot-{un}plug then this KVM vCPU creation could be deferred to later point

Re: [PATCH RFC V2 04/37] arm/virt,target/arm: Machine init time change common to vCPU {cold|hot}-plug

2023-09-27 Thread Gavin Shan
Mehta Signed-off-by: Salil Mehta Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Reported-by: Gavin Shan ^ [GS: pointed the assertion due to wrong range check] Signed-off-by: Salil Mehta --- hw/arm/virt.c

Re: [PATCH RFC V2 04/37] arm/virt,target/arm: Machine init time change common to vCPU {cold|hot}-plug

2023-09-27 Thread Gavin Shan
-by: Salil Mehta Signed-off-by: Salil Mehta Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Reported-by: Gavin Shan [GS: pointed the assertion due to wrong range check] Signed-off-by: Salil Mehta --- hw/arm/virt.c | 149 - target/arm/cpu.c

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

2023-09-26 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta 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,

Re: [PATCH RFC V2 02/37] cpus-common: Add common CPU utility for possible vCPUs

2023-09-26 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: Adds various utility functions which might be required to fetch or check the state of the possible vCPUs. This also introduces concept of *disabled* vCPUs, which are part of the *possible* vCPUs but are not part of the *present* vCPU. This state

Re: [PATCH RFC V2 01/37] arm/virt,target/arm: Add new ARMCPU {socket,cluster,core,thread}-id property

2023-09-26 Thread Gavin Shan
Hi Salil, On 9/26/23 20:04, Salil Mehta wrote: This shall be used to store user specified topology{socket,cluster,core,thread} and shall be converted to a unique 'vcpu-id' which is used as slot-index during hot(un)plug of vCPU. Note that we don't have 'vcpu-id' property. It's actually the

Re: [PATCH RFC V2 00/37] Support of Virtual CPU Hotplug for ARMv8 Arch

2023-09-25 Thread Gavin Shan
Hi Salil, On 9/26/23 06:21, Salil Mehta wrote: From: Russell King Sent: Monday, September 25, 2023 9:13 PM To: Salil Mehta Cc: qemu-devel@nongnu.org; qemu-...@nongnu.org; m...@kernel.org; james.mo...@arm.com; jean-phili...@linaro.org; Jonathan Cameron ; lorenzo.pieral...@linaro.com;

Re: [PATCH 3/4] hw/cpu: Introduce CPUClass::cpu_resolving_type field

2023-09-24 Thread Gavin Shan
Hi Philippe, On 9/12/23 08:40, Gavin Shan wrote: On 9/11/23 19:43, Philippe Mathieu-Daudé wrote: On 11/9/23 01:28, Gavin Shan wrote: On 9/8/23 21:22, Philippe Mathieu-Daudé wrote: Add a field to return the QOM type name of a CPU class. Signed-off-by: Philippe Mathieu-Daudé ---   include/hw

Re: [PATCH 3/4] hw/cpu: Introduce CPUClass::cpu_resolving_type field

2023-09-11 Thread Gavin Shan
On 9/11/23 19:43, Philippe Mathieu-Daudé wrote: On 11/9/23 01:28, Gavin Shan wrote: On 9/8/23 21:22, Philippe Mathieu-Daudé wrote: Add a field to return the QOM type name of a CPU class. Signed-off-by: Philippe Mathieu-Daudé ---   include/hw/core/cpu.h   | 2 ++   hw/core/cpu-common.c

Re: [PATCH v3 27/32] machine: Print CPU model name instead of CPU type name

2023-09-10 Thread Gavin Shan
On 9/8/23 17:56, Philippe Mathieu-Daudé wrote: On 8/9/23 01:49, Gavin Shan wrote: On 9/7/23 19:05, Philippe Mathieu-Daudé wrote: On 7/9/23 02:35, 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

Re: [PATCH v3 15/32] target/s390x: Use generic helper to show CPU model names

2023-09-10 Thread Gavin Shan
On 9/8/23 21:23, Philippe Mathieu-Daudé wrote: On 8/9/23 10:04, Philippe Mathieu-Daudé wrote: On 8/9/23 01:44, Gavin Shan wrote: On 9/7/23 18:20, David Hildenbrand wrote: On 07.09.23 02:35, Gavin Shan wrote: For target/s390x, the CPU type name is always the combination of the CPU modle name

Re: [PATCH 4/4] hw/cpu: Call object_class_dynamic_cast() once in cpu_class_by_name()

2023-09-10 Thread Gavin Shan
On 9/8/23 21:22, Philippe Mathieu-Daudé wrote: Leverage the public CPUClass::cpu_resolving_type field and call object_class_dynamic_cast() once in cpu_class_by_name(). Signed-off-by: Philippe Mathieu-Daudé --- hw/core/cpu-common.c | 3 ++- target/alpha/cpu.c | 3 +--

Re: [PATCH 1/4] target/alpha: Tidy up alpha_cpu_class_by_name()

2023-09-10 Thread Gavin Shan
On 9/8/23 21:22, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/alpha/cpu.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) Reviewed-by: Gavin Shan diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 270ae787b1..351ee2e9f2 100644

Re: [PATCH 3/4] hw/cpu: Introduce CPUClass::cpu_resolving_type field

2023-09-10 Thread Gavin Shan
Hi Philippe, On 9/8/23 21:22, Philippe Mathieu-Daudé wrote: Add a field to return the QOM type name of a CPU class. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 2 ++ hw/core/cpu-common.c| 2 +- target/alpha/cpu.c | 1 + target/arm/cpu.c| 1 +

Re: [PATCH v3 27/32] machine: Print CPU model name instead of CPU type name

2023-09-07 Thread Gavin Shan
On 9/7/23 19:05, Philippe Mathieu-Daudé wrote: On 7/9/23 02:35, 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 error messages to print CPU

Re: [PATCH v3 15/32] target/s390x: Use generic helper to show CPU model names

2023-09-07 Thread Gavin Shan
On 9/7/23 18:20, David Hildenbrand wrote: On 07.09.23 02:35, Gavin Shan wrote: For target/s390x, the CPU type name is always the combination of the CPU modle name and suffix. The CPU model names have been correctly shown in s390_print_cpu_model_list_entry() and create_cpu_model_list(). Use

Re: [PATCH v3 15/32] target/s390x: Use generic helper to show CPU model names

2023-09-07 Thread Gavin Shan
On 9/7/23 18:31, Thomas Huth wrote: On 07/09/2023 02.35, Gavin Shan wrote: For target/s390x, the CPU type name is always the combination of the CPU modle name and suffix. The CPU model names have been correctly s/modle/model/ Thanks, will be fixed in next respin. Thanks, Gavin

Re: [PATCH v3 01/32] cpu: Add helper cpu_model_from_type()

2023-09-07 Thread Gavin Shan
On 9/7/23 18:54, Philippe Mathieu-Daudé wrote: On 7/9/23 02:35, Gavin Shan wrote: Add helper cpu_model_from_type() to extract the CPU model name from the CPU type name in two circumstances: (1) The CPU type name is the combination of the CPU model name and suffix. (2) The CPU type name is same

[PATCH v3 32/32] hw/riscv/shakti_c: Check CPU type in machine_run_board_init()

2023-09-06 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 --- hw/riscv/shakti_c.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/riscv/shakti_c.c b

[PATCH v3 31/32] hw/arm: Check CPU type in machine_run_board_init()

2023-09-06 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 --- hw/arm/bananapi_m2u.c | 12 ++-- hw/arm/cubieboard.c | 12 ++-- hw/arm/mps2-tz.c|

[PATCH v3 29/32] hw/arm/virt: Hide host CPU model for tcg

2023-09-06 Thread Gavin Shan
-a55, cortex-a72, cortex-a76, a64fx, neoverse-n1, neoverse-v1, cortex-a53, cortex-a57, (null), max Hide 'host' CPU model until KVM or HVF is enabled. Signed-off-by: Gavin Shan --- hw/arm/virt.c | 2 ++ 1 file changed, 2

[PATCH v3 27/32] machine: Print CPU model name instead of CPU type name

2023-09-06 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 Shan --- hw/core

[PATCH v3 30/32] hw/arm/sbsa-ref: Check CPU type in machine_run_board_init()

2023-09-06 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 --- hw/arm/sbsa-ref.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/hw/arm/s

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

2023-09-06 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 --- hw/arm/virt.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/hw/arm/vir

[PATCH v3 25/32] machine: Use error handling when CPU type is checked

2023-09-06 Thread Gavin Shan
ons 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 da699cf4e1..6d3f8e133f 100644 --- a/hw/c

[PATCH v3 26/32] machine: Introduce helper is_cpu_type_supported()

2023-09-06 Thread Gavin Shan
spanning of code. The comments are tweaked a bit either. No functional change intended. Signed-off-by: Gavin Shan --- hw/core/machine.c | 82 +-- 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index

[PATCH v3 24/32] machine: Constify MachineClass::valid_cpu_types[i]

2023-09-06 Thread Gavin Shan
Constify MachineClass::valid_cpu_types[i], as suggested by Richard Henderson. Suggested-by: Richard Henderson Signed-off-by: Gavin Shan --- hw/m68k/q800.c | 2 +- include/hw/boards.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c

[PATCH v3 23/32] Mark cpu_list() supported on all targets

2023-09-06 Thread Gavin Shan
Remove the false conditions and comments since cpu_list() has been supported on all targets. Signed-off-by: Gavin Shan --- bsd-user/main.c | 3 --- cpu.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index f913cb55a7..3a2d84f14b 100644

[PATCH v3 22/32] target/nios2: Implement nios2_cpu_list()

2023-09-06 Thread Gavin Shan
Implement nios2_cpu_list() to support cpu_list(). With this applied, the available CPU model names, same to the CPU type names, are shown as below. $ ./build/qemu-system-nios2 -cpu ? Available CPUs: nios2-cpu Signed-off-by: Gavin Shan --- target/nios2/cpu.c | 20

[PATCH v3 21/32] target/microblaze: Implement microblaze_cpu_list()

2023-09-06 Thread Gavin Shan
Implement microblaze_cpu_list() to support cpu_list(). With this applied, the available CPU model names, same to the CPU type names, are shown as below. $ ./build/qemu-system-hppa -cpu ? Available CPUs: microblaze-cpu Signed-off-by: Gavin Shan --- target/microblaze/cpu.c | 20

[PATCH v3 20/32] target/hppa: Implement hppa_cpu_list()

2023-09-06 Thread Gavin Shan
Implement hppa_cpu_list() to support cpu_list(). With this applied, the available CPU model names, same to the CPU type names, are shown as below. $ ./build/qemu-system-hppa -cpu ? Available CPUs: hppa-cpu Signed-off-by: Gavin Shan --- target/hppa/cpu.c | 19 +++ target

[PATCH v3 19/32] target/xtensa: Improve xtensa_cpu_class_by_name()

2023-09-06 Thread Gavin Shan
Improve xtensa_cpu_class_by_name() by merging the condition of '@oc == NULL' to object_class_dynamic_cast(). Signed-off-by: Gavin Shan --- target/xtensa/cpu.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index acaf8c905f

[PATCH v3 17/32] target/tricore: Use generic helper to show CPU model names

2023-09-06 Thread Gavin Shan
() is also improved by merging the condition of '@oc == NULL' to object_class_dynamic_cast(). Signed-off-by: Gavin Shan --- target/tricore/cpu.c| 9 + target/tricore/helper.c | 13 + 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/target/tricore/cpu.c b/target

[PATCH v3 18/32] target/sparc: Improve sparc_cpu_class_by_name()

2023-09-06 Thread Gavin Shan
Improve sparc_cpu_class_by_name() by validating @oc, to ensure it's child of TYPE_SPARC_CPU since it's possible for other types of classes to have TYPE_SPARC_CPU as the suffix of their type names. Signed-off-by: Gavin Shan --- target/sparc/cpu.c | 7 ++- 1 file changed, 6 insertions(+), 1

[PATCH v3 16/32] target/sh4: Use generic helper to show CPU model names

2023-09-06 Thread Gavin Shan
model name in the above function. Besides, superh_cpu_class_by_name() is improved by avoiding "goto out" and validating the CPU class. Signed-off-by: Gavin Shan --- target/sh4/cpu.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/target/sh4/cpu.

[PATCH v3 15/32] target/s390x: Use generic helper to show CPU model names

2023-09-06 Thread Gavin Shan
functions. Besides, we need validate the CPU class in s390_cpu_class_by_name(), as other targets do. Signed-off-by: Gavin Shan --- target/s390x/cpu_models.c| 18 +++--- target/s390x/cpu_models_sysemu.c | 9 - 2 files changed, 15 insertions(+), 12 deletions(-) diff --git

[PATCH v3 14/32] target/rx: Use generic helper to show CPU model names

2023-09-06 Thread Gavin Shan
, rx_cpu_class_by_name() is improved by merging the condition of '@oc == NULL' to object_class_dynamic_cast(). Signed-off-by: Gavin Shan --- target/rx/cpu.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 157e57da0f..ff0ced1f3d

<    1   2   3   4   5   6   7   8   9   10   >