From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C887C35DEE for ; Tue, 25 Feb 2020 00:25:19 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 068E6218AC for ; Tue, 25 Feb 2020 00:25:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b="EIS6g4wc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 068E6218AC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6O2I-0002TZ-5m for qemu-devel@archiver.kernel.org; Mon, 24 Feb 2020 19:25:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52442) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6O1S-0000mS-Dm for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:24:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6O1R-0000MB-9F for qemu-devel@nongnu.org; Mon, 24 Feb 2020 19:24:26 -0500 Received: from ozlabs.org ([203.11.71.1]:45553) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6O1M-0000Iq-0F; Mon, 24 Feb 2020 19:24:20 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 48RKS01rmzz9sPK; Tue, 25 Feb 2020 11:24:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1582590256; bh=QB8oFSFaYoTX8Rx05o4U8QAJPl+c6DRspslzdATSPv4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EIS6g4wc5HG9jscHdglTXT8XM8ciZTrxjmwHjIQwC3S8rIPIkvtw/7/JDCx1PwCZN t1Y7w21xw+l/VgvFp+QLpgRSqB35L24vmsQFBcUMrFFyD1vbTuzaVuvfSf1eax0ALd hbWnomDgyjHNHjpifw7rdWTPMkcKjrYMbszh1AaA= Date: Tue, 25 Feb 2020 11:23:45 +1100 From: David Gibson To: Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= Subject: Re: [PATCH RESEND v2 11/32] hw/ppc: Use memory_region_init_rom() with read-only regions Message-ID: <20200225002345.GC41629@umbus.fritz.box> References: <20200224205533.23798-1-philmd@redhat.com> <20200224205533.23798-12-philmd@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nmemrqcdn5VTmUEE" Content-Disposition: inline In-Reply-To: <20200224205533.23798-12-philmd@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Sagar Karandikar , "Michael S. Tsirkin" , Jason Wang , Mark Cave-Ayland , qemu-devel@nongnu.org, KONRAD Frederic , Alistair Francis , "Edgar E. Iglesias" , Max Reitz , qemu-block@nongnu.org, Magnus Damm , =?iso-8859-1?Q?Herv=E9?= Poussineau , Joel Stanley , Palmer Dabbelt , Aleksandar Rikalo , Artyom Tarasenko , Eduardo Habkost , Jean-Christophe Dubois , Alistair Francis , Fabien Chouteau , qemu-arm@nongnu.org, Peter Chubb , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Richard Henderson , Kevin Wolf , qemu-riscv@nongnu.org, Igor Mitsyanko , Bastian Koppelmann , Laurent Vivier , Subbaraya Sundeep , Michael Walle , qemu-ppc@nongnu.org, Aleksandar Markovic , Paolo Bonzini , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --nmemrqcdn5VTmUEE Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 24, 2020 at 09:55:12PM +0100, Philippe Mathieu-Daud=E9 wrote: > This commit was produced with the Coccinelle script > scripts/coccinelle/memory-region-housekeeping.cocci. >=20 > Signed-off-by: Philippe Mathieu-Daud=E9 Acked-by: David Gibson > --- > hw/ppc/mac_newworld.c | 3 +-- > hw/ppc/mac_oldworld.c | 3 +-- > 2 files changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c > index 464d012103..566413e479 100644 > --- a/hw/ppc/mac_newworld.c > +++ b/hw/ppc/mac_newworld.c > @@ -156,13 +156,12 @@ static void ppc_core99_init(MachineState *machine) > memory_region_add_subregion(get_system_memory(), 0, ram); > =20 > /* allocate and load BIOS */ > - memory_region_init_ram(bios, NULL, "ppc_core99.bios", BIOS_SIZE, > + memory_region_init_rom(bios, NULL, "ppc_core99.bios", BIOS_SIZE, > &error_fatal); > =20 > if (bios_name =3D=3D NULL) > bios_name =3D PROM_FILENAME; > filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); > - memory_region_set_readonly(bios, true); > memory_region_add_subregion(get_system_memory(), PROM_ADDR, bios); > =20 > /* Load OpenBIOS (ELF) */ > diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c > index 7318d7e9b4..8b22ff60b8 100644 > --- a/hw/ppc/mac_oldworld.c > +++ b/hw/ppc/mac_oldworld.c > @@ -132,13 +132,12 @@ static void ppc_heathrow_init(MachineState *machine) > memory_region_add_subregion(sysmem, 0, ram); > =20 > /* allocate and load BIOS */ > - memory_region_init_ram(bios, NULL, "ppc_heathrow.bios", BIOS_SIZE, > + memory_region_init_rom(bios, NULL, "ppc_heathrow.bios", BIOS_SIZE, > &error_fatal); > =20 > if (bios_name =3D=3D NULL) > bios_name =3D PROM_FILENAME; > filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); > - memory_region_set_readonly(bios, true); > memory_region_add_subregion(sysmem, PROM_ADDR, bios); > =20 > /* Load OpenBIOS (ELF) */ --=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 --nmemrqcdn5VTmUEE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAl5UaRAACgkQbDjKyiDZ s5KqNRAAwHe0vYT9rKDx9BpcgQAO3s4kkrzffvgcGNe9AVt7B6T75Q+kf6bS+0oU yhLP9NJFkwjH1hzbyLE0sNKQjWpUdguJh7KYlC248qV8UnozdFXpEp4vYo6ZzLev 6EF7LqLRS4gIR1t7SP9DMeRHUIY5NGTWmDJMU2WrmGT3/gEMZ3MWyVVlOSMr3lD8 butF2PhAdrRUZL5H/IiXcbLIgeCzDw24+WwI8MppW1llereWfRgXL++j6OZnG5mr Xd1MsivbWZN1lRzORhhhY9eFLvmZk3B54gemMCuGPCX85iafqohFZQTkeq6QHeH0 dyBQ1KkgTHQJOZ8+o8V+zUIzDhOjiTFMZJ2w7z90BiNBt2wqvHYoUGTY9I9tqtdq TWOoOWkWxElc+HMMEWAq6z9Zxp/QhuPzQ0LqQovmeAGwLwPsuWc1oBE2yhnPDvYP d1PS8t9+RObBgT8qGFR5X20qpzQErRCU7Vh3exBLRcjjwcj73yJ2RNDaXuOgZfwv cjyKY5xi3FtNLX/F6Wus4TbC0nddcKs4I/3i/MoSUrAXhw1hFxhuNZ0gHteI0EZf 21L1XBnMUzz1m43uaIyyJTCU4ppEY8+/dlV0h/bcpWP0JvP7+YmLd3Bv5KFlrGxz c+NDW3O63gw9R7IB3QOYVSlQBIQrnqAjikQVt82hMWbQoh/yz7c= =Ji33 -----END PGP SIGNATURE----- --nmemrqcdn5VTmUEE-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1j6O1a-00018B-4c for mharc-qemu-riscv@gnu.org; Mon, 24 Feb 2020 19:24:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52514) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6O1X-00010t-Hl for qemu-riscv@nongnu.org; Mon, 24 Feb 2020 19:24:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6O1W-0000PJ-1C for qemu-riscv@nongnu.org; Mon, 24 Feb 2020 19:24:31 -0500 Received: from ozlabs.org ([203.11.71.1]:45553) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6O1M-0000Iq-0F; Mon, 24 Feb 2020 19:24:20 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 48RKS01rmzz9sPK; Tue, 25 Feb 2020 11:24:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1582590256; bh=QB8oFSFaYoTX8Rx05o4U8QAJPl+c6DRspslzdATSPv4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EIS6g4wc5HG9jscHdglTXT8XM8ciZTrxjmwHjIQwC3S8rIPIkvtw/7/JDCx1PwCZN t1Y7w21xw+l/VgvFp+QLpgRSqB35L24vmsQFBcUMrFFyD1vbTuzaVuvfSf1eax0ALd hbWnomDgyjHNHjpifw7rdWTPMkcKjrYMbszh1AaA= Date: Tue, 25 Feb 2020 11:23:45 +1100 From: David Gibson To: Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= Cc: qemu-devel@nongnu.org, Paolo Bonzini , Peter Maydell , Kevin Wolf , Alistair Francis , qemu-block@nongnu.org, Marcel Apfelbaum , Joel Stanley , qemu-ppc@nongnu.org, Alistair Francis , Sagar Karandikar , Magnus Damm , Aleksandar Markovic , Aleksandar Rikalo , Jason Wang , Igor Mitsyanko , Bastian Koppelmann , Laurent Vivier , Palmer Dabbelt , Peter Chubb , Max Reitz , Subbaraya Sundeep , KONRAD Frederic , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Andrzej Zaborowski , =?iso-8859-1?Q?Herv=E9?= Poussineau , qemu-arm@nongnu.org, Aurelien Jarno , Michael Walle , Artyom Tarasenko , Eduardo Habkost , "Michael S. Tsirkin" , Richard Henderson , Jean-Christophe Dubois , "Edgar E. Iglesias" , Mark Cave-Ayland , qemu-riscv@nongnu.org, Fabien Chouteau Subject: Re: [PATCH RESEND v2 11/32] hw/ppc: Use memory_region_init_rom() with read-only regions Message-ID: <20200225002345.GC41629@umbus.fritz.box> References: <20200224205533.23798-1-philmd@redhat.com> <20200224205533.23798-12-philmd@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nmemrqcdn5VTmUEE" Content-Disposition: inline In-Reply-To: <20200224205533.23798-12-philmd@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 X-BeenThere: qemu-riscv@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: Tue, 25 Feb 2020 00:24:33 -0000 --nmemrqcdn5VTmUEE Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 24, 2020 at 09:55:12PM +0100, Philippe Mathieu-Daud=E9 wrote: > This commit was produced with the Coccinelle script > scripts/coccinelle/memory-region-housekeeping.cocci. >=20 > Signed-off-by: Philippe Mathieu-Daud=E9 Acked-by: David Gibson > --- > hw/ppc/mac_newworld.c | 3 +-- > hw/ppc/mac_oldworld.c | 3 +-- > 2 files changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c > index 464d012103..566413e479 100644 > --- a/hw/ppc/mac_newworld.c > +++ b/hw/ppc/mac_newworld.c > @@ -156,13 +156,12 @@ static void ppc_core99_init(MachineState *machine) > memory_region_add_subregion(get_system_memory(), 0, ram); > =20 > /* allocate and load BIOS */ > - memory_region_init_ram(bios, NULL, "ppc_core99.bios", BIOS_SIZE, > + memory_region_init_rom(bios, NULL, "ppc_core99.bios", BIOS_SIZE, > &error_fatal); > =20 > if (bios_name =3D=3D NULL) > bios_name =3D PROM_FILENAME; > filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); > - memory_region_set_readonly(bios, true); > memory_region_add_subregion(get_system_memory(), PROM_ADDR, bios); > =20 > /* Load OpenBIOS (ELF) */ > diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c > index 7318d7e9b4..8b22ff60b8 100644 > --- a/hw/ppc/mac_oldworld.c > +++ b/hw/ppc/mac_oldworld.c > @@ -132,13 +132,12 @@ static void ppc_heathrow_init(MachineState *machine) > memory_region_add_subregion(sysmem, 0, ram); > =20 > /* allocate and load BIOS */ > - memory_region_init_ram(bios, NULL, "ppc_heathrow.bios", BIOS_SIZE, > + memory_region_init_rom(bios, NULL, "ppc_heathrow.bios", BIOS_SIZE, > &error_fatal); > =20 > if (bios_name =3D=3D NULL) > bios_name =3D PROM_FILENAME; > filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); > - memory_region_set_readonly(bios, true); > memory_region_add_subregion(sysmem, PROM_ADDR, bios); > =20 > /* Load OpenBIOS (ELF) */ --=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 --nmemrqcdn5VTmUEE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAl5UaRAACgkQbDjKyiDZ s5KqNRAAwHe0vYT9rKDx9BpcgQAO3s4kkrzffvgcGNe9AVt7B6T75Q+kf6bS+0oU yhLP9NJFkwjH1hzbyLE0sNKQjWpUdguJh7KYlC248qV8UnozdFXpEp4vYo6ZzLev 6EF7LqLRS4gIR1t7SP9DMeRHUIY5NGTWmDJMU2WrmGT3/gEMZ3MWyVVlOSMr3lD8 butF2PhAdrRUZL5H/IiXcbLIgeCzDw24+WwI8MppW1llereWfRgXL++j6OZnG5mr Xd1MsivbWZN1lRzORhhhY9eFLvmZk3B54gemMCuGPCX85iafqohFZQTkeq6QHeH0 dyBQ1KkgTHQJOZ8+o8V+zUIzDhOjiTFMZJ2w7z90BiNBt2wqvHYoUGTY9I9tqtdq TWOoOWkWxElc+HMMEWAq6z9Zxp/QhuPzQ0LqQovmeAGwLwPsuWc1oBE2yhnPDvYP d1PS8t9+RObBgT8qGFR5X20qpzQErRCU7Vh3exBLRcjjwcj73yJ2RNDaXuOgZfwv cjyKY5xi3FtNLX/F6Wus4TbC0nddcKs4I/3i/MoSUrAXhw1hFxhuNZ0gHteI0EZf 21L1XBnMUzz1m43uaIyyJTCU4ppEY8+/dlV0h/bcpWP0JvP7+YmLd3Bv5KFlrGxz c+NDW3O63gw9R7IB3QOYVSlQBIQrnqAjikQVt82hMWbQoh/yz7c= =Ji33 -----END PGP SIGNATURE----- --nmemrqcdn5VTmUEE--