svn commit: r184042 - head/sys/kern
Kip Macy
kmacy at FreeBSD.org
Sun Oct 19 01:35:27 UTC 2008
Author: kmacy
Date: Sun Oct 19 01:35:27 2008
New Revision: 184042
URL: http://svn.freebsd.org/changeset/base/184042
Log:
- Forward port flush of page table updates on context switch or userret
- Forward port vfork XEN hack
Modified:
head/sys/kern/kern_fork.c
head/sys/kern/kern_synch.c
head/sys/kern/subr_trap.c
Modified: head/sys/kern/kern_fork.c
==============================================================================
--- head/sys/kern/kern_fork.c Sun Oct 19 01:33:58 2008 (r184041)
+++ head/sys/kern/kern_fork.c Sun Oct 19 01:35:27 2008 (r184042)
@@ -117,10 +117,15 @@ vfork(td, uap)
struct thread *td;
struct vfork_args *uap;
{
- int error;
+ int error, flags;
struct proc *p2;
- error = fork1(td, RFFDG | RFPROC | RFPPWAIT | RFMEM, 0, &p2);
+#ifdef XEN
+ flags = RFFDG | RFPROC; /* validate that this is still an issue */
+#else
+ flags = RFFDG | RFPROC | RFPPWAIT | RFMEM;
+#endif
+ error = fork1(td, flags, 0, &p2);
if (error == 0) {
td->td_retval[0] = p2->p_pid;
td->td_retval[1] = 0;
Modified: head/sys/kern/kern_synch.c
==============================================================================
--- head/sys/kern/kern_synch.c Sun Oct 19 01:33:58 2008 (r184041)
+++ head/sys/kern/kern_synch.c Sun Oct 19 01:35:27 2008 (r184042)
@@ -65,6 +65,12 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
+#ifdef XEN
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/pmap.h>
+#endif
+
static void synch_setup(void *dummy);
SYSINIT(synch_setup, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, synch_setup,
NULL);
@@ -432,6 +438,9 @@ mi_switch(int flags, struct thread *newt
td, td->td_name, td->td_priority,
td->td_inhibitors, td->td_wmesg, td->td_lockname);
#endif
+#ifdef XEN
+ PT_UPDATES_FLUSH();
+#endif
sched_switch(td, newtd, flags);
CTR3(KTR_SCHED, "mi_switch: running %p(%s) prio %d",
td, td->td_name, td->td_priority);
Modified: head/sys/kern/subr_trap.c
==============================================================================
--- head/sys/kern/subr_trap.c Sun Oct 19 01:33:58 2008 (r184041)
+++ head/sys/kern/subr_trap.c Sun Oct 19 01:35:27 2008 (r184042)
@@ -73,6 +73,12 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
#include <machine/pcb.h>
+#ifdef XEN
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/pmap.h>
+#endif
+
#include <security/mac/mac_framework.h>
/*
@@ -118,6 +124,9 @@ userret(struct thread *td, struct trapfr
sched_userret(td);
KASSERT(td->td_locks == 0,
("userret: Returning with %d locks held.", td->td_locks));
+#ifdef XEN
+ PT_UPDATES_FLUSH();
+#endif
}
/*
More information about the svn-src-all
mailing list