From: awilliam@xenbuild2.aw Date: Thu, 4 Jan 2007 23:00:56 +0000 (-0700) Subject: [IA64] Respect memory attributes for EFI_RUNTIME memory X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15430 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f582880f6b392007a29ed9e652511688d708e068;p=xen.git [IA64] Respect memory attributes for EFI_RUNTIME memory 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 --- diff --git a/xen/arch/ia64/xen/dom_fw.c b/xen/arch/ia64/xen/dom_fw.c index 97a687e08c..3f9dd9cf2a 100644 --- a/xen/arch/ia64/xen/dom_fw.c +++ b/xen/arch/ia64/xen/dom_fw.c @@ -533,6 +533,7 @@ complete_dom0_memmap(struct domain *d, u64 start = md->phys_addr; u64 size = md->num_pages << EFI_PAGE_SHIFT; u64 end = start + size; + unsigned long flags; switch (md->type) { case EFI_RUNTIME_SERVICES_CODE: @@ -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. */