===================================================================
@@ -113,6 +113,7 @@ struct x86_cpuinit_ops {
/**
* struct x86_platform_ops - platform specific runtime functions
+ * @is_wb_acpi_tables E820 ACPI table are in WB memory
* @is_untracked_pat_range exclude from PAT logic
* @calibrate_tsc: calibrate TSC
* @get_wallclock: get time from HW clock like RTC etc.
@@ -120,6 +121,7 @@ struct x86_cpuinit_ops {
* @nmi_init enable NMI on cpus
*/
struct x86_platform_ops {
+ int (*is_wb_acpi_tables)(void);
int (*is_untracked_pat_range)(u64 start, u64 end);
unsigned long (*calibrate_tsc)(void);
unsigned long (*get_wallclock)(void);
===================================================================
@@ -58,6 +58,11 @@ static int uv_is_untracked_pat_range(u64
return is_ISA_range(start, end) || is_GRU_range(start, end);
}
+static int uv_is_wb_acpi_tables(void)
+{
+ return 1;
+}
+
static int early_get_nodeid(void)
{
union uvh_node_id_u node_id;
@@ -81,6 +86,7 @@ static int __init uv_acpi_madt_oem_check
nodeid = early_get_nodeid();
x86_platform.is_untracked_pat_range = uv_is_untracked_pat_range;
x86_platform.nmi_init = uv_nmi_init;
+ x86_platform.is_wb_acpi_tables = uv_is_wb_acpi_tables;
if (!strcmp(oem_table_id, "UVL"))
uv_system_type = UV_LEGACY_APIC;
else if (!strcmp(oem_table_id, "UVX"))
===================================================================
@@ -71,7 +71,10 @@ struct x86_cpuinit_ops x86_cpuinit __cpu
static void default_nmi_init(void) { };
+static int default_wb_acpi_tables(void) {return 0;}
+
struct x86_platform_ops x86_platform = {
+ .is_wb_acpi_tables = default_wb_acpi_tables,
.is_untracked_pat_range = default_is_untracked_pat_range,
.calibrate_tsc = native_calibrate_tsc,
.get_wallclock = mach_get_cmos_time,
===================================================================
@@ -293,12 +293,18 @@ acpi_os_map_memory(acpi_physical_address
printk(KERN_ERR PREFIX "Cannot map memory that high\n");
return NULL;
}
- if (acpi_gbl_permanent_mmap)
+ if (acpi_gbl_permanent_mmap) {
/*
* ioremap checks to ensure this is in reserved space
*/
- return ioremap((unsigned long)phys, size);
- else
+ if (x86_platform.is_wb_acpi_tables() &&
+ (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((unsigned long)phys, size);
+ } else
return __acpi_map_table((unsigned long)phys, size);
}
EXPORT_SYMBOL_GPL(acpi_os_map_memory);