public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* Fixups for ACPI initrd table override
@ 2013-02-22 13:12 Thomas Renninger
  2013-02-22 13:12 ` [PATCH 1/2] ACPI: Cleanup acpi_initrd_override declaration and remove ifdefs Thomas Renninger
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Thomas Renninger @ 2013-02-22 13:12 UTC (permalink / raw)
  To: hpa; +Cc: linux-acpi, lenb, rjw, aaron.lu, devurandom

These are rather minor fixups for code correctness.
Except the dependency for X86 which avoids build errors on IA64.

Sooner or later this X86 dependency (max_low_pfn_mapped) should vanish
from ACPI code, but for now just get the build failure quickly fixed with
an easy patch (the Kconfig one).


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ACPI: Cleanup acpi_initrd_override declaration and remove ifdefs
  2013-02-22 13:12 Fixups for ACPI initrd table override Thomas Renninger
@ 2013-02-22 13:12 ` Thomas Renninger
  2013-02-22 13:12 ` [PATCH 2/2] ACPI: Overriding ACPI tables via initrd only works with an initrd and on X86 Thomas Renninger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Thomas Renninger @ 2013-02-22 13:12 UTC (permalink / raw)
  To: hpa; +Cc: linux-acpi, lenb, rjw, aaron.lu, devurandom, Thomas Renninger

Move the acpi_initrd_override() declaration out of CONFIG_ACPI area so that
acpi_initrd_override is also defined if CONFIG_ACPI is not defined.

Move the acpi_initrd_override() call into reserve_initrd() inside the
CONFIG_BLK_DEV_INITRD block.

Now ifdefs around the call in setup.c can be removed.

Cleanup only, no functional change.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Thomas Renninger <Thomas Renninger" trenn@suse.de>
---
 arch/x86/kernel/setup.c |    6 ++----
 include/linux/acpi.h    |   16 ++++++++--------
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 915f5ef..5b85b65 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -410,6 +410,8 @@ static void __init reserve_initrd(void)
 	relocate_initrd();
 
 	memblock_free(ramdisk_image, ramdisk_end - ramdisk_image);
+
+	acpi_initrd_override((void *)initrd_start, initrd_end - initrd_start);
 }
 #else
 static void __init early_reserve_initrd(void)
@@ -1088,10 +1090,6 @@ void __init setup_arch(char **cmdline_p)
 
 	reserve_initrd();
 
-#if defined(CONFIG_ACPI) && defined(CONFIG_BLK_DEV_INITRD)
-	acpi_initrd_override((void *)initrd_start, initrd_end - initrd_start);
-#endif
-
 	reserve_crashkernel();
 
 	vsmp_init();
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index bcbdd74..d95d36a 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -79,14 +79,6 @@ typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *table);
 typedef int (*acpi_tbl_entry_handler)(struct acpi_subtable_header *header,
 				      const unsigned long end);
 
-#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE
-void acpi_initrd_override(void *data, size_t size);
-#else
-static inline void acpi_initrd_override(void *data, size_t size)
-{
-}
-#endif
-
 char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
 void __acpi_unmap_table(char *map, unsigned long size);
 int early_acpi_boot_init(void);
@@ -588,4 +580,12 @@ acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {}
 })
 #endif
 
+#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE
+void acpi_initrd_override(void *data, size_t size);
+#else
+static inline void acpi_initrd_override(void *data, size_t size)
+{
+}
+#endif
+
 #endif	/*_LINUX_ACPI_H*/
-- 
1.7.6.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] ACPI: Overriding ACPI tables via initrd only works with an initrd and on X86
  2013-02-22 13:12 Fixups for ACPI initrd table override Thomas Renninger
  2013-02-22 13:12 ` [PATCH 1/2] ACPI: Cleanup acpi_initrd_override declaration and remove ifdefs Thomas Renninger
@ 2013-02-22 13:12 ` Thomas Renninger
  2013-02-25 20:00   ` Yinghai Lu
  2013-02-25 17:26 ` Fixups for ACPI initrd table override Dennis Schridde
  2013-02-25 18:48 ` H. Peter Anvin
  3 siblings, 1 reply; 8+ messages in thread
From: Thomas Renninger @ 2013-02-22 13:12 UTC (permalink / raw)
  To: hpa; +Cc: linux-acpi, lenb, rjw, aaron.lu, devurandom, Thomas Renninger

Reflect this dependency in Kconfig.

Shorten the config description as suggested by Borislav Petkov.

Finding a suitable memory area to store the modified table(s) has been
taken over from arch/x86/kernel/setup.c and makes use of max_low_pfn_mapped:
memblock_find_in_range(0, max_low_pfn_mapped,...)
This one is X86 specific. It may not be hard to extend this functionality
for other ACPI aware architectures if there is need for.

For now make this feature only available for X86 to avoid build failures on
IA64, compare with:
https://bugzilla.kernel.org/show_bug.cgi?id=54091


Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Thomas Renninger <Thomas Renninger" trenn@suse.de>
---
 drivers/acpi/Kconfig |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 1a4ed64..c692404 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -266,7 +266,8 @@ config ACPI_CUSTOM_DSDT
 	default ACPI_CUSTOM_DSDT_FILE != ""
 
 config ACPI_INITRD_TABLE_OVERRIDE
-	bool "ACPI tables can be passed via uncompressed cpio in initrd"
+	bool "ACPI tables override via initrd"
+	depends on BLK_DEV_INITRD && X86
 	default n
 	help
 	  This option provides functionality to override arbitrary ACPI tables
-- 
1.7.6.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: Fixups for ACPI initrd table override
  2013-02-22 13:12 Fixups for ACPI initrd table override Thomas Renninger
  2013-02-22 13:12 ` [PATCH 1/2] ACPI: Cleanup acpi_initrd_override declaration and remove ifdefs Thomas Renninger
  2013-02-22 13:12 ` [PATCH 2/2] ACPI: Overriding ACPI tables via initrd only works with an initrd and on X86 Thomas Renninger
@ 2013-02-25 17:26 ` Dennis Schridde
  2013-02-25 18:48 ` H. Peter Anvin
  3 siblings, 0 replies; 8+ messages in thread
From: Dennis Schridde @ 2013-02-25 17:26 UTC (permalink / raw)
  To: Thomas Renninger; +Cc: hpa, linux-acpi, lenb, rjw, aaron.lu

[-- Attachment #1: Type: text/plain, Size: 110 bytes --]

Hi Thomas!

The 2 patches make the kernel compile on my ia64 box.

Thanks a lot for your quick reply!
--Dennis

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Fixups for ACPI initrd table override
  2013-02-22 13:12 Fixups for ACPI initrd table override Thomas Renninger
                   ` (2 preceding siblings ...)
  2013-02-25 17:26 ` Fixups for ACPI initrd table override Dennis Schridde
@ 2013-02-25 18:48 ` H. Peter Anvin
  3 siblings, 0 replies; 8+ messages in thread
From: H. Peter Anvin @ 2013-02-25 18:48 UTC (permalink / raw)
  To: Thomas Renninger; +Cc: linux-acpi, lenb, rjw, aaron.lu, devurandom

On 02/22/2013 05:12 AM, Thomas Renninger wrote:
> These are rather minor fixups for code correctness.
> Except the dependency for X86 which avoids build errors on IA64.
> 
> Sooner or later this X86 dependency (max_low_pfn_mapped) should vanish
> from ACPI code, but for now just get the build failure quickly fixed with
> an easy patch (the Kconfig one).
> 

Please send the cleanup one again after the merge window is over.

The build error is an urgent fix; I will take that now.

	-hpa


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] ACPI: Overriding ACPI tables via initrd only works with an initrd and on X86
  2013-02-22 13:12 ` [PATCH 2/2] ACPI: Overriding ACPI tables via initrd only works with an initrd and on X86 Thomas Renninger
@ 2013-02-25 20:00   ` Yinghai Lu
  2013-02-25 20:02     ` H. Peter Anvin
  0 siblings, 1 reply; 8+ messages in thread
From: Yinghai Lu @ 2013-02-25 20:00 UTC (permalink / raw)
  To: Thomas Renninger; +Cc: hpa, linux-acpi, lenb, rjw, aaron.lu, devurandom

On Fri, Feb 22, 2013 at 5:12 AM, Thomas Renninger <trenn@suse.de> wrote:
> Reflect this dependency in Kconfig.
>
> Shorten the config description as suggested by Borislav Petkov.
>
> Finding a suitable memory area to store the modified table(s) has been
> taken over from arch/x86/kernel/setup.c and makes use of max_low_pfn_mapped:
> memblock_find_in_range(0, max_low_pfn_mapped,...)
> This one is X86 specific. It may not be hard to extend this functionality
> for other ACPI aware architectures if there is need for.
>
> For now make this feature only available for X86 to avoid build failures on
> IA64, compare with:
> https://bugzilla.kernel.org/show_bug.cgi?id=54091
>
>
> Signed-off-by: Thomas Renninger <trenn@suse.de>
> Signed-off-by: Thomas Renninger <Thomas Renninger" trenn@suse.de>

what is that?

you need to fix your scripts.

> ---
>  drivers/acpi/Kconfig |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> index 1a4ed64..c692404 100644
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -266,7 +266,8 @@ config ACPI_CUSTOM_DSDT
>         default ACPI_CUSTOM_DSDT_FILE != ""
>
>  config ACPI_INITRD_TABLE_OVERRIDE
> -       bool "ACPI tables can be passed via uncompressed cpio in initrd"
> +       bool "ACPI tables override via initrd"
> +       depends on BLK_DEV_INITRD && X86
>         default n
>         help
>           This option provides functionality to override arbitrary ACPI tables

Can replace max_low_pfn_mapped with max_low_pfn instead ?
like to see if you can put acpi tables above 4G for x86_64.

if it does not work, you can use min(max_low_pfn<<PAGE_SHIFT,  0xffffffffUL)
instead.

Yinghai

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] ACPI: Overriding ACPI tables via initrd only works with an initrd and on X86
  2013-02-25 20:00   ` Yinghai Lu
@ 2013-02-25 20:02     ` H. Peter Anvin
  2013-02-25 20:07       ` Yinghai Lu
  0 siblings, 1 reply; 8+ messages in thread
From: H. Peter Anvin @ 2013-02-25 20:02 UTC (permalink / raw)
  To: Yinghai Lu; +Cc: Thomas Renninger, linux-acpi, lenb, rjw, aaron.lu, devurandom

On 02/25/2013 12:00 PM, Yinghai Lu wrote:
> 
> Can replace max_low_pfn_mapped with max_low_pfn instead ?
> like to see if you can put acpi tables above 4G for x86_64.
> 
> if it does not work, you can use min(max_low_pfn<<PAGE_SHIFT,  0xffffffffUL)
> instead.
> 

This is part of why we really need to get rid of these stupid variables
one and for all.  The only exception should perhaps be to mark the
HIGHMEM crossover point on HIGHMEM systems.

	-hpa



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] ACPI: Overriding ACPI tables via initrd only works with an initrd and on X86
  2013-02-25 20:02     ` H. Peter Anvin
@ 2013-02-25 20:07       ` Yinghai Lu
  0 siblings, 0 replies; 8+ messages in thread
From: Yinghai Lu @ 2013-02-25 20:07 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Thomas Renninger, linux-acpi, lenb, rjw, aaron.lu, devurandom

On Mon, Feb 25, 2013 at 12:02 PM, H. Peter Anvin <hpa@zytor.com> wrote:
> On 02/25/2013 12:00 PM, Yinghai Lu wrote:
>>
>> Can replace max_low_pfn_mapped with max_low_pfn instead ?
>> like to see if you can put acpi tables above 4G for x86_64.
>>
>> if it does not work, you can use min(max_low_pfn<<PAGE_SHIFT,  0xffffffffUL)
>> instead.
>>
>
> This is part of why we really need to get rid of these stupid variables
> one and for all.  The only exception should perhaps be to mark the
> HIGHMEM crossover point on HIGHMEM systems.

yes, we can drop max_low_pfn_mapped at least.

I should drop that in for-x86-mm2 time point, but saw ThomasR is using that,
so i dropped that patch to make the merge easy.

Now after Thomas change to max_low_pfn, we can drop max_low_pfn_mapped.

Yinghai

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-02-25 20:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-22 13:12 Fixups for ACPI initrd table override Thomas Renninger
2013-02-22 13:12 ` [PATCH 1/2] ACPI: Cleanup acpi_initrd_override declaration and remove ifdefs Thomas Renninger
2013-02-22 13:12 ` [PATCH 2/2] ACPI: Overriding ACPI tables via initrd only works with an initrd and on X86 Thomas Renninger
2013-02-25 20:00   ` Yinghai Lu
2013-02-25 20:02     ` H. Peter Anvin
2013-02-25 20:07       ` Yinghai Lu
2013-02-25 17:26 ` Fixups for ACPI initrd table override Dennis Schridde
2013-02-25 18:48 ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox