KVM: x86/mmu: Avoid modulo operator on 64-bit value to fix i386 build
PATCH 1/1 KVM: x86/mmu: Avoid modulo operator on 64-bit value to fix i386 build
Replace a modulo operator with the more common pattern for computing the gfn "offset" of a huge page to fix an i386 build error.
arch/x86/kvm/mmu/tdp_mmu.c:212: undefined reference to `__umoddi3'
---
Linus, do you want to take this directly so that it's in rc1? I don't know whether Paolo will be checking mail before then.
arch/x86/kvm/mmu/tdp_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/mmu/tdp_mmu.c +1 -1
@@ -209,7 +209,7 @@ static void __handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn,WARN_ON (level >PT64_ROOT_MAX_LEVEL );WARN_ON (level <PG_LEVEL_4K ); -WARN_ON (gfn %KVM_PAGES_PER_HPAGE (level)); +WARN_ON (gfn & (KVM_PAGES_PER_HPAGE (level) -1 ));/* * If this warning were to trigger it would indicate that there was a
Signature · 1 line
2.28.0
Paolo Bonzini
maintainerQuoted 5 lines · Sean Christopherson
Replace a modulo operator with the more common pattern for computing the gfn "offset" of a huge page to fix an i386 build error.
arch/x86/kvm/mmu/tdp_mmu.c:212: undefined reference to `__umoddi3'
Quoted 7 lines
Fixes 2f2fad0897cb ("kvm: x86/mmu: Add functions to handle changed TDP SPTEs")Reported-by Daniel Díaz <[email protected]>Signed-off-by Sean Christopherson <[email protected]>---
Linus, do you want to take this directly so that it's in rc1? I don't know whether Paolo will be checking mail before then
Yes, I am. I also have another bugfix, I was going to wait a couple days for any -rc1 issues to pop up but they came up faster than that.
Paolo