Skip to content

Commit fd49807

Browse files
jan-kiszkaKAGA-KOKO
authored andcommitted
x86/jailhouse: Halt instead of failing to restart
Jailhouse provides no guest-initiated restart. So, do not even try to. Signed-off-by: Jan Kiszka <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/ef8a0ef95c2b17c21066e5f28ea56b58bf7eaa82.1511770314.git.jan.kiszka@siemens.com
1 parent 5ae4443 commit fd49807

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

arch/x86/kernel/jailhouse.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010

1111
#include <linux/acpi_pmtmr.h>
1212
#include <linux/kernel.h>
13+
#include <linux/reboot.h>
1314
#include <asm/apic.h>
1415
#include <asm/cpu.h>
1516
#include <asm/hypervisor.h>
1617
#include <asm/i8259.h>
18+
#include <asm/reboot.h>
1719
#include <asm/setup.h>
1820

1921
static __initdata struct jailhouse_setup_data setup_data;
@@ -77,6 +79,12 @@ static void __init jailhouse_get_smp_config(unsigned int early)
7779
smp_found_config = 1;
7880
}
7981

82+
static void jailhouse_no_restart(void)
83+
{
84+
pr_notice("Jailhouse: Restart not supported, halting\n");
85+
machine_halt();
86+
}
87+
8088
static void __init jailhouse_init_platform(void)
8189
{
8290
u64 pa_data = boot_params.hdr.setup_data;
@@ -96,6 +104,8 @@ static void __init jailhouse_init_platform(void)
96104

97105
legacy_pic = &null_legacy_pic;
98106

107+
machine_ops.emergency_restart = jailhouse_no_restart;
108+
99109
while (pa_data) {
100110
mapping = early_memremap(pa_data, sizeof(header));
101111
memcpy(&header, mapping, sizeof(header));

0 commit comments

Comments
 (0)