debuggers.hg

changeset 22239:35a1a14c408e

Revert 22186:7167d6dd5c7c "x86: Retry do_mmu_update() a few times"

It does not work reliably for a couple of reasons:
(1) page_lock() fails if a page is !PGT_validated, and a page can
remain in that state for unbounded time.
(2) in the kernel-side race that motivated this patch, pgd_pin() can
lose to vmalloc_sync_all() -- pgd_pin() can try to chaneg a pmd page's
type to l2_pagetable while
vmalloc_sync_all()->set_pmd()->do_mmu_update() has it temporarily
pinned as writable. This is hard to fix on the Xen side.

Hence I give up on this approach, revert the patch, and settle for
kernel-side patching only.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Sep 22 08:49:09 2010 +0100 (2010-09-22)
parents a2b46be9958e
children e8e3aeed3eba
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Tue Sep 21 17:54:43 2010 +0100
     1.2 +++ b/xen/arch/x86/mm.c	Wed Sep 22 08:49:09 2010 +0100
     1.3 @@ -3414,7 +3414,6 @@ int do_mmu_update(
     1.4          case MMU_NORMAL_PT_UPDATE:
     1.5          case MMU_PT_UPDATE_PRESERVE_AD:
     1.6          {
     1.7 -            unsigned int retries = 0;
     1.8              p2m_type_t p2mt;
     1.9  
    1.10              rc = xsm_mmu_normal_update(d, pg_owner, req.val);
    1.11 @@ -3446,7 +3445,6 @@ int do_mmu_update(
    1.12                            (unsigned long)(req.ptr & ~PAGE_MASK));
    1.13              page = mfn_to_page(mfn);
    1.14  
    1.15 -        retry:
    1.16              if ( page_lock(page) )
    1.17              {
    1.18                  switch ( page->u.inuse.type_info & PGT_type_mask )
    1.19 @@ -3603,11 +3601,6 @@ int do_mmu_update(
    1.20                      v, va, req.val, _mfn(mfn));
    1.21                  put_page_type(page);
    1.22              }
    1.23 -            else if ( retries++ < 5 )
    1.24 -            {
    1.25 -                /* Page type can be in flux, so we retry a few times. */
    1.26 -                goto retry;
    1.27 -            }
    1.28  
    1.29              unmap_domain_page_with_cache(va, &mapcache);
    1.30              put_page(page);