From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH v9 01/11] xen: introduce SHUTDOWN_soft_reset shutdown reason Date: Thu, 16 Jul 2015 14:42:34 -0400 Message-ID: <20150716184233.GE14309@x230.dumpdata.com> References: <1437064046-12174-1-git-send-email-vkuznets@redhat.com> <1437064046-12174-2-git-send-email-vkuznets@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZFo7Q-0007hI-Hf for xen-devel@lists.xenproject.org; Thu, 16 Jul 2015 18:42:52 +0000 Content-Disposition: inline In-Reply-To: <1437064046-12174-2-git-send-email-vkuznets@redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vitaly Kuznetsov Cc: Wei Liu , Andrew Jones , Keir Fraser , Ian Campbell , Stefano Stabellini , Andrew Cooper , Julien Grall , Ian Jackson , Olaf Hering , Tim Deegan , David Vrabel , Jan Beulich , xen-devel@lists.xenproject.org, Daniel De Graaf List-Id: xen-devel@lists.xenproject.org On Thu, Jul 16, 2015 at 06:27:16PM +0200, Vitaly Kuznetsov wrote: > This special type of shutdown is supposed to be used by PVHVM guests when > they want to perform some sort of kexec/kdump. > > Signed-off-by: Vitaly Kuznetsov Reviewed-by: Konrad Rzeszutek Wilk > --- > Changes since v8: > - describe the expected behavior for 'soft reset' [Ian Jackson] > --- > xen/common/shutdown.c | 6 ++++++ > xen/include/public/sched.h | 11 ++++++++++- > 2 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/xen/common/shutdown.c b/xen/common/shutdown.c > index 9cfbf7a..03a8641 100644 > --- a/xen/common/shutdown.c > +++ b/xen/common/shutdown.c > @@ -66,6 +66,12 @@ void hwdom_shutdown(u8 reason) > machine_restart(0); > break; /* not reached */ > > + case SHUTDOWN_soft_reset: > + printk("Hardware domain %d did unsupported soft reset, rebooting.\n", > + hardware_domain->domain_id); > + machine_restart(0); > + break; /* not reached */ > + > default: > printk("Hardware Dom%u shutdown (unknown reason %u): ", > hardware_domain->domain_id, reason); > diff --git a/xen/include/public/sched.h b/xen/include/public/sched.h > index 4000ac9..b91bb9b 100644 > --- a/xen/include/public/sched.h > +++ b/xen/include/public/sched.h > @@ -159,7 +159,16 @@ DEFINE_XEN_GUEST_HANDLE(sched_watchdog_t); > #define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */ > #define SHUTDOWN_crash 3 /* Tell controller we've crashed. */ > #define SHUTDOWN_watchdog 4 /* Restart because watchdog time expired. */ > -#define SHUTDOWN_MAX 4 /* Maximum valid shutdown reason. */ > + > +/* > + * Domain asked to perform 'soft reset' for it. The expected behavior is to > + * reset internal Xen state for the domain returning it to the point where it > + * was created but leaving the domain's memory and vCPU contexts intact. This > + * will allow the domain to start over and set up all Xen specific interfaces > + * again. > + */ > +#define SHUTDOWN_soft_reset 5 > +#define SHUTDOWN_MAX 5 /* Maximum valid shutdown reason. */ > /* ` } */ > > #endif /* __XEN_PUBLIC_SCHED_H__ */ > -- > 2.4.3 >