From: David Vrabel <david.vrabel@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: "Keir (Xen.org)" <keir@xen.org>,
Ian Campbell <Ian.Campbell@citrix.com>,
"jbeulich@suse.com" <jbeulich@suse.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [RFC PATCH V3 18/22] Implement EVTCHNOP_register_extended
Date: Thu, 28 Feb 2013 12:33:49 +0000 [thread overview]
Message-ID: <512F4EAD.6000502@citrix.com> (raw)
In-Reply-To: <1361975655-22295-19-git-send-email-wei.liu2@citrix.com>
On 27/02/13 14:34, Wei Liu wrote:
> Note: this call always fails as it is not yet completed.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> 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;
If the guest's idea of the size of struct evtchn_register_extended is
smaller than Xen's, then Xen may try to copy more data that is actually
available. This may then return -EFAULT unexpectedly if the guest
allocated the structure at the end of a page and the following page is
not mapped.
David
next prev parent reply other threads:[~2013-02-28 12:33 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-27 14:33 [RFC PATCH V3] Implement 3-level event channel in Xen Wei Liu
2013-02-27 14:33 ` [RFC PATCH V3 01/22] Clean up trailing whitespaces Wei Liu
2013-02-28 11:30 ` David Vrabel
2013-02-28 11:36 ` Wei Liu
2013-02-28 11:38 ` Jan Beulich
2013-02-28 12:14 ` Ian Campbell
2013-02-28 12:29 ` Wei Liu
2013-02-28 13:08 ` Jan Beulich
2013-02-27 14:33 ` [RFC PATCH V3 02/22] Dynamically allocate d->evtchn Wei Liu
2013-02-27 16:35 ` Jan Beulich
2013-02-27 14:33 ` [RFC PATCH V3 03/22] Move event channel macros / struct definition to proper place Wei Liu
2013-02-27 14:33 ` [RFC PATCH V3 04/22] flask: include xen/event.h Wei Liu
2013-02-28 11:20 ` David Vrabel
2013-02-28 11:22 ` Wei Liu
2013-02-27 14:33 ` [RFC PATCH V3 05/22] Change MAX_EVTCHNS macro to max_evtchns inline function Wei Liu
2013-02-28 11:58 ` David Vrabel
2013-02-28 13:59 ` Wei Liu
2013-02-27 14:33 ` [RFC PATCH V3 06/22] Define extended event channel registration interface Wei Liu
2013-02-27 16:42 ` Jan Beulich
2013-02-28 11:25 ` Wei Liu
2013-02-28 11:32 ` Jan Beulich
2013-02-28 11:41 ` Wei Liu
2013-02-28 12:32 ` David Vrabel
2013-02-28 15:04 ` Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 07/22] Add evtchn_extended in struct domain Wei Liu
2013-02-28 11:55 ` David Vrabel
2013-02-27 14:34 ` [RFC PATCH V3 08/22] Calculate max event channels for EVTCHN_EXTENDED_L3 Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 09/22] Bump EVTCHNS_PER_BUCKET to 512 Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 10/22] Add evtchn_is_{pending, masked} and evtchn_clear_pending Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 11/22] Update Xen public header Wei Liu
2013-02-28 12:00 ` David Vrabel
2013-02-27 14:34 ` [RFC PATCH V3 12/22] Add supported extended event channel ABI bitmap Wei Liu
2013-02-27 16:47 ` Jan Beulich
2013-02-28 11:21 ` Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 13/22] Add evtchn_abi_str Wei Liu
2013-02-27 16:51 ` Jan Beulich
2013-02-28 11:28 ` Wei Liu
2013-02-28 11:33 ` Jan Beulich
2013-02-27 14:34 ` [RFC PATCH V3 14/22] Add control structures for 3-level event channel Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 15/22] Genneralized event channel operations Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 16/22] Introduce some macros for event channels Wei Liu
2013-02-27 16:53 ` Jan Beulich
2013-02-27 17:04 ` Ian Campbell
2013-02-28 7:54 ` Jan Beulich
2013-02-28 8:35 ` Ian Campbell
2013-02-28 11:17 ` Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 17/22] Infrastructure to manipulate 3-level event channel pages Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 18/22] Implement EVTCHNOP_register_extended Wei Liu
2013-02-28 12:33 ` David Vrabel [this message]
2013-02-27 14:34 ` [RFC PATCH V3 19/22] Enable exteneded event channel ABI query Wei Liu
2013-02-28 12:36 ` David Vrabel
2013-02-27 14:34 ` [RFC PATCH V3 20/22] Implement 3-level event channel routines Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 21/22] Only allow extended event channel on Dom0 and driver domains Wei Liu
2013-02-27 16:58 ` Jan Beulich
2013-02-28 11:19 ` Wei Liu
2013-02-28 12:43 ` David Vrabel
2013-02-28 19:29 ` Wei Liu
2013-02-27 14:34 ` [RFC PATCH V3 22/22] libxl: add evtchn_extended flag Wei Liu
2013-02-28 12:48 ` David Vrabel
2013-03-01 11:55 ` Ian Jackson
2013-02-27 16:28 ` [RFC PATCH V3] Implement 3-level event channel in Xen Keir Fraser
2013-02-27 17:01 ` Jan Beulich
2013-02-27 19:49 ` Keir Fraser
2013-02-27 23:19 ` Wei Liu
2013-02-28 5:58 ` Keir Fraser
2013-02-28 7:23 ` Jan Beulich
2013-03-01 12:00 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=512F4EAD.6000502@citrix.com \
--to=david.vrabel@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.