caused by c/s
4be86bb194e25e46b6cbee900601bfee76e8090a
In public/memory.h, struct xen_add_to_physmap has 'space' as an unsigned int,
but struct xen_add_to_physmap_batch has 'space' as a uint16_t.
By defining xenmem_add_to_physmap_one() with space defined as uint16_t, the
now-common xenmem_add_to_physmap() implicitly truncates xatp->space from
unsigned int to uint16_t, which changes the space switch()'d upon.
This wouldn't be noticed with any upstream code (of which I am aware), but was
discovered because of the XenServer support for legacy Windows PV drivers,
which make XENMEM_add_to_physmap hypercalls using spaces with the top bit set.
The current Windows PV drivers don't do this any more, but we 'fix' Xen to
support running VMs with out-of-date tools.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-Ack: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
int xenmem_add_to_physmap_one(
struct domain *d,
- uint16_t space,
+ unsigned int space,
domid_t foreign_domid,
unsigned long idx,
xen_pfn_t gpfn)
int xenmem_add_to_physmap_one(
struct domain *d,
- uint16_t space,
+ unsigned int space,
domid_t foreign_domid,
unsigned long idx,
xen_pfn_t gpfn)
void scrub_one_page(struct page_info *);
-int xenmem_add_to_physmap_one(struct domain *d, uint16_t space,
+int xenmem_add_to_physmap_one(struct domain *d, unsigned int space,
domid_t foreign_domid,
unsigned long idx, xen_pfn_t gpfn);