| .. | .. |
|---|
| 9 | 9 | * paravirt and debugging variants are added.) |
|---|
| 10 | 10 | */ |
|---|
| 11 | 11 | #undef CONFIG_PARAVIRT |
|---|
| 12 | +#undef CONFIG_PARAVIRT_XXL |
|---|
| 12 | 13 | #undef CONFIG_PARAVIRT_SPINLOCKS |
|---|
| 13 | 14 | #undef CONFIG_KASAN |
|---|
| 15 | +#undef CONFIG_KASAN_GENERIC |
|---|
| 14 | 16 | |
|---|
| 15 | 17 | /* cpu_feature_enabled() cannot be used this early */ |
|---|
| 16 | 18 | #define USE_EARLY_PGTABLE_L5 |
|---|
| .. | .. |
|---|
| 22 | 24 | #include <asm/page.h> |
|---|
| 23 | 25 | #include <asm/boot.h> |
|---|
| 24 | 26 | #include <asm/bootparam.h> |
|---|
| 27 | +#include <asm/desc_defs.h> |
|---|
| 28 | + |
|---|
| 29 | +#define BOOT_CTYPE_H |
|---|
| 30 | +#include <linux/acpi.h> |
|---|
| 25 | 31 | |
|---|
| 26 | 32 | #define BOOT_BOOT_H |
|---|
| 27 | 33 | #include "../ctype.h" |
|---|
| .. | .. |
|---|
| 31 | 37 | #else |
|---|
| 32 | 38 | #define memptr unsigned |
|---|
| 33 | 39 | #endif |
|---|
| 40 | + |
|---|
| 41 | +/* boot/compressed/vmlinux start and end markers */ |
|---|
| 42 | +extern char _head[], _end[]; |
|---|
| 34 | 43 | |
|---|
| 35 | 44 | /* misc.c */ |
|---|
| 36 | 45 | extern memptr free_mem_ptr; |
|---|
| .. | .. |
|---|
| 55 | 64 | |
|---|
| 56 | 65 | static inline void debug_putstr(const char *s) |
|---|
| 57 | 66 | { } |
|---|
| 58 | | -static inline void debug_puthex(const char *s) |
|---|
| 67 | +static inline void debug_puthex(unsigned long value) |
|---|
| 59 | 68 | { } |
|---|
| 60 | 69 | #define debug_putaddr(x) /* */ |
|---|
| 61 | 70 | |
|---|
| 62 | 71 | #endif |
|---|
| 63 | 72 | |
|---|
| 64 | | -#if CONFIG_EARLY_PRINTK || CONFIG_RANDOMIZE_BASE |
|---|
| 65 | 73 | /* cmdline.c */ |
|---|
| 66 | 74 | int cmdline_find_option(const char *option, char *buffer, int bufsize); |
|---|
| 67 | 75 | int cmdline_find_option_bool(const char *option); |
|---|
| 68 | | -#endif |
|---|
| 69 | 76 | |
|---|
| 77 | +struct mem_vector { |
|---|
| 78 | + u64 start; |
|---|
| 79 | + u64 size; |
|---|
| 80 | +}; |
|---|
| 70 | 81 | |
|---|
| 71 | 82 | #if CONFIG_RANDOMIZE_BASE |
|---|
| 72 | 83 | /* kaslr.c */ |
|---|
| .. | .. |
|---|
| 75 | 86 | unsigned long *output, |
|---|
| 76 | 87 | unsigned long output_size, |
|---|
| 77 | 88 | unsigned long *virt_addr); |
|---|
| 78 | | -/* cpuflags.c */ |
|---|
| 79 | | -bool has_cpuflag(int flag); |
|---|
| 80 | 89 | #else |
|---|
| 81 | 90 | static inline void choose_random_location(unsigned long input, |
|---|
| 82 | 91 | unsigned long input_size, |
|---|
| .. | .. |
|---|
| 87 | 96 | } |
|---|
| 88 | 97 | #endif |
|---|
| 89 | 98 | |
|---|
| 99 | +/* cpuflags.c */ |
|---|
| 100 | +bool has_cpuflag(int flag); |
|---|
| 101 | + |
|---|
| 90 | 102 | #ifdef CONFIG_X86_64 |
|---|
| 91 | | -void initialize_identity_maps(void); |
|---|
| 92 | | -void add_identity_map(unsigned long start, unsigned long size); |
|---|
| 93 | | -void finalize_identity_maps(void); |
|---|
| 103 | +extern int set_page_decrypted(unsigned long address); |
|---|
| 104 | +extern int set_page_encrypted(unsigned long address); |
|---|
| 105 | +extern int set_page_non_present(unsigned long address); |
|---|
| 94 | 106 | extern unsigned char _pgtable[]; |
|---|
| 95 | | -#else |
|---|
| 96 | | -static inline void initialize_identity_maps(void) |
|---|
| 97 | | -{ } |
|---|
| 98 | | -static inline void add_identity_map(unsigned long start, unsigned long size) |
|---|
| 99 | | -{ } |
|---|
| 100 | | -static inline void finalize_identity_maps(void) |
|---|
| 101 | | -{ } |
|---|
| 102 | 107 | #endif |
|---|
| 103 | 108 | |
|---|
| 104 | 109 | #ifdef CONFIG_EARLY_PRINTK |
|---|
| .. | .. |
|---|
| 113 | 118 | |
|---|
| 114 | 119 | void set_sev_encryption_mask(void); |
|---|
| 115 | 120 | |
|---|
| 121 | +#ifdef CONFIG_AMD_MEM_ENCRYPT |
|---|
| 122 | +void sev_es_shutdown_ghcb(void); |
|---|
| 123 | +extern bool sev_es_check_ghcb_fault(unsigned long address); |
|---|
| 124 | +#else |
|---|
| 125 | +static inline void sev_es_shutdown_ghcb(void) { } |
|---|
| 126 | +static inline bool sev_es_check_ghcb_fault(unsigned long address) |
|---|
| 127 | +{ |
|---|
| 128 | + return false; |
|---|
| 129 | +} |
|---|
| 116 | 130 | #endif |
|---|
| 131 | + |
|---|
| 132 | +/* acpi.c */ |
|---|
| 133 | +#ifdef CONFIG_ACPI |
|---|
| 134 | +acpi_physical_address get_rsdp_addr(void); |
|---|
| 135 | +#else |
|---|
| 136 | +static inline acpi_physical_address get_rsdp_addr(void) { return 0; } |
|---|
| 137 | +#endif |
|---|
| 138 | + |
|---|
| 139 | +#if defined(CONFIG_RANDOMIZE_BASE) && defined(CONFIG_MEMORY_HOTREMOVE) && defined(CONFIG_ACPI) |
|---|
| 140 | +extern struct mem_vector immovable_mem[MAX_NUMNODES*2]; |
|---|
| 141 | +int count_immovable_mem_regions(void); |
|---|
| 142 | +#else |
|---|
| 143 | +static inline int count_immovable_mem_regions(void) { return 0; } |
|---|
| 144 | +#endif |
|---|
| 145 | + |
|---|
| 146 | +/* ident_map_64.c */ |
|---|
| 147 | +#ifdef CONFIG_X86_5LEVEL |
|---|
| 148 | +extern unsigned int __pgtable_l5_enabled, pgdir_shift, ptrs_per_p4d; |
|---|
| 149 | +#endif |
|---|
| 150 | + |
|---|
| 151 | +/* Used by PAGE_KERN* macros: */ |
|---|
| 152 | +extern pteval_t __default_kernel_pte_mask; |
|---|
| 153 | + |
|---|
| 154 | +/* idt_64.c */ |
|---|
| 155 | +extern gate_desc boot_idt[BOOT_IDT_ENTRIES]; |
|---|
| 156 | +extern struct desc_ptr boot_idt_desc; |
|---|
| 157 | + |
|---|
| 158 | +/* IDT Entry Points */ |
|---|
| 159 | +void boot_page_fault(void); |
|---|
| 160 | +void boot_stage1_vc(void); |
|---|
| 161 | +void boot_stage2_vc(void); |
|---|
| 162 | + |
|---|
| 163 | +unsigned long sev_verify_cbit(unsigned long cr3); |
|---|
| 164 | + |
|---|
| 165 | +#endif /* BOOT_COMPRESSED_MISC_H */ |
|---|