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

[Xen-changelog] [IA64] acpi read-only mapping



# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID c7e8d1673140bebd63cb707f9263c301d6748c25
# Parent  5674e4fe8f0225eece0770b5af334795ba1924e0
[IA64] acpi read-only mapping

implemented dom0 acpi read-only mapping

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 xen/arch/ia64/xen/dom_fw.c    |   28 ++++++++++++++++++----------
 xen/arch/ia64/xen/domain.c    |   14 ++++++++------
 xen/include/asm-ia64/domain.h |    2 +-
 3 files changed, 27 insertions(+), 17 deletions(-)

diff -r 5674e4fe8f02 -r c7e8d1673140 xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c        Wed May 24 10:59:28 2006 -0600
+++ b/xen/arch/ia64/xen/dom_fw.c        Wed May 24 11:04:33 2006 -0600
@@ -697,6 +697,7 @@ struct dom0_passthrough_arg {
 struct dom0_passthrough_arg {
 #ifdef CONFIG_XEN_IA64_DOM0_VP
     struct domain*      d;
+    int                 flags;
 #endif
     efi_memory_desc_t *md;
     int*                i;
@@ -711,7 +712,7 @@ dom_fw_dom0_passthrough(efi_memory_desc_
 #ifdef CONFIG_XEN_IA64_DOM0_VP
     struct domain* d = arg->d;
     u64 start = md->phys_addr;
-    u64 end = start + (md->num_pages << EFI_PAGE_SHIFT);
+    u64 size = md->num_pages << EFI_PAGE_SHIFT;
 
     if (md->type == EFI_MEMORY_MAPPED_IO ||
         md->type == EFI_MEMORY_MAPPED_IO_PORT_SPACE) {
@@ -720,13 +721,12 @@ dom_fw_dom0_passthrough(efi_memory_desc_
         //    It requires impractical memory to map such a huge region
         //    to a domain.
         //    For now we don't map it, but later we must fix this.
-        if (md->type == EFI_MEMORY_MAPPED_IO &&
-            ((md->num_pages << EFI_PAGE_SHIFT) > 0x100000000UL))
+        if (md->type == EFI_MEMORY_MAPPED_IO && (size > 0x100000000UL))
             return 0;
 
-        paddr = assign_domain_mmio_page(d, start, end - start);
+        paddr = assign_domain_mmio_page(d, start, size);
     } else
-        paddr = assign_domain_mach_page(d, start, end - start);
+        paddr = assign_domain_mach_page(d, start, size, arg->flags);
 #else
     paddr = md->phys_addr;
 #endif
@@ -874,9 +874,10 @@ dom_fw_init (struct domain *d, const cha
        }
        if (d == dom0) {
 #ifdef CONFIG_XEN_IA64_DOM0_VP
-# define ASSIGN_DOMAIN_MACH_PAGE(d, p) assign_domain_mach_page(d, p, PAGE_SIZE)
+# define ASSIGN_DOMAIN_MACH_PAGE(d, p) \
+        assign_domain_mach_page((d), (p), PAGE_SIZE, ASSIGN_readonly)
 #else
-# define ASSIGN_DOMAIN_MACH_PAGE(d, p) ({p;})
+# define ASSIGN_DOMAIN_MACH_PAGE(d, p) (p)
 #endif
 
                printf("Domain0 EFI passthrough:");
@@ -990,17 +991,24 @@ dom_fw_init (struct domain *d, const cha
                /* pass through the I/O port space */
                if (!running_on_sim) {
                        struct dom0_passthrough_arg arg;
+                       arg.md = &efi_memmap[i];
+                       arg.i = &i;
 #ifdef CONFIG_XEN_IA64_DOM0_VP
                        arg.d = d;
-#endif
-                       arg.md = &efi_memmap[i];
-                       arg.i = &i;
+                       arg.flags = ASSIGN_writable;
+#endif
                        //XXX Is this needed?
                        efi_memmap_walk_type(EFI_RUNTIME_SERVICES_CODE,
                                             dom_fw_dom0_passthrough, &arg);
                        // for ACPI table.
+#ifdef CONFIG_XEN_IA64_DOM0_VP
+                       arg.flags = ASSIGN_readonly;
+#endif
                        efi_memmap_walk_type(EFI_RUNTIME_SERVICES_DATA,
                                             dom_fw_dom0_passthrough, &arg);
+#ifdef CONFIG_XEN_IA64_DOM0_VP
+                       arg.flags = ASSIGN_writable;
+#endif
                        efi_memmap_walk_type(EFI_ACPI_RECLAIM_MEMORY,
                                             dom_fw_dom0_passthrough, &arg);
                        efi_memmap_walk_type(EFI_MEMORY_MAPPED_IO,
diff -r 5674e4fe8f02 -r c7e8d1673140 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Wed May 24 10:59:28 2006 -0600
+++ b/xen/arch/ia64/xen/domain.c        Wed May 24 11:04:33 2006 -0600
@@ -873,12 +873,13 @@ assign_domain_page(struct domain *d,
 #ifdef CONFIG_XEN_IA64_DOM0_VP
 static void
 assign_domain_same_page(struct domain *d,
-                        unsigned long mpaddr, unsigned long size)
+                        unsigned long mpaddr, unsigned long size,
+                        unsigned long flags)
 {
     //XXX optimization
     unsigned long end = mpaddr + size;
     for (; mpaddr < end; mpaddr += PAGE_SIZE) {
-        __assign_domain_page(d, mpaddr, mpaddr, ASSIGN_writable);
+        __assign_domain_page(d, mpaddr, mpaddr, flags);
     }
 }
 
@@ -945,15 +946,16 @@ assign_domain_mmio_page(struct domain *d
                 __func__, __LINE__, d, mpaddr, size);
         return -EINVAL;
     }
-    assign_domain_same_page(d, mpaddr, size);
+    assign_domain_same_page(d, mpaddr, size, ASSIGN_writable);
     return mpaddr;
 }
 
 unsigned long
 assign_domain_mach_page(struct domain *d,
-                        unsigned long mpaddr, unsigned long size)
-{
-    assign_domain_same_page(d, mpaddr, size);
+                        unsigned long mpaddr, unsigned long size,
+                        unsigned long flags)
+{
+    assign_domain_same_page(d, mpaddr, size, flags);
     return mpaddr;
 }
 
diff -r 5674e4fe8f02 -r c7e8d1673140 xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h     Wed May 24 10:59:28 2006 -0600
+++ b/xen/include/asm-ia64/domain.h     Wed May 24 11:04:33 2006 -0600
@@ -120,7 +120,7 @@ void assign_domain_io_page(struct domain
 #ifdef CONFIG_XEN_IA64_DOM0_VP
 void alloc_dom_xen_and_dom_io(void);
 unsigned long assign_domain_mmio_page(struct domain *d, unsigned long mpaddr, 
unsigned long size);
-unsigned long assign_domain_mach_page(struct domain *d, unsigned long mpaddr, 
unsigned long size);
+unsigned long assign_domain_mach_page(struct domain *d, unsigned long mpaddr, 
unsigned long size, unsigned long flags);
 unsigned long do_dom0vp_op(unsigned long cmd, unsigned long arg0, unsigned 
long arg1, unsigned long arg2, unsigned long arg3);
 unsigned long dom0vp_zap_physmap(struct domain *d, unsigned long gpfn, 
unsigned int extent_order);
 unsigned long dom0vp_add_physmap(struct domain* d, unsigned long gpfn, 
unsigned long mfn, unsigned long flags, domid_t domid);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.