[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 2/2] 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> --- CC: Ian Jackson <Ian.Jackson@xxxxxxxxxx> CC: Wei Liu <wei.liu2@xxxxxxxxxx> CC: 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. */ -- 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |