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

[Xen-changelog] [xen staging] tools/xenstored: Drop mapping of the ring via foreign map



commit 38eeb3864de40aa568c48f9f26271c141c62b50b
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Fri May 17 11:08:56 2019 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Thu Jul 11 09:21:21 2019 -0500

    tools/xenstored: Drop mapping of the ring via foreign map
    
    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@xxxxxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
---
 tools/xenstore/xenstored_domain.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/tools/xenstore/xenstored_domain.c 
b/tools/xenstore/xenstored_domain.c
index 463ebba643..c793543bb4 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -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. */
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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