From patchwork Mon Jun 20 10:56:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksey Makarov X-Patchwork-Id: 9187161 X-Patchwork-Delegate: rjw@sisk.pl 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 E94E96075F for ; Mon, 20 Jun 2016 10:58:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D40B822B26 for ; Mon, 20 Jun 2016 10:58:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8EC9265B9; Mon, 20 Jun 2016 10:58:05 +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=ham 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 D77BC22B26 for ; Mon, 20 Jun 2016 10:58:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754355AbcFTK5o (ORCPT ); Mon, 20 Jun 2016 06:57:44 -0400 Received: from mail-lf0-f47.google.com ([209.85.215.47]:35962 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753817AbcFTK5i (ORCPT ); Mon, 20 Jun 2016 06:57:38 -0400 Received: by mail-lf0-f47.google.com with SMTP id q132so35054144lfe.3 for ; Mon, 20 Jun 2016 03:56:48 -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=PWZFKbKe9zj/T00cyUGtINSwmOhSzqOGrenxRGtgbSI=; b=RC8HWeYRjUy+I/MY5qvkfvqxcLMh6PhA3SMvBMEHI/Aya0Q5xvMlJc4NyD8F/0GuqA ElbQ5O/GXuzBhR4ejSeBbCmHjZOtU/ABrOFqtj4FkLRpBLgXYxzLPONamRGYhuoF+elF iWWA+hIEB0hDqCHLlTAD8jEx4G3v6DRAAwpTs= 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=PWZFKbKe9zj/T00cyUGtINSwmOhSzqOGrenxRGtgbSI=; b=Oo3HRhSwnCDWWwP5ZtfZLah6CjzF+Moml1zsCC/k6N6DOI/36Mivi0393/Bwkux4h+ wUpBkI8IIEYCJi6nPc1RccP4Dg50+9V4NOYguOe1aZ56ZVxKHZxo4mDhNDHrxfP7dbYH NK1fLbT9h5i03pdf3fHqH4kyPtYFLkX6bvrnDkRJnD0VpLzg+JAy38QRf8Gxw0U3sGak sD+xJPPkAp2mNsz2QDt20KOziBG8zeAmhxGbxcFpECOLux8tJjytN1afUBsSoVJULiYr wpSSLxjCvr516qRLfKZOyWCnyWfrzFgfKhKdnxWrImibdkhIShCtOheodLzIDk5jBshc U2UA== X-Gm-Message-State: ALyK8tLzNDJc7KPzJs8K2pR0MhDXNtVzjuD+RkmWEvFYvdoW0reG6+xA8NuFRscq21fWe7X2 X-Received: by 10.46.9.203 with SMTP id 194mr3561462ljj.61.1466420202790; Mon, 20 Jun 2016 03:56:42 -0700 (PDT) Received: from localhost.localdomain (nivc-213.auriga.ru. [80.240.102.213]) by smtp.gmail.com with ESMTPSA id g28sm6367133ljg.24.2016.06.20.03.56.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2016 03:56:42 -0700 (PDT) From: Aleksey Makarov To: "Rafael J . Wysocki" Cc: Catalin Marinas , Will Deacon , Len Brown , 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 Subject: [PATCH v4 5/5] ACPI: ARM64: support for ACPI_TABLE_UPGRADE Date: Mon, 20 Jun 2016 13:56:13 +0300 Message-Id: <20160620105615.15538-6-aleksey.makarov@linaro.org> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160620105615.15538-1-aleksey.makarov@linaro.org> References: <20160620105615.15538-1-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 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 a377a1f..0cf7b43 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 4b13ecd..5420cb0 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -121,4 +121,6 @@ static inline int arm64_acpi_numa_init(void) { return -ENOSYS; } static inline int acpi_numa_get_nid(unsigned int cpu, u64 hwid) { return NUMA_NO_NODE; } #endif /* CONFIG_ACPI_NUMA */ +#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();