* [edk2-devel] Move X2APIC enablement from Pei to Sec phase
@ 2025-04-20 1:31 Wang, Huibo via groups.io
2025-04-22 9:13 ` Ard Biesheuvel via groups.io
0 siblings, 1 reply; 2+ messages in thread
From: Wang, Huibo via groups.io @ 2025-04-20 1:31 UTC (permalink / raw)
To: devel@edk2.groups.io
Cc: Lendacky, Thomas, Ard Biesheuvel, Jiewen Yao, Gerd Hoffmann,
Erdem Aktas, Min Xu, Roth, Michael, Ray Ni, Jiaxin Wu,
Zhiguang Liu, Dun Tan, Rahul Kumar, Star Zeng
[-- Attachment #1: Type: text/plain, Size: 2227 bytes --]
[AMD Official Use Only - AMD Internal Distribution Only]
Hi,
I am currently working on enabling Alternate Injection for AMD SEV-SNP guests and have encountered a design issue.
The Alternate Injection specification, which is still preliminary, defines a so-called SVSM APIC protocol through a subset
of X2APIC MSRs while timer support is configurable.
[ This means, if timer functionality is not supported, the guest must rely on the hypervisor to emulate timer
support through use of the #HV Timer GHCB protocol. ]
When the OVMF firmware starts, it is in XAPIC mode by default and then, later, during the init phase it switches the guest to X2APIC.
However, with Alternate Injection enabled, the OVMF in its very first phase - SEC - does XAPIC accesses.
The SVSM, however, which is part of the guest, uses the so-called SVSM APIC protocol which uses a subset of the X2APIC MSRs.
The OVMF, however, assumes it starts off in XAPIC memory-mapped mode and thus there's a protocol mismatch of sorts
because with Alternate Injection already enabled in the SEC phase, it mandates X2APIC MSR accesses.
The registers (timer registers) when not handled by SVSM will get routed to the hypervisor (KVM) which at that point is operating the guest
in XAPIC mode until the PEI phase switches to X2APIC.
If X2APIC enablement is moved from the PEI to the SEC phase, the problem can be resolved. I have tested it and it works.
However, I dont know if there is any concern or potential design issues with that move.
Do folks think this is ok to do - i.e., move the X2APIC enablement to the SEC phase?
Or do you have any suggestions for a better solution?
Please feel free to ask questions if some concepts are unclear and I'll gladly expand on them.
I am new to this, sorry If I have CCed too many people.
Thanks,
Melody
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121279): https://edk2.groups.io/g/devel/message/121279
Mute This Topic: https://groups.io/mt/112386836/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 5834 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [edk2-devel] Move X2APIC enablement from Pei to Sec phase
2025-04-20 1:31 [edk2-devel] Move X2APIC enablement from Pei to Sec phase Wang, Huibo via groups.io
@ 2025-04-22 9:13 ` Ard Biesheuvel via groups.io
0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel via groups.io @ 2025-04-22 9:13 UTC (permalink / raw)
To: Wang, Huibo
Cc: devel@edk2.groups.io, Lendacky, Thomas, Ard Biesheuvel,
Jiewen Yao, Gerd Hoffmann, Erdem Aktas, Min Xu, Roth, Michael,
Ray Ni, Jiaxin Wu, Zhiguang Liu, Dun Tan, Rahul Kumar, Star Zeng
On Sun, 20 Apr 2025 at 03:31, Wang, Huibo <Huibo.Wang@amd.com> wrote:
>
> [AMD Official Use Only - AMD Internal Distribution Only]
>
This email header makes no sense when sending emails to a public mailing list.
If you are looking for the input of non-AMD employees, please resend
this email without a header that legally precludes them from
responding. If you are looking for the input of AMD employees only,
please use an internal mailing list.
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121281): https://edk2.groups.io/g/devel/message/121281
Mute This Topic: https://groups.io/mt/112386836/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-22 9:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-20 1:31 [edk2-devel] Move X2APIC enablement from Pei to Sec phase Wang, Huibo via groups.io
2025-04-22 9:13 ` Ard Biesheuvel via groups.io
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox