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

AMD SEV Debugswap #5594

Merged
merged 6 commits into from
Jul 4, 2024
Merged

AMD SEV Debugswap #5594

merged 6 commits into from
Jul 4, 2024

Conversation

aik
Copy link
Contributor

@aik aik commented Apr 24, 2024

This is to prevent #DB interception on AMD SEV-ES VM with enabled DebugSwap feature.

The goal of this pull request is CI check, attempt 4.

Copy link
Member

@ardbiesheuvel ardbiesheuvel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the typo in the patch title OvmfPkf->OvmfPkg. Also, there are two OvmfPkg patches with similar names that do different things, so please try to be more descriptive.

@aik
Copy link
Contributor Author

aik commented Jun 13, 2024

Please fix the typo in the patch title OvmfPkf->OvmfPkg. Also, there are two OvmfPkg patches with similar names that do different things, so please try to be more descriptive.

I'm fixing the typo but I cannot figure out better subject lines. Which two do you want to differ more? thanks,

Copy link
Member

@ardbiesheuvel ardbiesheuvel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind the titles - let's keep them as they are.

@kraxel
Copy link
Member

kraxel commented Jun 13, 2024

Looks good to me.

Note #1: this conflicts with another pending PR updating the AMD header files.

Note #2: I think @jyao1 should have a look at the PCD changes, whenever there are any concerns from TDX point of view (probably not), and whenever TDX has a simliar feature so it might make sense to define a common attr bit for that (maybe).

@ardbiesheuvel ardbiesheuvel requested review from mdkinney and lgao4 June 21, 2024 07:54
@ardbiesheuvel
Copy link
Member

@lgao4 @mdkinney @jyao1 any comments on this PR?

@aik
Copy link
Contributor Author

aik commented Jun 25, 2024

ping?

Copy link
Contributor

@lgao4 lgao4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in MdePkg looks good to me.

@ardbiesheuvel
Copy link
Member

@jyao1 @niruiyu Any thoughts? If not, I intend to merge this PR tomorrow.

@ardbiesheuvel ardbiesheuvel added the push Auto push patch series in PR if all checks pass label Jul 3, 2024
aik added 5 commits July 4, 2024 07:21
For now we need DebugSwap but others are likely to be needed too.

Cc: Liming Gao <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Zhiguang Liu <[email protected]>
Reviewed-by: Tom Lendacky <[email protected]>
Signed-off-by: Alexey Kardashevskiy <[email protected]>
Changes:
v5:
* "rb" from Tom

v4:
* added more from April/2024 APM
PcdConfidentialComputingGuestAttr so far only contained an SEV mode bit
but there are more other features which do not translate to levels
such as DebugVirtualization or SecureTsc.

Add the feature mask and the DebugVirtualization feature bit to the PCD.

Cc: Liming Gao <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Zhiguang Liu <[email protected]>
Reviewed-by: Tom Lendacky <[email protected]>
Signed-off-by: Alexey Kardashevskiy <[email protected]>
---
Changes:
v4:
* s/CCAttrFeatureAmdSevDebugSwap/CCAttrFeatureAmdSevEsDebugVirtualization/

v2:
* expanded features mask
* added type mask
The SEV-ES DebugVirtualization feature enables type B swapping of
debug registers on #VMEXIT and makes #DB and DR7 intercepts
unnecessary and unwanted.

When DebugVirtualization is enabled, this stops booting if
interaction from the HV.

Add new API to PEI, SEC, DXE.

This does not change the existing behaviour yet.

Cc: Ard Biesheuvel <[email protected]>
Cc: Erdem Aktas <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Michael Roth <[email protected]>
Cc: Min Xu <[email protected]>
Reviewed-by: Tom Lendacky <[email protected]>
Signed-off-by: Alexey Kardashevskiy <[email protected]>
---
Changes:
v5:
* "rb" from Tom

v4:
* s/DebugSwap/DebugVirtualization/
CONFIDENTIAL_COMPUTING_GUEST_ATTR is not a simple SEV level anymore
and includes a feature mask since the previous commit.

Fix AmdMemEncryptionAttrCheck to check the level and feature
correctly and add DebugVirtualization support.

Since the actual feature flag is not set yet, this should cause
no behavioural change.

Cc: Gerd Hoffmann <[email protected]>
Cc: Jiaxin Wu <[email protected]>
Cc: Rahul Kumar <[email protected]>
Cc: Ray Ni <[email protected]>
Reviewed-by: Tom Lendacky <[email protected]>
Signed-off-by: Alexey Kardashevskiy <[email protected]>
---
Changes:
v5:
* "rb" from Tom
Write the feature bit into PcdConfidentialComputingGuestAttr
and enable DebugVirtualization in PEI, SEC, DXE.

Cc: Ard Biesheuvel <[email protected]>
Cc: Erdem Aktas <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Michael Roth <[email protected]>
Cc: Min Xu <[email protected]>
Reviewed-by: Tom Lendacky <[email protected]>
Signed-off-by: Alexey Kardashevskiy <[email protected]>
---
Changes:
v5:
* "rb" from Tom

v4:
* s/DebugSwap/DebugVirtualization/g
@mergify mergify bot merged commit 2809966 into tianocore:master Jul 4, 2024
127 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
push Auto push patch series in PR if all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants