ia64/xen-unstable

changeset 7097:7e9ec4b2cc3c

imported patch ../tmp/fix_free_monitor_pagetable.patch
author kaf24@firebug.cl.cam.ac.uk
date Wed Sep 28 14:07:25 2005 +0100 (2005-09-28)
parents 5fb211049b3f
children 8204a2d6cd55
files xen/arch/x86/shadow32.c xen/arch/x86/shadow_public.c
line diff
     1.1 --- a/xen/arch/x86/shadow32.c	Wed Sep 28 14:06:41 2005 +0100
     1.2 +++ b/xen/arch/x86/shadow32.c	Wed Sep 28 14:07:25 2005 +0100
     1.3 @@ -755,9 +755,13 @@ void free_monitor_pagetable(struct vcpu 
     1.4  
     1.5      /*
     1.6       * Then free monitor_table.
     1.7 +     * Note: for VMX guest, only BSP need do this free.
     1.8       */
     1.9 -    mfn = pagetable_get_pfn(v->arch.monitor_table);
    1.10 -    free_domheap_page(&frame_table[mfn]);
    1.11 +    if (!(VMX_DOMAIN(v) && v->vcpu_id)) {
    1.12 +        mfn = pagetable_get_pfn(v->arch.monitor_table);
    1.13 +        unmap_domain_page(v->arch.monitor_vtable);
    1.14 +        free_domheap_page(&frame_table[mfn]);
    1.15 +    }
    1.16  
    1.17      v->arch.monitor_table = mk_pagetable(0);
    1.18      v->arch.monitor_vtable = 0;
     2.1 --- a/xen/arch/x86/shadow_public.c	Wed Sep 28 14:06:41 2005 +0100
     2.2 +++ b/xen/arch/x86/shadow_public.c	Wed Sep 28 14:07:25 2005 +0100
     2.3 @@ -256,14 +256,16 @@ void free_monitor_pagetable(struct vcpu 
     2.4  {
     2.5      unsigned long mfn;
     2.6  
     2.7 -//    ASSERT( pagetable_val(v->arch.monitor_table) );
     2.8 +    ASSERT( pagetable_val(v->arch.monitor_table) );
     2.9      /*
    2.10       * free monitor_table.
    2.11 +     * Note: for VMX guest, only BSP need do this free.
    2.12       */
    2.13 -    //mfn = (pagetable_val(v->arch.monitor_table)) >> PAGE_SHIFT;
    2.14 -    mfn = pagetable_get_pfn(v->arch.monitor_table);
    2.15 -    unmap_domain_page(v->arch.monitor_vtable);
    2.16 -    free_domheap_page(&frame_table[mfn]);
    2.17 +    if (!(VMX_DOMAIN(v) && v->vcpu_id)) {
    2.18 +        mfn = pagetable_get_pfn(v->arch.monitor_table);
    2.19 +        unmap_domain_page(v->arch.monitor_vtable);
    2.20 +        free_domheap_page(&frame_table[mfn]);
    2.21 +    }
    2.22      v->arch.monitor_table = mk_pagetable(0);
    2.23      v->arch.monitor_vtable = 0;
    2.24  }
    2.25 @@ -358,9 +360,13 @@ void free_monitor_pagetable(struct vcpu 
    2.26  
    2.27      /*
    2.28       * Then free monitor_table.
    2.29 +     * Note: for VMX guest, only BSP need do this free.
    2.30       */
    2.31 -    mfn = pagetable_get_pfn(v->arch.monitor_table);
    2.32 -    free_domheap_page(&frame_table[mfn]);
    2.33 +    if (!(VMX_DOMAIN(v) && v->vcpu_id)) {
    2.34 +        mfn = pagetable_get_pfn(v->arch.monitor_table);
    2.35 +        unmap_domain_page(v->arch.monitor_vtable);
    2.36 +        free_domheap_page(&frame_table[mfn]);
    2.37 +    }
    2.38  
    2.39      v->arch.monitor_table = mk_pagetable(0);
    2.40      v->arch.monitor_vtable = 0;