[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1294679859-30029-5-git-send-email-konrad.wilk@oracle.com>
Date: Mon, 10 Jan 2011 12:17:36 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To: linux-kernel@...r.kernel.org,
Jeremy Fitzhardinge <jeremy@...p.org>, hpa@...or.com,
Ian Campbell <Ian.Campbell@...rix.com>
Cc: Konrad Rzeszutek Wilk <konrad@...nel.org>,
xen-devel@...ts.xensource.com, Jan Beulich <JBeulich@...ell.com>,
Stefano Stabellini <stefano.stabellini@...citrix.com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Subject: [PATCH 4/7] xen/mmu: BUG_ON when racing to swap middle leaf.
The initial bootup code uses set_phys_to_machine quite a lot, and after
bootup it would be used by the balloon driver. The balloon driver does have
mutex lock so this should not be necessary - but just in case, add
a BUG_ON if we do hit this scenario.
[v2: Change from WARN to BUG_ON]
Reviewed-by: Ian Campbell <Ian.Campbell@...citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
---
arch/x86/xen/mmu.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 6d5b49b..0cce0c2 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -613,7 +613,8 @@ bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn)
/* Swap over from MISSING to IDENTITY if needed. */
if (p2m_top[topidx][mididx] == p2m_missing) {
- p2m_top[topidx][mididx] = p2m_identity;
+ BUG_ON(cmpxchg(&p2m_top[topidx][mididx], p2m_missing,
+ p2m_identity) != p2m_missing);
return true;
}
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists