[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.5] xen/arm: p2m: apply_p2m_changes: Do not undo more than necessary
commit d4d37391c4f2a1fe522de51f2a86c325f11ba0c3 Author: Julien Grall <julien.grall@xxxxxxx> AuthorDate: Fri May 20 14:37:41 2016 +0100 Commit: Stefano Stabellini <sstabellini@xxxxxxxxxx> CommitDate: Sat May 21 17:08:34 2016 +0100 xen/arm: p2m: apply_p2m_changes: Do not undo more than necessary Since commit 4b25423a "arch/arm: unmap partially-mapped memory regions", Xen has been undoing the P2M mappings when an error occurred during insertion or memory allocation. The function apply_p2m_changes can work with region not-aligned to a block size (2MB, 1G) or page size (4K). The mapping will be done by splitting the region in a set of regions aligned to the size supported by the page table. The mapping of a region could fail when it is not possible to allocate memory for an intermediate table (i.e a new or when shattering a block). When the mapping is undone, the end of the region is computed using the base address of the current region and the size of the failing level. However the failing level may not be the leaf one, therefore unrelated entries will be removed. Fix it by removing the mapping from the start address up to the last region that has been successfully mapped. Signed-off-by: Julien Grall <julien.grall@xxxxxxx> Reviewed-by: Wei Chen <Wei.Chen@xxxxxxx> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx> Signed-off-by: Stefano Stabellini <sstabellini@xxxxxxxxxx> --- xen/arch/arm/p2m.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 8809f5a..993f776 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -914,13 +914,10 @@ out: { BUG_ON(addr == end_gpaddr); /* - * addr keeps the address of the last successfully-inserted mapping, - * while apply_p2m_changes() considers an address range which is - * exclusive of end_gpaddr: add level_size to addr to obtain the - * right end of the range + * addr keeps the address of the end of the last successfully-inserted + * mapping. */ - apply_p2m_changes(d, REMOVE, - start_gpaddr, addr + level_sizes[level], orig_maddr, + apply_p2m_changes(d, REMOVE, start_gpaddr, addr, orig_maddr, mattr, p2m_invalid); } -- generated by git-patchbot for /home/xen/git/xen.git#stable-4.5 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |