From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: Re: [PATCH] vm_event: make sure the domain is paused in key domctls Date: Thu, 28 Jan 2016 16:52:50 +0200 Message-ID: <56AA2B42.5090904@bitdefender.com> References: <1453989160-8002-1-git-send-email-rcojocaru@bitdefender.com> <56AA215E.5020605@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <56AA215E.5020605@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , xen-devel@lists.xen.org Cc: tamas@tklengyel.com, keir@xen.org, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.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 > > Would you mind annotating each of the checks for d != current->domain > with /* no domain_pause(). */, which is our normal practice. Nice, doing that allowed me to find and modify this code: 1137 #ifdef CONFIG_HAS_MEM_ACCESS 1138 case XEN_DOMCTL_set_access_required: 1139 if ( unlikely(current->domain == d) ) /* no domain_pause() */ 1140 ret = -EPERM; 1141 else 1142 { 1143 domain_pause(d); 1144 p2m_get_hostp2m(d)->access_required = 1145 op->u.access_required.access_required; 1146 domain_unpause(d); 1147 } 1148 break; 1149 #endif (there was no domain_pause(d) / domain_unpause(d)) before. Thanks, Razvan