Re: [PATCH 25/54] KVM: x86/mmu: Add helpers to query mmu_role bits

From: Paolo Bonzini
Date: Wed Jun 23 2021 - 16:53:10 EST


On 23/06/21 22:47, Sean Christopherson wrote:
What do you think about calling these is_mmu_##name? The point of having
these helpers is that the register doesn't count, and they return the
effective value (e.g. false in most EPT cases).

I strongly prefer to keep <reg> in the name, both to match the mmu_role bits and
to make it a bit more clear that it's reflective (modified) register state, as
opposed to PTEs or even something else entirely. E.g. I always struggled to
remember the purpose of mmu->nx flag.

No problem. I do disagree that it's register state ("modified" seems to be more than a parenthetical remark), but not enough to argue about it and even less to do the work to rename the accessors.

Paolo