Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen conditionally include XENPV specific code.



details:   https://anonhg.NetBSD.org/src/rev/94ef01d93946
branches:  trunk
changeset: 839267:94ef01d93946
user:      cherry <cherry%NetBSD.org@localhost>
date:      Tue Feb 12 07:58:26 2019 +0000

description:
conditionally include XENPV specific code.

This explicitly excludes PV only functionality that would be wrong to
attempt to use in other modes, for eg: p2m table management.

diffstat:

 sys/arch/xen/include/pci_machdep.h    |   4 ++--
 sys/arch/xen/x86/hypervisor_machdep.c |  13 +++++++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diffs (85 lines):

diff -r 6b76cf3bb019 -r 94ef01d93946 sys/arch/xen/include/pci_machdep.h
--- a/sys/arch/xen/include/pci_machdep.h        Tue Feb 12 07:16:55 2019 +0000
+++ b/sys/arch/xen/include/pci_machdep.h        Tue Feb 12 07:58:26 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.h,v 1.19 2017/07/16 06:14:24 cherry Exp $ */
+/* $NetBSD: pci_machdep.h,v 1.20 2019/02/12 07:58:26 cherry Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -66,7 +66,7 @@
 
 #include "opt_xen.h"
 
-#ifndef DOM0OPS
+#if !defined(DOM0OPS) && defined(XENPV)
 int            xpci_enumerate_bus(struct pci_softc *, const int *,
                   int (*)(const struct pci_attach_args *),
                   struct pci_attach_args *);
diff -r 6b76cf3bb019 -r 94ef01d93946 sys/arch/xen/x86/hypervisor_machdep.c
--- a/sys/arch/xen/x86/hypervisor_machdep.c     Tue Feb 12 07:16:55 2019 +0000
+++ b/sys/arch/xen/x86/hypervisor_machdep.c     Tue Feb 12 07:58:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hypervisor_machdep.c,v 1.34 2018/12/25 06:50:12 cherry Exp $   */
+/*     $NetBSD: hypervisor_machdep.c,v 1.35 2019/02/12 07:58:26 cherry Exp $   */
 
 /*
  *
@@ -54,7 +54,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.34 2018/12/25 06:50:12 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.35 2019/02/12 07:58:26 cherry Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,6 +74,7 @@
 #include "isa.h"
 #include "pci.h"
 
+#ifdef XENPV
 /*
  * arch-dependent p2m frame lists list (L3 and L2)
  * used by Xen for save/restore mappings
@@ -85,6 +86,8 @@
 static void build_p2m_frame_list_list(void);
 static void update_p2m_frame_list_list(void);
 
+#endif
+
 // #define PORT_DEBUG 4
 // #define EARLY_DEBUG_EVENT
 
@@ -434,21 +437,26 @@
 void
 hypervisor_machdep_attach(void)
 {
+#ifdef XENPV
        /* dom0 does not require the arch-dependent P2M translation table */
        if (!xendomain_is_dom0()) {
                build_p2m_frame_list_list();
                sysctl_xen_suspend_setup();
        }
+#endif
 }
 
 void
 hypervisor_machdep_resume(void)
 {
+#ifdef XENPV
        /* dom0 does not require the arch-dependent P2M translation table */
        if (!xendomain_is_dom0())
                update_p2m_frame_list_list();
+#endif
 }
 
+#ifdef XENPV
 /*
  * Generate the p2m_frame_list_list table,
  * needed for guest save/restore
@@ -532,3 +540,4 @@
         HYPERVISOR_shared_info->arch.max_pfn = max_pfn;
 
 }
+#endif /* XENPV */



Home | Main Index | Thread Index | Old Index