Skip to content

Commit c523480

Browse files
mswilsongregkh
authored andcommitted
xen/gnttab: leave lazy MMU mode in the case of a m2p override failure
commit 14883a7 upstream. Commit f62805f introduced a bug where lazy MMU mode isn't exited if a m2p_add/remove_override call fails. Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Reviewed-by: David Vrabel <david.vrabel@citrix.com> Reviewed-by: Anthony Liguori <aliguori@amazon.com> Signed-off-by: Matt Wilson <msw@amazon.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ca62ebe commit c523480

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/xen/grant-table.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,9 +920,10 @@ int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
920920
ret = m2p_add_override(mfn, pages[i], kmap_ops ?
921921
&kmap_ops[i] : NULL);
922922
if (ret)
923-
return ret;
923+
goto out;
924924
}
925925

926+
out:
926927
if (lazy)
927928
arch_leave_lazy_mmu_mode();
928929

@@ -953,9 +954,10 @@ int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
953954
ret = m2p_remove_override(pages[i], kmap_ops ?
954955
&kmap_ops[i] : NULL);
955956
if (ret)
956-
return ret;
957+
goto out;
957958
}
958959

960+
out:
959961
if (lazy)
960962
arch_leave_lazy_mmu_mode();
961963

0 commit comments

Comments
 (0)