History | View | Annotate | Download (21.5 kB)
PPC: BookE: Implement EPR SPR
On the e500 series, accessing SPR_EPR magically turns into an access atthat CPU's IACK register on the MPIC. Implement that logic to get kernelsthat make use of that feature work.
Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: e500: Refactor serial dt generation
When generating serial port device tree nodes, we duplicate quite a bitof code, because there are 2 of them in the mpc8544ds board we emulate.
Shove the generating code into a function, so we duplicate less code....
PPC: e500: allow users to set the /compatible property via -machine
Device trees usually have a node /compatible, which indicate which machinetype we're looking at. For quick prototyping, it can be very useful to changethe contents of that node via the command line....
PPC: e500: Use new MPIC dt format
Due to popular demand, we're updating the way we generate the MPICnode and interrupt lines based on what the current state of art is.
Requested-by: Scott Wood <scottwood@freescale.com>Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: e500: Use new SOC dt format
Due to popular demand, let's clean up the soc node a bit and usemore recent dt notions.
PPC: e500: Define addresses as always 64bit
Every time we use an address constant, it needs to potentially fit intoa 64bit physical address space. So let's define things accordingly.
PPC: e500: Extend address/size of / to 64bit
We want to be able to support >= 4GB of RAM. To do so, we need to be ableto tell the guest OS how much RAM it has.
However, that information today is capped to 32bit. So let's extend theoffset and size fields to 64bit, so we can fit in big addresses and even...
PPC: e500: dt: use 64bit cell helper
We have a nice 64bit helper to ease the device tree generation andmake the code more readable when creating 64bit 2-cell parameters.Use it when generating the device tree.
PPC: e500: dt: use target_phys_addr_t for ramsize
We're passing the ram size as uint32_t, capping it to 32 bits atm.Change to target_phys_addr_t (uint64_t) to make sure we have allthe bits.
PPC: e500: enable manual loading of dtb blob
We want to be able to override the automatically created device treeby using the -dtb option. Implement this for the mpc8544ds machine.
PPC: e500: dt: create /soc8544 node dynamically
PPC: e500: dt: create serial nodes dynamically
PPC: e500: dt: create mpic node dynamically
PPC: e500: dt: create global-utils node dynamically
PPC: e500: dt: create pci node dynamically
PPC: e500: dt: start with empty device tree
Now that all of the device tree bits are generated during runtime, wecan get rid of the device tree blob and instead start from scratch withan empty device tree.
dt: Add -machine dumpdtb option to dump the current dtb
Now that we are dynamically creating the dtb, it's really useful tobe able to dump the created blob for debugging.
This patch implements a -machine dumpdtb=<file> option for e500 thatdumps the dtb exactly in the form the guest would get it to disk. It...
PPC: e500: require libfdt
Now that we're moving all of the device tree generation from an externalpre-execution generated blob to runtime generation using libfdt, we absolutelymust have libfdt around.
This requirement was there before already, as the only way to not require libfdt...
PPC: e500: dt: create memory node dynamically
PPC: e500: dt: create /cpus node dynamically
PPC: e500: dt: create /hypervisor node dynamically
PPC: e500: dt: create / node dynamically
PPC: e500: dt: create /chosen node dynamically
PPC: mpc8544ds: Span initial TLB entry over as much RAM as we need
The initial TLB entry is supposed to help us run the guest -kernel payload.This means the guest needs to be able to access its own memory, the initrdmemory and the device tree.
So far we only statically reserved a TLB entry from [0;256M[. This patch...
target-ppc: Let cpu_ppc_init() return PowerPCCPU
Adapt e500 mpc8544ds machine accordingly.
Turn cpu_init() into a static inline function returning CPUPPCState forbackwards compatibility.
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Alexander Graf <agraf@suse.de>
ppce500_mpc8544ds: Pass PowerPCCPU to mpc8544ds_cpu_reset[_sec]
Allows us to use cpu_reset() in place of cpu_state_reset().
Replace Qemu by QEMU in comments
The official spelling is QEMU.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Andreas Färber <afaerber@suse.de>[blauwirbel@gmail.com: fixed comment style in hw/sun4m.c]Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
ppc hw/: Don't use CPUState
Scripted conversion: for file in hw/ppc*.[hc] hw/mpc8544_guts.c hw/spapr*.[hc] hw/virtex_ml507.c hw/xics.c; do sed -i "s/CPUState/CPUPPCState/g" $file done
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Anthony Liguori <aliguori@us.ibm.com>
Rename cpu_reset() to cpu_state_reset()
Frees the identifier cpu_reset for QOM CPUs (manual rename).
Don't hide the parameter type behind explicit casts, use staticfunctions with strongly typed argument to indirect.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
vmstate, memory: decouple vmstate from memory API
Currently creating a memory region automatically registers it forlive migration. This differs from other state (which is enumeratedin a VMStateDescription structure) and ties the live migration codeinto the memory core....
ppcr500_mpc8544ds: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Merge remote-tracking branch 'upstream' into memory/batch
PPC: booke timers
While working on the emulation of the freescale p2010 (e500v2) I realized thatthere's no implementation of booke's timers features. Currently mpc8544 usesppc_emb (ppc_emb_timers_init) which is close but not exactly like booke (forexample booke uses different SPR)....
kvm: ppc: booke206: use MMU API
Share the TLB array with KVM. This allows us to set the initial TLBboth on initial boot and reset, is useful for debugging, and couldeventually be used to support migration.
Signed-off-by: Scott Wood <scottwood@freescale.com>...
ppc: booke206: use MAV=2.0 TSIZE definition, fix 4G pages
This definition is backward compatible with MAV=1.0 as long asthe guest does not set reserved bits in MAS1/MAS4.
Also, fix the shift in booke206_tlb_to_page_size -- it's the basethat should be able to hold a 4G page size, not the shift count....
MPC8544DS: Generate CPU nodes on init
With this patch, we generate CPU nodes in the machine initialization, givingus the freedom to generate as many nodes as we want and as the machine supports,but only those.
This is a first step towards a much cleaner device tree generation...
PPC: E500: Bump CPU count to 15
Now that we have everything in place, make the machine descriptionaware of the fact that we can now handle 15 virtual CPUs!
v1 -> v2:
- Max cpus is 15 because of MPIC
PPC: E500: Update cpu-release-addr property in cpu nodes
The guest OS wants to know where the guest spins, so let's tell him whileupdating the CPU nodes with the frequencies anyways.
- use new spin table address
PPC: E500: Add PV spinning code
CPUs that are not the boot CPU need to run in spinning code to check if theyshould run off to execute and if so where to jump to. This usually happensby leaving secondary CPUs looping and checking if some variable in memory...
PPC: E500: Update freqs for all CPUs
Now that we can so nicely find out the host's frequencies, we should alsomake sure that we get them into all virtual CPUs' device tree nodes.
PPC: E500: Remove unneeded CPU nodes
We should only keep CPU nodes in the device tree around that we really havevirtual CPUs for. So remove all superfluous entries that we just keep therein case someone wants to create a lot of vCPUs.
PPC: E500: Use generic kvm function for freq
Now that we have generic KVM functions to read out the host tb and clockfrequencies, let's use them in the e500 code!
PPC: E500: Remove mpc8544_copy_soc_cell
We don't need mpc8544_copy_soc_cell anymore, since we're explicitly readinghost values and writing guest values respectively.
PPC: E500: create multiple envs
When creating a VM, we should go through smp_cpus and create a virtual CPU forevery CPU the user requested. This patch adds support for that and moves somecode around to make that more convenient.
PPC: E500: Generate IRQ lines for many CPUs
Now that we can generate multiple envs for all our virtual CPUs, wealso need to tell the MPIC that we have multiple CPUs connected andconnect them all to the respective virtual interrupt lines.
serial: Add MemoryRegion parameter to serial_mm_init
Remove the get_system_memory() call from serial_mm_init, pushingit back into the callers. In many cases we already have thesystem memory region available.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
openpic: Memory API conversion for mpic
This patch converts mpic to the new memory API (through old mmio).
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>Signed-off-by: Avi Kivity <avi@redhat.com>
serial: Use enum device_endian in serial_mm_init parameter
The use of DEVICE_NATIVE_ENDIAN cleans up lots of ifdefs inmany of the callers.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Avi Kivity <avi@redhat.com>
serial: Remove ioregister parameter from serial_mm_init
All callers passed 1.
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
PPC: E500: Use MAS registers instead of internal TLB representation
The natural format for e500 cores to do TLB manipulation with are the MASregisters. Instead of converting them into some internal representationand back again when the guest reads them, we can just keep the data...
PPC: mpc8544ds: Add hypervisor node
When running a PPC guest with KVM that can do PV operations, we needto indicate the guest which instructions to use for a hypercall andthat it is running as KVM guest.
This logic was available on openbios based machines already. This patch...
PPC: E500: Implement reboot controller
When Linux reboots an e500 VM, it writes to a magic register in the"global-utilities" device indicated by the device tree. We were notemulating that device so far, rendering the VM reboot-less.
This patch implements that device with only the reboot functionality...
PPC: fix mpc8544ds pci default devices
After the Qdev'ification of the MPC8544DS board and PCI bus, the internalPCI bus name changed from "pci" to "pci.0". Reflect this change in thesearch for that bus.
This patch enables networking on e500 guests again....
PPC: Qdev'ify e500 pci
The e500 PCI controller isn't qdev'ified yet. This leads to severe issueswhen running with -drive.
To be able to use a virtio disk with an e500 VM, let's convert the PCIcontroller over to qdev.
Reviewed-by: Paul Brook <paul@codesourcery.com>...
PPC: Make MPC8544DS obey -cpu switch
The MPC8544DS board emulation code ignored the user defined -cpu switch.This patch enables it to only provide a sane default, not force an e500v2CPU inside.
PPC: Make MPC8544DS emulation work w/o KVM
The MPC8544DS board emulation was only used with KVM so far, so someparts of the code didn't provide proper values for non-KVM execution.
This patch makes the machine work without KVM enabled. To actually usethis, you also need proper e500v2 MMU emulation....
PPC MPC7544DS: Use new TLB helper function
Now that we have some nice helpers that can find us a TLB entry, let'suse that on the machine initialization code, so we don't need to knowabout the internals of the TLB array.
Don't call cpu_synchronize_state() from machine init.
This will deadlock when the I/O thread is used, since theCPU thread is blocked waiting for qemu_system_ready.
The synchronization is unnecessary since this is beforecpu_synchronize_all_post_init()....
isa_mmio: Always use little endian
This patch converts the ISA MMIO bridge code to always use little endian mmio.All bswap code that existed was only there to convert from native cpuendianness to little endian ISA devices.
Signed-off-by: Alexander Graf <agraf@suse.de>...
Delete write only variables
Compiling with GCC 4.6.0 20100925 produced warnings like:/src/qemu/net/tap-win32.c: In function 'tap_win32_open':/src/qemu/net/tap-win32.c:582:12: error: variable 'hThread' set but not used [-Werror=unused-but-set-variable]...
qemu_ram_alloc: Add DeviceState and name parameters
These will be used to generate unique id strings for ramblocks. The namefield is required, the device pointer is optional as most callers don'thave a device. When there's no device or the device isn't a child of...
Compile serial only once
Push TARGET_WORDS_BIGENDIAN dependency to board level.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Compile isa_mmio only once
load_elf: replace the address addend by a translation function
A few machines need to translate the ELF header addresses into physicaladdresses. Currently the only possibility is to add a value to theaddresses.
This patch replaces the addend argument by and a translation function...
powerpc/e500: adjust fdt and ramdisk loading addr
Since kernel uimage is getting bigger,old fixed loading bases will result in regions overlap.
Add pad for fdt and ramdisk, so that they won't overlap with uimage.
Signed-off-by: Liu Yu <yu.liu@freescale.com>...
powerpc: fix compilation with CONFIG_FDT undefined
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
powerpc/booke: move fdt loading to rom infrastructure
It's convinent to use rom to checking overlap, to reset etc.And uImage and ramdisk loading has already moved to it.
Also, after we add fdt to rom, free it.
target-ppc: add synchronize register for booke init
So that the following registers init could be flushed back to kvm.
Signed-off-by: Liu Yu <yu.liu@freescale.com>Acked-by: Hollis Blanchard <hollis@penguinppc.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix pci_add nic not to exit on bad model
Monitor command "pci_add ADDR nic model=MODEL" uses pci_nic_init() tocreate the NIC. When MODEL is unknown or "?", this prints to stderrand terminates the program.
Change pci_nic_init() not to treat "?" specially, and to return NULL...
Revert "Get rid of _t suffix"
In the very least, a change like this requires discussion on the list.
The naming convention is goofy and it causes a massive merge problem. Somethinglike this must be presented on the list first so people can provide input...
Get rid of _t suffix
Some not so obvious bits, slirp and Xen were left alone for the timebeing.
Signed-off-by: malc <av1474@comtv.ru>
Compile loader only once
Callers must pass ELF machine, byte swapping and symbol LSB clearinginformation to ELF loader. A.out loader needs page size information, passthat too as a parameter.
Extract prototypes to a separate file. Move loader.[ch] and elf_ops.h under hw....
qdev-ify virtio-blk.
First user of the new drive property. With this patch applied hostand guest config can be specified separately, like this:
-drive if=none,id=disk1,file=/path/to/disk.img -device virtio-blk-pci,drive=disk1
You can set any property for virtio-blk-pci now. You can set the pci...
Rename HAVE_FDT to CONFIG_FDT and define it also in Makefile
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kill drives_table
First step cleaning up the drives handling. This one does nothing butremoving drives_table[], still it became seriously big.
drive_get_index() is gone and is replaced by drives_get() which handsout DriveInfo pointers instead of a table index. This needs adaption in...
Support addr=... in option argument of -net nic
Make net_client_init() accept addr=, put the value into structNICinfo. Use it in pci_nic_init(), and remove arguments bus anddevfn.
Don't support addr= in third argument of monitor command pci_add,because that clashes with its first argument. Admittedly unelegant....
Support addr=... in option argument of -drive if=virtio
Make drive_init() accept addr=, put the value into struct DriveInfo.Use it in all the places that create virtio-blk-pci devices:pc_init1(), bamboo_init(), mpc8544ds_init().
Don't support addr= in third argument of monitor command pci_add and...
Use relative path for bios
Look for bios and other support files relative to qemu binary, rather thana hardcoded prefix.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Convert machine registration to use module init functions
This cleans up quite a lot of #ifdefs, extern variables, and other ugliness.
Separate virtio PCI code
Split the PCI host bindings from the VRing transport implementation.
Virtio-blk qdev conversion
Remove vga_ram_size
The vga_ram_size argument to machine init functions always has the samevalue, and is ignored by many machines (including SPARC32 which has anobsolete ifdef for VGA_RAM_SIZE).
Remove it and push VGA_RAM_SIZE into vga_int.h.
Remove redundant ram_require machine properly.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7090 c046a42c-6fe2-441c-8c8c-71466251a162
Wean device tree code off phys_ram_base.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7068 c046a42c-6fe2-441c-8c8c-71466251a162
More phys_ram_base elimination.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7064 c046a42c-6fe2-441c-8c8c-71466251a162
Sparse fixes: NULL use, header order, ANSI prototypes, static
Fix Sparse warnings: * use NULL instead of plain 0 * rearrange header include order to avoid redefining types accidentally * ANSIfy SLIRP * avoid "restrict" keyword * add static
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6736 c046a42c-6fe2-441c-8c8c-71466251a162
kvm/powerpc: Add MPC8544DS board support
This patch add an emulation of MPC8544DS board.It can work on All E500 platforms.
Signed-off-by: Liu Yu <yu.liu@freescale.com>Acked-by: Hollis Blanchard <hollisb@us.ibm.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>...