Re: [PATCH v10 (RESEND) 00/20] Change ghes to use HEST-based offsets and add support for error inject

2025-07-13 Thread Gavin Shan
Hi Mauro, On 6/13/25 1:17 AM, Mauro Carvalho Chehab wrote: Hi Michael, This is v10 of the patch series, rebased to apply after release 10.0. The only difference against v9 is a minor confict resolution. I sent already the patch with conflicts, but, as you didn't pick, I'm assuming you're optin

[PATCH v2 3/3] target/arm/kvm: Support multiple memory CPERs injection

2025-05-28 Thread Gavin Shan
rage space for those 16x memory CPERs. Signed-off-by: Gavin Shan --- hw/acpi/ghes.c | 2 +- target/arm/kvm.c | 46 +- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c index 34ff682048..43d52f5e2e 100644

[PATCH v2 2/3] kvm/arm/kvm: Introduce helper push_ghes_memory_errors()

2025-05-28 Thread Gavin Shan
Introduce helper push_ghes_memory_errors(), which sends ACPI GHES memory errors, injects SEA exception or aborts on errors. This function will be extended to support multiple ACPI GHES memory errors in the next path. No functional changes intended. Signed-off-by: Gavin Shan --- target/arm

[PATCH v2 1/3] acpi/ghes: Extend acpi_ghes_memory_errors() to support multiple CPERs

2025-05-28 Thread Gavin Shan
ror status is pulled out from ghes_gen_err_data_uncorrectable_recoverable(). No functional changes intended. Signed-off-by: Gavin Shan --- hw/acpi/ghes-stub.c| 2 +- hw/acpi/ghes.c | 27 ++- include/hw/acpi/ghes.h | 2 +- target/arm/kvm.c | 7 ++

[PATCH v2 0/3] target/arm/kvm: Improve memory error handling

2025-05-28 Thread Gavin Shan
s://lists.nongnu.org/archive/html/qemu-arm/2025-02/msg00897.html * Send 16x memory errors for the specific case (Jonathan) Gavin Shan (3): acpi/ghes: Extend acpi_ghes_memory_errors() to support multiple CPERs kvm/arm/kvm: Introduce helper push_ghes_memory_errors() target/arm/k

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

2025-05-21 Thread Gavin Shan
Hi Gustavo and Salil, On 5/22/25 1:06 AM, Gustavo Romero wrote: Hi Salil, Gavin, and folks, On 5/20/25 21:22, Gavin Shan wrote: Hi Salil, A kindly ping. vCPU hotplug is an important feature and You has put so much energies and amazing efforts to enable the feature from QEMU side, but it

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

2025-05-20 Thread Gavin Shan
ssble` flag for GICv3 CPU interface 4. Addressed comments from Gavin Shan (RedHat), Nicholas Piggin (IBM), Alex Bennée's & Gustavo Romero (Linaro) 5. Misc fixes and refatoring. (II) Summary This patch set introduces virtual CPU hotplug support for the ARMv8 architecture

Re: [PATCH V2 1/3] acpi: Add machine option to disable SPCR table

2025-04-22 Thread Gavin Shan
+), 3 deletions(-) One coding style issue below. With it fixed: Reviewed-by: Gavin Shan diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 3ac8f8e178..f25c3b26ce 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -940,7 +940,10 @@ void virt_acpi_build(VirtMa

Re: [PATCH 4/4] target/arm: Retry pushing CPER error if necessary

2025-02-25 Thread Gavin Shan
On 2/21/25 9:04 PM, Jonathan Cameron wrote: On Fri, 21 Feb 2025 15:27:36 +1000 Gavin Shan wrote: [...] I would say #1 is the ideal model because the read_ack_register is the bottleneck and it should be scaled up to max_cpus. In that way, the bottleneck can be avoided from the bottom

Re: [PATCH 4/4] target/arm: Retry pushing CPER error if necessary

2025-02-25 Thread Gavin Shan
On 2/25/25 9:19 PM, Igor Mammedov wrote: On Fri, 21 Feb 2025 11:04:35 + Jonathan Cameron wrote: Ideally I'd like whatever we choose to look like what a bare metal machine does - mostly because we are less likely to hit untested OS paths. Ack for that but, that would need someone from hw/

Re: [PATCH 4/4] target/arm: Retry pushing CPER error if necessary

2025-02-20 Thread Gavin Shan
On 2/20/25 3:55 AM, Igor Mammedov wrote: On Fri, 14 Feb 2025 14:16:35 +1000 Gavin Shan wrote: The error -1 is returned if the previously reported CPER error hasn't been claimed. The virtual machine is terminated due to abort(). It's conflicting to the ideal behaviour that the aff

Re: [PATCH 0/4] target/arm: Improvement on memory error handling

2025-02-16 Thread Gavin Shan
On 2/14/25 10:59 PM, Mauro Carvalho Chehab wrote: Em Fri, 14 Feb 2025 14:16:31 +1000 Gavin Shan escreveu: Currently, there is only one CPER buffer (entry), meaning only one memory error can be reported. In extreme case, multiple memory errors can be raised on different vCPUs. For example, a

Re: [PATCH 0/4] target/arm: Improvement on memory error handling

2025-02-16 Thread Gavin Shan
On 2/14/25 8:12 PM, Jonathan Cameron wrote: On Fri, 14 Feb 2025 14:16:31 +1000 Gavin Shan wrote: Currently, there is only one CPER buffer (entry), meaning only one memory error can be reported. In extreme case, multiple memory errors can be raised on different vCPUs. For example, a singile

Re: [PATCH 0/4] target/arm: Improvement on memory error handling

2025-02-16 Thread Gavin Shan
On 2/14/25 7:53 PM, Jonathan Cameron wrote: On Fri, 14 Feb 2025 14:16:31 +1000 Gavin Shan wrote: Currently, there is only one CPER buffer (entry), meaning only one memory error can be reported. In extreme case, multiple memory errors can be raised on different vCPUs. For example, a singile

[PATCH 4/4] target/arm: Retry pushing CPER error if necessary

2025-02-13 Thread Gavin Shan
tion. Move the chunk of code to push CPER error to a separate helper report_memory_errors() and retry the request when the return value from acpi_ghes_memory_errors() is greater than zero. Signed-off-by: Gavin Shan --- target/arm/kvm.c | 31 +-- 1 file changed, 25 i

[PATCH 3/4] acpi/ghes: Allow retry to write CPER errors

2025-02-13 Thread Gavin Shan
) is returned if the the previously reported CPER error hasn't been claimed by the guest. The caller will retry the request if the returned error number is 1. Signed-off-by: Gavin Shan --- hw/acpi/ghes-stub.c| 3 ++- hw/acpi/ghes.c | 12 +--- include/hw/acpi/ghes.h |

[PATCH 2/4] acpi/ghes: Use error_report() in ghes_record_cper_errors()

2025-02-13 Thread Gavin Shan
ed by ghes_record_cper_errors() and the error messages are printed with error_report() in the function. It's the preparatory work to add parameter for ghes_record_cper_errors() to indicate if the request can be retried by its callers. No functional changes intended. Signed-off-by: Gavin Shan --- hw/acpi/g

[PATCH 0/4] target/arm: Improvement on memory error handling

2025-02-13 Thread Gavin Shan
il it succeeds. Gavin Shan (4): acpi/ghes: Make ghes_record_cper_errors() static acpi/ghes: Use error_report() in ghes_record_cper_errors() acpi/ghes: Allow retry to write CPER errors target/arm: Retry pushing CPER error if necessary hw/acpi/ghes-stub.c| 3 ++- hw/acpi/ghes.c

[PATCH 1/4] acpi/ghes: Make ghes_record_cper_errors() static

2025-02-13 Thread Gavin Shan
acpi_ghes_memory_errors() is the only caller, no need to expose the function. Besides, the last 'return' in this function isn't necessary and remove it. No functional changes intended. Signed-off-by: Gavin Shan --- hw/acpi/ghes.c | 6 ++ include/hw/acpi/ghes.h

Re: [PATCH v2] hw/arm/virt: Support larger highmem MMIO regions

2025-02-04 Thread Gavin Shan
++ 2 files changed, 42 insertions(+) With the following nitpick addressed: Reviewed-by: Gavin Shan diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst index e67e7f0f7c50..f96cf4da2a78 100644 --- a/docs/system/arm/virt.rst +++ b/docs/system/arm/virt.rst @@ -138,6 +138,10 @@ hi

Re: [PATCH v3 18/26] hw/arm/boot: Mark all guest memory as RIPAS_RAM.

2025-02-03 Thread Gavin Shan
On 11/26/24 5:56 AM, Jean-Philippe Brucker wrote: All Realm IPA states are by default RIPAS_EMPTY, and accessing them in that state causes injection of synchronous exception. Either the loader or the guest needs to set IPA state to RIPAS_RAM before accessing it. Since a Linux guest needs all memo

Re: [PATCH v3 08/26] hw/core/loader: Add ROM loader notifier

2025-02-03 Thread Gavin Shan
On 11/26/24 5:56 AM, Jean-Philippe Brucker wrote: Add a function to register a notifier, that is invoked after a ROM gets loaded into guest memory. It will be used by Arm confidential guest support, in order to register all blobs loaded into memory with KVM, so that their content is moved into R

Re: [PATCH v3 09/26] target/arm/kvm-rme: Initialize Realm memory

2025-02-03 Thread Gavin Shan
On 11/26/24 5:56 AM, Jean-Philippe Brucker wrote: Initialize the IPA state of RAM. Collect the images copied into guest RAM into a sorted list, and issue POPULATE_REALM KVM ioctls once we've created the Realm Descriptor. The images are part of the Realm Initial Measurement. Signed-off-by: Jean-P

Re: [PATCH v3 06/26] target/arm/kvm-rme: Initialize vCPU

2025-02-03 Thread Gavin Shan
On 11/26/24 5:56 AM, Jean-Philippe Brucker wrote: The target code calls kvm_arm_vcpu_init() to mark the vCPU as part of a Realm. For a Realm vCPU, only x0-x7 can be set at runtime. Before boot, the PC can also be set, and is ignored at runtime. KVM also accepts a few system register changes durin

Re: [PATCH v3 17/26] hw/arm/virt: Reserve one bit of guest-physical address for RME

2024-12-13 Thread Gavin Shan
Hi Jean, On 11/26/24 5:56 AM, Jean-Philippe Brucker wrote: When RME is enabled, the upper GPA bit is used to distinguish protected from unprotected addresses. Reserve it when setting up the guest memory map. Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 14 -- 1 file

Re: [PATCH v3 00/26] arm: Run Arm CCA VMs with KVM

2024-12-11 Thread Gavin Shan
Hi Jean, On 12/11/24 1:01 PM, Gavin Shan wrote: On 11/26/24 5:55 AM, Jean-Philippe Brucker wrote: This series enables running confidential VMs on Arm CCA. The host KVM support is progressing but still under discussion [1], so there is no urgency to upstream this series. I'm sending thi

Re: [PATCH v3 00/26] arm: Run Arm CCA VMs with KVM

2024-12-10 Thread Gavin Shan
Hi Jean, On 11/26/24 5:55 AM, Jean-Philippe Brucker wrote: This series enables running confidential VMs on Arm CCA. The host KVM support is progressing but still under discussion [1], so there is no urgency to upstream this series. I'm sending this new version to give a status update, and also t

Re: [PATCH] hw/intc/arm-gicv3*: Refactor GICv3 CPU reginfo to have common invocation

2024-11-04 Thread Gavin Shan
(+), 130 deletions(-) With the following nitpicks addressed: Reviewed-by: Gavin Shan diff --git a/hw/intc/arm_gicv3.c b/hw/intc/arm_gicv3.c index 58e18fff54..2a30625916 100644 --- a/hw/intc/arm_gicv3.c +++ b/hw/intc/arm_gicv3.c @@ -459,6 +459,7 @@ static void arm_gicv3_class_init(ObjectClass

Re: [PATCH] arm/virt: Extract common code to wire GICC<->vCPU IRQs for reuse

2024-11-04 Thread Gavin Shan
-- 1 file changed, 60 insertions(+), 48 deletions(-) With the following nitpicks addressed: Reviewed-by: Gavin Shan diff --git a/hw/arm/virt.c b/hw/arm/virt.c index a0d3bef875..d6892b0266 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -761,6 +761,65 @@ static bool

Re: [PATCH] arm/virt: Extract common code to wire GICC<->vCPU IRQs for reuse

2024-11-04 Thread Gavin Shan
On 11/4/24 11:26 PM, Peter Maydell wrote: On Sun, 3 Nov 2024 at 15:25, Salil Mehta wrote: Extract common GIC and CPU interrupt wiring code to improve code readability and modularity, supporting reuse in future patch sets. This refactor is benign and introduces *no* functional changes. Note: T

Re: [PATCH] hw/arm/virt: Move common vCPU properties in a function

2024-11-04 Thread Gavin Shan
(-) With the following nitpicks addressed: Reviewed-by: Gavin Shan diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 1a381e9a2b..a0d3bef875 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2091,16 +2091,126 @@ static void virt_cpu_post_init(VirtMachineState *vms, MemoryRegion *sysmem

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

2024-10-17 Thread Gavin Shan
Hi Salil, The issues reported against on RFCv3 are still existing. I'm listing them as below. (1) Guest fails to start due to SVE initialization /home/gavin/sandbox/qemu.main/build/qemu-system-aarch64 \ -accel kvm -machine virt,gic-version=host,nvdimm=on \

Re: [PATCH V1 1/4] hw/acpi: Initialize ACPI Hotplug CPU Status with Support for vCPU `Persistence`

2024-10-16 Thread Gavin Shan
On 10/15/24 5:22 AM, Salil Mehta wrote: Certain CPU architecture specifications [1][2][3] prohibit changes to CPU presence after the kernel has booted. This limitation exists because many system initializations rely on the exact CPU count at boot time and do not expect it to change later. For exa

Re: [PATCH V1 1/4] hw/acpi: Initialize ACPI Hotplug CPU Status with Support for vCPU `Persistence`

2024-10-16 Thread Gavin Shan
On 10/15/24 5:22 AM, Salil Mehta wrote: Certain CPU architecture specifications [1][2][3] prohibit changes to CPU presence after the kernel has booted. This limitation exists because many system initializations rely on the exact CPU count at boot time and do not expect it to change later. For exa

Re: [PATCH] hw/char/pl011: Use correct masks for IBRD and FBRD

2024-10-09 Thread Gavin Shan
...@nongnu.org Fixes: b88cfee90268 ("hw/char/pl011: Avoid division-by-zero in pl011_get_baudrate()") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2610 Signed-off-by: Peter Maydell --- hw/char/pl011.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Gavin Shan

[PATCH] hostmem: Apply merge property after the memory region is initialized

2024-09-15 Thread Gavin Shan
system/memory.c:2419: memory_region_get_ram_ptr: \ Assertion `mr->ram_block' failed. Fix it by applying the merge property only when the memory region is initialized. Fixes: 5becdc0ab083 ("hostmem: simplify the code for merge and dump properties") Reported-by: Zhenyu

Re: [PATCH v1] virtio-mem: don't warn about THP sizes on a kernel without THP support

2024-09-12 Thread Gavin Shan
efault THP size. Cc: "Michael S. Tsirkin" Cc: Gavin Shan Cc: Juraj Marcin Signed-off-by: David Hildenbrand --- hw/virtio/virtio-mem.c | 7 +++ 1 file changed, 7 insertions(+) Reviewed-by: Gavin Shan

Re: [PATCH for-9.2] hw/arm/sbsa-ref: Don't leak string in sbsa_fdt_add_gic_node()

2024-08-26 Thread Gavin Shan
e entirely. Signed-off-by: Peter Maydell --- A small once-only leak, so this is 9.2 material. Spotted with clang leak-sanitizer. hw/arm/sbsa-ref.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH RFC V3 17/29] arm/virt: Release objects for *disabled* possible vCPUs after init

2024-08-24 Thread Gavin Shan
Hi Salil, On 8/23/24 11:17 PM, Salil Mehta wrote: On 8/22/24 8:58 PM, Salil Mehta wrote: >> On 8/21/24 8:23 PM, Salil Mehta wrote: >> >> >> >> On 8/21/24 2:40 AM, Salil Mehta wrote: >> >> > >> >> > I don’t understand this clearly. Are you suggesting to reuse only >

Re: [PATCH RFC V3 17/29] arm/virt: Release objects for *disabled* possible vCPUs after init

2024-08-23 Thread Gavin Shan
Hi Sail, On 8/22/24 8:58 PM, Salil Mehta wrote: On 8/21/24 8:23 PM, Salil Mehta wrote: >> >> On 8/21/24 2:40 AM, Salil Mehta wrote: >> > >> > I don’t understand this clearly. Are you suggesting to reuse only >> > single vCPU object to initialize all KVM vCPUs not yet plugged

Re: [PATCH RFC V3 17/29] arm/virt: Release objects for *disabled* possible vCPUs after init

2024-08-21 Thread Gavin Shan
Hi Salil, On 8/21/24 8:23 PM, Salil Mehta wrote: On 8/21/24 2:40 AM, Salil Mehta wrote: > > I don’t understand this clearly. Are you suggesting to reuse only > single vCPU object to initialize all KVM vCPUs not yet plugged? If > yes, then I'm not sure what do we gain here by adding

Re: [PATCH RFC V3 17/29] arm/virt: Release objects for *disabled* possible vCPUs after init

2024-08-20 Thread Gavin Shan
Hi Salil, On 8/21/24 2:40 AM, Salil Mehta wrote: I don’t understand this clearly. Are you suggesting to reuse only single vCPU object to initialize all KVM vCPUs not yet plugged? If yes, then I'm not sure what do we gain here by adding this complexity? It does not consume time or resources bec

Re: [PATCH RFC V3 11/29] arm/virt: Create GED dev before *disabled* CPU Objs are destroyed

2024-08-19 Thread Gavin Shan
Hi Salil, On 8/19/24 10:10 PM, Salil Mehta wrote: From: Gavin Shan Sent: Tuesday, August 13, 2024 2:05 AM To: Salil Mehta ; qemu-devel@nongnu.org; qemu-...@nongnu.org; m...@redhat.com On 6/14/24 9:36 AM, Salil Mehta wrote: > ACPI CPU hotplug state (is_present=_STA.PRES

Re: [PATCH RFC V3 17/29] arm/virt: Release objects for *disabled* possible vCPUs after init

2024-08-19 Thread Gavin Shan
Hi Salil, On 8/19/24 10:21 PM, Salil Mehta wrote: From: Gavin Shan Sent: Tuesday, August 13, 2024 2:17 AM To: Salil Mehta ; qemu-devel@nongnu.org; qemu-...@nongnu.org; m...@redhat.com On 6/14/24 9:36 AM, Salil Mehta wrote: > During `machvirt_init()`, QOM ARMCPU objects are

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

2024-08-18 Thread Gavin Shan
On 6/14/24 9:36 AM, Salil Mehta wrote: In the ARMv8 architecture, the GIC must know all the CPUs it is connected to during its initialization, and this cannot change afterward. This must be ensured during the initialization of the VGIC as well in KVM, which requires all vCPUs to be created and pr

Re: [PATCH RFC V3 18/29] arm/virt: Add/update basic hot-(un)plug framework

2024-08-12 Thread Gavin Shan
On 6/14/24 9:36 AM, Salil Mehta wrote: Add CPU hot-unplug hooks and update hotplug hooks with additional sanity checks for use in hotplug paths. Note: The functional contents of the hooks (currently left with TODO comments) will be gradually filled in subsequent patches in an incremental approac

Re: [PATCH RFC V3 17/29] arm/virt: Release objects for *disabled* possible vCPUs after init

2024-08-12 Thread Gavin Shan
On 6/14/24 9:36 AM, Salil Mehta wrote: During `machvirt_init()`, QOM ARMCPU objects are pre-created along with the corresponding KVM vCPUs in the host for all possible vCPUs. This is necessary due to the architectural constraint that KVM restricts the deferred creation of KVM vCPUs and VGIC initi

Re: [PATCH RFC V3 11/29] arm/virt: Create GED dev before *disabled* CPU Objs are destroyed

2024-08-12 Thread Gavin Shan
On 6/14/24 9:36 AM, 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 disabled vCPUs t

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

2024-08-12 Thread Gavin Shan
On 6/14/24 9:36 AM, Salil Mehta wrote: In the ARMv8 architecture, the GIC must know all the CPUs it is connected to during its initialization, and this cannot change afterward. This must be ensured during the initialization of the VGIC as well in KVM, which requires all vCPUs to be created and pr

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

2024-08-12 Thread Gavin Shan
On 8/12/24 6:15 PM, Igor Mammedov wrote: On Mon, 12 Aug 2024 14:35:56 +1000 Gavin Shan wrote: On 6/14/24 9:36 AM, 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-in

Re: [PATCH RFC V3 04/29] hw/arm/virt: Move setting of common CPU properties in a function

2024-08-11 Thread Gavin Shan
On 6/14/24 9:36 AM, 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 | 261 -- include/hw/arm/virt.h | 4 + 2 files changed, 182 insert

Re: [PATCH RFC V3 03/29] hw/arm/virt: Limit number of possible vCPUs for unsupported Accel or GIC Type

2024-08-11 Thread Gavin Shan
On 6/14/24 9:36 AM, Salil Mehta wrote: If Virtual CPU Hotplug support does not exist on a particular Accel platform or ARM GIC version, we should limit the possible vCPUs to those available during boot time (i.e SMP CPUs) and explicitly disable Virtual CPU Hotplug support. Signed-off-by: Salil M

Re: [PATCH RFC V3 02/29] cpu-common: Add common CPU utility for possible vCPUs

2024-08-11 Thread Gavin Shan
On 6/14/24 9:36 AM, Salil Mehta wrote: This patch adds various utility functions that may be required to fetch or check the state of possible vCPUs. It also introduces the concept of *disabled* vCPUs, which are part of the *possible* vCPUs but are not enabled. This state will be used during machi

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

2024-08-11 Thread Gavin Shan
On 6/14/24 9:36 AM, 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. Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil

Re: [PATCH 3/4] hw/arm/virt: Use kvm_arch_get_default_type()

2024-08-09 Thread Gavin Shan
On 8/9/24 1:51 PM, Gavin Shan wrote: kvm_arch_get_default_type() and kvm_arm_get_max_vm_ipa_size() are interchangeable since the type is equivalent to IPA size (bits) with one exception that IPA size (bits) is 40 when the type is zero. Replace kvm_arm_get_max_vm_ipa_size() with

Re: [PATCH 3/4] hw/arm/virt: Use kvm_arch_get_default_type()

2024-08-09 Thread Gavin Shan
On 8/9/24 6:59 PM, Peter Maydell wrote: On Fri, 9 Aug 2024 at 04:52, Gavin Shan wrote: kvm_arch_get_default_type() and kvm_arm_get_max_vm_ipa_size() are interchangeable since the type is equivalent to IPA size (bits) with one exception that IPA size (bits) is 40 when the type is zero. Well

Re: [PATCH 1/4] hw/arm/virt: hide virt_kvm_type() on !CONFIG_KVM

2024-08-09 Thread Gavin Shan
On 8/9/24 7:00 PM, Peter Maydell wrote: On Fri, 9 Aug 2024 at 04:52, Gavin Shan wrote: virt_kvm_type() and mc->kvm_type() are only needed when CONFIG_KVM is enabled. It's reasonable to hide them when CONFIG_KVM is disabled. Signed-off-by: Gavin Shan --- hw/arm/virt.c | 4

[PATCH 0/4] hw/arm/virt: Improve virt_kvm_type()

2024-08-08 Thread Gavin Shan
e KVM type and IPA size (bits). Gavin Shan (4): hw/arm/virt: hide virt_kvm_type() on !CONFIG_KVM hw/arm/virt: Avoid multiple lines of comments in virt_kvm_type() hw/arm/virt: Use kvm_arch_get_default_type() target/arm/kvm: Remove kvm_arm_get_max_vm_ipa_size() hw/arm/virt.c

[PATCH 2/4] hw/arm/virt: Avoid multiple lines of comments in virt_kvm_type()

2024-08-08 Thread Gavin Shan
The comment needn't to span multiple lines and can be merged to one line perfectly. Signed-off-by: Gavin Shan --- hw/arm/virt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 83be57db37..09b7a158a9 100644 --- a/hw/arm/virt.c +++

[PATCH 3/4] hw/arm/virt: Use kvm_arch_get_default_type()

2024-08-08 Thread Gavin Shan
, kvm_arm_get_max_vm_ipa_size() needn't to be a public API any more. Signed-off-by: Gavin Shan --- hw/arm/virt.c| 14 ++ target/arm/kvm.c | 2 +- target/arm/kvm_arm.h | 15 --- 3 files changed, 7 insertions(+), 24 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c

[PATCH 4/4] target/arm/kvm: Remove kvm_arm_get_max_vm_ipa_size()

2024-08-08 Thread Gavin Shan
Remove kvm_arm_get_max_vm_ipa_size() after its logics are moved to its only caller kvm_arch_get_default_type(). Signed-off-by: Gavin Shan --- target/arm/kvm.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 65893c9c12

[PATCH 1/4] hw/arm/virt: hide virt_kvm_type() on !CONFIG_KVM

2024-08-08 Thread Gavin Shan
virt_kvm_type() and mc->kvm_type() are only needed when CONFIG_KVM is enabled. It's reasonable to hide them when CONFIG_KVM is disabled. Signed-off-by: Gavin Shan --- hw/arm/virt.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 719e83e6a1..83

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

2024-08-07 Thread Gavin Shan
Hi Salil, On 8/8/24 2:07 AM, Salil Mehta wrote: I tested ARM arch specific patches with the latest Qemu which contains below mentioned fix and I cannot reproduce the crash. I used kernel linux-6.11-rc2 and it booted successfully. Though I did see a kernel crash on attempting to hotplug first v

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

2024-08-07 Thread Gavin Shan
Hi Salil, On 8/8/24 10:29 AM, Gavin Shan wrote: On 8/8/24 9:48 AM, Salil Mehta wrote: However, I'm unable to hot-add a vCPU and haven't get a chance to look at it closely. (qemu) device_add host-arm-cpu,id=cpu,socket-id=1 (qemu) [  258.901027] Unable to handle kernel write to read-o

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

2024-08-07 Thread Gavin Shan
Hi Salil, On 8/8/24 9:48 AM, Salil Mehta wrote: On 8/7/24 11:27 PM, Salil Mehta wrote: > > Let me figure out this. Have you also included the below patch along > with the architecture agnostic patch-set accepted in this Qemu cycle? > > https://lore.kernel.org/all/20240801142322.39488

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

2024-08-07 Thread Gavin Shan
Hi Salil, On 8/7/24 11:27 PM, Salil Mehta wrote: Let me figure out this. Have you also included the below patch along with the architecture agnostic patch-set accepted in this Qemu cycle? https://lore.kernel.org/all/20240801142322.3948866-3-peter.mayd...@linaro.org/ There are no vCPU fd to

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

2024-08-07 Thread Gavin Shan
Hi Salil, With this series and latest upstream Linux kernel (host), I ran into core dump as below. I'm not sure if it's a known issue or not. # uname -r 6.11.0-rc2-gavin+ # /home/gavin/sandbox/qemu.main/build/qemu-system-aarch64 -accel kvm \ -machine virt,gic-version=host,nvdimm=on -cpu host

Re: [PATCH] accel/kvm/kvm-all: Fixes the missing break in vCPU unpark logic

2024-07-25 Thread Gavin Shan
: Extract common KVM vCPU {creation,parking} code") Reported-by: Peter Maydell Suggested-by: Peter Maydell Message-ID: Signed-off-by: Salil Mehta --- accel/kvm/kvm-all.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Gavin Shan

Re: [PATCH V12 0/8] Add architecture agnostic code to support vCPU Hotplug

2024-06-25 Thread Gavin Shan
Hi Salil and Igor, On 6/26/24 9:51 AM, Salil Mehta wrote: On Wed, Jun 5, 2024 at 3:03 PM Igor Mammedov mailto:imamm...@redhat.com>> wrote: On Sun, 2 Jun 2024 18:03:05 -0400 "Michael S. Tsirkin" mailto:m...@redhat.com>> wrote: > On Thu, May 30, 2024 at 12:42:33AM +0100, Salil Mehta

Re: [PATCH v3] hw/arm/virt: Avoid unexpected warning from Linux guest on host with Fujitsu CPUs

2024-06-11 Thread Gavin Shan
-tree root node, meaning all devices are capable of DMA coherent by default. Signed-off-by: Zhenyu Zhang --- v3: Add comments explaining why we add 'dma-coherent' property (Peter) --- hw/arm/virt.c | 11 +++ 1 file changed, 11 insertions(+) Reviewed-by: Gavin Shan

Re: Unexpected error in rme_configure_one() at ../target/arm/kvm-rme.c:159

2024-06-06 Thread Gavin Shan
On 6/6/24 15:05, Gavin Shan wrote: Even the edk2 for the guest can be built successfully, but I'm not able to try it because I'm unable to bring up the host now. I tried to rebuild the environment from scratch, the host runs into crash inside EDK2 unfortunately...   TF-RM

Re: Unexpected error in rme_configure_one() at ../target/arm/kvm-rme.c:159

2024-06-05 Thread Gavin Shan
On 6/6/24 01:56, Jean-Philippe Brucker wrote: On Wed, Jun 05, 2024 at 11:28:47AM +1000, Gavin Shan wrote: WriteSections64(): /home/gavin/sandbox/CCA/edk2-guest/Build/ArmVirtQemu-AARCH64/DEBUG_GCC5/AARCH64/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore/DEBUG/ArmPlatformPrePeiCore.dll

Re: Unexpected error in rme_configure_one() at ../target/arm/kvm-rme.c:159

2024-06-04 Thread Gavin Shan
Hi Jean, On 6/4/24 21:15, Jean-Philippe Brucker wrote: On Tue, Jun 04, 2024 at 01:02:08PM +1000, Gavin Shan wrote: On 6/3/24 18:24, Jean-Philippe Brucker wrote: On Sat, Jun 01, 2024 at 08:14:46PM +1000, Gavin Shan wrote: ---> guest edk2 # git clone https://git.codelinaro.org/linaro/d

Re: Unexpected error in rme_configure_one() at ../target/arm/kvm-rme.c:159

2024-06-03 Thread Gavin Shan
Hi Jean, On 6/3/24 18:24, Jean-Philippe Brucker wrote: On Sat, Jun 01, 2024 at 08:14:46PM +1000, Gavin Shan wrote: ---> guest edk2 # git clone https://git.codelinaro.org/linaro/dcap/edk2.git edk2-guest # cd edk2-guest; git checkout origin/cca/v2 -b cca/v2 # git submodule update --i

Re: Unexpected error in rme_configure_one() at ../target/arm/kvm-rme.c:159

2024-06-01 Thread Gavin Shan
Hi Jean and Ard, On 6/1/24 01:09, Jean-Philippe Brucker wrote: On Fri, May 31, 2024 at 04:23:13PM +1000, Gavin Shan wrote: I got a chance to try CCA software components, suggested by [1]. However, the edk2 is stuck somewhere. I didn't reach to stage of loading guest kernel yet. I'm

Re: Unexpected error in rme_configure_one() at ../target/arm/kvm-rme.c:159

2024-05-30 Thread Gavin Shan
On 5/31/24 14:19, Itaru Kitayama wrote: On May 30, 2024, at 22:30, Philippe Mathieu-Daudé wrote: Cc'ing more developers On 30/5/24 06:30, Itaru Kitayama wrote: Hi, When I see a Realm VM creation fails with: Unexpected error in rme_configure_one() at ../target/arm/kvm-rme.c:159: qemu-system-aar

Re: [PATCH v2 5/5] hw/arm/aspeed: Check for CPU types in machine_run_board_init()

2024-01-24 Thread Gavin Shan
- hw/arm/aspeed_ast2600.c | 6 +- hw/arm/aspeed_soc_common.c | 5 - 6 files changed, 27 insertions(+), 6 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH v2 4/5] hw/arm/aspeed: Introduce aspeed_soc_cpu_type() helper

2024-01-24 Thread Gavin Shan
/arm/aspeed_ast10x0.c | 2 +- hw/arm/aspeed_ast2400.c | 3 ++- hw/arm/aspeed_ast2600.c | 3 ++- hw/arm/aspeed_soc_common.c | 5 + 5 files changed, 11 insertions(+), 3 deletions(-) Reviewed-by: Gavin Shan

Re: [PATCH v2 3/5] hw/arm/aspeed: Init CPU defaults in a common helper

2024-01-24 Thread Gavin Shan
insertions(+), 43 deletions(-) One nit needs to be addressed: Reviewed-by: Gavin Shan diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 5b01a4dd28..636a6269aa 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -1141,10 +1141,14 @@ static void aspeed_machine_class_props_init(ObjectClass *oc

Re: [PATCH v2 2/5] hw/arm/aspeed: Set default CPU count using aspeed_soc_num_cpus()

2024-01-24 Thread Gavin Shan
oc: Add AST1030 support") and supermicrox11-bmc (commit 40a38df55e "hw/arm/aspeed: Add board model for Supermicro X11 BMC") machines. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/aspeed.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) Reviewed-by: Gavin Shan

Re: [PATCH v2 1/5] hw/arm/aspeed: Remove dead code

2024-01-24 Thread Gavin Shan
On 1/24/24 08:48, Philippe Mathieu-Daudé wrote: Remove copy/paste typo from commit 6c323aba40 ("hw/arm/aspeed: Adding new machine Tiogapass in QEMU"). Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/aspeed.c | 1 - 1 file changed, 1 deletion(-) Reviewed-by: Gavin Shan

Re: [PATCH v2 6/6] hw/arm/zynq: Check for CPU types in machine_run_board_init()

2024-01-24 Thread Gavin Shan
On 1/24/24 08:25, Philippe Mathieu-Daudé wrote: Restrict MachineClass::valid_cpu_types[] to the single valid CPU type. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/xilinx_zynq.c | 5 + 1 file changed, 5 insertions(+) Reviewed-by: Gavin Shan

Re: [PATCH v2 5/6] hw/arm/vexpress: Check for CPU types in machine_run_board_init()

2024-01-24 Thread Gavin Shan
On 1/24/24 08:25, Philippe Mathieu-Daudé wrote: Restrict MachineClass::valid_cpu_types[] to the single valid CPU types. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/vexpress.c | 10 ++ 1 file changed, 10 insertions(+) Reviewed-by: Gavin Shan

Re: [PATCH v2 4/6] hw/arm/highbank: Check for CPU types in machine_run_board_init()

2024-01-24 Thread Gavin Shan
pe Mathieu-Daudé --- hw/arm/highbank.c | 10 ++ 1 file changed, 10 insertions(+) Reviewed-by: Gavin Shan

Re: [PATCH v2 3/6] hw/arm/highbank: Add missing QOM parent for CPU cores

2024-01-24 Thread Gavin Shan
On 1/24/24 08:25, Philippe Mathieu-Daudé wrote: QDev objects created with qdev_new() need to manually add their parent relationship with object_property_add_child(). Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/highbank.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Gavin Shan

Re: [PATCH v2 2/6] hw/arm/exynos: Check for CPU types in machine_run_board_init()

2024-01-24 Thread Gavin Shan
ned-off-by: Philippe Mathieu-Daudé --- hw/arm/exynos4_boards.c | 8 1 file changed, 8 insertions(+) Reviewed-by: Gavin Shan

Re: [PATCH v2 1/6] hw/arm/exynos: Add missing QOM parent for CPU cores

2024-01-24 Thread Gavin Shan
On 1/24/24 08:25, Philippe Mathieu-Daudé wrote: QDev objects created with qdev_new() need to manually add their parent relationship with object_property_add_child(). Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/exynos4210.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Gavin

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] 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: [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

[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: [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

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 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 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 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 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-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-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 23/25] hw/misc: Simplify memory_region_init_ram_from_fd() calls

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

  1   2   3   4   5   6   7   8   9   10   >