ia64/xen-unstable

changeset 8683:0d95066795de

Explicitly block attempts to mutate the M2P tables of shadow mode
guests once they're running.

Signed-off-by: Steven Smith, sos22@cam.ac.uk
author sos22@douglas.cl.cam.ac.uk
date Thu Jan 26 14:39:12 2006 +0100 (2006-01-26)
parents 1580009f137c
children f658587fdaac
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Thu Jan 26 14:33:20 2006 +0100
     1.2 +++ b/xen/arch/x86/mm.c	Thu Jan 26 14:39:12 2006 +0100
     1.3 @@ -2152,35 +2152,22 @@ int do_mmu_update(
     1.4  
     1.5          case MMU_MACHPHYS_UPDATE:
     1.6  
     1.7 +            if (shadow_mode_translate(FOREIGNDOM)) {
     1.8 +                /* We don't allow translate mode guests to have their
     1.9 +                   M2P tables mutated while they're running. */
    1.10 +                okay = 0;
    1.11 +                break;
    1.12 +            }
    1.13 +
    1.14              mfn = req.ptr >> PAGE_SHIFT;
    1.15              gpfn = req.val;
    1.16  
    1.17 -            /* HACK ALERT...  Need to think about this some more... */
    1.18 -            if ( unlikely(shadow_mode_translate(FOREIGNDOM) && IS_PRIV(d)) )
    1.19 -            {
    1.20 -                shadow_lock(FOREIGNDOM);
    1.21 -                printk("privileged guest dom%d requests pfn=%lx to "
    1.22 -                       "map mfn=%lx for dom%d\n",
    1.23 -                       d->domain_id, gpfn, mfn, FOREIGNDOM->domain_id);
    1.24 -                set_pfn_from_mfn(mfn, gpfn);
    1.25 -                set_p2m_entry(FOREIGNDOM, gpfn, mfn, &sh_mapcache, &mapcache);
    1.26 -                okay = 1;
    1.27 -                shadow_unlock(FOREIGNDOM);
    1.28 -                break;
    1.29 -            }
    1.30 -
    1.31              if ( unlikely(!get_page_from_pagenr(mfn, FOREIGNDOM)) )
    1.32              {
    1.33                  MEM_LOG("Could not get page for mach->phys update");
    1.34                  break;
    1.35              }
    1.36  
    1.37 -            if ( unlikely(shadow_mode_translate(FOREIGNDOM) && !IS_PRIV(d)) )
    1.38 -            {
    1.39 -                MEM_LOG("can't mutate the m2p of translated guests");
    1.40 -                break;
    1.41 -            }
    1.42 -
    1.43              set_pfn_from_mfn(mfn, gpfn);
    1.44              okay = 1;
    1.45