From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andres Lagar-Cavilla Subject: [PATCH 5 of 6] x86/mm/shadow: fix p2m/paging deadlock when updating shadow cr3 Date: Fri, 13 Apr 2012 12:22:23 -0400 Message-ID: <1d8566a0564208e64bb2.1334334143@xdev.gridcentric.ca> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: andres@gridcentric.ca, tim@xen.org List-Id: xen-devel@lists.xenproject.org xen/arch/x86/mm/shadow/multi.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) Signed-off-by: Andres Lagar-Cavilla diff -r a7ca6ae73992 -r 1d8566a05642 xen/arch/x86/mm/shadow/multi.c --- a/xen/arch/x86/mm/shadow/multi.c +++ b/xen/arch/x86/mm/shadow/multi.c @@ -4190,7 +4190,12 @@ sh_update_cr3(struct vcpu *v, int do_loc return; } - if ( do_locking ) paging_lock(v->domain); + if ( do_locking ) + { + /* See comment in shadow_update_paging_modes. */ + p2m_lock(p2m_get_hostp2m(v->domain)); + paging_lock(v->domain); + } #if (SHADOW_OPTIMIZATIONS & SHOPT_OUT_OF_SYNC) /* Need to resync all the shadow entries on a TLB flush. Resync @@ -4434,7 +4439,11 @@ sh_update_cr3(struct vcpu *v, int do_loc #endif /* Release the lock, if we took it (otherwise it's the caller's problem) */ - if ( do_locking ) paging_unlock(v->domain); + if ( do_locking ) + { + paging_unlock(v->domain); + p2m_unlock(p2m_get_hostp2m(v->domain)); + } }