Skip to content

Commit fc1a812

Browse files
awilliambonzini
authored andcommitted
KVM: MTRR: Use default type for non-MTRR-covered gfn before WARN_ON
The patch was munged on commit to re-order these tests resulting in excessive warnings when trying to do device assignment. Return to original ordering: https://lkml.org/lkml/2015/7/15/769 Fixes: 3e5d2fd ("KVM: MTRR: simplify kvm_mtrr_get_guest_memory_type") Signed-off-by: Alex Williamson <[email protected]> Reviewed-by: Xiao Guangrong <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 7307f70 commit fc1a812

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/x86/kvm/mtrr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -672,16 +672,16 @@ u8 kvm_mtrr_get_guest_memory_type(struct kvm_vcpu *vcpu, gfn_t gfn)
672672
if (iter.mtrr_disabled)
673673
return mtrr_disabled_type();
674674

675+
/* not contained in any MTRRs. */
676+
if (type == -1)
677+
return mtrr_default_type(mtrr_state);
678+
675679
/*
676680
* We just check one page, partially covered by MTRRs is
677681
* impossible.
678682
*/
679683
WARN_ON(iter.partial_map);
680684

681-
/* not contained in any MTRRs. */
682-
if (type == -1)
683-
return mtrr_default_type(mtrr_state);
684-
685685
return type;
686686
}
687687
EXPORT_SYMBOL_GPL(kvm_mtrr_get_guest_memory_type);

0 commit comments

Comments
 (0)