From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vitaly Kuznetsov Subject: [PATCH v9 01/11] xen: introduce SHUTDOWN_soft_reset shutdown reason Date: Thu, 16 Jul 2015 18:27:16 +0200 Message-ID: <1437064046-12174-2-git-send-email-vkuznets@redhat.com> References: <1437064046-12174-1-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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZFm0Z-0004O8-AU for xen-devel@lists.xenproject.org; Thu, 16 Jul 2015 16:27:39 +0000 In-Reply-To: <1437064046-12174-1-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: xen-devel@lists.xenproject.org Cc: Andrew Jones , Julien Grall , Keir Fraser , Ian Campbell , Stefano Stabellini , Andrew Cooper , Ian Jackson , Olaf Hering , Tim Deegan , David Vrabel , Jan Beulich , Wei Liu , Daniel De Graaf List-Id: xen-devel@lists.xenproject.org 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 --- 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