public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Xen: Fix pte unpin BUG when !CONFIG_SMP
@ 2008-09-09 11:25 Alex Nixon
  2008-09-09 11:27 ` Ingo Molnar
  2008-09-09 18:05 ` Jeremy Fitzhardinge
  0 siblings, 2 replies; 16+ messages in thread
From: Alex Nixon @ 2008-09-09 11:25 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Alex Nixon, Jeremy Fitzhardinge, Ingo Molnar

We still need to pin PTEs, even if there are no PTE locks.  Otherwise we'll BUG whenever there aren't PTE locks (i.e. whenever NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS), as we try to unpin PTEs which were never pinned in the first place.

Signed-off-by: Alex Nixon <alex.nixon@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/xen/mmu.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index f5af913..1239bda 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -819,9 +819,10 @@ static int xen_pin_page(struct page *page, enum pt_level level)
 					pfn_pte(pfn, PAGE_KERNEL_RO),
 					level == PT_PGD ? UVMF_TLB_FLUSH : 0);
 
-		if (ptl) {
+		if (level == PT_PTE)
 			xen_do_pin(MMUEXT_PIN_L1_TABLE, pfn);
 
+		if (ptl) {
 			/* Queue a deferred unlock for when this batch
 			   is completed. */
 			xen_mc_callback(xen_pte_unlock, ptl);
@@ -924,9 +925,7 @@ static int xen_unpin_page(struct page *page, enum pt_level level)
 		 */
 		if (level == PT_PTE) {
 			ptl = xen_pte_lock(page);
-
-			if (ptl)
-				xen_do_pin(MMUEXT_UNPIN_TABLE, pfn);
+			xen_do_pin(MMUEXT_UNPIN_TABLE, pfn);
 		}
 
 		mcs = __xen_mc_entry(0);
-- 
1.5.4.3


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2008-09-10 11:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-09 11:25 [PATCH] Xen: Fix pte unpin BUG when !CONFIG_SMP Alex Nixon
2008-09-09 11:27 ` Ingo Molnar
2008-09-09 18:05 ` Jeremy Fitzhardinge
2008-09-09 19:21   ` Alex Nixon
2008-09-09 20:37     ` Jeremy Fitzhardinge
2008-09-09 22:26       ` Alex Nixon
2008-09-09 22:28         ` Jeremy Fitzhardinge
2008-09-09 22:43         ` [PATCH 1/2] mm: define USE_SPLIT_PTLOCKS rather than repeating expression Jeremy Fitzhardinge
2008-09-10 11:28           ` Hugh Dickins
2008-09-09 22:43         ` [PATCH 2/2] xen: fix pinning when not using split pte locks Jeremy Fitzhardinge
2008-09-09 22:53           ` Andrew Morton
2008-09-09 23:29             ` Jeremy Fitzhardinge
2008-09-10  8:18               ` Ingo Molnar
2008-09-09 23:22           ` Alex Nixon
2008-09-09 23:32             ` Jeremy Fitzhardinge
2008-09-10  8:10             ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox