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 patches for Intel TXT support #1

Open
wants to merge 70 commits into
base: main
Choose a base branch
from
Open

Conversation

TomaszAIR
Copy link

@TomaszAIR TomaszAIR commented Dec 5, 2022

Set of patches which adds Intel TXT support in Xen for TrenchBoot.

This is necessary to create Proof of Concept for TrenchBoot Anti Evil
Maid for QubesOS.

Due to the requirements of Intel TXT and how it is utilised, it is
impossible to use the Xen boot protocols defined in the UEFI or
Multiboot2 specifications. Those patches creates a custom Intel TXT
entry point for Xen which would hand-off to the standard Multiboot2
entry point and enable direct launch of Xen by GRUB via DRTM on Intel
hardware. Additionally there was no support for launching Xen with Intel
TXT other than Trusted Boot. Certain parts had to be ported from
Trusted Boot specific code to Xen native code:

  • constructing MLE header
  • waking up APs
  • restoring MTRRs
  • reserving the TXT memory
  • reenabling SMIs
  • handling TXT shutdown and S3 resume/suspend
  • TPM event log finding

See: https://lists.xenproject.org/archives/html/xen-devel/2022-10/msg01663.html
for details

Signed-off-by: Tomasz Żyjewski [email protected]

@TomaszAIR TomaszAIR force-pushed the inteltxt-support branch 5 times, most recently from 5adc968 to 0ab3116 Compare April 25, 2023 11:53
Drop patches included upstream already, update context of some existing
patches.
Include also XSA-431 patch that was published after 4.17.1 release.
Backport serial console fix, and a build fix with GCC 13 (relevant for
Archlinux).
It isn't used anymore, VMs use distribution-native Xen packages fully.
Replace custom patch with proper upstream implementation.
Microcode update is available only for some models at this moment, so
include the workaround patch too to cover remaining models.
And drop those already included upstream.
Temporarily use a git snapshot, until upstream provides proper tarballs.
They may grow quite big in some cases, and are very compressible.
This adds some basic support but even if working as intended this
doesn't reach satisfactory residency values yet. And more importantly in
Qubes' default configuration common devices (at least Intel integrated
USB and Thunderbolt) need more work to not completely block residency.
Some of them were already backported, but there are few more relevant
fixes. This may also ease applying future patches.
The signing key still uses SHA1, which is rejected by sequoia-sq. Switch
to hash file until the key is updated.
* origin/main:
  Temporarily switch to a hash file for download verification
The patches are conflicting (contextually and semantically) with
1017-Disable-TSX-by-default.patch so drop the latter.
Go back to signatures, as builderv2 was modified to tolerate older keys
too.
This reverts commit 606f99a.
Remove patches included upstream.
See patch description for details.

Fixes QubesOS/qubes-issues#9030
* origin/pr/167:
  Basic S0ix support
@SergiiDmytruk SergiiDmytruk force-pushed the inteltxt-support branch 2 times, most recently from fbe20ec to 8e209dc Compare May 12, 2024 21:44
marmarek and others added 13 commits May 20, 2024 04:09
Remove bin86 and dev86 needed only for hypervisor build (not applicable
here).
Remove yajl as already listed in depends.
Add python-setuptools.
/var/log/xen needs to be owned by the package, otherwise xendriverdomain
service fails to start.
Remove no longer needed deps - we don't build stubdomain in this package
anymore.
* build-deps:
  Fix Arch build on conflicting _FORTIFY_SOURCE values
  rpm: cleanup build dependencies
Add patches fixing XHCI DbC console when sys-usb is running.
Technically not a backport yet, but this version is very close to beeing
committed upstream so should qualify as a backport soon.
Signed-off-by: Tomasz Żyjewski <[email protected]>
Signed-off-by: Sergii Dmytruk <[email protected]>
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.

4 participants