From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: EOI acceleration for high bandwidth IO Date: Mon, 06 Jul 2009 17:53:51 +0300 Message-ID: <4A520FFF.1030908@redhat.com> References: <1246872854.11177.1.camel@bl3aed4p.de.ibm.com> <4A51E5AB.7070103@redhat.com> <9832F13BD22FB94A829F798DA4A8280501B9CF542E@pdsmsx503.ccr.corp.intel.com> <4A520446.7030709@redhat.com> <9832F13BD22FB94A829F798DA4A8280501B9CF5445@pdsmsx503.ccr.corp.intel.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: "Dong, Eddie" Return-path: Received: from mx2.redhat.com ([66.187.237.31]:46349 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862AbZGFOva (ORCPT ); Mon, 6 Jul 2009 10:51:30 -0400 In-Reply-To: <9832F13BD22FB94A829F798DA4A8280501B9CF5445@pdsmsx503.ccr.corp.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On 07/06/2009 05:34 PM, Dong, Eddie wrote: > Avi Kivity wrote: > >> On 07/06/2009 04:42 PM, Dong, Eddie wrote: >> >>> EOI is one of key VM Exit at high bandwidth IO such as VT-d >>> with 10Gb/s NIC. This patch accelerate guest EOI emulation >>> utilizing HW VM Exit information. >>> >>> >> Won't this fail if the guest uses STOSD to issue the EOI? >> >> > Good catch, should we use an exclusion list for the opcode? > That means fetching the opcode and doing partial decoding, which will negate the advantage. > Or use decode cache for hot IP (RO in EPT for gip)? > How can you tell if the code did not change? I think it's reasonable to assume that the guest won't use STOSD for EOI though, and to apply your patch. There's no risk to the host. > We noticed huge amount of vEOI in 10Gb/s NIC which is ~70KHZ for EOI. > With SR-IOV, it could go up much more to even million level. Decode and > emulation cost 7K cycles, while short path may only spend 3-4K cycles. > Yes, and I think we can drop the short path further to almost zero by using paravirtualization. It would work for Linux and Windows x86 (with something similar to tpr patching). Unfortunately it won't work on Windows x64 since it doesn't allow patching. We can also expose x2apic (already merged) or Hyper-V enlightenment which converts EOI to MSR write which is fairly fast. -- error compiling committee.c: too many arguments to function