From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6B6D-0006AD-DS for qemu-devel@nongnu.org; Mon, 14 Nov 2016 01:50:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6B6A-0003Pp-Ch for qemu-devel@nongnu.org; Mon, 14 Nov 2016 01:50:37 -0500 Received: from 15.mo4.mail-out.ovh.net ([91.121.62.11]:40038) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c6B6A-0003PX-77 for qemu-devel@nongnu.org; Mon, 14 Nov 2016 01:50:34 -0500 Received: from player750.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo4.mail-out.ovh.net (Postfix) with ESMTP id DA5761BF39 for ; Mon, 14 Nov 2016 07:50:32 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Mon, 14 Nov 2016 07:50:11 +0100 Message-Id: <1479106212-18971-3-git-send-email-clg@kaod.org> In-Reply-To: <1479106212-18971-1-git-send-email-clg@kaod.org> References: <1479106212-18971-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 2/3] ppc/pnv: fix xscom address translation for POWER9 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-ppc@nongnu.org Cc: David Gibson , qemu-devel@nongnu.org, Alexander Graf , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= High addresses can overflow the uint32_t pcba variable after the 8byte shift. Signed-off-by: C=C3=A9dric Le Goater --- hw/ppc/pnv_xscom.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c index f46646141a96..8da271872f59 100644 --- a/hw/ppc/pnv_xscom.c +++ b/hw/ppc/pnv_xscom.c @@ -124,8 +124,8 @@ static uint64_t xscom_read(void *opaque, hwaddr addr,= unsigned width) goto complete; } =20 - val =3D address_space_ldq(&chip->xscom_as, pcba << 3, MEMTXATTRS_UNS= PECIFIED, - &result); + val =3D address_space_ldq(&chip->xscom_as, (uint64_t) pcba << 3, + MEMTXATTRS_UNSPECIFIED, &result); if (result !=3D MEMTX_OK) { qemu_log_mask(LOG_GUEST_ERROR, "XSCOM read failed at @0x%" HWADDR_PRIx " pcba=3D0x%08x\n", addr, pcba); @@ -150,8 +150,8 @@ static void xscom_write(void *opaque, hwaddr addr, ui= nt64_t val, goto complete; } =20 - address_space_stq(&chip->xscom_as, pcba << 3, val, MEMTXATTRS_UNSPEC= IFIED, - &result); + address_space_stq(&chip->xscom_as, (uint64_t) pcba << 3, val, + MEMTXATTRS_UNSPECIFIED, &result); if (result !=3D MEMTX_OK) { qemu_log_mask(LOG_GUEST_ERROR, "XSCOM write failed at @0x%" HWADDR_PRIx " pcba=3D0x%08x data=3D0x%" PRIx64 "\n= ", --=20 2.7.4