Skip to content

Commit

Permalink
KVM: MTRR: Use default type for non-MTRR-covered gfn before WARN_ON
Browse files Browse the repository at this point in the history
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 <alex.williamson@redhat.com>
Reviewed-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
awilliam authored and bonzini committed Aug 5, 2015
1 parent 7307f70 commit fc1a812
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/x86/kvm/mtrr.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,16 +672,16 @@ u8 kvm_mtrr_get_guest_memory_type(struct kvm_vcpu *vcpu, gfn_t gfn)
if (iter.mtrr_disabled)
return mtrr_disabled_type();

/* not contained in any MTRRs. */
if (type == -1)
return mtrr_default_type(mtrr_state);

/*
* We just check one page, partially covered by MTRRs is
* impossible.
*/
WARN_ON(iter.partial_map);

/* not contained in any MTRRs. */
if (type == -1)
return mtrr_default_type(mtrr_state);

return type;
}
EXPORT_SYMBOL_GPL(kvm_mtrr_get_guest_memory_type);
Expand Down

0 comments on commit fc1a812

Please sign in to comment.