2 * tboot.h: shared data structure with tboot and kernel and functions
3 * used by kernel for runtime support of Intel(R) Trusted
6 * Copyright (c) 2006-2009, Intel Corporation
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.
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
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.
23 #ifndef _LINUX_TBOOT_H
24 #define _LINUX_TBOOT_H
26 /* these must have the values from 0-5 in this order */
28 TB_SHUTDOWN_REBOOT
= 0,
36 #ifdef CONFIG_INTEL_TXT
37 #include <acpi/acpi.h>
38 /* used to communicate between tboot and the launched kernel */
40 #define TB_KEY_SIZE 64 /* 512 bits */
42 #define MAX_TB_MAC_REGIONS 32
44 struct tboot_mac_region
{
45 u64 start
; /* must be 64 byte -aligned */
46 u32 size
; /* must be 64 byte -granular */
49 /* GAS - Generic Address Structure (ACPI 2.0+) */
50 struct tboot_acpi_generic_address
{
59 * combines Sx info from FADT and FACS tables per ACPI 2.0+ spec
60 * (http://www.acpi.info/)
62 struct tboot_acpi_sleep_info
{
63 struct tboot_acpi_generic_address pm1a_cnt_blk
;
64 struct tboot_acpi_generic_address pm1b_cnt_blk
;
65 struct tboot_acpi_generic_address pm1a_evt_blk
;
66 struct tboot_acpi_generic_address pm1b_evt_blk
;
71 u64 kernel_s3_resume_vector
;
75 * shared memory page used for communication between tboot and kernel
85 /* version number: 5 is current */
88 /* physical addr of tb_log_t log */
92 * physical addr of entry point for tboot shutdown and
93 * type of shutdown (TB_SHUTDOWN_*) being requested
98 /* kernel-specified ACPI info for Sx shutdown */
99 struct tboot_acpi_sleep_info acpi_sinfo
;
101 /* tboot location in memory (physical) */
105 /* memory regions (phys addrs) for tboot to MAC on S3 */
107 struct tboot_mac_region mac_regions
[MAX_TB_MAC_REGIONS
];
114 /* symmetric key for use by kernel; will be encrypted on S3 */
115 u8 s3_key
[TB_KEY_SIZE
];
122 /* used to 4byte-align num_in_wfs */
123 u8 reserved_align
[3];
125 /* number of processors in wait-for-SIPI */
130 * UUID for tboot data struct to facilitate matching
131 * defined as {663C8DFF-E8B3-4b82-AABF-19EA4D057A08} by tboot, which is
132 * represented as {} in the char array used here
134 #define TBOOT_UUID {0xff, 0x8d, 0x3c, 0x66, 0xb3, 0xe8, 0x82, 0x4b, 0xbf,\
135 0xaa, 0x19, 0xea, 0x4d, 0x5, 0x7a, 0x8}
137 extern struct tboot
*tboot
;
139 static inline int tboot_enabled(void)
141 return tboot
!= NULL
;
144 extern void tboot_probe(void);
145 extern void tboot_shutdown(u32 shutdown_type
);
146 extern void tboot_sleep(u8 sleep_state
, u32 pm1a_control
, u32 pm1b_control
);
147 extern struct acpi_table_header
*tboot_get_dmar_table(
148 struct acpi_table_header
*dmar_tbl
);
149 extern int tboot_force_iommu(void);
153 #define tboot_probe() do { } while (0)
154 #define tboot_shutdown(shutdown_type) do { } while (0)
155 #define tboot_sleep(sleep_state, pm1a_control, pm1b_control) \
157 #define tboot_get_dmar_table(dmar_tbl) (dmar_tbl)
158 #define tboot_force_iommu() 0
160 #endif /* !CONFIG_INTEL_TXT */
162 #endif /* _LINUX_TBOOT_H */