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

Add new TDCALL functions to support TD partitioning #714

Merged
merged 7 commits into from
Jun 20, 2024

Conversation

vijaydhanraj
Copy link
Contributor

Fixes: #707

Added the following TDCALL support as part of this PR.

  • Wrapper to tdcall_accept_page to accept a memory range (for both normal 4K as well as 2M large pages).
  • Add tdcall_vm_read/write to access TD-scope meta field of a TD.
  • Add tdcall_vp_read/write is to access vCPU-scope meta field of a TD.
  • Add tdcall_vp_invept/invvpid to provide SEPT flushing support.
  • Add tdcall_vp_enter support.
  • Add tdcall to support memory attribute write.

TD page accept call can fail sometimes with
`TDX_OPERAND_BUSY` error code, in such cases simply
retry the operation.

Signed-off-by: Jason Chen CJ <[email protected]>
Signed-off-by: Vijay Dhanraj <[email protected]>
This is a precursor to introducing `td_accept_memory` which
will accept both normal 4K pages as well as 2M huge pages.

No functional change is introduced.

Signed-off-by: Vijay Dhanraj <[email protected]>
This commit introduces `td_accept_memory` to accept a range of either
4K normal pages or 2M huge pages. This is basically a helper function
which is wrapped around `td_accept_pages` and initializes the pages
to zero using the TD ephemeral private key.

Signed-off-by: Peter Fang <[email protected]>
Signed-off-by: Vijay Dhanraj <[email protected]>
tdcall_vm_read/write is to access TD-scope meta field of a TD and
tdcall_vp_read/write is to access vCPU-scope meta field of a TD.

Signed-off-by: Jason Chen CJ <[email protected]>
Signed-off-by: Chuanxiao Dong <[email protected]>
Signed-off-by: Vijay Dhanraj <[email protected]>
Add tdcall_vp_invept/invvpid to provide SEPT flushing support

Signed-off-by: Jason Chen CJ <[email protected]>
Signed-off-by: Vijay Dhanraj <[email protected]>
Current asm_td_call implementation immediately returns on exit
without saving guest vmexit reasons. Extend asm_td_call to save
the guest vmexit reasons as part of RAX and also introduce
`tdcall_vp_enter` interface to enter TDP guest.

Signed-off-by: Jason Chen CJ <[email protected]>
Signed-off-by: Vijay Dhanraj <[email protected]>
Add `tdcall_mem_page_attr_wr` interface to write memory attributes
of a private page. It is also used to create or remove L2 page
aliases as required.

Signed-off-by: Chuanxiao Dong <[email protected]>
Signed-off-by: Vijay Dhanraj <[email protected]>
@jyao1 jyao1 closed this Jun 20, 2024
@jyao1 jyao1 reopened this Jun 20, 2024
@jyao1 jyao1 merged commit 573b6f8 into confidential-containers:main Jun 20, 2024
35 of 36 checks passed
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.

Add new TDCALL functions to support TD partitioning
2 participants