From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzDAo-0003U0-Ko for qemu-devel@nongnu.org; Tue, 25 Oct 2016 21:38:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzDAn-0006ME-6A for qemu-devel@nongnu.org; Tue, 25 Oct 2016 21:38:34 -0400 Date: Wed, 26 Oct 2016 11:05:00 +1100 From: David Gibson Message-ID: <20161026000500.GL11052@umbus.fritz.box> References: <1477129610-31353-1-git-send-email-clg@kaod.org> <1477129610-31353-16-git-send-email-clg@kaod.org> <20161025053007.GA11052@umbus.fritz.box> <87421643-0697-40d3-8c28-d00348c0c54d@kaod.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wSq95SjGPZBE6hCW" Content-Disposition: inline In-Reply-To: <87421643-0697-40d3-8c28-d00348c0c54d@kaod.org> Subject: Re: [Qemu-devel] [PATCH v5 15/17] ppc/pnv: Add cut down PSI bridge model and hookup external interrupt List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?C=E9dric?= Le Goater Cc: qemu-ppc@nongnu.org, Benjamin Herrenschmidt , qemu-devel@nongnu.org, Alexander Graf --wSq95SjGPZBE6hCW Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 25, 2016 at 09:58:10AM +0200, C=E9dric Le Goater wrote: > On 10/25/2016 07:30 AM, David Gibson wrote: > > On Sat, Oct 22, 2016 at 11:46:48AM +0200, C=E9dric Le Goater wrote: > >> From: Benjamin Herrenschmidt > >> > >> The PSI (Processor Service Interface) is one of the engines of the > >> "Bridge" unit which connects the different interfaces to the Power > >> Processor. > >> > >> This adds just enough of the PSI bridge to handle various on-chip and > >> the one external interrupt. The rest of PSI has to do with the link to > >> the IBM FSP service processor which we don't plan to emulate (not used > >> on OpenPower machines). > >> > >> Signed-off-by: Benjamin Herrenschmidt > >> [clg: - updated for qemu-2.7 > >> - changed the XSCOM interface to fit new model > >> - QOMified the model > >> - reworked set_xive ] > >> Signed-off-by: C=E9dric Le Goater > >> --- > >> > >> When skiboot initializes PSIHB, it fills the xives with server=3D0, > >> prio=3D0xff, which is fine, but for some reason the last two xive > >> settings reach the qemu MMIO region with a bogus value : > >> =20 > >> pnv_psi_mmio_write: MMIO write 0x30 val 0x000000ff00000000 > >> pnv_psi_mmio_write: MMIO write 0x60 val 0x000000ff20000000 > >> pnv_psi_mmio_write: MMIO write 0x68 val 0x000000ff40000000 > >> pnv_psi_mmio_write: MMIO write 0x70 val 0x000000ff60000000 > >> pnv_psi_mmio_write: MMIO write 0x78 val 0xffffffff80000000 > >> pnv_psi_mmio_write: MMIO write 0x80 val 0xffffffffa0000000 > >> > >> It looks like a badly initialized temp variable in the call > >> stack. The memory regions look fine, maybe in stdcix ? For the > >> moment, I have added a logging error to catch non zero values as the > >> guest should not do that in any case. > >=20 > > Just to clarify, I think you're saying that you believe this to be a > > skiboot (guest side) bug rather than a qemu bug. Is that right? >=20 > Yes. I just found why. The P8_IRQ_PSI_* values in skiboot need to > be unsigned because they are shifted left of 29 bits : >=20 > ... > #define P8_IRQ_PSI_LOCAL_ERR 4 > #define P8_IRQ_PSI_EXTERNAL 5 /* Used for UART */ > ... > out_be64(psi->regs + PSIHB_XIVR_LOCAL_ERR, > (0xffull << 32) | (P8_IRQ_PSI_LOCAL_ERR << 29)); > out_be64(psi->regs + PSIHB_XIVR_HOST_ERR, > (0xffull << 32) | (P8_IRQ_PSI_EXTERNAL << 29)); >=20 >=20 > I will send a skiboot patch but we need to keep the code as it is.=20 Sure. Seems like the hardware ignores those high bits, so we probably should too. --=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 --wSq95SjGPZBE6hCW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYD/MsAAoJEGw4ysog2bOSoVMP/imu2YMhBykbcQ9D7e4CacCf dns7lNwlqfMWPrnaYnutvlrQPrYdl2RT6AmNddIfiYG6luZifglXkJjjRDrw7zdO 03qnlrsp15skrIymdmjCBqSwGX14r22hdmUa57iCTjJIu3NKoBdyyo6TkA5qS3f2 8bHhfhYrjj8aqdJpVBTOd+uUnZAD5tUHC8bGg/0EltWi2kgvUCDhfC8/Qah5ktwZ c0XZHwHgtj4wwGATxs1EbC8vQpaEL2mQtYSK99DUQ/1ZPddvcbudrzwKQ6oku+0l jEDyKf9XI++lt+op3KxI19a15DQWpjmhhbPWrhLRv5o2Nkz6URGoMD64TfyJW/kB DV/xNK4VnukPUSXU0WMtASR8qfb7y4djjxTpCc/45P2l1b2ct8tfxGqNKnBTlQmS Jbmo1DgH27CPCEQBwD7bRDMjRaJHmAr3KYahtb73y59oLLUphT1H7eEi5q3eXNgF S9MTuTzd+VGwVq5+XxDxa4t8nXPXVTnL2wRrvtQ4PihwAW0V9RnYbPc4umCpA53q XRCqXY7+8RlFenEGbujQz7TzFb7ZPkgcJBtWqWhQL2JAUG9ZHyjWn9CiHKOugt97 rxJzk1G/w8tUmGY3w9z+3E/uqz6vP8qiaa8pnr/7JdV3Ae70/t662Rxcz+FIymMF 6vSSf4mHUPJRLrQb3hhU =CuKJ -----END PGP SIGNATURE----- --wSq95SjGPZBE6hCW--