Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iNyAx-0002Lz-Qh for mharc-qemu-trivial@gnu.org; Fri, 25 Oct 2019 07:54:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47173) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNyAu-0002DC-5J for qemu-trivial@nongnu.org; Fri, 25 Oct 2019 07:54:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNyAt-0005lb-0J for qemu-trivial@nongnu.org; Fri, 25 Oct 2019 07:54:36 -0400 Received: from mel.act-europe.fr ([2a02:2ab8:224:1::a0a:d2]:42346 helo=smtp.eu.adacore.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iNyAq-0005ks-NS; Fri, 25 Oct 2019 07:54:32 -0400 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 2C02781399; Fri, 25 Oct 2019 13:54:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at eu.adacore.com Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1n_JiqXbquRh; Fri, 25 Oct 2019 13:54:31 +0200 (CEST) Received: from localhost.localdomain (unknown [109.190.253.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 7BB2781392; Fri, 25 Oct 2019 13:54:30 +0200 (CEST) Subject: Re: [PATCH 2/2] hw/misc/grlib_ahb_apb_pnp: Fix 8-bit accesses To: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Mark Cave-Ayland , Fabien Chouteau , Artyom Tarasenko , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, Jiri Gaisler References: <20191025110114.27091-1-philmd@redhat.com> <20191025110114.27091-3-philmd@redhat.com> From: KONRAD Frederic Message-ID: <952771de-3f81-5d54-7dae-8aba1780c8f2@adacore.com> Date: Fri, 25 Oct 2019 13:54:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191025110114.27091-3-philmd@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 2a02:2ab8:224:1::a0a:d2 X-BeenThere: qemu-trivial@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2019 11:54:38 -0000 Le 10/25/19 =C3=A0 1:01 PM, Philippe Mathieu-Daud=C3=A9 a =C3=A9crit=C2=A0= : > The Plug & Play region of the AHB/APB bridge can be accessed > by various word size, however the implementation is clearly > restricted to 32-bit: >=20 > static uint64_t grlib_apb_pnp_read(void *opaque, hwaddr offset, unsi= gned size) > { > APBPnp *apb_pnp =3D GRLIB_APB_PNP(opaque); >=20 > return apb_pnp->regs[offset >> 2]; > } >=20 > Set the MemoryRegionOps::impl min/max fields to 32-bit, so > memory.c::access_with_adjusted_size() can adjust when the > access is not 32-bit. >=20 > This is required to run RTEMS on leon3, the grlib scanning > functions do byte accesses. >=20 > Reported-by: Jiri Gaisler > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- > hw/misc/grlib_ahb_apb_pnp.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/hw/misc/grlib_ahb_apb_pnp.c b/hw/misc/grlib_ahb_apb_pnp.c > index f3c015d2c3..e230e25363 100644 > --- a/hw/misc/grlib_ahb_apb_pnp.c > +++ b/hw/misc/grlib_ahb_apb_pnp.c > @@ -242,6 +242,10 @@ static const MemoryRegionOps grlib_apb_pnp_ops =3D= { > .read =3D grlib_apb_pnp_read, > .write =3D grlib_apb_pnp_write, > .endianness =3D DEVICE_BIG_ENDIAN, > + .impl =3D { > + .min_access_size =3D 4, > + .max_access_size =3D 4, > + }, > }; > =20 > static void grlib_apb_pnp_realize(DeviceState *dev, Error **errp) >=20 Reviewed-by: KONRAD Frederic Thanks