From patchwork Tue Jun 19 06:44:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 139089 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp4837549lji; Mon, 18 Jun 2018 23:46:28 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLoboEgYY6vXTwb2fXPhbia/IWDT4cefYfw4mvQXDRoH02R2R8rZfiGTEQqSclk1Cp0AVDZ X-Received: by 2002:a62:4141:: with SMTP id o62-v6mr16578604pfa.111.1529390788777; Mon, 18 Jun 2018 23:46:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529390788; cv=none; d=google.com; s=arc-20160816; b=YvslMC5Dj9QHRrMA8SqoGbyVEvve6pjuNmaZWjwb/nTf7Bfqxql5tOCVTQwD8A2yzf f4HWpL7WMg3QFP8yXujiJV5i0M2zrNA0sBPG5l1JV6vkyHlRJz3z76uZLboLsSmGldcE 7eXt/B7TukcSUb32uqe0JVBtij+l5I/JhbrYxYne/iR7BSkimdYDvgvbBRWYVcHduJR+ fhPslZSVwA5sMRy5xAb+2EO033gUxBXyO71BTWggeQ3cnd7zo5SMGWv8I/66IpebqpO6 +4qYgHuS+546WXS5n7/VXW9rFczXFaOFmC6iMBi//gFctB596Doc21HvfrorSxky8wNA Dn+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=oQBxjbhd3sorzsMaJwszGFfBNGkMSm+1QnH1URdsLGE=; b=athW75heKDH1Dcxi+KvZ5qLBrO+uvsMzfzti+GttgSVpYrAlalFBg210jXWVsRtwMK IZheBn2C9djb2G1aqhd7vQckrW0+lxeyUmAzfvWp6QxRLkA4Lo+MPG6RiSGWdLEmbyYR uuoEkOJhNjdRs2a5x+OLrBLxFVrlnwVvF3IT5jRsBJBUSvFEfZLgFPtY0pWNC8GH1u9J g+S+hPBU/Ay20/yZ6Z+mJHaKm+tcJ16aVqnz2RQP9sXMQK0UUykTofDAaxhrQlM6WpPL EqZeUUpQPXQNRz7Ei83CvhP2pBXf1HsgcZid/bOWJNk2lEfNwO88siVUz59UetYMHE52 2SdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bsGImkMY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x32-v6si16632276pld.435.2018.06.18.23.46.28; Mon, 18 Jun 2018 23:46:28 -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=@linaro.org header.s=google header.b=bsGImkMY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756229AbeFSGq1 (ORCPT + 30 others); Tue, 19 Jun 2018 02:46:27 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:40831 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755536AbeFSGoM (ORCPT ); Tue, 19 Jun 2018 02:44:12 -0400 Received: by mail-pl0-f67.google.com with SMTP id t12-v6so10397328plo.7 for ; Mon, 18 Jun 2018 23:44:12 -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=oQBxjbhd3sorzsMaJwszGFfBNGkMSm+1QnH1URdsLGE=; b=bsGImkMY0YQk+qC/DMf4ZWW82ZNqGj0m/RmAzznQP/SqxLo85JmXW+bGukd2Py81mJ NJq3/y/OrRE5BiufK0c/G2RWf8xbPV9V6YA0PhvhThoHNkqfu8T/kcMV7haRHqLOpUqT Myn7Mo6OWE/tHptsgB9uMtXPrFh6U2gPNvu2o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oQBxjbhd3sorzsMaJwszGFfBNGkMSm+1QnH1URdsLGE=; b=UFjzp/1ykkhFlNu+8YuKTsz870Cuau+jaqaGSPFy+vp+wYN+dArtM+aEJkROQd2MEL 12PI1cJ5JRSyjQh+NAJnk+l/uThhPoe5hpms4OzZLvN2YizoxugiNDVDPTB3XqiuZsRN nmR2GdKZXands9CvV0zX1pEFYiRJBQZybYbaEh9JbGZ39JnDR3KQ3uLl1p1QuvBPapV9 YkbDavN+Knkytcxx5NYItQKyUwLdNZ7eryfekkVe8kZZvfocEIMst8rEGXbh+b9uTyc2 0aoV1So5piR7jf4Tdla77B0v0aF7cCjSG0EtvUnHrdnewQEI3CqmggOQgLmgFPoehhtf gaMQ== X-Gm-Message-State: APt69E0lRIPWh8I1bznAQDByRBv2KKLoSfFBrOrusnWBlqZLlyjbfESN 1KsNK4vYNgL91dJ7sA7arhCiNQ== X-Received: by 2002:a17:902:1e4:: with SMTP id b91-v6mr17386973plb.155.1529390651996; Mon, 18 Jun 2018 23:44:11 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id e68-v6sm32031601pfl.65.2018.06.18.23.44.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jun 2018 23:44:11 -0700 (PDT) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com, akpm@linux-foundation.org, ard.biesheuvel@linaro.org Cc: tbaicar@codeaurora.org, bhsharma@redhat.com, dyoung@redhat.com, james.morse@arm.com, mark.rutland@arm.com, al.stone@linaro.org, graeme.gregory@linaro.org, hanjun.guo@linaro.org, lorenzo.pieralisi@arm.com, sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, AKASHI Takahiro Subject: [PATCH v2 2/4] efi/arm: map UEFI memory map even w/o runtime services enabled Date: Tue, 19 Jun 2018 15:44:22 +0900 Message-Id: <20180619064424.6642-3-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180619064424.6642-1-takahiro.akashi@linaro.org> References: <20180619064424.6642-1-takahiro.akashi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Under the current implementation, UEFI memory map will be mapped and made available in virtual mappings only if runtime services are enabled. But in a later patch, we want to use UEFI memory map in acpi_os_ioremap() to create mappings of ACPI tables using memory attributes described in UEFI memory map. So, as a first step, arm_enter_runtime_services() will be modified so that UEFI memory map will be always accessible. See a relevant commit: arm64: acpi: fix alignment fault in accessing ACPI tables Signed-off-by: AKASHI Takahiro Cc: Ard Biesheuvel --- drivers/firmware/efi/arm-runtime.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.17.0 Acked-by: James Morse Reviewed-by: Ard Biesheuvel diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index 5889cbea60b8..30ac5c82051e 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c @@ -115,6 +115,13 @@ static int __init arm_enable_runtime_services(void) return 0; } + mapsize = efi.memmap.desc_size * efi.memmap.nr_map; + + if (efi_memmap_init_late(efi.memmap.phys_map, mapsize)) { + pr_err("Failed to remap EFI memory map\n"); + return 0; + } + if (efi_runtime_disabled()) { pr_info("EFI runtime services will be disabled.\n"); return 0; @@ -127,13 +134,6 @@ static int __init arm_enable_runtime_services(void) pr_info("Remapping and enabling EFI services.\n"); - mapsize = efi.memmap.desc_size * efi.memmap.nr_map; - - if (efi_memmap_init_late(efi.memmap.phys_map, mapsize)) { - pr_err("Failed to remap EFI memory map\n"); - return -ENOMEM; - } - if (!efi_virtmap_init()) { pr_err("UEFI virtual mapping missing or invalid -- runtime services will not be available\n"); return -ENOMEM;