ia64/xen-unstable

changeset 8661:43c294aea9ec

Make shadow translate mode work for unprivileged, uniprocessor guests
with no devices on plain 32 bit non-PAE hosts.

Signed-off-by: Steven Smith, sos22@cam.ac.uk
author sos22@douglas.cl.cam.ac.uk
date Wed Jan 25 17:15:11 2006 +0100 (2006-01-25)
parents 860fa26845c2
children 407358daf389
files tools/libxc/xc_linux_build.c xen/arch/x86/mm.c xen/arch/x86/shadow32.c xen/include/asm-x86/shadow.h
line diff
     1.1 --- a/tools/libxc/xc_linux_build.c	Wed Jan 25 17:14:19 2006 +0100
     1.2 +++ b/tools/libxc/xc_linux_build.c	Wed Jan 25 17:15:11 2006 +0100
     1.3 @@ -60,16 +60,18 @@ static int probeimageformat(char *image,
     1.4      return 0;
     1.5  }
     1.6  
     1.7 -#define alloc_pt(ltab, vltab)                                           \
     1.8 +#define alloc_pt(ltab, vltab, pltab)                                    \
     1.9  do {                                                                    \
    1.10 -    ltab = (uint64_t)page_array[ppt_alloc++] << PAGE_SHIFT;                  \
    1.11 +    pltab = ppt_alloc++;                                                \
    1.12 +    ltab = (uint64_t)page_array[pltab] << PAGE_SHIFT;                   \
    1.13 +    pltab <<= PAGE_SHIFT;                                               \
    1.14      if ( vltab != NULL )                                                \
    1.15          munmap(vltab, PAGE_SIZE);                                       \
    1.16      if ( (vltab = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,       \
    1.17                                         PROT_READ|PROT_WRITE,            \
    1.18                                         ltab >> PAGE_SHIFT)) == NULL )   \
    1.19          goto error_out;                                                 \
    1.20 -    memset(vltab, 0, PAGE_SIZE);                                        \
    1.21 +    memset(vltab, 0x0, PAGE_SIZE);                                      \
    1.22  } while ( 0 )
    1.23  
    1.24  #if defined(__i386__)
    1.25 @@ -80,33 +82,42 @@ static int setup_pg_tables(int xc_handle
    1.26                             unsigned long v_end,
    1.27                             unsigned long *page_array,
    1.28                             unsigned long vpt_start,
    1.29 -                           unsigned long vpt_end)
    1.30 +                           unsigned long vpt_end,
    1.31 +                           unsigned shadow_mode_enabled)
    1.32  {
    1.33      l1_pgentry_t *vl1tab=NULL, *vl1e=NULL;
    1.34      l2_pgentry_t *vl2tab=NULL, *vl2e=NULL;
    1.35 -    unsigned long l1tab = 0;
    1.36 -    unsigned long l2tab = 0;
    1.37 +    unsigned long l1tab = 0, pl1tab;
    1.38 +    unsigned long l2tab = 0, pl2tab;
    1.39      unsigned long ppt_alloc;
    1.40      unsigned long count;
    1.41  
    1.42      ppt_alloc = (vpt_start - dsi_v_start) >> PAGE_SHIFT;
    1.43 -    alloc_pt(l2tab, vl2tab);
    1.44 +    alloc_pt(l2tab, vl2tab, pl2tab);
    1.45      vl2e = &vl2tab[l2_table_offset(dsi_v_start)];
    1.46      ctxt->ctrlreg[3] = l2tab;
    1.47  
    1.48      for ( count = 0; count < ((v_end - dsi_v_start) >> PAGE_SHIFT); count++ )
    1.49 -    {    
    1.50 +    {
    1.51          if ( ((unsigned long)vl1e & (PAGE_SIZE-1)) == 0 )
    1.52          {
    1.53 -            alloc_pt(l1tab, vl1tab);
    1.54 +            alloc_pt(l1tab, vl1tab, pl1tab);
    1.55              vl1e = &vl1tab[l1_table_offset(dsi_v_start + (count<<PAGE_SHIFT))];
    1.56 -            *vl2e++ = l1tab | L2_PROT;
    1.57 +            if (shadow_mode_enabled)
    1.58 +                *vl2e = pl1tab | L2_PROT;
    1.59 +            else
    1.60 +                *vl2e = l1tab | L2_PROT;
    1.61 +            vl2e++;
    1.62          }
    1.63  
    1.64 -        *vl1e = (page_array[count] << PAGE_SHIFT) | L1_PROT;
    1.65 -        if ( (count >= ((vpt_start-dsi_v_start)>>PAGE_SHIFT)) && 
    1.66 -             (count <  ((vpt_end  -dsi_v_start)>>PAGE_SHIFT)) )
    1.67 -            *vl1e &= ~_PAGE_RW;
    1.68 +        if (shadow_mode_enabled) {
    1.69 +            *vl1e = (count << PAGE_SHIFT) | L1_PROT;
    1.70 +        } else {
    1.71 +            *vl1e = (page_array[count] << PAGE_SHIFT) | L1_PROT;
    1.72 +            if ( (count >= ((vpt_start-dsi_v_start)>>PAGE_SHIFT)) && 
    1.73 +                 (count <  ((vpt_end  -dsi_v_start)>>PAGE_SHIFT)) )
    1.74 +                *vl1e &= ~_PAGE_RW;
    1.75 +        }
    1.76          vl1e++;
    1.77      }
    1.78      munmap(vl1tab, PAGE_SIZE);
    1.79 @@ -127,12 +138,13 @@ static int setup_pg_tables_pae(int xc_ha
    1.80                                 unsigned long v_end,
    1.81                                 unsigned long *page_array,
    1.82                                 unsigned long vpt_start,
    1.83 -                               unsigned long vpt_end)
    1.84 +                               unsigned long vpt_end,
    1.85 +                               unsigned shadow_mode_enabled)
    1.86  {
    1.87      l1_pgentry_64_t *vl1tab = NULL, *vl1e = NULL;
    1.88      l2_pgentry_64_t *vl2tab = NULL, *vl2e = NULL;
    1.89      l3_pgentry_64_t *vl3tab = NULL, *vl3e = NULL;
    1.90 -    uint64_t l1tab, l2tab, l3tab;
    1.91 +    uint64_t l1tab, l2tab, l3tab, pl1tab, pl2tab, pl3tab;
    1.92      unsigned long ppt_alloc, count, nmfn;
    1.93  
    1.94      /* First allocate page for page dir. */
    1.95 @@ -149,7 +161,7 @@ static int setup_pg_tables_pae(int xc_ha
    1.96          page_array[ppt_alloc] = nmfn;
    1.97      }
    1.98  
    1.99 -    alloc_pt(l3tab, vl3tab);
   1.100 +    alloc_pt(l3tab, vl3tab, pl3tab);
   1.101      vl3e = &vl3tab[l3_table_offset_pae(dsi_v_start)];
   1.102      ctxt->ctrlreg[3] = l3tab;
   1.103  
   1.104 @@ -159,22 +171,32 @@ static int setup_pg_tables_pae(int xc_ha
   1.105          {
   1.106              if ( !((unsigned long)vl2e & (PAGE_SIZE-1)) )
   1.107              {
   1.108 -                alloc_pt(l2tab, vl2tab);
   1.109 +                alloc_pt(l2tab, vl2tab, pl2tab);
   1.110                  vl2e = &vl2tab[l2_table_offset_pae(
   1.111                      dsi_v_start + (count << PAGE_SHIFT))];
   1.112 -                *vl3e++ = l2tab | L3_PROT;
   1.113 +                if (shadow_mode_enabled)
   1.114 +                    *vl3e = pl2tab | L3_PROT;
   1.115 +                else
   1.116 +                    *vl3e++ = l2tab | L3_PROT;
   1.117              }
   1.118  
   1.119 -            alloc_pt(l1tab, vl1tab);
   1.120 +            alloc_pt(l1tab, vl1tab, pl1tab);
   1.121              vl1e = &vl1tab[l1_table_offset_pae(
   1.122                  dsi_v_start + (count << PAGE_SHIFT))];
   1.123 -            *vl2e++ = l1tab | L2_PROT;
   1.124 +            if (shadow_mode_enabled)
   1.125 +                *vl2e = pl1tab | L2_PROT;
   1.126 +            else
   1.127 +                *vl2e++ = l1tab | L2_PROT;
   1.128          }
   1.129          
   1.130 -        *vl1e = ((uint64_t)page_array[count] << PAGE_SHIFT) | L1_PROT;
   1.131 -        if ( (count >= ((vpt_start-dsi_v_start)>>PAGE_SHIFT)) &&
   1.132 -             (count <  ((vpt_end  -dsi_v_start)>>PAGE_SHIFT)) ) 
   1.133 -            *vl1e &= ~_PAGE_RW;
   1.134 +        if (shadow_mode_enabled) {
   1.135 +            *vl1e = (count << PAGE_SHIFT) | L1_PROT;
   1.136 +        } else {
   1.137 +            *vl1e = ((uint64_t)page_array[count] << PAGE_SHIFT) | L1_PROT;
   1.138 +            if ( (count >= ((vpt_start-dsi_v_start)>>PAGE_SHIFT)) &&
   1.139 +                 (count <  ((vpt_end  -dsi_v_start)>>PAGE_SHIFT)) ) 
   1.140 +                *vl1e &= ~_PAGE_RW;
   1.141 +        }
   1.142          vl1e++;
   1.143      }
   1.144       
   1.145 @@ -203,7 +225,8 @@ static int setup_pg_tables_64(int xc_han
   1.146                                unsigned long v_end,
   1.147                                unsigned long *page_array,
   1.148                                unsigned long vpt_start,
   1.149 -                              unsigned long vpt_end)
   1.150 +                              unsigned long vpt_end,
   1.151 +                              int shadow_mode_enabled)
   1.152  {
   1.153      l1_pgentry_t *vl1tab=NULL, *vl1e=NULL;
   1.154      l2_pgentry_t *vl2tab=NULL, *vl2e=NULL;
   1.155 @@ -247,11 +270,15 @@ static int setup_pg_tables_64(int xc_han
   1.156              vl2e++;
   1.157          }
   1.158          
   1.159 -        *vl1e = (page_array[count] << PAGE_SHIFT) | L1_PROT;
   1.160 -        if ( (count >= ((vpt_start-dsi_v_start)>>PAGE_SHIFT)) &&
   1.161 -             (count <  ((vpt_end  -dsi_v_start)>>PAGE_SHIFT)) ) 
   1.162 -        {
   1.163 -            *vl1e &= ~_PAGE_RW;
   1.164 +        if (shadow_mode_enable) {
   1.165 +            *vl1e = (count << PAGE_SHIFT) | L1_PROT;
   1.166 +        } else {
   1.167 +            *vl1e = (page_array[count] << PAGE_SHIFT) | L1_PROT;
   1.168 +            if ( (count >= ((vpt_start-dsi_v_start)>>PAGE_SHIFT)) &&
   1.169 +                 (count <  ((vpt_end  -dsi_v_start)>>PAGE_SHIFT)) ) 
   1.170 +                {
   1.171 +                    *vl1e &= ~_PAGE_RW;
   1.172 +                }
   1.173          }
   1.174          vl1e++;
   1.175      }
   1.176 @@ -458,6 +485,8 @@ static int setup_guest(int xc_handle,
   1.177      unsigned long vpt_start;
   1.178      unsigned long vpt_end;
   1.179      unsigned long v_end;
   1.180 +    unsigned shadow_mode_enabled;
   1.181 +    unsigned long guest_store_mfn, guest_console_mfn, guest_shared_info_mfn;
   1.182  
   1.183      rc = probeimageformat(image, image_size, &load_funcs);
   1.184      if ( rc != 0 )
   1.185 @@ -558,7 +587,7 @@ static int setup_guest(int xc_handle,
   1.186          goto error_out;
   1.187      }
   1.188  
   1.189 -    if ( (page_array = malloc(nr_pages * sizeof(unsigned long))) == NULL )
   1.190 +    if ( (page_array = malloc((nr_pages + 1) * sizeof(unsigned long))) == NULL )
   1.191      {
   1.192          PERROR("Could not allocate memory");
   1.193          goto error_out;
   1.194 @@ -593,24 +622,8 @@ static int setup_guest(int xc_handle,
   1.195      if ( (mmu = xc_init_mmu_updates(xc_handle, dom)) == NULL )
   1.196          goto error_out;
   1.197  
   1.198 -    /* setup page tables */
   1.199 -#if defined(__i386__)
   1.200 -    if (dsi.pae_kernel)
   1.201 -        rc = setup_pg_tables_pae(xc_handle, dom, ctxt,
   1.202 -                                 dsi.v_start, v_end,
   1.203 -                                 page_array, vpt_start, vpt_end);
   1.204 -    else
   1.205 -        rc = setup_pg_tables(xc_handle, dom, ctxt,
   1.206 -                             dsi.v_start, v_end,
   1.207 -                             page_array, vpt_start, vpt_end);
   1.208 -#endif
   1.209 -#if defined(__x86_64__)
   1.210 -    rc = setup_pg_tables_64(xc_handle, dom, ctxt,
   1.211 -                            dsi.v_start, v_end,
   1.212 -                            page_array, vpt_start, vpt_end);
   1.213 -#endif
   1.214 -    if (0 != rc)
   1.215 -        goto error_out;
   1.216 +    shadow_mode_enabled = !!strstr(dsi.xen_guest_string,
   1.217 +                                   "SHADOW=translate");
   1.218  
   1.219      /* Write the phys->machine and machine->phys table entries. */
   1.220      physmap_pfn = (vphysmap_start - dsi.v_start) >> PAGE_SHIFT;
   1.221 @@ -618,7 +631,10 @@ static int setup_guest(int xc_handle,
   1.222          xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE,
   1.223          page_array[physmap_pfn++]);
   1.224  
   1.225 -    for ( count = 0; count < nr_pages; count++ )
   1.226 +    if (shadow_mode_enabled)
   1.227 +        page_array[nr_pages] = shared_info_frame;
   1.228 +
   1.229 +    for ( count = 0; count < nr_pages + shadow_mode_enabled; count++ )
   1.230      {
   1.231          if ( xc_add_mmu_update(
   1.232              xc_handle, mmu,
   1.233 @@ -640,20 +656,58 @@ static int setup_guest(int xc_handle,
   1.234          }
   1.235      }
   1.236      munmap(physmap, PAGE_SIZE);
   1.237 -    
   1.238 +
   1.239 +    /* Send the page update requests down to the hypervisor. */
   1.240 +    if ( xc_finish_mmu_updates(xc_handle, mmu) )
   1.241 +        goto error_out;
   1.242 +
   1.243 +    if (shadow_mode_enabled) {
   1.244 +        /* Enable shadow translate mode */
   1.245 +        if (xc_shadow_control(xc_handle, dom,
   1.246 +                              DOM0_SHADOW_CONTROL_OP_ENABLE_TRANSLATE,
   1.247 +                              NULL, 0, NULL) < 0) {
   1.248 +            PERROR("Could not enable translation mode");
   1.249 +            goto error_out;
   1.250 +        }
   1.251 +    }
   1.252 +
   1.253 +    /* setup page tables */
   1.254 +#if defined(__i386__)
   1.255 +    if (dsi.pae_kernel)
   1.256 +        rc = setup_pg_tables_pae(xc_handle, dom, ctxt,
   1.257 +                                 dsi.v_start, v_end,
   1.258 +                                 page_array, vpt_start, vpt_end,
   1.259 +                                 shadow_mode_enabled);
   1.260 +    else
   1.261 +        rc = setup_pg_tables(xc_handle, dom, ctxt,
   1.262 +                             dsi.v_start, v_end,
   1.263 +                             page_array, vpt_start, vpt_end,
   1.264 +                             shadow_mode_enabled);
   1.265 +#endif
   1.266 +#if defined(__x86_64__)
   1.267 +    rc = setup_pg_tables_64(xc_handle, dom, ctxt,
   1.268 +                            dsi.v_start, v_end,
   1.269 +                            page_array, vpt_start, vpt_end,
   1.270 +                            shadow_mode_enabled);
   1.271 +#endif
   1.272 +    if (0 != rc)
   1.273 +        goto error_out;
   1.274 +
   1.275  #if defined(__i386__)
   1.276      /*
   1.277       * Pin down l2tab addr as page dir page - causes hypervisor to provide
   1.278       * correct protection for the page
   1.279       */
   1.280 -    if (dsi.pae_kernel) {
   1.281 -        if ( pin_table(xc_handle, MMUEXT_PIN_L3_TABLE,
   1.282 -                       ctxt->ctrlreg[3] >> PAGE_SHIFT, dom) )
   1.283 -            goto error_out;
   1.284 -    } else {
   1.285 -        if ( pin_table(xc_handle, MMUEXT_PIN_L2_TABLE,
   1.286 -                       ctxt->ctrlreg[3] >> PAGE_SHIFT, dom) )
   1.287 -            goto error_out;
   1.288 +    if (!shadow_mode_enabled) {
   1.289 +        if (dsi.pae_kernel) {
   1.290 +            if ( pin_table(xc_handle, MMUEXT_PIN_L3_TABLE,
   1.291 +                           ctxt->ctrlreg[3] >> PAGE_SHIFT, dom) )
   1.292 +                goto error_out;
   1.293 +        } else {
   1.294 +            if ( pin_table(xc_handle, MMUEXT_PIN_L2_TABLE,
   1.295 +                           ctxt->ctrlreg[3] >> PAGE_SHIFT, dom) )
   1.296 +                goto error_out;
   1.297 +        }
   1.298      }
   1.299  #endif
   1.300  
   1.301 @@ -672,24 +726,34 @@ static int setup_guest(int xc_handle,
   1.302      if ( xc_clear_domain_page(xc_handle, dom, *store_mfn) ||
   1.303           xc_clear_domain_page(xc_handle, dom, *console_mfn) )
   1.304          goto error_out;
   1.305 +    if (shadow_mode_enabled) {
   1.306 +        guest_store_mfn = (vstoreinfo_start-dsi.v_start) >> PAGE_SHIFT;
   1.307 +        guest_console_mfn = (vconsole_start-dsi.v_start) >> PAGE_SHIFT;
   1.308 +        guest_shared_info_mfn = nr_pages;
   1.309 +    } else {
   1.310 +        guest_store_mfn = *store_mfn;
   1.311 +        guest_console_mfn = *console_mfn;
   1.312 +        guest_shared_info_mfn = shared_info_frame;
   1.313 +    }
   1.314  
   1.315      start_info = xc_map_foreign_range(
   1.316          xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE,
   1.317          page_array[(vstartinfo_start-dsi.v_start)>>PAGE_SHIFT]);
   1.318 +    /*shared_info, start_info */
   1.319      memset(start_info, 0, sizeof(*start_info));
   1.320      rc = xc_version(xc_handle, XENVER_version, NULL);
   1.321      sprintf(start_info->magic, "xen-%i.%i-x86_%d%s",
   1.322              rc >> 16, rc & (0xFFFF), (unsigned int)sizeof(long)*8,
   1.323              dsi.pae_kernel ? "p" : "");
   1.324      start_info->nr_pages     = nr_pages;
   1.325 -    start_info->shared_info  = shared_info_frame << PAGE_SHIFT;
   1.326 +    start_info->shared_info  = guest_shared_info_mfn << PAGE_SHIFT;
   1.327      start_info->flags        = flags;
   1.328      start_info->pt_base      = vpt_start;
   1.329      start_info->nr_pt_frames = nr_pt_pages;
   1.330      start_info->mfn_list     = vphysmap_start;
   1.331 -    start_info->store_mfn    = *store_mfn;
   1.332 +    start_info->store_mfn    = guest_store_mfn;
   1.333      start_info->store_evtchn = store_evtchn;
   1.334 -    start_info->console_mfn   = *console_mfn;
   1.335 +    start_info->console_mfn   = guest_console_mfn;
   1.336      start_info->console_evtchn = console_evtchn;
   1.337      if ( initrd_len != 0 )
   1.338      {
     2.1 --- a/xen/arch/x86/mm.c	Wed Jan 25 17:14:19 2006 +0100
     2.2 +++ b/xen/arch/x86/mm.c	Wed Jan 25 17:15:11 2006 +0100
     2.3 @@ -1826,6 +1826,8 @@ int do_mmuext_op(
     2.4              break;
     2.5  
     2.6          case MMUEXT_NEW_BASEPTR:
     2.7 +            if (shadow_mode_translate(current->domain))
     2.8 +                mfn = __gpfn_to_mfn(current->domain, mfn);
     2.9              okay = new_guest_cr3(mfn);
    2.10              percpu_info[cpu].deferred_ops &= ~DOP_FLUSH_TLB;
    2.11              break;
    2.12 @@ -2680,6 +2682,7 @@ long do_set_gdt(unsigned long *frame_lis
    2.13      int nr_pages = (entries + 511) / 512;
    2.14      unsigned long frames[16];
    2.15      long ret;
    2.16 +    int x;
    2.17  
    2.18      /* Rechecked in set_gdt, but ensures a sane limit for copy_from_user(). */
    2.19      if ( entries > FIRST_RESERVED_GDT_ENTRY )
    2.20 @@ -2688,6 +2691,11 @@ long do_set_gdt(unsigned long *frame_lis
    2.21      if ( copy_from_user(frames, frame_list, nr_pages * sizeof(unsigned long)) )
    2.22          return -EFAULT;
    2.23  
    2.24 +    if (shadow_mode_translate(current->domain)) {
    2.25 +        for (x = 0; x < nr_pages; x++)
    2.26 +            frames[x] = __gpfn_to_mfn(current->domain, frames[x]);
    2.27 +    }
    2.28 +
    2.29      LOCK_BIGLOCK(current->domain);
    2.30  
    2.31      if ( (ret = set_gdt(current, frames, entries)) == 0 )
     3.1 --- a/xen/arch/x86/shadow32.c	Wed Jan 25 17:14:19 2006 +0100
     3.2 +++ b/xen/arch/x86/shadow32.c	Wed Jan 25 17:15:11 2006 +0100
     3.3 @@ -1391,7 +1391,7 @@ int shadow_mode_control(struct domain *d
     3.4      case DOM0_SHADOW_CONTROL_OP_ENABLE_TRANSLATE:
     3.5          free_shadow_pages(d);
     3.6          rc = __shadow_mode_enable(
     3.7 -            d, d->arch.shadow_mode|SHM_enable|SHM_refcounts|SHM_translate);
     3.8 +            d, d->arch.shadow_mode|SHM_enable|SHM_refcounts|SHM_translate|SHM_wr_pt_pte);
     3.9          break;
    3.10  
    3.11      default:
    3.12 @@ -2643,7 +2643,8 @@ int shadow_fault(unsigned long va, struc
    3.13      __guest_get_l2e(v, va, &gpde);
    3.14      if ( unlikely(!(l2e_get_flags(gpde) & _PAGE_PRESENT)) )
    3.15      {
    3.16 -        SH_VVLOG("shadow_fault - EXIT: L1 not present");
    3.17 +        SH_VVLOG("shadow_fault - EXIT: L2 not present (%x)",
    3.18 +                 l2e_get_intpte(gpde));
    3.19          perfc_incrc(shadow_fault_bail_pde_not_present);
    3.20          goto fail;
    3.21      }
    3.22 @@ -2655,8 +2656,9 @@ int shadow_fault(unsigned long va, struc
    3.23      orig_gpte = gpte = linear_pg_table[l1_linear_offset(va)];
    3.24      if ( unlikely(!(l1e_get_flags(gpte) & _PAGE_PRESENT)) )
    3.25      {
    3.26 -        SH_VVLOG("shadow_fault - EXIT: gpte not present (%" PRIpte ")",
    3.27 -                 l1e_get_intpte(gpte));
    3.28 +        SH_VVLOG("shadow_fault - EXIT: gpte not present (%" PRIpte ") (gpde %" PRIpte ")",
    3.29 +                 l1e_get_intpte(gpte),
    3.30 +                 l2e_get_intpte(gpde));
    3.31          perfc_incrc(shadow_fault_bail_pte_not_present);
    3.32          goto fail;
    3.33      }
     4.1 --- a/xen/include/asm-x86/shadow.h	Wed Jan 25 17:14:19 2006 +0100
     4.2 +++ b/xen/include/asm-x86/shadow.h	Wed Jan 25 17:15:11 2006 +0100
     4.3 @@ -490,7 +490,7 @@ static inline void __mark_dirty(struct d
     4.4  #ifndef NDEBUG
     4.5      else if ( mfn < max_page )
     4.6      {
     4.7 -        SH_VLOG("mark_dirty OOR! mfn=%x pfn=%lx max=%x (dom %p)",
     4.8 +        SH_VLOG("mark_dirty OOR! mfn=%lx pfn=%lx max=%x (dom %p)",
     4.9                 mfn, pfn, d->arch.shadow_dirty_bitmap_size, d);
    4.10          SH_VLOG("dom=%p caf=%08x taf=%" PRtype_info, 
    4.11                  page_get_owner(pfn_to_page(mfn)),