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 8 commits into
base: main
Choose a base branch
from

Conversation

peterfang
Copy link
Contributor

This is the second half of the TDX enabling work in stage2. It enables SVSM running on a TDP platform to boot until the last jump in stage2_main(). It also adds support for serial console.

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 <peter.fang@intel.com>
Clean up formatting and crate ordering.

Signed-off-by: Peter Fang <peter.fang@intel.com>
Add the tdx-tdcall crate in preparation for the upcoming TDX enabling
changes.

Signed-off-by: Peter Fang <peter.fang@intel.com>
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 <peter.fang@intel.com>
Rename struct SVSMIOPort for clarity and distinction from the TDX
implementation.

Signed-off-by: Peter Fang <peter.fang@intel.com>
phys_addr_sizes should be the entirety of CPUID leaf 0x80000008.EAX, not
just the Physical Address Bits field.

Signed-off-by: Peter Fang <peter.fang@intel.com>
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
KERNEL_MAPPING.

Signed-off-by: Peter Fang <peter.fang@intel.com>
On TDP platforms, validate_page_range() means page acceptance. Use the
tdx-tdcall crate for this TDCALL operation.

Signed-off-by: Peter Fang <peter.fang@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant