From: Mark Rutland <mark.rutland@arm.com>
To: Aleksey Makarov <aleksey.makarov@linaro.org>
Cc: Russell King <linux@arm.linux.org.uk>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Len Brown <lenb@kernel.org>,
linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Graeme Gregory <graeme.gregory@linaro.org>,
Jon Masters <jcm@redhat.com>, "Zheng, Lv" <lv.zheng@intel.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will.deacon@arm.com>
Subject: Re: [PATCH 3/3] ACPI: ARM64: support for ACPI_TABLE_UPGRADE
Date: Tue, 17 May 2016 13:46:29 +0100 [thread overview]
Message-ID: <20160517124629.GE14955@leverpostej> (raw)
In-Reply-To: <1463486765-31827-4-git-send-email-aleksey.makarov@linaro.org>
On Tue, May 17, 2016 at 03:06:03PM +0300, Aleksey Makarov wrote:
> From: Jon Masters <jcm@redhat.com>
>
> This patch adds support for ACPI_TABLE_UPGRADE for ARM64
This feels like a tool to paper over problems rather than solve them.
If vendors are shipping horrendously broken tables today, clearly no
software has ever really supported them. So why add workarounds?
Why is this necessary? Is there a particular case for this, or is this
just for parity with x86?
IMO it would be better to put pressure on vendors to fix their FW and
provide sensible OS-agnostic update mechanisms.
> To access initrd image we need to move initialization
> of linear mapping a bit earlier.
>
> Signed-off-by: Jon Masters <jcm@redhat.com>
> Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
> ---
> arch/arm64/kernel/setup.c | 6 ++++--
> drivers/acpi/Kconfig | 2 +-
> drivers/acpi/tables.c | 10 +++++++++-
> 3 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> index feab2ee..1d5e24f 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();
> +
> + early_initrd_acpi_init();
Do we actually need full paging up here?
Why can we not use fixmap based copying as we do for the other cases
prior to paging_init?
> +
> /* Parse the ACPI tables for possible boot-time configuration */
> acpi_boot_table_init();
>
> - paging_init();
> -
> if (acpi_disabled)
> unflatten_device_tree();
>
> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> index c204344..ec694c0 100644
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -313,7 +313,7 @@ config ACPI_CUSTOM_DSDT
>
> config ACPI_TABLE_UPGRADE
> bool "Allow upgrading ACPI tables via initrd"
> - depends on BLK_DEV_INITRD && X86
> + depends on BLK_DEV_INITRD && (X86 || ARM64)
> default y
> help
Perhaps ARCH_HAS_ACPI_TABLE_UPGRADE?
> This option provides functionality to upgrade arbitrary ACPI tables
> diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
> index 82be84a..c35034d8 100644
> --- a/drivers/acpi/tables.c
> +++ b/drivers/acpi/tables.c
> @@ -482,6 +482,14 @@ static DECLARE_BITMAP(acpi_initrd_installed, NR_ACPI_INITRD_TABLES);
>
> #define MAP_CHUNK_SIZE (NR_FIX_BTMAPS << PAGE_SHIFT)
>
> +#if defined(CONFIG_X86)
> +#define MAX_PHYS_ACPI_TABLES (max_low_pfn_mapped << PAGE_SHIFT)
> +#elif defined(CONFIG_ARM64)
> +#define MAX_PHYS_ACPI_TABLES PFN_PHYS(max_pfn)
> +#else
> +#error "MAX_PHYS_ACPI_TABLES is not defiend for this architecture"
> +#endif
s/defiend/defined/
This should be defined in an arch-specific header if it is actually
arch-specific.
Thanks,
Mark.
> +
> static void __init acpi_table_initrd_init(void *data, size_t size)
> {
> int sig, no, table_nr = 0, total_offset = 0;
> @@ -541,7 +549,7 @@ static void __init acpi_table_initrd_init(void *data, size_t size)
> return;
>
> acpi_tables_addr =
> - memblock_find_in_range(0, max_low_pfn_mapped << PAGE_SHIFT,
> + memblock_find_in_range(0, MAX_PHYS_ACPI_TABLES,
> all_tables_size, PAGE_SIZE);
> if (!acpi_tables_addr) {
> WARN_ON(1);
> --
> 2.8.2
>
next prev parent reply other threads:[~2016-05-17 12:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-17 12:06 [PATCH 0/3] ACPI: ARM64: support for ACPI_TABLE_UPGRADE Aleksey Makarov
2016-05-17 12:06 ` [PATCH 1/3] ACPI: table upgrade: use cacheable map for tables Aleksey Makarov
2016-05-18 3:06 ` Zheng, Lv
2016-05-17 12:06 ` [PATCH 2/3] ACPI: table upgrade: move early_initrd_acpi_init() to header file Aleksey Makarov
2016-05-18 1:08 ` Zheng, Lv
2016-05-17 12:06 ` [PATCH 3/3] ACPI: ARM64: support for ACPI_TABLE_UPGRADE Aleksey Makarov
2016-05-17 12:46 ` Mark Rutland [this message]
2016-05-17 16:44 ` Jon Masters
2016-05-17 16:48 ` Jon Masters
2016-05-23 17:56 ` Lorenzo Pieralisi
2016-05-23 18:29 ` Jon Masters
2016-05-23 16:49 ` Mark Rutland
2016-05-18 15:11 ` Aleksey Makarov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160517124629.GE14955@leverpostej \
--to=mark.rutland@arm.com \
--cc=aleksey.makarov@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=graeme.gregory@linaro.org \
--cc=jcm@redhat.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=lv.zheng@intel.com \
--cc=rjw@rjwysocki.net \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox