Re: [PATCH v3 2/8] KVM: Integrate gfn_to_memslot_approx() into search_memslots()

From: Paolo Bonzini
Date: Thu Jun 10 2021 - 12:17:42 EST


On 19/05/21 23:24, Sean Christopherson wrote:
An alternative to modifying the PPC code would be to make the existing
search_memslots() a wrapper to __search_memslots(), with the latter taking
@approx.

Let's just modify PPC to use __gfn_to_memslot instead of search_memslots().

__gfn_to_memslot() has never introduced any functionality over search_memslots(), ever since search_memslots() was introduced in 2011.

Paolo

We might also want to make this __always_inline to improve the likelihood of the
compiler optimizing away @approx. I doubt it matters in practice...