From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [PATCH 09/19] KVM: PPC: Book3S HV: add a SET_SOURCE control to the XIVE native device Date: Tue, 5 Feb 2019 16:35:54 +1100 Message-ID: <20190205053554.GI22661@umbus.fritz.box> References: <20190107184331.8429-1-clg@kaod.org> <20190107184331.8429-10-clg@kaod.org> <20190204045751.GD1927@umbus.fritz.box> <40c8dc36-0d54-1e66-d766-5580c19ae8fd@kaod.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rCb8EA+9TsBVtA92" Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, Paul Mackerras , linuxppc-dev@lists.ozlabs.org To: =?iso-8859-1?Q?C=E9dric?= Le Goater Return-path: Content-Disposition: inline In-Reply-To: <40c8dc36-0d54-1e66-d766-5580c19ae8fd@kaod.org> 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 --rCb8EA+9TsBVtA92 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 04, 2019 at 08:07:20PM +0100, C=E9dric Le Goater wrote: > On 2/4/19 5:57 AM, David Gibson wrote: > > On Mon, Jan 07, 2019 at 07:43:21PM +0100, C=E9dric Le Goater wrote: [snip] > >> + sb =3D kvmppc_xive_create_src_block(xive, irq); > >> + if (!sb) { > >> + pr_err("Failed to create block...\n"); > >> + return -ENOMEM; > >> + } > >> + } > >> + state =3D &sb->irq_state[idx]; > >> + > >> + if (get_user(val, ubufp)) { > >> + pr_err("fault getting user info !\n"); > >> + return -EFAULT; > >> + } > >> + > >> + /* > >> + * If the source doesn't already have an IPI, allocate > >> + * one and get the corresponding data > >> + */ > >> + if (!state->ipi_number) { > >> + state->ipi_number =3D xive_native_alloc_irq(); > >> + if (state->ipi_number =3D=3D 0) { > >> + pr_err("Failed to allocate IRQ !\n"); > >> + return -ENOMEM; > >> + } > >=20 > > Am I right in thinking this is the point at which a specific guest irq > > number gets bound to a specific host irq number? >=20 > yes. the XIVE IRQ state caches this information and 'state' should be=20 > protected before being assigned, indeed ... The XICS-over-XIVE device > also has the same race issue. >=20 > It's not showing because where initializing the KVM device sequentially > from QEMU and only once. Ok. So, for the passthrough case, what's the point at which we know that a particular guest interrupt needs to be bound to a specific real hardware interrupt, rather than a generic IPI? --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --rCb8EA+9TsBVtA92 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAlxZILoACgkQbDjKyiDZ s5JdJhAAzVuiEoXQxgnZpkZHKWtgO16seRiZIO1T3zUqHAv2m202CkCdClFc0Ktk zQxLa3cXMFtmDhXJ0ewxDGoxv3xcqz9SERjwHAeg/3DP323EoOktPjUhVcql065F +sMMvNJR5yw69lVDUNfHHE0J6xW6ADbrZo2BEMyZqw7kDeFycdQnXUF8M4w5CnQQ R2WlVvIxvxrn3B0hr8ZwRiQMVC/Y5kEzaIGS5D3VEM+AIZ/3ZPD+5L9C+MhtNkpK 3ZW3uakQCObWMeFHLwDOXGmInZcnrOaWSJQJQWrMXWTc4Dv9Kof9vyxUiEG/B0tK /UopLiz5aG9dY8zHAtUFyKIbNW3GeWHwie17y6qsgroKbTDAyyPT71X9VABdxTHM 6tjAHm+oyo2XLmaJfzNuqCk77ew04Bbe/mTyju6lxsnoqXbHc53psPMB/dQBKWQu XMMSDh2w4JFqGM3N1l8lzPogIS8/n+lFyGbIQ/nArV+nSRq4zc5Uj+dkiJGL7BpY sK0Pat+kdE21CdlaIRROb+Idn0sv2IY6JdsMUfhQ8mLubZuO+c710sX18HkC8iFX rkG4r7Jtq+aaKwiyBAqYDMESbmSC3yaC8oa7Tk9GoSbirTKhxRnZQ1yTu/NBmzgc 2lXljyDXO+xhndeMfCFmtOUSjeGue6fJzEp62N8mlRp5iPuX4y0= =IEau -----END PGP SIGNATURE----- --rCb8EA+9TsBVtA92--