All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexis D...t" <alexis.dambricourt@gmail.com>
To: pbonzini@redhat.com
Cc: kvm@vger.kernel.org
Subject: [PATCH] KVM: MTRR: fix fixed MTRR segment look up
Date: Mon, 14 Dec 2015 15:39:34 +0100	[thread overview]
Message-ID: <CAG0+HugZfEmVcBBZucgrHjBTJon7igm-i+=rHbTh0Wu+Ru-g_g@mail.gmail.com> (raw)

It fixes the slow-down of VM running with pci-passthrough, since some MTRR
range changed from MTRR_TYPE_WRBACK to MTRR_TYPE_UNCACHABLE.

Fixes: fa61213746a ("KVM: MTRR: simplify kvm_mtrr_get_guest_memory_type")
Bugzilla: (https://bugzilla.kernel.org/show_bug.cgi?id=107561)

Signed-off-by: Alexis Dambricourt <alexis.dambricourt@gmail.com>
---
 arch/x86/kvm/mtrr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/mtrr.c b/arch/x86/kvm/mtrr.c
index 9e8bf13..adc54e1 100644
--- a/arch/x86/kvm/mtrr.c
+++ b/arch/x86/kvm/mtrr.c
@@ -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;
        }

--

             reply	other threads:[~2015-12-14 14:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 14:39 Alexis D...t [this message]
2015-12-14 15:36 ` [PATCH] KVM: MTRR: fix fixed MTRR segment look up Paolo Bonzini
2015-12-14 16:06   ` Alexis D...t
2015-12-14 16:07     ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAG0+HugZfEmVcBBZucgrHjBTJon7igm-i+=rHbTh0Wu+Ru-g_g@mail.gmail.com' \
    --to=alexis.dambricourt@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.