linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jack Steiner <steiner@sgi.com>
To: "H. Peter Anvin" <hpa@zytor.com>,
	hmh@hmh.eng.br, mingo@elte.hu, tglx@linutronix.de,
	lenb@kernel.org, tony.luck@gmail.com
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC  - V2] - Mapping ACPI tables as CACHED
Date: Thu, 26 Aug 2010 12:17:04 -0500	[thread overview]
Message-ID: <20100826171704.GA21584@sgi.com> (raw)
In-Reply-To: <4C743C0F.2010101@zytor.com>

Map ACPI tables as WB on x86_64. No substantive changes to IA64.


Signed-off-by: Jack Steiner <steiner@sgi.com>

---
V2 - Change the patch to unconditionally map ACPI tables as WB on x86_64.
     I'm still some paranoid about this because of the potential imapct on
     some platforms with weird BIOSs. However, note that on EFI-enabled
     systems (like UV), the ACPI tables are already mapped as WB memory.
     This is done in the EFI function efi_enter_virtual_mode().
     The ACPI code in acpi_os_map_memory() is not currently aware of the
     EFI mapping & currently maps the memory as UC. This seems like a bug.




 arch/ia64/kernel/acpi.c     |    5 +++++
 arch/x86/kernel/acpi/boot.c |   14 ++++++++++++++
 drivers/acpi/osl.c          |    2 +-
 include/linux/acpi.h        |    1 +
 4 files changed, 21 insertions(+), 1 deletion(-)

Index: linux/arch/ia64/kernel/acpi.c
===================================================================
--- linux.orig/arch/ia64/kernel/acpi.c	2010-08-26 09:32:46.000000000 -0500
+++ linux/arch/ia64/kernel/acpi.c	2010-08-26 11:51:05.544732478 -0500
@@ -172,6 +172,11 @@ char *__init __acpi_map_table(unsigned l
 	return __va(phys_addr);
 }
 
+char *__init __acpi_map_table_permanent(unsigned long phys_addr, unsigned long size)
+{
+	return ioremap(phys_addr, size);
+}
+
 void __init __acpi_unmap_table(char *map, unsigned long size)
 {
 }
Index: linux/arch/x86/kernel/acpi/boot.c
===================================================================
--- linux.orig/arch/x86/kernel/acpi/boot.c	2010-08-26 09:32:48.000000000 -0500
+++ linux/arch/x86/kernel/acpi/boot.c	2010-08-26 11:57:27.408724846 -0500
@@ -167,6 +167,20 @@ void __init __acpi_unmap_table(char *map
 	early_iounmap(map, size);
 }
 
+/*
+ * Permanently map memory for ACPI. Map ACPI tables and RAM as WB,
+ * other regions as UC.
+ */
+char *__init __acpi_map_table_permanent(unsigned long phys, unsigned long size)
+{
+	if (e820_all_mapped(phys, phys + size, E820_RAM) ||
+	    		e820_all_mapped(phys, phys + size, E820_ACPI) ||
+			e820_all_mapped(phys, phys + size, E820_NVS))
+		return ioremap_cache((unsigned long)phys, size);
+	else
+		return ioremap(phys, size);
+}
+
 #ifdef CONFIG_X86_LOCAL_APIC
 static int __init acpi_parse_madt(struct acpi_table_header *table)
 {
Index: linux/drivers/acpi/osl.c
===================================================================
--- linux.orig/drivers/acpi/osl.c	2010-08-26 09:32:48.276653117 -0500
+++ linux/drivers/acpi/osl.c	2010-08-26 11:45:33.488606489 -0500
@@ -271,7 +271,7 @@ acpi_os_map_memory(acpi_physical_address
 		/*
 		* ioremap checks to ensure this is in reserved space
 		*/
-		return ioremap((unsigned long)phys, size);
+		return __acpi_map_table_permanent((unsigned long)phys, size);
 	else
 		return __acpi_map_table((unsigned long)phys, size);
 }
Index: linux/include/linux/acpi.h
===================================================================
--- linux.orig/include/linux/acpi.h	2010-08-26 09:32:51.000000000 -0500
+++ linux/include/linux/acpi.h	2010-08-26 11:41:14.484709188 -0500
@@ -77,6 +77,7 @@ typedef int (*acpi_table_handler) (struc
 typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
 
 char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
+char * __acpi_map_table_permanent (unsigned long phys_addr, unsigned long size);
 void __acpi_unmap_table(char *map, unsigned long size);
 int early_acpi_boot_init(void);
 int acpi_boot_init (void);

  reply	other threads:[~2010-08-26 17:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22 15:22 [RFC] - Mapping ACPI tables as CACHED Jack Steiner
2010-07-22 15:52 ` Len Brown
2010-07-23 16:38   ` Jack Steiner
2010-07-23  1:46 ` ykzhao
2010-07-23  7:23   ` Ingo Molnar
2010-07-23 14:26     ` ykzhao
2010-08-17 14:45       ` Jack Steiner
2010-08-17 15:51       ` H. Peter Anvin
2010-08-17 14:42     ` Jack Steiner
2010-08-17 14:39   ` Jack Steiner
2010-07-24  0:14 ` Henrique de Moraes Holschuh
2010-07-24  0:45   ` Matthew Garrett
2010-07-24 12:26     ` Henrique de Moraes Holschuh
2010-08-17 14:49   ` Jack Steiner
2010-08-17 16:02     ` Linus Torvalds
2010-08-24 21:39   ` H. Peter Anvin
2010-08-26 17:17     ` Jack Steiner [this message]
2010-08-26 18:08       ` [RFC - V2] " H. Peter Anvin
2010-12-08 21:22         ` Jack Steiner
2010-12-09  1:27           ` H. Peter Anvin
2010-12-09  3:50             ` Jack Steiner
2010-12-09  6:12               ` Len Brown
2010-08-17 15:59 ` [RFC] " Jack Steiner
2010-08-26 17:47   ` Len Brown

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=20100826171704.GA21584@sgi.com \
    --to=steiner@sgi.com \
    --cc=hmh@hmh.eng.br \
    --cc=hpa@zytor.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@gmail.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;
as well as URLs for NNTP newsgroup(s).