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

grub-core/loader/i386/txt/txt.c: Use MAXPHYADDR in MTRR masks #23

Open
wants to merge 2 commits into
base: intel-txt-aem-2.06
Choose a base branch
from

Conversation

miczyg1
Copy link

@miczyg1 miczyg1 commented Aug 17, 2024

Based on Intel TXT MLE Developer Guide revision 017.4 Table 4 the SINIT capabilities bit 8 indicates whether fixed 36bit masks or MAXPHYADDR masks are to be used in MTRR calculations. Failing to adhere to it may lead to creation of potentially disjoint WB cache ranges and violation of CRAM protections - according to the document.

@krystian-hebel
Copy link
Member

This shouldn't make a difference with current Xen implementation, in https://github.com/TrenchBoot/xen/blob/aem-4.17.4/xen/arch/x86/boot/head.S#L131 36-bit is selected, and according to Table 5. Truth Table of SINIT / MLE functionality of TXT SDG (Revision 017.4) it takes precedence. To make it work, we should also set this bit in Xen, but currently there are too many branches that would require this change.

@krystian-hebel krystian-hebel deleted the branch intel-txt-aem-2.06 August 26, 2024 11:55
@krystian-hebel krystian-hebel changed the base branch from intel-txt-aem-2.06-rebased to intel-txt-aem-2.06 August 26, 2024 12:04
@miczyg1
Copy link
Author

miczyg1 commented Sep 5, 2024

This shouldn't make a difference with current Xen implementation, in https://github.com/TrenchBoot/xen/blob/aem-4.17.4/xen/arch/x86/boot/head.S#L131 36-bit is selected, and according to Table 5. Truth Table of SINIT / MLE functionality of TXT SDG (Revision 017.4) it takes precedence. To make it work, we should also set this bit in Xen, but currently there are too many branches that would require this change.

Yes, but then you end up with mixed MTRRs masks on a core. Some of them have MAXPHYADDR masks and some of them have 36bit masks... That's what I observed on VP6670

Based on Intel TXT MLE Developer Guide revision 017.4 Table 4
the SINIT capabilities bit 8 indicates whether fixed 36bit masks
or MAXPHYADDR masks are to be used in MTRR calculations. Failing
to adhere to it may lead to creation of potentially disjoint WB
cache ranges and violation of CRAM protections - according to the
document.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
CBnT requires the auth PCR usage and no legacy PCR usage as per
TXT MLE Software Development Guide revision 017.4.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.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.

2 participants