On Mon, Aug 4, 2014 at 5:31 PM, Wanpeng Li <wanpeng.li@xxxxxxxxxxxxxxx> wrote: > Hi David, > On Mon, Aug 04, 2014 at 02:10:20PM -0700, David Matlack wrote: >>The following events can lead to an incorrect KVM_EXIT_MMIO bubbling >>up to userspace: >> >>(1) Guest accesses gpa X without a memory slot. The gfn is cached in >>struct kvm_vcpu_arch (mmio_gfn). On Intel EPT-enabled hosts, KVM sets >>the SPTE write-execute-noread so that future accesses cause >>EPT_MISCONFIGs. >> >>(2) Host userspace creates a memory slot via KVM_SET_USER_MEMORY_REGION >>covering the page just accessed. >> > > One question: > > Who trigger host userspace creates a mmio memslot? It will be created > just after first mmio #PF? Devices such as vga can be in modes where their memory behaves like ram and using a memslot to back the memory makes sense. In other modes, reading and writing to vga memory has side-effects and so mmio makes sense (delete memslot). Switching between these modes is a guest initiated event. -- 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