direct-io.hg

changeset 13456:2d4807ed1056

[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 <jes@sgi.com>
author awilliam@xenbuild2.aw
date Thu Jan 04 16:00:56 2007 -0700 (2007-01-04)
parents 5708307d0e35
children eb40e07b867f
files xen/arch/ia64/xen/dom_fw.c
line diff
     1.1 --- a/xen/arch/ia64/xen/dom_fw.c	Thu Jan 04 15:45:10 2007 -0700
     1.2 +++ b/xen/arch/ia64/xen/dom_fw.c	Thu Jan 04 16:00:56 2007 -0700
     1.3 @@ -533,6 +533,7 @@ complete_dom0_memmap(struct domain *d,
     1.4  		u64 start = md->phys_addr;
     1.5  		u64 size = md->num_pages << EFI_PAGE_SHIFT;
     1.6  		u64 end = start + size;
     1.7 +		unsigned long flags;
     1.8  
     1.9  		switch (md->type) {
    1.10  		case EFI_RUNTIME_SERVICES_CODE:
    1.11 @@ -540,9 +541,19 @@ complete_dom0_memmap(struct domain *d,
    1.12  		case EFI_ACPI_RECLAIM_MEMORY:
    1.13  		case EFI_ACPI_MEMORY_NVS:
    1.14  		case EFI_RESERVED_TYPE:
    1.15 -			/* Map into dom0 - All these are writable.  */
    1.16 -			assign_domain_mach_page(d, start, size,
    1.17 -			                        ASSIGN_writable);
    1.18 +			/*
    1.19 +			 * Map into dom0 - We must respect protection
    1.20 +			 * and cache attributes.  Not all of these pages
    1.21 +			 * are writable!!!
    1.22 +			 */
    1.23 +			flags = ASSIGN_writable;	/* dummy - zero */
    1.24 +			if (md->attribute & EFI_MEMORY_WP)
    1.25 +				flags |= ASSIGN_readonly;
    1.26 +			if (md->attribute & EFI_MEMORY_UC)
    1.27 +				flags |= ASSIGN_nocache;
    1.28 +
    1.29 +			assign_domain_mach_page(d, start, size, flags);
    1.30 +
    1.31  			/* Fall-through.  */
    1.32  		case EFI_MEMORY_MAPPED_IO:
    1.33  			/* Will be mapped with ioremap.  */