All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>,
	"Ian Jackson" <iwj@xenproject.org>,
	"Juergen Gross" <jgross@suse.com>
Subject: [PATCH v2 3/6] libxencall: introduce variant of xencall2() returning long
Date: Tue, 22 Jun 2021 17:18:42 +0200	[thread overview]
Message-ID: <beca6bb7-a991-8a94-ebbe-af973e1f3958@suse.com> (raw)
In-Reply-To: <6c532607-c2a3-d0ab-e4e5-428f85f4a045@suse.com>

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@suse.com>
Acked-by: Ian Jackson <iwj@xenproject.org>
---
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;



  parent reply	other threads:[~2021-06-22 15:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 15:16 [PATCH v2 0/6] allow xc_domain_maximum_gpfn() to observe full GFN value Jan Beulich
2021-06-22 15:17 ` [PATCH v2 1/6] x86/HVM: wire up multicalls Jan Beulich
2021-06-22 15:18 ` [PATCH v2 2/6] libxencall: osdep_hypercall() should return long Jan Beulich
2021-06-22 15:18 ` Jan Beulich [this message]
2021-06-22 18:22   ` [PATCH v2 3/6] libxencall: introduce variant of xencall2() returning long Andrew Cooper
2021-06-22 15:19 ` [PATCH v2 4/6] libxc: use multicall for memory-op on Linux (and Solaris) Jan Beulich
2021-06-22 19:35   ` Andrew Cooper
2021-06-22 15:19 ` [PATCH v2 5/6] libxencall: drop bogus mentioning of xencall6() Jan Beulich
2021-06-22 18:25   ` Andrew Cooper
2021-06-23  6:18     ` Jan Beulich
2021-06-22 15:20 ` [PATCH v2 6/6] libxc: make xc_domain_maximum_gpfn() endianness-agnostic Jan Beulich
2021-06-22 18:33   ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=beca6bb7-a991-8a94-ebbe-af973e1f3958@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jgross@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.