From patchwork Wed Oct 2 17:16:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xia, Hongyan" X-Patchwork-Id: 11171711 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0441213BD for ; Wed, 2 Oct 2019 17:21:32 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D473321848 for ; Wed, 2 Oct 2019 17:21:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="ppt9pW6G" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D473321848 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iFiIO-00018s-Qe; Wed, 02 Oct 2019 17:20:12 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iFiIN-00018a-IK for xen-devel@lists.xenproject.org; Wed, 02 Oct 2019 17:20:11 +0000 X-Inumbo-ID: e3409574-e538-11e9-971c-12813bfff9fa Received: from smtp-fw-9102.amazon.com (unknown [207.171.184.29]) by localhost (Halon) with ESMTPS id e3409574-e538-11e9-971c-12813bfff9fa; Wed, 02 Oct 2019 17:20:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1570036811; x=1601572811; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=UjuKLyVt5NcnOe8Xrtb78RB4wfI3B0cRksZlB3VQq9Q=; b=ppt9pW6GWN3kSu5pmScQxuhMwthm6MepR24bZ5iuhdvgNojyy7QlLtyA 8aeCN+XJ38SbbOg1Wy8iKZYTeZLQVggO1wN2tqo1M6QNwxz69N44Wu5VR 74wAb82i6yhYnjmeLQynjaYsnXDxQJ+uVUG4GHlpktGdLqSCMbEfrx5g2 o=; X-IronPort-AV: E=Sophos;i="5.67,249,1566864000"; d="scan'208";a="706204485" Received: from sea3-co-svc-lb6-vlan3.sea.amazon.com (HELO email-inbound-relay-2a-8549039f.us-west-2.amazon.com) ([10.47.22.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 02 Oct 2019 17:18:08 +0000 Received: from EX13MTAUEA001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2a-8549039f.us-west-2.amazon.com (Postfix) with ESMTPS id 04807A1C11; Wed, 2 Oct 2019 17:17:14 +0000 (UTC) Received: from EX13D14UEE004.ant.amazon.com (10.43.62.145) by EX13MTAUEA001.ant.amazon.com (10.43.61.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 2 Oct 2019 17:17:04 +0000 Received: from EX13MTAUEE001.ant.amazon.com (10.43.62.200) by EX13D14UEE004.ant.amazon.com (10.43.62.145) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 2 Oct 2019 17:17:03 +0000 Received: from u9d785c4ba99158.ant.amazon.com (10.125.106.78) by mail-relay.amazon.com (10.43.62.226) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 2 Oct 2019 17:17:03 +0000 From: Hongyan Xia To: Date: Wed, 2 Oct 2019 18:16:53 +0100 Message-ID: <8bd69059eeda992d55ba29dd5946903cb55620fd.1570034362.git.hongyax@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH v3 8/9] x86/mm: add an end_of_loop label in modify_xen_mappings X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Wei Liu , Wei Liu , Jan Beulich , =?utf-8?q?Roger_Pau_?= =?utf-8?q?Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Wei Liu 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 --- 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 3838343b87..d7eb804f06 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -5445,7 +5445,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 ) @@ -5463,7 +5463,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. */ @@ -5507,7 +5507,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 ) @@ -5581,7 +5581,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); @@ -5600,7 +5600,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); @@ -5627,7 +5627,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); @@ -5640,7 +5640,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; } { @@ -5662,6 +5662,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);