From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: Deadlocks by p2m_lock and event_lock Date: Fri, 9 Mar 2012 16:55:44 +0000 Message-ID: <20120309165544.GE83422@ocelot.phlegethon.org> References: <403610A45A2B5242BD291EDAE8B37D300FCE3236@SHSMSX102.ccr.corp.intel.com> <20120309112010.GB83422@ocelot.phlegethon.org> <403610A45A2B5242BD291EDAE8B37D300FCE32B2@SHSMSX102.ccr.corp.intel.com> <763b511f59616a274ff142d62f55f7bf.squirrel@webmail.lagarcavilla.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <763b511f59616a274ff142d62f55f7bf.squirrel@webmail.lagarcavilla.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andres Lagar-Cavilla Cc: Keir Fraser , "xen-devel@lists.xensource.com" , "Hao, Xudong" , "JBeulich@suse.com" , "Zhang, Xiantao" List-Id: xen-devel@lists.xenproject.org At 08:29 -0800 on 09 Mar (1331281767), Andres Lagar-Cavilla wrote: > >> I don't know about the event lock, but it seems unwise to call in to > >> handle_mmio with a gfn lock held. How about fixing the other path? > >> > >> diff -r 04673ecb9d78 xen/arch/x86/hvm/hvm.c > >> --- a/xen/arch/x86/hvm/hvm.c Thu Mar 08 16:40:05 2012 +0000 > >> +++ b/xen/arch/x86/hvm/hvm.c Fri Mar 09 11:15:25 2012 +0000 > >> @@ -1324,10 +1324,11 @@ int hvm_hap_nested_page_fault(unsigned l > >> if ( (p2mt == p2m_mmio_dm) || > >> (access_w && (p2mt == p2m_ram_ro)) ) > >> { > >> + put_gfn(p2m->domain, gfn); > >> if ( !handle_mmio() ) > >> hvm_inject_exception(TRAP_gp_fault, 0, 0); > >> rc = 1; > >> - goto out_put_gfn; > >> + goto out; > >> } > >> > >> #ifdef __x86_64__ > >> @@ -1379,6 +1380,7 @@ int hvm_hap_nested_page_fault(unsigned l > >> > >> out_put_gfn: > >> put_gfn(p2m->domain, gfn); > >> +out: > >> if ( paged ) > >> p2m_mem_paging_populate(v->domain, gfn); > >> if ( req_ptr ) > > > > Yes, that's fine to release the p2m lock earlier than handle_mmio. > > Ack OK, applied. Tim.