@@ -341,7 +341,36 @@ pub struct InterruptDescriptorTable {
341
341
pub virtualization : Entry < HandlerFunc > ,
342
342
343
343
/// vector nr. 21-29
344
- reserved_2 : [ Entry < HandlerFunc > ; 9 ] ,
344
+ reserved_2 : [ Entry < HandlerFunc > ; 8 ] ,
345
+
346
+ /// The VMM Communication Exception (`#VC`) is always generated by hardware when an `SEV-ES`
347
+ /// enabled guest is running and an `NAE` event occurs.
348
+ ///
349
+ /// `SEV-ES` stands for the _"Encrypted State"_ feature of the _"AMD Secure Encrypted Virtualization"_
350
+ /// technology. `NAE` stands for an _"Non-Automatic Exit"_, which is an `VMEXIT` event that requires
351
+ /// hypervisor emulation. See
352
+ /// [this whitepaper](https://www.amd.com/system/files/TechDocs/Protecting%20VM%20Register%20State%20with%20SEV-ES.pdf)
353
+ /// for an overview of the `SEV-ES` feature.
354
+ ///
355
+ /// The `#VC` exception is a precise, contributory, fault-type exception utilizing exception vector 29.
356
+ /// This exception cannot be masked. The error code of the `#VC` exception is equal
357
+ /// to the `#VMEXIT` code of the event that caused the `NAE`.
358
+ ///
359
+ /// In response to a `#VC` exception, a typical flow would involve the guest handler inspecting the error
360
+ /// code to determine the cause of the exception and deciding what register state must be copied to the
361
+ /// `GHCB` (_"Guest Hypervisor Communication Block"_) for the event to be handled. The handler
362
+ /// should then execute the `VMGEXIT` instruction to
363
+ /// create an `AE` and invoke the hypervisor. After a later `VMRUN`, guest execution will resume after the
364
+ /// `VMGEXIT` instruction where the handler can view the results from the hypervisor and copy state from
365
+ /// the `GHCB` back to its internal state as needed.
366
+ ///
367
+ /// Note that it is inadvisable for the hypervisor to set the `VMCB` (_"Virtual Machine Control Block"_)
368
+ /// intercept bit for the `#VC` exception as
369
+ /// this would prevent proper handling of `NAE`s by the guest. Similarly, the hypervisor should avoid
370
+ /// setting intercept bits for events that would occur in the `#VC` handler (such as `IRET`).
371
+ ///
372
+ /// The vector number of the ``#VC`` exception is 29.
373
+ pub vmm_communication_exception : Entry < HandlerFuncWithErrCode > ,
345
374
346
375
/// The Security Exception (`#SX`) signals security-sensitive events that occur while
347
376
/// executing the VMM, in the form of an exception so that the VMM may take appropriate
@@ -407,7 +436,8 @@ impl InterruptDescriptorTable {
407
436
machine_check: Entry :: missing( ) ,
408
437
simd_floating_point: Entry :: missing( ) ,
409
438
virtualization: Entry :: missing( ) ,
410
- reserved_2: [ Entry :: missing( ) ; 9 ] ,
439
+ reserved_2: [ Entry :: missing( ) ; 8 ] ,
440
+ vmm_communication_exception: Entry :: missing( ) ,
411
441
security_exception: Entry :: missing( ) ,
412
442
reserved_3: Entry :: missing( ) ,
413
443
interrupts: [ Entry :: missing( ) ; 256 - 32 ] ,
0 commit comments