]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
acpi: refactor acpi_os_map_memory to be architecturally independent
authorShannon Zhao <shannon.zhao@linaro.org>
Mon, 1 Feb 2016 12:56:54 +0000 (13:56 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 1 Feb 2016 12:56:54 +0000 (13:56 +0100)
The first Mb handling is not necessary and the attribute of __vmap() is
different for ARM. Factor the first Mb handling only for x86 and define
a mapping attribute for each architecture.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/acpi/osl.c
xen/include/asm-x86/acpi.h

index 2f1d723c348c98aaae5c1bda64ef789cc2f3e058..8a28d8727ba3f87e01c20a8b368abe6a641e68c2 100644 (file)
@@ -93,11 +93,11 @@ acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
                mfn_t mfn = _mfn(PFN_DOWN(phys));
                unsigned int offs = phys & (PAGE_SIZE - 1);
 
-               /* The low first Mb is always mapped. */
-               if ( !((phys + size - 1) >> 20) )
+               /* The low first Mb is always mapped on x86. */
+               if (IS_ENABLED(CONFIG_X86) && !((phys + size - 1) >> 20))
                        return __va(phys);
                return __vmap(&mfn, PFN_UP(offs + size), 1, 1,
-                             PAGE_HYPERVISOR_NOCACHE) + offs;
+                             ACPI_MAP_MEM_ATTR) + offs;
        }
        return __acpi_map_table(phys, size);
 }
index d3bde7883036b541b9a6c8fe8c69a8d1e1be83fe..d532e3d68717f3e4c7a0ed948a2296cbb40109bd 100644 (file)
@@ -163,4 +163,6 @@ void hvm_acpi_sleep_button(struct domain *d);
 void save_rest_processor_state(void);
 void restore_rest_processor_state(void);
 
+#define ACPI_MAP_MEM_ATTR      PAGE_HYPERVISOR_NOCACHE
+
 #endif /*__X86_ASM_ACPI_H*/