Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1129859imm; Thu, 5 Jul 2018 15:32:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf8F4InMpvzkfi4YrBSp48/rZV5/6xY73OwLAjtwpgXBKElhtyASBcz2TMEW62py5XWLTxT X-Received: by 2002:a63:1b17:: with SMTP id b23-v6mr7246145pgb.275.1530829963018; Thu, 05 Jul 2018 15:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530829962; cv=none; d=google.com; s=arc-20160816; b=R18pDXEx7nXA3lect1fJ7SL24gBA0GWxewbVFgDl+wvwI24+2fBcZpaCrWKAbK8kKy cj8MIe5GFk3H01CMN/RTapNU/UlZyIEcPs3o3k75WeiG5jeRoIb5t7ByD/9uLPjYbotE KT77r0Tf2MoYe6K64ToH84WCS0vcd7MWbfUx68/98e0sc30aIebUevzsAZ7kNULXOIFd T1ltWQJ+gWbeE4I65GOzrzOM7wFA78aU+x0BwRNZT3CA9rKX0/RmPn3U6TgXrWiS/0q2 I3oOEFqSTldAnqtSSUn/ztV+Ydcmpt5kAJ85bEHc4nrvsqbht0UR3BZnk9jVaHaILQtS RiTg== 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=Sug5JS97rTlVkz/prn+QJVSLTqQcj3MaSmDD4yZyoig=; b=ljvdP64ea3IuznW917NXARLZkkYKHNJIPXllNj943FspvgyML2pxK38qJSbXPbLBJH GNK9kgtidy+2VN7YXh3lsSEBohrvCCannBcA1GgyRDK7lQxcjksez7Yj+Hgad4d5iJOj bvonufnLPCmYzDeklQ3ewtaKCLFGwSA49fd+wslUUlg3hp7PkXfu5kC2joCka2vQIKSx Rr4/KZTeOZUFzrJlm38pMBFgpm8p2Ov4VshzVlgOWl7WzLW/subEyopysFaGpoE7248a 0tClrUu1LdVnayfdU43Gb3DYAXfXu5FFtCQhgPrsz9Wg9HF9qrg1CcndSo5CtCc6/UyK Xvew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OXIk4lbf; 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 u2-v6si6171869pgp.292.2018.07.05.15.32.28; Thu, 05 Jul 2018 15:32:42 -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=OXIk4lbf; 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 S1753637AbeGEWbv (ORCPT + 99 others); Thu, 5 Jul 2018 18:31:51 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:42188 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753489AbeGEWbu (ORCPT ); Thu, 5 Jul 2018 18:31:50 -0400 Received: by mail-io0-f196.google.com with SMTP id r24-v6so9183075ioh.9 for ; Thu, 05 Jul 2018 15:31:49 -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=Sug5JS97rTlVkz/prn+QJVSLTqQcj3MaSmDD4yZyoig=; b=OXIk4lbfKVgq0lMRK9AWey1m+RL5hTce0ZOZfrRqlOrVkBbaDsTTackpin1XuVMGNc iRZWpuYFtWfJH8XlpIzc4yds+FYz+b5cDQBVzyAa/8QqRUcn47KtB84osgG/7mcITBZw 4h6FzhSXPCT0I8/RfVtYii/27EV2C3pZu8srQ= 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=Sug5JS97rTlVkz/prn+QJVSLTqQcj3MaSmDD4yZyoig=; b=a0tvlug1V2nU433CPsIKNk/kEe+n6E+GRjLagxYJR6XqrMz0kH8dspL/zyr2CccJMY R2kYvQ0paYptA0CUaAQhFkkSfatYO2r1xOz/XmWj6R7Ynn9CJwAcuqY1sbUloYg6CbLa 0FCNbHcNz3W2vlOMmXkxcXxu+5I3mlP9WVcDpclw8e46041slXczdHW5uepKP9VGtSXe 0LZwcvurA+sE2/rKaz+Z01s4RgHu9Gwd/2XOxyWfNdBiYW56DUXQ1N9Zf2vFLWETsQNk cmkyxzKR4UrZTThSfcUPr4Td94yp2E6Met2z7nsxjTpxfWJiPwqZvCA6X0BrUOXOoYYq o+0Q== X-Gm-Message-State: APt69E1ztwTSF5RF1HJSzKI2MSGEHbl9P8aoWwvIwnPn+5Mx2oxf8aKt Npnd54x+pwDnEOCAJ/KNDa/0ci0AAhqjvjnRtICCIA== X-Received: by 2002:a6b:5d1a:: with SMTP id r26-v6mr6391907iob.170.1530829909631; Thu, 05 Jul 2018 15:31:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:bbc7:0:0:0:0:0 with HTTP; Thu, 5 Jul 2018 15:31:49 -0700 (PDT) In-Reply-To: <20180705164824.GA7445@arm.com> References: <20180619064424.6642-1-takahiro.akashi@linaro.org> <20180619064424.6642-4-takahiro.akashi@linaro.org> <20180704170655.GD8370@arm.com> <20180705094313.GL28220@linaro.org> <20180705164824.GA7445@arm.com> From: Ard Biesheuvel Date: Fri, 6 Jul 2018 00:31:49 +0200 Message-ID: Subject: Re: [PATCH v2 3/4] efi/arm: map UEFI memory map earlier on boot To: Will Deacon Cc: James Morse , AKASHI Takahiro , Catalin Marinas , Andrew Morton , "Baicar, Tyler" , Bhupesh Sharma , Dave Young , 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 5 July 2018 at 18:48, Will Deacon wrote: > On Thu, Jul 05, 2018 at 12:02:15PM +0100, James Morse wrote: >> On 05/07/18 10:43, AKASHI Takahiro wrote: >> > On Wed, Jul 04, 2018 at 08:49:32PM +0200, Ard Biesheuvel wrote: >> >> On 4 July 2018 at 19:06, Will Deacon wrote: >> >>> On Tue, Jun 19, 2018 at 03:44:23PM +0900, AKASHI Takahiro wrote: >> >>>> Since arm_enter_runtime_services() was modified to always create a virtual >> >>>> mapping of UEFI memory map in the previous patch, it is now renamed to >> >>>> efi_enter_virtual_mode() and called earlier before acpi_load_tables() >> >>>> in acpi_early_init(). >> >>>> >> >>>> This will allow us to use UEFI memory map in acpi_os_ioremap() to create >> >>>> mappings of ACPI tables using memory attributes described in UEFI memory >> >>>> map. >> >> >>> Hmm, this is ugly as hell. Is there nothing else we can piggy-back off? >> >>> It's also fairly jarring that, on x86, efi_enter_virtual_mode() is called >> >>> a few lines later, *after* acpi_early_init() has been called. >> >> >> Currently, there is a gap where we have already torn down the early >> >> mapping and haven't created the definitive mapping of the UEFI memory >> >> map. There are other reasons why this is an issue, and I recently >> >> proposed [0] myself to address one of them >> >> >> Akashi-san, could you please confirm whether the patch below would be >> >> sufficient for you? Apologies for going back and forth on this, but I >> >> agree with Will that we should try to avoid warts like the one above >> >> in generic code. >> >> >> >> [0] https://marc.info/?l=linux-efi&m=152930773507524&w=2 >> > >> > I think that this patch will also work. >> > Please drop my patch#2 and #3 if you want to pick up my patchset, Will. >> >> Patch 2 is what changes arm_enable_runtime_services() to map the efi memory map >> before bailing out due to efi=noruntime. >> >> Without it, 'efi=noruntime' means no-acpi-tables. > > So it sounds like we want patch 2. Akashi, given that this series is only > four patches, please can you send out a v3 with the stuff that should be > reviewed and merged? Otherwise, there's a real risk we end up with breakage > that goes unnoticed initially. > Yes, we want patches #1, #2 and #4, and this one can be replaced with my patch above. Everything can be taken via the arm64 tree as far as I am concerned.