]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tools/xenstored: Drop mapping of the ring via foreign map
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 17 May 2019 10:08:56 +0000 (11:08 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 11 Jul 2019 14:21:21 +0000 (09:21 -0500)
This is a vestigial remnent of the pre xenstored stub domain days.

Foreign mapping via MFN is a privileged operation which is not
necessary, because grant details are unconditionally set up during
domain construction.  In practice, this means xenstored never uses its
ability to foreign map the ring.

Drop the ability completely, which removes the penultimate use of the
unstable libxc interface.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
tools/xenstore/xenstored_domain.c

index 463ebba6439e9a513e16095f71d4dcbf00519b57..c793543bb40b86a35a216212d8a3fc0ac107fa93 100644 (file)
@@ -171,24 +171,16 @@ static int readchn(struct connection *conn, void *data, unsigned int len)
        return len;
 }
 
-static void *map_interface(domid_t domid, unsigned long mfn)
-{
-       if (*xgt_handle != NULL) {
-               /* this is the preferred method */
-               return xengnttab_map_grant_ref(*xgt_handle, domid,
-                       GNTTAB_RESERVED_XENSTORE, PROT_READ|PROT_WRITE);
-       } else {
-               return xc_map_foreign_range(*xc_handle, domid,
-                       XC_PAGE_SIZE, PROT_READ|PROT_WRITE, mfn);
-       }
+static void *map_interface(domid_t domid)
+{
+       return xengnttab_map_grant_ref(*xgt_handle, domid,
+                                      GNTTAB_RESERVED_XENSTORE,
+                                      PROT_READ|PROT_WRITE);
 }
 
 static void unmap_interface(void *interface)
 {
-       if (*xgt_handle != NULL)
-               xengnttab_unmap(*xgt_handle, interface, 1);
-       else
-               munmap(interface, XC_PAGE_SIZE);
+       xengnttab_unmap(*xgt_handle, interface, 1);
 }
 
 static int destroy_domain(void *_domain)
@@ -396,7 +388,7 @@ int do_introduce(struct connection *conn, struct buffered_data *in)
        domain = find_domain_by_domid(domid);
 
        if (domain == NULL) {
-               interface = map_interface(domid, mfn);
+               interface = map_interface(domid);
                if (!interface)
                        return errno;
                /* Hang domain off "in" until we're finished. */