From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8yYr-0007LJ-Fa for qemu-devel@nongnu.org; Mon, 21 Nov 2016 19:03:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8yYo-00085H-LV for qemu-devel@nongnu.org; Mon, 21 Nov 2016 19:03:45 -0500 Date: Tue, 22 Nov 2016 10:05:29 +1100 From: David Gibson Message-ID: <20161121230529.GC8681@umbus.fritz.box> References: <20161120231605.D90DD745789@zero.eik.bme.hu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Qbvjkv9qwOGw/5Fx" Content-Disposition: inline In-Reply-To: <20161120231605.D90DD745789@zero.eik.bme.hu> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc: Make uninorth interrupt swizzling identical to Grackle List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: BALATON Zoltan Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org --Qbvjkv9qwOGw/5Fx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 21, 2016 at 12:12:31AM +1000, BALATON Zoltan wrote: > From: Benjamin Herrenschmidt >=20 > It's currently broken as it uses an incorrect shift, it tries > to use the slot number but uses the top bits of the bus number > instead. >=20 > Note: Neither implementation matches what OpenBIOS ends up putting > in the device-tree either, which will have to be fixed separately. >=20 > This is not quite correct for modelling a real Mac since Apple > tend to tie all 4 interrupt lines of a slot together and have > separate interrupts for every slot and every motherboard devices > going straight to the PIC but we'll sort that out later. >=20 > Signed-off-by: Benjamin Herrenschmidt > --- > hw/pci-host/uninorth.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > This needs a corresponding fix in OpenBIOS but this has to be > committed first for that. As this is already broken making this change > should not make things worse as they are now. Could we get this in now > as a bugfix commit? Applied to ppc-for-2.8. >=20 > diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c > index 7aac4d6..df342ac 100644 > --- a/hw/pci-host/uninorth.c > +++ b/hw/pci-host/uninorth.c > @@ -62,9 +62,7 @@ typedef struct UNINState { > =20 > static int pci_unin_map_irq(PCIDevice *pci_dev, int irq_num) > { > - int devfn =3D pci_dev->devfn & 0x00FFFFFF; > - > - return (((devfn >> 11) & 0x1F) + irq_num) & 3; > + return (irq_num + (pci_dev->devfn >> 3)) & 3; > } > =20 > static void pci_unin_set_irq(void *opaque, int irq_num, int level) --=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 --Qbvjkv9qwOGw/5Fx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYM325AAoJEGw4ysog2bOS1/YQAK99SZPlfXEens6qNusR9BAj TVRJembP3SMgLI/Iyvu/D3gqWjrDWy9txTLG0ztPAb+wEJaJT9rvrf+HmsMoRn4F D6hI44+jEzLc/dLwvAJ8INIWLCW6fW8O5QAnWqYqUDty26AfPxi/5H+6rqkfMtbv S7bTePp9sVpLXy9Z7Amn92FA3boIiYyPnw30LFMphC1DLRZKN/IPcMW1KGko2UWE memp6AU/zmYPnfJoJ8UspmEYoXsr9pwyGJjHUAXnQI/YS5FuacnEzKGtpg/bMm2T /0u9Puh4fmKl32Yuy1wWgKFT+jjwXHS311GVCuOoK5N2b43rv9fBG3GSrG/4oRlN iEfMJ6/SoEpWw0NSPQDFOIRxHsFrlnr8fPj1XLoRow0Y0s2el4jOEwNoVtzGUhCV ODLVDPt2T8cbrr7XLVR2qkdWWenAQgxXdoZFNe157IniZ14X4cNGx7TDMgW0j0kf E8Ck3i6bPwk1osb3RYs5JMcJOkkjia30Y65MfqoBGDjGlMpjh1A49TPQ3od/onKU mlrsnDbmeZN/XGotxp2rrnH9kU2y/Mb4S8oe+UhIi2ukpdu+7jg8CscIwOosODOY gs8Y3J/18hCw5qUnSfERdA10sL59aSCa0lGqCqMtSStyDX94F6w1Axpht2gOlDt+ g6a3LePEwF5BSEZ56xOY =kaYl -----END PGP SIGNATURE----- --Qbvjkv9qwOGw/5Fx--