x86/cpa: make sure cpa is safe to call in lazy mmu mode
authorJeremy Fitzhardinge <jeremy@goop.org>
Wed, 11 Feb 2009 17:32:19 +0000 (09:32 -0800)
committerIngo Molnar <mingo@elte.hu>
Thu, 12 Feb 2009 07:27:26 +0000 (08:27 +0100)
commit4f06b0436b2ddbd3b67b10e77098a6862787b3eb
treefc1ec5bcd2f7ed2c77121d87ffe5839ec7bdaeaa
parent9f339e7028e2855717af3193c938f9960ad13b38
x86/cpa: make sure cpa is safe to call in lazy mmu mode

Impact: fix race leading to crash under KVM and Xen

The CPA code may be called while we're in lazy mmu update mode - for
example, when using DEBUG_PAGE_ALLOC and doing a slab allocation
in an interrupt handler which interrupted a lazy mmu update.  In this
case, the in-memory pagetable state may be out of date due to pending
queued updates.  We need to flush any pending updates before inspecting
the page table.  Similarly, we must explicitly flush any modifications
CPA may have made (which comes down to flushing queued operations when
flushing the TLB).

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Stable Kernel <stable@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/mm/pageattr.c