From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: =?utf-8?q?=5BPATCH_2/2=5D_x86=3A_latch_current?= =?utf-8?b?4oCRPmRvbWFpbiBpbiBkb19waHlzZGV2X29wKCk=?= Date: Mon, 19 Jan 2015 15:58:49 +0000 Message-ID: <54BD29B9.9060003@citrix.com> References: <54BD310A0200007800056878@mail.emea.novell.com> <54BD329E02000078000568CF@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YDEjn-0002ts-Al for xen-devel@lists.xenproject.org; Mon, 19 Jan 2015 15:59:35 +0000 In-Reply-To: <54BD329E02000078000568CF@mail.emea.novell.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: Jan Beulich , xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org On 19/01/15 15:36, Jan Beulich wrote: > @@ -483,7 +482,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H > ret = -EFAULT; > if ( copy_from_guest(&apic, arg, 1) != 0 ) > break; > - ret = xsm_apic(XSM_PRIV, v->domain, cmd); > + ret = xsm_apic(XSM_PRIV, currd, cmd); > if ( ret ) > break; > ret = ioapic_guest_write(apic.apic_physbase, apic.reg, apic.value); > @@ -499,7 +498,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H > > /* Use the APIC check since this dummy hypercall should still only > * be called by the domain with access to program the ioapic */ > - ret = xsm_apic(XSM_PRIV, v->domain, cmd); > + ret = xsm_apic(XSM_PRIV, currd, cmd); > if ( ret ) > break; > > @@ -529,15 +528,16 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H There is a "is_pvh_vcpu(current)" between these two hunks which wants latching in the same way as set_iobitmap, allowing the "current" below to become "curr". With that fixed, Reviewed-by: Andrew Cooper > if ( set_iopl.iopl > 3 ) > break; > ret = 0; > - v->arch.pv_vcpu.iopl = set_iopl.iopl; > + current->arch.pv_vcpu.iopl = set_iopl.iopl; > break; > } > > case PHYSDEVOP_set_iobitmap: { > + struct vcpu *curr = current; > struct physdev_set_iobitmap set_iobitmap; > > ret = -ENOSYS; > - if ( is_pvh_vcpu(current) ) > + if ( is_pvh_vcpu(curr) ) > break; > > ret = -EFAULT;