direct-io.hg

changeset 13453:d9b2dd57fdc4

[IA64] Add convmem_end

Split the meaning of struct domain::maxmem into struct arch_domain::convmem_end
so that maxmem means the number of pages which domain has and convmem_end means
the highest address of conventional memory (i.e. RAM).

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild2.aw
date Thu Jan 04 15:25:47 2007 -0700 (2007-01-04)
parents 98f48cf14d98
children 8bf7cd060df8
files xen/arch/ia64/xen/dom_fw.c xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/mm.c xen/include/asm-ia64/domain.h
line diff
     1.1 --- a/xen/arch/ia64/xen/dom_fw.c	Thu Jan 04 15:12:05 2007 -0700
     1.2 +++ b/xen/arch/ia64/xen/dom_fw.c	Thu Jan 04 15:25:47 2007 -0700
     1.3 @@ -582,6 +582,7 @@ complete_dom0_memmap(struct domain *d,
     1.4  			num_mds++;
     1.5  
     1.6  			dom_mem -= dom_md->num_pages << EFI_PAGE_SHIFT;
     1.7 +			d->arch.convmem_end = end;
     1.8  			break;
     1.9  
    1.10  		case EFI_UNUSABLE_MEMORY:
    1.11 @@ -804,6 +805,7 @@ dom_fw_init(struct domain *d,
    1.12  		/* Memory.  */
    1.13  		MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB,
    1.14  		        FW_END_PADDR, maxmem);
    1.15 +		d->arch.convmem_end = maxmem;
    1.16  		
    1.17  		/* Create an entry for IO ports.  */
    1.18  		MAKE_MD(EFI_MEMORY_MAPPED_IO_PORT_SPACE, EFI_MEMORY_UC,
     2.1 --- a/xen/arch/ia64/xen/domain.c	Thu Jan 04 15:12:05 2007 -0700
     2.2 +++ b/xen/arch/ia64/xen/domain.c	Thu Jan 04 15:25:47 2007 -0700
     2.3 @@ -760,8 +760,9 @@ int shadow_mode_control(struct domain *d
     2.4  		atomic64_set(&d->arch.shadow_fault_count, 0);
     2.5  		atomic64_set(&d->arch.shadow_dirty_count, 0);
     2.6  
     2.7 -		d->arch.shadow_bitmap_size = (d->max_pages + BITS_PER_LONG-1) &
     2.8 -		                             ~(BITS_PER_LONG-1);
     2.9 +		d->arch.shadow_bitmap_size =
    2.10 +			((d->arch.convmem_end >> PAGE_SHIFT) +
    2.11 +			 BITS_PER_LONG - 1) & ~(BITS_PER_LONG - 1);
    2.12  		d->arch.shadow_bitmap = xmalloc_array(unsigned long,
    2.13  		                   d->arch.shadow_bitmap_size / BITS_PER_LONG);
    2.14  		if (d->arch.shadow_bitmap == NULL) {
     3.1 --- a/xen/arch/ia64/xen/mm.c	Thu Jan 04 15:12:05 2007 -0700
     3.2 +++ b/xen/arch/ia64/xen/mm.c	Thu Jan 04 15:25:47 2007 -0700
     3.3 @@ -700,12 +700,12 @@ unsigned long lookup_domain_mpa(struct d
     3.4  
     3.5      printk("%s: d 0x%p id %d current 0x%p id %d\n",
     3.6             __func__, d, d->domain_id, current, current->vcpu_id);
     3.7 -    if ((mpaddr >> PAGE_SHIFT) < d->max_pages)
     3.8 +    if (mpaddr < d->arch.convmem_end)
     3.9          printk("%s: non-allocated mpa 0x%lx (< 0x%lx)\n", __func__,
    3.10 -               mpaddr, (unsigned long)d->max_pages << PAGE_SHIFT);
    3.11 +               mpaddr, d->arch.convmem_end);
    3.12      else
    3.13          printk("%s: bad mpa 0x%lx (=> 0x%lx)\n", __func__,
    3.14 -               mpaddr, (unsigned long)d->max_pages << PAGE_SHIFT);
    3.15 +               mpaddr, d->arch.convmem_end);
    3.16  
    3.17      if (entry != NULL)
    3.18          p2m_entry_set(entry, NULL, __pte(0));
     4.1 --- a/xen/include/asm-ia64/domain.h	Thu Jan 04 15:12:05 2007 -0700
     4.2 +++ b/xen/include/asm-ia64/domain.h	Thu Jan 04 15:25:47 2007 -0700
     4.3 @@ -78,6 +78,9 @@ struct arch_domain {
     4.4          };
     4.5      };
     4.6  
     4.7 +    /* maximum metaphysical address of conventional memory */
     4.8 +    u64 convmem_end;
     4.9 +
    4.10      /* Allowed accesses to io ports.  */
    4.11      struct rangeset *ioport_caps;
    4.12