From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [PATCH v2 04/16] KVM: PPC: Book3S HV: XIVE: add a control to initialize a source Date: Wed, 27 Feb 2019 10:20:33 +1100 Message-ID: <20190226232033.GU6872@umbus.fritz.box> References: <20190222112840.25000-1-clg@kaod.org> <20190222112840.25000-5-clg@kaod.org> <20190225021012.GH7668@umbus.fritz.box> <20190226042515.GB28015@blackberry> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lIC76ItX9S6XOZ/S" Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, =?iso-8859-1?Q?C=E9dric?= Le Goater , linuxppc-dev@lists.ozlabs.org To: Paul Mackerras Return-path: Content-Disposition: inline In-Reply-To: <20190226042515.GB28015@blackberry> 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 --lIC76ItX9S6XOZ/S Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 26, 2019 at 03:25:15PM +1100, Paul Mackerras wrote: > On Mon, Feb 25, 2019 at 01:10:12PM +1100, David Gibson wrote: > > On Fri, Feb 22, 2019 at 12:28:28PM +0100, C=E9dric Le Goater wrote: > > > + /* > > > + * 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 -ENXIO; > > > + } > > > + xive_native_populate_irq_data(state->ipi_number, > > > + &state->ipi_data); > > > + pr_debug("%s allocated hw_irq=3D0x%x for irq=3D0x%lx\n", __func__, > > > + state->ipi_number, irq); > > > + } > > > + > > > + arch_spin_lock(&sb->lock); > >=20 > > Why the direct call to arch_spin_lock() rather than just spin_lock()? >=20 > He's sharing data structures with the xics-on-xive code, and that code > has a real-mode variant, and in real mode we don't want to risk > invoking lockdep code. Hence sb->lock is an arch_spinlock_t, and he > has to use arch_spin_lock() on it. Ah, right. --=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 --lIC76ItX9S6XOZ/S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAlx1ycEACgkQbDjKyiDZ s5K9yQ//TxJ/OtHQ+JjZ1OENZvfGSQS0F8DT2GAPYWoH3vFizcDU/RTQrrXVVEC/ dTF9uNqs9zuk7SC26php82pL4S5xYCaI+/DeZOY5KJ70FUWmtGuKQV7a3eMAC/UA dip35re9ojfN4ctsrgwGZiLD9TrPFH6LVERmyJhhGLN4ZJfC+OjmwPv5MEl/pJMu tN9rdvnm82Jt8nzuJmCTYNBSzvGJ+wAi9ZLXgnfLHWvuo6wZuG6URJyt+hSwMS/o LuhXz+/Q+mKlexrgFvS/lO3lwbkJ3MazisH0ihiBVa8HHlchiaslGbhU29weInN2 QLxSyz1PjRhcnf/AkqTGLF1VJqSxtEzARriFbzfTHNjSCSOFXW1w7h44Har7758n UdFustPWr4Nh8khI4U2wTjUwuNrpLIlBv6KWGTebxxEBcdWB0fMOs1M7kIFNdAc9 /o34BN1iBupWPPfPksDcTbz6ff3HhfPQN8pq2XrF8i8sCtP2diRdJHRtlRaH0yPO U8069EwRqP46xl8GqLqeRm2dlECZIR7yOjl3LKK4qFk4jmA9gXENeuuaakTMmsbM CgEPxcLnpIYVZ7St7ORCvbOq0Rk7eh1eAXvlEZsDCAYm/X/a1cm/R2z8in3cUezi aJacnJH6r5L1gW0XVLkix3RspjzZzJH29j2ItggWUs0jVm/Sp1M= =n0wd -----END PGP SIGNATURE----- --lIC76ItX9S6XOZ/S--