From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andres Lagar-Cavilla Subject: [PATCH 4 of 6] x86/mm/shadow: fix p2m/paging deadlock when updating shadow mode Date: Fri, 13 Apr 2012 12:22:22 -0400 Message-ID: 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/common.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) Signed-off-by: Andres Lagar-Cavilla diff -r 964c6cbad926 -r a7ca6ae73992 xen/arch/x86/mm/shadow/common.c --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -2997,9 +2997,13 @@ static void sh_update_paging_modes(struc void shadow_update_paging_modes(struct vcpu *v) { + /* Avoid deadlock in shadow mode. When updating, we might need to resync an + * l1 and thus get_gfn on all the gfn's pointed to by the guest l1e pte's. */ + p2m_lock(p2m_get_hostp2m(v->domain)); paging_lock(v->domain); sh_update_paging_modes(v); paging_unlock(v->domain); + p2m_unlock(p2m_get_hostp2m(v->domain)); } /**************************************************************************/