[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RESEND v2 17/32] hw/ppc/ppc405: Use memory_region_init_rom()
From: |
David Gibson |
Subject: |
Re: [PATCH RESEND v2 17/32] hw/ppc/ppc405: Use memory_region_init_rom() with read-only regions |
Date: |
Tue, 25 Feb 2020 11:24:03 +1100 |
On Mon, Feb 24, 2020 at 09:55:18PM +0100, Philippe Mathieu-Daudé wrote:
> The scripts/coccinelle/memory-region-housekeeping.cocci reported:
> * TODO
> [[view:./hw/ppc/ppc405_boards.c::face=ovl-face1::linb=195::colb=8::cole=30][potential
> use of memory_region_init_rom*() in ./hw/ppc/ppc405_boards.c::195]]
> * TODO
> [[view:./hw/ppc/ppc405_boards.c::face=ovl-face1::linb=464::colb=8::cole=30][potential
> use of memory_region_init_rom*() in ./hw/ppc/ppc405_boards.c::464]]
>
> We can indeed replace the memory_region_init_ram() and
> memory_region_set_readonly() calls by memory_region_init_rom().
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Acked-by: David Gibson <address@hidden>
> ---
> hw/ppc/ppc405_boards.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
> index 1f721feed6..5afe023253 100644
> --- a/hw/ppc/ppc405_boards.c
> +++ b/hw/ppc/ppc405_boards.c
> @@ -192,7 +192,7 @@ static void ref405ep_init(MachineState *machine)
> #endif
> {
> bios = g_new(MemoryRegion, 1);
> - memory_region_init_ram(bios, NULL, "ef405ep.bios", BIOS_SIZE,
> + memory_region_init_rom(bios, NULL, "ef405ep.bios", BIOS_SIZE,
> &error_fatal);
>
> if (bios_name == NULL)
> @@ -216,7 +216,6 @@ static void ref405ep_init(MachineState *machine)
> /* Avoid an uninitialized variable warning */
> bios_size = -1;
> }
> - memory_region_set_readonly(bios, true);
> }
> /* Register FPGA */
> ref405ep_fpga_init(sysmem, 0xF0300000);
> @@ -461,7 +460,7 @@ static void taihu_405ep_init(MachineState *machine)
> if (bios_name == NULL)
> bios_name = BIOS_FILENAME;
> bios = g_new(MemoryRegion, 1);
> - memory_region_init_ram(bios, NULL, "taihu_405ep.bios", BIOS_SIZE,
> + memory_region_init_rom(bios, NULL, "taihu_405ep.bios", BIOS_SIZE,
> &error_fatal);
> filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
> if (filename) {
> @@ -479,7 +478,6 @@ static void taihu_405ep_init(MachineState *machine)
> error_report("Could not load PowerPC BIOS '%s'", bios_name);
> exit(1);
> }
> - memory_region_set_readonly(bios, true);
> }
> /* Register Linux flash */
> dinfo = drive_get(IF_PFLASH, 0, fl_idx);
--
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
signature.asc
Description: PGP signature
- [PATCH RESEND v2 10/32] hw/pci-host: Use memory_region_init_rom() with read-only regions, (continued)
- [PATCH RESEND v2 10/32] hw/pci-host: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 11/32] hw/ppc: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 12/32] hw/riscv: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 13/32] hw/sh4: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 14/32] hw/sparc: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 15/32] scripts/cocci: Patch to detect potential use of memory_region_init_rom, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 16/32] hw/arm/stm32: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 17/32] hw/ppc/ppc405: Use memory_region_init_rom() with read-only regions, Philippe Mathieu-Daudé, 2020/02/24
- Re: [PATCH RESEND v2 17/32] hw/ppc/ppc405: Use memory_region_init_rom() with read-only regions,
David Gibson <=
- [PATCH RESEND v2 18/32] hw/i386/pc_sysfw: Simplify using memory_region_init_alias(), Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 19/32] hw/i386/pc_sysfw: Remove unused 'ram_size' argument, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 20/32] scripts/cocci: Patch to remove unnecessary memory_region_set_readonly(), Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 21/32] hw/arm: Remove unnecessary memory_region_set_readonly() on ROM alias, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 22/32] scripts/cocci: Patch to let devices own their MemoryRegions, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 23/32] hw/arm: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 24/32] hw/char: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 25/32] hw/core: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24