Skip to contentSkip to conversation

what's the purpose of line page table (PML4 entry 258)

DISCUSSION weiming 1 participant 1 message Mar 31, 2008

lore
Share & tools
lore

weiming

author
#0 lore raw

Hi,

When I read the code of do_update_va_mapping, I find that it update the pte entry in the line page table by looking up the line page table via guest_map_l1e() :

2998 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L2998>
int do_update_va_mapping
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=do_update_va_mapping>(unsigned
long va, u64 <http://lxr.xensource.com/lxr/ident?a=x86_64;i=u64>
val64,
2999 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L2999>
unsigned long flags
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=flags>)
3000 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3000> { 3001 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3001>
l1_pgentry_t
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=l1_pgentry_t> val
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=val> = l1e_from_intpte
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=l1e_from_intpte>(val64);
3002 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3002>

    struct vcpu <http://lxr.xensource.com/lxr/ident?a=x86_64;i=vcpu>

*v <http://lxr.xensource.com/lxr/ident?a=x86_64;i=v> = current
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=current>;
3003 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3003>
struct domain
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=domain> *d = v
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=v>->domain
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=domain>;
3004 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3004>
l1_pgentry_t
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=l1_pgentry_t> *pl1e; 3005 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3005>

    unsigned long  vmask, bmap_ptr, gl1mfn;
3006 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3006>
    cpumask_t <http://lxr.xensource.com/lxr/ident?a=x86_64;i=cpumask_t>
     pmask;

3007 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3007>
int rc
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=rc> = 0;
3008 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3008>
3009 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3009>

    perfc_incr <http://lxr.xensource.com/lxr/ident?a=x86_64;i=perfc_incr>(calls_to_update_va);

3010 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3010>
3011 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3011>
if ( unlikely
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=unlikely>(!__addr_ok
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=__addr_ok>(va) && !paging_mode_external
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=paging_mode_external>(d))
)
3012 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3012>
return -EINVAL
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=EINVAL>;
3013 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3013>
3014 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3014>

    rc <http://lxr.xensource.com/lxr/ident?a=x86_64;i=rc> =

xsm_update_va_mapping
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=xsm_update_va_mapping>(current
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=current>->domain
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=domain>, val
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=val>);
3015 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3015>

    if ( rc <http://lxr.xensource.com/lxr/ident?a=x86_64;i=rc> )
3016 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3016>
        return rc <http://lxr.xensource.com/lxr/ident?a=x86_64;i=rc>;

3017 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3017>
3018 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3018>
LOCK_BIGLOCK
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=LOCK_BIGLOCK>(d);
3019 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3019>
3020 <http://lxr.xensource.com/lxr/source/xen/arch/x86/mm.c?a=x86_64#L3020>
pl1e = guest_map_l1e
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=guest_map_l1e>(v
<http://lxr.xensource.com/lxr/ident?a=x86_64;i=v>, va, &gl1mfn);
...
...

what's the purpose of this table?

Thanks

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel