WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] confusion about monitor table in shadow mode

To: "'Tim Deegan'" <Tim.Deegan@xxxxxxxxxx>
Subject: [Xen-devel] confusion about monitor table in shadow mode
From: "Li Yaqiong" <liyaq04@xxxxxxxxxx>
Date: Thu, 15 Jan 2009 11:32:14 +0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 14 Jan 2009 19:33:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
Importance: Normal
In-reply-to: <20090112124730.GE22263@xxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi,Tim
        I have confusion when understanding monitor table in shadow
mode. In arch/x86/mm/shadow/mutli.c, the definition of
sh_make_monitor_table is following:
        #if SHADOW_PAGING_LEVELS == GUEST_PAGING_LEVELS
        mfn_t
        sh_make_monitor_table(struct vcpu *v)
        {
        .......
        }
The macro SHADOW_PAGING_LEVELS is defined in arch/x86/mm/shadow/types.h:
        #if GUEST_PAGING_LEVELS == 4
        #define SHADOW_PAGING_LEVELS 4
        #else
        #define SHADOW_PAGING_LEVELS 3
        #endif
If a 32-bit hvm is created, its GUEST_PAGING_LEVELS should be 2. In this
case, SHADOW_PAGING_LEVELS will be 3 and sh_make_monitor_table will not
be compiled. Is it correct? But, when a hvm domain is initialized, Xen
will call sh_update_paging_modes to create a monitor table for it:
In sh_update_paging_modes:
        #ifdef __x86_64__
            if ( hvm_long_mode_enabled(v) )
            {
                // long mode guest...
                v->arch.paging.mode =
                    &SHADOW_INTERNAL_NAME(sh_paging_mode, 4);
            }
            else
        #endif
                if ( hvm_pae_enabled(v) )
                {
                    // 32-bit PAE mode guest...
                    v->arch.paging.mode =
                        &SHADOW_INTERNAL_NAME(sh_paging_mode, 3);
                }
                else
                {
                    // 32-bit 2 level guest...
                    v->arch.paging.mode =
                        &SHADOW_INTERNAL_NAME(sh_paging_mode, 2);
                }
        }

        if ( pagetable_is_null(v->arch.monitor_table) )
        {
            mfn_t mmfn =
v->arch.paging.mode->shadow.make_monitor_table(v);
            v->arch.monitor_table = pagetable_from_mfn(mmfn);
            make_cr3(v, mfn_x(mmfn));
            hvm_update_host_cr3(v);
        }
This function will finally be called by hvm_domain_initialise. But
sh_make_monitor_table is NULL-poinitor. What will happened in this case?

Need your help!

-Techie



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>