From patchwork Mon Jul 11 19:00:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 71754 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp98819qga; Mon, 11 Jul 2016 12:02:20 -0700 (PDT) X-Received: by 10.66.85.197 with SMTP id j5mr38112447paz.87.1468263740044; Mon, 11 Jul 2016 12:02:20 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 3si5061362pfg.32.2016.07.11.12.02.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jul 2016 12:02:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bMgSQ-0000dB-KS; Mon, 11 Jul 2016 19:01:30 +0000 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bMgSH-0000Vp-3J for linux-arm-kernel@lists.infradead.org; Mon, 11 Jul 2016 19:01:21 +0000 Received: by mail-wm0-x22f.google.com with SMTP id i5so30672308wmg.0 for ; Mon, 11 Jul 2016 12:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=id03ii6COqp5sQpga8lNXhxY1j5uXtjzPuHbxRrRQ1A=; b=CfoM5+GUQcJCnSQ/gWwe2NeMu2XoIbJ40U4oiEAE0A/L0oEkUdcJb5l1X1ckYWDcru RZI9vsllbakR0heytZu+MjvX63pCXcOuavVwFMP8MGFW14sezd3H/lJ2tcwLifuxIZAv 9gVnkmEYOV1Khz4bQT7Zdnduf1bPlCiaR5UAA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=id03ii6COqp5sQpga8lNXhxY1j5uXtjzPuHbxRrRQ1A=; b=Zo9i7/PV0ksU2V0rBgNZoSupxQNloDd9irh6E930tfsA6AnSvaG3zhKHsJSZZvhz4E Jp6eP7C8X62143XynfOufcGZQ4RXx4kVMFS/Txg8tqR6jXoEpV2Anl0fWIwgKLDMDov1 eO+01PJSvY280hTB14TWYuaRp+mtvfMaQ+6J1pe52odgTipxWO5VMUvloneVOeg8hEkU eUOT4em3DGCEsDIBuOFC/CxThRIae92tzHfzZaJR6jYZbl6Q3bRzuVlYAZsa2bax12lH nrRbiWNrf3NFYtqtjRaREQkJBFR6ly0ToIVPW3lLVnk5OlzHQCNqEj4w6BXsl+K5tJyp 1VZA== X-Gm-Message-State: ALyK8tLhcFElrqDOvqa9Y02SAEfer/ha9MVwh6NGAWDcwG9OyYjTeYrPa5Q4OUwxkynmxuzc X-Received: by 10.194.236.166 with SMTP id uv6mr1144921wjc.118.1468263659678; Mon, 11 Jul 2016 12:00:59 -0700 (PDT) Received: from localhost.localdomain ([188.203.148.129]) by smtp.gmail.com with ESMTPSA id b187sm1646398wmg.15.2016.07.11.12.00.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jul 2016 12:00:59 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt@codeblueprint.co.uk, tbaicar@codeaurora.org, cov@codeaurora.org Subject: [PATCH v2 1/2] efi: esrt: use memremap not ioremap to access ESRT table in memory Date: Mon, 11 Jul 2016 21:00:45 +0200 Message-Id: <1468263646-28184-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1468263646-28184-1-git-send-email-ard.biesheuvel@linaro.org> References: <1468263646-28184-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160711_120121_285861_779F77AC X-CRM114-Status: GOOD ( 13.66 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, pjones@redhat.com, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org On ARM and arm64, ioremap() and memremap() are not interchangeable like on x86, and the use of ioremap() on ordinary RAM is typically flagged as an error if the memory region being mapped is also covered by the linear mapping, since that would lead to aliases with conflicting cacheability attributes. Since what we are dealing with is not an I/O region with side effects, using ioremap() here is arguably incorrect anyway, so let's replace it with memremap() instead. Acked-by: Peter Jones Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/esrt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c index b93cd11f9bcc..14914074f716 100644 --- a/drivers/firmware/efi/esrt.c +++ b/drivers/firmware/efi/esrt.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -387,9 +388,9 @@ static int __init esrt_sysfs_init(void) if (!esrt_data || !esrt_data_size) return -ENOSYS; - esrt = ioremap(esrt_data, esrt_data_size); + esrt = memremap(esrt_data, esrt_data_size, MEMREMAP_WB); if (!esrt) { - pr_err("ioremap(%pa, %zu) failed.\n", &esrt_data, + pr_err("memremap(%pa, %zu) failed.\n", &esrt_data, esrt_data_size); return -ENOMEM; }