On Thu, Aug 20, 2020 at 01:09:03PM -0700, Atish Patra wrote:
On Thu, Aug 20, 2020 at 1:03 PM Heinrich Schuchardt xypron.glpk@gmx.de wrote:
On 8/20/20 9:32 PM, Atish Patra wrote:
On Thu, Aug 20, 2020 at 8:46 AM Grant Likely <grant.likely@arm.com mailto:grant.likely@arm.com> wrote: > 2. RISC-V related sections in EBBR > a. UEFI: > Currently, RISC-V doesn't support a EFI_RESET_SYSTEM boot > service as firmware doesn't have a standard way > to reset the system. There is a proposal to add a system reset > function to Supervisor Binary Specification(SBI) which > can be mapped to EFI_RESET_SYSTEM by the firmware. Apart from > that, I believe RISC-V supports all UEFI boot and > run time services mandated by EBBR. Is it a blocker for RISC-V > EBBR compatibility?
Reset system if a fundamental interface. I'm not keen to relax this requirement.
As per the specification, Reset system is only mandatory for boot services. But I couldn't find anything in the EFI stub in the kernel that actually invokes it. I see only watchdog in U-boot using it to comply with the watchdog requirement of UEFI spec. I am not sure if EDK2 has other usages. Is it supposed to be used by the firmware/boot loader only ?
Usages of the service can be found in:
- GRUB (command reboot)
- iPXE (commands reboot, poweroff)
- EFI shell (command reset)
Linux uses it in
- arch/x86/kernel/reboot.c
- arch/arm64/kernel/process.c
via function efi_reboot() implemented in drivers/firmware/efi/reboot.c.
As per my understanding, efi_reboot uses the runtime efi service that gets called after ExitBootService(). This is marked optional in the EBBR spec. I was talking about the reset_system user as a boot service.
As per EBBR spec, "ResetSystem() is required to be implemented in boot services, but it is optional for runtime services"
That might actually be an Armism creeping in!
IIRC reboot discussions were annoyingly complex because, on Arm, systems both UEFI *and* PSCI provided a means to reboot the device (and naturally there had been historic firmware bugs where only one of them worked). Hence the language about falling back to architecture specific things (e.g. PSCI).
If RISC-V platforms don't have any alternative architecture specific approaches then they are would likely benefit from ResetSystem() being mandatory.
Daniel.