Module Name:    src
Committed By:   cherry
Date:           Wed Feb 13 06:52:43 UTC 2019

Modified Files:
        src/sys/arch/xen/include: xenpmap.h
        src/sys/arch/xen/xen: evtchn.c hypervisor.c xen_machdep.c

Log Message:
Further restrict the scope of XENPV to relevant parts.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/xen/include/xenpmap.h
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/xen/xen/evtchn.c
cvs rdiff -u -r1.70 -r1.71 src/sys/arch/xen/xen/hypervisor.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/xen/xen/xen_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/include/xenpmap.h
diff -u src/sys/arch/xen/include/xenpmap.h:1.40 src/sys/arch/xen/include/xenpmap.h:1.41
--- src/sys/arch/xen/include/xenpmap.h:1.40	Thu Jul 26 17:20:08 2018
+++ src/sys/arch/xen/include/xenpmap.h	Wed Feb 13 06:52:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: xenpmap.h,v 1.40 2018/07/26 17:20:08 maxv Exp $	*/
+/*	$NetBSD: xenpmap.h,v 1.41 2019/02/13 06:52:43 cherry Exp $	*/
 
 /*
  *
@@ -72,6 +72,7 @@ void xen_kpm_sync(struct pmap *, int);
 #define xpq_queue_pin_l4_table(pa)	\
 	xpq_queue_pin_table(pa, MMUEXT_PIN_L4_TABLE)
 
+#ifdef XENPV
 extern unsigned long *xpmap_phys_to_machine_mapping;
 
 static __inline paddr_t
@@ -121,6 +122,8 @@ xpmap_ptom_isvalid(paddr_t ppa)
 	    != INVALID_P2M_ENTRY);
 }
 
+#endif /* XENPV */
+
 static inline void
 MULTI_update_va_mapping(
 	multicall_entry_t *mcl, vaddr_t va,

Index: src/sys/arch/xen/xen/evtchn.c
diff -u src/sys/arch/xen/xen/evtchn.c:1.84 src/sys/arch/xen/xen/evtchn.c:1.85
--- src/sys/arch/xen/xen/evtchn.c:1.84	Wed Feb 13 05:01:58 2019
+++ src/sys/arch/xen/xen/evtchn.c	Wed Feb 13 06:52:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: evtchn.c,v 1.84 2019/02/13 05:01:58 cherry Exp $	*/
+/*	$NetBSD: evtchn.c,v 1.85 2019/02/13 06:52:43 cherry Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -54,7 +54,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.84 2019/02/13 05:01:58 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.85 2019/02/13 06:52:43 cherry Exp $");
 
 #include "opt_xen.h"
 #include "isa.h"
@@ -256,6 +256,7 @@ void
 events_init(void)
 {
 	mutex_init(&evtchn_lock, MUTEX_DEFAULT, IPL_NONE);
+#ifdef XENPV
 	debug_port = bind_virq_to_evtch(VIRQ_DEBUG);
 
 	KASSERT(debug_port != -1);
@@ -273,6 +274,7 @@ events_init(void)
 #if NPCI > 0 || NISA > 0
 	hypervisor_ack_pirq_event(debug_port);
 #endif /* NPCI > 0 || NISA > 0 */
+#endif /* XENPV */
 	x86_enable_intr();		/* at long last... */
 }
 
@@ -1080,6 +1082,7 @@ xen_debug_handler(void *arg)
 	return 0;
 }
 
+#ifdef XENPV
 static struct evtsource *
 event_get_handler(const char *intrid)
 {
@@ -1207,3 +1210,4 @@ interrupt_construct_intrids(const kcpuse
 
 	return ii_handler;
 }
+#endif /* XENPV */

Index: src/sys/arch/xen/xen/hypervisor.c
diff -u src/sys/arch/xen/xen/hypervisor.c:1.70 src/sys/arch/xen/xen/hypervisor.c:1.71
--- src/sys/arch/xen/xen/hypervisor.c:1.70	Sat Feb  2 12:32:55 2019
+++ src/sys/arch/xen/xen/hypervisor.c	Wed Feb 13 06:52:43 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.70 2019/02/02 12:32:55 cherry Exp $ */
+/* $NetBSD: hypervisor.c,v 1.71 2019/02/13 06:52:43 cherry Exp $ */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.70 2019/02/02 12:32:55 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.71 2019/02/13 06:52:43 cherry Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -373,20 +373,22 @@ hypervisor_attach(device_t parent, devic
 static bool
 hypervisor_suspend(device_t dev, const pmf_qual_t *qual)
 {
+#ifdef XENPV
 	events_suspend();
 	xengnt_suspend();
-
+#endif
 	return true;
 }
 
 static bool
 hypervisor_resume(device_t dev, const pmf_qual_t *qual)
 {
+#ifdef XENPV
 	hypervisor_machdep_resume();
 
 	xengnt_resume();
 	events_resume();
-
+#endif
 	return true;
 }
 

Index: src/sys/arch/xen/xen/xen_machdep.c
diff -u src/sys/arch/xen/xen/xen_machdep.c:1.20 src/sys/arch/xen/xen/xen_machdep.c:1.21
--- src/sys/arch/xen/xen/xen_machdep.c:1.20	Sat Feb  2 12:32:55 2019
+++ src/sys/arch/xen/xen/xen_machdep.c	Wed Feb 13 06:52:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_machdep.c,v 1.20 2019/02/02 12:32:55 cherry Exp $	*/
+/*	$NetBSD: xen_machdep.c,v 1.21 2019/02/13 06:52:43 cherry Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xen_machdep.c,v 1.20 2019/02/02 12:32:55 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_machdep.c,v 1.21 2019/02/13 06:52:43 cherry Exp $");
 
 #include "opt_xen.h"
 
@@ -80,6 +80,7 @@ u_int	tsc_get_timecount(struct timecount
 
 bool xen_suspend_allow;
 
+#ifdef XENPV
 extern uint64_t tsc_freq;	/* XXX */
 
 static int sysctl_xen_suspend(SYSCTLFN_ARGS);
@@ -419,6 +420,7 @@ xen_suspend_domain(void)
 	aprint_verbose("domain resumed\n");
 
 }
+#endif /* XENPV */
 
 #define PRINTK_BUFSIZE 1024
 void

Reply via email to