44#include <defs.h>
55#include <types.h>
66
7+ /* SLR defined bootloaders */
8+ #define SLR_BOOTLOADER_INVALID 0
9+ #define SLR_BOOTLOADER_GRUB 1
10+
11+ /* Log formats */
12+ #define SLR_DRTM_TPM12_LOG 1
13+ #define SLR_DRTM_TPM20_LOG 2
14+
15+ /* Array Lengths */
16+ #define TPM_EVENT_INFO_LENGTH 32
17+
18+ /* Tags */
19+ #define SLR_ENTRY_INVALID 0x0000
20+ #define SLR_ENTRY_DL_INFO 0x0001
21+ #define SLR_ENTRY_LOG_INFO 0x0002
22+ #define SLR_ENTRY_ENTRY_POLICY 0x0003
23+ #define SLR_ENTRY_INTEL_INFO 0x0004
24+ #define SLR_ENTRY_AMD_INFO 0x0005
25+ #define SLR_ENTRY_ARM_INFO 0x0006
26+ #define SLR_ENTRY_UEFI_INFO 0x0007
27+ #define SLR_ENTRY_UEFI_CONFIG 0x0008
28+ #define SLR_ENTRY_END 0xffff
29+
30+ /*
31+ * Common SLRT Table Header
32+ */
733struct slr_entry_hdr {
834 u16 tag ;
935 u16 size ;
1036} __packed ;
1137
12- #define SLR_ENTRY_INVALID 0x0000
13- #define SLR_ENTRY_DL_INFO 0x0001
14- #define SLR_ENTRY_LOG_INFO 0x0002
15- #define SLR_ENTRY_DRTM_POLICY 0x0003
16- #define SLR_ENTRY_INTEL_INFO 0x0004
17- #define SLR_ENTRY_AMD_INFO 0x0005
18- #define SLR_ENTRY_ARM_INFO 0x0006
19- #define SLR_ENTRY_UEFI_INFO 0x0007
20- #define SLR_ENTRY_UEFI_CONFIG 0x0008
21- #define SLR_ENTRY_END 0xffff
22-
38+ /*
39+ * Primary Secure Launch Resource Table Header
40+ */
2341struct slr_table {
2442 u32 magic ;
2543 u16 revision ;
@@ -30,74 +48,41 @@ struct slr_table {
3048 struct slr_entry_hdr entries [];
3149} __packed ;
3250
51+ /*
52+ * Boot loader context
53+ */
3354struct slr_bl_context {
3455 u16 bootloader ;
35- u16 reserved ;
56+ u16 reserved [ 3 ] ;
3657 u64 context ;
3758} __packed ;
3859
39- #define SLR_BOOTLOADER_GRUB 1
40-
60+ /*
61+ * DRTM Dynamic Launch Configuration
62+ */
4163struct slr_entry_dl_info {
4264 struct slr_entry_hdr hdr ;
43- struct slr_bl_context bl_context ;
44- u64 dl_handler ;
45- u64 dce_base ;
4665 u32 dce_size ;
66+ u64 dce_base ;
67+ u64 dlme_size ;
4768 u64 dlme_base ;
48- u32 dlme_size ;
49- u32 dlme_entry ; /* Offset from dlme_base */
69+ u64 dlme_entry ; /* Offset from dlme_base */
70+ struct slr_bl_context bl_context ;
71+ u64 dl_handler ;
5072} __packed ;
5173
74+ /*
75+ * TPM Log Information
76+ */
5277struct slr_entry_log_info {
5378 struct slr_entry_hdr hdr ;
5479 u16 format ;
55- u16 reserved ;
56- u64 addr ;
80+ u16 reserved [3 ];
5781 u32 size ;
82+ u64 addr ;
5883} __packed ;
5984
60- #define SLR_LOG_FORMAT_TPM12_TXT 1
61- #define SLR_LOG_FORMAT_TPM20_TCG 2
62-
63- #define TPM_EVENT_INFO_LENGTH 20
64-
65- struct slr_policy_entry {
66- u16 pcr ;
67- u16 entity_type ;
68- u16 flags ;
69- u16 reserved ;
70- u64 entity ;
71- u64 size ;
72- char evt_info [TPM_EVENT_INFO_LENGTH ];
73- } __packed ;
74-
75- /* Constants for entity_type */
76- #define SLR_ET_UNSPECIFIED 0x0000
77- #define SLR_ET_SLRT 0x0001
78- #define SLR_ET_LINUX_BOOT_PARAMS 0x0002
79- #define SLR_ET_LINUX_SETUP_DATA 0x0003
80- #define SLR_ET_CMDLINE 0x0004
81- #define SLR_ET_UEFI_MEMMAP 0x0005
82- #define SLR_ET_RAMDISK 0x0006
83- #define SLR_ET_MULTIBOOT2_INFO 0x0007
84- #define SLR_ET_MULTIBOOT2_MODULE 0x0008
85- // values 0x0009-0x000f reserved for future use
86- // TXT-specific:
87- #define SLR_ET_TXT_OS2MLE 0x0010
88- #define SLR_ET_UNUSED 0xffff
89-
90- /* Constants for flags */
91- #define SLR_POLICY_FLAG_MEASURED 0x1
92- #define SLR_POLICY_IMPLICIT_SIZE 0x2
93-
94- struct slr_entry_policy {
95- struct slr_entry_hdr hdr ;
96- u16 revision ;
97- u16 nr_entries ;
98- struct slr_policy_entry policy_entries [];
99- } __packed ;
100-
85+ /* Secure Kernel Loader */
10186extern struct slr_table bootloader_data ;
10287
10388static inline void * end_of_slrt (void )
0 commit comments