Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1125938imm; Thu, 5 Jul 2018 15:27:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe6ITMNk99gM/3gRdumZFBRqqtCz6Nt3LgM7hCIxxGW0qdjmpGLDhE4HFVsobmuTkaAL2yx X-Received: by 2002:a62:1d97:: with SMTP id d145-v6mr8251726pfd.101.1530829630493; Thu, 05 Jul 2018 15:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530829630; cv=none; d=google.com; s=arc-20160816; b=gbLEEk/ZZFCGTwYZ+esLu6B6PtfWFpIpu5N5qSwo7A1PKmNF0gUObjVs2j5qmgV3dX a4oOmuEyBQOrKZ29tnMwrIWbizkF2P63EWWYeMXGVyaHZkFIKfwcoe9NtW1ziUIpk6T7 EEYAzVX1pROFUvEl43YT3N3zc7jR7jk+DEgpdFqe8zSnvoK+8AM3TniTELK6WuLtPNmq Q0ObfZuEewIoKauXKELoLQtoxqfPijhAauiRMrhFChWh4yWfgAtdtgqf77xl2ImCZhGz HEFTLz+PvKDYToTTf8Az1ASQTNzxJMLI55ntaBehGYfRght9PKK6nYRLjKJZ9Ib+w4Kg YdRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=Itn3GGTAZrZ9LLqDELowKuzdSYibg/LVa3Nwm/YGp+g=; b=G/BkG4RnFHSpWJiNhwsDK0BlcCPbMDUp7eFXqRoqTM6Lolxf7dthk+BjBEExp5ulLS WJA5ekbA6PcN+DRMSIb/fMd1b7Yi8Iy7WTct9sVFa8oSPk4eEn9ZJ1fiozu2yU81XEPn Yz6ZtQxGi7R+YvoPEpYq67p3xDgP+hwKHc92Vjvmi5yyMTbSZ3oq6+4wStcwe8TkJ4iP HbCg9AbYuCUWfOyv+OT7Yx5SkHc8+l/pnFll0Mxj7rwVZkCrzXEpy3k3xLpykq6ILUb1 4Sx0UO7t6Bf7CEQMhIOpEycSceQJBIW+1Br/2SquW7kgQiHIatjjS6X3vO/ZcZcoW6zW h4iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tl34x+Nb; 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 n61-v6si6678434plb.256.2018.07.05.15.26.56; Thu, 05 Jul 2018 15:27:10 -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=Tl34x+Nb; 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 S1753555AbeGEW0T (ORCPT + 99 others); Thu, 5 Jul 2018 18:26:19 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:33473 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753432AbeGEW0R (ORCPT ); Thu, 5 Jul 2018 18:26:17 -0400 Received: by mail-io0-f194.google.com with SMTP id z20-v6so9183668iol.0 for ; Thu, 05 Jul 2018 15:26:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Itn3GGTAZrZ9LLqDELowKuzdSYibg/LVa3Nwm/YGp+g=; b=Tl34x+NbbxypL+9USkzjCJoPMevvQJEhDrBJZ9qpfs3Nz8Mvg16aIPeAwNFarxGCcW 7jYt+A06oanqLWJjtsBd/ntAVHXUHezLWohTkK85HHJlV0MvwgMj7g7M517yQBosj/t+ 5zbtS+tLlIDBRzQundpX5qelbQC1mI+QZoH24= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Itn3GGTAZrZ9LLqDELowKuzdSYibg/LVa3Nwm/YGp+g=; b=MMK2Xp3L6l07K+txYtp2uJLn/aL0tHKyuCVe/GZSozcBoENAe28Q4MgqvlzpTFBnCL M9DPUNpWiiC3A1Z1qFtRHPi/OtQicH0gfY35oYGZFYdosYxguCqyhsjXnJEie4uB8Vrk PBPd4BJ+5VocOTSZkATCrNaz3g5Bc+NpZNVYVqs1xajXviLZXVkEyKGMOG/TwZteEXr6 Ewv4wqXxaAW8DtzCqpfd1kMn/X5PDZW1R2sLolA+OsevTukr085BKyfSMOxXeW6I7IJk Y5wmWJsdkoFVI1+vrTuGT4kHu3TmNDVcQNs8ntorr3gIW264aj3V4rxb4Bx5eTssjsRs dSDw== X-Gm-Message-State: AOUpUlGJKp9TQm4YRtucgwhXV7NiBzdr2dFXDFCiyK3gtyCItg6S3HJg nKURSCa0cPf5kjFd8yxLC7c6GD/OdbjWVAGmD8VepA== X-Received: by 2002:a6b:be83:: with SMTP id o125-v6mr6459667iof.173.1530829576901; Thu, 05 Jul 2018 15:26:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:bbc7:0:0:0:0:0 with HTTP; Thu, 5 Jul 2018 15:26:16 -0700 (PDT) In-Reply-To: <20180619064424.6642-3-takahiro.akashi@linaro.org> References: <20180619064424.6642-1-takahiro.akashi@linaro.org> <20180619064424.6642-3-takahiro.akashi@linaro.org> From: Ard Biesheuvel Date: Fri, 6 Jul 2018 00:26:16 +0200 Message-ID: Subject: Re: [PATCH v2 2/4] efi/arm: map UEFI memory map even w/o runtime services enabled To: AKASHI Takahiro Cc: Catalin Marinas , Will Deacon , Andrew Morton , "Baicar, Tyler" , Bhupesh Sharma , Dave Young , James Morse , Mark Rutland , Al Stone , Graeme Gregory , Hanjun Guo , Lorenzo Pieralisi , Sudeep Holla , linux-arm-kernel , Linux Kernel Mailing List , Kexec Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19 June 2018 at 08:44, AKASHI Takahiro wrote: > 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 Reviewed-by: Ard Biesheuvel This may be taken via the arm64 tree. > --- > 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 >