Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp488038imm; Fri, 15 Jun 2018 00:58:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI0mDleoKw22chWPhKesre5DluLTtfdptZh3D2FiyGIafYv3V9CaMYcx1AYgrvpoKsfCKxb X-Received: by 2002:a17:902:9344:: with SMTP id g4-v6mr805840plp.10.1529049537211; Fri, 15 Jun 2018 00:58:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529049537; cv=none; d=google.com; s=arc-20160816; b=Xvb30GfA01PKbsmPmwNB6MfuNtmLsbj+9xJSfFf/0DC2lXk6bPJR1kGqqfqp7yj6v6 nI2IrUedUlqGyA7+PaiG5d+fb2J9GxtEQHcgYm49NIadPzB0Sa1Iyu0m8fDQyMZBu1Kj bYgKK4F24lLTE6/yTHk7LoWQa9Y57tkRaJ/BE/jkOqP7HSeo/7EaqxERGLPVaEKIndJJ nLIe/DpwpYxM+T20M1wwdUMVaLdNiLjPYUlfOx8ocnnryk7rfN6Yh9a9ZFuAnLwfJQQs 5JqV8lbDSFlFSBxLqQYWSpDGY/9a9Qw7AchjlTAh7tAbvmOAdjcZhfc9wz9Sy6VQsuHf niDQ== 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 s1-v6si6178305pga.296.2018.06.15.00.58.42; Fri, 15 Jun 2018 00:58:57 -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 S1755993AbeFOH4t (ORCPT + 99 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(+) 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(); -- 2.17.0