|
3 | 3 |
|
4 | 4 | //! AMD SEV-SNP specific definitions.
|
5 | 5 |
|
| 6 | +use crate::ApicRegister; |
6 | 7 | use bitfield_struct::bitfield;
|
| 8 | +use static_assertions::const_assert_eq; |
7 | 9 | use zerocopy::FromBytes;
|
8 | 10 | use zerocopy::Immutable;
|
9 | 11 | use zerocopy::IntoBytes;
|
@@ -414,6 +416,52 @@ pub struct SevVmsa {
|
414 | 416 | pub ymm_registers: [SevXmmRegister; 16],
|
415 | 417 | }
|
416 | 418 |
|
| 419 | +#[repr(C)] |
| 420 | +#[derive(Debug, Clone, IntoBytes, Immutable, KnownLayout, FromBytes)] |
| 421 | +/// Structure representing the SEV-ES AVIC backing page. |
| 422 | +/// Specification: "AMD64 PPR Vol3 System Programming", 15.29.3 AVIC Backing Page. |
| 423 | +pub struct SevAvicPage { |
| 424 | + pub reserved_0: [ApicRegister; 2], |
| 425 | + pub id: ApicRegister, |
| 426 | + pub version: ApicRegister, |
| 427 | + pub reserved_4: [ApicRegister; 4], |
| 428 | + pub tpr: ApicRegister, |
| 429 | + pub apr: ApicRegister, |
| 430 | + pub ppr: ApicRegister, |
| 431 | + pub eoi: ApicRegister, |
| 432 | + pub rrd: ApicRegister, |
| 433 | + pub ldr: ApicRegister, |
| 434 | + pub dfr: ApicRegister, |
| 435 | + pub svr: ApicRegister, |
| 436 | + pub isr: [ApicRegister; 8], |
| 437 | + pub tmr: [ApicRegister; 8], |
| 438 | + pub irr: [ApicRegister; 8], |
| 439 | + pub esr: ApicRegister, |
| 440 | + pub reserved_29: [ApicRegister; 6], |
| 441 | + pub lvt_cmci: ApicRegister, |
| 442 | + pub icr: [ApicRegister; 2], |
| 443 | + pub lvt_timer: ApicRegister, |
| 444 | + pub lvt_thermal: ApicRegister, |
| 445 | + pub lvt_pmc: ApicRegister, |
| 446 | + pub lvt_lint0: ApicRegister, |
| 447 | + pub lvt_lint1: ApicRegister, |
| 448 | + pub lvt_error: ApicRegister, |
| 449 | + pub timer_icr: ApicRegister, |
| 450 | + pub timer_ccr: ApicRegister, |
| 451 | + pub reserved_3a: [ApicRegister; 4], |
| 452 | + pub timer_dcr: ApicRegister, |
| 453 | + pub self_ipi: ApicRegister, |
| 454 | + pub eafr: ApicRegister, |
| 455 | + pub eacr: ApicRegister, |
| 456 | + pub seoi: ApicRegister, |
| 457 | + pub reserved_44: [ApicRegister; 0x5], |
| 458 | + pub ier: [ApicRegister; 8], |
| 459 | + pub ei_lv_tr: [ApicRegister; 3], |
| 460 | + pub reserved_54: [ApicRegister; 0xad], |
| 461 | +} |
| 462 | + |
| 463 | +const_assert_eq!(size_of::<SevAvicPage>(), 4096); |
| 464 | + |
417 | 465 | // Info codes for the GHCB MSR protocol.
|
418 | 466 | open_enum::open_enum! {
|
419 | 467 | pub enum GhcbInfo: u64 {
|
|
0 commit comments