ia64/xen-unstable

changeset 14077:8a58ea36e420

[IA64] Bug fixes to assign_domain_mmio_page()

- phys_addr also needs to be rounded down to a page start
- return the original mpaddr, not the modified one

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild2.aw
date Thu Mar 01 15:02:09 2007 -0700 (2007-03-01)
parents 0deb53ff4b67
children 50d5bf02e59e
files xen/arch/ia64/xen/mm.c
line diff
     1.1 --- a/xen/arch/ia64/xen/mm.c	Thu Mar 01 11:21:44 2007 -0700
     1.2 +++ b/xen/arch/ia64/xen/mm.c	Thu Mar 01 15:02:09 2007 -0700
     1.3 @@ -1048,7 +1048,9 @@ assign_domain_mmio_page(struct domain *d
     1.4                          unsigned long phys_addr, unsigned long size,
     1.5                          unsigned long flags)
     1.6  {
     1.7 +    unsigned long addr = mpaddr & PAGE_MASK;
     1.8      unsigned long end = PAGE_ALIGN(mpaddr + size);
     1.9 +
    1.10      if (size == 0) {
    1.11          gdprintk(XENLOG_INFO, "%s: domain %p mpaddr 0x%lx size = 0x%lx\n",
    1.12                  __func__, d, mpaddr, size);
    1.13 @@ -1061,9 +1063,9 @@ assign_domain_mmio_page(struct domain *d
    1.14          return -EINVAL;
    1.15      }
    1.16  
    1.17 -    for (mpaddr &= PAGE_MASK; mpaddr < end;
    1.18 -         mpaddr += PAGE_SIZE, phys_addr += PAGE_SIZE) {
    1.19 -        __assign_domain_page(d, mpaddr, phys_addr, flags);
    1.20 +    for (phys_addr &= PAGE_MASK; addr < end;
    1.21 +         addr += PAGE_SIZE, phys_addr += PAGE_SIZE) {
    1.22 +        __assign_domain_page(d, addr, phys_addr, flags);
    1.23      }
    1.24  
    1.25      return mpaddr;