Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 1 | /* |
| 2 | * runtime-wrappers.c - Runtime Services function call wrappers |
| 3 | * |
| 4 | * Copyright (C) 2014 Linaro Ltd. <ard.biesheuvel@linaro.org> |
| 5 | * |
| 6 | * Split off from arch/x86/platform/efi/efi.c |
| 7 | * |
| 8 | * Copyright (C) 1999 VA Linux Systems |
| 9 | * Copyright (C) 1999 Walt Drummond <drummond@valinux.com> |
| 10 | * Copyright (C) 1999-2002 Hewlett-Packard Co. |
| 11 | * Copyright (C) 2005-2008 Intel Co. |
| 12 | * Copyright (C) 2013 SuSE Labs |
| 13 | * |
| 14 | * This file is released under the GPLv2. |
| 15 | */ |
| 16 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 17 | #define pr_fmt(fmt) "efi: " fmt |
| 18 | |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 19 | #include <linux/bug.h> |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 20 | #include <linux/efi.h> |
Mark Rutland | 1d04ba1 | 2016-04-25 21:07:08 +0100 | [diff] [blame] | 21 | #include <linux/irqflags.h> |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 22 | #include <linux/mutex.h> |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 23 | #include <linux/semaphore.h> |
Mark Rutland | 1d04ba1 | 2016-04-25 21:07:08 +0100 | [diff] [blame] | 24 | #include <linux/stringify.h> |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 25 | #include <asm/efi.h> |
| 26 | |
Alex Thorlton | 80e7559 | 2016-06-25 08:20:27 +0100 | [diff] [blame] | 27 | /* |
| 28 | * Wrap around the new efi_call_virt_generic() macros so that the |
| 29 | * code doesn't get too cluttered: |
| 30 | */ |
| 31 | #define efi_call_virt(f, args...) \ |
| 32 | efi_call_virt_pointer(efi.systab->runtime, f, args) |
| 33 | #define __efi_call_virt(f, args...) \ |
| 34 | __efi_call_virt_pointer(efi.systab->runtime, f, args) |
| 35 | |
| 36 | void efi_call_virt_check_flags(unsigned long flags, const char *call) |
Mark Rutland | 1d04ba1 | 2016-04-25 21:07:08 +0100 | [diff] [blame] | 37 | { |
| 38 | unsigned long cur_flags, mismatch; |
| 39 | |
| 40 | local_save_flags(cur_flags); |
| 41 | |
| 42 | mismatch = flags ^ cur_flags; |
| 43 | if (!WARN_ON_ONCE(mismatch & ARCH_EFI_IRQ_FLAGS_MASK)) |
| 44 | return; |
| 45 | |
| 46 | add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_NOW_UNRELIABLE); |
| 47 | pr_err_ratelimited(FW_BUG "IRQ flags corrupted (0x%08lx=>0x%08lx) by EFI %s\n", |
| 48 | flags, cur_flags, call); |
| 49 | local_irq_restore(flags); |
| 50 | } |
Mark Rutland | 1d04ba1 | 2016-04-25 21:07:08 +0100 | [diff] [blame] | 51 | |
| 52 | /* |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 53 | * According to section 7.1 of the UEFI spec, Runtime Services are not fully |
| 54 | * reentrant, and there are particular combinations of calls that need to be |
| 55 | * serialized. (source: UEFI Specification v2.4A) |
| 56 | * |
| 57 | * Table 31. Rules for Reentry Into Runtime Services |
| 58 | * +------------------------------------+-------------------------------+ |
| 59 | * | If previous call is busy in | Forbidden to call | |
| 60 | * +------------------------------------+-------------------------------+ |
| 61 | * | Any | SetVirtualAddressMap() | |
| 62 | * +------------------------------------+-------------------------------+ |
| 63 | * | ConvertPointer() | ConvertPointer() | |
| 64 | * +------------------------------------+-------------------------------+ |
| 65 | * | SetVariable() | ResetSystem() | |
| 66 | * | UpdateCapsule() | | |
| 67 | * | SetTime() | | |
| 68 | * | SetWakeupTime() | | |
| 69 | * | GetNextHighMonotonicCount() | | |
| 70 | * +------------------------------------+-------------------------------+ |
| 71 | * | GetVariable() | GetVariable() | |
| 72 | * | GetNextVariableName() | GetNextVariableName() | |
| 73 | * | SetVariable() | SetVariable() | |
| 74 | * | QueryVariableInfo() | QueryVariableInfo() | |
| 75 | * | UpdateCapsule() | UpdateCapsule() | |
| 76 | * | QueryCapsuleCapabilities() | QueryCapsuleCapabilities() | |
| 77 | * | GetNextHighMonotonicCount() | GetNextHighMonotonicCount() | |
| 78 | * +------------------------------------+-------------------------------+ |
| 79 | * | GetTime() | GetTime() | |
| 80 | * | SetTime() | SetTime() | |
| 81 | * | GetWakeupTime() | GetWakeupTime() | |
| 82 | * | SetWakeupTime() | SetWakeupTime() | |
| 83 | * +------------------------------------+-------------------------------+ |
| 84 | * |
| 85 | * Due to the fact that the EFI pstore may write to the variable store in |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 86 | * interrupt context, we need to use a lock for at least the groups that |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 87 | * contain SetVariable() and QueryVariableInfo(). That leaves little else, as |
| 88 | * none of the remaining functions are actually ever called at runtime. |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 89 | * So let's just use a single lock to serialize all Runtime Services calls. |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 90 | */ |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 91 | static DEFINE_SEMAPHORE(efi_runtime_lock); |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 92 | |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 93 | static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc) |
| 94 | { |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 95 | efi_status_t status; |
| 96 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 97 | if (down_interruptible(&efi_runtime_lock)) |
| 98 | return EFI_ABORTED; |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 99 | status = efi_call_virt(get_time, tm, tc); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 100 | up(&efi_runtime_lock); |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 101 | return status; |
| 102 | } |
| 103 | |
| 104 | static efi_status_t virt_efi_set_time(efi_time_t *tm) |
| 105 | { |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 106 | efi_status_t status; |
| 107 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 108 | if (down_interruptible(&efi_runtime_lock)) |
| 109 | return EFI_ABORTED; |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 110 | status = efi_call_virt(set_time, tm); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 111 | up(&efi_runtime_lock); |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 112 | return status; |
| 113 | } |
| 114 | |
| 115 | static efi_status_t virt_efi_get_wakeup_time(efi_bool_t *enabled, |
| 116 | efi_bool_t *pending, |
| 117 | efi_time_t *tm) |
| 118 | { |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 119 | efi_status_t status; |
| 120 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 121 | if (down_interruptible(&efi_runtime_lock)) |
| 122 | return EFI_ABORTED; |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 123 | status = efi_call_virt(get_wakeup_time, enabled, pending, tm); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 124 | up(&efi_runtime_lock); |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 125 | return status; |
| 126 | } |
| 127 | |
| 128 | static efi_status_t virt_efi_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm) |
| 129 | { |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 130 | efi_status_t status; |
| 131 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 132 | if (down_interruptible(&efi_runtime_lock)) |
| 133 | return EFI_ABORTED; |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 134 | status = efi_call_virt(set_wakeup_time, enabled, tm); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 135 | up(&efi_runtime_lock); |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 136 | return status; |
| 137 | } |
| 138 | |
| 139 | static efi_status_t virt_efi_get_variable(efi_char16_t *name, |
| 140 | efi_guid_t *vendor, |
| 141 | u32 *attr, |
| 142 | unsigned long *data_size, |
| 143 | void *data) |
| 144 | { |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 145 | efi_status_t status; |
| 146 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 147 | if (down_interruptible(&efi_runtime_lock)) |
| 148 | return EFI_ABORTED; |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 149 | status = efi_call_virt(get_variable, name, vendor, attr, data_size, |
| 150 | data); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 151 | up(&efi_runtime_lock); |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 152 | return status; |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | static efi_status_t virt_efi_get_next_variable(unsigned long *name_size, |
| 156 | efi_char16_t *name, |
| 157 | efi_guid_t *vendor) |
| 158 | { |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 159 | efi_status_t status; |
| 160 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 161 | if (down_interruptible(&efi_runtime_lock)) |
| 162 | return EFI_ABORTED; |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 163 | status = efi_call_virt(get_next_variable, name_size, name, vendor); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 164 | up(&efi_runtime_lock); |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 165 | return status; |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | static efi_status_t virt_efi_set_variable(efi_char16_t *name, |
| 169 | efi_guid_t *vendor, |
| 170 | u32 attr, |
| 171 | unsigned long data_size, |
| 172 | void *data) |
| 173 | { |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 174 | efi_status_t status; |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 175 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 176 | if (down_interruptible(&efi_runtime_lock)) |
| 177 | return EFI_ABORTED; |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 178 | status = efi_call_virt(set_variable, name, vendor, attr, data_size, |
| 179 | data); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 180 | up(&efi_runtime_lock); |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 181 | return status; |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 182 | } |
| 183 | |
Matt Fleming | 6d80dba | 2014-09-30 21:58:52 +0100 | [diff] [blame] | 184 | static efi_status_t |
| 185 | virt_efi_set_variable_nonblocking(efi_char16_t *name, efi_guid_t *vendor, |
| 186 | u32 attr, unsigned long data_size, |
| 187 | void *data) |
| 188 | { |
Matt Fleming | 6d80dba | 2014-09-30 21:58:52 +0100 | [diff] [blame] | 189 | efi_status_t status; |
| 190 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 191 | if (down_trylock(&efi_runtime_lock)) |
Matt Fleming | 6d80dba | 2014-09-30 21:58:52 +0100 | [diff] [blame] | 192 | return EFI_NOT_READY; |
| 193 | |
| 194 | status = efi_call_virt(set_variable, name, vendor, attr, data_size, |
| 195 | data); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 196 | up(&efi_runtime_lock); |
Matt Fleming | 6d80dba | 2014-09-30 21:58:52 +0100 | [diff] [blame] | 197 | return status; |
| 198 | } |
| 199 | |
| 200 | |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 201 | static efi_status_t virt_efi_query_variable_info(u32 attr, |
| 202 | u64 *storage_space, |
| 203 | u64 *remaining_space, |
| 204 | u64 *max_variable_size) |
| 205 | { |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 206 | efi_status_t status; |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 207 | |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 208 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) |
| 209 | return EFI_UNSUPPORTED; |
| 210 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 211 | if (down_interruptible(&efi_runtime_lock)) |
| 212 | return EFI_ABORTED; |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 213 | status = efi_call_virt(query_variable_info, attr, storage_space, |
| 214 | remaining_space, max_variable_size); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 215 | up(&efi_runtime_lock); |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 216 | return status; |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 217 | } |
| 218 | |
Ard Biesheuvel | d3cac1f | 2016-02-01 22:06:57 +0000 | [diff] [blame] | 219 | static efi_status_t |
| 220 | virt_efi_query_variable_info_nonblocking(u32 attr, |
| 221 | u64 *storage_space, |
| 222 | u64 *remaining_space, |
| 223 | u64 *max_variable_size) |
| 224 | { |
Ard Biesheuvel | d3cac1f | 2016-02-01 22:06:57 +0000 | [diff] [blame] | 225 | efi_status_t status; |
| 226 | |
| 227 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) |
| 228 | return EFI_UNSUPPORTED; |
| 229 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 230 | if (down_trylock(&efi_runtime_lock)) |
Ard Biesheuvel | d3cac1f | 2016-02-01 22:06:57 +0000 | [diff] [blame] | 231 | return EFI_NOT_READY; |
| 232 | |
| 233 | status = efi_call_virt(query_variable_info, attr, storage_space, |
| 234 | remaining_space, max_variable_size); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 235 | up(&efi_runtime_lock); |
Ard Biesheuvel | d3cac1f | 2016-02-01 22:06:57 +0000 | [diff] [blame] | 236 | return status; |
| 237 | } |
| 238 | |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 239 | static efi_status_t virt_efi_get_next_high_mono_count(u32 *count) |
| 240 | { |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 241 | efi_status_t status; |
| 242 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 243 | if (down_interruptible(&efi_runtime_lock)) |
| 244 | return EFI_ABORTED; |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 245 | status = efi_call_virt(get_next_high_mono_count, count); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 246 | up(&efi_runtime_lock); |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 247 | return status; |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 248 | } |
| 249 | |
| 250 | static void virt_efi_reset_system(int reset_type, |
| 251 | efi_status_t status, |
| 252 | unsigned long data_size, |
| 253 | efi_char16_t *data) |
| 254 | { |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 255 | if (down_interruptible(&efi_runtime_lock)) { |
| 256 | pr_warn("failed to invoke the reset_system() runtime service:\n" |
| 257 | "could not get exclusive access to the firmware\n"); |
| 258 | return; |
| 259 | } |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 260 | __efi_call_virt(reset_system, reset_type, status, data_size, data); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 261 | up(&efi_runtime_lock); |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 262 | } |
| 263 | |
| 264 | static efi_status_t virt_efi_update_capsule(efi_capsule_header_t **capsules, |
| 265 | unsigned long count, |
| 266 | unsigned long sg_list) |
| 267 | { |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 268 | efi_status_t status; |
| 269 | |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 270 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) |
| 271 | return EFI_UNSUPPORTED; |
| 272 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 273 | if (down_interruptible(&efi_runtime_lock)) |
| 274 | return EFI_ABORTED; |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 275 | status = efi_call_virt(update_capsule, capsules, count, sg_list); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 276 | up(&efi_runtime_lock); |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 277 | return status; |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 278 | } |
| 279 | |
| 280 | static efi_status_t virt_efi_query_capsule_caps(efi_capsule_header_t **capsules, |
| 281 | unsigned long count, |
| 282 | u64 *max_size, |
| 283 | int *reset_type) |
| 284 | { |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 285 | efi_status_t status; |
| 286 | |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 287 | if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) |
| 288 | return EFI_UNSUPPORTED; |
| 289 | |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 290 | if (down_interruptible(&efi_runtime_lock)) |
| 291 | return EFI_ABORTED; |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 292 | status = efi_call_virt(query_capsule_caps, capsules, count, max_size, |
| 293 | reset_type); |
Ard Biesheuvel | dce48e3 | 2016-07-15 21:36:31 +0200 | [diff] [blame] | 294 | up(&efi_runtime_lock); |
Ard Biesheuvel | 161485e | 2014-08-04 18:16:00 +0200 | [diff] [blame] | 295 | return status; |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 296 | } |
| 297 | |
| 298 | void efi_native_runtime_setup(void) |
| 299 | { |
| 300 | efi.get_time = virt_efi_get_time; |
| 301 | efi.set_time = virt_efi_set_time; |
| 302 | efi.get_wakeup_time = virt_efi_get_wakeup_time; |
| 303 | efi.set_wakeup_time = virt_efi_set_wakeup_time; |
| 304 | efi.get_variable = virt_efi_get_variable; |
| 305 | efi.get_next_variable = virt_efi_get_next_variable; |
| 306 | efi.set_variable = virt_efi_set_variable; |
Matt Fleming | 6d80dba | 2014-09-30 21:58:52 +0100 | [diff] [blame] | 307 | efi.set_variable_nonblocking = virt_efi_set_variable_nonblocking; |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 308 | efi.get_next_high_mono_count = virt_efi_get_next_high_mono_count; |
| 309 | efi.reset_system = virt_efi_reset_system; |
| 310 | efi.query_variable_info = virt_efi_query_variable_info; |
Ard Biesheuvel | d3cac1f | 2016-02-01 22:06:57 +0000 | [diff] [blame] | 311 | efi.query_variable_info_nonblocking = virt_efi_query_variable_info_nonblocking; |
Ard Biesheuvel | 022ee6c | 2014-06-26 12:09:05 +0200 | [diff] [blame] | 312 | efi.update_capsule = virt_efi_update_capsule; |
| 313 | efi.query_capsule_caps = virt_efi_query_capsule_caps; |
| 314 | } |