Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/x86 KASSERT() that the per-cpu queues are run a...



details:   https://anonhg.NetBSD.org/src/rev/b3ec447b3705
branches:  trunk
changeset: 932396:b3ec447b3705
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed May 06 17:28:26 2020 +0000

description:
KASSERT() that the per-cpu queues are run at IPL_VM after boot.

diffstat:

 sys/arch/xen/x86/x86_xpmap.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (59 lines):

diff -r 1f18277928d7 -r b3ec447b3705 sys/arch/xen/x86/x86_xpmap.c
--- a/sys/arch/xen/x86/x86_xpmap.c      Wed May 06 17:27:39 2020 +0000
+++ b/sys/arch/xen/x86/x86_xpmap.c      Wed May 06 17:28:26 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: x86_xpmap.c,v 1.86 2020/05/02 16:44:36 bouyer Exp $    */
+/*     $NetBSD: x86_xpmap.c,v 1.87 2020/05/06 17:28:26 bouyer Exp $    */
 
 /*
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.86 2020/05/02 16:44:36 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.87 2020/05/06 17:28:26 bouyer Exp $");
 
 #include "opt_xen.h"
 #include "opt_ddb.h"
@@ -105,6 +105,7 @@
 #include <sys/systm.h>
 #include <sys/mutex.h>
 #include <sys/cpu.h>
+#include <sys/kernel.h>
 
 #include <uvm/uvm.h>
 
@@ -193,6 +194,8 @@
        int done = 0, ret;
        size_t xpq_idx;
 
+       KASSERT(curcpu()->ci_ilevel >= IPL_VM || cold);
+
        xpq_idx = curcpu()->ci_xpq_idx;
        xpq_queue = xpq_queue_array[curcpu()->ci_cpuid];
 
@@ -219,7 +222,7 @@
 static inline void
 xpq_increment_idx(void)
 {
-
+       KASSERT(curcpu()->ci_ilevel >= IPL_VM || cold);
        if (__predict_false(++curcpu()->ci_xpq_idx == XPQUEUE_SIZE))
                xpq_flush_queue();
 }
@@ -315,12 +318,12 @@
 void
 xpq_flush_cache(void)
 {
-       int s = splvm(); /* XXXSMP */
+       int s = splvm();
 
        xpq_flush_queue();
 
        asm("wbinvd":::"memory");
-       splx(s); /* XXX: removeme */
+       splx(s);
 }
 
 void



Home | Main Index | Thread Index | Old Index