From: "Jan Beulich" Subject: Re: [PATCH 1/2] xen: Introduce PHYSDEVOP_pirq_eoi_gmfn_new Date: Thu, 26 Jan 2012 16:09:43 +0000 Message-ID: <4F2188D7020000780006F43B@nat28.tlf.novell.com> References: <1327592987-20317-1-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1327592987-20317-1-git-send-email-stefano.stabellini@eu.citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: xen-devel@lists.xensource.com, konrad.wilk@oracle.com List-Id: xen-devel@lists.xenproject.org >>> On 26.01.12 at 16:49, Stefano Stabellini wrote: > PHYSDEVOP_pirq_eoi_gmfn changes the semantics of PHYSDEVOP_eoi. > Introduce PHYSDEVOP_pirq_eoi_gmfn_new, that is like > PHYSDEVOP_pirq_eoi_gmfn but it doesn't modify the behaviour of another > hypercall. I keep forgetting why you think the auto-unmasking does any harm. It was done that way to avoid an extra hypercall. > @@ -531,6 +532,8 @@ long do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg) > } > > current->domain->arch.pirq_eoi_map = mfn_to_virt(mfn); > + if ( cmd == PHYSDEVOP_pirq_eoi_gmfn ) > + current->domain->arch.auto_unmask = 1; Indentation., > ret = 0; > break; > } > --- a/xen/arch/x86/physdev.c > +++ b/xen/arch/x86/physdev.c > @@ -271,7 +271,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg) > break; > } > if ( !is_hvm_domain(v->domain) && > - v->domain->arch.pv_domain.pirq_eoi_map ) > + v->domain->arch.pv_domain.pirq_eoi_map && > + v->domain->arch.pv_domain.auto_unmask ) Could you not avoid the checking of v->domain->arch.pv_domain.pirq_eoi_map by making sure v->domain->arch.pv_domain.auto_unmask gets cleared when the map gets destroyed (not sure if that is permitted at all). > evtchn_unmask(pirq->evtchn); > if ( !is_hvm_domain(v->domain) || > domain_pirq_to_irq(v->domain, eoi.irq) > 0 ) > --- a/xen/include/asm-x86/domain.h > +++ b/xen/include/asm-x86/domain.h > @@ -231,6 +231,9 @@ struct pv_domain > /* Shared page for notifying that explicit PIRQ EOI is required. */ > unsigned long *pirq_eoi_map; > unsigned long pirq_eoi_map_mfn; > + /* set auto_unmask to 1 if you want PHYSDEVOP_eoi to automatically > + * unmask the event channel */ > + unsigned int auto_unmask; bool_t? Jan > > /* Pseudophysical e820 map (XENMEM_memory_map). */ > spinlock_t e820_lock;