From patchwork Fri Jun 19 10:15:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 31319 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5JAGAjZ022221 for ; Fri, 19 Jun 2009 10:16:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753568AbZFSKQE (ORCPT ); Fri, 19 Jun 2009 06:16:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751337AbZFSKQD (ORCPT ); Fri, 19 Jun 2009 06:16:03 -0400 Received: from mx2.redhat.com ([66.187.237.31]:55386 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750732AbZFSKQC (ORCPT ); Fri, 19 Jun 2009 06:16:02 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5JAG44N026998 for ; Fri, 19 Jun 2009 06:16:04 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5JAG43w023307 for ; Fri, 19 Jun 2009 06:16:04 -0400 Received: from localhost.localdomain (dhcp-lab-149.englab.brq.redhat.com [10.34.33.149]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5JAG3br028520 for ; Fri, 19 Jun 2009 06:16:03 -0400 From: Paolo Bonzini To: kvm@vger.kernel.org Subject: [PATCH] KVM: SVM: Pass through the host kernel's IO delay port Date: Fri, 19 Jun 2009 12:15:53 +0200 Message-Id: <1245406553-22013-1-git-send-email-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Paolo Bonzini KVM's optimization of guest port 80 accesses was removed last May 11 in commit 99f85a. However, this probably has speed penalties. I don't have a machine to test but the equivalent VMX patch (fdef3ad) reported a speedup of 3-5%, and on the Xen mailing list it was mentioned that on Xen passing port 80 through had positive effects on startup speed. We can enable passthrough to the same port the host kernel uses instead. Signed-off-by: Paolo Bonzini --- arch/x86/kernel/io_delay.c | 1 + arch/x86/kvm/svm.c | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/io_delay.c b/arch/x86/kernel/io_delay.c index a979b5b..a478cb2 100644 --- a/arch/x86/kernel/io_delay.c +++ b/arch/x86/kernel/io_delay.c @@ -129,3 +129,4 @@ static int __init io_delay_param(char *s) } early_param("io_delay", io_delay_param); +EXPORT_SYMBOL_GPL(io_delay_type); diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 1f8510c..c49f4db 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -411,6 +412,10 @@ static __init int svm_hardware_setup(void) iopm_va = page_address(iopm_pages); memset(iopm_va, 0xff, PAGE_SIZE * (1 << IOPM_ALLOC_ORDER)); + if (io_delay_type == CONFIG_IO_DELAY_TYPE_0X80) + clear_bit(0x80, iopm_va); + else if (io_delay_type == CONFIG_IO_DELAY_TYPE_0XED) + clear_bit(0xED, iopm_va); iopm_base = page_to_pfn(iopm_pages) << PAGE_SHIFT; if (boot_cpu_has(X86_FEATURE_NX))