4040 * code doesn't get too cluttered:
4141 */
4242#define efi_call_virt (f , args ...) \
43- efi_call_virt_pointer (efi.runtime, f, args)
43+ arch_efi_call_virt (efi.runtime, f, args)
4444
4545union efi_rts_args {
4646 struct {
@@ -139,7 +139,7 @@ unsigned long efi_call_virt_save_flags(void)
139139 return flags ;
140140}
141141
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 )
143143{
144144 unsigned long cur_flags , mismatch ;
145145
@@ -150,8 +150,8 @@ void efi_call_virt_check_flags(unsigned long flags, const char *call)
150150 return ;
151151
152152 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 ) );
155155 arch_efi_restore_flags (flags );
156156}
157157
@@ -211,6 +211,10 @@ static void efi_call_rts(struct work_struct *work)
211211{
212212 const union efi_rts_args * args = efi_rts_work .args ;
213213 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 ();
214218
215219 switch (efi_rts_work .efi_rts_id ) {
216220 case EFI_GET_TIME :
@@ -287,6 +291,10 @@ static void efi_call_rts(struct work_struct *work)
287291 */
288292 pr_err ("Requested executing invalid EFI Runtime Service.\n" );
289293 }
294+
295+ efi_call_virt_check_flags (flags , efi_rts_work .caller );
296+ arch_efi_call_virt_teardown ();
297+
290298 efi_rts_work .status = status ;
291299 complete (& efi_rts_work .efi_rts_comp );
292300}
@@ -296,6 +304,7 @@ static efi_status_t __efi_queue_work(enum efi_rts_ids id,
296304{
297305 efi_rts_work .efi_rts_id = id ;
298306 efi_rts_work .args = args ;
307+ efi_rts_work .caller = __builtin_return_address (0 );
299308 efi_rts_work .status = EFI_ABORTED ;
300309
301310 if (!efi_enabled (EFI_RUNTIME_SERVICES )) {
@@ -423,8 +432,8 @@ virt_efi_set_variable_nonblocking(efi_char16_t *name, efi_guid_t *vendor,
423432 if (down_trylock (& efi_runtime_lock ))
424433 return EFI_NOT_READY ;
425434
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 );
428437 up (& efi_runtime_lock );
429438 return status ;
430439}
@@ -462,8 +471,9 @@ virt_efi_query_variable_info_nonblocking(u32 attr,
462471 if (down_trylock (& efi_runtime_lock ))
463472 return EFI_NOT_READY ;
464473
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 );
467477 up (& efi_runtime_lock );
468478 return status ;
469479}
0 commit comments