From patchwork Thu Jun 2 17:49:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 9151059 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 83FB360467 for ; Thu, 2 Jun 2016 17:53:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79F1826490 for ; Thu, 2 Jun 2016 17:53:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EBBE28319; Thu, 2 Jun 2016 17:53:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0595D26490 for ; Thu, 2 Jun 2016 17:53:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1b8Wmj-00067X-Mj; Thu, 02 Jun 2016 17:51:57 +0000 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1b8Wmg-000644-CJ for linux-arm-kernel@lists.infradead.org; Thu, 02 Jun 2016 17:51:55 +0000 Received: by mail-lf0-x234.google.com with SMTP id k98so39126937lfi.1 for ; Thu, 02 Jun 2016 10:51:33 -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=GNI4WovdGORO6rrcOH/xEYNXcQqo/+p1kfZ18JJRAh4=; b=RAyP9MGoaaztP7twI5u/4cCh5a0MjbqzQmv0yXWa5hpr3fxkb/P9wD+qUJ96eut8R7 vyD1SheMAt0MmUhRBI+pVD/WlFV/iNkzglGR+DoBHzTW33Ktu4gTl2OzUugP7hATddRS Av9sjZ5OgodM53nGjUAcg+wP/4/Syp5/LmDZs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GNI4WovdGORO6rrcOH/xEYNXcQqo/+p1kfZ18JJRAh4=; b=D91qaIPq4f2Zk+KBaK3niJBs/hBDEVNbLD+OmW8sd4rVjNP7S51XwvKlIUXhKG7TOo 0TOZE7B8XvlrOVogzMNf7XnkeLJywpRESI5R8jZni1U6c2z7CDoou2pTRr4/nE75yVOD Va4nTOPjPgqyYnFHk6tFCb9v3xtcjSF02CaXXeW/PpiOnMEZO1kDzwVmUwawSydpCQhs /yexIr50GeXkMrYZTQS5ZJ84Y1V0Ats1gPSG3bsBitjS5VumJO5JR+RmA84KOyuJvTnx Pse6dADtmIgqwmpo57YrcJg71awxaj0TKvv/aPP+5pgJBxZCWWg/fzTLpI+KMzgT84Cd bZLQ== X-Gm-Message-State: ALyK8tLGVlaGa+RyLFeNntTlyCar+izkF0X/pNnLmRDF2DgEuUUj99Y9Q3mIADDbWaRaxsn5 X-Received: by 10.25.26.81 with SMTP id a78mr3710491lfa.185.1464889892288; Thu, 02 Jun 2016 10:51:32 -0700 (PDT) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id c1sm147140lfc.34.2016.06.02.10.51.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jun 2016 10:51:31 -0700 (PDT) From: Aleksey Makarov To: Catalin Marinas Subject: [PATCH v3 5/5] ACPI: ARM64: support for ACPI_TABLE_UPGRADE Date: Thu, 2 Jun 2016 20:49:10 +0300 Message-Id: <20160602174910.30428-1-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160527171424.GG10909@e104818-lin.cambridge.arm.com> References: <20160527171424.GG10909@e104818-lin.cambridge.arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160602_105154_603744_D71C4D11 X-CRM114-Status: GOOD ( 16.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Graeme Gregory , Will Deacon , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Aleksey Makarov , "Zheng, Lv" , Jon Masters , linux-arm-kernel@lists.infradead.org, Len Brown MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jon Masters This patch adds support for ACPI_TABLE_UPGRADE for ARM64 To access initrd image we need to move initialization of linear mapping a bit earlier. The implementation of the feature acpi_table_upgrade() (drivers/acpi/tables.c) works with initrd data represented as an array in virtual memory. It uses some library utility to find the redefined tables in that array and iterates over it to copy the data to new allocated memory. So to access the initrd data via fixmap we need to rewrite it considerably. In x86 arch, kernel memory is already mapped by the time when acpi_table_upgrade() and acpi_boot_table_init() are called so I think that we can just move this mapping one function earlier too. Signed-off-by: Jon Masters Signed-off-by: Aleksey Makarov Acked-by: Will Deacon --- arch/arm64/Kconfig | 1 + arch/arm64/include/asm/acpi.h | 2 ++ arch/arm64/kernel/setup.c | 6 ++++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 87c48ad..baee459 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -5,6 +5,7 @@ config ARM64 select ACPI_REDUCED_HARDWARE_ONLY if ACPI select ACPI_MCFG if ACPI select ARCH_HAS_DEVMEM_IS_ALLOWED + select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE select ARCH_HAS_ELF_RANDOMIZE select ARCH_HAS_GCOV_PROFILE_ALL diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index aee323b..c7aefc5 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -113,4 +113,6 @@ static inline const char *acpi_get_enable_method(int cpu) pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr); #endif +#define ACPI_TABLE_UPGRADE_MAX_PHYS MEMBLOCK_ALLOC_ACCESSIBLE + #endif /*_ASM_ACPI_H*/ diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index feab2ee..4bce811 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -261,11 +261,13 @@ void __init setup_arch(char **cmdline_p) efi_init(); arm64_memblock_init(); + paging_init(); + + acpi_table_upgrade(); + /* Parse the ACPI tables for possible boot-time configuration */ acpi_boot_table_init(); - paging_init(); - if (acpi_disabled) unflatten_device_tree();