From: James Morse [mailto:james.morse@arm.com] Sent: Friday, October 21, 2022 2:01 PM To: Russell King (Oracle) linux@armlinux.org.uk Cc: Salil Mehta salil.mehta@huawei.com; Joyce Qi joyce.qi@linaro.org; Jonathan Cameron jonathan.cameron@huawei.com; Lorenzo Pieralisi lorenzo.pieralisi@linaro.org; Jean-Philippe Brucker jean-philippe@linaro.org; Jean-Philippe Brucker jean-philippe.brucker@arm.com; linaro-open-discussions@op-lists.linaro.org; salil.mehta@opnsrc.net; mehta.salil.lnk@gmail.com Subject: Re: Linaro-open-discussions Digest, Vol 25, Issue 3
Hi Russell,
On 21/10/2022 12:37, Russell King (Oracle) wrote:
On Fri, Oct 21, 2022 at 10:45:48AM +0100, James Morse wrote:
Hi Russell, Salil,
On 21/10/2022 08:38, Russell King (Oracle) wrote:
This is fine if the guest hasn't already brought the vCPU online, but if it has, blocking CPU_ON doesn't prevent the guest continuing to use the vCPU. How would that aspect be addressed with your approach?
CPU_ON shouldn't block, but can (now) return DENIED if the firmware policy
means the CPU
is "pretend not-present".
That is what I meant. Not "block" as in "wait until something".
Sorry - I read that wrong! (I've been in lockdep hell all morning).
ACPI already has mechanisms for this. The _STA value/policy can only change when the CPU is offline. If firmware wants request a CPU is taken offline, it can issue a eject-request notification. If the OS will then take the CPU offline, and call _EJ0 to say its done, as well as updating _OST with its progress.
There is no mechanism to forcibly offline a running CPU.
Hi Russel,
You might want to see "slide 5 - Quick Overview Virtual CPU Hot-(un)plug Event Sequence" for the detailed interactions of what James just explained:
Reference: https://kvmforum2020.sched.com/event/eE4m/challenges-in-supporting-virtual-c...
Code Reference, File: linux/drivers/acpi/scan.c
acpi_scan_hot_remove(struct acpi_device *device) { [...] acpi_scan_try_to_offline(device); [...] status = acpi_evaluate_ej0(handle); [...] }
Thanks Salil