Commit a7f2d786 authored by Alexis Dambricourt's avatar Alexis Dambricourt Committed by Paolo Bonzini

KVM: MTRR: fix fixed MTRR segment look up

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: f7bfb57b
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107561
Cc: qemu-stable@nongnu.org
Signed-off-by: default avatarAlexis Dambricourt <alexis.dambricourt@gmail.com>
[Use correct BZ for "Fixes" annotation.  - Paolo]
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 6fd08621
...@@ -267,7 +267,7 @@ static int fixed_mtrr_addr_to_seg(u64 addr) ...@@ -267,7 +267,7 @@ static int fixed_mtrr_addr_to_seg(u64 addr)
for (seg = 0; seg < seg_num; seg++) { for (seg = 0; seg < seg_num; seg++) {
mtrr_seg = &fixed_seg_table[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; return seg;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment