From patchwork Mon Apr 22 16:49:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 162603 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2801208jan; Mon, 22 Apr 2019 09:51:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdnuaaeoM9WgzjyCTpn3GPvKaoEtsZnX27CQwpBRpw2xhTXsnUKmtBLoVWr6yU8/OxmNtq X-Received: by 2002:a81:9982:: with SMTP id q124mr16813938ywg.390.1555951868908; Mon, 22 Apr 2019 09:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555951868; cv=none; d=google.com; s=arc-20160816; b=Izbg+jD830Mb3CKzj4XDOC9oSgc219Ml2KXXoccx3eAv+/SujGePPdrMa5Ib0b1yWg QR+MRfIMCG+7BUoSUCpcraHKAtZdZ7TLCotxyRX4mD8fWuH/sdtBkzsBPhbe3/4YkECQ UAidlgYGNGw4pBGcTTszOY/1cf6w72Z0GtA6rtYkDiDJZF2vKXmQ5ckTVyu5GnpujexC F/aijO3wnms62jSDyZdVcp+vCcBZ+RFmgge+rFjDRxk4/C81/SHjKhP5XOndB1kZZJBy /b1LjJ/WiL/JeJN7PfCFgW07N3ZRzboD69kuzlP0WIoLsU+e+yx46yByb9/ARk6apInS Jzsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=D8c4FalC3AnAaEhqRDCwmEvcyQmmm0xVRQCjH7+U/Qs=; b=Ng7Ir6/rI5gWqRfs2Oc7HZU23iRq3hZ4s2beN7VcFY6BtXeQJQEXDlR0LsAoT+SCZo BDbdt+dexqAUgammP3K4GDPfZCThcL7I1QhCP+SzeQc8TVSWFdefvNR0nSXrj8b8bd1G hGWIMiufSYBVW487zezmtPz7nparISg5QsvjG+pGTe6brsj0RGRrUSB7zn3tGVmt2Hxh Ndt+KUnRWtKpdJXnvDk9zSARBBfBL4rwweurKb7BuoR1ygC/iXI80FOqGUjLJ5H+F+/D FCAOoP7lQrPI7y4uzxZz+Ex1hMR7uT6kW7ikABGYO9zf1JxBtj3/5O7QVYnnZsYox71h dGXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id q185si4234132ywb.278.2019.04.22.09.51.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Apr 2019 09:51:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 1hIc95-0005ST-Dx; Mon, 22 Apr 2019 16:50:19 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hIc93-0005PI-NF for xen-devel@lists.xenproject.org; Mon, 22 Apr 2019 16:50:17 +0000 X-Inumbo-ID: b4acb2b2-651e-11e9-92d7-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id b4acb2b2-651e-11e9-92d7-bc764e045a96; Mon, 22 Apr 2019 16:50:16 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 703B4374; Mon, 22 Apr 2019 09:50:16 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 60CF43F557; Mon, 22 Apr 2019 09:50:15 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 22 Apr 2019 17:49:36 +0100 Message-Id: <20190422164937.21350-20-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190422164937.21350-1-julien.grall@arm.com> References: <20190422164937.21350-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 19/20] xen/arm: Pair call to set_fixmap with call to clear_fixmap in copy_from_paddr X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Oleksandr_Tyshchenko@epam.com, Julien Grall , sstabellini@kernel.org, Andrii_Anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" At the moment, set_fixmap may replace a valid entry without following the break-before-make sequence. This may result to TLB conflict abort. Rather than dealing with Break-Before-Make in set_fixmap, every call to set_fixmap is paired with a call to clear_fixmap. Signed-off-by: Julien Grall Reviewed-by: Andrii Anisov --- xen/arch/arm/kernel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c index e3ffdb2fa1..389bef2afa 100644 --- a/xen/arch/arm/kernel.c +++ b/xen/arch/arm/kernel.c @@ -58,13 +58,12 @@ void __init copy_from_paddr(void *dst, paddr_t paddr, unsigned long len) set_fixmap(FIXMAP_MISC, maddr_to_mfn(paddr), PAGE_HYPERVISOR_WC); memcpy(dst, src + s, l); clean_dcache_va_range(dst, l); + clear_fixmap(FIXMAP_MISC); paddr += l; dst += l; len -= l; } - - clear_fixmap(FIXMAP_MISC); } static void __init place_modules(struct kernel_info *info,