xen/arm: p2m: Read *_mapped_gfn with the p2m lock taken
authorJulien Grall <julien.grall@arm.com>
Thu, 14 Sep 2017 15:39:01 +0000 (16:39 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Sat, 7 Oct 2017 00:37:08 +0000 (17:37 -0700)
commit2c2ae1976da06283e923d97720c0bdcbebf04515
treea59fd3de123a975ea909d66dfbd1e9b010e3ef1e
parent4fb67fbb8e7c43727d625bf654a0bfae1ee40428
xen/arm: p2m: Read *_mapped_gfn with the p2m lock taken

*_mapped_gfn are currently read before acquiring the lock. However, they
may be modified by the p2m code before the lock was acquired. This means
we will use the wrong values.

Fix it by moving the read inside the section protected by the p2m lock.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/p2m.c