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

[Xen-changelog] [xen-unstable] libxc: match types of 'subject' and 'foreigndom' between struct xc_mmu and do_mmu_update

  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Mon, 04 Feb 2013 15:44:25 +0000
  • Delivery-date: Mon, 04 Feb 2013 15:44:29 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Dario Faggioli <dario.faggioli@xxxxxxxxxx>
# Date 1359031677 0
# Node ID f2a4dbbf35c88c51d5d8bcb4cdc2fc04b08b6bbd
# Parent  1881713c6a20fdd698eaa482cd69067bf4c7c248
libxc: match types of 'subject' and 'foreigndom' between struct xc_mmu and 

In do_mmu_update() (in the hypervisor) the parameter 'foreigndom' is
'unsigned int' and both its high (bits 31-16) and low (bits 15-0) are
parts utilised, as explained here:

However, the actual parameter, i.e., the 'subject' field in
struct xc_mmu is declared as domid_t, which typedef-s to uint16_t.
This means we are never able to pass anything via the higher 16 bits
of 'foreigndom', which in turns may cause the hypercall to fail when
called on an actual foreign domain.

Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 1881713c6a20 -r f2a4dbbf35c8 tools/libxc/xc_private.c
--- a/tools/libxc/xc_private.c  Thu Jan 24 12:47:56 2013 +0000
+++ b/tools/libxc/xc_private.c  Thu Jan 24 12:47:57 2013 +0000
@@ -478,13 +478,13 @@ static int flush_mmu_updates(xc_interfac
     return err;
-struct xc_mmu *xc_alloc_mmu_updates(xc_interface *xch, domid_t dom)
+struct xc_mmu *xc_alloc_mmu_updates(xc_interface *xch, unsigned int subject)
     struct xc_mmu *mmu = malloc(sizeof(*mmu));
     if ( mmu == NULL )
         return mmu;
     mmu->idx     = 0;
-    mmu->subject = dom;
+    mmu->subject = subject;
     return mmu;
diff -r 1881713c6a20 -r f2a4dbbf35c8 tools/libxc/xc_private.h
--- a/tools/libxc/xc_private.h  Thu Jan 24 12:47:56 2013 +0000
+++ b/tools/libxc/xc_private.h  Thu Jan 24 12:47:57 2013 +0000
@@ -308,10 +308,10 @@ void discard_file_cache(xc_interface *xc
 struct xc_mmu {
     mmu_update_t updates[MAX_MMU_UPDATES];
     int          idx;
-    domid_t      subject;
+    unsigned int subject;
 /* Structure returned by xc_alloc_mmu_updates must be free()'ed by caller. */
-struct xc_mmu *xc_alloc_mmu_updates(xc_interface *xch, domid_t dom);
+struct xc_mmu *xc_alloc_mmu_updates(xc_interface *xch, unsigned int subject);
 int xc_add_mmu_update(xc_interface *xch, struct xc_mmu *mmu,
                    unsigned long long ptr, unsigned long long val);
 int xc_flush_mmu_updates(xc_interface *xch, struct xc_mmu *mmu);

Xen-changelog mailing list



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