lkml.org 
[lkml]   [2017]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 08/10] x86: jailhouse: Halt instead of failing to restart
Date
From: Jan Kiszka <jan.kiszka@siemens.com>

Jailhouse provides no guest-initiated restart. So, do not even try to.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
arch/x86/kernel/jailhouse.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/x86/kernel/jailhouse.c b/arch/x86/kernel/jailhouse.c
index c1ed7fcd7bfa..0bcca175c35e 100644
--- a/arch/x86/kernel/jailhouse.c
+++ b/arch/x86/kernel/jailhouse.c
@@ -12,10 +12,12 @@

#include <linux/acpi_pmtmr.h>
#include <linux/kernel.h>
+#include <linux/reboot.h>
#include <asm/apic.h>
#include <asm/cpu.h>
#include <asm/hypervisor.h>
#include <asm/i8259.h>
+#include <asm/reboot.h>
#include <asm/setup.h>

#define SETUP_JAILHOUSE 0x53484c4a /* "JLHS" */
@@ -133,6 +135,12 @@ static unsigned long jailhouse_calibrate_tsc(void)
return 0;
}

+static void jailhouse_no_restart(void)
+{
+ pr_notice("Jailhouse: Restart not supported, halting\n");
+ machine_halt();
+}
+
static unsigned int x2apic_get_apic_id(unsigned long id)
{
return id;
@@ -153,6 +161,8 @@ static void __init jailhouse_init_platform(void)
x86_platform.calibrate_cpu = jailhouse_calibrate_cpu;
x86_platform.calibrate_tsc = jailhouse_calibrate_tsc;

+ machine_ops.emergency_restart = jailhouse_no_restart;
+
data = early_memremap(pa_data, sizeof(*data));

if (data->header.type != SETUP_JAILHOUSE ||
--
2.12.3
\
 
 \ /
  Last update: 2017-11-16 08:36    [W:0.165 / U:7.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site