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

Changes/fixes on top of v11 AMD patches for non-PSP case #138

Draft
wants to merge 12 commits into
base: linux-sl-master-9-12-24-v11-amd
Choose a base branch
from

Conversation

SergiiDmytruk
Copy link
Member

Most of the commits are meant to be squashed into other commits on the base branch later on.

When the inner for loop doesn't break upon finding a matching algorithm,
it:
 - finds SHA1 ID and updates `alg_id_field` but not `dptr`
 - finds SHA256 ID and copies SHA1 and bytes that follow it as SHA256
 - exits and outer loop gets to run again with `alg_id_field` pointing
   past the list of digests, this time likely doing nothing, leading to
   a PCR being extended with a semi-random hash

Breaking isn't enough on its own because then alg_id_field might end up
not being moved if corresponding TPM bank is off, so instead advance the
pointer outside of the inner loop.

Signed-off-by: Sergii Dmytruk <[email protected]>
Copy link
Member

@krystian-hebel krystian-hebel left a comment

Choose a reason for hiding this comment

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

It took me a while to wrap my head around how slr_entry_amd_info gets located. Normally container_of() macro is used for such things, but I guess it doesn't help when remapping is involved.

@@ -3348,16 +3348,14 @@ int __init amd_iommu_enable(void)
if (ret)
return ret;

#if IS_ENABLED(CONFIG_SECURE_LAUNCH)
Copy link
Member

Choose a reason for hiding this comment

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

Why is this removed? Won't it cause build failures with this option disabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed the check as unnecessary, seems to build fine without slaunch. Since in coreboot this kind of changes is used to reduce number of places where things are compiled conditionally, I thought Linux likely does the same and grepping seemed to confirm that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes it causes 32b builds to fail (SL is only meant to be build at 64b). Earlier per Ard's request I changed this to use if () instead of #if () and the autobuilder for Linux reported an error. So we agreed to switch it back. Patch set v9 or v10 I think had the change in it.

Copy link
Member Author

Choose a reason for hiding this comment

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

include/linux/slaunch.h Show resolved Hide resolved
@krystian-hebel
Copy link
Member

One more thing that was missed in target branch: Kconfig description of CONFIG_SECURE_LAUNCH mentions only Intel, it should be extended to include AMD as well.

@SergiiDmytruk
Copy link
Member Author

One more thing that was missed in target branch: Kconfig description of CONFIG_SECURE_LAUNCH mentions only Intel, it should be extended to include AMD as well.

c859335

@SergiiDmytruk SergiiDmytruk force-pushed the linux-sl-master-9-12-24-v11-amd-no-psp branch from 2571717 to 63ed6bb Compare December 9, 2024 19:33
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.

3 participants