]> xenbits.xensource.com Git - xen.git/commit
mm: fix public declaration of struct xen_mem_acquire_resource
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 7 Aug 2020 15:29:41 +0000 (17:29 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 Aug 2020 15:29:41 +0000 (17:29 +0200)
commit7cce3f25a13715eef16d55fe716c0a850b85573d
tree2d056a78b6cc920e1cab440cf4503917b33ab999
parent43258cec1413e819d84e005b11d70ad021b1a21e
mm: fix public declaration of struct xen_mem_acquire_resource

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. Doing such
change will reduce the size of the structure on 32bit x86 by 4bytes,
since there will be no padding added after the frame_list handle.

This is fine, as users of the previous layout will allocate 4bytes of
padding that won't be read by Xen, and users of the new layout won't
allocate those, which is also fine since Xen won't try to access them.

Note that the structure already has compat handling, and such handling
will take care of copying the right size (ie: minus the padding) when
called from a 32bit x86 context. This is true for the compat code both
before and after this patch, since the structures in the memory.h
compat header are subject to a pragma pack(4), which already removed
the trailing padding that would otherwise be introduced by the
alignment of the frame field to 8 bytes.

Fixes: 3f8f12281dd20 ('x86/mm: add HYPERVISOR_memory_op to acquire guest resources')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 0e2e54966af556f4047c1048855c4a071028a32d
master date: 2020-06-29 18:03:49 +0200
xen/include/public/memory.h