Hi James,
From: James Morse [mailto:james.morse@arm.com] Sent: Friday, October 28, 2022 5:17 PM To: Salil Mehta salil.mehta@huawei.com; joyce.qi@linaro.org Cc: linaro-open-discussions@op-lists.linaro.org; lorenzo.pieralisi@linaro.org; ilkka@os.amperecomputing.com; Jean-Philippe Brucker jean-philippe.brucker@arm.com; salil.mehta@opnsrc.net Subject: Re: [Linaro-open-discussions] Re: Invitation: Linaro Open Discussions monthly meeting @ Wed 5 Oct 2022 19:00 - 20:00 (HKT) (linaro-open-discussions@op-lists.linaro.org)
Hi Salil,
Thanks for this, I've fixed a couple of bugs in the tree.
On the qemu side: Using KVM and your Qemu tree, PSCI returns success, when it should return denied for CPUs that are forbidden due to firmware policy: [ 0.027597] smp: Bringing up secondary CPUs ... [ 5.108204] CPU1: failed to come online [ 5.109198] CPU1: failed in unknown state : 0x0 [ 5.110384] smp: Brought up 1 node, 1 CPU
Did you try to use below branch(with some suggested fixes) which I shared with you?
[1] James Approach with online-capable and present==possible (some fixes) https://github.com/salil-mehta/linux.git virt-cpuhp-arm64/rfc-v2/jmorse-pres-eq-poss-cpu
This is mostly harmless for linux, but using PSCI_DENIED squashes the error, and avoids the timeout waiting for the secondary to turn up. Mostly harmless as this may cause 'cpus stuck in kernel' to get set, which would prevent kexec.
This probably means you're not using the HVC_TO_USER support for KVM that gets added as part of this series. You can then use the PSCI_TO_USER cap to disable the kernel's PSCI handler, which lets the VMM manage this directly.
Yes, that is true . I intentionally removed the PSCI-to-userspace patches as I was wondering if the CPU devices are not available in the guest kernel for the disabled CPUs how can they be made online?
Still using KVM, firmware should clear the enabled bit from _STA for any call after the eject-request. I see this is still 0xF before _EJx is called.
This is how the existing handshake protocol works. Firmware intimates the OS about ejection request which confirms its status about ejection-in-progress. Firmware/VMM then sends the ACPI event to remove the CPU from the kernel(which effectively is try-to-offline process and making not-present), Until this point _STA.ENABLED=1 (which is a correct behavior since firmware/VMM cannot disable the CPU before it has been made offline by the OS - can we snatch the physical resources before completing the housekeeping at OS?). Once offline'ing/removal is done, OS then informs the firmware/VMM about this completion using _EJ0 method (Which is effective way of giving green signal to the firmware/VMM to go ahead and remove the physical resources).
Firmware then removes the device and any further evaluation of _STA would show _STA.ENABLED=0 and ideally should show is not present(but this is something which I have not changed in the QEMU - maybe we need to do or does it even matter at QEMU level?).
This means the cpu remains registered, and user-space doesn't get notified that the CPU is no longer available. User-space can still try to enable the CPU, which will fail.
That is true and to fix this we could use the online-capable Bit instead of using the _STA.ENABLED Bit status as discussed in the 5th Oct LOD meeting. I have done those changes in the above branch [1].
Thanks Salil
I've not tried TCG mode yet.
Thanks,
James
On 17/10/2022 17:12, Salil Mehta via Linaro-open-discussions wrote:
Hi James, As discussed in the meeting below are the repositories which you might want
to have a look.
[1] Forward ported QEMU with some fixes was shared (by Salil) https://github.com/salil-mehta/qemu.git
virt-cpuhp-armv8/rfc-v1-port29092022
[2] James Approach with online-capable and present==possible (some fixes) https://github.com/salil-mehta/linux.git
virt-cpuhp-arm64/rfc-v2/jmorse-pres-eq-poss-cpu
[3] Variant of James approach with online-capable and conditionally present
cpus
https://github.com/salil-mehta/linux.git
virt-cpuhp-arm64/rfc-v2/jmorse-variant-with-cond-present-cpu
I have also shared the LOD presentation with Joyce for uploading to the site.
Attachment: [1] Linaro Open Discussion Meeting Update - 05102022 - Salil_Mehta-fixed.pdf
Many thanks Salil
-----Original Message----- From: Google Calendar [mailto:calendar-notification@google.com] On Behalf
Of
Joyce Qi via Linaro-open-discussions Sent: Wednesday, October 5, 2022 9:31 AM To: linaro-open-discussions@op-lists.linaro.org; james.morse@arm.com; Jonathan Cameron jonathan.cameron@huawei.com;
lorenzo.pieralisi@linaro.org;
ilkka@os.amperecomputing.com Subject: [Linaro-open-discussions] Invitation: Linaro Open Discussions
monthly
meeting @ Wed 5 Oct 2022 19:00 - 20:00 (HKT) (linaro-open-discussions@op-lists.linaro.org)
Linaro Open Discussions monthly meeting Wednesday 5 Oct 2022 ⋅ 19:00 – 20:00 Hong Kong Standard Time
https://www.google.com/url?q=https%3A%2F%2Flinaro-org.zoom.us%2Fj%2F9568250
0341&sa=D&source=calendar&usd=2&usg=AOvVaw2JDK9LgOcXl2WanQ86Y-6h
Joyce QI 邀请您参加预先安排的 Zoom 会议。
加入 Zoom 会议 https://linaro-org.zoom.us/j/95682500341
会议号:956 8250 0341 手机一键拨号 +16699009128,,95682500341# 美国 (San Jose) +13462487799,,95682500341# 美国 (Houston)
根据您的位置拨号 +1 669 900 9128 美国 (San Jose) +1 346 248 7799 美国 (Houston) +1 253 215 8782 美国 (Tacoma) +1 646 558 8656 美国 (New York) +1 301 715 8592 美国 (Washington DC) +1 312 626 6799 美国 (Chicago) 888 788 0099 美国 免费 877 853 5247 美国 免费 会议号:956 8250 0341 查找本地号码:https://linaro-org.zoom.us/u/ady2J9Zn7t
Guests linaro-open-discussions@op-lists.linaro.org james.morse@arm.com jonathan.cameron@huawei.com lorenzo.pieralisi@linaro.org ilkka@os.amperecomputing.com View all guest info
https://calendar.google.com/calendar/event?action=VIEW&eid=Mjg1MjNrNWtiM...
cGlsYW8zb2hwa3E5cWFfMjAyMjA5MjdUMTEwMDAwWiBsaW5hcm8tb3Blbi1kaXNjdXNzaW9uc0B
vcC1saXN0cy5saW5hcm8ub3Jn&tok=NTQjY184anE0dGh2ZTNuN3NlaThhMGpmazlwdXI3c0Bnc
m91cC5jYWxlbmRhci5nb29nbGUuY29tY2JlMDNmZTk3ZTYzMGMyN2ExZDE2N2QyYjcwOTYxMjNi
ODIwMjA0ZQ&ctz=Asia%2FHong_Kong&hl=en_GB&es=0
Reply for linaro-open-discussions@op-lists.linaro.org and view more details
https://calendar.google.com/calendar/event?action=VIEW&eid=Mjg1MjNrNWtiM...
cGlsYW8zb2hwa3E5cWFfMjAyMjA5MjdUMTEwMDAwWiBsaW5hcm8tb3Blbi1kaXNjdXNzaW9uc0B
vcC1saXN0cy5saW5hcm8ub3Jn&tok=NTQjY184anE0dGh2ZTNuN3NlaThhMGpmazlwdXI3c0Bnc
m91cC5jYWxlbmRhci5nb29nbGUuY29tY2JlMDNmZTk3ZTYzMGMyN2ExZDE2N2QyYjcwOTYxMjNi
ODIwMjA0ZQ&ctz=Asia%2FHong_Kong&hl=en_GB&es=0 Your attendance is optional.
~~//~~ Invitation from Google Calendar: https://calendar.google.com/calendar/
You are receiving this email because you are an attendee of the event. To stop receiving future updates for this event, decline this event.
Forwarding this invitation could allow any recipient to send a response to the organiser, be added to the guest list, invite others regardless of their own invitation status or modify your RSVP.
Learn more https://support.google.com/calendar/answer/37135#forwarding
Linaro-open-discussions mailing list -- linaro-open-discussions@op-lists.linaro.org https://collaborate.linaro.org/display/LOD/Linaro+Open+Discussions+Home