From: "Jan Beulich" Subject: Re: [PATCH v5 1/6] x86: allow IRQ to be disabled for resource access Date: Thu, 22 Jan 2015 11:18:43 +0000 Message-ID: <54C0EAA302000078000580E7@mail.emea.novell.com> References: <1421839164-26037-1-git-send-email-chao.p.peng@linux.intel.com> <1421839164-26037-2-git-send-email-chao.p.peng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1421839164-26037-2-git-send-email-chao.p.peng@linux.intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Chao Peng Cc: wei.liu2@citrix.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, will.auld@intel.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 21.01.15 at 12:19, wrote: > --- a/xen/arch/x86/platform_hypercall.c > +++ b/xen/arch/x86/platform_hypercall.c > @@ -90,7 +90,9 @@ static void check_resource_access(struct xen_resource_access *ra) > int ret = 0; > xenpf_resource_entry_t *entry = ra->entries + i; > > - if ( entry->rsvd ) > + /* DISABLE_IRQ flag should never be set for the last entry */ > + if ( entry->flags & XEN_RESOURCE_ENTRY_FLAGS_DISABLE_IRQ && This needs checking that all the other 31 bits are clear as well as parenthesizing. > @@ -124,11 +126,19 @@ static void resource_access(void *info) > { > struct xen_resource_access *ra = info; > unsigned int i; > + unsigned long irqflags = 0; > + bool_t irq_disabled = 0; I don't think you need two variables for this - this is x86-only code and EFLAGS bit 1 is always set. Jan