qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Salil Mehta
Subject: RE: [PATCH RFC V2 18/37] arm/virt: Make ARM vCPU *present* status ACPI *persistent*
Date: Mon, 16 Oct 2023 22:33:25 +0000

Hi Gavin,

> From: Gavin Shan <gshan@redhat.com>
> Sent: Friday, September 29, 2023 12:18 AM
> To: Salil Mehta <salil.mehta@huawei.com>; qemu-devel@nongnu.org; 
> qemu-arm@nongnu.org
> Cc: maz@kernel.org; jean-philippe@linaro.org; Jonathan Cameron
> <jonathan.cameron@huawei.com>; lpieralisi@kernel.org;
> peter.maydell@linaro.org; richard.henderson@linaro.org;
> imammedo@redhat.com; andrew.jones@linux.dev; david@redhat.com;
> philmd@linaro.org; eric.auger@redhat.com; will@kernel.org; ardb@kernel.org;
> oliver.upton@linux.dev; pbonzini@redhat.com; mst@redhat.com;
> rafael@kernel.org; borntraeger@linux.ibm.com; alex.bennee@linaro.org;
> linux@armlinux.org.uk; darren@os.amperecomputing.com;
> ilkka@os.amperecomputing.com; vishnu@os.amperecomputing.com;
> karl.heubaum@oracle.com; miguel.luis@oracle.com; salil.mehta@opnsrc.net;
> zhukeqian <zhukeqian1@huawei.com>; wangxiongfeng (C)
> <wangxiongfeng2@huawei.com>; wangyanan (Y) <wangyanan55@huawei.com>;
> jiakernel2@gmail.com; maobibo@loongson.cn; lixianglai@loongson.cn
> Subject: Re: [PATCH RFC V2 18/37] arm/virt: Make ARM vCPU *present* status
> ACPI *persistent*
> 
> 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-plugged
> >
> > References:
> > [1] Check comment 5 in the bugzilla entry
> >     Link: https://bugzilla.tianocore.org/show_bug.cgi?id=4481#c5
> >
> > Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
> > ---
> >   cpus-common.c         |  6 ++++++
> >   hw/arm/virt.c         |  7 +++++++
> >   include/hw/core/cpu.h | 20 ++++++++++++++++++++
> >   3 files changed, 33 insertions(+)
> >
> 
> hmm, it's another CPU state. There are 4 CPU states, plus other 3 CPU states:
> possible, present, enabled. Now we're having always-present state.

Possible vCPU is not a QOM CPUState. Neither it gets represented through
ACPI to the guest OS through _STA method. A device which in this case is
a CPU can be in ENABLED state or can just be PRESENT but not ENABLED.

All possible vCPUs get detected by guest OS by the mere presence of GICC
Entry (Enabled/online-capable) in the ACPI MADT Table.

A plugged vCPU will be 'present' in QOM and will be ACPI _STA.PRESENT as
well. A un-plugged vCPU will be 'not-present' in QOM i.e. its CPUState
object will be NULL. This is akin to x86 or any other architecture and
we are not changing any of this at QOM level.

What changes is the representation of un-plugged vCPU to Guest OS via
ACPI _STA method. For ARM, we *fake* QOM un-plugged vCPU presence to the
Guest OS through the ACPI _STA method. To detect this we check the bool
'acpi_persistent' part of CPUState. This has to be set explicitly by
Architectures like ARM which do not support hot-plug. Hence, CPUs are
in 'always present' state ACPI wise but cannot be used as they are 
ACPI disabled i.e. ACPI _STA.ENABLED=0.


> I think
> those CPU states can be squeezed into the previous present state. What we
> need is to ensure all possible vCPUs are present from the beginning.

All of this is unnecessary, really.


Thanks
Salil.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]