From patchwork Mon Apr 25 20:06:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 66636 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1237054qge; Mon, 25 Apr 2016 13:16:35 -0700 (PDT) X-Received: by 10.98.29.137 with SMTP id d131mr33497198pfd.2.1461615395161; Mon, 25 Apr 2016 13:16:35 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e74si321904pfd.165.2016.04.25.13.16.34; Mon, 25 Apr 2016 13:16:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeblueprint-co-uk.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933521AbcDYUQc (ORCPT + 29 others); Mon, 25 Apr 2016 16:16:32 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:37767 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964903AbcDYUHc (ORCPT ); Mon, 25 Apr 2016 16:07:32 -0400 Received: by mail-wm0-f48.google.com with SMTP id n3so145581304wmn.0 for ; Mon, 25 Apr 2016 13:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeblueprint-co-uk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=X2laG+EtcVPb1xZCDAaLqZEaBOU6HN/YtDU2h0uI6AQ=; b=2SlaRyDmLDEqrz3VAWhUGL019Wlfrkc7Eo32GqxpzlfExdK4R2A3oOgKf8Lxm1J6wi +UQsIUQ+5sj5Un5iCuAK6qxx+dvmF86/1eql1XiTnunMCX9KJ+sLkDwpheqtEFRsGkf8 ir+9KmOidt+NfJzIW5oue1uku9pGnEqmNl+MdHAxGLuHeR2Z28uGFTAelZGp1NdcvRtY yLMoiCX9tPQl1kbubAFAmftQk4UVtMU6hHeeDTnjKuWJTC1Buk42UeqmcbpGYN4uY30q 9v4LhsArgngSsL6znP6XFbhUizLxbDg2RQ1qECYGw89g9TMwfCMpfty/UbHEpUbbRITA cEFw== 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=X2laG+EtcVPb1xZCDAaLqZEaBOU6HN/YtDU2h0uI6AQ=; b=KmqkRO7wT5cKRFpqRGdG6sw4GKAi2KZ/v/HvnpkHL7K4ctZAEFa0OoBM1gyHNo0iOe Olr77+oG8ylhtikNyUe86VHlANSiROPtyFsiIgkOuK2WV8geBFlSQrMMvj3nA0/Z3gHb 5azzP39ew4MKQlLGqDxHytJlKjljinAQYUAwg5lo6oyAhvjY6snaSEXms8qRtfPwsIjk I6fc4461qiTSqX7lD8LJr+LoYaJlOHEqwW2mNnJeMVu3H8Y4phEVsl0coQHctrG8Ip94 NN0kRUKXWiWxfhLrixDl4dqnC+rE6MNSlOo4V+GoTr5XtuCY9WfKWPrp8LPBUS/XLSTJ ma0Q== X-Gm-Message-State: AOPr4FU8OQ77i0cHj7SwyQLgPYHOLdi4Hh+4WPggUygllH33qkALJKt7Mv461arfjAXLKQ== X-Received: by 10.28.126.145 with SMTP id z139mr13811310wmc.81.1461614850813; Mon, 25 Apr 2016 13:07:30 -0700 (PDT) Received: from localhost (bcdc58e5.skybroadband.com. [188.220.88.229]) by smtp.gmail.com with ESMTPSA id ju3sm19202714wjb.11.2016.04.25.13.07.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Apr 2016 13:07:30 -0700 (PDT) From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Matt Fleming Subject: [PATCH 09/40] efi/arm*: Use memremap() to create the persistent memmap mapping Date: Mon, 25 Apr 2016 21:06:41 +0100 Message-Id: <1461614832-17633-10-git-send-email-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1461614832-17633-1-git-send-email-matt@codeblueprint.co.uk> References: <1461614832-17633-1-git-send-email-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel Instead of using ioremap_cache(), which is slightly inappropriate for mapping firmware tables, and is not even allowed on ARM for mapping regions that are covered by a struct page, use memremap(), which was invented for this purpose, and will also reuse the existing kernel direct mapping if the requested region is covered by it. Signed-off-by: Ard Biesheuvel Signed-off-by: Matt Fleming --- drivers/firmware/efi/arm-runtime.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.7.3 diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index 55a9ea041068..19283deac375 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c @@ -105,8 +105,7 @@ static int __init arm_enable_runtime_services(void) mapsize = efi.memmap.map_end - efi.memmap.map; - efi.memmap.map = (__force void *)ioremap_cache(efi.memmap.phys_map, - mapsize); + efi.memmap.map = memremap(efi.memmap.phys_map, mapsize, MEMREMAP_WB); if (!efi.memmap.map) { pr_err("Failed to remap EFI memory map\n"); return -ENOMEM;