-
Notifications
You must be signed in to change notification settings - Fork 158
NMI for CVM in OpenHCL #2049
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
NMI for CVM in OpenHCL #2049
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,6 +103,7 @@ use user_driver::DmaClient; | |
| use virt::IsolationType; | ||
| use virt::PartitionCapabilities; | ||
| use virt::VpIndex; | ||
| use virt::X86Partition; | ||
| use virt::irqcon::IoApicRouting; | ||
| use virt::irqcon::MsiRequest; | ||
| use virt::x86::apic_software_device::ApicSoftwareDevices; | ||
|
|
@@ -844,7 +845,7 @@ impl virt::Partition for UhPartition { | |
| } | ||
| } | ||
|
|
||
| impl virt::X86Partition for UhPartition { | ||
| impl X86Partition for UhPartition { | ||
| fn ioapic_routing(&self) -> Arc<dyn IoApicRouting> { | ||
| self.inner.clone() | ||
| } | ||
|
|
@@ -1929,6 +1930,22 @@ impl UhPartition { | |
| } | ||
| } | ||
|
|
||
| /// Trigger the LINT1 interrupt vector on the LAPIC of the BSP. | ||
| pub fn assert_debug_interrupt(&self, _vtl: u8) { | ||
| #[cfg(guest_arch = "x86_64")] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What should happen here for non-x86? #Resolved There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The NMI is triggered by the hypervisor in that case, there is no GET request. We would likely extend this to ARM in the future for ARM CVMs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we trace a warning or something? Or cfg out this whole function, and the block in underhill_core that wires it up? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm also not a huge fan of having a variable named with a leading _ that actually does get used. Tracing a warning would fix that. |
||
| const LINT_INDEX_1: u8 = 1; | ||
| #[cfg(guest_arch = "x86_64")] | ||
| match self.inner.isolation { | ||
| IsolationType::Snp => { | ||
| tracing::error!(?_vtl, "Debug interrupts cannot be injected into SNP VMs",); | ||
| } | ||
| _ => { | ||
| let bsp_index = VpIndex::new(0); | ||
| self.pulse_lint(bsp_index, Vtl::try_from(_vtl).unwrap(), LINT_INDEX_1) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /// Enables or disables the PM timer assist. | ||
| pub fn set_pm_timer_assist(&self, port: Option<u16>) -> Result<(), HvError> { | ||
| self.inner.hcl.set_pm_timer_assist(port) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.