Re: [PATCH 6/7] KVM: MMU: Simplify spte fetch() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/12/2010 08:08 AM, Xiao Guangrong wrote:

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'


That is true (and this is a change from the current code), but level < gw->level will be very rare (1G pages backed by 4k pages) so I don't mind the extra check.



--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux