From patchwork Fri Jun 15 07:56:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 138660 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp519665lji; Fri, 15 Jun 2018 00:56:52 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKic2F+x979IBsaKKGay2Atm2DYxi8jGMkDTGyqxqqAH6jKyCYn8yMvQZNmOLwqlm5XRaYL X-Received: by 2002:a62:ca99:: with SMTP id y25-v6mr697182pfk.187.1529049412036; Fri, 15 Jun 2018 00:56:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529049412; cv=none; d=google.com; s=arc-20160816; b=HxG+DVMAfP9+M39k9Ce2ysH/78WfL4q1eVwyJpKBZQojYPLjhZDg6kB3a92SNBNOL+ DLs54fOiessU+kog3OlE+XQ/bF1w5y7mnjQ5z72tADMkZtbKUlEMDHzVPTiQkHK/mI3C SAPUO0bBUtJSaqdAAIcHCj4SMS87uO+mAxxsq3/p4hjRbC2pAHHtlowbivcpyJWbqjxY ltUQh/7cZXOr+DBDPviUzA0aVuqUxSAAWFDWN/EVfkpMgcJRZJxK4NHxYWK0wteRqrSi vXCjVcMukuxufXB6KnV4EfDnF/YAYfDG208seEr+6bEznyOifmPrUUvqnk5okGiP1z1r bKng== 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=kpMEU3sh1IN0/bxn4qA0OTMbmXCEF6TENF+YzCU+lOw=; b=LX2ok2ISzbYGbZ+YB/R/OFe8hIWYvFLvygqpyBawJNesiHp+mXgeC2EIMOJurxJZ4e 4wZjAFmGsJ+998cAwR2TMoyhMAB9leyMh06DRmvaPH/hFOYSUmw1s24yCIXZT6c7ZGnV 8O+/YiC9vQigF02OgDwE/CPdwLPCHS6TG/nBtjTKAJI/Dep9Mqq8yMR9kagT4eP7QowC xvQhiaXUlVFqf4WICxo8LD7i8Fgtj5MSS1bHa/Z3poF7cpSq+Uc657szobW996YEsCR9 Yb+rCLmFiYfT9koBUUAXbkbdstKWVV89ihurK7m7ENHSL7LqtLh+w977BXxeqPMLGXP7 CYfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DDBvU4rz; 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 s36-v6si7178751pld.278.2018.06.15.00.56.51; Fri, 15 Jun 2018 00:56:52 -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=DDBvU4rz; 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 S1755997AbeFOH4t (ORCPT + 30 others); Fri, 15 Jun 2018 03:56:49 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:38658 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755925AbeFOH4q (ORCPT ); Fri, 15 Jun 2018 03:56:46 -0400 Received: by mail-pl0-f66.google.com with SMTP id b14-v6so4941502pls.5 for ; Fri, 15 Jun 2018 00:56:45 -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=kpMEU3sh1IN0/bxn4qA0OTMbmXCEF6TENF+YzCU+lOw=; b=DDBvU4rzCp9e+l19e+pORcW+cEFywfs3fb1wjwtB8DcbVZiIj/KWS2WMhIhSSDm9Me ti+Jj+TCb7ZdaLMoEx0z4oA0I+WJD19fKOV3JNOEiNDyh0/fxx3rBVO7iaWDeYyiqmpy r0zFGt6g/zJ6D14WTbXzhgA6ggN9IjbAvowqY= 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=kpMEU3sh1IN0/bxn4qA0OTMbmXCEF6TENF+YzCU+lOw=; b=j3KCcr0OT3mUrx6HgXbuhv8ktRvLOV585k2vkTrPlyUIMWbTT49vobc4f6dqhQmN1I ALF4qd4lcqFRtz6hMtqoR4r+EVyRxJVK+oS4wq/l8F6/iFt5JMdJ51Y588let+9zrqmG pUtdL86l3PGaSgO/TTefsN0w37Vg3fsOCV/58AE8Owqdo/BBzfwkVI14atRcrhmXoNme CkwHOfqSQY5p5Hnb0O5+unv+sK7oWcnn5Ck6oB2pKT5TZEVubpzvcm2Jv+TIDhf5Aq4d /wOM4VbtqmHKxufso90ATR3Kaxd1HTyg5mv6dDid1Y2wRkhkagfql2RLkTop60tirKw8 Qi9w== X-Gm-Message-State: APt69E2SH7Lu1wip7IziMwwRQm5GO8j04lh6R0pQ8oPb56oYTfGU6Uv2 EklhywxMh3qlnaiM0YnHNNsm6w== X-Received: by 2002:a17:902:9048:: with SMTP id w8-v6mr788087plz.34.1529049405314; Fri, 15 Jun 2018 00:56:45 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id s2-v6sm12872638pfb.127.2018.06.15.00.56.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 00:56:44 -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 3/3] init: map UEFI memory map early if on arm or arm64 Date: Fri, 15 Jun 2018 16:56:23 +0900 Message-Id: <20180615075623.13454-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180615075623.13454-1-takahiro.akashi@linaro.org> References: <20180615075623.13454-1-takahiro.akashi@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As ACPI tables may not always be properly aligned, those regions should be mapped cacheable in order to allow the kernel safe access to them. UEFI memory map contains necessary information for mappings, and we want to make sure that it should get accessible before any acpi_os_ioremap()'s. So, in this patch, efi_enter_virtual_mode(), which was previously named efi_enable_runtime_services() and invoked via early_initcall on arm/arm64, is now moved early enough as the first access will occur in acpi_load_tables() of acpi_early_init(). See a relevant commit: arm64: acpi,efi: fix alignment fault in accessing ACPI tables at kdump Signed-off-by: AKASHI Takahiro Suggested-by: Ard Biesheuvel Cc: Andrew Morton --- init/main.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.17.0 diff --git a/init/main.c b/init/main.c index 3b4ada11ed52..532fc0d02353 100644 --- a/init/main.c +++ b/init/main.c @@ -694,6 +694,9 @@ asmlinkage __visible void __init start_kernel(void) debug_objects_mem_init(); setup_per_cpu_pageset(); numa_policy_init(); + if (IS_ENABLED(CONFIG_EFI) && + (IS_ENABLED(CONFIG_ARM64) || IS_ENABLED(CONFIG_ARM))) + efi_enter_virtual_mode(); acpi_early_init(); if (late_time_init) late_time_init();