[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [Qemu-devel] [PATCH v1 3/5] hppa: drop usage of memory_
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [qemu-s390x] [Qemu-devel] [PATCH v1 3/5] hppa: drop usage of memory_region_allocate_system_memory() for ROM |
Date: |
Mon, 15 Apr 2019 17:16:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 4/15/19 3:27 PM, Igor Mammedov wrote:
> machine_hppa_init() violates memory_region_allocate_system_memory() contract
> by calling it multiple times which could break with -mem-path. Replace
> the second usage (for 'rom') with memory_region_init_ram() instead.
>
> Signed-off-by: Igor Mammedov <address@hidden>
> ---
> hw/hppa/machine.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
> index d1b1d3c..b413913 100644
> --- a/hw/hppa/machine.c
> +++ b/hw/hppa/machine.c
> @@ -158,9 +158,8 @@ static void machine_hppa_init(MachineState *machine)
> g_free(firmware_filename);
>
> rom_region = g_new(MemoryRegion, 1);
> - memory_region_allocate_system_memory(rom_region, OBJECT(machine),
> - "firmware",
> - (FIRMWARE_END - FIRMWARE_START));
> + memory_region_init_ram(rom_region, NULL, "firmware",
> + (FIRMWARE_END - FIRMWARE_START), &error_fatal);
> memory_region_add_subregion(addr_space, FIRMWARE_START, rom_region);
>
> /* Load kernel */
>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
- [qemu-s390x] [PATCH v1 0/5] Fix misuses of memory_region_allocate_system_memory(), Igor Mammedov, 2019/04/15
- [qemu-s390x] [PATCH v1 1/5] sparc64: use memory_region_allocate_system_memory() only for '-m' specified RAM, Igor Mammedov, 2019/04/15
- [qemu-s390x] [PATCH v1 2/5] ppc: rs6000_mc: drop usage of memory_region_allocate_system_memory(), Igor Mammedov, 2019/04/15
- [qemu-s390x] [PATCH v1 3/5] hppa: drop usage of memory_region_allocate_system_memory() for ROM, Igor Mammedov, 2019/04/15
- Re: [qemu-s390x] [Qemu-devel] [PATCH v1 3/5] hppa: drop usage of memory_region_allocate_system_memory() for ROM,
Philippe Mathieu-Daudé <=
- [qemu-s390x] [PATCH v1 4/5] memory: make MemoryRegion alias migratable, Igor Mammedov, 2019/04/15
- [qemu-s390x] [PATCH v1 5/5] s390: do not call memory_region_allocate_system_memory() multiple times, Igor Mammedov, 2019/04/15
- Re: [qemu-s390x] [PATCH v1 5/5] s390: do not call memory_region_allocate_system_memory() multiple times, Christian Borntraeger, 2019/04/16
- Re: [qemu-s390x] [PATCH v1 5/5] s390: do not call memory_region_allocate_system_memory() multiple times, Christian Borntraeger, 2019/04/16
- Re: [qemu-s390x] [Qemu-devel] [PATCH v1 5/5] s390: do not call memory_region_allocate_system_memory() multiple times, Igor Mammedov, 2019/04/17
- Re: [qemu-s390x] [Qemu-devel] [PATCH v1 5/5] s390: do not call memory_region_allocate_system_memory() multiple times, Igor Mammedov, 2019/04/18
- Re: [qemu-s390x] [Qemu-devel] [PATCH v1 5/5] s390: do not call memory_region_allocate_system_memory() multiple times, David Hildenbrand, 2019/04/18
- Re: [qemu-s390x] [Qemu-devel] [PATCH v1 5/5] s390: do not call memory_region_allocate_system_memory() multiple times, Igor Mammedov, 2019/04/18
- Re: [qemu-s390x] [Qemu-devel] [PATCH v1 5/5] s390: do not call memory_region_allocate_system_memory() multiple times, David Hildenbrand, 2019/04/18