Skip to contentSkip to conversation

drivers/firmware/efi/runtime-wrappers.c:350:51: error: passing argument 1 of 'efi.runtime-><U4280>.get_time' from incompatible pointer type

PATCH kernel test robot 1 participant 1 message Oct 16 EFI

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
head:   0d950fa5f7bfd3c9e7760a83b4970dc31603b043
commit: 0d950fa5f7bfd3c9e7760a83b4970dc31603b043 [27/27] lkdtm: Add more EFI runtime tests
config: loongarch-randconfig-2000-20261016 (https://download.01.org/0day-ci/archive/20261016/[email protected]/config)
compiler: loongarch64-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261016/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from drivers/firmware/efi/runtime-wrappers.c:28:
drivers/firmware/efi/runtime-wrappers.c: In function 'efi_call_rts':

>> drivers/firmware/efi/runtime-wrappers.c:350:51: error: passing argument 1 of 'efi.runtime-><U4280>.get_time' from incompatible pointer type [-Wincompatible-pointer-types]
     350 |                                        efi.runtime->set_virtual_address_map,
         |                                        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
         |                                                   |
         |                                                   efi_status_t (*)(long unsigned int,  long unsigned int,  u32,  efi_memory_desc_t *) {aka long unsigned int (*)(long unsigned int,  long unsigned int,  unsigned int,  efi_memory_desc_t *)}
   include/linux/efi.h:1178:57: note: in definition of macro 'arch_efi_call_virt'
    1178 | #define arch_efi_call_virt(p, f, args...)       ((p)->f(args))
         |                                                         ^~~~
   drivers/firmware/efi/runtime-wrappers.c:349:26: note: in expansion of macro 'efi_call_virt'
     349 |                 status = efi_call_virt(get_time,
         |                          ^~~~~~~~~~~~~
   drivers/firmware/efi/runtime-wrappers.c:350:51: note: expected 'efi_time_t *' but argument is of type 'efi_status_t (*)(long unsigned int,  long unsigned int,  u32,  efi_memory_desc_t *)' {aka 'long unsigned int (*)(long unsigned int,  long unsigned int,  unsigned int,  efi_memory_desc_t *)'}
   include/linux/efi.h:1178:57: note: in definition of macro 'arch_efi_call_virt'
    1178 | #define arch_efi_call_virt(p, f, args...)       ((p)->f(args))
         |                                                         ^~~~

drivers/firmware/efi/runtime-wrappers.c:349:26: note: in expansion of macro 'efi_call_virt'
349 | status = efi_call_virt(get_time,
| ^~~~~~~~~~~~~

vim +350 drivers/firmware/efi/runtime-wrappers.c

240
241 /*
242 * Calls the appropriate efi_runtime_service() with the appropriate
243 * arguments.
244 */
245 static void __nocfi efi_call_rts(struct work_struct *work)
246 {
247 const union efi_rts_args *args = efi_rts_work.args;
248 efi_status_t status = EFI_NOT_FOUND;
249 unsigned long flags;
250
251 if (!efi_enabled(EFI_RUNTIME_SERVICES))
252 efi_rts_park_worker();
253
254 efi_runtime_lock_owner = current;
255
256 arch_efi_call_virt_setup();
257 flags = efi_call_virt_save_flags();
258
259 switch (efi_rts_work.efi_rts_id) {
260 case EFI_GET_TIME:
261 status = efi_call_virt(get_time,
262 args->GET_TIME.time,
263 args->GET_TIME.capabilities);
264 break;
265 case EFI_SET_TIME:
266 status = efi_call_virt(set_time,
267 args->SET_TIME.time);
268 break;
269 case EFI_GET_WAKEUP_TIME:
270 status = efi_call_virt(get_wakeup_time,

   271					       args->GET_WAKEUP_TIME.enabled,
   272					       args->GET_WAKEUP_TIME.pending,
   273					       args->GET_WAKEUP_TIME.time);
   274			break;
   275		case EFI_SET_WAKEUP_TIME:
   276			status = efi_call_virt(set_wakeup_time,
   277					       args->SET_WAKEUP_TIME.enable,
   278					       args->SET_WAKEUP_TIME.time);
   279			break;
   280		case EFI_GET_VARIABLE:
   281			status = efi_call_virt(get_variable,
   282					       args->GET_VARIABLE.name,
   283					       args->GET_VARIABLE.vendor,
   284					       args->GET_VARIABLE.attr,
   285					       args->GET_VARIABLE.data_size,
   286					       args->GET_VARIABLE.data);
   287			break;
   288		case EFI_GET_NEXT_VARIABLE:
   289			status = efi_call_virt(get_next_variable,
   290					       args->GET_NEXT_VARIABLE.name_size,
   291					       args->GET_NEXT_VARIABLE.name,
   292					       args->GET_NEXT_VARIABLE.vendor);
   293			break;
   294		case EFI_SET_VARIABLE:
   295			status = efi_call_virt(set_variable,
   296					       args->SET_VARIABLE.name,
   297					       args->SET_VARIABLE.vendor,
   298					       args->SET_VARIABLE.attr,
   299					       args->SET_VARIABLE.data_size,
   300					       args->SET_VARIABLE.data);
   301			break;
   302		case EFI_QUERY_VARIABLE_INFO:
   303			status = efi_call_virt(query_variable_info,
   304					       args->QUERY_VARIABLE_INFO.attr,
   305					       args->QUERY_VARIABLE_INFO.storage_space,
   306					       args->QUERY_VARIABLE_INFO.remaining_space,
   307					       args->QUERY_VARIABLE_INFO.max_variable_size);
   308			break;
   309		case EFI_GET_NEXT_HIGH_MONO_COUNT:
   310			status = efi_call_virt(get_next_high_mono_count,
   311					       args->GET_NEXT_HIGH_MONO_COUNT.high_count);
   312			break;
   313		case EFI_UPDATE_CAPSULE:
   314			status = efi_call_virt(update_capsule,
   315					       args->UPDATE_CAPSULE.capsules,
   316					       args->UPDATE_CAPSULE.count,
   317					       args->UPDATE_CAPSULE.sg_list);
   318			break;
   319		case EFI_QUERY_CAPSULE_CAPS:
   320			status = efi_call_virt(query_capsule_caps,
   321					       args->QUERY_CAPSULE_CAPS.capsules,
   322					       args->QUERY_CAPSULE_CAPS.count,
   323					       args->QUERY_CAPSULE_CAPS.max_size,
   324					       args->QUERY_CAPSULE_CAPS.reset_type);
   325			break;
   326		case EFI_ACPI_PRM_HANDLER:
   327	#ifdef CONFIG_ACPI_PRMT
   328			status = arch_efi_call_virt(args, ACPI_PRM_HANDLER.acpi_prm_handler,
   329						    args->ACPI_PRM_HANDLER.param_buffer_addr,
   330						    args->ACPI_PRM_HANDLER.context);
   331			break;
   332	#endif
   333		default:
   334			/*
   335			 * Ideally, we should never reach here because a caller of this
   336			 * function should have put the right efi_runtime_service()
   337			 * function identifier into efi_rts_work->efi_rts_id
   338			 */
   339			pr_err("Requested executing invalid EFI Runtime Service.\n");
   340			break;
   341	
   342	#if IS_ENABLED(CONFIG_LKDTM)
   343		case EFI_LKDTM_RUNTIME_RO_TEST:
   344			/*
   345			 * Call GetTime() with the output argument pointing to
   346			 * executable memory, which should be mapped read-only in the
   347			 * EFI page tables.
   348			 */
   349			status = efi_call_virt(get_time,
 > 350					       efi.runtime->set_virtual_address_map,

351 NULL);
352 break;
353 case EFI_LKDTM_RUNTIME_NX_TEST:
354 /*
355 * Call efi.runtime, which points to a data object in a EFI
356 * runtime region, as if it were a function pointer.
357 */
358 struct { efi_status_t (__efiapi *fn)(int); } s = { (void *)efi.runtime };
359
360 status = arch_efi_call_virt((&s), fn, 0);
361 break;
362 #endif
363 }
364
365 efi_call_virt_check_flags(flags, efi_rts_work.caller);
366 arch_efi_call_virt_teardown();
367
368 /*
369 * EFI runtime services may also have been disabled because the
370 * firmware faulted, but the caller is still waiting for us in that
371 * case. Only park the worker if the caller has given up on it.
372 */
373 if (READ_ONCE(efi_rts_abandoned))
374 efi_rts_park_worker();
375
376 efi_rts_work.status = status;
377 complete(&efi_rts_work.efi_rts_comp);
378 efi_runtime_lock_owner = NULL;
379 }
380

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki