Avi Kivity wrote:
> - if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep)
> - && level == gw->level)
> - validate_direct_spte(vcpu, sptep, direct_access);
......
> + link_shadow_page(sptep, sp);
> + }
> +
> + for (;
> + shadow_walk_okay(&iterator) && iterator.level > hlevel;
> + shadow_walk_next(&iterator)) {
> + gfn_t direct_gfn;
> +
> + level = iterator.level;
> + sptep = iterator.sptep;
>
> drop_spte_if_large(vcpu, sptep);
>
> if (is_shadow_present_pte(*sptep))
> continue;
>
> - if (level <= gw->level) {
> - direct = 1;
> - access = direct_access;
> -
> - /*
> - * It is a large guest pages backed by small host pages,
> - * So we set @direct(@sp->role.direct)=1, and set
> - * @table_gfn(@sp->gfn)=the base page frame for linear
> - * translations.
> - */
> - table_gfn = gw->gfn & ~(KVM_PAGES_PER_HPAGE(level) - 1);
> - } else {
> - direct = 0;
> - table_gfn = gw->table_gfn[level - 2];
> - }
> - sp = kvm_mmu_get_page(vcpu, table_gfn, addr, level-1,
> - direct, access, sptep);
> - if (!direct)
> - if (!FNAME(validate_indirect_spte)(vcpu, sptep, sp,
> - gw, level)) {
> - kvm_release_pfn_clean(pfn);
> - sptep = NULL;
> - break;
> - }
> + validate_direct_spte(vcpu, sptep, direct_access);
Need validate_direct_spte() only when 'level == gw->level'
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html