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: 9151053 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 228976074E for ; Thu, 2 Jun 2016 17:51:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E8BE1FF10 for ; Thu, 2 Jun 2016 17:51:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00E762830C; Thu, 2 Jun 2016 17:51:37 +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 770D41FF10 for ; Thu, 2 Jun 2016 17:51:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932967AbcFBRvg (ORCPT ); Thu, 2 Jun 2016 13:51:36 -0400 Received: from mail-lf0-f45.google.com ([209.85.215.45]:35556 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932324AbcFBRvf (ORCPT ); Thu, 2 Jun 2016 13:51:35 -0400 Received: by mail-lf0-f45.google.com with SMTP id w16so39021620lfd.2 for ; Thu, 02 Jun 2016 10:51:34 -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=mRAG739PGqKhO+95wtegJRQiQCdrUrCghrqO4+BTfKCyyC/q6/ep/v2S0VSJlg0q0t s09BgvBCCVJTIOXJxPP+Fe6EHHJFbveZPJU5u02RQAYPa1dyImxnuuJlq4XLoiaKbLBt FQ9eYdpxpLAEPdBq14eC3KW8GlmembfrSci+fGG9iHrBl3G692UgKXfKkTVojco6jI29 w/IIGC7N0HExDjDJ8R/2WK3/CnlGvooh3fIE8mXf2zC8sNSL2Rd9c7sunECslvWiZYWr SGKY3JAQmsMm03t7+No64DZnWq1O6TWP5sZzRFtpnz3bXkAXlQljYlMrzyWcdaEsF0Ac DoUg== X-Gm-Message-State: ALyK8tIOfCvVd+MlttOJoYNzEtSO048qT67hPX/Z1JnxPDDHRrnzeYDi2iPS+FQgfSRzG9UD 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 Cc: Will Deacon , "Rafael J . Wysocki" , 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 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> 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 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();