From: Paolo Bonzini <pbonzini@redhat.com>
To: "Sebastian Schütte" <dracon@ewetel.net>,
"KVM list" <kvm@vger.kernel.org>
Subject: Re: [Bug 103321] New: NPT page attribute support causes extreme slowdown
Date: Tue, 15 Sep 2015 18:32:51 +0200 [thread overview]
Message-ID: <55F84833.90003@redhat.com> (raw)
In-Reply-To: <55E74785.2060701@ewetel.net>
On 02/09/2015 21:01, Sebastian Schütte wrote:
> I inserted some printk() lines into init_vmcb() around the call of
> svm_set_guest_pat() to print out the g_pat value as well as
> svm->vcpu.vcpu_id and noticed that something was off:
>
> Initially, the PATs of all VCPUs are set to 0x0606060606060606.
> However, after attaching some devices (vfio-pci enabling device and
> vfio_ecap_init lines are being printed) init_vmcb() is only called
> again for vcpu_id > 0. Unless g_pat is changed somewhere else, VCPU
> #0 remains set to 0x0606060606060606 (according to comments in
> svm_set_guest_pat() this is bad for assigned devices) while all other
> VCPUs use 0x0007040600070406.
>
> I'd guess that could explain the slowdown.
>
Hi, sorry for the delay. If you change KVM like this
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 27f57fc05bc7..3ce878c5fde8 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1155,10 +1155,7 @@ static void svm_set_guest_pat(struct vcpu_svm *svm, u64 *g_pat)
* have assigned devices, however, we cannot force WB for RAM
* pages only, so use the guest PAT directly.
*/
- if (!kvm_arch_has_assigned_device(vcpu->kvm))
- *g_pat = 0x0606060606060606;
- else
- *g_pat = vcpu->arch.pat;
+ *g_pat = vcpu->arch.pat;
}
static u64 svm_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio)
(obviously not a valid patch for upstream patch, but good enough for
testing) do you get normal speed?
Paolo
next prev parent reply other threads:[~2015-09-15 16:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-22 22:16 [Bug 103321] New: NPT page attribute support causes extreme slowdown bugzilla-daemon
2015-08-22 22:16 ` [Bug 103321] " bugzilla-daemon
2015-08-22 22:17 ` bugzilla-daemon
[not found] ` <55D90002.10703@redhat.com>
[not found] ` <55DA16BB.4020004@ewetel.net>
2015-08-24 2:24 ` [Bug 103321] New: " Paolo Bonzini
2015-08-24 22:55 ` Sebastian Schütte
2015-09-02 19:01 ` Sebastian Schütte
2015-09-15 16:32 ` Paolo Bonzini [this message]
2015-09-15 20:11 ` Sebastian Schütte
2015-10-28 22:56 ` [Bug 103321] " bugzilla-daemon
2015-10-28 22:56 ` bugzilla-daemon
2015-10-28 23:13 ` bugzilla-daemon
2015-10-28 23:51 ` bugzilla-daemon
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=55F84833.90003@redhat.com \
--to=pbonzini@redhat.com \
--cc=dracon@ewetel.net \
--cc=kvm@vger.kernel.org \
/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.