ia64/xen-unstable

changeset 8429:a4de51a2629f

Remove obsolete MMUEXT_REASSIGN_PAGE. It's not used by
anyone and is superceded by grant transfers.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Dec 21 19:10:53 2005 +0100 (2005-12-21)
parents b3edbeea3e79
children 9b108cf447e5
files xen/arch/x86/mm.c xen/include/public/xen.h
line diff
     1.1 --- a/xen/arch/x86/mm.c	Wed Dec 21 18:45:43 2005 +0100
     1.2 +++ b/xen/arch/x86/mm.c	Wed Dec 21 19:10:53 2005 +0100
     1.3 @@ -1930,105 +1930,6 @@ int do_mmuext_op(
     1.4              }
     1.5              break;
     1.6          }
     1.7 -
     1.8 -        case MMUEXT_REASSIGN_PAGE:
     1.9 -            if ( unlikely(!IS_PRIV(d)) )
    1.10 -            {
    1.11 -                MEM_LOG("Dom %u has no reassignment priv", d->domain_id);
    1.12 -                okay = 0;
    1.13 -                break;
    1.14 -            }
    1.15 -            
    1.16 -            e = percpu_info[cpu].foreign;
    1.17 -            if ( unlikely(e == NULL) )
    1.18 -            {
    1.19 -                MEM_LOG("No FOREIGNDOM to reassign mfn %lx to", mfn);
    1.20 -                okay = 0;
    1.21 -                break;
    1.22 -            }
    1.23 -            
    1.24 -            /*
    1.25 -             * Grab both page_list locks, in order. This prevents the page from
    1.26 -             * disappearing elsewhere while we modify the owner, and we'll need
    1.27 -             * both locks if we're successful so that we can change lists.
    1.28 -             */
    1.29 -            if ( d < e )
    1.30 -            {
    1.31 -                spin_lock(&d->page_alloc_lock);
    1.32 -                spin_lock(&e->page_alloc_lock);
    1.33 -            }
    1.34 -            else
    1.35 -            {
    1.36 -                spin_lock(&e->page_alloc_lock);
    1.37 -                spin_lock(&d->page_alloc_lock);
    1.38 -            }
    1.39 -            
    1.40 -            /*
    1.41 -             * Check that 'e' will accept the page and has reservation
    1.42 -             * headroom. Also, a domain mustn't have PGC_allocated pages when
    1.43 -             * it is dying. 
    1.44 -             */
    1.45 -            ASSERT(e->tot_pages <= e->max_pages);
    1.46 -            if ( unlikely(test_bit(_DOMF_dying, &e->domain_flags)) ||
    1.47 -                 unlikely(e->tot_pages == e->max_pages) ||
    1.48 -                 unlikely(IS_XEN_HEAP_FRAME(page)) )
    1.49 -            {
    1.50 -                MEM_LOG("Transferee has no reservation headroom (%d,%d), or "
    1.51 -                        "page is in Xen heap (%lx), or dom is dying (%ld).",
    1.52 -                        e->tot_pages, e->max_pages, mfn, e->domain_flags);
    1.53 -                okay = 0;
    1.54 -                goto reassign_fail;
    1.55 -            }
    1.56 -
    1.57 -            /*
    1.58 -             * The tricky bit: atomically change owner while there is just one
    1.59 -             * benign reference to the page (PGC_allocated). If that reference
    1.60 -             * disappears then the deallocation routine will safely spin.
    1.61 -             */
    1.62 -            _d  = pickle_domptr(d);
    1.63 -            _nd = page->u.inuse._domain;
    1.64 -            y   = page->count_info;
    1.65 -            do {
    1.66 -                x = y;
    1.67 -                if ( unlikely((x & (PGC_count_mask|PGC_allocated)) != 
    1.68 -                              (1|PGC_allocated)) ||
    1.69 -                     unlikely(_nd != _d) )
    1.70 -                {
    1.71 -                    MEM_LOG("Bad page values %lx: ed=%p(%u), sd=%p,"
    1.72 -                            " caf=%08x, taf=%" PRtype_info,
    1.73 -                            page_to_pfn(page), d, d->domain_id,
    1.74 -                            unpickle_domptr(_nd), x, page->u.inuse.type_info);
    1.75 -                    okay = 0;
    1.76 -                    goto reassign_fail;
    1.77 -                }
    1.78 -                __asm__ __volatile__(
    1.79 -                    LOCK_PREFIX "cmpxchg8b %3"
    1.80 -                    : "=d" (_nd), "=a" (y), "=c" (e),
    1.81 -                    "=m" (*(volatile u64 *)(&page->count_info))
    1.82 -                    : "0" (_d), "1" (x), "c" (e), "b" (x) );
    1.83 -            } 
    1.84 -            while ( unlikely(_nd != _d) || unlikely(y != x) );
    1.85 -            
    1.86 -            /*
    1.87 -             * Unlink from 'd'. We transferred at least one reference to 'e',
    1.88 -             * so noone else is spinning to try to delete this page from 'd'.
    1.89 -             */
    1.90 -            d->tot_pages--;
    1.91 -            list_del(&page->list);
    1.92 -            
    1.93 -            /*
    1.94 -             * Add the page to 'e'. Someone may already have removed the last
    1.95 -             * reference and want to remove the page from 'e'. However, we have
    1.96 -             * the lock so they'll spin waiting for us.
    1.97 -             */
    1.98 -            if ( unlikely(e->tot_pages++ == 0) )
    1.99 -                get_knownalive_domain(e);
   1.100 -            list_add_tail(&page->list, &e->page_list);
   1.101 -            
   1.102 -        reassign_fail:        
   1.103 -            spin_unlock(&d->page_alloc_lock);
   1.104 -            spin_unlock(&e->page_alloc_lock);
   1.105 -            break;
   1.106              
   1.107          default:
   1.108              MEM_LOG("Invalid extended pt command 0x%x", op.cmd);
     2.1 --- a/xen/include/public/xen.h	Wed Dec 21 18:45:43 2005 +0100
     2.2 +++ b/xen/include/public/xen.h	Wed Dec 21 19:10:53 2005 +0100
     2.3 @@ -145,10 +145,6 @@
     2.4   * cmd: MMUEXT_SET_LDT
     2.5   * linear_addr: Linear address of LDT base (NB. must be page-aligned).
     2.6   * nr_ents: Number of entries in LDT.
     2.7 - * 
     2.8 - * cmd: MMUEXT_REASSIGN_PAGE
     2.9 - * mfn: Machine frame number to be reassigned to the FD.
    2.10 - *      (NB. page must currently belong to the calling domain).
    2.11   */
    2.12  #define MMUEXT_PIN_L1_TABLE      0
    2.13  #define MMUEXT_PIN_L2_TABLE      1
    2.14 @@ -164,14 +160,13 @@
    2.15  #define MMUEXT_INVLPG_ALL       11
    2.16  #define MMUEXT_FLUSH_CACHE      12
    2.17  #define MMUEXT_SET_LDT          13
    2.18 -#define MMUEXT_REASSIGN_PAGE    14
    2.19  #define MMUEXT_NEW_USER_BASEPTR 15
    2.20  
    2.21  #ifndef __ASSEMBLY__
    2.22  struct mmuext_op {
    2.23      unsigned int cmd;
    2.24      union {
    2.25 -        /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR, REASSIGN_PAGE */
    2.26 +        /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */
    2.27          unsigned long mfn;
    2.28          /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
    2.29          unsigned long linear_addr;