Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/xen No need to run hypercalls at IPL_VM.



details:   https://anonhg.NetBSD.org/src/rev/1f18277928d7
branches:  trunk
changeset: 932395:1f18277928d7
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed May 06 17:27:39 2020 +0000

description:
No need to run hypercalls at IPL_VM.
XXX still not MP-safe

diffstat:

 sys/arch/xen/xen/balloon.c |  17 +++--------------
 1 files changed, 3 insertions(+), 14 deletions(-)

diffs (70 lines):

diff -r 3ed1803b9f44 -r 1f18277928d7 sys/arch/xen/xen/balloon.c
--- a/sys/arch/xen/xen/balloon.c        Wed May 06 16:50:13 2020 +0000
+++ b/sys/arch/xen/xen/balloon.c        Wed May 06 17:27:39 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: balloon.c,v 1.21 2020/04/25 15:26:18 bouyer Exp $ */
+/* $NetBSD: balloon.c,v 1.22 2020/05/06 17:27:39 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: balloon.c,v 1.21 2020/04/25 15:26:18 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: balloon.c,v 1.22 2020/05/06 17:27:39 bouyer Exp $");
 
 #include <sys/inttypes.h>
 #include <sys/device.h>
@@ -272,15 +272,11 @@
 static size_t
 xenmem_get_maxreservation(void)
 {
-       int s;
        unsigned int ret;
 
-       s = splvm(); /* XXXSMP */
        ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, 
            & (domid_t) { DOMID_SELF });
 
-       splx(s);
-
        if (ret == 0) {
                /* well, a maximum reservation of 0 is really bogus */
                panic("%s failed, maximum reservation returned 0", __func__);
@@ -293,12 +289,10 @@
 static size_t
 xenmem_get_currentreservation(void)
 {
-       int s, ret;
+       int ret;
 
-       s = splvm(); /* XXXSMP */
        ret = HYPERVISOR_memory_op(XENMEM_current_reservation,
                                   & (domid_t) { DOMID_SELF });
-       splx(s);
 
        if (ret < 0) {
                panic("%s failed: %d", __func__, ret);
@@ -415,11 +409,8 @@
        set_xen_guest_handle(reservation.extent_start, mfn_list);
        reservation.nr_extents = rpages;
 
-       s = splvm(); /* XXXSMP */
        ret = HYPERVISOR_memory_op(XENMEM_decrease_reservation,
                                   &reservation);
-       splx(s);
-
        if (ret != rpages) {
                /*
                 * we are in bad shape: the operation failed for certain
@@ -481,9 +472,7 @@
        set_xen_guest_handle(reservation.extent_start, mfn_list);
        reservation.nr_extents = tpages;
 
-       s = splvm(); /* XXXSMP */
        ret = HYPERVISOR_memory_op(XENMEM_increase_reservation, &reservation);
-       splx(s);
 
        if (ret < 0) {
                panic("%s: increase reservation failed, ret %d",



Home | Main Index | Thread Index | Old Index