From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vitaly Kuznetsov Subject: [PATCH v7 01/10] xen: introduce SHUTDOWN_soft_reset shutdown reason Date: Wed, 27 May 2015 17:25:37 +0200 Message-ID: <1432740346-7887-2-git-send-email-vkuznets@redhat.com> References: <1432740346-7887-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.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YxdDT-0000r9-Mz for xen-devel@lists.xenproject.org; Wed, 27 May 2015 15:25:59 +0000 In-Reply-To: <1432740346-7887-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. Toolstack will have to build a new domain with the memory content of the original domain and start executing the new one from the point where SHUTDOWN_soft_reset was called. This operation is not supported for PV domains including the hardware domain. Signed-off-by: Vitaly Kuznetsov --- xen/common/shutdown.c | 6 ++++++ xen/include/public/sched.h | 3 ++- 2 files changed, 8 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..800c808 100644 --- a/xen/include/public/sched.h +++ b/xen/include/public/sched.h @@ -159,7 +159,8 @@ 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. */ +#define SHUTDOWN_soft_reset 5 /* Soft reset, rebuild keeping memory content */ +#define SHUTDOWN_MAX 5 /* Maximum valid shutdown reason. */ /* ` } */ #endif /* __XEN_PUBLIC_SCHED_H__ */ -- 1.9.3