setup_data.h 1.9 KB

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