mirror_qemu/hw/ppc
Hu Tao e206ad4833 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>
2014-07-22 17:37:25 +02:00
..
Makefile.objs spapr_pci_vfio: Add spapr-pci-vfio-host-bridge to support vfio 2014-06-27 13:48:23 +02:00
e500-ccsr.h ppc: do not use ../ in include files 2013-03-01 13:57:33 +01:00
e500.c ppc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory 2014-07-15 16:11:58 +02:00
e500.h machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
e500plat.c machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
mac.h hw/ppc/mac.h: remove unused BIOS_FILENAME definition 2013-12-02 21:18:18 +04:00
mac_newworld.c ppc: fix -mem-path failure 2014-07-22 17:37:25 +02:00
mac_oldworld.c ppc: fix -mem-path failure 2014-07-22 17:37:25 +02:00
mpc8544_guts.c cpu: Replace cpu_single_env with CPUState current_cpu 2013-07-09 21:20:28 +02:00
mpc8544ds.c machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
ppc.c spapr: Add support for time base offset migration 2014-06-16 13:24:35 +02:00
ppc4xx_devs.c ppc: fix -mem-path failure 2014-07-22 17:37:25 +02:00
ppc4xx_pci.c savevm: Remove all the unneeded version_minimum_id_old (ppc) 2014-06-16 04:55:26 +02:00
ppc405.h hw: move private headers to hw/ subdirectories. 2013-04-08 18:13:16 +02:00
ppc405_boards.c ppc: fix -mem-path failure 2014-07-22 17:37:25 +02:00
ppc405_uc.c ppc: fix -mem-path failure 2014-07-22 17:37:25 +02:00
ppc440_bamboo.c machine: Conversion of QEMUMachineInitArgs to MachineState 2014-05-28 17:35:01 +02:00
ppc_booke.c hw/ppc: Avoid shifting left into sign bit 2014-03-27 19:22:49 +04:00
ppce500_spin.c ppce500_spin: Initialize struct properly 2014-04-08 11:20:05 +02:00
prep.c ppc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory 2014-07-15 16:11:58 +02:00
spapr.c spapr: Enable use of huge pages 2014-07-15 16:11:59 +02:00
spapr_events.c spapr: Move interrupt allocator to xics 2014-06-27 13:48:26 +02:00
spapr_hcall.c hw/ppc/spapr_hcall.c: Add ULL suffix to 64 bit constant 2014-07-08 16:03:19 +01:00
spapr_iommu.c sPAPR/IOMMU: Fix TCE entry permission 2014-07-15 16:11:59 +02:00
spapr_pci.c spapr_pci: Use XICS interrupt allocator and do not cache interrupts in PHB 2014-06-27 13:48:27 +02:00
spapr_pci_vfio.c spapr_pci_vfio: Add spapr-pci-vfio-host-bridge to support vfio 2014-06-27 13:48:23 +02:00
spapr_rtas.c spapr: Add RTAS sysparm SPLPAR Characteristics 2014-06-27 13:48:26 +02:00
spapr_vio.c spapr: Move interrupt allocator to xics 2014-06-27 13:48:26 +02:00
virtex_ml507.c ppc: memory: Replace memory_region_init_ram with memory_region_allocate_system_memory 2014-07-15 16:11:58 +02:00