From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Subject: Re: [PATCH 06/19] KVM: PPC: Book3S HV: add a GET_ESB_FD control to the XIVE native device Date: Tue, 12 Feb 2019 23:07:11 +0100 Message-ID: References: <20190205052822.GE22661@umbus.fritz.box> <4d565738-a99b-0333-8533-037677358faa@kaod.org> <20190206012308.GP22661@umbus.fritz.box> <1745dd9f-2927-cae6-e8da-c350b0bd0a66@kaod.org> <20190207024950.GA22661@umbus.fritz.box> <20190208051523.GD2688@umbus.fritz.box> <9b556f53-fcfb-2ca3-019e-6ced0ec74c2a@kaod.org> <20190208215329.GA9529@blackberry> <8c915ed7-5aa5-1276-6598-d5dcd115dd56@kaod.org> <20190211023842.GE7230@umbus.fritz.box> <9dc53c6bccd6fd303481217f768ec173992431e2.camel@kernel.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org To: Benjamin Herrenschmidt , David Gibson Return-path: In-Reply-To: <9dc53c6bccd6fd303481217f768ec173992431e2.camel@kernel.crashing.org> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+glppe-linuxppc-embedded-2=m.gmane.org@lists.ozlabs.org Sender: "Linuxppc-dev" List-Id: kvm.vger.kernel.org On 2/11/19 7:42 AM, Benjamin Herrenschmidt wrote: > On Mon, 2019-02-11 at 13:38 +1100, David Gibson wrote: >> >> 1) All in kernel >> >> The offset always maps directly to guest irq number and the kernel >> somehow binds it either to an IPI or a host irq as necessary. >> Cédric's original code attempts this, but the mechanism of keeping a >> pointer to the VMA can't work. > > Why do you need a pointer to the VMA anyway ? unmap_mapping_range() > doesn't need a VMA for the unmap part, and faults/mmaps have the VMA. > >> But.. remapping the irqs should be sufficiently infrequent that it >> might be ok to consider simply stepping through all the hosting >> process's VMAs to do this. > > Which unmap_mapping_range() does for you as I explained previously. You > only need the address space. See how spufs does it (among others). and the different CAPI drivers. This is much better and it works fine. On the same topic, the XIVE IC on P10 will use IPI ESB pages for the PHB interrupts sources. We will still need this kind of remapping but the pages will be from the same controller. Thanks, C. From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= Date: Tue, 12 Feb 2019 22:07:11 +0000 Subject: Re: [PATCH 06/19] KVM: PPC: Book3S HV: add a GET_ESB_FD control to the XIVE native device Message-Id: List-Id: References: <20190205052822.GE22661@umbus.fritz.box> <4d565738-a99b-0333-8533-037677358faa@kaod.org> <20190206012308.GP22661@umbus.fritz.box> <1745dd9f-2927-cae6-e8da-c350b0bd0a66@kaod.org> <20190207024950.GA22661@umbus.fritz.box> <20190208051523.GD2688@umbus.fritz.box> <9b556f53-fcfb-2ca3-019e-6ced0ec74c2a@kaod.org> <20190208215329.GA9529@blackberry> <8c915ed7-5aa5-1276-6598-d5dcd115dd56@kaod.org> <20190211023842.GE7230@umbus.fritz.box> <9dc53c6bccd6fd303481217f768ec173992431e2.camel@kernel.crashing.org> In-Reply-To: <9dc53c6bccd6fd303481217f768ec173992431e2.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Benjamin Herrenschmidt , David Gibson Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org On 2/11/19 7:42 AM, Benjamin Herrenschmidt wrote: > On Mon, 2019-02-11 at 13:38 +1100, David Gibson wrote: >> >> 1) All in kernel >> >> The offset always maps directly to guest irq number and the kernel >> somehow binds it either to an IPI or a host irq as necessary. >> C=C3=A9dric's original code attempts this, but the mechanism of keeping a >> pointer to the VMA can't work. >=20 > Why do you need a pointer to the VMA anyway ? unmap_mapping_range() > doesn't need a VMA for the unmap part, and faults/mmaps have the VMA. >=20 >> But.. remapping the irqs should be sufficiently infrequent that it >> might be ok to consider simply stepping through all the hosting >> process's VMAs to do this. >=20 > Which unmap_mapping_range() does for you as I explained previously. You > only need the address space. See how spufs does it (among others). and the different CAPI drivers. This is much better and it works fine. On the same topic, the XIVE IC on P10 will use IPI ESB pages for the=20 PHB interrupts sources. We will still need this kind of remapping but=20 the pages will be from the same controller. Thanks, C.