Further restrict the scope of XENPV to relevant parts.

This commit is contained in:
cherry 2019-02-13 06:52:43 +00:00
parent 43f97eae48
commit 14037d51a0
4 changed files with 20 additions and 9 deletions

View File

@ -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,

View File

@ -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 kcpuset_t *cpuset)
return ii_handler;
}
#endif /* XENPV */

View File

@ -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, device_t self, void *aux)
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;
}

View File

@ -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 timecounter *);
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