From patchwork Wed Oct 2 17:16:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xia, Hongyan" X-Patchwork-Id: 11171699 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 A62F113B1 for ; Wed, 2 Oct 2019 17:18:37 +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 82C30222BE for ; Wed, 2 Oct 2019 17:18:37 +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="Bkg3G6Lh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82C30222BE 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 1iFiFf-0008JK-4D; Wed, 02 Oct 2019 17:17:23 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iFiFd-0008Im-Sh for xen-devel@lists.xenproject.org; Wed, 02 Oct 2019 17:17:21 +0000 X-Inumbo-ID: 7a18aae6-e538-11e9-8628-bc764e2007e4 Received: from smtp-fw-6002.amazon.com (unknown [52.95.49.90]) by localhost (Halon) with ESMTPS id 7a18aae6-e538-11e9-8628-bc764e2007e4; Wed, 02 Oct 2019 17:17:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1570036633; x=1601572633; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=fV/9brbO4gWoje4rTTbmECdy77LcIRpQMwVCOUOHLvY=; b=Bkg3G6Lhx50Jw30+PFrnAspScmFPM6lNOc5gMJ2WpLnPuD8mgI9vvhx6 IXbryp5tu+dpSInjPovNIxiNpMBi3ngJaobQTNZv07zNTT2oG6u3Nm3Wn IUOn+Z/oT5DeTmBg4x+yyY37L64Us8ky30iXNzyss7TMOHr9HGwjPtAAQ Q=; X-IronPort-AV: E=Sophos;i="5.67,249,1566864000"; d="scan'208";a="425367849" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2a-e7be2041.us-west-2.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 02 Oct 2019 17:17:11 +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-e7be2041.us-west-2.amazon.com (Postfix) with ESMTPS id 9DDC2A226F; Wed, 2 Oct 2019 17:17:11 +0000 (UTC) Received: from EX13D10UEE002.ant.amazon.com (10.43.62.136) 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:02 +0000 Received: from EX13MTAUEE001.ant.amazon.com (10.43.62.200) by EX13D10UEE002.ant.amazon.com (10.43.62.136) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 2 Oct 2019 17:17:02 +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:01 +0000 From: Hongyan Xia To: Date: Wed, 2 Oct 2019 18:16:51 +0100 Message-ID: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk Subject: [Xen-devel] [PATCH v3 6/9] x86/mm: add an end_of_loop label in map_pages_to_xen 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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 26fcb2709b..5a5f0685cc 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -5102,7 +5102,7 @@ int map_pages_to_xen( if ( !mfn_eq(mfn, INVALID_MFN) ) mfn = mfn_add(mfn, 1UL << (L3_PAGETABLE_SHIFT - PAGE_SHIFT)); nr_mfns -= 1UL << (L3_PAGETABLE_SHIFT - PAGE_SHIFT); - continue; + goto end_of_loop; } if ( (l3e_get_flags(ol3e) & _PAGE_PRESENT) && @@ -5129,7 +5129,7 @@ int map_pages_to_xen( if ( !mfn_eq(mfn, INVALID_MFN) ) mfn = mfn_add(mfn, i); nr_mfns -= i; - continue; + goto end_of_loop; } l2t = alloc_xen_pagetable(); @@ -5310,7 +5310,7 @@ int map_pages_to_xen( { if ( locking ) spin_unlock(&map_pgdir_lock); - continue; + goto end_of_loop; } if ( l2e_get_flags(ol2e) & _PAGE_PSE ) @@ -5365,7 +5365,7 @@ int map_pages_to_xen( { if ( locking ) spin_unlock(&map_pgdir_lock); - continue; + goto end_of_loop; } l2t = l3e_to_l2e(ol3e); @@ -5390,6 +5390,7 @@ int map_pages_to_xen( else if ( locking ) spin_unlock(&map_pgdir_lock); } + end_of_loop:; } #undef flush_flags