[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RESEND v2 18/32] hw/i386/pc_sysfw: Simplify using memory_regi
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH RESEND v2 18/32] hw/i386/pc_sysfw: Simplify using memory_region_init_alias() |
Date: |
Tue, 25 Feb 2020 13:39:15 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 25/02/20 11:05, Philippe Mathieu-Daudé wrote:
>>
>> pc_isa_bios_init() does a manual copy of a part of the BIOS,
>> from a read-only region. We can simplify by directly aliasing
>> the same part.
>>
>> Before:
>>
>> (qemu) info mtree
>> memory-region: system
>> 0000000000000000-ffffffffffffffff (prio 0, i/o): system
>> 0000000000000000-0000000007ffffff (prio 0, ram): alias
>> ram-below-4g @pc.ram 0000000000000000-0000000007ffffff
>> 0000000000000000-ffffffffffffffff (prio -1, i/o): pci
>> 00000000000a0000-00000000000bffff (prio 1, i/o): vga-lowmem
>> 00000000000c0000-00000000000dffff (prio 1, rom): pc.rom
>> 00000000000e0000-00000000000fffff (prio 1, rom): isa-bios
>> ...
>> 00000000fff00000-00000000ffffffff (prio 0, romd): system.flash0
>>
>> After:
>>
>> (qemu) info mtree
>> memory-region: system
>> 0000000000000000-ffffffffffffffff (prio 0, i/o): system
>> 0000000000000000-0000000007ffffff (prio 0, ram): alias
>> ram-below-4g @pc.ram 0000000000000000-0000000007ffffff
>> 0000000000000000-ffffffffffffffff (prio -1, i/o): pci
>> 00000000000a0000-00000000000bffff (prio 1, i/o): vga-lowmem
>> 00000000000c0000-00000000000dffff (prio 1, rom): pc.rom
>> 00000000000e0000-00000000000fffff (prio 1, romd): alias
>> isa-bios @system.flash0 00000000000e0000-00000000000fffff
>> ...
>> 00000000fff00000-00000000ffffffff (prio 0, romd): system.flash0
>
> IIUC migrating old -> new is OK, the previous ROM copy is discarded.
>
> What about new -> old, does it require specific handling? Do we care?
Old->new is broken because the "isa-bios" memory region is not found.
qemu-system-x86_64: Unknown ramblock "isa-bios", cannot accept migration
qemu-system-x86_64: error while loading state for instance 0x0 of device 'ram'
qemu-system-x86_64: load of migration failed: Invalid argument
Paolo
- Re: [PATCH RESEND v2 11/32] hw/ppc: Use memory_region_init_rom() with read-only regions, (continued)
- [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
- [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
- [PATCH RESEND v2 26/32] hw/display: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 27/32] hw/dma: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24
- [PATCH RESEND v2 28/32] hw/riscv: Let devices own the MemoryRegion they create, Philippe Mathieu-Daudé, 2020/02/24