ia64/xen-unstable

changeset 10473:7713276d159e

[XEN] Multi-processor guests need to be more conservative when
doing batched writable-pagetable work.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sun Jun 18 19:44:13 2006 +0100 (2006-06-18)
parents e23961a8ce7e
children 8eab9f3cdb1a
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Sun Jun 18 19:24:00 2006 +0100
     1.2 +++ b/xen/arch/x86/mm.c	Sun Jun 18 19:44:13 2006 +0100
     1.3 @@ -3565,17 +3565,27 @@ int ptwr_do_page_fault(struct domain *d,
     1.4      }
     1.5  
     1.6      /*
     1.7 -     * If this is a multi-processor guest then ensure that the page is hooked
     1.8 -     * into at most one L2 table, which must be the one running on this VCPU.
     1.9 +     * Multi-processor guest? Then ensure that the page table is hooked into
    1.10 +     * at most one L2, and also ensure that there is only one mapping of the
    1.11 +     * page table itself (or there can be conflicting writable mappings from
    1.12 +     * other VCPUs).
    1.13       */
    1.14 -    if ( (d->vcpu[0]->next_in_list != NULL) &&
    1.15 -         ((page->u.inuse.type_info & PGT_count_mask) != 
    1.16 -          (!!(page->u.inuse.type_info & PGT_pinned) +
    1.17 -           (which == PTWR_PT_ACTIVE))) )
    1.18 +    if ( d->vcpu[0]->next_in_list != NULL )
    1.19      {
    1.20 -        /* Could be conflicting writable mappings from other VCPUs. */
    1.21 -        cleanup_writable_pagetable(d);
    1.22 -        goto emulate;
    1.23 +        if ( /* Hooked into at most one L2 table (which this VCPU maps)? */
    1.24 +             ((page->u.inuse.type_info & PGT_count_mask) != 
    1.25 +              (!!(page->u.inuse.type_info & PGT_pinned) +
    1.26 +               (which == PTWR_PT_ACTIVE))) ||
    1.27 +             /* PTEs are mapped read-only in only one place? */
    1.28 +             ((page->count_info & PGC_count_mask) !=
    1.29 +              (!!(page->count_info & PGC_allocated) +       /* alloc count */
    1.30 +               (page->u.inuse.type_info & PGT_count_mask) + /* type count  */
    1.31 +               1)) )                                        /* map count   */
    1.32 +        {
    1.33 +            /* Could be conflicting writable mappings from other VCPUs. */
    1.34 +            cleanup_writable_pagetable(d);
    1.35 +            goto emulate;
    1.36 +        }
    1.37      }
    1.38  
    1.39      /*