Skip to content

Commit

Permalink
KVM: MTRR: fix fixed MTRR segment look up
Browse files Browse the repository at this point in the history
This fixes the slow-down of VM running with pci-passthrough, since some MTRR
range changed from MTRR_TYPE_WRBACK to MTRR_TYPE_UNCACHABLE.  Memory in the
0K-640K range was incorrectly treated as uncacheable.

Fixes: f7bfb57
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107561
Cc: qemu-stable@nongnu.org
Signed-off-by: Alexis Dambricourt <alexis.dambricourt@gmail.com>
[Use correct BZ for "Fixes" annotation.  - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Alexis Dambricourt authored and Paolo Bonzini committed Dec 22, 2015
1 parent 6fd0862 commit a7f2d78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/mtrr.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ static int fixed_mtrr_addr_to_seg(u64 addr)

for (seg = 0; seg < seg_num; seg++) {
mtrr_seg = &fixed_seg_table[seg];
if (mtrr_seg->start >= addr && addr < mtrr_seg->end)
if (mtrr_seg->start <= addr && addr < mtrr_seg->end)
return seg;
}

Expand Down

0 comments on commit a7f2d78

Please sign in to comment.