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

TEEs: Introduce kernel-confidential #8753

Merged
merged 5 commits into from Jan 10, 2024

Conversation

fidencio
Copy link
Member

In order to reduce the amount of artefacts we're shipping, let's try to introduce a single kernel and QEMU that would be capable of supporting SEV / SNP / TDX.

This series only introduce such artefacts, but those are not used yet.

We'll first have those ones built, and after that start testing it as part of the CI. This gives us time to solve the redness of the AMD CIs, and the switch to a new host side stack on the Intel CI, after folks are back from vacation.

@fidencio fidencio marked this pull request as draft December 29, 2023 11:30
@katacontainersbot katacontainersbot added the size/huge Largest and most complex task (probably needs breaking into small pieces) label Dec 29, 2023
@fidencio fidencio force-pushed the topic/add-confidential-artefacts branch from afa227f to 923e5bc Compare January 2, 2024 14:19
@fitzthum
Copy link
Contributor

fitzthum commented Jan 3, 2024

A few high-level notes.

First, SNP support is not upstream in QEMU yet. I think the most recent patches are here. So we will probably need to continue shipping SNP QEMU for a while.

Second, for SEV(-ES) to support attestation. we need a kernel module to be built into the rootfs. This is sort of related to this work because the kernel module has to be compatible with the guest kernel. In CCv0 we have this code to tell the rootfs builder about the kernel module. We assume that the module has already been built when we build the SEV kernel. In theory we can do something very similar with the generic kernel. I don't think this code for the module has made it into main yet. It might need to be added as part of @ryansavino's shim patch.

I can take a closer look at this shortly and test out the SEV components at some point.

@fidencio
Copy link
Member Author

fidencio commented Jan 7, 2024

So we will probably need to continue shipping SNP QEMU for a while.

I'll drop the QEMU part of this patch then. Thanks for letting me know!

@fidencio fidencio force-pushed the topic/add-confidential-artefacts branch from 923e5bc to 4d4f299 Compare January 9, 2024 00:15
@fidencio
Copy link
Member Author

fidencio commented Jan 9, 2024

@fitzthum, could you give it a try on this latest update?

In order to generate a rootfs in the same way you're used to do for SEV, please, apply also this patch (which is out of context of this series, but will come in a different one after this one gets merged).

⋊> kata-containers on topic/add-confidential-artefacts ≡ ⨯ git diff
diff --git a/tools/packaging/kata-deploy/local-build/Makefile b/tools/packaging/kata-deploy/local-build/Makefile
index 21ad3626d..5a863bc86 100644
--- a/tools/packaging/kata-deploy/local-build/Makefile
+++ b/tools/packaging/kata-deploy/local-build/Makefile
@@ -153,7 +153,7 @@ rootfs-image-tdx-tarball: kernel-tdx-experimental-tarball
 rootfs-initrd-mariner-tarball:
        ${MAKE} $@-build
 
-rootfs-initrd-sev-tarball: kernel-sev-tarball
+rootfs-initrd-sev-tarball: kernel-confidential-tarball
        ${MAKE} $@-build
 
 rootfs-initrd-tarball:

@fidencio fidencio changed the title TEEs: Introduce qemu-confidential and kernel-confidential TEEs: Introduce kernel-confidential Jan 9, 2024
@fidencio fidencio marked this pull request as ready for review January 9, 2024 00:26
@fidencio
Copy link
Member Author

fidencio commented Jan 9, 2024

/test

@fidencio fidencio force-pushed the topic/add-confidential-artefacts branch from 4d4f299 to ab2beb9 Compare January 9, 2024 13:59
Copy link
Member

@jepio jepio left a comment

Choose a reason for hiding this comment

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

i like where this is headed. lgtm

Copy link
Member

@stevenhorsman stevenhorsman left a comment

Choose a reason for hiding this comment

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

Just left some minor comments/suggestions, but otherwise it looks good. Thanks!

tools/packaging/kernel/build-kernel.sh Outdated Show resolved Hide resolved
tools/packaging/kernel/build-kernel.sh Outdated Show resolved Hide resolved
tools/packaging/kernel/build-kernel.sh Show resolved Hide resolved
Copy link
Member

@gkurz gkurz left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @fidencio !

fidencio and others added 5 commits January 9, 2024 14:35
We've not been building QEMU experimental for a very long time, and the
entry there has only been serving the purpose to clutter the
versions.yaml (in the best case scenario) or even confuse new
contributors to the project.

Mind that the machinery to build the QEMU experimental is not touched,
and that's used to build the TEEs capabale artefacts.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
As all the supported architectures are disabling the virtiofsd build,
there's no need to keep the switch statement there.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
We're using a Kernel based on v6.7, which should include all te
patches needed for SEV / SNP / TDX.

By doing this, later on, we'll be able to stop building the specific
kernel for each one of the targets we have for the TEEs.

Let's note that we've introduced the "confidential" target for the
kernel builder script, while the TEE specific builds are being kept as
they're -- at least for now.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
SSIA. :-)

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
@fidencio fidencio force-pushed the topic/add-confidential-artefacts branch from ab2beb9 to c3f6eaa Compare January 9, 2024 17:36
@katacontainersbot katacontainersbot added the size/medium Average sized task label Jan 9, 2024
@katacontainersbot katacontainersbot removed the size/huge Largest and most complex task (probably needs breaking into small pieces) label Jan 9, 2024
@fidencio
Copy link
Member Author

fidencio commented Jan 9, 2024

I've got all your comments addressed, thanks a lot for your review!

@fidencio
Copy link
Member Author

fidencio commented Jan 9, 2024

/test

@gkurz gkurz merged commit 0c37aec into kata-containers:main Jan 10, 2024
171 of 241 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test size/medium Average sized task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants