Skip to content

Commit 9511992

Browse files
committed
x86: Secure Launch kernel late boot stub
The routine slaunch_setup() is called out of the x86 specific setup_arch() routine during early kernel boot. After determining what platform is present, various operations specific to that platform occur. This includes finalizing setting for the platform late launch and verifying that memory protections are in place. Intel VT-d/IOMMU hardware provides special registers called Protected Memory Regions (PMRs) that allow all memory to be protected from DMA during a TXT DRTM launch. This coverage is validated during the late setup process to ensure DMA protection is in place prior to the IOMMUs being initialized and configured by the mainline kernel. See the Intel Trusted Execution Technology - Measured Launch Environment Developer's Guide for more details: https://www.intel.com/content/dam/www/public/us/en/documents/guides/intel-txt-software-development-guide.pdf In addition this routine reserves key memory regions used by Secure Launch (e.g. the TXT heap, AP startup block etc) as well as fetching values needed later from the TXT heap and SLRT. Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com> Signed-off-by: Ross Philipson <ross.philipson@oracle.com>
1 parent 38a5fee commit 9511992

4 files changed

Lines changed: 517 additions & 0 deletions

File tree

arch/x86/kernel/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ obj-$(CONFIG_X86_32) += tls.o
8282
obj-$(CONFIG_IA32_EMULATION) += tls.o
8383
obj-y += step.o
8484
obj-$(CONFIG_INTEL_TXT) += tboot.o
85+
obj-$(CONFIG_SECURE_LAUNCH) += slaunch.o
8586
obj-$(CONFIG_ISA_DMA_API) += i8237.o
8687
obj-y += stacktrace.o
8788
obj-y += cpu/

arch/x86/kernel/setup.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/static_call.h>
2525
#include <linux/swiotlb.h>
2626
#include <linux/tboot.h>
27+
#include <linux/slaunch.h>
2728
#include <linux/usb/xhci-dbgp.h>
2829
#include <linux/vmalloc.h>
2930

@@ -1025,6 +1026,8 @@ void __init setup_arch(char **cmdline_p)
10251026
early_gart_iommu_check();
10261027
#endif
10271028

1029+
slaunch_setup();
1030+
10281031
/*
10291032
* partially used pages are not usable - thus
10301033
* we are rounding upwards:

0 commit comments

Comments
 (0)