]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
KVM: x86: Manually flush collapsible SPTEs only when toggling flags
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 11 Sep 2019 19:19:52 +0000 (12:19 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 24 Sep 2019 11:37:25 +0000 (13:37 +0200)
commit319109a2d0dde8672323efcf909740c2c6e98be4
tree1af5583196bc8655f33c9d4d37c1f2a9a100e7b6
parent52200d0d944e473142271773c41f5f490f3a821f
KVM: x86: Manually flush collapsible SPTEs only when toggling flags

Zapping collapsible sptes, a.k.a. 4k sptes that can be promoted into a
large page, is only necessary when changing only the dirty logging flag
of a memory region.  If the memslot is also being moved, then all sptes
for the memslot are zapped when it is invalidated.  When a memslot is
being created, it is impossible for there to be existing dirty mappings,
e.g. KVM can have MMIO sptes, but not present, and thus dirty, sptes.

Note, the comment and logic are shamelessly borrowed from MIPS's version
of kvm_arch_commit_memory_region().

Fixes: 3ea3b7fa9af06 ("kvm: mmu: lazy collapse small sptes into large sptes")
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c