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

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


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 22 Jun 2021 17:18:42 +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=H8bfy44Kldc2RqppGX0GDbslnJnZuK1kudBdrWRi9kc=; b=P9FxXsRRMy49hPf2nzaNwZfZf9YKIV9wU2NBjvhZVANXwZbFSdDVlfJ4UbFwVXIxna3/+wQAglgpetaadaymP4xuAbTInNBDCiits6Lh1zQC8htZr9tV3QKWXsMZ8JA+2ikOxSxXMEeeZZzXZu6yZmttOPkIaYxgNxkYxYqgKlYIYxsInLUeDGdP7GRLcuMhv4ZMOOZ1zQMTkVMziSGHutn4Wma9E6MfUE7YAtaS2wse1juBBIP04RQA5hNRJdy77WDOHy0NY835ixlXi9zFLir0b03iTS/HMGi5alCkvZ2EoMzNa3HuCsSt12x6ARhGThzNQS7lupieO0HZOaNgww==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZABdDmzHteT8ecvqp3G/jO/1syomfBkwkR/qouxxIXlUvOY2Db60xyUPHOTsdnrwJPuumXTW5dx9ogGug9ASF7pFDCxfEg53VMSY7YbhuaojchOoA/oI28LPS6yTxHsiVvod/wcpKcwJlIia+4eqf5uwcv3EXHaJTpYAup/dk1ZRO7dgaFte4RkYp4NzmnjEGl/5N9kBWk9AFUym6LOhQNhWhJAvHLDjcZZV9KgPVbketx6c7wz59FbYf9J9Cnb4al4q5qGY1ojq7iA7JKS+wRrTBaIvWOlc5LA/EbAdU6kYfgN3rcdD9ZKcDsL46aTGLwwb1lQTgEIAV/eUXE/5OA==
  • 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: Tue, 22 Jun 2021 15:18:49 +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.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
---
v2: Move dropping of xencall6 from the version script to a separate
    patch.
---
I wasn't sure whether equivalents for the other xencall<N>() should also
be introduced, and hence I went for the minimal solution first. Otoh
there's also xencall0() without any 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
@@ -27,3 +27,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®.