Skip to content

Commit aca0ec9

Browse files
Ackerley Tngbonzini
authored andcommitted
KVM: x86/mmu: fix determination of max NPT mapping level for private pages
The `if (req_max_level)` test was meant ignore req_max_level if PG_LEVEL_NONE was returned. Hence, this function should return max_level instead of the ignored req_max_level. This is only a latent issue for now, since guest_memfd does not support large pages. Signed-off-by: Ackerley Tng <[email protected]> Message-ID: <[email protected]> Fixes: f32fb32 ("KVM: x86: Add hook for determining max NPT mapping level") Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 66a644c commit aca0ec9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/mmu/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4335,7 +4335,7 @@ static u8 kvm_max_private_mapping_level(struct kvm *kvm, kvm_pfn_t pfn,
43354335
if (req_max_level)
43364336
max_level = min(max_level, req_max_level);
43374337

4338-
return req_max_level;
4338+
return max_level;
43394339
}
43404340

43414341
static int kvm_faultin_pfn_private(struct kvm_vcpu *vcpu,

0 commit comments

Comments
 (0)