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

stage2: add TD Partitioning support #419

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Commits on Aug 23, 2024

  1. igvmbuilder: Insert a zero CPUID page for TDP platforms

    Since both the stage2 bootloader and the SVSM kernel dump the CPUID
    page, there needs to be a page present at the respective GPA on TDP
    platforms. Insert a normal zero page at the CPUID page location so that
    dump_cpuid_table() can work as expected.
    
    Signed-off-by: Peter Fang <[email protected]>
    peterfang committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    eef05c7 View commit details
    Browse the repository at this point in the history
  2. igvmbuilder: Insert a zero secrets page for TDP platforms

    Since the SVSM kernel touches the secrets page in svsm_start(), there
    needs to be a page present at the respective GPA on TDP platforms.
    Insert a normal zero page at the secrets page location so that the SVSM
    kernel can touch it without issues.
    
    Signed-off-by: Peter Fang <[email protected]>
    peterfang committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    1ca685d View commit details
    Browse the repository at this point in the history
  3. Cargo.toml: Clean up

    Clean up formatting and crate ordering.
    
    Signed-off-by: Peter Fang <[email protected]>
    peterfang committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    6ee8487 View commit details
    Browse the repository at this point in the history
  4. Cargo.toml: Add tdx-tdcall crate

    Add the tdx-tdcall crate in preparation for the upcoming TDX enabling
    changes.
    
    Signed-off-by: Peter Fang <[email protected]>
    peterfang committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    ed379fe View commit details
    Browse the repository at this point in the history
  5. stage1: Fix stage2 launch info size

    Stage2LaunchInfo has been increased to 48 bytes. Make the according
    changes in stage1 trampoline.
    
    Signed-off-by: Peter Fang <[email protected]>
    peterfang committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    a1e7391 View commit details
    Browse the repository at this point in the history
  6. stage1: Revert lds change

    Setting the initial location counter has no effect since all of the
    addresses before edata are derived based on the subsequent locations.
    
    Signed-off-by: Peter Fang <[email protected]>
    peterfang committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    bea3392 View commit details
    Browse the repository at this point in the history
  7. svsm_console: Add SvsmTdIOPort

    Add the TDX implementation of IOPort. This implementation translates all
    of the in/out operations to TDVMCALL operations as required by the GHCI
    spec.
    
    Signed-off-by: Peter Fang <[email protected]>
    peterfang committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    60076fa View commit details
    Browse the repository at this point in the history
  8. svsm_console: Rename SVSMIOPort to SvsmSevIOPort

    Rename struct SVSMIOPort for clarity and distinction from the TDX
    implementation.
    
    Signed-off-by: Peter Fang <[email protected]>
    peterfang committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    a50cd4f View commit details
    Browse the repository at this point in the history
  9. platform: tdp: Fix phys_addr_sizes

    phys_addr_sizes should be the entirety of CPUID leaf 0x80000008.EAX, not
    just the Physical Address Bits field.
    
    Signed-off-by: Peter Fang <[email protected]>
    peterfang committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    b03a387 View commit details
    Browse the repository at this point in the history
  10. platform: Add GPA to validate_page_range()

    validate_page_range() currently takes GVA due to the design of
    PVALIDATE. In the case of TDX, GPA is required for page acceptance.
    
    Add an additional input, paddr (PhysAddr), to validate_page_range(). An
    explicit input for GPA is required because virt_to_phys() is not always
    available. The input region may be out of range for the current
    FIXED_MAPPING.
    
    Signed-off-by: Peter Fang <[email protected]>
    peterfang committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    db49993 View commit details
    Browse the repository at this point in the history
  11. platform: tdp: Implement validate_page_range()

    On TDP platforms, validate_page_range() means page acceptance. Use the
    tdx-tdcall crate for this TDCALL operation.
    
    Signed-off-by: Peter Fang <[email protected]>
    peterfang committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    c70ec34 View commit details
    Browse the repository at this point in the history