From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [Bug 103321] New: NPT page attribute support causes extreme slowdown Date: Sun, 23 Aug 2015 19:24:20 -0700 Message-ID: <55DA8054.7080900@redhat.com> References: <55D90002.10703@redhat.com> <55DA16BB.4020004@ewetel.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE To: =?UTF-8?Q?Sebastian_Sch=c3=bctte?= , KVM list Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50458 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753416AbbHXCYY (ORCPT ); Sun, 23 Aug 2015 22:24:24 -0400 In-Reply-To: <55DA16BB.4020004@ewetel.net> Sender: kvm-owner@vger.kernel.org List-ID: On 23/08/2015 11:53, Sebastian Sch=C3=BCtte wrote: >> What version of SeaBIOS? > 1.8.2 stable, from the Arch repo >> Can you try cherry-picking commit 5492830370171b6a4ede8a3bfba687a8d0= f25fa5? > Tried that, but it doesn't seem to make a difference. >> If that fails, can you trace the execution of the VM until the begin= ning >> of the Linux kernel boot (http://www.linux-kvm.org/page/Tracing) and >> send it compressed to me by email? > I have attached a trace up to the point when the Windows bootloader > kicks in. I could still set up a Linux VM if you think its trace woul= d > be more helpful, though. No, it seems to be in the BIOS. Please try this: diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 74d825716f4f..f8f69cffecbf 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -882,7 +882,8 @@ static u8 fallback_mtrr_type(int mtrr) case MTRR_TYPE_WRTHROUGH: return MTRR_TYPE_UNCACHABLE; case MTRR_TYPE_WRPROT: - return MTRR_TYPE_UC_MINUS; + /* Assume it's backed by RAM in the host. */ + return MTRR_TYPE_WRBACK; default: BUG(); } @@ -3054,6 +3055,7 @@ static int cr_interception(struct vcpu_svm *svm) if (cr >=3D 16) { /* mov to cr */ cr -=3D 16; val =3D kvm_register_read(&svm->vcpu, reg); + trace_kvm_cr_write(cr, val); switch (cr) { case 0: if (!check_selective_cr0_intercepted(svm, val)) This is a bit of a hack, but it can be enough for a test. For a real patch one would make mtrr2protval bidimensional, accessing it like "return mtrr2protval[is_mmio][mtrr]" in svm_get_mt_mask. Then you can return MTRR_TYPE_UC_MINUS if is_mmio, and MTRR_TYPE_WRBACK if !is_mmio. Paolo