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

[PATCH 3/5] libxencall: introduce variant of xencall2() returning long


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 18 Jun 2021 12:24:33 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lJvvmVhJ6x/yxLap6O6VF1QkaR/Dz+vEuOFGNI8+yBo=; b=AHyl1X4Q9B7isuvkctHvooAbyIBv25erq/5dgqmD7jL7uFOnA1zCp9Is0nzvlVDIh2OG7CiAqFax4ARqa7Tk93MaHoxgHDXWYjHb57tzJ1XBNvknEohn6fBUE/ZXD+sERFYSyiRkzW2xRZgWFBhogaUGqx4OGrKVUbSEBMtagAIgNMaPmSewA0qCqVQajVM6OnezNEjTO22nNObxiuoM5zlFMKimwj1jnIY80CGHqTbwBlgRhEFTjTlJWMVOjzSeVl6YZBCUJZ6C3Kd0yPavvW27oHUCkXX53t4j4QiYgPi3uh07q3DCWBNbeV5z2WnkEPz3WH/J0ppeedBKi+gGnw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=io7zHhlximNRb6H+4Lg5cKks9eQkof85SJxLkPJf+Hq9NM2eQzRRyyqHT0WRc7be6116ph33JYjkXlqNOQtccMjACve5771e8+4+jP+XQXnk96uMsTWYWhKFbv2t40KBw5VGh7tf7jYnSs4OJmBMeri6bJDJgZqhXJEc8gdDRVt1SNx7/Z5FOUWU4lxY5h6dswy5ebT+01Nk/lmVJkNrUiGSKuyW2uJ2CEVkdZjCRgYk5KmFQ3bwMYhdkeF1fULPicDWZHOL2+CEzvKPgsfWvqT8ocPcE8JRcE5edfRMG57JS6Oez9fSMvsRbga3UP3pnGc5Zgv6rtuWdIsTLccQDQ==
  • Authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Fri, 18 Jun 2021 10:24:41 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Some hypercalls, memory-op in particular, can return values requiring
more than 31 bits to represent. Hence the underlying layers need to make
sure they won't truncate such values.

While adding the new function to the map file, I noticed the stray
xencall6 there. I'm taking the liberty to remove it at this occasion. If
such a function would ever appear, it shouldn't lane in version 1.0.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
I wasn't sure whether euqivalents for the other xencall<N>() should also
be introduced, and hence went for the minimal solution first. Otoh there
is also xencall0() which has no users ...

--- a/tools/include/xencall.h
+++ b/tools/include/xencall.h
@@ -113,6 +113,10 @@ int xencall5(xencall_handle *xcall, unsi
              uint64_t arg1, uint64_t arg2, uint64_t arg3,
              uint64_t arg4, uint64_t arg5);
 
+/* Variant(s) of the above, as needed, returning "long" instead of "int". */
+long xencall2L(xencall_handle *xcall, unsigned int op,
+               uint64_t arg1, uint64_t arg2);
+
 /*
  * Allocate and free memory which is suitable for use as a pointer
  * argument to a hypercall.
--- a/tools/libs/call/core.c
+++ b/tools/libs/call/core.c
@@ -127,6 +127,17 @@ int xencall2(xencall_handle *xcall, unsi
     return osdep_hypercall(xcall, &call);
 }
 
+long xencall2L(xencall_handle *xcall, unsigned int op,
+               uint64_t arg1, uint64_t arg2)
+{
+    privcmd_hypercall_t call = {
+        .op = op,
+        .arg = { arg1, arg2 },
+    };
+
+    return osdep_hypercall(xcall, &call);
+}
+
 int xencall3(xencall_handle *xcall, unsigned int op,
              uint64_t arg1, uint64_t arg2, uint64_t arg3)
 {
--- a/tools/libs/call/libxencall.map
+++ b/tools/libs/call/libxencall.map
@@ -9,7 +9,6 @@ VERS_1.0 {
                xencall3;
                xencall4;
                xencall5;
-               xencall6;
 
                xencall_alloc_buffer;
                xencall_free_buffer;
@@ -27,3 +26,8 @@ VERS_1.2 {
        global:
                xencall_fd;
 } VERS_1.1;
+
+VERS_1.3 {
+       global:
+               xencall2L;
+} VERS_1.2;




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.