]> git.hungrycats.org Git - linux/commit
KVM: x86/mmu: rename and clarify BYTE_MASK
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Apr 2026 15:41:57 +0000 (11:41 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 1 May 2026 04:08:07 +0000 (00:08 -0400)
commit296b29597db1cf96b955da0f1bcb34d2759dd9d7
treee851a5ffc90acf74456ab60a1d4f60edd5d26d77
parent0c768fa0aeb882fb5fbe75f4dcf0eb6ed23b9e8b
KVM: x86/mmu: rename and clarify BYTE_MASK

The BYTE_MASK macro is the central point of the black magic
in update_permission_bitmask().  Rename it to something
that relates to how it is used, and add a comment explaining
how it works.

Using shifts instead of powers of two was actually suggested by
David Hildenbrand back in 2017 for clarity[1] but I evidently
forgot his suggestion when applying to kvm.git.

[1] https://lore.kernel.org/kvm/e4b5df86-31ae-2f4e-0666-393753e256df@redhat.com/

Tested-by: David Riley <d.riley@proxmox.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c