Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/bouyer-xenpvh]: src/sys/arch For RB_POWERDONW, call HYPERVISOR_shutdown(...



details:   https://anonhg.NetBSD.org/src/rev/266bd515d8bb
branches:  bouyer-xenpvh
changeset: 982909:266bd515d8bb
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Thu Apr 09 16:12:50 2020 +0000

description:
For RB_POWERDONW, call HYPERVISOR_shutdown() in all cases where the
hypercall page is available. A PVHHVM domU now properly exits on
halt -p

diffstat:

 sys/arch/amd64/amd64/machdep.c |  13 ++++++++-----
 sys/arch/i386/i386/machdep.c   |  14 ++++++++------
 2 files changed, 16 insertions(+), 11 deletions(-)

diffs (69 lines):

diff -r b5cc08e1ff06 -r 266bd515d8bb sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c    Wed Apr 08 17:59:16 2020 +0000
+++ b/sys/arch/amd64/amd64/machdep.c    Thu Apr 09 16:12:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.346 2020/01/31 08:21:11 maxv Exp $       */
+/*     $NetBSD: machdep.c,v 1.346.4.1 2020/04/09 16:12:50 bouyer Exp $ */
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.346 2020/01/31 08:21:11 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.346.4.1 2020/04/09 16:12:50 bouyer Exp $");
 
 #include "opt_modular.h"
 #include "opt_user_ldt.h"
@@ -729,9 +729,12 @@
 
                acpi_enter_sleep_state(ACPI_STATE_S5);
 #endif
-#ifdef XENPV
-               HYPERVISOR_shutdown();
-#endif /* XENPV */
+#ifdef XEN
+               if (vm_guest == VM_GUEST_XENPV ||
+                   vm_guest == VM_GUEST_XENPVH ||
+                   vm_guest == VM_GUEST_XENPVHVM)
+                       HYPERVISOR_shutdown();
+#endif /* XEN */
        }
 
        cpu_broadcast_halt();
diff -r b5cc08e1ff06 -r 266bd515d8bb sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c      Wed Apr 08 17:59:16 2020 +0000
+++ b/sys/arch/i386/i386/machdep.c      Thu Apr 09 16:12:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.825 2020/01/31 08:21:11 maxv Exp $       */
+/*     $NetBSD: machdep.c,v 1.825.4.1 2020/04/09 16:12:50 bouyer Exp $ */
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.825 2020/01/31 08:21:11 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.825.4.1 2020/04/09 16:12:50 bouyer Exp $");
 
 #include "opt_beep.h"
 #include "opt_compat_freebsd.h"
@@ -793,10 +793,12 @@
 #else
                __USE(s);
 #endif
-#ifdef XENPV
-               HYPERVISOR_shutdown();
-               for (;;);
-#endif
+#ifdef XEN
+               if (vm_guest == VM_GUEST_XENPV ||
+                   vm_guest == VM_GUEST_XENPVH ||
+                   vm_guest == VM_GUEST_XENPVHVM)
+                       HYPERVISOR_shutdown();
+#endif /* XEN */
        }
 
 #ifdef MULTIPROCESSOR



Home | Main Index | Thread Index | Old Index