Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/arch/xen/i386 Pull up revision 1.11 via patch (reques...



details:   https://anonhg.NetBSD.org/src/rev/a14fee79c9bd
branches:  netbsd-3
changeset: 575938:a14fee79c9bd
user:      tron <tron%NetBSD.org@localhost>
date:      Sat May 28 16:27:46 2005 +0000

description:
Pull up revision 1.11 via patch (requested by bouyer in ticket #355):
Always call the xpq_queue*() functions at splvm(), so that it's safe to call
them from interrupt context.
xpq_flush_queue() is called from IPL_NET in if_xennet.c, and
other xpq_queue* functions may be called from interrupt context via
pmap_kenter*(). Should fix port-xen/30153.
Thanks to Jason Thorpe and YAMAMOTO Takashi for enlightments on this issue.

diffstat:

 sys/arch/xen/i386/pmap.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (72 lines):

diff -r bff929dd9ff1 -r a14fee79c9bd sys/arch/xen/i386/pmap.c
--- a/sys/arch/xen/i386/pmap.c  Sat May 28 16:23:36 2005 +0000
+++ b/sys/arch/xen/i386/pmap.c  Sat May 28 16:27:46 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.8.2.1 2005/04/21 17:09:06 tron Exp $        */
+/*     $NetBSD: pmap.c,v 1.8.2.2 2005/05/28 16:27:46 tron Exp $        */
 /*     NetBSD: pmap.c,v 1.179 2004/10/10 09:55:24 yamt Exp             */
 
 /*
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.8.2.1 2005/04/21 17:09:06 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.8.2.2 2005/05/28 16:27:46 tron Exp $");
 
 #include "opt_cputype.h"
 #include "opt_user_ldt.h"
@@ -854,6 +854,7 @@
 pte_atomic_update_ma(pt_entry_t *pte, pt_entry_t *mapte, pt_entry_t npte)
 {
        pt_entry_t opte;
+       int s = splvm();
 
        XENPRINTK(("pte_atomic_update_ma pte %p mapte %p npte %08x\n",
                   pte, mapte, npte));
@@ -879,6 +880,7 @@
                        xpq_queue_pte_update(mapte, npte);
        }
        xpq_flush_queue();
+       splx(s);
 
        return opte;
 }
@@ -1895,6 +1897,7 @@
 {
        pd_entry_t *pdir = object;
        paddr_t pdirpa;
+       int s;
 
        /*
         * NOTE: The `pmap_lock' is held when the PDP is allocated.
@@ -1928,8 +1931,10 @@
        pmap_update(pmap_kernel());
 
        /* pin page type */
+       s = splvm();
        xpq_queue_pin_table(xpmap_ptom(pdirpa), XPQ_PIN_L2_TABLE);
        xpq_flush_queue();
+       splx(s);
 
        return (0);
 }
@@ -1939,6 +1944,7 @@
 {
        pd_entry_t *pdir = object;
        paddr_t pdirpa;
+       int s;
 
        /* fetch the physical address of the page directory. */
        pdirpa = PDE_GET(&pdir[PDSLOT_PTE]) & PG_FRAME;
@@ -1946,8 +1952,10 @@
        XENPRINTF(("pmap_pdp_dtor %p %p\n", pdir, (void *)pdirpa));
 
        /* unpin page type */
+       s = splvm();
        xpq_queue_unpin_table(xpmap_ptom(pdirpa));
        xpq_flush_queue();
+       splx(s);
        pmap_enter(pmap_kernel(), (vaddr_t)pdir, pdirpa,
            VM_PROT_READ | VM_PROT_WRITE, VM_PROT_READ | VM_PROT_WRITE);
 #if 0



Home | Main Index | Thread Index | Old Index