40
40
* code doesn't get too cluttered:
41
41
*/
42
42
#define efi_call_virt (f , args ...) \
43
- efi_call_virt_pointer (efi.runtime, f, args)
43
+ arch_efi_call_virt (efi.runtime, f, args)
44
44
45
45
union efi_rts_args {
46
46
struct {
@@ -139,7 +139,7 @@ unsigned long efi_call_virt_save_flags(void)
139
139
return flags ;
140
140
}
141
141
142
- void efi_call_virt_check_flags (unsigned long flags , const char * call )
142
+ void efi_call_virt_check_flags (unsigned long flags , const void * caller )
143
143
{
144
144
unsigned long cur_flags , mismatch ;
145
145
@@ -150,8 +150,8 @@ void efi_call_virt_check_flags(unsigned long flags, const char *call)
150
150
return ;
151
151
152
152
add_taint (TAINT_FIRMWARE_WORKAROUND , LOCKDEP_NOW_UNRELIABLE );
153
- pr_err_ratelimited (FW_BUG "IRQ flags corrupted (0x%08lx=>0x%08lx) by EFI %s \n" ,
154
- flags , cur_flags , call );
153
+ pr_err_ratelimited (FW_BUG "IRQ flags corrupted (0x%08lx=>0x%08lx) by EFI call from %pS \n" ,
154
+ flags , cur_flags , caller ?: __builtin_return_address ( 0 ) );
155
155
arch_efi_restore_flags (flags );
156
156
}
157
157
@@ -211,6 +211,10 @@ static void efi_call_rts(struct work_struct *work)
211
211
{
212
212
const union efi_rts_args * args = efi_rts_work .args ;
213
213
efi_status_t status = EFI_NOT_FOUND ;
214
+ unsigned long flags ;
215
+
216
+ arch_efi_call_virt_setup ();
217
+ flags = efi_call_virt_save_flags ();
214
218
215
219
switch (efi_rts_work .efi_rts_id ) {
216
220
case EFI_GET_TIME :
@@ -287,6 +291,10 @@ static void efi_call_rts(struct work_struct *work)
287
291
*/
288
292
pr_err ("Requested executing invalid EFI Runtime Service.\n" );
289
293
}
294
+
295
+ efi_call_virt_check_flags (flags , efi_rts_work .caller );
296
+ arch_efi_call_virt_teardown ();
297
+
290
298
efi_rts_work .status = status ;
291
299
complete (& efi_rts_work .efi_rts_comp );
292
300
}
@@ -296,6 +304,7 @@ static efi_status_t __efi_queue_work(enum efi_rts_ids id,
296
304
{
297
305
efi_rts_work .efi_rts_id = id ;
298
306
efi_rts_work .args = args ;
307
+ efi_rts_work .caller = __builtin_return_address (0 );
299
308
efi_rts_work .status = EFI_ABORTED ;
300
309
301
310
if (!efi_enabled (EFI_RUNTIME_SERVICES )) {
@@ -423,8 +432,8 @@ virt_efi_set_variable_nonblocking(efi_char16_t *name, efi_guid_t *vendor,
423
432
if (down_trylock (& efi_runtime_lock ))
424
433
return EFI_NOT_READY ;
425
434
426
- status = efi_call_virt ( set_variable , name , vendor , attr , data_size ,
427
- data );
435
+ status = efi_call_virt_pointer ( efi . runtime , set_variable , name , vendor ,
436
+ attr , data_size , data );
428
437
up (& efi_runtime_lock );
429
438
return status ;
430
439
}
@@ -462,8 +471,9 @@ virt_efi_query_variable_info_nonblocking(u32 attr,
462
471
if (down_trylock (& efi_runtime_lock ))
463
472
return EFI_NOT_READY ;
464
473
465
- status = efi_call_virt (query_variable_info , attr , storage_space ,
466
- remaining_space , max_variable_size );
474
+ status = efi_call_virt_pointer (efi .runtime , query_variable_info , attr ,
475
+ storage_space , remaining_space ,
476
+ max_variable_size );
467
477
up (& efi_runtime_lock );
468
478
return status ;
469
479
}
0 commit comments