Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vCPU state reset upon AP_CREATION #378

Open
mmisono opened this issue Jun 10, 2024 · 1 comment
Open

vCPU state reset upon AP_CREATION #378

mmisono opened this issue Jun 10, 2024 · 1 comment

Comments

@mmisono
Copy link

mmisono commented Jun 10, 2024

Hi

Currently the KVM resets a vCPU state upon AP_CREATION VMGEXIT via KVM_REQ_UPDATE_PROTECTED_GUEST_STATE request. The vCPU reset includes the lapic reset.

I found that this causes an issue regarding interrupts when creating another VMPL with AP_CREATION. For example, we think of a scenario where SVSM provides an interface to run code in VMPL3.

  • SVSM start Linux in VMPL2
  • Linux configure lapic
  • Later, Linux makes some SVSM call, and in the handler SVSM creates VMPL3 and run some code there with AP_CREATION. This AP_CREATION resets lapic states
  • After execution of VMPL3 code, SVSM return Linux with VMPL2 with VMPL_RUN
  • As the LAPIC setting is gone, linux won't get any interrupts after that, resulting in a stuck

I was wondering if the current vCPU reset is as intended. If so, what would be the correct way to manage interrupts when using multiple VMPL levels?

@tlendacky
Copy link
Contributor

The current hypervisor support is proof-of-concept type code and has its limitations as you've seen. Eventually the idea is to provide an APIC emulation level per VMPL, which would hopefully solve the issue that you are seeing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants