+ if (range && kvm_available_flush_tlb_with_range()) {This seems wrong. It seems the intention of this function is to flush TLB for
+ /* Callback should flush both private GFN and shared GFN. */
+ range->start_gfn = kvm_gfn_unalias(kvm, range->start_gfn);
all aliases for a given GFN range. Here it seems you are unconditionally change
to range to always exclude the stolen bits.
- gfn = gpte_to_gfn(gpte);
+ gfn = gpte_to_gfn(vcpu, gpte);
pte_access = sp->role.access;
pte_access &= FNAME(gpte_access)(gpte);
FNAME(protect_clean_gpte)(vcpu->arch.mmu, &pte_access, gpte);
In commit message you mentioned "Don't support stolen bits for shadow EPT" (you
actually mean shadow MMU I suppose), yet there's bunch of code change to shadow
MMU.