All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hongyan Xia <hongyxia@amazon.com>
To: <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wl@xen.org>, "Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v4 8/9] x86/mm: add an end_of_loop label in modify_xen_mappings
Date: Wed, 4 Dec 2019 17:11:00 +0000	[thread overview]
Message-ID: <1f413130d6ab27ab5f7754606ffed38bdff0829c.1575477921.git.hongyxia@amazon.com> (raw)
In-Reply-To: <cover.1575477921.git.hongyxia@amazon.com>

From: Wei Liu <wei.liu2@citrix.com>

We will soon need to clean up mappings whenever the out most loop
is ended. Add a new label and turn relevant continue's into goto's.

No functional change.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/mm.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 4c659c28d8..d3b0956a3a 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -5604,7 +5604,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
 
             v += 1UL << L3_PAGETABLE_SHIFT;
             v &= ~((1UL << L3_PAGETABLE_SHIFT) - 1);
-            continue;
+            goto end_of_loop;
         }
 
         if ( l3e_get_flags(*pl3e) & _PAGE_PSE )
@@ -5622,7 +5622,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
 
                 l3e_write_atomic(pl3e, nl3e);
                 v += 1UL << L3_PAGETABLE_SHIFT;
-                continue;
+                goto end_of_loop;
             }
 
             /* PAGE1GB: shatter the superpage and fall through. */
@@ -5663,7 +5663,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
 
             v += 1UL << L2_PAGETABLE_SHIFT;
             v &= ~((1UL << L2_PAGETABLE_SHIFT) - 1);
-            continue;
+            goto end_of_loop;
         }
 
         if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
@@ -5734,7 +5734,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
              * skip the empty&free check.
              */
             if ( (nf & _PAGE_PRESENT) || ((v != e) && (l1_table_offset(v) != 0)) )
-                continue;
+                goto end_of_loop;
             if ( locking )
                 spin_lock(&map_pgdir_lock);
 
@@ -5753,7 +5753,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             {
                 if ( locking )
                     spin_unlock(&map_pgdir_lock);
-                continue;
+                goto end_of_loop;
             }
 
             l1t = l2e_to_l1e(*pl2e);
@@ -5780,7 +5780,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
          */
         if ( (nf & _PAGE_PRESENT) ||
              ((v != e) && (l2_table_offset(v) + l1_table_offset(v) != 0)) )
-            continue;
+            goto end_of_loop;
         if ( locking )
             spin_lock(&map_pgdir_lock);
 
@@ -5793,7 +5793,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
         {
             if ( locking )
                 spin_unlock(&map_pgdir_lock);
-            continue;
+            goto end_of_loop;
         }
 
         {
@@ -5815,6 +5815,7 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf)
             else if ( locking )
                 spin_unlock(&map_pgdir_lock);
         }
+    end_of_loop:;
     }
 
     flush_area(NULL, FLUSH_TLB_GLOBAL);
-- 
2.17.1


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

  parent reply	other threads:[~2019-12-04 17:11 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 17:10 [Xen-devel] [PATCH v4 0/9] Add alternative API for Xen PTEs Hongyan Xia
2019-12-04 17:10 ` [Xen-devel] [PATCH v4 1/9] x86: move some xen mm function declarations Hongyan Xia
2019-12-04 17:10 ` [Xen-devel] [PATCH v4 2/9] x86: introduce a new set of APIs to manage Xen page tables Hongyan Xia
2019-12-04 17:54   ` Xia, Hongyan
2019-12-05  7:20     ` Jan Beulich
2019-12-11 16:33   ` Julien Grall
2019-12-04 17:10 ` [Xen-devel] [PATCH v4 3/9] x86/mm: introduce l{1, 2}t local variables to map_pages_to_xen Hongyan Xia
2019-12-04 18:01   ` Xia, Hongyan
2019-12-05  8:38     ` Jan Beulich
2019-12-04 17:10 ` [Xen-devel] [PATCH v4 4/9] x86/mm: introduce l{1, 2}t local variables to modify_xen_mappings Hongyan Xia
2019-12-12 14:34   ` Julien Grall
2019-12-04 17:10 ` [Xen-devel] [PATCH v4 5/9] x86/mm: map_pages_to_xen would better have one exit path Hongyan Xia
2019-12-04 17:10 ` [Xen-devel] [PATCH v4 6/9] x86/mm: add an end_of_loop label in map_pages_to_xen Hongyan Xia
2019-12-05 10:21   ` Xia, Hongyan
2019-12-05 10:25     ` Jan Beulich
2019-12-05 11:02       ` Durrant, Paul
2019-12-05 11:12         ` Jan Beulich
2019-12-05 13:22           ` Xia, Hongyan
2019-12-06 15:58           ` Xia, Hongyan
2019-12-04 17:10 ` [Xen-devel] [PATCH v4 7/9] x86/mm: make sure there is one exit path for modify_xen_mappings Hongyan Xia
2019-12-04 17:11 ` Hongyan Xia [this message]
2019-12-04 17:11 ` [Xen-devel] [PATCH v4 9/9] x86/mm: change pl*e to l*t in virt_to_xen_l*e Hongyan Xia
2019-12-05  9:14 ` [Xen-devel] [PATCH v4 0/9] Add alternative API for Xen PTEs Jan Beulich
2019-12-05  9:41   ` Xia, Hongyan
2019-12-05  9:51     ` Jan Beulich
2019-12-05 10:45       ` Xia, Hongyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1f413130d6ab27ab5f7754606ffed38bdff0829c.1575477921.git.hongyxia@amazon.com \
    --to=hongyxia@amazon.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.