direct-io.hg

changeset 8689:e9770d41e5bd

Bug fix: we need to eagerly synchronise th HL2, since Xen relies on it
(via the guest linear table), and faults to that don't get sent to the
shadow mode infrastructure, and so we can't do it lazily.

Signed-off-by: Steven Smith, sos22@cam.ac.uk
author sos22@douglas.cl.cam.ac.uk
date Fri Jan 27 21:38:55 2006 +0100 (2006-01-27)
parents 990c009015e8
children a47b7a464f09
files xen/arch/x86/shadow32.c
line diff
     1.1 --- a/xen/arch/x86/shadow32.c	Fri Jan 27 21:23:06 2006 +0100
     1.2 +++ b/xen/arch/x86/shadow32.c	Fri Jan 27 21:38:55 2006 +0100
     1.3 @@ -1456,7 +1456,9 @@ shadow_hl2_table(struct domain *d, unsig
     1.4  {
     1.5      unsigned long hl2mfn;
     1.6      l1_pgentry_t *hl2;
     1.7 +    l2_pgentry_t *gpgd;
     1.8      int limit;
     1.9 +    int x;
    1.10  
    1.11      ASSERT(PGT_base_page_table == PGT_l2_page_table);
    1.12  
    1.13 @@ -1495,6 +1497,11 @@ shadow_hl2_table(struct domain *d, unsig
    1.14              l1e_from_pfn(hl2mfn, __PAGE_HYPERVISOR);
    1.15      }
    1.16  
    1.17 +    gpgd = map_domain_page(gmfn);
    1.18 +    for (x = 0; x < DOMAIN_ENTRIES_PER_L2_PAGETABLE; x++)
    1.19 +        validate_hl2e_change(d, gpgd[x], &hl2[x]);
    1.20 +    unmap_domain_page(gpgd);
    1.21 +
    1.22      unmap_domain_page(hl2);
    1.23  
    1.24      return hl2mfn;
    1.25 @@ -2797,8 +2804,9 @@ void shadow_l2_normal_pt_update(
    1.26      unsigned long pa, l2_pgentry_t gpde,
    1.27      struct domain_mmap_cache *cache)
    1.28  {
    1.29 -    unsigned long sl2mfn;
    1.30 +    unsigned long sl2mfn, hl2mfn;
    1.31      l2_pgentry_t *spl2e;
    1.32 +    l1_pgentry_t *hl2e;
    1.33  
    1.34      shadow_lock(d);
    1.35  
    1.36 @@ -2812,6 +2820,15 @@ void shadow_l2_normal_pt_update(
    1.37                              &spl2e[(pa & ~PAGE_MASK) / sizeof(l2_pgentry_t)]);
    1.38          unmap_domain_page_with_cache(spl2e, cache);
    1.39      }
    1.40 +    hl2mfn = __shadow_status(current->domain, pa >> PAGE_SHIFT,
    1.41 +                             PGT_hl2_shadow);
    1.42 +    if ( hl2mfn )
    1.43 +    {
    1.44 +        hl2e = map_domain_page(hl2mfn);
    1.45 +        validate_hl2e_change(d, gpde,
    1.46 +                             &hl2e[(pa & ~PAGE_MASK) / sizeof(l1_pgentry_t)]);
    1.47 +        unmap_domain_page(hl2e);
    1.48 +    }
    1.49  
    1.50      shadow_unlock(d);
    1.51  }