[PATCH RFC V6 01/24] hw/core: Introduce administrative power-state property and its accessors

2025-10-02 Thread salil . mehta
From: Salil Mehta Some devices cannot be hot-unplugged, either because removal is not meaningful (e.g. on-board devices) or not supported (e.g. certain PCIe devices). Others, such as CPUs on architectures like ARM, lack native hotplug support but can still have their availability controlled

RE: [PATCH RFC V6 24/24] tcg: Defer TB flush for 'lazy realized' vCPUs on first region alloc

2025-10-02 Thread Salil Mehta via
e...@opnsrc.net; qemu-devel@nongnu.org; qemu- > a...@nongnu.org; m...@redhat.com > Subject: Re: [PATCH RFC V6 24/24] tcg: Defer TB flush for 'lazy realized' > vCPUs > on first region alloc > > On 9/30/25 18:01, salil.me...@opnsrc.net wrote: > > From: Salil Mehta

[PATCH RFC V6 21/24] hw/intc/arm-gicv3-kvm: Pause all vCPUs & cache ICC_CTLR_EL1 for userspace PSCI CPU_ON

2025-09-30 Thread salil . mehta
From: Salil Mehta Problem: === When PSCI CPU_ON was handled entirely in KVM, the operation executed under VGIC/KVM locks at EL2 and appeared atomic to other vCPU threads (intermediate states were not observable). With the SMCCC forward-to-userspace filter enabled, PSCI ON/OFF calls now exit

[PATCH RFC V6 23/24] monitor, qapi: add 'info cpus-powerstate' and QMP query (Admin + Oper states)

2025-09-30 Thread salil . mehta
From: Salil Mehta The existing 'info hotpluggable-cpus' applies to platforms with true CPU hotplug. On ARM, vCPUs are not hotpluggable: resources are allocated at boot and policy is enforced administratively (e.g. via ACPI _STA) to achieve a hotplug-like effect. As a result, the ho

[PATCH RFC V6 20/24] target/arm/kvm: Write vCPU's state back to KVM on cold-reset

2025-09-30 Thread salil . mehta
at KVM’s `MP_STATE` is updated accordingly, forcing synchronization of the `mp_state` between QEMU and KVM. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Salil Mehta --- target/arm/arm-powerctl.c | 1 + target/arm/kvm.c | 7 +++ 2 files changed, 8 insertions(+) diff --git a/targ

[PATCH RFC V6 08/24] arm/virt, gicv3: Guard CPU interface access for admin disabled vCPUs

2025-09-30 Thread salil . mehta
From: Salil Mehta Per Arm GIC Architecture Specification (IHI0069H_b, §11.1), the CPU interface and its Processing Element (PE) share a power domain. If the PE is powered down or administratively disabled, the CPU interface must be quiescent or off, and any access is architecturally

[PATCH RFC V6 24/24] tcg: Defer TB flush for 'lazy realized' vCPUs on first region alloc

2025-09-30 Thread salil . mehta
From: Salil Mehta The TCG code cache is split into regions shared by vCPUs under MTTCG. For cold-boot (early realized) vCPUs, regions are sized/allocated during bring-up. However, when a vCPU is *lazy_realized* (administratively "disabled" at boot and realized later on demand), its

[PATCH RFC V6 16/24] arm/virt/acpi: Update ACPI DSDT Tbl to include 'Online-Capable' CPUs AML

2025-09-30 Thread salil . mehta
From: Salil Mehta This change emits AML in DSDT to support vCPU deferred online-capability on arm/virt. It wires the CPU OSPM coordination paths so that CPUs which are administratively disabled at boot can be brought online later under policy, providing hotplug-like functionality without

[PATCH RFC V6 04/24] arm/virt, target/arm: Add new ARMCPU {socket, cluster, core, thread}-id property

2025-09-30 Thread salil . mehta
From: Salil Mehta Store the user-specified topology (socket/cluster/core/thread) and derive a unique 'vcpu-id'. The 'vcpu-id' is used as the slot index in the possible vCPUs list when administratively enabling or disabling a vCPU. Co-developed-by: Keqian Zhu Signed-off-by

[PATCH RFC V6 03/24] hw/arm/virt: Clamp 'maxcpus' as-per machine's vCPU deferred online-capability

2025-09-30 Thread salil . mehta
From: Salil Mehta To support a vCPU hot-add–like model on ARM, the virt machine may be setup with more CPUs than are active at boot. These additional CPUs are fully realized in KVM and listed in ACPI tables from the start, but begin in a disabled state. They can later be brought online or taken

[PATCH RFC V6 12/24] hw/core: Introduce generic device power-state handler interface

2025-09-30 Thread salil . mehta
From: Salil Mehta Device power-state transitions such as powering on, powering off, or entering standby may be triggered by administrative state changes (enable to disable or disable to enable), guest OSPM requests in response to workload or policy, or platform-specific control flows (e.g. ACPI

[PATCH RFC V6 17/24] hw/arm/virt, acpi/ged: Add PowerStateHandler hooks for runtime CPU state changes

2025-09-30 Thread salil . mehta
From: Salil Mehta Administrative power state property has been recently introduced as part of this patch-set, and QEMU currently lacks a way for platforms to react to such control (e.g. 'device_set ... admin-state=disable'). These host-driven changes must drive corresponding o

[PATCH RFC V6 07/24] arm/gicv3: Refactor CPU interface init for shared TCG/KVM use

2025-09-30 Thread salil . mehta
From: Salil Mehta GICv3 CPU interface initialization currently has separate logic paths for TCG and KVM accelerators, even though much of the flow—such as iterating over vCPUs and applying common setup—should be identical. This separation makes it harder to add new CPU interface features that

[PATCH RFC V6 14/24] arm/acpi: Introduce dedicated CPU OSPM interface for ARM-like platforms

2025-09-30 Thread salil . mehta
From: Salil Mehta The existing ACPI CPU hotplug interface is built for x86 platforms where CPUs can be inserted or removed and resources are allocated dynamically. On ARM, CPUs are never hotpluggable: resources are allocated at boot and QOM vCPU objects always exist. Instead, CPUs are

[PATCH RFC V6 05/24] arm/virt, kvm: Pre-create KVM vCPUs for 'disabled' QOM vCPUs at machine init

2025-09-30 Thread salil . mehta
From: Salil Mehta ARM CPU architecture does not allow CPUs to be plugged after system has initialized. This is a constraint. Hence, the Kernel must know all the CPUs being booted during its initialization. This applies to the Guest Kernel as well and therefore, the number of KVM vCPU descriptors

[PATCH RFC V6 11/24] hw/arm/acpi: MADT change to size the guest with possible vCPUs

2025-09-30 Thread salil . mehta
From: Salil Mehta When QEMU builds the MADT table, modifications are needed to include information about possible vCPUs that are exposed as ACPI-disabled (i.e., `_STA.Enabled=0`). This new information will help the guest kernel pre-size its resources during boot time. Pre-sizing based on

[PATCH RFC V6 00/24] Support of Virtual CPU Hotplug-like Feature for ARMv8+ Arch

2025-09-30 Thread salil . mehta
From: Salil Mehta [!] Sending again: It looks like mails sent from my official ID are being held somewhere. Hence, I am using my other email address. Sorry for any inconvenience this may have caused. (I) Prologue This patch series adds support for a virtual CPU

[PATCH RFC V6 10/24] arm/virt: Init PMU at host for all present vCPUs

2025-09-30 Thread salil . mehta
From: Salil Mehta ARM architecture requires that all CPUs which form part of the VM must expose identical feature sets and consistent system components at creation time. This includes the Performance Monitoring Unit (PMU). If only the boot CPUs had their PMU state initialized, the remaining CPUs

[PATCH RFC V6 02/24] hw/core, qemu-options.hx: Introduce 'disabledcpus' SMP parameter

2025-09-30 Thread salil . mehta
From: Salil Mehta Add support for a new SMP configuration parameter, 'disabledcpus', which specifies the number of additional CPUs that are present in the virtual machine but administratively disabled at boot. These CPUs are visible in firmware (e.g. ACPI tables) yet unavailable to

Test email

2025-09-30 Thread Salil Mehta via
Test email. sorry for the noise!

test email

2025-09-30 Thread Salil Mehta
test email (sorry for the noise)

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

2025-05-22 Thread Salil Mehta via
o > Cc: Gavin Shan ; Salil Mehta > ; qemu-devel@nongnu.org; qemu- [...] > On Wed, 21 May 2025 12:06:57 -0300 > Gustavo Romero wrote: > > > Hi Salil, Gavin, and folks, > > > > On 5/20/25 21:22, Gavin Shan wrote: > > > Hi Salil, > > > >

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

2025-05-22 Thread Salil Mehta via
HI Gavin, > -Original Message- > From: Gavin Shan > Sent: Thursday, May 22, 2025 12:54 AM > To: Gustavo Romero ; Salil Mehta > ; qemu-devel@nongnu.org; qemu- > a...@nongnu.org; m...@redhat.com; Jonathan Cameron > ; Igor Mammedov > ; Eric Auger [..] > > H

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

2025-05-22 Thread Salil Mehta via
Hi Gustavo, > From: Gustavo Romero > Sent: Wednesday, May 21, 2025 4:07 PM > To: Gavin Shan ; Salil Mehta > ; qemu-devel@nongnu.org; qemu- > a...@nongnu.org; m...@redhat.com; Jonathan Cameron > ; Igor Mammedov > ; Eric Auger [...] > > Hi Salil, Gavin, and folks, &

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

2025-05-22 Thread Salil Mehta via
Hi Gavin, Thanks for your email and sorry for the delay in reply as I was in transit and on annual leave since Monday. Please check my replies inline. Best regards Salil > From: Gavin Shan > Sent: Wednesday, May 21, 2025 1:22 AM > To: Salil Mehta ; qemu-devel@nongnu.or

[PATCH V2 2/3] Fix: CPUs presence logic in _STA for x86 backward compatability

2024-11-08 Thread Salil Mehta via
+} +Else +{ +Local0 = 0x0D +} } Reported-by: Igor Mammedov Message-ID: <20241106100047.18901...@imammedo.users.ipa.redhat.com> Signed-off-by: Salil Mehta --- hw/acpi/cpu.c

[PATCH V2 3/3] tests/qtest/bios-tables-test: Fix DSDT golden masters for x86/{pc, q35}

2024-11-08 Thread Salil Mehta via
If ((\_SB.PCI0.PRES.CPEN == One)) +{ +Local0 |= 0x0F } Release (\_SB.PCI0.PRES.CPLK) Reported-by: Igor Mammedov Message-ID: <20241106100047.18901...@imammedo.users.ipa.redhat.com> Signed-off-by: Salil Mehta --- tests/data/acpi/x86/pc/DSDT

[PATCH V2 1/3] qtest: allow ACPI DSDT Table changes

2024-11-08 Thread Salil Mehta via
list changed files in tests/qtest/bios-tables-test-allowed-diff.h Suggested-by: Igor Mammedov Message-ID: <20241106100047.18901...@imammedo.users.ipa.redhat.com> Signed-off-by: Salil Mehta --- tests/qtest/bios-tables-test-allowed-diff.h | 41 + 1 file changed, 41 inse

[PATCH V2 0/3] Fixes CPUs AML & acpi-bios-tables to be x86 backward compatible

2024-11-08 Thread Salil Mehta via
checking the `presence` of vCPUs dynamically (feedback from Igor Mammedov) Fixes [PULL 60/65], [PULL 61/65]: Message-ID: Message-ID: <4d62d15b11909e9af121577e707b88f2e4524371.1730754238.git@redhat.com> Salil Mehta (3): qtest: allow ACPI DSDT Table changes Fix: CPUs presence logic i

RE: [PATCH 2/3] Fix: Reverse CPUs presence check logic for x86 backward compatability

2024-11-07 Thread Salil Mehta via
Hi Igor, Many thanks for taking time to reply. > From: qemu-arm-bounces+salil.mehta=huawei@nongnu.org arm-bounces+salil.mehta=huawei@nongnu.org> On Behalf Of Igor > Mammedov > Sent: Thursday, November 7, 2024 4:57 PM > To: Salil Mehta > > On Wed, 6 No

RE: [PATCH 2/3] Fix: Reverse CPUs presence check logic for x86 backward compatability

2024-11-06 Thread Salil Mehta via
Hi Igor, Thanks for replying back and the reviews. Please find my replies inline. > From: Igor Mammedov > Sent: Wednesday, November 6, 2024 4:08 PM > To: Salil Mehta > > On Wed, 6 Nov 2024 14:45:42 + > Salil Mehta wrote: > > > Hi Igor, > &g

[PATCH 0/3] Fixes CPUs AML & acpi-bios-tables to be x86 backward compatible

2024-11-06 Thread Salil Mehta via
-ID: <4d62d15b11909e9af121577e707b88f2e4524371.1730754238.git@redhat.com> Salil Mehta (3): qtest: allow ACPI DSDT Table changes Fix: Reverse CPUs presence check logic for x86 backward compatability tests/qtest/bios-tables-test: Fix DSDT golden masters for x86/{pc,q35} hw/acpi

[PATCH 3/3] tests/qtest/bios-tables-test: Fix DSDT golden masters for x86/{pc, q35}

2024-11-06 Thread Salil Mehta via
-by: Igor Mammedov Message-ID: <20241106100047.18901...@imammedo.users.ipa.redhat.com> Signed-off-by: Salil Mehta --- tests/data/acpi/x86/pc/DSDT | Bin 8561 -> 8561 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 8472 -> 8472 bytes tests/data/acpi/x86/pc

[PATCH 1/3] qtest: allow ACPI DSDT Table changes

2024-11-06 Thread Salil Mehta via
list changed files in tests/qtest/bios-tables-test-allowed-diff.h Suggested-by: Igor Mammedov Message-ID: <20241106100047.18901...@imammedo.users.ipa.redhat.com> Signed-off-by: Salil Mehta --- tests/qtest/bios-tables-test-allowed-diff.h | 41 + 1 file changed, 41 inse

RE: [PATCH 2/3] Fix: Reverse CPUs presence check logic for x86 backward compatability

2024-11-06 Thread Salil Mehta via
Hi Igor, > From: qemu-arm-bounces+salil.mehta=huawei@nongnu.org arm-bounces+salil.mehta=huawei@nongnu.org> On Behalf Of Igor > Mammedov > Sent: Wednesday, November 6, 2024 1:57 PM > To: Salil Mehta > > On Wed, 6 Nov 2024 13:03:30 + > Salil Mehta

[PATCH 2/3] Fix: Reverse CPUs presence check logic for x86 backward compatability

2024-11-06 Thread Salil Mehta via
+} +Else +{ +Local0 = 0x0D +} } Suggested-by: Igor Mammedov Message-ID: <20241106100047.18901...@imammedo.users.ipa.redhat.com> Signed-off-by: Salil Mehta --- hw/acpi/cpu.

RE: [PULL 60/65] hw/acpi: Update ACPI `_STA` method with QOM vCPU ACPI Hotplug states

2024-11-06 Thread Salil Mehta via
HI Igor, Thank for you replying back. > From: qemu-devel-bounces+salil.mehta=huawei@nongnu.org devel-bounces+salil.mehta=huawei@nongnu.org> On Behalf Of Igor > Mammedov > Sent: Wednesday, November 6, 2024 9:01 AM > To: Salil Mehta > > On Tue, 5 Nov 2024 21

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

2024-11-06 Thread Salil Mehta via
HI Peter, > From: Peter Maydell > Sent: Wednesday, November 6, 2024 1:01 PM > To: Salil Mehta > > On Tue, 5 Nov 2024 at 22:20, Salil Mehta wrote: > > > > HI Peter, > > > > > From: Peter Maydell > > > Sent: Monda

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

2024-11-05 Thread Salil Mehta via
HI Peter, > From: Peter Maydell > Sent: Monday, November 4, 2024 1:27 PM > To: Salil Mehta > > 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, supp

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

2024-11-05 Thread Salil Mehta via
Hi Gavin, Thanks for the valuable comments. I will address them but it looks peter has already pulled ARM changes for this cycle? Thanks Salil. > From: Gavin Shan > Sent: Tuesday, November 5, 2024 12:01 AM > To: Salil Mehta ; qemu-devel@nongnu.org; > qemu-...@nongnu.org; m..

RE: [PULL 60/65] hw/acpi: Update ACPI `_STA` method with QOM vCPU ACPI Hotplug states

2024-11-05 Thread Salil Mehta via
> From: Igor Mammedov > Sent: Tuesday, November 5, 2024 12:50 PM > To: Michael S. Tsirkin > Cc: qemu-devel@nongnu.org; Peter Maydell ; > Salil Mehta ; Ani Sinha ; > Eduardo Habkost ; Marcel Apfelbaum > ; Philippe Mathieu-Daudé > ; wangyanan (Y) ; Zhao > Liu

RE: [PATCH V3 0/5] Arch agnostic ACPI changes to support vCPU Hotplug (on Archs like ARM)

2024-11-04 Thread Salil Mehta via
HI Miguel, > From: Miguel Luis > Sent: Monday, November 4, 2024 12:55 PM > To: Salil Mehta > > Hi Salil, > > > On 3 Nov 2024, at 09:24, Salil Mehta via > wrote: > > > > Change Log > > == > > > > Patch V2 -> V3:

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

2024-11-04 Thread Salil Mehta via
us. https://lore.kernel.org/qemu-devel/20241103102419.202225-1-salil.me...@huawei.com/ Many thanks! Best regards Salil. > From: Salil Mehta > Sent: Friday, November 1, 2024 10:54 AM > To: 'Igor Mammedov' ; Salil Mehta > > > Hi Igor, > > Thanks for r

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

2024-11-03 Thread Salil Mehta via
] Suggested-by: Miguel Luis [5/05/2024: Fix the total number of PPIs available as per ARM BSA to avoid overflow] Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta --- hw/arm/virt.c | 108 -- 1 file changed, 60 insertions

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

2024-11-03 Thread Salil Mehta via
* functional changes intended. Code has been tested to confirm correct initialization sequences across relevant scenarios. Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta --- hw/intc/arm_gicv3.c| 1 + hw/intc/arm_gicv3_cpuif.c

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

2024-11-03 Thread Salil Mehta via
cosmetic change only; *no* functional changes are intended here. Signed-off-by: Salil Mehta --- hw/arm/virt.c | 238 +- include/hw/arm/virt.h | 4 + 2 files changed, 147 insertions(+), 95 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c

RE: [PATCH V2 0/6] Arch agnostic ACPI changes to support vCPU Hotplug (on Archs like ARM)

2024-11-03 Thread Salil Mehta via
agnostic ACPI changes to support vCPU Hotplug (on Archs like ARM) https://lore.kernel.org/qemu-devel/20241103102419.202225-1-salil.me...@huawei.com/#t Sorry for any inconvenience above might have caused. Best regards Salil. > -Original Message- > From: Salil Mehta > Sent:

[PATCH V3 2/5] qtest: allow ACPI DSDT Table changes

2024-11-03 Thread Salil Mehta via
list changed files in tests/qtest/bios-tables-test-allowed-diff.h Reported-by: Zhao Liu Signed-off-by: Salil Mehta --- tests/qtest/bios-tables-test-allowed-diff.h | 41 + 1 file changed, 41 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests

[PATCH V3 5/5] hw/acpi: Update GED with vCPU Hotplug VMSD for migration

2024-11-03 Thread Salil Mehta via
"ost_status": "0x" }, [...] { "is_inserting": false, "is_removing": false, "ost_event": "0x",

[PATCH V3 1/5] hw/acpi: Make CPUs ACPI `presence` conditional during vCPU hot-unplug

2024-11-03 Thread Salil Mehta via
-__ii0iNb3.pdf [3] KVMForum 2020 Presentation: Challenges in Supporting Virtual CPU Hotplug on SoC Based Systems (like ARM64) Link: https://kvmforum2020.sched.com/event/eE4m [4] Example implementation of architecture-specific CPU persistence hook Link: https://github.com/salil-mehta

[PATCH V3 4/5] tests/qtest/bios-tables-test: Update DSDT golden masters for x86/{pc, q35}

2024-11-03 Thread Salil Mehta via
f ((\_SB.PCI0.PRES.CPEN == One)) +{ +Local0 = 0x0F +} +Else +{ +Local0 = 0x0D +} } Release (\_SB.PCI0.PRES.CPLK) Reported-by:

[PATCH V3 3/5] hw/acpi: Update ACPI `_STA` method with QOM vCPU ACPI Hotplug states

2024-11-03 Thread Salil Mehta via
using architecture-specific code [1]. Reference: [1] Example implementation of architecture-specific hook to fetch CPU `enabled status Link: https://github.com/salil-mehta/qemu/commit/c0b416b11e5af6505e558866f0eb6c9f3709173e Signed-off-by: Salil Mehta --- hw/acpi/cpu.c | 38

[PATCH V3 0/5] Arch agnostic ACPI changes to support vCPU Hotplug (on Archs like ARM)

2024-11-03 Thread Salil Mehta via
Architecture Agnostic ACPI changes patch-set: Repo: https://github.com/salil-mehta/qemu.git virt-cpuhp-armv8/rfc-v6.arch.agnostic.acpi.v3 Link: https://github.com/salil-mehta/qemu/commits/virt-cpuhp-armv8/rfc-v6.arch.agnostic.acpi.v3 (*) Works with upcoming ARM architecture specif

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

2024-11-01 Thread Salil Mehta via
cle and drop the last patch? Arch agnostic ACPI V2 series: https://lore.kernel.org/qemu-devel/20241031200502.3869-1-salil.me...@huawei.com/T/#mf10104510269d5c290622a0471f0997ad058e397 Upcoming RFC V6, Support of Virtual CPU Hotplug for ARMv8 Arch Link: https://github.com/salil-mehta/qemu/commits/virt-c

[PATCH V2 6/6] hw/acpi: Update GED with vCPU Hotplug VMSD for migration

2024-10-31 Thread Salil Mehta via
se, "is_removing": false, "is_enabled": false, "ost_event": "0x", "ost_status": "0x" } ]

[PATCH V2 5/6] tests/qtest/bios-tables-test: Update DSDT golden masters for x86/{pc, q35}

2024-10-31 Thread Salil Mehta via
\_SB.PCI0.PRES.CPLK) Reported-by: Zhao Liu Signed-off-by: Salil Mehta --- tests/data/acpi/x86/pc/DSDT | Bin 8527 -> 8533 bytes tests/data/acpi/x86/pc/DSDT.acpierst | Bin 8438 -> 8444 bytes tests/data/acpi/x86/pc/DSDT.acpihmat | Bin 9852 -> 9858 by

[PATCH V2 3/6] qtest: allow ACPI DSDT Table changes

2024-10-31 Thread Salil Mehta via
list changed files in tests/qtest/bios-tables-test-allowed-diff.h Reported-by: Zhao Liu Signed-off-by: Salil Mehta --- tests/qtest/bios-tables-test-allowed-diff.h | 41 + 1 file changed, 41 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests

[PATCH V2 4/6] hw/acpi: Update CPUs AML's `is_enabled` state in ACPI _STA method

2024-10-31 Thread Salil Mehta via
Update the CPUs AML code to reflect the ACPI CPU Hotplug `is_enabled` state in the `_STA.Enabled` Bit when the ACPI `_STA` method is evaluated by the Guest Kernel during initialization, as well as when vCPUs are hot-plugged or hot-unplugged. Signed-off-by: Salil Mehta Reviewed-by: Gustavo Romero

[PATCH V2 2/6] hw/acpi: Update ACPI CPU Hotplug state during vCPU hot(un)plug

2024-10-31 Thread Salil Mehta via
Update the `is_enabled` state in `AcpiCpuStatus` when vCPUs are hot-plugged or hot-unplugged. Signed-off-by: Salil Mehta Reviewed-by: Gustavo Romero --- hw/acpi/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index 238a0edbc1..8940687f90 100644 --- a

[PATCH V2 1/6] hw/acpi: Introduce `is_enabled` state in ACPI CPU Hotplug Status

2024-10-31 Thread Salil Mehta via
Link: https://kvm-forum.qemu.org/2023/Challenges_Revisited_in_Supporting_Virt_CPU_Hotplug_-__ii0iNb3.pdf [3] KVMForum 2020 Presentation: Challenges in Supporting Virtual CPU Hotplug on SoC Based Systems (like ARM64) Link: https://kvmforum2020.sched.com/event/eE4m Signed-off-by: Salil

[PATCH V2 0/6] Arch agnostic ACPI changes to support vCPU Hotplug (on Archs like ARM)

2024-10-31 Thread Salil Mehta via
hitecture Agnostic ACPI changes patch-set: https://github.com/salil-mehta/qemu.git virt-cpuhp-armv8/rfc-v6.arch.agnostic.acpi.v2 Link: https://github.com/salil-mehta/qemu/commits/virt-cpuhp-armv8/rfc-v6.arch.agnostic.acpi.v2 (*) Works with upcoming ARM architecture specific patch-set

RE: [PATCH V1 0/4] Arch agnostic ACPI changes to support vCPU Hotplug (on Archs like ARM)

2024-10-22 Thread Salil Mehta via
Hi Igor, Thanks for taking time to review the series. Please find my replies inline. > From: qemu-devel-bounces+salil.mehta=huawei@nongnu.org devel-bounces+salil.mehta=huawei@nongnu.org> On Behalf Of Igor > Mammedov > Sent: Friday, October 18, 2024 3:46 PM >

RE: [PATCH V1 3/4] hw/acpi: Reflect ACPI vCPU {present,enabled} states in ACPI _STA.{PRES,ENA} Bits

2024-10-22 Thread Salil Mehta via
Hi Gustavo, > From: Gustavo Romero > Sent: Monday, October 21, 2024 3:10 AM > To: Salil Mehta ; qemu-devel@nongnu.org; > qemu-...@nongnu.org; m...@redhat.com > > Hi Salil, > > On 10/14/24 16:22, Salil Mehta wrote: > > Reflect the ACPI CPU hotplug `is_{pr

RE: [PATCH V1 3/4] hw/acpi: Reflect ACPI vCPU {present,enabled} states in ACPI _STA.{PRES,ENA} Bits

2024-10-22 Thread Salil Mehta via
Hi Igor, > From: Igor Mammedov > Sent: Friday, October 18, 2024 3:25 PM > To: Salil Mehta > Cc: qemu-devel@nongnu.org; qemu-...@nongnu.org; m...@redhat.com; > m...@kernel.org; jean-phili...@linaro.org; Jonathan Cameron > ; lpieral...@kernel.org; > peter.mayd...@linar

RE: [PATCH V1 3/4] hw/acpi: Reflect ACPI vCPU {present,enabled} states in ACPI _STA.{PRES,ENA} Bits

2024-10-22 Thread Salil Mehta via
> From: Igor Mammedov > Sent: Friday, October 18, 2024 3:19 PM > To: Zhao Liu > Cc: Salil Mehta ; qemu-devel@nongnu.org; > qemu-...@nongnu.org; m...@redhat.com; m...@kernel.org; jean- > phili...@linaro.org; Jonathan Cameron > ; lpieral...@kernel.org; >

RE: [PATCH V1 3/4] hw/acpi: Reflect ACPI vCPU {present,enabled} states in ACPI _STA.{PRES,ENA} Bits

2024-10-22 Thread Salil Mehta via
Hi Zhao, Sorry, for the late reply. I was away last week with only intermittent access to the mails. > From: Zhao Liu > Sent: Friday, October 18, 2024 6:13 AM > To: Salil Mehta > > Hi Salil, > > On Mon, Oct 14, 2024 at 08:22:04PM +0100, Salil Mehta wrote: >

RE: [PATCH V1 4/4] hw/acpi: Populate vCPU Hotplug VMSD to migrate `is_{present,enabled}` states

2024-10-22 Thread Salil Mehta via
Hi Igor, > From: Igor Mammedov > Sent: Friday, October 18, 2024 3:31 PM > To: Salil Mehta > > On Mon, 14 Oct 2024 20:22:05 +0100 > Salil Mehta wrote: > > > The ACPI CPU hotplug states `is_{present, enabled}` must be migrated > > alongside other vCPU

RE: [PATCH V1 2/4] hw/acpi: Update ACPI CPU Status `is_{present, enabled}` during vCPU hot(un)plug

2024-10-22 Thread Salil Mehta via
Hi Igor, > From: Igor Mammedov > Sent: Friday, October 18, 2024 3:18 PM > To: Salil Mehta > > On Mon, 14 Oct 2024 20:22:03 +0100 > Salil Mehta wrote: > > > Update the `AcpiCpuStatus` for `is_enabled` and `is_present` > > accordingly when vCPUs

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

2024-10-21 Thread Salil Mehta
Hi Igor, Thanks for taking time to review and sorry for not being prompt. I was in transit due to some difficult personal situation. On Fri, Oct 18, 2024 at 3:11 PM Igor Mammedov wrote: > On Mon, 14 Oct 2024 20:22:02 +0100 > Salil Mehta wrote: > > > Certain CPU architecture sp

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

2024-10-21 Thread Salil Mehta
Hi Gustavo On Thu, Oct 17, 2024 at 9:25 PM Gustavo Romero wrote: > Hi Salil, > > On 10/14/24 16:22, Salil Mehta wrote: > > Certain CPU architecture specifications [1][2][3] prohibit changes to CPU > > presence after the kernel has booted. This limitation exists

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

2024-10-21 Thread Salil Mehta
Hi Gavin, On Thu, Oct 17, 2024 at 6:27 AM Gavin Shan wrote: > 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 > >

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

2024-10-21 Thread Salil Mehta
HI Gustavo, On Wed, Oct 16, 2024 at 10:01 PM Gustavo Romero wrote: > Hi Salil, > > On 10/14/24 16:22, Salil Mehta wrote: > > Certain CPU architecture specifications [1][2][3] prohibit changes to CPU > > presence after the kernel has booted. This limitation exists

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

2024-10-21 Thread Salil Mehta
Hi Miguel, On Wed, Oct 16, 2024 at 3:09 PM Miguel Luis wrote: > Hi Salil, > > > On 15 Oct 2024, at 09:59, Salil Mehta wrote: > > > > PROLOGUE > > > > > > To assist in review and set the right expectations from this RFC, please > first &

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

2024-10-21 Thread Salil Mehta
Hi Gavin, Sorry for the late reply. I had to travel outside the UK urgently because of some personal challenging situation. I'm still on the transit back to the UK hence replying from my other email ID.. On Thu, Oct 17, 2024 at 8:07 AM Gavin Shan wrote: > Hi Salil, > > The issues reported again

RE: [PULL v2 40/61] hw/acpi: Update GED _EVT method AML with CPU scan

2024-10-15 Thread Salil Mehta via
Hi Igor, > From: Igor Mammedov > Sent: Tuesday, October 15, 2024 3:34 PM > To: Salil Mehta > > On Tue, 15 Oct 2024 09:41:24 + > Salil Mehta wrote: > > > HI Igor, > > > > > From: Igor Mammedov > > > Sent: Tuesday, October 15

RE: [PATCH V1 0/4] Arch agnostic ACPI changes to support vCPU Hotplug (on Archs like ARM)

2024-10-15 Thread Salil Mehta via
HI Bibo, > From: maobibo > Sent: Tuesday, October 15, 2024 4:31 AM > To: Salil Mehta ; qemu-devel@nongnu.org; > qemu-...@nongnu.org; m...@redhat.com > > With cpu-add/cpu-del command tested on LoongArch system, no migration > tested. There is no negative influen

[PATCH RFC V5 30/30] hw/arm/virt: Expose cold-booted vCPUs as MADT GICC *Enabled*

2024-10-15 Thread Salil Mehta via
//uefi.org/sites/default/files/resources/ACPI_Spec_6_5_Aug29.pdf (Pages 138, 140) Signed-off-by: Salil Mehta --- hw/arm/virt.c | 16 include/hw/core/cpu.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 15d9c2d8ac..d1172151be 100644

[PATCH RFC V5 29/30] hw/intc/arm_gicv3_kvm: Pause all vCPU to ensure locking in KVM of resetting vCPU

2024-10-15 Thread Salil Mehta via
fail if KVM is unable to acquire the necessary locks on all vCPUs. Therefore, to ensure proper locking of the vCPU being reset and prevent failures, we need to *pause all vCPUs* during this operation to facilitate successful locking within the host. Signed-off-by: Salil Mehta --- hw/intc

[PATCH RFC V5 26/30] hw/intc/arm_gicv3_common: Add GICv3CPUState 'accessible' flag migration handling

2024-10-15 Thread Salil Mehta via
tion or override the destination QEMU’s vCPU configuration to match the source. We have adopted the latter approach as a mitigation for the mismatch. Nonetheless, the administrator should still ensure that the number of possible QOM vCPUs is consistent at both ends. Signed-off-by: Salil

[PATCH RFC V5 28/30] target/arm/kvm: Write vCPU's state back to KVM on cold-reset

2024-10-15 Thread Salil Mehta via
trigger a call to `kvm_arch_put_registers()`. This guarantees that KVM’s `MP_STATE` is updated accordingly, forcing synchronization of the `mp_state` between QEMU and KVM. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Salil Mehta --- target/arm/kvm.c | 7 +++ 1 file changed, 7 insertion

[PATCH RFC V5 27/30] target/arm/kvm, tcg: Handle SMCCC hypercall exits in VMM during PSCI_CPU_{ON, OFF}

2024-10-15 Thread Salil Mehta via
From: Author Salil Mehta To support vCPU hotplug, we must trap any `HVC`/`SMC` `PSCI_CPU_{ON,OFF}` hypercalls from the host KVM to QEMU for policy checks. This ensures the following when a vCPU is brought online: 1. The vCPU is actually plugged in (i.e., present). 2. The vCPU is not disabled

[PATCH RFC V5 25/30] tcg/mttcg: Introduce MTTCG thread unregistration leg

2024-10-15 Thread Salil Mehta via
From: Miguel Luis Introduce the TCG thread unregistration leg which shall be called in context to TCG/vCPU unrealize. Reported-by: Salil Mehta Signed-off-by: Miguel Luis Signed-off-by: Salil Mehta --- accel/tcg/tcg-accel-ops-mttcg.c | 1 + include/tcg/startup.h | 7 +++ tcg

[PATCH RFC V5 24/30] target/arm: Add support to *unrealize* ARMCPU during vCPU Hot-unplug

2024-10-15 Thread Salil Mehta via
vCPUs are not destroyed in host KVM rather their Qemu context is parked at the QEMU KVM layer. Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta Reported-by: Vishnu Pajjuri [VP: Identified CPU stall issue & suggested probable fix] Signed-off-by: Salil M

[PATCH RFC V5 20/30] hw/arm: Changes required for reset and to support next boot

2024-10-15 Thread Salil Mehta via
Updates the firmware config with the next boot cpus information and also registers the reset callback to be called when guest reboots to reset the cpu. Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta --- hw/arm/boot.c | 2 +- hw/arm/virt.c

[PATCH RFC V5 23/30] tcg: Update tcg_register_thread() leg to handle region alloc for hotplugged vCPU

2024-10-15 Thread Salil Mehta via
. Reported-by: Miguel Luis Signed-off-by: Miguel Luis Signed-off-by: Salil Mehta --- accel/tcg/tcg-accel-ops-mttcg.c | 2 +- accel/tcg/tcg-accel-ops-rr.c| 2 +- include/tcg/startup.h | 6 ++ include/tcg/tcg.h | 1 + tcg/region.c| 14

[PATCH RFC V5 22/30] target/arm/cpu: Check if hotplugged ARM vCPU's FEAT match existing

2024-10-15 Thread Salil Mehta via
The ARM extensions configuration *must* match the existing vCPUs already initialized in KVM at VM initialization. ARM does not allow any per-vCPU features to be changed once the system has fully initialized. This is an immutable constraint of the ARM CPU architecture. Signed-off-by: Salil Mehta

[PATCH RFC V5 21/30] arm/virt: Update the guest(via GED) about vCPU hot-(un)plug events

2024-10-15 Thread Salil Mehta via
-(un)plug event for the *targeted* vCPU. Introduce the required ACPI calls into the existing hot-(un)plug hooks, allowing ACPI GED events to be triggered from QEMU to the guest VM. Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta --- hw/arm/virt.c | 39

[PATCH RFC V5 19/30] hw/arm, gicv3: Changes to notify GICv3 CPU state with vCPU hot-(un)plug event

2024-10-15 Thread Salil Mehta via
: Keqian Zhu Signed-off-by: Salil Mehta --- hw/arm/virt.c | 31 ++- hw/intc/arm_gicv3_common.c | 60 +- include/hw/arm/virt.h | 1 + include/hw/intc/arm_gicv3_common.h | 23 4 files changed, 112 insertions

[PATCH RFC V5 18/30] arm/virt: Changes to (un)wire GICC<->vCPU IRQs during hot-(un)plug

2024-10-15 Thread Salil Mehta via
g cases. Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta Reported-by: Vishnu Pajjuri [4/05/2024: Issue with total number of PPI available during create GIC] Suggested-by: Miguel Luis [5/05/2024: Fix the total number of PPIs available as per ARM BSA to avoid overflow] S

[PATCH RFC V5 17/30] arm/virt: Add/update basic hot-(un)plug framework

2024-10-15 Thread Salil Mehta via
ace. 4. Updating the guest with next boot information for this vCPU in the firmware. Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta --- hw/arm/virt.c | 104 ++ 1 file changed, 104 insertions(+) diff --git a/

[PATCH RFC V5 16/30] target/arm: Force ARM vCPU *present* status ACPI *persistent*

2024-10-15 Thread Salil Mehta via
://bugzilla.tianocore.org/show_bug.cgi?id=4481#c5 Signed-off-by: Salil Mehta --- target/arm/cpu64.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index d2f4624d61..c2af6a28f5 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -797,6 +797,13

[PATCH RFC V5 15/30] hw/arm/acpi: MADT Tbl change to size the guest with possible vCPUs

2024-10-15 Thread Salil Mehta via
/ACPI/6.5/05_ACPI_Software_Programming_Model.html#gic-cpu-interface-gicc-structure Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta --- hw/arm/virt-acpi-build.c | 36 ++-- include/hw/acpi/cpu.h| 19 +++ 2 files

[PATCH RFC V5 13/30] arm/virt/acpi: Update ACPI DSDT Tbl to include CPUs AML with hotplug support

2024-10-15 Thread Salil Mehta via
} \_SB.GED.CSCN () } } } Device (PWRB) { [...] } } Signed-off-by: Salil Mehta --- hw/arm/virt-acpi-build.c | 33 +++-- 1 file changed, 23 insertions(+), 10

[PATCH RFC V5 14/30] hw/acpi: Make _MAT method optional

2024-10-15 Thread Salil Mehta via
f-by: Jean-Philippe Brucker Reviewed-by: Gavin Shan Signed-off-by: Salil Mehta --- hw/acpi/cpu.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index d34c1e601e..2cbeedffe8 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -731,10 +731,

[PATCH RFC V5 12/30] arm/virt: Release objects for *disabled* possible vCPUs after init

2024-10-15 Thread Salil Mehta via
old ARMCPU object instead of creating a new one for the hotplug request. Each of these approaches has its own pros and cons. This prototype uses the first approach (suggestions are welcome!). Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta --- hw/arm/v

[PATCH RFC V5 11/30] arm/virt: Init PMU at host for all possible vCPUs

2024-10-15 Thread Salil Mehta via
until the ARM specification is updated to allow otherwise. Past discussion for reference: Link: https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg00131.html Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta --- hw/arm/virt.c | 9 + include

[PATCH RFC V5 10/30] arm/virt: Enhance GED framework to handle vCPU hotplug events

2024-10-15 Thread Salil Mehta via
the Guest Kernel. Signed-off-by: Salil Mehta Reviewed-by: Gavin Shan --- hw/arm/virt.c | 5 - include/hw/arm/virt.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 00fd65b4e1..b9df428049 100644 --- a/hw/arm/virt.c +++ b/hw/arm

[PATCH RFC V5 09/30] arm/acpi: Enable ACPI support for vCPU hotplug

2024-10-15 Thread Salil Mehta via
compatible with ARM64.) Enable the ACPI support switch for vCPU hotplug feature. Actual ACPI changes required will follow in subsequent patches. Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta --- hw/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff

[PATCH RFC V5 08/30] hw/intc/arm-gicv3*: Changes required to (re)init the GICv3 vCPU Interface

2024-10-15 Thread Salil Mehta via
: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta --- hw/intc/arm_gicv3.c| 1 + hw/intc/arm_gicv3_cpuif.c | 245 ++--- hw/intc/arm_gicv3_cpuif_common.c | 13 ++ hw/intc/arm_gicv3_kvm.c| 14 +- hw/intc

[PATCH RFC V5 05/30] arm/virt, kvm: Pre-create KVM vCPUs for all unplugged QOM vCPUs @machine init

2024-10-15 Thread Salil Mehta via
Signed-off-by: Salil Mehta Reported-by: Vishnu Pajjuri [VP: Identified CPU stall issue & suggested probable fix] --- hw/arm/virt.c | 74 ++- include/hw/core/cpu.h | 1 + target/arm/cpu64.c| 9 ++ target/arm/kvm.c

  1   2   3   4   5   6   7   >