ia64/xen-unstable

changeset 18689:7ad8c47f5c4b

[IA64] allow __assign_domain_page() to assign real MMIO page over _PAGE_IO.

When VTD is enabled on HVM domain,
P2M entry may change from _PAGE_IO to real MMIO page.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Fri Oct 24 11:38:09 2008 +0900 (2008-10-24)
parents 02c8733e2d91
children c19871b66cea
files xen/arch/ia64/xen/mm.c
line diff
     1.1 --- a/xen/arch/ia64/xen/mm.c	Wed Oct 22 17:20:15 2008 +0900
     1.2 +++ b/xen/arch/ia64/xen/mm.c	Fri Oct 24 11:38:09 2008 +0900
     1.3 @@ -917,11 +917,19 @@ int
     1.4  
     1.5      old_pte = __pte(0);
     1.6      new_pte = pfn_pte(physaddr >> PAGE_SHIFT, __pgprot(prot));
     1.7 + again_hvm_page_io:
     1.8      ret_pte = ptep_cmpxchg_rel(&d->arch.mm, mpaddr, pte, old_pte, new_pte);
     1.9      if (pte_val(ret_pte) == pte_val(old_pte)) {
    1.10          smp_mb();
    1.11          return 0;
    1.12      }
    1.13 +    /* in HVM guest, when VTD is enabled,
    1.14 +     * P2M entry may change from _PAGE_IO type to real MMIO page 
    1.15 +     */
    1.16 +    if(VMX_DOMAIN(d->vcpu[0]) && (pte_val(ret_pte) & _PAGE_IO)) {
    1.17 +        old_pte = ret_pte;
    1.18 +        goto again_hvm_page_io;
    1.19 +    }
    1.20  
    1.21      // dom0 tries to map real machine's I/O region, but failed.
    1.22      // It is very likely that dom0 doesn't boot correctly because