From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/7] KVM: Add a route layer to convert MSI message to GSI Date: Sun, 11 Jan 2009 11:34:45 +0200 Message-ID: <4969BD35.2020603@redhat.com> References: <1231411535-2461-1-git-send-email-sheng@linux.intel.com> <1231411535-2461-2-git-send-email-sheng@linux.intel.com> <496616E9.5040007@redhat.com> <200901091050.59817.sheng@linux.intel.com> <49679209.1030600@redhat.com> <20090110111214.GA14678@yukikaze> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Avi Kivity , Sheng Yang , Marcelo Tosatti , kvm@vger.kernel.org Return-path: Received: from mx2.redhat.com ([66.187.237.31]:48159 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750836AbZAKJev (ORCPT ); Sun, 11 Jan 2009 04:34:51 -0500 In-Reply-To: <20090110111214.GA14678@yukikaze> Sender: kvm-owner@vger.kernel.org List-ID: Sheng Yang wrote: > On Fri, Jan 09, 2009 at 08:06:01PM +0200, Avi Kivity wrote: > >> Sheng Yang wrote: >> >>>>> +struct kvm_gsi_route_entry_guest { >>>>> >>>>> >>>> what does _guest mean here? almost all kvm stuff is _guest related. >>>> >>>> >>> Because I can't think of a good name... kvm_gsi_route_entry_guest? >>> kvm_gsi_kernel_route_entry? What's your favorite? :) >>> >>> >>> >> kvm_gsi_route_entry? >> > > Which is used for kernel one now... > So add _kernel to that... It's more important to keep the userspace interface clean. >> We need to allow userspace to change pic/ioapic routing for the HPET. >> >> There are two styles of maintaining the table: >> >> 1. add/remove ioctls >> >> The advantage is that very little work needs to be done when something >> changes, but the code size (and bug count) doubles. >> >> 2. replace everything ioctl >> >> Smaller code size, but slower if there are high frequency changes >> >> I don't think we'll see high frequency interrupt routing changes; we'll >> probably have one on setup (for HPET), another when switching from ACPI >> PIC mode to ACPI APIC mode, and one for every msi initialized. >> > > I come to option 2 mix with option 1 now. What I meant is, MSI part is in > device-assignment part, and HPET and others are in some other place, so a > global table should be maintained for these three across the parts of > userspace. I don't like the global gsi route table, and especially we > already got one in kernel space. We have to do some maintain work in the > kernel space, e.g. looking up a entry, so I think a little add-on can take > the job. > > And now I think you original purpose is three different tables for MSI, HPET > and ACPI APIC mode? This also avoid global big table in userspace. But it > seems like a waste, and also too specific... > > So how about this? One ioctl to replace everything, another(maybe two, > transfer entry number then table, or one with maximum entries number in > userspace) can export current gsi route table? This can avoid the global > route table, as well as reduce the complexity. > I still don't understand. We already have all of the information needed in userspace. We know whether HPET is in use or not, whether PIC mode or APIC mode is enabled, and what MSIs are enabled. We need all this at least for live migration. In the kernel, we'll need a function to free the table (for VM shutdown), so adding a function to populate a new table seems to be the least amount of work. But I think we're miscommunicating, maybe I'm misunderstanding what you're suggesting. -- error compiling committee.c: too many arguments to function