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

[xen master] libxencall: introduce variant of xencall2() returning long



commit bef64f2c0019f828824a67f918604fe40768b1de
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Jun 24 16:39:02 2021 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Jun 24 16:39:02 2021 +0200

    libxencall: introduce variant of xencall2() returning long
    
    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>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 tools/include/xencall.h        |  4 ++++
 tools/libs/call/core.c         | 11 +++++++++++
 tools/libs/call/libxencall.map |  5 +++++
 3 files changed, 20 insertions(+)

diff --git a/tools/include/xencall.h b/tools/include/xencall.h
index 2d0c42ad5e..fc95ed0fe5 100644
--- a/tools/include/xencall.h
+++ b/tools/include/xencall.h
@@ -113,6 +113,10 @@ int xencall5(xencall_handle *xcall, unsigned int op,
              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.
diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c
index 57d3a33e6b..02c4f8e1ae 100644
--- a/tools/libs/call/core.c
+++ b/tools/libs/call/core.c
@@ -127,6 +127,17 @@ int xencall2(xencall_handle *xcall, unsigned int op,
     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)
 {
diff --git a/tools/libs/call/libxencall.map b/tools/libs/call/libxencall.map
index 6922b96511..ad7518b0e0 100644
--- 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;
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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