[PATCH v5 4/6] hw/arm/virt: Introduce virt_get_high_memmap_enabled() helper

2022-10-11 Thread Gavin Shan
This introduces virt_get_high_memmap_enabled() helper, which returns the pointer to vms->highmem_{redists, ecam, mmio}. The pointer will be used in the subsequent patches. No functional change intended. Signed-off-by: Gavin Shan Tested-by: Zhenyu Zhang --- hw/arm/virt.c |

[PATCH v5 2/6] hw/arm/virt: Rename variable size to region_size in virt_set_high_memmap()

2022-10-11 Thread Gavin Shan
This renames variable 'size' to 'region_size' in virt_set_high_memmap(). Its counterpart ('region_base') will be introduced in next patch. No functional change intended. Signed-off-by: Gavin Shan Reviewed-by: Eric Auger Reviewed-by: Cornelia Huck Tested-by: Zh

[PATCH v5 5/6] hw/arm/virt: Improve high memory region address assignment

2022-10-11 Thread Gavin Shan
it has been disabled in case (1), (2) and (3). 'vms->high_compact' is false for now, meaning that we don't have any behavior changes until it becomes configurable through property 'compact-highmem' in next patch. Signed-off-by: Gavin Shan Tested-by: Zhenyu Zhang --- hw/arm/vir

[PATCH v6 0/4] hw/arm/virt: Fix CPU's default NUMA node ID

2022-04-17 Thread Gavin Shan
/3] to take thread ID as ACPI processor ID in MADT and SRAT table (Gavin) Gavin Shan (4): qapi/machine.json: Add cluster-id hw/arm/virt: Consider SMP configuration in CPU topology hw/arm/virt: Fix CPU's default NUMA node ID hw/acpi/aml-build: Use e

[PATCH v6 1/4] qapi/machine.json: Add cluster-id

2022-04-17 Thread Gavin Shan
::machine_numa_finish_cpu_init() to associate CPU with NUMA node when no default association isn't provided. * hw/core/machine-hmp-cmds.c::hmp_hotpluggable_cpus() to dump cluster-id. Signed-off-by: Gavin Shan Reviewed-by: Yanan Wang --- hw/core/machine-hmp-cmds.c | 4 hw/core/machine.c

[PATCH v6 2/4] hw/arm/virt: Consider SMP configuration in CPU topology

2022-04-17 Thread Gavin Shan
lated. The die ID for the given CPU isn't assigned since it's not supported on arm/virt machine. Besides, the used SMP configuration in qtest/numa-test/aarch64_numa_cpu() is corrcted to avoid testing failure Signed-off-by: Gavin Shan Reviewed-by: Yanan Wang --- hw/arm/v

[PATCH v6 4/4] hw/acpi/aml-build: Use existing CPU topology to build PPTT table

2022-04-17 Thread Gavin Shan
user of build_pptt() is arm/virt machine. Signed-off-by: Gavin Shan --- hw/acpi/aml-build.c | 105 ++-- 1 file changed, 43 insertions(+), 62 deletions(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 4086879ebf..2bd062a52b 100644 --- a/hw/

[PATCH v6 3/4] hw/arm/virt: Fix CPU's default NUMA node ID

2022-04-17 Thread Gavin Shan
e associated with NODE#0/1, but there are no CPUs associated with NODE#2/3/4/5. Signed-off-by: Gavin Shan Reviewed-by: Igor Mammedov Reviewed-by: Yanan Wang --- hw/arm/virt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 5443ecae92..c347

Re: [PATCH v5 1/4] qapi/machine.json: Add cluster-id

2022-04-19 Thread Gavin Shan
Hi Daniel, On 4/19/22 11:59 PM, Daniel P. Berrangé wrote: On Thu, Apr 14, 2022 at 10:27:25AM +0800, wangyanan (Y) wrote: Hi Gavin, Cc: Daniel and Markus On 2022/4/14 8:06, Gavin Shan wrote: Hi Yanan, On 4/13/22 7:49 PM, wangyanan (Y) wrote: On 2022/4/3 22:59, Gavin Shan wrote: This adds

Re: [PATCH v5 4/4] hw/acpi/aml-build: Use existing CPU topology to build PPTT table

2022-04-19 Thread Gavin Shan
Hi Igor, On 4/19/22 4:54 PM, Igor Mammedov wrote: On Thu, 14 Apr 2022 08:33:29 +0800 Gavin Shan wrote: On 4/13/22 9:52 PM, Igor Mammedov wrote: On Sun, 3 Apr 2022 22:59:53 +0800 Gavin Shan wrote: When the PPTT table is built, the CPU topology is re-calculated, but it's unece

Re: [PATCH v5 4/4] hw/acpi/aml-build: Use existing CPU topology to build PPTT table

2022-04-20 Thread Gavin Shan
Hi Igor, On 4/20/22 4:10 PM, Igor Mammedov wrote: On Wed, 20 Apr 2022 13:19:34 +0800 Gavin Shan wrote: On 4/19/22 4:54 PM, Igor Mammedov wrote: On Thu, 14 Apr 2022 08:33:29 +0800 Gavin Shan wrote: On 4/13/22 9:52 PM, Igor Mammedov wrote: On Sun, 3 Apr 2022 22:59:53 +0800 Gavin Shan

Re: [PATCH v6 2/4] hw/arm/virt: Consider SMP configuration in CPU topology

2022-04-20 Thread Gavin Shan
Hi Igor, On 4/20/22 4:32 PM, Igor Mammedov wrote: On Mon, 18 Apr 2022 10:09:18 +0800 Gavin Shan wrote: Currently, the SMP configuration isn't considered when the CPU topology is populated. In this case, it's impossible to provide the default CPU-to-NUMA mapping or association ba

[PATCH v7 2/4] hw/arm/virt: Consider SMP configuration in CPU topology

2022-04-20 Thread Gavin Shan
lated. The die ID for the given CPU isn't assigned since it's not supported on arm/virt machine. Besides, the used SMP configuration in qtest/numa-test/aarch64_numa_cpu() is corrcted to avoid testing failure Signed-off-by: Gavin Shan Reviewed-by: Yanan Wang --- hw/arm/v

[PATCH v7 4/4] hw/acpi/aml-build: Use existing CPU topology to build PPTT table

2022-04-20 Thread Gavin Shan
user of build_pptt() is arm/virt machine. Signed-off-by: Gavin Shan --- hw/acpi/aml-build.c | 109 +++- 1 file changed, 47 insertions(+), 62 deletions(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 4086879ebf..73f4e69c29 100644 --- a/hw/

[PATCH v7 0/4] hw/arm/virt: Fix CPU's default NUMA node ID

2022-04-20 Thread Gavin Shan
(Igor) * Added PATCH[3/3] to take thread ID as ACPI processor ID in MADT and SRAT table (Gavin) Gavin Shan (4): qapi/machine.json: Add cluster-id hw/arm/virt: Consider SMP configuration in CPU topology hw/arm/virt:

[PATCH v7 1/4] qapi/machine.json: Add cluster-id

2022-04-20 Thread Gavin Shan
::machine_numa_finish_cpu_init() to associate CPU with NUMA node when no default association isn't provided. * hw/core/machine-hmp-cmds.c::hmp_hotpluggable_cpus() to dump cluster-id. Signed-off-by: Gavin Shan Reviewed-by: Yanan Wang --- hw/core/machine-hmp-cmds.c | 4 hw/core/machine.c

[PATCH v7 3/4] hw/arm/virt: Fix CPU's default NUMA node ID

2022-04-20 Thread Gavin Shan
e associated with NODE#0/1, but there are no CPUs associated with NODE#2/3/4/5. Signed-off-by: Gavin Shan Reviewed-by: Igor Mammedov Reviewed-by: Yanan Wang --- hw/arm/virt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 5443ecae92..c347

Re: [PATCH v6 2/4] hw/arm/virt: Consider SMP configuration in CPU topology

2022-04-20 Thread Gavin Shan
Hi Igor, On 4/20/22 7:50 PM, Igor Mammedov wrote: On Wed, 20 Apr 2022 18:31:02 +0800 Gavin Shan wrote: On 4/20/22 4:32 PM, Igor Mammedov wrote: On Mon, 18 Apr 2022 10:09:18 +0800 Gavin Shan wrote: Currently, the SMP configuration isn't considered when the CPU topology is populate

Re: [PATCH v6 2/4] hw/arm/virt: Consider SMP configuration in CPU topology

2022-04-21 Thread Gavin Shan
Hi Igor, On 4/20/22 10:50 PM, Igor Mammedov wrote: On Wed, 20 Apr 2022 22:24:46 +0800 Gavin Shan wrote: On 4/20/22 7:50 PM, Igor Mammedov wrote: On Wed, 20 Apr 2022 18:31:02 +0800 Gavin Shan wrote: On 4/20/22 4:32 PM, Igor Mammedov wrote: On Mon, 18 Apr 2022 10:09:18 +0800 Gavin Shan

Re: [PATCH v6 2/4] hw/arm/virt: Consider SMP configuration in CPU topology

2022-04-21 Thread Gavin Shan
Hi Drew, On 4/21/22 5:02 PM, Andrew Jones wrote: On Wed, Apr 20, 2022 at 10:24:46PM +0800, Gavin Shan wrote: ... With amend to the command lines, the following one is used and below error is raised from the test. The error is mentioned in the commit log in PATCH[v7 2/4]. -machine

Re: [PATCH v7 4/4] hw/acpi/aml-build: Use existing CPU topology to build PPTT table

2022-04-21 Thread Gavin Shan
Hi Igor, On 4/20/22 10:56 PM, Igor Mammedov wrote: On Wed, 20 Apr 2022 18:49:09 +0800 Gavin Shan wrote: When the PPTT table is built, the CPU topology is re-calculated, but it's unecessary because the CPU topology has been populated in virt_possible_cpu_arch_ids() on arm/virt machine.

Re: [PATCH v7 4/4] hw/acpi/aml-build: Use existing CPU topology to build PPTT table

2022-04-22 Thread Gavin Shan
Hi Yanan, On 4/21/22 7:50 PM, wangyanan (Y) wrote: On 2022/4/20 18:49, Gavin Shan wrote: When the PPTT table is built, the CPU topology is re-calculated, but it's unecessary because the CPU topology has been populated in virt_possible_cpu_arch_ids() on arm/virt machine. This re

Re: [PATCH v7 1/4] qapi/machine.json: Add cluster-id

2022-04-22 Thread Gavin Shan
Hi Yanan, On 4/21/22 7:51 PM, wangyanan (Y) wrote: On 2022/4/20 18:49, Gavin Shan wrote: This adds cluster-id in CPU instance properties, which will be used by arm/virt machine. Besides, the cluster-id is also verified or dumped in various spots:    * hw/core/machine.c

Re: [PATCH v7 2/4] hw/arm/virt: Consider SMP configuration in CPU topology

2022-04-22 Thread Gavin Shan
Hi Yanan, On 4/21/22 7:50 PM, wangyanan (Y) wrote: Hi Gavin, Sorry I missed the v6. No problem at all. thanks for your review again :) On 2022/4/20 18:49, Gavin Shan wrote: Currently, the SMP configuration isn't considered when the CPU topology is populated. In this case, it's

[PATCH v8 0/5] hw/arm/virt: Fix CPU's default NUMA node ID

2022-04-24 Thread Gavin Shan
(Igor) * Added PATCH[3/3] to take thread ID as ACPI processor ID in MADT and SRAT table (Gavin) Gavin Shan (5): qapi/machine.json: Add cluster-id qtest/numa-test: Specify CPU topology in aarch64_numa_cpu() hw/arm/virt: Consider SMP configura

[PATCH v8 1/5] qapi/machine.json: Add cluster-id

2022-04-24 Thread Gavin Shan
::machine_numa_finish_cpu_init() to record CPU slots with no NUMA mapping set. * hw/core/machine-hmp-cmds.c::hmp_hotpluggable_cpus() to dump cluster-id. Signed-off-by: Gavin Shan Reviewed-by: Yanan Wang --- hw/core/machine-hmp-cmds.c | 4 hw/core/machine.c | 16 qapi

[PATCH v8 2/5] qtest/numa-test: Specify CPU topology in aarch64_numa_cpu()

2022-04-24 Thread Gavin Shan
ore the CPU topology is enabled in next patch. Signed-off-by: Gavin Shan Reviewed-by: Yanan Wang --- tests/qtest/numa-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qtest/numa-test.c b/tests/qtest/numa-test.c index 90bf68a5b3..aeda8c774c 100644 --- a/tests/q

[PATCH v8 3/5] hw/arm/virt: Consider SMP configuration in CPU topology

2022-04-24 Thread Gavin Shan
lated. The die ID for the given CPU isn't assigned since it's not supported on arm/virt machine. Besides, the used SMP configuration in qtest/numa-test/aarch64_numa_cpu() is corrcted to avoid testing failure Signed-off-by: Gavin Shan Reviewed-by: Yanan Wang --- hw/arm/virt.c | 15 +++

[PATCH v8 4/5] hw/arm/virt: Fix CPU's default NUMA node ID

2022-04-24 Thread Gavin Shan
e associated with NODE#0/1, but there are no CPUs associated with NODE#2/3/4/5. Signed-off-by: Gavin Shan Reviewed-by: Igor Mammedov Reviewed-by: Yanan Wang --- hw/arm/virt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 0fd7f9a6a1..0910

[PATCH v8 5/5] hw/acpi/aml-build: Use existing CPU topology to build PPTT table

2022-04-24 Thread Gavin Shan
user of build_pptt() is arm/virt machine. Signed-off-by: Gavin Shan Tested-by: Yanan Wang Reviewed-by: Yanan Wang Acked-by: Igor Mammedov --- hw/acpi/aml-build.c | 111 +++- 1 file changed, 48 insertions(+), 63 deletions(-) diff --git a/hw/acpi/aml-buil

[PATCH 0/1] hw/arm/virt: Support for virtio-mem-pci

2021-11-29 Thread Gavin Shan
emu) qom-set hp-vm1 requested-size 0 (qemu) qom-set hp-vm1 requested-size 512M Gavin Shan (1): hw/arm/virt: Support for virtio-mem-pci hw/arm/Kconfig | 1 + hw/arm/virt.c | 68 +- hw/virtio/virtio-mem.c | 2 ++ 3 files changed, 70 i

[PATCH 1/1] hw/arm/virt: Support for virtio-mem-pci

2021-11-29 Thread Gavin Shan
t huge page and HugeTLB, plus migration. Signed-off-by: Gavin Shan --- hw/arm/Kconfig | 1 + hw/arm/virt.c | 68 +- hw/virtio/virtio-mem.c | 2 ++ 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/hw/arm/Kconfig b/hw/ar

Re: [PATCH 1/1] hw/arm/virt: Support for virtio-mem-pci

2021-11-30 Thread Gavin Shan
On 11/30/21 8:37 PM, David Hildenbrand wrote: On 30.11.21 01:33, Gavin Shan wrote: This supports virtio-mem-pci device on "virt" platform, by simply following the implementation on x86. Thanks for picking this up! Thanks, David. * The patch was written by David H

[PATCH v2 0/2] hw/arm/virt: Support for virtio-mem-pci

2021-12-02 Thread Gavin Shan
64 in PATCH[1/2] (David) * PATCH[2/2] is added to correct the THP sizes on ARM64 (David) Gavin Shan (2): hw/arm/virt: Support for virtio-mem-pci virtio-mem: Correct default THP size for ARM64 hw/arm/Kconfig | 1 + hw/arm/virt.

[PATCH v2 1/2] hw/arm/virt: Support for virtio-mem-pci

2021-12-02 Thread Gavin Shan
Co-developed-by: Jonathan Cameron Signed-off-by: Gavin Shan --- hw/arm/Kconfig | 1 + hw/arm/virt.c | 68 +- hw/virtio/virtio-mem.c | 4 ++- 3 files changed, 71 insertions(+), 2 deletions(-) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig i

[PATCH v2 2/2] virtio-mem: Correct default THP size for ARM64

2021-12-02 Thread Gavin Shan
brand Signed-off-by: Gavin Shan --- hw/virtio/virtio-mem.c | 32 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index ac7a40f514..8f3c95300f 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/vi

Re: [PATCH 1/1] hw/arm/virt: Support for virtio-mem-pci

2021-12-02 Thread Gavin Shan
On 12/1/21 8:03 PM, David Hildenbrand wrote: * It has been passing the tests with various combinations like 64KB and 4KB page sizes on host and guest, different memory device backends like normal, transparent huge page and HugeTLB, plus migration. Perfect. A note that

Re: [PATCH v2 0/2] hw/arm/virt: Support for virtio-mem-pci

2021-12-03 Thread Gavin Shan
Hi Jonathan, On 12/4/21 1:10 AM, Jonathan Cameron wrote: On Fri, 3 Dec 2021 11:35:20 +0800 Gavin Shan wrote: This series supports virtio-mem-pci device, by simply following the implementation on x86. The exception is the block size is 512MB on ARM64 instead of 128MB on x86, compatible with

Re: [PATCH v2 1/2] hw/arm/virt: Support for virtio-mem-pci

2021-12-03 Thread Gavin Shan
On 12/4/21 5:18 AM, David Hildenbrand wrote: On 03.12.21 04:35, Gavin Shan wrote: This supports virtio-mem-pci device on "virt" platform, by simply following the implementation on x86. * This implements the hotplug handlers to support virtio-mem-pci device hot-add, whi

[PATCH v3 2/2] hw/arm/virt: Support for virtio-mem-pci

2021-12-03 Thread Gavin Shan
Co-developed-by: Jonathan Cameron Signed-off-by: Gavin Shan Reviewed-by: Jonathan Cameron Reviewed-by: David Hildenbrand --- hw/arm/Kconfig | 1 + hw/arm/virt.c | 68 +- hw/virtio/virtio-mem.c | 4 ++- 3 files changed, 71 insertions(+), 2 del

[PATCH v3 0/2] hw/arm/virt: Support for virtio-mem-pci

2021-12-03 Thread Gavin Shan
t the THP sizes on ARM64 (David) Gavin Shan (2): virtio-mem: Correct default THP size for ARM64 hw/arm/virt: Support for virtio-mem-pci hw/arm/Kconfig | 1 + hw/arm/virt.c | 68 +- hw/virtio/virtio-mem.c | 36 ++

[PATCH v3 1/2] virtio-mem: Correct default THP size for ARM64

2021-12-03 Thread Gavin Shan
brand Signed-off-by: Gavin Shan Reviewed-by: Jonathan Cameron Reviewed-by: David Hildenbrand --- hw/virtio/virtio-mem.c | 32 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index d5a578142b..b20595

Re: [PATCH v2 2/2] virtio-mem: Correct default THP size for ARM64

2021-12-03 Thread Gavin Shan
On 12/4/21 5:16 AM, David Hildenbrand wrote: On 03.12.21 04:35, Gavin Shan wrote: The default block size is same as to the THP size, which is either retrieved from "/sys/kernel/mm/transparent_hugepage/hpage_pmd_size" or hardcoded to 2MB. There are flaws in both mechanisms and this

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; lpieral...

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 ind

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 sha

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, 1

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

2023-09-26 Thread Gavin Shan
: 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 04/37] arm/virt,target/arm: Machine init time change common to vCPU {cold|hot}-plug

2023-09-26 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 05/37] accel/kvm: Extract common KVM vCPU {creation,parking} code

2023-09-26 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 a

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

2023-09-27 Thread Gavin Shan
re we 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

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 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 init

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
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 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 G

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 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 this

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

2023-09-27 Thread Gavin Shan
code 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 @@ s

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 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 disable

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

2023-09-27 Thread Gavin Shan
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 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 archite

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 yet-to-be-plu

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 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 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 faci

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

2023-09-28 Thread Gavin Shan
owing nits 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(d

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 a

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 appro

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 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 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 sa

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 t

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 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 04/10] hw/acpi: Init GED framework with cpu hotplug events

2023-10-02 Thread Gavin Shan
-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 VMStateD

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 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 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 includ

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 10/10] target/arm/kvm: Write CPU state back to KVM on reset

2023-10-02 Thread Gavin Shan
STATE. 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 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 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 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 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 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-by

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

2023-10-10 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 the

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 V5 8/9] physmem: Add helper function to destroy CPU AddressSpace

2023-10-11 Thread Gavin Shan
ot;system: Rename softmmu/ 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/i

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
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 v1 0/5] target/arm: Handle psci calls in userspace

2023-07-12 Thread Gavin Shan
Hi Salil, On 7/4/23 19:58, Salil Mehta wrote: Latest Qemu Prototype (Pre RFC V2) (Not in the final shape of the patches) https://github.com/salil-mehta/qemu.git    virt-cpuhp-armv8/rfc-v1-port11052023.dev-1 should work against below kernel changes as confirmed by James, Latest Kernel Protot

[PATCH 3/3] hw/arm/virt: Support host CPU type only when KVM or HVF is configured

2023-07-12 Thread Gavin Shan
The CPU type 'host-arm-cpu' class won't be registered until KVM or HVF is configured in target/arm/cpu64.c. Support the corresponding CPU type only when KVM or HVF is configured. Signed-off-by: Gavin Shan --- hw/arm/virt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/

[PATCH 2/3] hw/arm/virt: Use generic CPU type invalidation

2023-07-12 Thread Gavin Shan
There is a generic CPU type invalidation in machine_run_board_init() and we needn't a same and private invalidation. Set mc->valid_cpu_types to use the generic CPU type invalidation. No functional change intended. Signed-off-by: Gavin Shan --- hw/arm/virt.c | 21 +++--

[PATCH 1/3] machine: Factor CPU type invalidation out into helper

2023-07-12 Thread Gavin Shan
The CPU type invalidation logic in machine_run_board_init() is independent enough. Lets factor it out into helper validate_cpu_type(). Since we're here, the relevant comments are improved a bit. No functional change intended. Signed-off-by: Gavin Shan --- hw/core/machine.c

[PATCH 0/3] hw/arm/virt: Use generic CPU invalidation

2023-07-12 Thread Gavin Shan
neoverse-n1-arm-cpu, \ neoverse-v1-arm-cpu, cortex-a53-arm-cpu, cortex-a57-arm-cpu, \ max-arm-cpu Gavin Shan (3): machine: Factor CPU type invalidation out into helper hw/arm/virt: Use generic CPU type invalidation hw/arm/virt: Support host CPU type only when KVM or HVF is configured

[PATCH] memory: Remove unecessary variable in memory_region_escape_name()

2023-07-12 Thread Gavin Shan
The variable 'c' isn't needed because it can be replaced by '*p' completely. Remove the unecessary variable 'c' to simplify the function a bit. No functional change intended. Signed-off-by: Gavin Shan --- softmmu/memory.c | 11 +-- 1 file changed, 5

Re: [PATCH 0/3] hw/arm/virt: Use generic CPU invalidation

2023-07-13 Thread Gavin Shan
Hi Peter and Marcin, On 7/13/23 21:52, Marcin Juszkiewicz wrote: W dniu 13.07.2023 o 13:44, Peter Maydell pisze: I see this isn't a change in this patch, but given that what the user specifies is not "cortex-a8-arm-cpu" but "cortex-a8", why do we include the "-arm-cpu" suffix in the error mess

Re: [PATCH 0/3] hw/arm/virt: Use generic CPU invalidation

2023-07-13 Thread Gavin Shan
Hi Peter, On 7/13/23 21:44, Peter Maydell wrote: On Thu, 13 Jul 2023 at 06:45, Gavin Shan wrote: There is a generic CPU type invalidation in machine_run_board_init() and we needn't a same and private invalidation for hw/arm/virt machines. This series intends to use the generic CPU

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