On Thu, Jun 19, 2014 at 10:21:16AM +0300, Gleb Natapov wrote: > On Wed, Jun 18, 2014 at 08:12:05PM -0300, mtosatti@xxxxxxxxxx wrote: > > Allow vcpus to pin spte translations by: > > > > 1) Creating a per-vcpu list of pinned ranges. > What if memory slot containing pinned range is going away? ->page_fault() should fail and guest abort. Will double check. > > 2) On mmu reload request: > > - Fault ranges. > > - Mark sptes with a pinned bit. > Should also be marked "dirty" as per SDM: > The three DS save area sections should be allocated from a non-paged pool, and marked accessed and dirty This (SDM text) is about guest pagetable AFAICS. > > + mutex_unlock(&vcpu->arch.pinned_mmu_mutex); > > + > > + if (vcpu->arch.nr_pinned_ranges >= > > + KVM_MAX_PER_VCPU_PINNED_RANGE) > > + return -ENOSPC; > Shouldn't we refuse to register pinned range if !TDP? Sure. > > + /* MMU notifier sequence window: retry */ > > + if (!r && !pinned) > > + kvm_make_request(KVM_REQ_MMU_RELOAD, vcpu); > > + if (r) { > > + kvm_make_request(KVM_REQ_TRIPLE_FAULT, vcpu); > I do not think triple fault is appropriate here. The reasons for triple fault are > documented in SDM and this is not one of them. What about error exit to user space? Agree, will change. -- 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