[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] acpi: refactor acpi_os_map_memory to be architecturally independent



commit 1d0f16710b6b2ef3d72eaf4d8426d98594b91b92
Author:     Shannon Zhao <shannon.zhao@xxxxxxxxxx>
AuthorDate: Mon Feb 1 13:56:54 2016 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Feb 1 13:56:54 2016 +0100

    acpi: refactor acpi_os_map_memory to be architecturally independent
    
    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@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/drivers/acpi/osl.c     | 6 +++---
 xen/include/asm-x86/acpi.h | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/osl.c b/xen/drivers/acpi/osl.c
index 2f1d723..8a28d87 100644
--- a/xen/drivers/acpi/osl.c
+++ b/xen/drivers/acpi/osl.c
@@ -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);
 }
diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h
index d3bde78..d532e3d 100644
--- a/xen/include/asm-x86/acpi.h
+++ b/xen/include/asm-x86/acpi.h
@@ -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*/
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.