]> www.infradead.org Git - users/hch/block.git/commit
Merge branch 'mm-delete-change-gpte' into HEAD
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 11 Apr 2024 17:06:24 +0000 (13:06 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 12 Apr 2024 08:41:14 +0000 (04:41 -0400)
commit531f5200243242d79e99751e4f8a16592afd121f
treeb892d8ce293bd19e4fe634c2a305a5d041b5ac39
parent9bc60f733839ab6fcdde0d0b15cbb486123e6402
parentf7842747d13d9f4eedba9edec5b834c9d9237717
Merge branch 'mm-delete-change-gpte' into HEAD

The .change_pte() MMU notifier callback was intended as an optimization
and for this reason it was initially called without a surrounding
mmu_notifier_invalidate_range_{start,end}() pair.  It was only ever
implemented by KVM (which was also the original user of MMU notifiers)
and the rules on when to call set_pte_at_notify() rather than set_pte_at()
have always been pretty obscure.

It may seem a miracle that it has never caused any hard to trigger
bugs, but there's a good reason for that: KVM's implementation has
been nonfunctional for a good part of its existence.  Already in
2012, commit 6bdb913f0a70 ("mm: wrap calls to set_pte_at_notify with
invalidate_range_start and invalidate_range_end", 2012-10-09) changed the
.change_pte() callback to occur within an invalidate_range_start/end()
pair; and because KVM unmaps the sPTEs during .invalidate_range_start(),
.change_pte() has no hope of finding a sPTE to change.

Therefore, all the code for .change_pte() can be removed from both KVM
and mm/, and set_pte_at_notify() can be replaced with just set_pte_at().

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>