Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jul 2021 15:27:59 GMT
From:      =?utf-8?Q?Roger Pau Monn=C3=A9?= <royger@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 0b4f30c2366c - main - xen/control: introduce xen_pv_shutdown_handler()
Message-ID:  <202107281527.16SFRxLu088101@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by royger:

URL: https://cgit.FreeBSD.org/src/commit/?id=0b4f30c2366c658ea158590cfe621b8229a210e3

commit 0b4f30c2366c658ea158590cfe621b8229a210e3
Author:     Julien Grall <julien@xen.org>
AuthorDate: 2014-04-04 23:52:05 +0000
Commit:     Roger Pau Monné <royger@FreeBSD.org>
CommitDate: 2021-07-28 15:27:04 +0000

    xen/control: introduce xen_pv_shutdown_handler()
    
    While x86 only register PV shutdown handler for PV guests. ARM guests
    are always using HVM and requires the PV shutdown handler.
    
    Submitted by: Elliott Mitchell <ehem+freebsd@m5p.com>
    Reviewed by: royger
    Differential Revision: https://reviews.freebsd.org/D29406
---
 sys/dev/xen/control/control.c | 2 +-
 sys/x86/include/xen/xen-os.h  | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c
index 57251a10e6eb..f72193edceea 100644
--- a/sys/dev/xen/control/control.c
+++ b/sys/dev/xen/control/control.c
@@ -446,7 +446,7 @@ xctrl_attach(device_t dev)
 	xctrl->xctrl_watch.max_pending = 1;
 	xs_register_watch(&xctrl->xctrl_watch);
 
-	if (xen_pv_domain())
+	if (xen_pv_shutdown_handler())
 		EVENTHANDLER_REGISTER(shutdown_final, xen_pv_shutdown_final, NULL,
 		                      SHUTDOWN_PRI_LAST);
 
diff --git a/sys/x86/include/xen/xen-os.h b/sys/x86/include/xen/xen-os.h
index 37463a8b069c..5b3b912e0891 100644
--- a/sys/x86/include/xen/xen-os.h
+++ b/sys/x86/include/xen/xen-os.h
@@ -49,6 +49,13 @@ extern int xen_disable_pv_disks;
 /* tunable for disabling PV nics */
 extern int xen_disable_pv_nics;
 
+static inline bool
+xen_pv_shutdown_handler(void)
+{
+
+	return (xen_pv_domain());
+}
+
 static inline bool
 xen_pv_disks_disabled(void)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107281527.16SFRxLu088101>