Pending the OS-supported hibernate functionality, prevent requesting S4
when S4BIOS is not supported.
To this end, make sure that acpi_supported_stypes[] indicates that
POWER_STYPE_FW_HIBERNATE is not supported if 'acpi_s4bios_supported' is
false, even if S4 is supported by the platform (which is only
a power-down-like state, without any support to save the system image by
itself). This will cause requests to enter S4, which are translated to
POWER_STYPE_FW_HIBERNATE before reaching
acpi_ReqSleepState()/acpi_EnterSleepState(), to fail in this case.
Retire the 'hw.acpi.s4bios' sysctl knob, as having it to 0 by default
(S4BIOS not supported) or setting it to 0 (default is 1 when S4BIOS is
supported) could only lead, on a S4 request, to a power down without any
possibility to restore the system (and, since a recent commit, it has
not been possible anymore to force it to 1 when S4BIOS is not announced
supported in the FACS table, which would cause a failure or a crash).
When OS-supported hibernate is introduced, it will become the default
hibernate method over S4BIOS, as we have not heard of any semi-recent
hardware platform implementing it (and when it is, it usually needs
a sufficiently large dedicated slice/partition, and does not use FreeBSD
swap slices/partitions). Then, for people still wanting to use S4BIOS
on older platforms that support it, the tentative plans are to modify
acpiconf(8) to accept '4BIOS' as an argument to '-s', or modify zzz(8)
so that one can pass a specific suspension method.
Sponsored by: The FreeBSD Foundation