Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Jan 2008 06:31:59 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 132226 for review
Message-ID:  <200801010631.m016VxDe014502@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=132226

Change 132226 by kmacy@pandemonium:kmacy:xen31 on 2008/01/01 06:31:39

	make sf_buf work on xen

Affected files ...

.. //depot/projects/xen31/sys/i386/i386/vm_machdep.c#3 edit

Differences ...

==== //depot/projects/xen31/sys/i386/i386/vm_machdep.c#3 (text+ko) ====

@@ -265,7 +265,7 @@
 
 	/* Setup to release spin count in fork_exit(). */
 	td2->td_md.md_spinlock_count = 1;
-	td2->td_md.md_saved_flags = PSL_KERNEL | PSL_I;
+	td2->td_md.md_saved_flags = PSL_USER;
 
 	/*
 	 * Now, cpu_switch() can schedule the new process.
@@ -446,7 +446,7 @@
 
 	/* Setup to release spin count in fork_exit(). */
 	td->td_md.md_spinlock_count = 1;
-	td->td_md.md_saved_flags = PSL_KERNEL | PSL_I;
+	td->td_md.md_saved_flags = PSL_USER;
 }
 
 /*
@@ -772,8 +772,11 @@
 	 */
 	ptep = vtopte(sf->kva);
 	opte = *ptep;
+#ifdef XEN
+	PT_SET_MA(sf->kva, xpmap_ptom(VM_PAGE_TO_PHYS(m)) | pgeflag | PG_RW | PG_V);
+#else	
 	*ptep = VM_PAGE_TO_PHYS(m) | pgeflag | PG_RW | PG_V;
-
+#endif
 	/*
 	 * Avoid unnecessary TLB invalidations: If the sf_buf's old
 	 * virtual-to-physical mapping was not used, then any processor
@@ -822,6 +825,14 @@
 	if (sf->ref_count == 0) {
 		TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry);
 		nsfbufsused--;
+#ifdef XEN
+		/*
+		 * Xen doesn't like having dangling R/W mappings
+		 */
+                pmap_qremove(sf->kva, 1);
+                sf->m = NULL;
+                LIST_REMOVE(sf, list_entry);
+#endif
 		if (sf_buf_alloc_want > 0)
 			wakeup_one(&sf_buf_freelist);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801010631.m016VxDe014502>