[Xen-devel] [PATCH] x86/mm: Simplify promote_l4_table()'s exit semantics

Andrew Cooper posted 1 patch 4 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20191216162006.15260-1-andrew.cooper3@citrix.com
xen/arch/x86/mm.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
[Xen-devel] [PATCH] x86/mm: Simplify promote_l4_table()'s exit semantics
Posted by Andrew Cooper 4 years, 4 months ago
promote_l4_table() is different from its lower level helpers, by having an
extra return path out of the middle of the loop in the case of a failure.

Break from the loop, which is consistent with the other helpers, and
functionally equivalent.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/arch/x86/mm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index c14c677a62..594f1bd290 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -1856,10 +1856,7 @@ static int promote_l4_table(struct page_info *page)
             }
         }
         if ( rc < 0 )
-        {
-            unmap_domain_page(pl4e);
-            return rc;
-        }
+            break;
 
         pl4e[i] = adjust_guest_l4e(l4e, d);
     }
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] x86/mm: Simplify promote_l4_table()'s exit semantics
Posted by George Dunlap 4 years, 4 months ago
On 12/16/19 4:20 PM, Andrew Cooper wrote:
> promote_l4_table() is different from its lower level helpers, by having an
> extra return path out of the middle of the loop in the case of a failure.
> 
> Break from the loop, which is consistent with the other helpers, and
> functionally equivalent.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: George Dunlap <george.dunlap@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel