From: Roger Pau Monne <roger.pau@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
paul@xen.org, Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
George Dunlap <george.dunlap@citrix.com>,
Jan Beulich <jbeulich@suse.com>,
Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH for-4.14 v2] mm: fix public declaration of struct xen_mem_acquire_resource
Date: Thu, 25 Jun 2020 16:16:43 +0200 [thread overview]
Message-ID: <20200625141643.82822-1-roger.pau@citrix.com> (raw)
XENMEM_acquire_resource and it's related structure is currently inside
a __XEN__ or __XEN_TOOLS__ guarded section to limit it's scope to the
hypervisor or the toolstack only. This is wrong as the hypercall is
already being used by the Linux kernel at least, and as such needs to
be public.
Also switch the usage of uint64_aligned_t to plain uint64_t, as
uint64_aligned_t is only to be used by the toolstack. Note that a
padding field is added on 32bit x86, so that the size of the structure
is the same.
No layout structure change. The structure doesn't need to be adjusted
on 32bit Arm, because guest handlers are already expanded to 64bits.
Fixes: 3f8f12281dd20 ('x86/mm: add HYPERVISOR_memory_op to acquire guest resources')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Should also be backported.
---
Changes since v1:
- Add padding on 32bits so structure size matches between arches and
the previous layout is kept.
---
xen/include/public/memory.h | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/xen/include/public/memory.h b/xen/include/public/memory.h
index dbd35305df..b6d3587cfa 100644
--- a/xen/include/public/memory.h
+++ b/xen/include/public/memory.h
@@ -607,6 +607,8 @@ struct xen_reserved_device_memory_map {
typedef struct xen_reserved_device_memory_map xen_reserved_device_memory_map_t;
DEFINE_XEN_GUEST_HANDLE(xen_reserved_device_memory_map_t);
+#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
+
/*
* Get the pages for a particular guest resource, so that they can be
* mapped directly by a tools domain.
@@ -645,7 +647,7 @@ struct xen_mem_acquire_resource {
* IN - the index of the initial frame to be mapped. This parameter
* is ignored if nr_frames is 0.
*/
- uint64_aligned_t frame;
+ uint64_t frame;
#define XENMEM_resource_ioreq_server_frame_bufioreq 0
#define XENMEM_resource_ioreq_server_frame_ioreq(n) (1 + (n))
@@ -662,12 +664,14 @@ struct xen_mem_acquire_resource {
* This parameter may be NULL if nr_frames is 0.
*/
XEN_GUEST_HANDLE(xen_pfn_t) frame_list;
+
+#ifdef __i386__
+ uint32_t pad2;
+#endif
};
typedef struct xen_mem_acquire_resource xen_mem_acquire_resource_t;
DEFINE_XEN_GUEST_HANDLE(xen_mem_acquire_resource_t);
-#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
-
/*
* XENMEM_get_vnumainfo used by guest to get
* vNUMA topology from hypervisor.
--
2.26.2
next reply other threads:[~2020-06-25 14:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 14:16 Roger Pau Monne [this message]
2020-06-25 14:27 ` [PATCH for-4.14 v2] mm: fix public declaration of struct xen_mem_acquire_resource Roger Pau Monné
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=20200625141643.82822-1-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=paul@xen.org \
--cc=sstabellini@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).