From: Sander Eikelenboom Subject: Re: Re: [PATCH 1/5] xen: events: use irq_alloc_desc(_at) instead of open-coding an IRQ allocator. Date: Thu, 28 Oct 2010 14:57:53 +0200 Message-ID: <1739877628.20101028145753@eikelenboom.it> References: <1288023736.11153.40.camel@zakaz.uk.xensource.com> <1288023813-31989-1-git-send-email-ian.campbell@citrix.com> <20101025173522.GA5590@dumpdata.com> <4CC60CB7.3070005@goop.org> <20101026141739.GA9557@dumpdata.com> <4CC70583.2050503@goop.org> <20101026170841.GA10708@dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: Ian Campbell , Jeremy Fitzhardinge , "xen-devel@lists.xensource.com" , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org Hello Stefano, Thursday, October 28, 2010, 2:43:12 PM, you wrote: > On Tue, 26 Oct 2010, Konrad Rzeszutek Wilk wrote: >> > In that case we should use dynamic allocation for everything. Or try = to >> > work out distinct irq ranges for different interrupts if you really wa= nt >> > to keep irq=3D=3Dgsi. >>=20 >> Some little alarm bells are ringing in the back of my head about irq != =3D gsi. >>=20 >> I think the issue was the permission. When a PCI device is allocated to = the >> PV guest, we do a bunch of xc_* calls to allow the domain to use the BARs >> and the IRQ. I believe when the guest boots and tries to map the >> event channel with the physical IRQ, one of the arguments is that GSI. A= nd >> if we provide a bogus GSI, well, we won't get the INTx to the guest. >>=20 >> As you mentioned, Stefano's patch add a new element to the tuple that can >> contain the GSI value. At which point we can make the guest IRQ !=3D GSI, >> as long as we can contain the mapping present so >> that for the hypercalls we can give it the right GSI. >>=20 >> The MSI/MSI-X use a completly different mechanism that does not all >> of this complication, so we are OK with that. >>=20 >> .. snip .. >>=20 >> > d) dynamically allocate all irqs for all event channel types. >>=20 >> Ok, you sold me on this idea. >>=20 > Even though dynamic allocation might seem possible for both pirqs and > irqs, there are some severe limitations: > - Xen won't allocate pirq numbers lower than 16 (probably because it > expects pirq =3D=3D gsi for the first 16 gsi), so it might run out > of pirqs if we ask Xen to always choose the pirq number for us. As a > consequence it is safer to keep using pirq =3D=3D gsi, at least for the > first 16 gsis. This limitation should probably be fixed in Xen, but we > need to support older hypervisors so we cannot rely on the fix to be > present. I don't know if this discussion is for dom0 kernels only., if it is .. is t= hat support of older hypervisors necessarily true ? If i read the xen pvops wiki: NOTE! xen/stable-2.6.32.x versions after June 2010 (2.6.32.15 and new= er) require at least Xen 4.0.1-rc2 or newer to work properly! xend and xenstored will fail to start if using those kernel versions = with for example Xen 4.0.0. There's an issue with creating/using /dev/xen/ device nodes, which ha= s been fixed in Xen 4.0.1-rc2 and newer versions. See this patch: http://xenbits.xen.org/xen-4.0-testing.hg?rev/0e1521f= 654f2 and discussion at: http://lists.xensource.com/archives/html/xen-devel= /2010-06/msg01129.html for more information. So a pvops dom0 kernel all ready seems to require a very recent hypervisor.= So for a dom0 pvops kernel there has to be much less worry about support f= or older hypervisors for Xen guests it would only apply for pv domains ? So this could perhaps also be the opportunity to change things ? -- Sander > - Linux expects irq =3D=3D gsi, see arch/x86/kernel/acpi/boot.c:gsi_to_irq > /* Provide an identity mapping of gsi =3D=3D irq > * except on truly weird platforms that have > * non isa irqs in the first 16 gsis. > */ --=20 Best regards, Sander mailto:linux@eikelenboom.it