[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [RFC PATCH V3 18/22] Implement EVTCHNOP_register_extended
Note: this call always fails as it is not yet completed. Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- xen/common/event_channel.c | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index 26daa7e..bb6e5f9 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -1204,6 +1204,34 @@ static long evtchn_register_3level(evtchn_register_3level_t *arg) return rc; } +/* + * NOTE to extneded event channel users: + * extended channels are likely to consume lots large global mapping + * area in Xen. For example, 3-level event channel consumes 16 + + * nr_vcpus pages global mapping area. + */ +static long evtchn_register_extended(struct evtchn_register_extended *reg) +{ + struct domain *d = current->domain; + int rc; + + spin_lock(&d->event_lock); + + switch ( reg->cmd ) + { + case EVTCHN_EXTENDED_NONE: + default: + rc = -EINVAL; + case EVTCHN_EXTENDED_L3: + rc = evtchn_register_3level(®->u.l3); + break; + } + + spin_unlock(&d->event_lock); + + return rc; +} + long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) { long rc; @@ -1312,6 +1340,19 @@ long do_event_channel_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg) break; } + case EVTCHNOP_register_extended: { + struct evtchn_register_extended reg; + + if ( copy_from_guest(®, arg, 1) != 0 ) + return -EFAULT; + rc = evtchn_register_extended(®); + + /* XXX always fails this call because it is not yet completed */ + rc = -EINVAL; + + break; + } + default: rc = -ENOSYS; break; @@ -1438,6 +1479,19 @@ int evtchn_init(struct domain *d) return 0; } +static void evtchn_unmap_extended(struct domain *d) +{ + switch ( d->evtchn_extended ) + { + case EVTCHN_EXTENDED_NONE: + default: + break; + case EVTCHN_EXTENDED_L3: + __evtchn_unmap_all_3level(d); + break; + } +} + void evtchn_destroy(struct domain *d) { @@ -1466,6 +1520,8 @@ void evtchn_destroy(struct domain *d) clear_global_virq_handlers(d); + evtchn_unmap_extended(d); + free_xenheap_page(d->evtchn); } -- 1.7.10.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |