From 0279d8951ead549fdebce93130a2f6c673081862 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Sun, 24 Jul 2016 09:32:10 +1000 Subject: Fast reboot for P8 This is an experimental patch that implements "Fast reboot" on P8 machines. The basic idea is that when the OS calls OPAL reboot, we gather all the threads in the system using a combination of patching the reset vector and soft-resetting them, then cleanup a few bits of hardware (we do re-probe PCIe for example), and reload & restart the bootloader. For Trusted Boot, this means we *add* measurements to the TPM, so you will get *different* PCR values as compared to a full IPL. This makes sense as if you want to be sure you are running something known then, well, do a full IPL as soft reset should never be trusted to clear any malicious code. This is very experimental and needs a lot of testing and also auditing code for other bits of HW that might need to be cleaned up. BenH TODO: I also need to check if we are properly PERST'ing PCI devices. This is partially based on old code I had to do that on P7. I only support it on P8 though as there are issues with the PSI interrupts on P7 that cannot be reliably solved. Even though this should be considered somewhat experimental, we've had a lot of success on a variety of machines. Dozens/hundreds of reboots across Tuleta, Garrison and Habanero. Currently, we've hidden it behind a NVRAM config option, which *is* liable to change in the future (to ensure that only those who know what they're doing enable it) You can enable the experimental support via nvram option: nvram -p ibm,skiboot --update-config experimental-fast-reset=feeling-lucky Signed-off-by: Benjamin Herrenschmidt [stewart@linux.vnet.ibm.com: hide behind nvram option, include Mambo fixes from Mikey] Signed-off-by: Stewart Smith --- hw/fsp/fsp-console.c | 5 +++++ hw/fsp/fsp-leds.c | 3 +++ 2 files changed, 8 insertions(+) (limited to 'hw/fsp') diff --git a/hw/fsp/fsp-console.c b/hw/fsp/fsp-console.c index 44d24cc..0080d73 100644 --- a/hw/fsp/fsp-console.c +++ b/hw/fsp/fsp-console.c @@ -892,6 +892,9 @@ static void reopen_all_hvsi(void) void fsp_console_reset(void) { + if (!fsp_present()) + return; + prlog(PR_NOTICE, "FSP: Console reset !\n"); /* This is called on a fast-reset. To work around issues with HVSI @@ -1001,6 +1004,8 @@ void fsp_console_select_stdout(void) */ } } + dt_check_del_prop(dt_chosen, "linux,stdout-path"); + if (fsp_serials[1].open && use_serial) { dt_add_property_string(dt_chosen, "linux,stdout-path", "/ibm,opal/consoles/serial@1"); diff --git a/hw/fsp/fsp-leds.c b/hw/fsp/fsp-leds.c index 50e82b5..b5a32ad 100644 --- a/hw/fsp/fsp-leds.c +++ b/hw/fsp/fsp-leds.c @@ -1570,6 +1570,9 @@ void create_led_device_nodes(void) if (!pled) return; + /* Check if already populated (fast-reboot) */ + if (dt_has_node_property(pled, "compatible", NULL)) + return; dt_add_property_strings(pled, "compatible", DT_PROPERTY_LED_COMPATIBLE); led_mode = dt_prop_get(pled, DT_PROPERTY_LED_MODE); -- cgit v1.1