KVM: MMU: mark page dirty in make_spte
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 Sep 2021 08:52:23 +0000 (04:52 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 1 Oct 2021 07:44:53 +0000 (03:44 -0400)
commitbcc4f2bc5026633198c0f8b7dd8b0e5e15de5c9d
treef3bd16275a0f3adda8cd1f7ce37fe1764dd06c0c
parent68be1306caea8948738cab04014ca4506b590d38
KVM: MMU: mark page dirty in make_spte

This simplifies set_spte, which we want to remove, and unifies code
between the shadow MMU and the TDP MMU.  The warning will be added
back later to make_spte as well.

There is a small disadvantage in the TDP MMU; it may unnecessarily mark
a page as dirty twice if two vCPUs end up mapping the same page twice.
However, this is a very small cost for a case that is already rare.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/spte.c
arch/x86/kvm/mmu/tdp_mmu.c