master
 1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
 2#ifndef _ASM_X86_SETUP_DATA_H
 3#define _ASM_X86_SETUP_DATA_H
 4
 5/* setup_data/setup_indirect types */
 6#define SETUP_NONE			0
 7#define SETUP_E820_EXT			1
 8#define SETUP_DTB			2
 9#define SETUP_PCI			3
10#define SETUP_EFI			4
11#define SETUP_APPLE_PROPERTIES		5
12#define SETUP_JAILHOUSE			6
13#define SETUP_CC_BLOB			7
14#define SETUP_IMA			8
15#define SETUP_RNG_SEED			9
16#define SETUP_KEXEC_KHO			10
17#define SETUP_ENUM_MAX			SETUP_KEXEC_KHO
18
19#define SETUP_INDIRECT			(1<<31)
20#define SETUP_TYPE_MAX			(SETUP_ENUM_MAX | SETUP_INDIRECT)
21
22#ifndef __ASSEMBLER__
23
24#include <linux/types.h>
25
26/* extensible setup data list node */
27struct setup_data {
28	__u64 next;
29	__u32 type;
30	__u32 len;
31	__u8 data[];
32};
33
34/* extensible setup indirect data node */
35struct setup_indirect {
36	__u32 type;
37	__u32 reserved;  /* Reserved, must be set to zero. */
38	__u64 len;
39	__u64 addr;
40};
41
42/*
43 * The E820 memory region entry of the boot protocol ABI:
44 */
45struct boot_e820_entry {
46	__u64 addr;
47	__u64 size;
48	__u32 type;
49} __attribute__((packed));
50
51/*
52 * The boot loader is passing platform information via this Jailhouse-specific
53 * setup data structure.
54 */
55struct jailhouse_setup_data {
56	struct {
57		__u16	version;
58		__u16	compatible_version;
59	} __attribute__((packed)) hdr;
60	struct {
61		__u16	pm_timer_address;
62		__u16	num_cpus;
63		__u64	pci_mmconfig_base;
64		__u32	tsc_khz;
65		__u32	apic_khz;
66		__u8	standard_ioapic;
67		__u8	cpu_ids[255];
68	} __attribute__((packed)) v1;
69	struct {
70		__u32	flags;
71	} __attribute__((packed)) v2;
72} __attribute__((packed));
73
74/*
75 * IMA buffer setup data information from the previous kernel during kexec
76 */
77struct ima_setup_data {
78	__u64 addr;
79	__u64 size;
80} __attribute__((packed));
81
82/*
83 * Locations of kexec handover metadata
84 */
85struct kho_data {
86	__u64 fdt_addr;
87	__u64 fdt_size;
88	__u64 scratch_addr;
89	__u64 scratch_size;
90} __attribute__((packed));
91
92#endif /* __ASSEMBLER__ */
93
94#endif /* _ASM_X86_SETUP_DATA_H */