From patchwork Tue May 14 12:21: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: 164163 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2552327ili; Tue, 14 May 2019 05:23:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvFkPbEFE3TZL42XxxG/+XPZFRXPcI9qy/mSAubjSZzNJdDZCLgCnIl6UahRQuEoUAH76j X-Received: by 2002:a24:a943:: with SMTP id x3mr569598iti.64.1557836600243; Tue, 14 May 2019 05:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557836600; cv=none; d=google.com; s=arc-20160816; b=A7k78uHvd7U55HSOa8Bk6LSdfi/7nDkYN+B1vgj0m8wVYwxHkhhYAC9sv6sG1SqCi0 Wra7Eb9mWPExlxzmX1yhW+YRirK005ccJZB6NefT7psyrpqJFihRBP9EDBPst494Jbpa 7JejcKHOE5d4a+VLvqOzfAdN2nkGJaqHHUYKXTAndNe44VH6JMePRmseZS/Qi056jvsr m0oNno8OohWX1d+URSwWH3GO3/DhCuMfwv4vqgCmA+EWZOpOe94A6fphEvtDZ8YAXtKx hWDl5c4HcSMAvS9NRrWqCiYgY6oO9LvGuxrNu9EREO7bxuioFvCn04mUYJ5f+eDz8+uW rjmQ== 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=rF9dz8sMNsDtDBrbkwzVQVkiKc36gaS/oMaOKuWEWJ9Sy/tZzGLRH5NN9FaEitSrEK iHpkUb0t6a85am/1cObS6Q0U2U9NhNmrWxYhFGOMCeMdNA09yvfKEAYwnFFWUi3QjI7F F5SJc/EGq/H4gCGSKY7pA85qFCTaLKN8uJAVI9DG6bsOjOeiu8eL1i5W1XEOfwn3/PI9 2DXsvaOyl14TQ8VjsqCcGFyutBBP2IEQZjpQH0VKstkqiIG4z+bd4Fr7MHJvs1aEvUip XgQdJgjzlWq7qxwhfOUAgq3jnMjOY6AJnwkwkKFfy1Wl9EJZWCSTZo4TJ2uj/3ZPbUsM Cy9g== 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 a188si1422353itc.68.2019.05.14.05.23.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 05:23:20 -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 1hQWRu-0000Yi-9I; Tue, 14 May 2019 12:22:26 +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 1hQWRs-0000UE-65 for xen-devel@lists.xenproject.org; Tue, 14 May 2019 12:22:24 +0000 X-Inumbo-ID: ed3274ae-7642-11e9-9bd8-af6c598e80cf Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id ed3274ae-7642-11e9-9bd8-af6c598e80cf; Tue, 14 May 2019 12:22:23 +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 E887015AB; Tue, 14 May 2019 05:22:22 -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 B538B3F71E; Tue, 14 May 2019 05:22:21 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 14 May 2019 13:21:36 +0100 Message-Id: <20190514122136.28215-28-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190514122136.28215-1-julien.grall@arm.com> References: <20190514122136.28215-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH MM-PART2 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 --- 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,