Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp842230imm; Thu, 5 Jul 2018 09:48:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfP6LR9Re8nVz3gHyQAMHlIhIOs48zddN/b53/X9KyBPgnf8H2xMNRGamKQVYtx9H3hqfqD X-Received: by 2002:a63:8f03:: with SMTP id n3-v6mr6398336pgd.166.1530809325881; Thu, 05 Jul 2018 09:48:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530809325; cv=none; d=google.com; s=arc-20160816; b=BmOjPA2+JscfjzNXzQZnyZTTh+BhaMA6JgeVA6t4zdyQXzQU6PnvQhsoLnZuue1dop rF6zRqm37d4stE8NjFSOcQ3BLKp4Kfggh4aQVCWf3JqKLTK0x9JQJEg6u7XmimcdtCqF 4O7BYUS4UDYxwTp/r9eIgna9fVJRxIiucBrGE84GlTA1HeoGDYbo+wtNTMUagq8Kkdn6 /rtqeQ8XaZcfCfx2z1SxXA/p9ZgiSxSPBDXggKUM61OE0FQMaceGLFrLwYZYDH/tL1vA SNUnP/nlqFh7dc9jQJ5fGXWRxfKLNpeMJ97XTgZXNbQTChDOuujwSMYDUa5R43wrjepe 9PPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=NPbwmjQBuCPNGiAENDf5VHhefPYl5rGnzRiO8pftvCg=; b=PXOHQoaWrJUppAQPUAfVZORMsglA7nBxmjR79gIECzzjRBwVTVW6C3+H7h3v3KDPFb pVfy1PEf/dS9MxyljmFaTW3lQCt+pXGLxKZRMNTHAAHTzj8EUZ1SGeBV8PBM66U/780h EVb0nFvlGe09gwvtcZuiv0G5sGIHyM9W4YXTYavGnzTZfN1wTxVeq2VYxBBetuWgvYev HThInX8oIoB0iIu8vIuz7O+olp9uAy7i9c0WDPL1GEAFLa5TSy29PEE1qL/5/XF9KDrF M/5hUiiusXHWXtVo/yLun+Ko+hGoKyU9OepScVT9OeAAeR90OkcnVF29JrwikSc5Vk7P 455A== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r9-v6si6306023pls.188.2018.07.05.09.48.21; Thu, 05 Jul 2018 09:48:45 -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; 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 S1753585AbeGEQrq (ORCPT + 99 others); Thu, 5 Jul 2018 12:47:46 -0400 Received: from foss.arm.com ([217.140.101.70]:53864 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753325AbeGEQrp (ORCPT ); Thu, 5 Jul 2018 12:47:45 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D90C87A9; Thu, 5 Jul 2018 09:47:44 -0700 (PDT) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A8E4C3F5BA; Thu, 5 Jul 2018 09:47:44 -0700 (PDT) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id D79B61AE3105; Thu, 5 Jul 2018 17:48:24 +0100 (BST) Date: Thu, 5 Jul 2018 17:48:24 +0100 From: Will Deacon To: James Morse Cc: AKASHI Takahiro , Ard Biesheuvel , 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 Subject: Re: [PATCH v2 3/4] efi/arm: map UEFI memory map earlier on boot Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, Will