Skip to content

Commit 2f2eaf6

Browse files
committed
Add missing IDT entry #HV (vector 28)
Currently the InterruptDescriptorTable is missing entry with vector number 28, #HV. More information at AMD's APM Volume 2, subsection 8.2.21. See issue #377. Signed-off-by: Carlos Bilbao <[email protected]>
1 parent 0e53eef commit 2f2eaf6

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

src/structures/idt.rs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,25 @@ pub struct InterruptDescriptorTable {
340340
/// vector nr. 20
341341
pub virtualization: Entry<HandlerFunc>,
342342

343-
/// vector nr. 21-28
344-
reserved_2: [Entry<HandlerFunc>; 8],
343+
/// vector nr. 21-27
344+
reserved_2: [Entry<HandlerFunc>; 7],
345+
346+
/// The Hypervisor Injection Exception (`#HV`) is injected by a hypervisor
347+
/// as a doorbell to inform an `SEV-SNP` enabled guest running with the
348+
/// `Restricted Injection` feature of events to be processed.
349+
///
350+
/// `SEV-SNP` stands for the _"Secure Nested Paging"_ feature of the _"AMD
351+
/// Secure Encrypted Virtualization"_ technology. The `Restricted
352+
/// Injection` feature disables all hypervisor-based interrupt queuing
353+
/// and event injection of all vectors except #HV.
354+
///
355+
/// The `#HV` exception is a benign exception and can only be injected as
356+
/// an exception and without an error code. `SEV-SNP` enabled guests are
357+
/// expected to communicate with the hypervisor about events via a
358+
/// software-managed para-virtualization interface.
359+
///
360+
/// The vector number of the ``#HV`` exception is 28.
361+
pub hv_injection_exception: Entry<HandlerFunc>,
345362

346363
/// The VMM Communication Exception (`#VC`) is always generated by hardware when an `SEV-ES`
347364
/// enabled guest is running and an `NAE` event occurs.
@@ -436,7 +453,8 @@ impl InterruptDescriptorTable {
436453
machine_check: Entry::missing(),
437454
simd_floating_point: Entry::missing(),
438455
virtualization: Entry::missing(),
439-
reserved_2: [Entry::missing(); 8],
456+
reserved_2: [Entry::missing(); 7],
457+
hv_injection_exception: Entry::missing(),
440458
vmm_communication_exception: Entry::missing(),
441459
security_exception: Entry::missing(),
442460
reserved_3: Entry::missing(),

0 commit comments

Comments
 (0)