NPT: temporarily retain page table mapping in do_recalc()
authorJan Beulich <jbeulich@suse.com>
Tue, 6 May 2014 11:30:31 +0000 (13:30 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 6 May 2014 11:30:31 +0000 (13:30 +0200)
commit3feebf4490505b6d0b74bca248a9630292be6fd0
tree245f08512b93df0d9580e3f3683f1f4919f7944a
parent6ec48cf41b6656c98148380f39010063e62628c5
NPT: temporarily retain page table mapping in do_recalc()

Commit b3e024f3 ("x86/NPT: don't walk page tables when changing types
on a range") neglected the fact that p2m_next_level() replaces the
previous level's mapping with the new level's one, hence dereferencing
a stale pointer the translation for which may no longer be available
(timing dependent). Add a parameter to that function allowing the
caller to request that the mapping be retained (the unmapping will be
taken care of by the caller then).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/p2m-pt.c