From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Herrmann Subject: Re: [PATCH 15/15] MIPS: paravirt: Provide _machine_halt function to exit VM on shutdown of guest Date: Thu, 29 May 2014 00:04:18 +0200 Message-ID: <20140528220418.GA6335@alberich> References: <1400597236-11352-1-git-send-email-andreas.herrmann@caviumnetworks.com> <1400597236-11352-16-git-send-email-andreas.herrmann@caviumnetworks.com> <537CADD1.5020006@imgtec.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Cc: , David Daney , Ralf Baechle , To: James Hogan Return-path: Received: from mail-bn1blp0184.outbound.protection.outlook.com ([207.46.163.184]:16707 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752058AbaE1WFK (ORCPT ); Wed, 28 May 2014 18:05:10 -0400 Content-Disposition: inline In-Reply-To: <537CADD1.5020006@imgtec.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, May 21, 2014 at 02:44:49PM +0100, James Hogan wrote: > On 20/05/14 15:47, Andreas Herrmann wrote: > > Signed-off-by: Andreas Herrmann > > Does it make sense to provide a _machine_restart too? Hmm, I've not seen a real need for this so far. (Halting the guest and relaunching it from the shell with lkvm was fast enough for my tests ;-) But it's worth to get it working. I might be wrong but I think that this requires lkvm changes to actually handle the reboot. > I think this should be squashed into patch 10 really, Done that. > or else patch 10 > split up into several parts (irq, smp, serial, other). Still kept the pci stuff as a separate patch in case that it might be replaced with something based on "PCI: Generic Configuration Access Mechanism support" (https://lkml.org/lkml/2014/5/18/54) or similar. Andreas > Cheers > James > > > --- > > 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); > > } > > > >