WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [patch] respect memory attributes for EFI_RUNTIME memor

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [patch] respect memory attributes for EFI_RUNTIME memory
From: Jes Sorensen <jes@xxxxxxx>
Date: Fri, 29 Dec 2006 16:30:12 +0100
Delivery-date: Fri, 29 Dec 2006 07:29:58 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.4 (X11/20060527)
Hi,

The code in complete_dom0_memmap() was overly simplified pretending all
EFI_RUNTIME memory was writable and cachable.

Xen must respect the EFI memory attributes correctly when assigning
these pages.

This one should be against Alex's tree, but it also applies with a minor
modification to Isaku's NUMA patches.

Alex, I'd appreciate it if you apply this one, it's important for sn2.

Thanks,
Jes

Respect memory attributes when mapping EFI_RUNTIME and reserved pages.
Not all of these pages are writable and/or cachable!

Signed-off-by: Jes Sorensen <jes@xxxxxxx>

diff -r 533e06b4151c xen/arch/ia64/xen/dom_fw.c
--- a/xen/arch/ia64/xen/dom_fw.c        Fri Dec 29 14:28:10 2006 +0100
+++ b/xen/arch/ia64/xen/dom_fw.c        Fri Dec 29 16:23:21 2006 +0100
@@ -516,10 +516,11 @@ complete_dom0_memmap(struct domain *d,
 {
        efi_memory_desc_t *md;
        u64 addr;
        int j;
        void *efi_map_start, *efi_map_end, *p;
        u64 efi_desc_size;
        int i;
+       unsigned long flags;
 
        /* Walk through all MDT entries.
           Copy all interesting entries.  */
@@ -540,9 +541,19 @@ complete_dom0_memmap(struct domain *d,
                case EFI_ACPI_RECLAIM_MEMORY:
                case EFI_ACPI_MEMORY_NVS:
                case EFI_RESERVED_TYPE:
-                       /* Map into dom0 - All these are writable.  */
-                       assign_domain_mach_page(d, start, size,
-                                               ASSIGN_writable);
+                       /*
+                        * Map into dom0 - we must respect protection 
+                        * and cache attributes. Not all of these pages
+                        * are writable!!!
+                        */
+                       flags = ASSIGN_writable;        /* dummy - zero */
+                       if (md->attribute & EFI_MEMORY_WP)
+                               flags |= ASSIGN_readonly;
+                       if (md->attribute & EFI_MEMORY_UC)
+                               flags |= ASSIGN_nocache;
+
+                       assign_domain_mach_page(d, start, size, flags);
+
                        /* Fall-through.  */
                case EFI_MEMORY_MAPPED_IO:
                        /* Will be mapped with ioremap.  */
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [patch] respect memory attributes for EFI_RUNTIME memory, Jes Sorensen <=