aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/tboot.h
diff options
context:
space:
mode:
authorJoseph Cihula <joseph.cihula@intel.com>2009-06-30 22:30:59 -0400
committerH. Peter Anvin <hpa@zytor.com>2009-07-21 14:49:06 -0400
commit3162534069597e34dd0ac9eb711be8dc23835ae7 (patch)
treea8cddd3899917784ebac2cdf6c75d2c8b50d04af /arch/x86/include/asm/tboot.h
parentaea1f7964ae6cba5eb419a958956deb9016b3341 (diff)
x86, intel_txt: Intel TXT boot support
This patch adds kernel configuration and boot support for Intel Trusted Execution Technology (Intel TXT). Intel's technology for safer computing, Intel Trusted Execution Technology (Intel TXT), defines platform-level enhancements that provide the building blocks for creating trusted platforms. Intel TXT was formerly known by the code name LaGrande Technology (LT). Intel TXT in Brief: o Provides dynamic root of trust for measurement (DRTM) o Data protection in case of improper shutdown o Measurement and verification of launched environment Intel TXT is part of the vPro(TM) brand and is also available some non-vPro systems. It is currently available on desktop systems based on the Q35, X38, Q45, and Q43 Express chipsets (e.g. Dell Optiplex 755, HP dc7800, etc.) and mobile systems based on the GM45, PM45, and GS45 Express chipsets. For more information, see http://www.intel.com/technology/security/. This site also has a link to the Intel TXT MLE Developers Manual, which has been updated for the new released platforms. A much more complete description of how these patches support TXT, how to configure a system for it, etc. is in the Documentation/intel_txt.txt file in this patch. This patch provides the TXT support routines for complete functionality, documentation for TXT support and for the changes to the boot_params structure, and boot detection of a TXT launch. Attempts to shutdown (reboot, Sx) the system will result in platform resets; subsequent patches will support these shutdown modes properly. Documentation/intel_txt.txt | 210 +++++++++++++++++++++ Documentation/x86/zero-page.txt | 1 arch/x86/include/asm/bootparam.h | 3 arch/x86/include/asm/fixmap.h | 3 arch/x86/include/asm/tboot.h | 197 ++++++++++++++++++++ arch/x86/kernel/Makefile | 1 arch/x86/kernel/setup.c | 4 arch/x86/kernel/tboot.c | 379 +++++++++++++++++++++++++++++++++++++++ security/Kconfig | 30 +++ 9 files changed, 827 insertions(+), 1 deletion(-) Signed-off-by: Joseph Cihula <joseph.cihula@intel.com> Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Gang Wei <gang.wei@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/include/asm/tboot.h')
-rw-r--r--arch/x86/include/asm/tboot.h197
1 files changed, 197 insertions, 0 deletions
diff --git a/arch/x86/include/asm/tboot.h b/arch/x86/include/asm/tboot.h
new file mode 100644
index 000000000000..b13929d4e5f4
--- /dev/null
+++ b/arch/x86/include/asm/tboot.h
@@ -0,0 +1,197 @@
1/*
2 * tboot.h: shared data structure with tboot and kernel and functions
3 * used by kernel for runtime support of Intel(R) Trusted
4 * Execution Technology
5 *
6 * Copyright (c) 2006-2009, Intel Corporation
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 */
22
23#ifndef _ASM_TBOOT_H
24#define _ASM_TBOOT_H
25
26#include <acpi/acpi.h>
27
28/* these must have the values from 0-5 in this order */
29enum {
30 TB_SHUTDOWN_REBOOT = 0,
31 TB_SHUTDOWN_S5,
32 TB_SHUTDOWN_S4,
33 TB_SHUTDOWN_S3,
34 TB_SHUTDOWN_HALT,
35 TB_SHUTDOWN_WFS
36};
37
38#ifdef CONFIG_INTEL_TXT
39
40/* used to communicate between tboot and the launched kernel */
41
42#define TB_KEY_SIZE 64 /* 512 bits */
43
44#define MAX_TB_MAC_REGIONS 32
45
46struct tboot_mac_region {
47 u64 start; /* must be 64 byte -aligned */
48 u32 size; /* must be 64 byte -granular */
49} __packed;
50
51/* GAS - Generic Address Structure (ACPI 2.0+) */
52struct tboot_acpi_generic_address {
53 u8 space_id;
54 u8 bit_width;
55 u8 bit_offset;
56 u8 access_width;
57 u64 address;
58} __packed;
59
60/*
61 * combines Sx info from FADT and FACS tables per ACPI 2.0+ spec
62 * (http://www.acpi.info/)
63 */
64struct tboot_acpi_sleep_info {
65 struct tboot_acpi_generic_address pm1a_cnt_blk;
66 struct tboot_acpi_generic_address pm1b_cnt_blk;
67 struct tboot_acpi_generic_address pm1a_evt_blk;
68 struct tboot_acpi_generic_address pm1b_evt_blk;
69 u16 pm1a_cnt_val;
70 u16 pm1b_cnt_val;
71 u64 wakeup_vector;
72 u32 vector_width;
73 u64 kernel_s3_resume_vector;
74} __packed;
75
76/*
77 * shared memory page used for communication between tboot and kernel
78 */
79struct tboot {
80 /*
81 * version 3+ fields:
82 */
83
84 /* TBOOT_UUID */
85 u8 uuid[16];
86
87 /* version number: 5 is current */
88 u32 version;
89
90 /* physical addr of tb_log_t log */
91 u32 log_addr;
92
93 /*
94 * physical addr of entry point for tboot shutdown and
95 * type of shutdown (TB_SHUTDOWN_*) being requested
96 */
97 u32 shutdown_entry;
98 u32 shutdown_type;
99
100 /* kernel-specified ACPI info for Sx shutdown */
101 struct tboot_acpi_sleep_info acpi_sinfo;
102
103 /* tboot location in memory (physical) */
104 u32 tboot_base;
105 u32 tboot_size;
106
107 /* memory regions (phys addrs) for tboot to MAC on S3 */
108 u8 num_mac_regions;
109 struct tboot_mac_region mac_regions[MAX_TB_MAC_REGIONS];
110
111
112 /*
113 * version 4+ fields:
114 */
115
116 /* symmetric key for use by kernel; will be encrypted on S3 */
117 u8 s3_key[TB_KEY_SIZE];
118
119
120 /*
121 * version 5+ fields:
122 */
123
124 /* used to 4byte-align num_in_wfs */
125 u8 reserved_align[3];
126
127 /* number of processors in wait-for-SIPI */
128 u32 num_in_wfs;
129} __packed;
130
131/*
132 * UUID for tboot data struct to facilitate matching
133 * defined as {663C8DFF-E8B3-4b82-AABF-19EA4D057A08} by tboot, which is
134 * represented as {} in the char array used here
135 */
136#define TBOOT_UUID {0xff, 0x8d, 0x3c, 0x66, 0xb3, 0xe8, 0x82, 0x4b, 0xbf,\
137 0xaa, 0x19, 0xea, 0x4d, 0x5, 0x7a, 0x8}
138
139extern struct tboot *tboot;
140
141static inline int tboot_enabled(void)
142{
143 return tboot != NULL;
144}
145
146extern void tboot_probe(void);
147extern void tboot_create_trampoline(void);
148extern void tboot_shutdown(u32 shutdown_type);
149extern void tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control);
150extern int tboot_wait_for_aps(int num_aps);
151extern struct acpi_table_header *tboot_get_dmar_table(
152 struct acpi_table_header *dmar_tbl);
153extern int tboot_force_iommu(void);
154
155#else /* CONFIG_INTEL_TXT */
156
157static inline int tboot_enabled(void)
158{
159 return 0;
160}
161
162static inline void tboot_probe(void)
163{
164}
165
166static inline void tboot_create_trampoline(void)
167{
168}
169
170static inline void tboot_shutdown(u32 shutdown_type)
171{
172}
173
174static inline void tboot_sleep(u8 sleep_state, u32 pm1a_control,
175 u32 pm1b_control)
176{
177}
178
179static inline int tboot_wait_for_aps(int num_aps)
180{
181 return 0;
182}
183
184static inline struct acpi_table_header *tboot_get_dmar_table(
185 struct acpi_table_header *dmar_tbl)
186{
187 return dmar_tbl;
188}
189
190static inline int tboot_force_iommu(void)
191{
192 return 0;
193}
194
195#endif /* !CONFIG_INTEL_TXT */
196
197#endif /* _ASM_TBOOT_H */