KVM: x86/mmu: Add macro for hugepage GFN mask
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 8 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | KVM: x86/mmu: Add helper macro for computing hugepage GFN maskarch/ arch/ arch/ +1 more | +5 | 2 replies | |
| 2/3 | KVM: x86/mmu: Open code GFN "rounding" in TDP MMUarch/ | +3 | 1 reply | |
| 3/3 | KVM: x86/mmu: Use hugepage GFN mask to compute GFN offset maskarch/ arch/ arch/ +1 more | +6 | 2 replies |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Ben Gardon |
|---|---|
| 1/3 | R-b |
| 2/3 | R-b |
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/3] KVM: x86/mmu: Add macro for hugepage GFN mask
Add a macro, which is probably long overdue, to replace open coded variants of "~(KVM_PAGES_PER_HPAGE(level) - 1)". The straw that broke the camel's back is the TDP MMU's round_gfn_for_level(), which goes straight for the optimized approach of using NEG instead of SUB+NOT (gcc uses NEG for both). The use of '-(...)' made me do a double take (more like a quadrupal take) when reading the TDP MMU code as my eyes/brain have been heavily trained to look for the more common '~(... - 1)'.
Sean Christopherson (3):
KVM: x86/mmu: Add helper macro for computing hugepage GFN mask
KVM: x86/mmu: Open code GFN "rounding" in TDP MMU
KVM: x86/mmu: Use hugepage GFN mask to compute GFN offset mask
arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/mmu/mmu.c | 4 ++-- arch/x86/kvm/mmu/mmutrace.h | 2 +- arch/x86/kvm/mmu/paging_tmpl.h | 4 ++-- arch/x86/kvm/mmu/tdp_iter.c | 11 +++-------- arch/x86/kvm/mmu/tdp_mmu.c | 2 +- arch/x86/kvm/x86.c | 6 +++--- 7 files changed, 13 insertions(+), 17 deletions(-)
Signature · 1 line
2.28.0