.. | .. |
---|
25 | 25 | ({ \ |
---|
26 | 26 | efi_virtmap_load(); \ |
---|
27 | 27 | __efi_fpsimd_begin(); \ |
---|
| 28 | + raw_spin_lock(&efi_rt_lock); \ |
---|
28 | 29 | }) |
---|
29 | 30 | |
---|
30 | 31 | #define arch_efi_call_virt(p, f, args...) \ |
---|
.. | .. |
---|
36 | 37 | |
---|
37 | 38 | #define arch_efi_call_virt_teardown() \ |
---|
38 | 39 | ({ \ |
---|
| 40 | + raw_spin_unlock(&efi_rt_lock); \ |
---|
39 | 41 | __efi_fpsimd_end(); \ |
---|
40 | 42 | efi_virtmap_unload(); \ |
---|
41 | 43 | }) |
---|
42 | 44 | |
---|
| 45 | +extern raw_spinlock_t efi_rt_lock; |
---|
43 | 46 | efi_status_t __efi_rt_asm_wrapper(void *, const char *, ...); |
---|
44 | 47 | |
---|
45 | 48 | #define ARCH_EFI_IRQ_FLAGS_MASK (PSR_D_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT) |
---|
46 | 49 | |
---|
47 | | -/* arch specific definitions used by the stub code */ |
---|
48 | | - |
---|
49 | 50 | /* |
---|
50 | | - * AArch64 requires the DTB to be 8-byte aligned in the first 512MiB from |
---|
51 | | - * start of kernel and may not cross a 2MiB boundary. We set alignment to |
---|
52 | | - * 2MiB so we know it won't cross a 2MiB boundary. |
---|
| 51 | + * Even when Linux uses IRQ priorities for IRQ disabling, EFI does not. |
---|
| 52 | + * And EFI shouldn't really play around with priority masking as it is not aware |
---|
| 53 | + * which priorities the OS has assigned to its interrupts. |
---|
53 | 54 | */ |
---|
54 | | -#define EFI_FDT_ALIGN SZ_2M /* used by allocate_new_fdt_and_exit_boot() */ |
---|
| 55 | +#define arch_efi_save_flags(state_flags) \ |
---|
| 56 | + ((void)((state_flags) = read_sysreg(daif))) |
---|
| 57 | + |
---|
| 58 | +#define arch_efi_restore_flags(state_flags) write_sysreg(state_flags, daif) |
---|
| 59 | + |
---|
| 60 | + |
---|
| 61 | +/* arch specific definitions used by the stub code */ |
---|
55 | 62 | |
---|
56 | 63 | /* |
---|
57 | 64 | * In some configurations (e.g. VMAP_STACK && 64K pages), stacks built into the |
---|
.. | .. |
---|
61 | 68 | (SEGMENT_ALIGN > THREAD_ALIGN ? SEGMENT_ALIGN : THREAD_ALIGN) |
---|
62 | 69 | |
---|
63 | 70 | /* on arm64, the FDT may be located anywhere in system RAM */ |
---|
64 | | -static inline unsigned long efi_get_max_fdt_addr(unsigned long dram_base) |
---|
| 71 | +static inline unsigned long efi_get_max_fdt_addr(unsigned long image_addr) |
---|
65 | 72 | { |
---|
66 | 73 | return ULONG_MAX; |
---|
67 | 74 | } |
---|
68 | 75 | |
---|
69 | 76 | /* |
---|
70 | 77 | * On arm64, we have to ensure that the initrd ends up in the linear region, |
---|
71 | | - * which is a 1 GB aligned region of size '1UL << (VA_BITS - 1)' that is |
---|
| 78 | + * which is a 1 GB aligned region of size '1UL << (VA_BITS_MIN - 1)' that is |
---|
72 | 79 | * guaranteed to cover the kernel Image. |
---|
73 | 80 | * |
---|
74 | 81 | * Since the EFI stub is part of the kernel Image, we can relax the |
---|
75 | | - * usual requirements in Documentation/arm64/booting.txt, which still |
---|
| 82 | + * usual requirements in Documentation/arm64/booting.rst, which still |
---|
76 | 83 | * apply to other bootloaders, and are required for some kernel |
---|
77 | 84 | * configurations. |
---|
78 | 85 | */ |
---|
79 | | -static inline unsigned long efi_get_max_initrd_addr(unsigned long dram_base, |
---|
80 | | - unsigned long image_addr) |
---|
| 86 | +static inline unsigned long efi_get_max_initrd_addr(unsigned long image_addr) |
---|
81 | 87 | { |
---|
82 | | - return (image_addr & ~(SZ_1G - 1UL)) + (1UL << (VA_BITS - 1)); |
---|
| 88 | + return (image_addr & ~(SZ_1G - 1UL)) + (1UL << (VA_BITS_MIN - 1)); |
---|
83 | 89 | } |
---|
84 | | - |
---|
85 | | -#define efi_call_early(f, ...) sys_table_arg->boottime->f(__VA_ARGS__) |
---|
86 | | -#define __efi_call_early(f, ...) f(__VA_ARGS__) |
---|
87 | | -#define efi_call_runtime(f, ...) sys_table_arg->runtime->f(__VA_ARGS__) |
---|
88 | | -#define efi_is_64bit() (true) |
---|
89 | | - |
---|
90 | | -#define efi_table_attr(table, attr, instance) \ |
---|
91 | | - ((table##_t *)instance)->attr |
---|
92 | | - |
---|
93 | | -#define efi_call_proto(protocol, f, instance, ...) \ |
---|
94 | | - ((protocol##_t *)instance)->f(instance, ##__VA_ARGS__) |
---|
95 | 90 | |
---|
96 | 91 | #define alloc_screen_info(x...) &screen_info |
---|
97 | 92 | |
---|
98 | | -static inline void free_screen_info(efi_system_table_t *sys_table_arg, |
---|
99 | | - struct screen_info *si) |
---|
| 93 | +static inline void free_screen_info(struct screen_info *si) |
---|
100 | 94 | { |
---|
101 | 95 | } |
---|
102 | | - |
---|
103 | | -/* redeclare as 'hidden' so the compiler will generate relative references */ |
---|
104 | | -extern struct screen_info screen_info __attribute__((__visibility__("hidden"))); |
---|
105 | 96 | |
---|
106 | 97 | static inline void efifb_setup_from_dmi(struct screen_info *si, const char *opt) |
---|
107 | 98 | { |
---|