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

Re: [Xen-devel] [PATCHv2 4/5] evtchn: remove the locking when unmasking an event channel



On 16/06/15 10:19, Jan Beulich wrote:
>>>> On 15.06.15 at 17:48, <david.vrabel@xxxxxxxxxx> wrote:
>> --- a/xen/common/event_channel.c
>> +++ b/xen/common/event_channel.c
>> @@ -977,9 +977,7 @@ int evtchn_unmask(unsigned int port)
>>      struct domain *d = current->domain;
>>      struct evtchn *evtchn;
>>  
>> -    ASSERT(spin_is_locked(&d->event_lock));
>> -
>> -    if ( unlikely(!port_is_valid(d, port)) )
>> +    if ( port >= read_atomic(&d->valid_evtchns) )
>>          return -EINVAL;
> 
> Again this partial open coding looks wrong to me.

Again, d->valid_evtchns is the only field we can safely check without
d->event_lock.

I think this is fine because unmasking an unbound event channel is harmless.

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®.