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

Re: [Xen-devel] [PATCH] vm_event: make sure the domain is paused in key domctls


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxx
  • From: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
  • Date: Thu, 28 Jan 2016 16:27:31 +0200
  • Cc: tamas@xxxxxxxxxxxxx, keir@xxxxxxx, jbeulich@xxxxxxxx
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Thu, 28 Jan 2016 14:27:17 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=2B7c+7KCG4f8Hqr1qwhtzOLe/9bZTLImsBTYbixXPFxIOGP54NBmHczQlXk2EhvmTdeAjA2fvDxdtSNppWss7WOf0JGPVYutvJL4fMHhpSV318r8RXoWcnWXXNLW28h779qGJ2zyTLRIf3Rq2f/Df3JwkS09195PDeuP5vL12Gb81GZE56UJpSEpH+MOKp0qTXOC9osyyptzPTW+5Jsi97Zvc3sQb3jKXE6vOMFRKB8mSEd9j9eeKLc2yZorKCZKpT+3Sx9BiKxV9RScWdmpJSAPKFdFmPwSXMqLvncnhZ/41T9IYAN+J65jNqCDiz7B1X15HDY01Gp54FcM5T/ypA==; h=Received:Received:Received:Received:Received:From:Subject:To:References:Cc:X-Enigmail-Draft-Status:Message-ID:Date:User-Agent:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

On 01/28/2016 04:10 PM, Andrew Cooper wrote:
> On 28/01/16 13:52, Razvan Cojocaru wrote:
>> This patch pauses the domain for all writes through the 'ad'
>> pointer in monitor_domctl(), defers a domain_unpause() call until
>> after the CRs are updated for the MONITOR_EVENT_WRITE_CTRLREG
>> case, and makes sure that the domain is paused for both vm_event
>> enable and disable cases in vm_event_domctl().
>> Thanks go to Andrew Cooper for his review and suggestions.
>>
>> Signed-off-by: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
> 
> Would you mind annotating each of the checks for d != current->domain
> with /* no domain_pause(). */, which is our normal practice.

Of course, no problem.

> I think it might be better to move the current check for
> XEN_DOMCTL_monitor_op into monitor_domctl() itself, to have all checks
> together in one place.

I'll move it.

>> @@ -144,6 +146,8 @@ int monitor_domctl(struct domain *d, struct 
>> xen_domctl_monitor_op *mop)
>>          if ( rc )
>>              return rc;
>>  
>> +        domain_pause(d);
>> +
>>          if ( mop->op == XEN_DOMCTL_MONITOR_OP_ENABLE &&
>>               mop->u.mov_to_msr.extended_capture )
>>          {
>> @@ -154,7 +158,6 @@ int monitor_domctl(struct domain *d, struct 
>> xen_domctl_monitor_op *mop)
> 
> You will need to rework the return -EOPNOTSUPP between these two hunks
> to avoid missing the domain_unpause()
> 
> It would probably be better to pull the check forwards to before the
> domain_pause().

Right, sorry I've missed that. Thanks!

>>          } else
>>              ad->monitor.mov_to_msr_extended = 0;
>>  
>> -        domain_pause(d);
>>          ad->monitor.mov_to_msr_enabled = !status;
>>          domain_unpause(d);
>>          break;
>> @@ -196,9 +199,8 @@ int monitor_domctl(struct domain *d, struct 
>> xen_domctl_monitor_op *mop)
>>
> 
> The other codepaths look fine.


Thanks for the review,
Razvan


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