亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? multi.c

?? xen 3.2.2 源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/****************************************************************************** * arch/x86/mm/shadow/multi.c * * Simple, mostly-synchronous shadow page tables.  * Parts of this code are Copyright (c) 2006 by XenSource Inc. * Parts of this code are Copyright (c) 2006 by Michael A Fetterman * Parts based on earlier work by Michael A Fetterman, Ian Pratt et al. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */#include <xen/config.h>#include <xen/types.h>#include <xen/mm.h>#include <xen/trace.h>#include <xen/sched.h>#include <xen/perfc.h>#include <xen/domain_page.h>#include <asm/page.h>#include <asm/current.h>#include <asm/shadow.h>#include <asm/flushtlb.h>#include <asm/hvm/hvm.h>#include <asm/hvm/cacheattr.h>#include <asm/mtrr.h>#include "private.h"#include "types.h"/* THINGS TO DO LATER: *  * TEARDOWN HEURISTICS * Also: have a heuristic for when to destroy a previous paging-mode's  * shadows.  When a guest is done with its start-of-day 32-bit tables * and reuses the memory we want to drop those shadows.  Start with  * shadows in a page in two modes as a hint, but beware of clever tricks  * like reusing a pagetable for both PAE and 64-bit during boot... * * PAE LINEAR MAPS * Rework shadow_get_l*e() to have the option of using map_domain_page() * instead of linear maps.  Add appropriate unmap_l*e calls in the users.  * Then we can test the speed difference made by linear maps.  If the  * map_domain_page() version is OK on PAE, we could maybe allow a lightweight  * l3-and-l2h-only shadow mode for PAE PV guests that would allow them  * to share l2h pages again.  * * GUEST_WALK_TABLES TLB FLUSH COALESCE * guest_walk_tables can do up to three remote TLB flushes as it walks to * the first l1 of a new pagetable.  Should coalesce the flushes to the end,  * and if we do flush, re-do the walk.  If anything has changed, then  * pause all the other vcpus and do the walk *again*. * * PSE disabled / PSE36 * We don't support any modes other than PSE enabled, PSE36 disabled. * Neither of those would be hard to change, but we'd need to be able to  * deal with shadows made in one mode and used in another. */#define FETCH_TYPE_PREFETCH 1#define FETCH_TYPE_DEMAND   2#define FETCH_TYPE_WRITE    4typedef enum {    ft_prefetch     = FETCH_TYPE_PREFETCH,    ft_demand_read  = FETCH_TYPE_DEMAND,    ft_demand_write = FETCH_TYPE_DEMAND | FETCH_TYPE_WRITE,} fetch_type_t;#ifdef DEBUG_TRACE_DUMPstatic char *fetch_type_names[] = {    [ft_prefetch]     "prefetch",    [ft_demand_read]  "demand read",    [ft_demand_write] "demand write",};#endif/**************************************************************************//* Hash table mapping from guest pagetables to shadows * * Normal case: maps the mfn of a guest page to the mfn of its shadow page. * FL1's:       maps the *gfn* of the start of a superpage to the mfn of a *              shadow L1 which maps its "splinters". */static inline mfn_t get_fl1_shadow_status(struct vcpu *v, gfn_t gfn)/* Look for FL1 shadows in the hash table */{    mfn_t smfn = shadow_hash_lookup(v, gfn_x(gfn), SH_type_fl1_shadow);    return smfn;}static inline mfn_t get_shadow_status(struct vcpu *v, mfn_t gmfn, u32 shadow_type)/* Look for shadows in the hash table */{    mfn_t smfn = shadow_hash_lookup(v, mfn_x(gmfn), shadow_type);    perfc_incr(shadow_get_shadow_status);    return smfn;}static inline void set_fl1_shadow_status(struct vcpu *v, gfn_t gfn, mfn_t smfn)/* Put an FL1 shadow into the hash table */{    SHADOW_PRINTK("gfn=%"SH_PRI_gfn", type=%08x, smfn=%05lx\n",                   gfn_x(gfn), SH_type_fl1_shadow, mfn_x(smfn));    shadow_hash_insert(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);}static inline void set_shadow_status(struct vcpu *v, mfn_t gmfn, u32 shadow_type, mfn_t smfn)/* Put a shadow into the hash table */{    struct domain *d = v->domain;    int res;    SHADOW_PRINTK("d=%d, v=%d, gmfn=%05lx, type=%08x, smfn=%05lx\n",                   d->domain_id, v->vcpu_id, mfn_x(gmfn),                   shadow_type, mfn_x(smfn));    /* 32-on-64 PV guests don't own their l4 pages so can't get_page them */    if ( !is_pv_32on64_vcpu(v) || shadow_type != SH_type_l4_64_shadow )    {        res = get_page(mfn_to_page(gmfn), d);        ASSERT(res == 1);    }    shadow_hash_insert(v, mfn_x(gmfn), shadow_type, smfn);}static inline void delete_fl1_shadow_status(struct vcpu *v, gfn_t gfn, mfn_t smfn)/* Remove a shadow from the hash table */{    SHADOW_PRINTK("gfn=%"SH_PRI_gfn", type=%08x, smfn=%05lx\n",                   gfn_x(gfn), SH_type_fl1_shadow, mfn_x(smfn));    shadow_hash_delete(v, gfn_x(gfn), SH_type_fl1_shadow, smfn);}static inline void delete_shadow_status(struct vcpu *v, mfn_t gmfn, u32 shadow_type, mfn_t smfn)/* Remove a shadow from the hash table */{    SHADOW_PRINTK("d=%d, v=%d, gmfn=%05lx, type=%08x, smfn=%05lx\n",                   v->domain->domain_id, v->vcpu_id,                   mfn_x(gmfn), shadow_type, mfn_x(smfn));    shadow_hash_delete(v, mfn_x(gmfn), shadow_type, smfn);    /* 32-on-64 PV guests don't own their l4 pages; see set_shadow_status */    if ( !is_pv_32on64_vcpu(v) || shadow_type != SH_type_l4_64_shadow )        put_page(mfn_to_page(gmfn));}/**************************************************************************//* CPU feature support querying */static inline intguest_supports_superpages(struct vcpu *v){    /* The _PAGE_PSE bit must be honoured in HVM guests, whenever     * CR4.PSE is set or the guest is in PAE or long mode.      * It's also used in the dummy PT for vcpus with CR4.PG cleared. */    return (is_hvm_vcpu(v) &&             (GUEST_PAGING_LEVELS != 2              || !hvm_paging_enabled(v)             || (v->arch.hvm_vcpu.guest_cr[4] & X86_CR4_PSE)));}static inline intguest_supports_nx(struct vcpu *v){    if ( GUEST_PAGING_LEVELS == 2 || !cpu_has_nx )        return 0;    if ( !is_hvm_vcpu(v) )        return cpu_has_nx;    return hvm_nx_enabled(v);}/**************************************************************************//* Functions for walking the guest page tables *//* Flags that are needed in a pagetable entry, with the sense of NX inverted */static uint32_t mandatory_flags(struct vcpu *v, uint32_t pfec) {    static uint32_t flags[] = {        /* I/F -  Usr Wr */        /* 0   0   0   0 */ _PAGE_PRESENT,         /* 0   0   0   1 */ _PAGE_PRESENT|_PAGE_RW,        /* 0   0   1   0 */ _PAGE_PRESENT|_PAGE_USER,        /* 0   0   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER,        /* 0   1   0   0 */ _PAGE_PRESENT,         /* 0   1   0   1 */ _PAGE_PRESENT|_PAGE_RW,        /* 0   1   1   0 */ _PAGE_PRESENT|_PAGE_USER,        /* 0   1   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER,        /* 1   0   0   0 */ _PAGE_PRESENT|_PAGE_NX_BIT,         /* 1   0   0   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_NX_BIT,        /* 1   0   1   0 */ _PAGE_PRESENT|_PAGE_USER|_PAGE_NX_BIT,        /* 1   0   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_NX_BIT,        /* 1   1   0   0 */ _PAGE_PRESENT|_PAGE_NX_BIT,         /* 1   1   0   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_NX_BIT,        /* 1   1   1   0 */ _PAGE_PRESENT|_PAGE_USER|_PAGE_NX_BIT,        /* 1   1   1   1 */ _PAGE_PRESENT|_PAGE_RW|_PAGE_USER|_PAGE_NX_BIT,    };    /* Don't demand not-NX if the CPU wouldn't enforce it. */    if ( !guest_supports_nx(v) )        pfec &= ~PFEC_insn_fetch;    /* Don't demand R/W if the CPU wouldn't enforce it. */    if ( is_hvm_vcpu(v) && unlikely(!hvm_wp_enabled(v))          && !(pfec & PFEC_user_mode) )        pfec &= ~PFEC_write_access;    return flags[(pfec & 0x1f) >> 1];}/* Modify a guest pagetable entry to set the Accessed and Dirty bits. * Returns non-zero if it actually writes to guest memory. */static uint32_t set_ad_bits(void *guest_p, void *walk_p, int set_dirty){    guest_intpte_t old, new;    old = *(guest_intpte_t *)walk_p;    new = old | _PAGE_ACCESSED | (set_dirty ? _PAGE_DIRTY : 0);    if ( old != new )     {        /* Write the new entry into the walk, and try to write it back         * into the guest table as well.  If the guest table has changed         * under out feet then leave it alone. */        *(guest_intpte_t *)walk_p = new;        if ( cmpxchg(((guest_intpte_t *)guest_p), old, new) == old )             return 1;    }    return 0;}/* Walk the guest pagetables, after the manner of a hardware walker.  * * Inputs: a vcpu, a virtual address, a walk_t to fill, a  *         pointer to a pagefault code, and a flag "shadow_op". *  * We walk the vcpu's guest pagetables, filling the walk_t with what we * see and adding any Accessed and Dirty bits that are needed in the * guest entries.  Using the pagefault code, we check the permissions as * we go.  For the purposes of reading pagetables we treat all non-RAM * memory as contining zeroes. *  * If "shadow_op" is non-zero, we are serving a genuine guest memory access,  * and must (a) be under the shadow lock, and (b) remove write access * from any guest PT pages we see, as we will be shadowing them soon * and will rely on the contents' not having changed. *  * Returns 0 for success, or the set of permission bits that we failed on  * if the walk did not complete. * N.B. This is different from the old return code but almost no callers * checked the old return code anyway. */static uint32_tguest_walk_tables(struct vcpu *v, unsigned long va, walk_t *gw,                   uint32_t pfec, int shadow_op){    struct domain *d = v->domain;    p2m_type_t p2mt;    guest_l1e_t *l1p = NULL;    guest_l2e_t *l2p = NULL;#if GUEST_PAGING_LEVELS >= 4 /* 64-bit only... */    guest_l3e_t *l3p = NULL;    guest_l4e_t *l4p;#endif    uint32_t gflags, mflags, rc = 0;    int pse;    ASSERT(!shadow_op || shadow_locked_by_me(d));        perfc_incr(shadow_guest_walk);    memset(gw, 0, sizeof(*gw));    gw->va = va;    /* Mandatory bits that must be set in every entry.  We invert NX, to     * calculate as if there were an "X" bit that allowed access.      * We will accumulate, in rc, the set of flags that are missing. */    mflags = mandatory_flags(v, pfec);#if GUEST_PAGING_LEVELS >= 3 /* PAE or 64... */#if GUEST_PAGING_LEVELS >= 4 /* 64-bit only... */    /* Get the l4e from the top level table and check its flags*/    gw->l4mfn = pagetable_get_mfn(v->arch.guest_table);    l4p = ((guest_l4e_t *)v->arch.paging.shadow.guest_vtable);    gw->l4e = l4p[guest_l4_table_offset(va)];    gflags = guest_l4e_get_flags(gw->l4e) ^ _PAGE_NX_BIT;    rc |= ((gflags & mflags) ^ mflags);    if ( rc & _PAGE_PRESENT ) goto out;    /* Map the l3 table */    gw->l3mfn = gfn_to_mfn(d, guest_l4e_get_gfn(gw->l4e), &p2mt);    if ( !p2m_is_ram(p2mt) )     {        rc |= _PAGE_PRESENT;        goto out;    }    ASSERT(mfn_valid(gw->l3mfn));    /* This mfn is a pagetable: make sure the guest can't write to it. */    if ( shadow_op && sh_remove_write_access(v, gw->l3mfn, 3, va) != 0 )        flush_tlb_mask(d->domain_dirty_cpumask);     /* Get the l3e and check its flags*/    l3p = sh_map_domain_page(gw->l3mfn);    gw->l3e = l3p[guest_l3_table_offset(va)];    gflags = guest_l3e_get_flags(gw->l3e) ^ _PAGE_NX_BIT;    rc |= ((gflags & mflags) ^ mflags);    if ( rc & _PAGE_PRESENT )        goto out;#else /* PAE only... */    /* Get l3e from the cache of the top level table and check its flag */    gw->l3e = v->arch.paging.shadow.gl3e[guest_l3_table_offset(va)];    if ( !(guest_l3e_get_flags(gw->l3e) & _PAGE_PRESENT) )     {        rc |= _PAGE_PRESENT;        goto out;    }#endif /* PAE or 64... */    /* Map the l2 table */    gw->l2mfn = gfn_to_mfn(d, guest_l3e_get_gfn(gw->l3e), &p2mt);    if ( !p2m_is_ram(p2mt) )    {        rc |= _PAGE_PRESENT;        goto out;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线小视频| 国产婷婷精品av在线| 欧美一区二区视频网站| 国产亚洲短视频| 午夜私人影院久久久久| 高清在线成人网| 欧美一个色资源| 亚洲欧美一区二区三区孕妇| 久久成人久久爱| 欧美日韩中文国产| 亚洲欧美激情小说另类| 国产成人亚洲综合a∨婷婷 | 欧美精选午夜久久久乱码6080| 久久只精品国产| 琪琪久久久久日韩精品| 日本韩国欧美三级| 中文字幕一区二区三区不卡| 国产一区二区调教| 777a∨成人精品桃花网| 亚洲综合一区二区三区| 97精品电影院| 中文字幕二三区不卡| 久久国产精品72免费观看| 欧美高清一级片在线| 亚洲国产色一区| 日本精品视频一区二区| 国产精品美女久久久久久久久| 国产精品主播直播| 2019国产精品| 国产伦精一区二区三区| 精品欧美乱码久久久久久 | 亚洲国产一区二区视频| 一本一本久久a久久精品综合麻豆| 欧美激情一区二区三区四区| 国产伦精品一区二区三区在线观看| 精品国产制服丝袜高跟| 麻豆精品在线播放| 欧美成人性福生活免费看| 久久精品国产成人一区二区三区| 欧美一区二区三区在线观看| 欧美aaaaaa午夜精品| 欧美成人一级视频| 国产高清一区日本| 国产精品久久福利| 91蝌蚪porny成人天涯| 一区二区三区在线看| 欧美日韩五月天| 日本伊人色综合网| 久久久综合网站| 成人高清免费在线播放| 日韩理论在线观看| 欧美日韩亚洲另类| 国产成人啪免费观看软件| 国产精品人人做人人爽人人添| 成人动漫中文字幕| 一区二区成人在线观看| 制服.丝袜.亚洲.中文.综合| 韩国v欧美v日本v亚洲v| 国产精品色哟哟网站| 日本精品裸体写真集在线观看 | 亚洲美女在线一区| 欧美人与禽zozo性伦| 久久超碰97中文字幕| 中文字幕亚洲欧美在线不卡| 欧美三级日韩在线| 激情综合亚洲精品| 亚洲欧美激情视频在线观看一区二区三区 | 亚洲国产精品一区二区久久恐怖片 | 91国产成人在线| 免费看欧美美女黄的网站| 欧美国产1区2区| 538prom精品视频线放| 国产99久久久国产精品潘金| 亚洲国产一区在线观看| 欧美激情一区二区三区蜜桃视频| 欧美精品乱码久久久久久按摩| 国产河南妇女毛片精品久久久| 亚洲大型综合色站| 国产亚洲欧美色| 日韩一区二区三区在线| 91蝌蚪porny| 国产盗摄一区二区三区| 日日噜噜夜夜狠狠视频欧美人| 国产偷v国产偷v亚洲高清 | 男女男精品视频| 综合中文字幕亚洲| 欧美精品 国产精品| 国产精品一二三四| 亚洲国产aⅴ成人精品无吗| 亚洲精品在线免费观看视频| 久久精品国产一区二区三| 中文字幕一区视频| 精品少妇一区二区三区免费观看| 美女视频黄免费的久久| 亚洲毛片av在线| 国产欧美一区二区三区鸳鸯浴| 成人天堂资源www在线| 精品在线视频一区| 一区二区三区四区av| 久久综合久久久久88| 欧美无砖砖区免费| 成人app在线观看| 激情六月婷婷综合| 日韩av高清在线观看| 亚洲乱码一区二区三区在线观看| 日韩欧美中文一区| 欧美三级视频在线播放| 色综合天天综合网天天看片| 国产麻豆精品久久一二三| 亚洲gay无套男同| 亚洲欧美二区三区| 欧美国产精品v| 久久你懂得1024| 日韩一区二区三区免费看 | 欧美色精品在线视频| gogo大胆日本视频一区| 国产揄拍国内精品对白| 婷婷综合久久一区二区三区| 亚洲品质自拍视频| 亚洲欧美一区二区三区极速播放| 2017欧美狠狠色| 久久久五月婷婷| 久久奇米777| 久久综合色鬼综合色| 日韩午夜激情av| 91丨porny丨在线| 大桥未久av一区二区三区中文| 激情丁香综合五月| 久久国产夜色精品鲁鲁99| 久久成人综合网| 久久电影网站中文字幕| 久久99久久99小草精品免视看| 五月综合激情日本mⅴ| 婷婷开心激情综合| 午夜影院在线观看欧美| 午夜激情久久久| 污片在线观看一区二区| 日本欧美大码aⅴ在线播放| ...xxx性欧美| 日本不卡一区二区| 久久精品国产精品亚洲精品 | 国产亚洲美州欧州综合国| 欧美日韩黄色一区二区| 亚洲精品一区二区三区香蕉 | 欧美美女一区二区在线观看| 在线观看视频一区二区| 91精品国产欧美一区二区18| 日韩视频在线永久播放| 中文字幕一区不卡| 一区二区三区精品视频| 亚洲h动漫在线| 免费在线观看一区| 国产老女人精品毛片久久| 成人动漫一区二区在线| 欧美日韩精品综合在线| 日韩一区二区电影在线| 亚洲欧美日韩国产手机在线| 亚洲国产精品久久不卡毛片| 蜜桃av一区二区| 成人激情动漫在线观看| 欧美影视一区二区三区| 欧美日韩国产免费一区二区 | 国产亚洲短视频| 亚洲柠檬福利资源导航| 美女任你摸久久| 成人av片在线观看| 91精选在线观看| 日本一区二区电影| 五月综合激情网| 国产1区2区3区精品美女| 在线看国产日韩| 欧美一区二区私人影院日本| 国产嫩草影院久久久久| 午夜欧美大尺度福利影院在线看| 亚洲电影你懂得| 色婷婷综合久色| 久久久精品2019中文字幕之3| 亚洲乱码一区二区三区在线观看| 狠狠色丁香久久婷婷综| 欧洲亚洲国产日韩| 久久伊人中文字幕| 亚洲国产欧美在线| 不卡区在线中文字幕| 正在播放亚洲一区| 日韩毛片精品高清免费| 一区二区三区鲁丝不卡| 91首页免费视频| 久久精品人人做人人爽97| 亚洲国产日产av| 色偷偷成人一区二区三区91| 国产偷国产偷精品高清尤物| 国产一区二区在线看| 欧美日韩免费在线视频| 亚洲视频免费在线观看| 国产高清精品久久久久| 欧美一区二区性放荡片| 亚洲国产精品久久久久婷婷884| 成人av在线电影| 国产精品三级av在线播放| 开心九九激情九九欧美日韩精美视频电影 |