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

Re: [Xen-devel] [PATCH v2 1/1] evtchn: make EVTCHNOP_reset suitable for kexec



On 30/07/14 14:26, Vitaly Kuznetsov wrote:
> It would be nice to allow guests to close all event channels in
> ABI-agnostic way in case of kexec/kdump. EVTCHNOP_reset looks suitable
> for this purpose. However control blocks for vcpus and event array need
> cleanup when FIFO ABI is being used.
> 
> With this change a guest can simply do EVTCHNOP_reset before kexec in
> both 2-level and FIFO cases. It is also important to perform store/console
> channel remapping after such call.

Can you add documentation to xen/include/public/event_channels.h?

> The issue can also be solved by introducing a new EVTCHNOP operation but
> it seems that EVTCHNOP_reset can be reused.
> 
> [The idea was suggested by Ian Campbell, Andrew Cooper, and David Vrabel]
> 
> Changes from v1:

List changes after a --- marker so they don't end up in the final commit
message.

> --- a/xen/common/event_channel.c
> +++ b/xen/common/event_channel.c
> @@ -957,6 +957,17 @@ static long evtchn_reset(evtchn_reset_t *r)
>      for ( i = 0; port_is_valid(d, i); i++ )
>          (void)__evtchn_close(d, i);
>  
> +    if ( (d == current->domain) && d->evtchn_fifo )
> +    {
> +        /*
> +         * Guest domain called EVTCHNOP_reset with DOMID_SELF, destroying
> +         * FIFO event array and control blocks, resetting evtchn_port_ops to
> +         * evtchn_port_ops_2l.
> +         */
> +        evtchn_fifo_destroy(d);
> +        evtchn_2l_init(d);

You need to take d->event_lock around this if, or the guest could try to
bind another event whilst the ABI is in an inconsistent state.

David

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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