Module Name:    src
Committed By:   bouyer
Date:           Wed May  6 17:27:39 UTC 2020

Modified Files:
        src/sys/arch/xen/xen: balloon.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/xen/xen/balloon.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/xen/balloon.c
diff -u src/sys/arch/xen/xen/balloon.c:1.21 src/sys/arch/xen/xen/balloon.c:1.22
--- src/sys/arch/xen/xen/balloon.c:1.21	Sat Apr 25 15:26:18 2020
+++ src/sys/arch/xen/xen/balloon.c	Wed May  6 17:27:39 2020
@@ -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 @@ error:
 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 @@ xenmem_get_maxreservation(void)
 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 @@ balloon_inflate(struct balloon_xenbus_so
 	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 @@ balloon_deflate(struct balloon_xenbus_so
 	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",

Reply via email to