mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 18:44:58 -06:00
ppc: fix -mem-path failure
commit e938ba0c
tried to enable -mem-path for ppc but breaked some ppc
boards.
The problems are:
1. it fails when allocating memory for rom, sram whose sizes are less
than huge page size:
./ppc-softmmu/qemu-system-ppc -m 512 -mem-path /hugepages/ \
-kernel /home/hutao/Downloads/vmlinux-ppc -initrd \
/home/hutao/Downloads/initrd-ppc.gz
qemu-system-ppc: /mnt/data/projects/qemu/exec.c:1184: qemu_ram_set_idstr: Assertion `new_block' failed.
2. if there is a numa node backed by memory backend object, qemu fails
with message:
./ppc-softmmu/qemu-system-ppc -m 512 \
-object memory-backend-file,size=512M,mem-path=/hugepages,id=f0 \
-numa node,nodeid=0,memdev=f0 \
-kernel /home/hutao/Downloads/vmlinux-ppc \
-initrd /home/hutao/Downloads/initrd-ppc.gz
qemu-system-ppc: memory backend f0 is used multiple times. Each -numa option must use a different memdev value.
This patch does following:
1. replaces memory_region_allocate_system_memory() with
memory_region_init_ram() for rom, sram. Then only system memory
is backed by hugepages when specifying mem-path.
2. for memory banks, allocates all ram with
one memory_region_allocate_system_memory(), and use
memory_region_init_alias() to initialize memory banks.
Tested machines: default(g3beige), mac99, taihu, bamboo, ref405ep.
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
35858955e6
commit
e206ad4833
5 changed files with 52 additions and 28 deletions
|
@ -204,8 +204,9 @@ static void ppc_core99_init(MachineState *machine)
|
|||
memory_region_add_subregion(get_system_memory(), 0, ram);
|
||||
|
||||
/* allocate and load BIOS */
|
||||
memory_region_allocate_system_memory(bios, NULL, "ppc_core99.bios",
|
||||
BIOS_SIZE);
|
||||
memory_region_init_ram(bios, NULL, "ppc_core99.bios", BIOS_SIZE);
|
||||
vmstate_register_ram_global(bios);
|
||||
|
||||
if (bios_name == NULL)
|
||||
bios_name = PROM_FILENAME;
|
||||
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue