[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 16/23] vixen: pass grant table operations through to the outer Xen
On Sun, Jan 07, 2018 at 12:28:32PM -0800, Anthony Liguori wrote: > static long > +vixen_gnttab_setup_table( > + XEN_GUEST_HANDLE_PARAM(gnttab_setup_table_t) uop, unsigned int count) > +{ > + long rc; > + > + struct gnttab_setup_table op; > + xen_pfn_t *frame_list = NULL; > + XEN_GUEST_HANDLE(xen_pfn_t) old_frame_list; > + > + if ( count != 1 ) > + return -EINVAL; > + > + if ( unlikely(copy_from_guest(&op, uop, 1) != 0) ) > + { > + gdprintk(XENLOG_INFO, "Fault while reading gnttab_setup_table_t.\n"); > + return -EFAULT; > + } > + > + if ( op.nr_frames > 0 ) { > + frame_list = xzalloc_array(xen_pfn_t, op.nr_frames); > + if ( frame_list == NULL ) > + return -ENOMEM; > + } > + > + old_frame_list = op.frame_list; > + op.frame_list.p = frame_list; > + > + rc = HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &op, count); > + op.frame_list = old_frame_list; Are you sure this works? HVM based guests need to use XENMAPSPACE_grant_table so that they map the grant table somewhere in the p2m. My comment was the other way around: you can ditch the GNTTABOP_setup_table call, but you need to keep the XENMAPSPACE_grant_table one. > long > do_grant_table_op( > unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) uop, unsigned int count) > @@ -3324,6 +3422,9 @@ do_grant_table_op( > if ( (cmd &= GNTTABOP_CMD_MASK) != GNTTABOP_cache_flush && opaque_in ) > return -EINVAL; > > + if ( is_vixen() ) > + return vixen_do_grant_table_op(cmd, uop, count); You seem to be missing the compat code. Roger. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |