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/xen Pull up revision 1.25 (requested by bouy...



details:   https://anonhg.NetBSD.org/src/rev/11f86c72b80f
branches:  netbsd-3
changeset: 575941:11f86c72b80f
user:      tron <tron%NetBSD.org@localhost>
date:      Sat May 28 16:28:14 2005 +0000

description:
Pull up revision 1.25 (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/xen/if_xennet.c |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (82 lines):

diff -r 6551a14dd855 -r 11f86c72b80f sys/arch/xen/xen/if_xennet.c
--- a/sys/arch/xen/xen/if_xennet.c      Sat May 28 16:28:07 2005 +0000
+++ b/sys/arch/xen/xen/if_xennet.c      Sat May 28 16:28:14 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_xennet.c,v 1.13.2.9 2005/05/27 23:03:59 riz Exp $   */
+/*     $NetBSD: if_xennet.c,v 1.13.2.10 2005/05/28 16:28:14 tron Exp $ */
 
 /*
  *
@@ -33,7 +33,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.13.2.9 2005/05/27 23:03:59 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet.c,v 1.13.2.10 2005/05/28 16:28:14 tron Exp $");
 
 #include "opt_inet.h"
 #include "rnd.h"
@@ -560,6 +560,7 @@
 {
        NETIF_RING_IDX ringidx;
        int nr_pfns;
+       int s;
 
        ringidx = sc->sc_rx->req_prod;
        nr_pfns = 0;
@@ -600,7 +601,9 @@
         * outstanding in the page update queue -- make sure we flush
         * those first!
         */
+       s = splvm();
        xpq_flush_queue();
+       splx(s);
 
        /* After all PTEs have been zapped we blow away stale TLB entries. */
        rx_mcl[nr_pfns-1].args[2] = UVMF_FLUSH_TLB;
@@ -841,7 +844,7 @@
        struct vm_page *pg;
        int id, nr_pfns;
        NETIF_RING_IDX ringidx;
-       int s;
+       int snet, svm;
 
        ringidx = sc->sc_rx->req_prod;
        if ((ringidx - sc->sc_rx_resp_cons) > (RX_MAX_ENTRIES / 2))
@@ -852,7 +855,7 @@
        rxpages = uvm_km_valloc_align(kernel_map, RX_ENTRIES * PAGE_SIZE,
            PAGE_SIZE);
 
-       s = splnet();
+       snet = splnet();
        for (va = rxpages; va < rxpages + RX_ENTRIES * PAGE_SIZE;
             va += PAGE_SIZE) {
                pg = uvm_pagealloc(NULL, 0, NULL, 0);
@@ -897,7 +900,7 @@
        }
 
        if (nr_pfns == 0) {
-               splx(s);
+               splx(snet);
                return;
        }
 
@@ -906,7 +909,9 @@
         * outstanding in the page update queue -- make sure we flush
         * those first!
         */
+       svm = splvm();
        xpq_flush_queue();
+       splx(svm);
 
        /* After all PTEs have been zapped we blow away stale TLB entries. */
        rx_mcl[nr_pfns-1].args[2] = UVMF_FLUSH_TLB;
@@ -929,7 +934,7 @@
        /* Above is a suitable barrier to ensure backend will see requests. */
        sc->sc_rx->req_prod = ringidx;
 
-       splx(s);
+       splx(snet);
 
 }
 



Home | Main Index | Thread Index | Old Index