From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] KVM: SVM: Pass through the host kernel's IO delay port Date: Mon, 22 Jun 2009 12:11:59 +0200 Message-ID: <4A3F58EF.8010206@redhat.com> References: <1245406553-22013-1-git-send-email-pbonzini@redhat.com> <4A3F4F6F.6090209@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:55873 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751228AbZFVKMG (ORCPT ); Mon, 22 Jun 2009 06:12:06 -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 n5MAC9a8004685 for ; Mon, 22 Jun 2009 06:12:09 -0400 In-Reply-To: <4A3F4F6F.6090209@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > On 06/19/2009 01:15 PM, Paolo Bonzini wrote: >> 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. > > Since we don't tell the guest to use 0xed, this won't help. Won't the guest do that automatically through DMI? I think we have four cases: 1) non-buggy chipset, host uses 0x80 and guest cannot crash the machine; this is okay. 2) buggy chipset, both host and guest use 0xed thanks to DMI detection; and (since 0x80 is not passthrough) the guest cannot crash the machine, so this is okay. 3) host is given explicit io_delay=0xed, but the guest isn't. However, 0x80 is not passthrough so the guest can use port 0x80 safely even on buggy hardware. 4) a buggy chipset is not detected, so io_delay=0x80 and 0x80 is made passthrough. In principle the guest could crash the machine; however the host will have written to 0x80 at startup, most likely causing a crash way before a guest is started. So this should not be a problem either. Paolo