From patchwork Thu May 19 16:15:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 9127945 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 4938660221 for ; Thu, 19 May 2016 16:17:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CAD828117 for ; Thu, 19 May 2016 16:17:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31373281CE; Thu, 19 May 2016 16:17:33 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF1F528117 for ; Thu, 19 May 2016 16:17:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932793AbcESQRI (ORCPT ); Thu, 19 May 2016 12:17:08 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:32814 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932788AbcESQRF (ORCPT ); Thu, 19 May 2016 12:17:05 -0400 Received: by mail-lf0-f43.google.com with SMTP id y84so39449950lfc.0 for ; Thu, 19 May 2016 09:17:04 -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=YJcIrgMVnFuIrYaJeuOBJtunLsZagDKZNB0wlrHoxvg=; b=axJXxd3bt1jFden0MKqguzb6b7Fg6TqZuHP8ot05+cHJkEQoAvCJKN6vLYBsslpcUI uxJQ3Pp6V0xkXU4oknJMudZBcQdeuyrLsVLz+tSMD3+XtFyG7brcCFlN91cLIg1mcp8z k0s/GfayUJBcBFzf3xpJWLw4u83A3NK9v0HBY= 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=YJcIrgMVnFuIrYaJeuOBJtunLsZagDKZNB0wlrHoxvg=; b=cBsiO/daAgLUJ0qxV90bQWjVoAuMAEBnUtXP5+n0SiMskgSb8X6KGvAYnVra7NnFAF zupQTUokr0o1mUJRiQaf4q9vQ0nlwtMTh+WYLBkdsupwWLhglVoB2TeaOLsX2PEkBRdB AyShOLMTJzeZYLfkmakS+wqw/wqAM8n1Y9uXpqoXdSrXsbOEzeib0eS0Z/lmflKQpL+V LA6XoFP7NbzRMCMzAZ09GVEKjCsHa6Q5Xu0XaAn6B0slL7G8WO7qnhupw4MrePqZ6Gdh RAR7DAjxIKCHFnk92WzdLQ77OQAJrZ+hAPEynK1aY6uPQ7EcezHN5KJjuKDYropVSIcJ Yrjg== X-Gm-Message-State: AOPr4FWIJj92p4xw3y73V3+mBV5VdZxmFSe1lSpOBEkY1eQcOo5g2ODvE+CJVdpXTtJXNPDQ X-Received: by 10.25.81.13 with SMTP id f13mr5240734lfb.78.1463674623606; Thu, 19 May 2016 09:17:03 -0700 (PDT) Received: from turnip.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id yf9sm2396538lbb.34.2016.05.19.09.17.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 May 2016 09:17:02 -0700 (PDT) From: Aleksey Makarov To: Russell King , "Rafael J . Wysocki" , Len Brown Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Aleksey Makarov , Graeme Gregory , Jon Masters , "Zheng, Lv" , Mark Rutland , Catalin Marinas , Will Deacon Subject: [PATCH v2 5/5] ACPI: ARM64: support for ACPI_TABLE_UPGRADE Date: Thu, 19 May 2016 19:15:16 +0300 Message-Id: <1463674518-22477-6-git-send-email-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1463674518-22477-1-git-send-email-aleksey.makarov@linaro.org> References: <1463674518-22477-1-git-send-email-aleksey.makarov@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.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 --- 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 5d30abf..f4f9f56 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -5,6 +5,7 @@ config ARM64 select ACPI_PCI_HOST_GENERIC if ACPI select ACPI_REDUCED_HARDWARE_ONLY 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..d75f6c7 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 PFN_PHYS(max_pfn) + #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();