From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andres Lagar-Cavilla Subject: [PATCH 2 of 9] x86/mm: Don't fail to nominate for paging on type flag, rather look at type count Date: Wed, 01 Feb 2012 14:51:54 -0500 Message-ID: <27031a8a4effeb184ee6.1328125914@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.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: andres@gridcentric.ca, tim@xen.org, olaf@aepfle.de, adin@gridcentric.ca List-Id: xen-devel@lists.xenproject.org xen/arch/x86/mm/p2m.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Xen doesn't clean the type flag when dropping the type count for a page to zero. So, looking at the type flag when nominating a page for paging it's incorrect. Look at the type count instead. Signed-off-by: Andres Lagar-Cavilla Signed-off-by: Adin Scannell diff -r decd21170c2a -r 27031a8a4eff xen/arch/x86/mm/p2m.c --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -761,7 +761,7 @@ int p2m_mem_paging_nominate(struct domai (1 | PGC_allocated) ) goto out; - if ( (page->u.inuse.type_info & PGT_type_mask) != PGT_none ) + if ( (page->u.inuse.type_info & PGT_count_mask) != 0 ) goto out; /* Fix p2m entry */ @@ -823,7 +823,7 @@ int p2m_mem_paging_evict(struct domain * (2 | PGC_allocated) ) goto out_put; - if ( (page->u.inuse.type_info & PGT_type_mask) != PGT_none ) + if ( (page->u.inuse.type_info & PGT_count_mask) != 0 ) goto out_put; /* Decrement guest domain's ref count of the page */