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

[Xen-changelog] [xen master] common/memory: Fix ABI breakage for XENMEM_add_to_physmap



commit ebc168f238ab7a729c45032c9663b14844f34656
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Jan 20 09:49:20 2014 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Jan 20 09:49:20 2014 +0100

    common/memory: Fix ABI breakage for XENMEM_add_to_physmap
    
    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@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Release-Ack: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
    Acked-by: Keir Fraser <keir@xxxxxxx>
---
 xen/arch/arm/mm.c    |    2 +-
 xen/arch/x86/mm.c    |    2 +-
 xen/include/xen/mm.h |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 293b6e2..127cce0 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -970,7 +970,7 @@ void share_xen_page_with_privileged_guests(
 
 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)
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 32c0473..172c68c 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4522,7 +4522,7 @@ static int handle_iomem_range(unsigned long s, unsigned 
long e, void *p)
 
 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)
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index f90ed74..b183189 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -356,7 +356,7 @@ static inline unsigned int get_order_from_pages(unsigned 
long nr_pages)
 
 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);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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