From patchwork Tue May 14 12:24:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 164191 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2555403ili; Tue, 14 May 2019 05:26:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/1fzQrUR2oqJ4fxUeQq0bGcEJgVcZvRl46YjCBkPq7IrpYGlN5d3toWYSzaTGmtXeiZl7 X-Received: by 2002:a5e:8d13:: with SMTP id m19mr20042350ioj.304.1557836789593; Tue, 14 May 2019 05:26:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557836789; cv=none; d=google.com; s=arc-20160816; b=N61GSOCNiYKeIc3pCCZmt6aUG+ib2HTRbQ+kIyhwfwzye/da2Phyq+y+w8RRQ9E+5y 73cw/Dqh3yC9SmA972EbgFjjQ+cXw3zhOyi6dEf384Z7yh39Vm44T5KKi7oGa0CeTOGk O+ntxhPou/+uKxPOTcueZQ2edohgXDF77fWq6p/n1f6PhLKekPLy8Lx0B8FHWkXIzbKS BWm8XM1z0n2/2BXzBDcD0WriF/ytO2BwN4WzyMMvOYvK06JNCt5FU+jSN7l5/UAYDsgF bDP+0ZMCj1pY0teuSiwn1u5tpsj9zcryhnTlkfgpfpR0ao/0WIMoXM5K+tL78Q3rUW87 tsFQ== 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=L8D+cxzqu/amENytuourTm5F3hxNZ5GypY+mx9yb+18=; b=Ooe0WYxoyi70LULlPE/+qwHXuAB86gzk/qiBsl4CXxSN5xCerFjdIZHTRKkMZXTvjS w3p0ofzsIwoQLgiaHsfQGRg4kiYYMgD7ufG3/h7Bb0S1uL5hYpitfQywarMndXe+az3h HOR9r36LL4ps73YjPGMrvlaD8wXpnmbvotG/0ir0igcL71MRilBdQCd2KKSVyYiTcaWg 3Vglt9vfZ023X65SBtLILnZeyjqBY2EuxDKU1IcOCwZKtbBtSDTPapM7cq8yYgG5/cRq wK6fIM+7gPJDt0a50LnRwW8R/UcpaPGHLPJde2T6SOFx8d30Xwt+6M0KgdYjCI3ozfK8 RlLA== 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 a142si1377984itd.128.2019.05.14.05.26.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 05:26:29 -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 1hQWUv-00038e-P0; Tue, 14 May 2019 12:25:33 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQWUt-00034q-W8 for xen-devel@lists.xenproject.org; Tue, 14 May 2019 12:25:32 +0000 X-Inumbo-ID: 5ccf11b6-7643-11e9-8980-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 5ccf11b6-7643-11e9-8980-bc764e045a96; Tue, 14 May 2019 12:25:30 +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 3FBD915AB; Tue, 14 May 2019 05:25:30 -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 0CB6C3F71E; Tue, 14 May 2019 05:25:28 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 14 May 2019 13:24:56 +0100 Message-Id: <20190514122456.28559-20-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190514122456.28559-1-julien.grall@arm.com> References: <20190514122456.28559-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH MM-PART2 RESEND v2 19/19] 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 , Stefano Stabellini , Andrii Anisov 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 Reviewed-by: Stefano Stabellini --- Changes in v2: - Add Andrii's reviewed-by --- 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,