Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758564Ab3DXWOe (ORCPT ); Wed, 24 Apr 2013 18:14:34 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:61882 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758532Ab3DXWOd (ORCPT ); Wed, 24 Apr 2013 18:14:33 -0400 X-IronPort-AV: E=Sophos;i="4.87,546,1363132800"; d="scan'208";a="20404007" Date: Wed, 24 Apr 2013 23:14:28 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: Stefano Stabellini CC: "xen-devel@lists.xensource.com" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "konrad.wilk@oracle.com" , Ian Campbell , Marc Zyngier , "will.deacon@arm.com" , "arnd@arndb.de" , "rob.herring@calxeda.com" Subject: Re: [PATCH v4 7/7] mach-virt: support Xen hypercalls for shutdown and reboot In-Reply-To: <1366831695-13214-7-git-send-email-stefano.stabellini@eu.citrix.com> Message-ID: References: <1366831695-13214-7-git-send-email-stefano.stabellini@eu.citrix.com> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2209 Lines: 77 On Wed, 24 Apr 2013, Stefano Stabellini wrote: > Signed-off-by: Stefano Stabellini > CC: Marc Zyngier > CC: will.deacon@arm.com > CC: arnd@arndb.de > CC: rob.herring@calxeda.com Thinking twice about this patch, a less intrusive alternative would be to set arm_pm_restart and pm_power_off to two xen specific functions later on from xen_guest_init. > arch/arm/mach-virt/virt.c | 32 ++++++++++++++++++++++++++++++++ > 1 files changed, 32 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/mach-virt/virt.c b/arch/arm/mach-virt/virt.c > index 528c05e..ba14321 100644 > --- a/arch/arm/mach-virt/virt.c > +++ b/arch/arm/mach-virt/virt.c > @@ -23,13 +23,44 @@ > #include > #include > > +#include > +#include > + > #include > #include > #include > +#include > + > +static void virt_restart(char str, const char *cmd) > +{ > +#ifdef CONFIG_XEN > + if (xen_domain()) { > + struct sched_shutdown r = { .reason = SHUTDOWN_reboot }; > + int rc; > + rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r); > + if (rc) > + BUG(); > + } > +#endif > +} > + > +static void virt_power_off(void) > +{ > +#ifdef CONFIG_XEN > + if (xen_domain()) { > + struct sched_shutdown r = { .reason = SHUTDOWN_poweroff }; > + int rc; > + rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r); > + if (rc) > + BUG(); > + } > +#endif > +} > > static void __init virt_init(void) > { > of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); > + pm_power_off = virt_power_off; > } > > static void __init virt_timer_init(void) > @@ -52,4 +83,5 @@ DT_MACHINE_START(VIRT, "Dummy Virtual Machine") > .init_machine = virt_init, > .smp = smp_ops(virt_smp_ops), > .dt_compat = virt_dt_match, > + .restart = virt_restart, > MACHINE_END > -- > 1.7.2.5 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/