1. 22 Aug, 2023 2 commits
    • Ard Biesheuvel's avatar
      efi/runtime-wrappers: Don't duplicate setup/teardown code · 3c17ae41
      Ard Biesheuvel authored
      Avoid duplicating the EFI arch setup and teardown routine calls numerous
      times in efi_call_rts(). Instead, expand the efi_call_virt_pointer()
      macro into efi_call_rts(), taking the pre and post parts out of the
      switch.
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      3c17ae41
    • Ard Biesheuvel's avatar
      efi/runtime-wrappers: Remove duplicated macro for service returning void · e38abdab
      Ard Biesheuvel authored
      __efi_call_virt() exists as an alternative for efi_call_virt() for the
      sole reason that ResetSystem() returns void, and so we cannot use a call
      to it in the RHS of an assignment.
      
      Given that there is only a single user, let's drop the macro, and expand
      it into the caller. That way, the remaining macro can be tightened
      somewhat in terms of type safety too.
      
      Note that the use of typeof() on the runtime service invocation does not
      result in an actual call being made, but it does require a few pointer
      types to be fixed up and converted into the proper function pointer
      prototypes.
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      e38abdab
  2. 21 Aug, 2023 4 commits
    • Ard Biesheuvel's avatar
      efi/runtime-wrapper: Move workqueue manipulation out of line · c99ba6e5
      Ard Biesheuvel authored
      efi_queue_work() is a macro that implements the non-trivial manipulation
      of the EFI runtime workqueue and completion data structure, most of
      which is generic, and could be shared between all the users of the
      macro. So move it out of the macro and into a new helper function.
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      c99ba6e5
    • Ard Biesheuvel's avatar
      efi/runtime-wrappers: Use type safe encapsulation of call arguments · c7c7bce0
      Ard Biesheuvel authored
      The current code that marshalls the EFI runtime call arguments to hand
      them off to a async helper does so in a type unsafe and slightly messy
      manner - everything is cast to void* except for some integral types that
      are passed by reference and dereferenced on the receiver end.
      
      Let's clean this up a bit, and record the arguments of each runtime
      service invocation exactly as they are issued, in a manner that permits
      the compiler to check the types of the arguments at both ends.
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      c7c7bce0
    • Ard Biesheuvel's avatar
      efi/riscv: Move EFI runtime call setup/teardown helpers out of line · d8ea2ffd
      Ard Biesheuvel authored
      Only the arch_efi_call_virt() macro that some architectures override
      needs to be a macro, given that it is variadic and encapsulates calls
      via function pointers that have different prototypes.
      
      The associated setup and teardown code are not special in this regard,
      and don't need to be instantiated at each call site. So turn them into
      ordinary C functions and move them out of line.
      
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Albert Ou <aou@eecs.berkeley.edu>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      d8ea2ffd
    • Ard Biesheuvel's avatar
      efi/arm64: Move EFI runtime call setup/teardown helpers out of line · c37ce235
      Ard Biesheuvel authored
      Only the arch_efi_call_virt() macro that some architectures override
      needs to be a macro, given that it is variadic and encapsulates calls
      via function pointers that have different prototypes.
      
      The associated setup and teardown code are not special in this regard,
      and don't need to be instantiated at each call site. So turn them into
      ordinary C functions and move them out of line.
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      c37ce235
  3. 03 Aug, 2023 3 commits
  4. 09 Jul, 2023 10 commits
  5. 08 Jul, 2023 21 commits