Hi Jianyong,
On 30/10/2022 08:54, jianyong.wu--- via Linaro-open-discussions wrote:
I'm confused with that why set cpu possible flag to false when ACPI_MADT_ENABLED is not set.
Without any context .... are you referring to the code in gic_acpi_parse_madt_gicc()?
This is for CPUs that have a MADT:GICC:GICR entry instead of having their redistributor described by a MADT:GICR entry. The ACPI spec says entries in the MADT:GICR are in an always-on power domain, so the irqchip driver can always access them. It doesn't say anything about when the redistributor is accessible if the MADT:GICC:GICR field is used instead. This code is assuming the worst: that the redistributor is not online-capable, and any access by the irqchip driver will lead to an external-abort, or a lockup. Linux won't try to use CPUs that look like this as it can't probe the redistributor features at boot. This is why the CPUs are removed from the possible and present masks.
If you want to support this 'hotplug' mechanism, you need to use the MADT:GICR description of the redistributors because it is defined as always-on.
I tried to get the spec people to start defining the power management in this area, but without a physical piece of hardware that does this: its not going to be standardised.
IMO, we should check further about the online_capable bit, once it is set, cpu possible flag should be set to true.
I consider "possible" means cpu is not present but can be hot add later. Am I right?
Possible means the CPU can be present. It might be present right now.
But present/possible aren't relevant here. This is a different solution to the problem.
We can't invent cpu hotplug for arm64 without a physical machine that does it. As software engineers, we can't know the constraints the hardware designers will have. To make it possible to support physical cpu hotplug machines in the future, we need to add support for this thing in such a way that it doesn't mean stable kernels are broken on that hardware when it comes along.
This series lets EL3/the-VMM manage the CPU online/offline policy from outside the guest. This looks like cpu-hotplug to user-space, but its actually doing something different.
_all_ of arm64's ACPI tables are based on the assumption that everything described is present. We can't undermine this without creating problems. On a VM, everything really is present all the time.
Thanks,
James IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.