From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Herrmann Subject: [PATCH 15/15] MIPS: paravirt: Provide _machine_halt function to exit VM on shutdown of guest Date: Tue, 20 May 2014 16:47:16 +0200 Message-ID: <1400597236-11352-16-git-send-email-andreas.herrmann@caviumnetworks.com> References: <1400597236-11352-1-git-send-email-andreas.herrmann@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain Cc: David Daney , Andreas Herrmann , Ralf Baechle , James Hogan , To: Return-path: Received: from mail-bl2lp0209.outbound.protection.outlook.com ([207.46.163.209]:13158 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753913AbaETOuD (ORCPT ); Tue, 20 May 2014 10:50:03 -0400 In-Reply-To: <1400597236-11352-1-git-send-email-andreas.herrmann@caviumnetworks.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Andreas Herrmann --- arch/mips/paravirt/setup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/mips/paravirt/setup.c b/arch/mips/paravirt/setup.c index f80c3bc..6d2781c 100644 --- a/arch/mips/paravirt/setup.c +++ b/arch/mips/paravirt/setup.c @@ -8,6 +8,7 @@ #include +#include #include #include #include @@ -27,6 +28,11 @@ void __init plat_time_init(void) preset_lpj = mips_hpt_frequency / (2 * HZ); } +static void pv_machine_halt(void) +{ + hypcall0(1 /* Exit VM */); +} + /* * Early entry point for arch setup */ @@ -47,6 +53,7 @@ void __init prom_init(void) if (i < argc - 1) strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE); } + _machine_halt = pv_machine_halt; register_smp_ops(¶virt_smp_ops); } -- 1.7.9.5