From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: KVM & VT-d2? Date: Sun, 17 May 2009 22:50:00 +0300 Message-ID: <4A106A68.3010105@redhat.com> References: <0199E0D51A61344794750DC57738F58E66BC9810C8@GVW1118EXC.americas.hpqcorp.net> <57C9024A16AD2D4C97DC78E552063EA3A16F9FBF@orsmsx505.amr.corp.intel.com> <0199E0D51A61344794750DC57738F58E66BC9810CC@GVW1118EXC.americas.hpqcorp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "Kay, Allen M" , "kvm@vger.kernel.org" To: "Fischer, Anna" Return-path: Received: from mx2.redhat.com ([66.187.237.31]:56157 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752160AbZEQTuD (ORCPT ); Sun, 17 May 2009 15:50:03 -0400 In-Reply-To: <0199E0D51A61344794750DC57738F58E66BC9810CC@GVW1118EXC.americas.hpqcorp.net> Sender: kvm-owner@vger.kernel.org List-ID: Fischer, Anna wrote: > I thought that one use case of VT-d2 interrupt remapping was to be able to safely and more efficiently deliver interrupts to the CPU that runs the particular VCPU of the guest that owns the I/O device that issues the interrupt. Shouldn't there at least be some performance (e.g. latency) improvement doing the remapping and checking in HW with a predefined table rather than multiplexing this in software in the hypervisor layer? > This can be done even without VT-d. Since qemu knows how the guest affines its interrupts (via the MSI entry), it can affine the corresponding host interrupt. Right now Linux can affine the host interrupt to a cpu; this requires periodic polling since the vcpu thread can move around. It would be interesting to add an API to affine an interrupt to a thread, so whenever the thread is migrated to a different cpu, the interrupt follows it around. I imagine it would be useful for non-virtualization applications as well. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.