I am working on a tiny x86 64 bit kernel that is multiboot2 compliant, the kernel is loaded and launched by Grub. The requirement is that, once the kernel finishes its activity it needs to relaunch Grub. In non UEFI based systems, we used to achieve this by bringing the processor back to real mode jumping to address 0x7c00.
With UEFI systems, I am trying to understand if something similar is feasible, one possible approach in my mind is to reload Grub from the kernel using the EFI_IMAGE_LOAD and EFI_IMAGE_START routines in the EFI boot services table. My understanding of UEFI internals are very limited, it would be greatly helpful if someone can confirm if this approach will work or not.