Skip to contentSkip to conversation

x86/efi: remove unreachable efi_halt_system() function

PATCH In review Roger Pau Monne 3 participants 3 messages Feb 24 – Mar 2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/efi: remove unreachable efi_halt_system() function

After e4c3755d4dd7 the function efi_halt_system() is unreachable, remove it from the file.

No functional change expected, as the function is not called.

Fixes e4c3755d4dd7 ("x86-64/EFI: don't call EfiResetSystem() from machine_halt()")
---
 xen/common/efi/common-stub.c |  1 -
 xen/common/efi/runtime.c     | 13 -------------
 xen/include/xen/efi.h        |  1 -
 3 files changed, 15 deletions(-)
xen/common/efi/common-stub.c +0 -1
index 77f138a6c574..9dc8aa538cc1 100644
@@ -18,7 +18,6 @@ unsigned long efi_get_time(void)
     return 0;
 }
 
-void efi_halt_system(void) { }
 void efi_reset_system(bool warm) { }
 
 int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
xen/common/efi/runtime.c +0 -13
index f786ceb00763..ba27c62132d2 100644
@@ -188,19 +188,6 @@ unsigned long efi_get_time(void)
                   time.Hour, time.Minute, time.Second);
 }
 
-void efi_halt_system(void)
-{
-    EFI_STATUS status;
-    struct efi_rs_state state = efi_rs_enter();
-
-    if ( !state.cr3 )
-        return;
-    status = efi_rs->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL);
-    efi_rs_leave(&state);
-
-    printk(XENLOG_WARNING "EFI: could not halt system (%#lx)\n", status);
-}
-
 void efi_reset_system(bool warm)
 {
     EFI_STATUS status;
xen/include/xen/efi.h +0 -1
index 723cb8085270..2e36b01e205b 100644
@@ -42,7 +42,6 @@ void efi_init_memory(void);
 bool efi_boot_mem_unused(unsigned long *start, unsigned long *end);
 bool efi_rs_using_pgtables(void);
 unsigned long efi_get_time(void);
-void efi_halt_system(void);
 void efi_reset_system(bool warm);
 #ifndef COMPAT
 int efi_get_info(uint32_t idx, union xenpf_efi_info *info);
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Roger Pau Monne

After e4c3755d4dd7 the function efi_halt_system() is unreachable, remove it from the file.

No functional change expected, as the function is not called.

Fixes e4c3755d4dd7 ("x86-64/EFI: don't call EfiResetSystem() from machine_halt()")

I see this dropped with --gc-sections, FWIW.

Thanks,
Jason

#2 lore raw
Quoted 10 lines · Jason Andryuk
Quoted 7 lines · Roger Pau Monne

After e4c3755d4dd7 the function efi_halt_system() is unreachable, remove it from the file.

No functional change expected, as the function is not called.

Fixes e4c3755d4dd7 ("x86-64/EFI: don't call EfiResetSystem() from machine_halt()")
Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab