Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4814628imm; Mon, 18 Jun 2018 23:47:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKbN7uwuMIQjhnamfdHl9W0v1YSm0iGCYCbU7tGj1FNuRvZ2n5i3YIKQuJFDImkOmEsvma1 X-Received: by 2002:a62:1146:: with SMTP id z67-v6mr16625130pfi.135.1529390859074; Mon, 18 Jun 2018 23:47:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529390859; cv=none; d=google.com; s=arc-20160816; b=gacuB566gDHHQOwDFirgdqsPPJ1MNFdwMztruvRGu2wr2Cr7GVwvJbaWZf1wQi4FOV ySjS3tjtuzFxuwX2mtI9ce5/G83rZD+t1DuA9DxN3cmXJs0doPgu0L5vs6q3A0A1Xkzr WiCTP8zhoeHF8FSbKFzuRkwLJ2ZdNPD0mpb8i0w0M6+scrxgOP7e9jpYI/27iv8aNXBZ 5zHCL5ztjqAFu3u3Psmgr6+jHLewM8MEuJwijgdGQlhYgrse4au3sHzMNPj2cb0lMxtB R8yNASsXdf1xjHIEpuYHjKJrjnVKItNmCMz2/O8EP27lBLZ22gXI3UdnZrqWh6CIEXhc 9txg== 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 m12-v6si16933160pll.461.2018.06.18.23.47.25; Mon, 18 Jun 2018 23:47:39 -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 S1756212AbeFSGq0 (ORCPT + 99 others); Tue, 19 Jun 2018 02:46:26 -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(-) 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; -- 2.17.0