summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-11-10Merge remote-tracking branch 'remotes/xtensa/tags/20141110-xtensa' into stagingPeter Maydell3-0/+63
Xtensa fixes for 2.2: - fix entry opcode register window checking and add unit test. # gpg: Signature made Mon 10 Nov 2014 15:01:47 GMT using RSA key ID F83FA044 # gpg: Good signature from "Max Filippov <max.filippov@cogentembedded.com>" # gpg: aka "Max Filippov <jcmvbkbc@gmail.com>" * remotes/xtensa/tags/20141110-xtensa: target-xtensa: add entry overflow test target-xtensa: add missing window check for entry Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-11-10Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell9-24/+87
Block patches # gpg: Signature made Mon 10 Nov 2014 09:42:07 GMT using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: block/vdi: Limit maximum size even futher qapi: Complete BlkdebugEvent iotests: Add test for non-existing backing file block: Propagate error in bdrv_img_create() qemu-img: Omit error_report() after img_open() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-11-10target-xtensa: add entry overflow testMax Filippov1-0/+51
Check that entry instruction raises window overflow exception when PS.CALLINC points to live registers. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-11-10target-xtensa: add missing window check for entryMax Filippov2-0/+12
Entry opcode needs to check if moving to new register frame would cause register window overflow. Entry used in function prologue never overflows because preceding windowed call* opcode writes return address to the target register window frame, causing overflow exceptions at the point of call. But when a sequence of entry opcodes is used for register window spilling there may not be a call or other opcode that would cause window check between entries and they would not raise overflow exception themselves resulting in data corruption. Cc: qemu-stable@nongnu.org Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2014-11-10Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20141105' into stagingPeter Maydell3-10/+24
Several bugfixes for s390x: - instruction decoding and sparse warning in kvm - overlong input and hangs in the sclp consoles # gpg: Signature made Wed 05 Nov 2014 15:42:14 GMT using RSA key ID C6F02FAF # gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>" # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" * remotes/cohuck/tags/s390x-20141105: s390x/sclpconsole: Avoid hanging SCLP ASCII console s390x/sclpconsole-lm: Fix hanging SCLP line mode console s390x/sclpconsole-lm: truncate input if line is too long s390x/kvm: Fix warning from sparse s390x/kvm: Fix opcode decoding for eb instruction handler Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-11-10Merge remote-tracking branch 'remotes/lalrae/tags/mips-20141107' into stagingPeter Maydell6-14/+30
* remotes/lalrae/tags/mips-20141107: target-mips: fix multiple TCG registers covering same data mips: Ensure PC update with MTC0 single-stepping target-mips: fix for missing delay slot in BC1EQZ and BC1NEZ mips: Set the CP0.Config3.DSP and CP0.Config3.DSP2P bits mips: Add macros for CP0.Config3 and CP0.Config4 bits mips: Respect CP0.Status.CU1 for microMIPS FP branches mips: Remove CONFIG_VT82C686 from non-Fulong configs Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-11-10Merge remote-tracking branch 'remotes/amit/tags/vser-2.2.0-queue-2' into stagingPeter Maydell1-1/+1
Fixes a crash when a virtio-serial port is added without a name to it. # gpg: Signature made Fri 07 Nov 2014 04:58:05 GMT using RSA key ID 854083B6 # gpg: Good signature from "Amit Shah <amit@amitshah.net>" # gpg: aka "Amit Shah <amit@kernel.org>" # gpg: aka "Amit Shah <amitshah@gmx.net>" * remotes/amit/tags/vser-2.2.0-queue-2: virtio-serial: avoid crash when port has no name Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-11-10Merge remote-tracking branch 'mreitz/block' into queue-blockKevin Wolf3-14/+27
* mreitz/block: block/vdi: Limit maximum size even futher
2014-11-09block/vdi: Limit maximum size even futherMax Reitz3-14/+27
The block layer read and write functions do not like requests which are bigger than INT_MAX bytes. Since the VDI bmap is read and written in a single operation, its size is therefore limited accordingly. This reduces the maximum VDI image size supported by QEMU to half of what it currently is (down to approximately 512 TB). The VDI test 084 has to be adapted accordingly. Actually, one could clearly see that it was broken from the "Could not open 'TEST_DIR/t.IMGFMT': Invalid argument" line for an image which was supposed to work just fine. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Peter Lieven <pl@kamp.de>
2014-11-07qapi: Complete BlkdebugEventMax Reitz1-1/+3
Several events were missing from the QAPI enum, add them. Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-11-07target-mips: fix multiple TCG registers covering same dataYongbok Kim1-5/+3
Avoid to allocate different TCG registers for the FPU registers that are mapped on the MSA vectore registers. Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2014-11-07mips: Ensure PC update with MTC0 single-steppingMaciej W. Rozycki1-1/+1
Correct the way PC is updated when single-stepping instructions, by keeping the old PC only for the BS_EXCP (exception condition) state. Some MTC0 (and possibly other) instructions switch to the BS_STOP state to terminate the current translation block, so that the state transition of the simulated CPU resulting from the CP0 operation takes effect with the following instruction. This happens with `mtc0 <reg>,c0_config' for example, typically used to set KSEG0 cacheability. While single-stepping this has a side-effect of not advancing the PC past the instruction just executed; subsequent single-step traps will stop at the same instruction repeatedly. Example: (gdb) stepi 0x80004d24 in _start () 5: x/i $pc => 0x80004d24 <_start+364>: mfc0 t1,c0_config (gdb) 0x80004d28 in _start () 5: x/i $pc => 0x80004d28 <_start+368>: li at,-8 (gdb) 0x80004d2c in _start () 5: x/i $pc => 0x80004d2c <_start+372>: and t1,t1,at (gdb) 0x80004d30 in _start () 5: x/i $pc => 0x80004d30 <_start+376>: ori t1,t1,0x3 (gdb) 0x80004d34 in _start () 5: x/i $pc => 0x80004d34 <_start+380>: mtc0 t1,c0_config (gdb) 0x80004d34 in _start () 5: x/i $pc => 0x80004d34 <_start+380>: mtc0 t1,c0_config (gdb) 0x80004d34 in _start () 5: x/i $pc => 0x80004d34 <_start+380>: mtc0 t1,c0_config (gdb) 0x80004d34 in _start () 5: x/i $pc => 0x80004d34 <_start+380>: mtc0 t1,c0_config (gdb) -- oops! Signed-off-by: Maciej W. Rozycki <macro@codesourcery.com> Reviewed-by: Leon Alrae <leon.alrae@imgtec.com> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2014-11-07target-mips: fix for missing delay slot in BC1EQZ and BC1NEZLeon Alrae1-0/+1
New R6 COP1 conditional branches currently don't have delay slot. Fixing this by setting MIPS_HFLAG_BDS32 flag which is required for branches having 4-byte delay slot. Signed-off-by: Leon Alrae <leon.alrae@imgtec.com> Reviewed-by: Yongbok Kim <yongbok.kim@imgtec.com>
2014-11-07mips: Set the CP0.Config3.DSP and CP0.Config3.DSP2P bitsMaciej W. Rozycki1-3/+5
Set the CP0.Config3.DSP2P bit for the 74kf processor and both that bit and the CP0.Config3.DSP bit for the artificial mips32r5-generic and mips64dspr2 processors. They have the DSPr2 ASE enabled in `insn_flags' and CPUs that implement that ASE need to have both CP0.Config3.DSP and CP0.Config3.DSP2P set or software won't detect its presence. Signed-off-by: Maciej W. Rozycki <macro@codesourcery.com> Reviewed-by: Leon Alrae <leon.alrae@imgtec.com> [leon.alrae@imgtec.com: remove DSP flags from mips32r5-generic] Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2014-11-07mips: Add macros for CP0.Config3 and CP0.Config4 bitsMaciej W. Rozycki1-0/+13
Define macros for CP0.Config3 and CP0.Config4 bits. These used to be exhaustive as at MIPS32r3, but more bits may have been added since. Signed-off-by: Maciej W. Rozycki <macro@codesourcery.com> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2014-11-07mips: Respect CP0.Status.CU1 for microMIPS FP branchesMaciej W. Rozycki1-2/+7
Make microMIPS FP branches respect CP0.Status.CU1 and trap with a Coprocessor Unusable exception if COP1 has been disabled; also trap if no FPU is present at all. Standard MIPS FP instruction encodings have a more regular structure and branches are covered with a single umbrella along other instructions. This is not the case with the microMIPS encoding, this case has to be taken care of explicitly here. Code to do so has been copied from the standard MIPS code handler for OPC_CP1, in `decode_opc'. Problems arising from this bug will generally only show up on user context switches in operating systems making use of lazy FP context switches, such as Linux. It will also more readily trigger if software FPU emulation is used, either implicitly on a non-float CPU, or forced on a hard-float CPU such as with the "nofpu" Linux kernel command line argument. The problem may have been easily missed because we have no hard-float microMIPS CPU configuration present; in fact we have no microMIPS CPU configuration of any kind present. Signed-off-by: Maciej W. Rozycki <macro@codesourcery.com> Reviewed-by: Leon Alrae <leon.alrae@imgtec.com> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2014-11-07mips: Remove CONFIG_VT82C686 from non-Fulong configsMaciej W. Rozycki3-3/+0
Fix the regression introduced with commit 47934d0aadc075b05ce2d9e8a44fa6a46edd1afa [hw: move ISA bridges and devices to hw/isa/, configure with default-configs/], by removing CONFIG_VT82C686 from configurations that previously did not enable it. That southbridge is only available on Fulong platforms (CONFIG_FULONG) that are exclusively little-endian, 64-bit MIPS. Previously vt82c686.o was pulled explicitly with obj-$(CONFIG_FULONG). Signed-off-by: Maciej W. Rozycki <macro@codesourcery.com> Reviewed-by: Leon Alrae <leon.alrae@imgtec.com> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2014-11-07virtio-serial: avoid crash when port has no nameMarc-André Lureau1-1/+1
It seems "name" is not mandatory, and the following command line (based on one generated by current libvirt) will crash qemu at start: qemu-system-x86_64 \ -device virtio-serial-pci \ -device virtserialport,name=foo \ -device virtconsole Program received signal SIGSEGV, Segmentation fault. __strcmp_ssse3 () at ../sysdeps/x86_64/strcmp.S:210 210 movlpd (%rsi), %xmm2 Missing separate debuginfos, use: debuginfo-install python-libs-2.7.5-13.fc20.x86_64 (gdb) bt #0 __strcmp_ssse3 () at ../sysdeps/x86_64/strcmp.S:210 #1 0x000055555566bdc6 in find_port_by_name (name=0x0) at /home/elmarco/src/qemu/hw/char/virtio-serial-bus.c:67 Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com> Reviewed-by: Amos Kong <akong@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
2014-11-06iotests: Add test for non-existing backing fileMax Reitz3-0/+57
Test the error message when a COW file is about to be created which is supposed to inherit the size of its backing file, while the backing file given does not actually exist. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Peter Lieven <pl@kamp.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-11-06block: Propagate error in bdrv_img_create()Max Reitz1-5/+0
If the specified backing file could not be opened, do not generate a new error message which contains the message which has been generated by bdrv_open(), but just propagate the latter. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Peter Lieven <pl@kamp.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-11-06qemu-img: Omit error_report() after img_open()Max Reitz1-4/+0
img_open() already prints an error if the operation failed, so there should not be another error_report() afterwards. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-11-05s390x/sclpconsole: Avoid hanging SCLP ASCII consoleHeinz Graalfs1-1/+11
Force recalculation of file descriptor sets for main loop's poll(), in order to be able to readd a possibly removed input file descriptor after can_read() returned 0 (zero). Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-11-05s390x/sclpconsole-lm: Fix hanging SCLP line mode consoleHeinz Graalfs1-0/+1
Trigger recalculating sets of file descriptors for the main loop's poll() in order to make sure a possibly removed FD 0 from the poll() file descriptor array is re-added. FD 0 is removed from the decriptor array when the console's can_read() callback returns 0. Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-11-05s390x/sclpconsole-lm: truncate input if line is too longHeinz Graalfs1-4/+7
As the SCLP line mode console input length is limited by the available SCCB buffer space, it might lock up if the input does not fit into the buffer. With this patch, characters that don't fit are 'eaten' up to the next CR/LF and the input line is sent truncated to the guest. Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-11-05s390x/kvm: Fix warning from sparseThomas Huth1-1/+1
When running "sparse" with the s390x kvm.c code, it complains that "constant 0x00400f1d40330000 is so big it is long" - let's fix this by appending a proper suffix. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-11-05s390x/kvm: Fix opcode decoding for eb instruction handlerFrank Blaschka1-4/+4
The second byte of the opcode is encoded in the lowest byte of the ipb field, not the lowest byte of the ipa field. Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2014-11-05Update version for v2.2.0-rc0 releasev2.2.0-rc0Peter Maydell1-1/+1
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-11-05Merge remote-tracking branch 'remotes/agraf/tags/signed-s390-for-upstream' ↵Peter Maydell3-5/+15
into staging Patch queue for s390 - 2014-11-05 Two simple bug fixes to enable slightly newer guest kernels and preliminary -M s390-ccw support for TCG (virtio doesn't work yet!) # gpg: Signature made Wed 05 Nov 2014 11:01:55 GMT using RSA key ID 03FEDC60 # gpg: Good signature from "Alexander Graf <agraf@suse.de>" # gpg: aka "Alexander Graf <alex@csgraf.de>" * remotes/agraf/tags/signed-s390-for-upstream: s390x: Implement SAM{24,31,64} s390x: Fix sclp console input Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-11-05vhost-user-test: Fix 'make check' broken on glib < 2.26Gonglei1-1/+22
After commit 89b516d8, some logics is turbid and breaks 'make check' as below errors: tests/vhost-user-test.c: In function '_cond_wait_until': tests/vhost-user-test.c:154: error: 'G_TIME_SPAN_SECOND' undeclared (first use in this function) tests/vhost-user-test.c:154: error: (Each undeclared identifier is reported only once tests/vhost-user-test.c:154: error: for each function it appears in.) tests/vhost-user-test.c: In function 'read_guest_mem': tests/vhost-user-test.c:192: warning: implicit declaration of function 'g_get_monotonic_time' tests/vhost-user-test.c:192: warning: nested extern declaration of 'g_get_monotonic_time' tests/vhost-user-test.c:192: error: 'G_TIME_SPAN_SECOND' undeclared (first use in this function) make: *** [tests/vhost-user-test.o] Error 1 First, vhost-usr-test.c rely on glib-compat.h because of using G_TIME_SPAN_SECOND [glib < 2.26] and g_get_monotonic_time(), but vhost-usr-test.c defined QEMU_GLIB_COMPAT_H, which make glib-compat.h will not be included. Second, if we remove QEMU_GLIB_COMPAT_H definability in vhost-usr-test.c, then we will get below warnings: tests/vhost-user-test.c: In function 'read_guest_mem': tests/vhost-user-test.c:190: warning: passing argument 1 of 'g_mutex_lock' from incompatible pointer type tests/vhost-user-test.c:234: warning: passing argument 1 of 'g_mutex_unlock' from incompatible pointer type That's because glib-compat.h redefine the g_mutex_lock/unlock function. Those functions' arguments is CompatGMutex/CompatGCond, but vhost-user-test.c is using GMutex/GCond, which cause the type is not consistent. We can rerealize those functions of vhost-user-test.c, which need a lots of patches. Let's simply address it, and leave this file alone. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Message-id: 1415149259-6188-1-git-send-email-arei.gonglei@huawei.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-11-05s390x: Implement SAM{24,31,64}Alexander Graf2-3/+15
The SAM instructions simply change 2 bits in PSW.MASK to advertise the current memory mode. While we can't fully guarantee that 31 bit mode (or even remotely 24 bit mode) actually work correctly, we don't check whether lpswe modifies these bits, so we shouldn't keep the guest from executing SAM instructions either. This patch implements all SAM instrutions with their actual PSW changing semantics, making more recent Linux kernels boot properly which do issue a SAM31 call during early boot. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Reviewed-by: Richard Henderson <rth@twiddle.net>
2014-11-05s390x: Fix sclp console inputAlexander Graf1-2/+0
When injecting an sclp console interrupt into the guest, we increase the PC by 4 for some reason. I have no idea why I put that code there, but it's clearly wrong. Remove the increment. This patch fixes sclp serial input for the ccw machine. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
2014-11-04Merge remote-tracking branch 'remotes/agraf/tags/signed-ppc-for-upstream' ↵Peter Maydell30-233/+1216
into staging Patch queue for ppc - 2014-11-04 Fun things for 2.2: - e500 virt machine: power off support (needs 3.19 guests) - e500 virt machine: -device eTSEC support - new framework to allow dynamic spawning of sysbus devices - spapr: enable migration of nvram - new 440x5wDFPU cpu type - Altivec and other random fixes # gpg: Signature made Tue 04 Nov 2014 22:26:39 GMT using RSA key ID 03FEDC60 # gpg: Good signature from "Alexander Graf <agraf@suse.de>" # gpg: aka "Alexander Graf <alex@csgraf.de>" * remotes/agraf/tags/signed-ppc-for-upstream: (34 commits) spapr: Allow dynamic creation of PHB target-ppc: Fix Altivec Round Opcodes target-ppc: Fix vcmpbfp. Unordered Case target-ppc: Fix Altivec Shifts target-ppc: simplify AES emulation e500: Add support for eTSEC in device tree PPC: e500: Support dynamically spawned sysbus devices sysbus: Add new platform bus helper device sysbus: Expose MMIO enumeration helper sysbus: Expose IRQ enumeration helpers sysbus: Make devices spawnable via -device sysbus: Add dynamic sysbus device search hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*) ppc: do not look at the MMU index to detect PR/HV mode target-ppc: kvm: Fix memory overflow issue about strncat() spapr_nvram: Enable migration PPC: E500: Hook up power off GPIO to GPIO controller PPC: E500: Instantiate MPC8XXX gpio controller on virt machine PPC: Add MPC8XXX gpio controller target-ppc: Fix an invalid free in opcode table handling code. ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-11-04spapr: Allow dynamic creation of PHBAlexander Graf1-0/+21
Now that we finally check for presence of dangling sysbus devices, make check started complaining that the sPAPR PHB is one such device. However, it really isn't. The spapr PHB is not really a traditional sysbus device, but much more a special spapr pv device which is already able to get created dynamically. Move spapr to its own dynamic sysbus check handling and allow PHB devices to get allocated dynamically. Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04target-ppc: Fix Altivec Round OpcodesTom Musta1-6/+6
Correct the opcodes for the vrfim, vrfin and vrfiz instructions. Signed-off-by: Tom Musta <tommusta@gmail.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04target-ppc: Fix vcmpbfp. Unordered CaseTom Musta1-1/+1
Fix the implementation of Vector Compare Bounds Single Precision. Specifically, fix the case where the operands are unordered -- since the result is non-zero, the CR[6] field should be set to zero. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04target-ppc: Fix Altivec ShiftsTom Musta1-11/+2
Fix the implementation of the Altivec shift left and shift right instructions (vsl, vsr) which erroneously inverts shift direction on big endian hosts. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04target-ppc: simplify AES emulationAurelien Jarno1-2/+2
This patch simplifies the AES code, by directly accessing the newly added S-Box, InvS-Box tables instead of recreating them by using the AES_Te and AES_Td tables. Cc: Alexander Graf <agraf@suse.de> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Tested-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04e500: Add support for eTSEC in device treeAlexander Graf1-0/+43
This patch adds support to expose eTSEC devices in the dynamically created guest facing device tree. This allows us to expose eTSEC devices into guests without changes in the machine file. Because we can now tell the guest about eTSEC devices this patch allows the user to specify eTSEC devices via -device at all. Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04PPC: e500: Support dynamically spawned sysbus devicesAlexander Graf3-0/+111
For e500 our approach to supporting dynamically spawned sysbus devices is to create a simple bus from the guest's point of view within which we map those devices dynamically. We allocate memory regions always within the "platform" hole in address space and map IRQs to predetermined IRQ lines that are reserved for platform device usage. This maps really nicely into device tree logic, so we can just tell the guest about our virtual simple bus in device tree as well. Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04sysbus: Add new platform bus helper deviceAlexander Graf3-0/+311
We need to support spawning of sysbus devices dynamically via the command line. The easiest way to represent these dynamically spawned devices in the guest's memory and IRQ layout is by preallocating some space for dynamic sysbus devices. This is what the "platform bus" device does. It is a sysbus device that exports a configurably sized MMIO region and a configurable number of IRQ lines. When this device encounters sysbus devices that have been dynamically created and not manually wired up, it dynamically connects them to its own pool of resources. The machine model can then loop through all of these devices and create a guest configuration (device tree) to make them visible to the guest. Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04sysbus: Expose MMIO enumeration helperAlexander Graf2-0/+7
Sysbus devices have a range of MMIO regions they expose. The exact number of regions is device specific and internal information to the device model. Expose whether a region exists via a public interface. That way our platform bus enumeration code can dynamically determine how many regions exist. Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04sysbus: Expose IRQ enumeration helpersAlexander Graf4-0/+36
Sysbus devices can get their IRQ lines connected to other devices. It is possible to figure out which IRQ line a connection is on and whether a sysbus device even provides an IRQ connector at a specific offset. This patch exposes helpers to make this information publicly accessible. We will need it for the platform bus dynamic sysbus enumeration. Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04sysbus: Make devices spawnable via -deviceAlexander Graf4-9/+41
Now that we can properly map sysbus devices that haven't been connected to something forcefully by C code, we can allow the -device command line option to spawn them. For machines that don't implement dynamic sysbus assignment in their board files we add a new bool "has_dynamic_sysbus" to the machine class. When that property is false (default), we bail out when we see dynamically spawned sysbus devices, like we did before. Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04sysbus: Add dynamic sysbus device searchAlexander Graf2-0/+50
Sysbus devices can be spawned by C code or dynamically via the command line. In the latter case, we need to be able to find the dynamically created devices to do things with them. This patch adds a search helper that makes it easy to look for dynamically spawned sysbus devices. Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*)Peter Maydell1-11/+17
The g_hash_table_iter_* functions for iterating through a hash table are not present in glib 2.12, which is our current minimum requirement. Rewrite the code to use g_hash_table_foreach() instead. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04ppc: do not look at the MMU index to detect PR/HV modePaolo Bonzini1-88/+77
The MMU index is an internal detail that should not be needed by the translator (except to generate loads and stores). Look at the MSR directly. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04target-ppc: kvm: Fix memory overflow issue about strncat()Chen Gang1-4/+4
strncat() will append additional '\0' to destination buffer, so need additional 1 byte for it, or may cause memory overflow, just like other area within QEMU have done. And can use g_strdup_printf() instead of strncat(), which may be more easier understanding. Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04spapr_nvram: Enable migrationAlexey Kardashevskiy1-17/+64
The only case when sPAPR NVRAM migrates now is if is backed by a file and copy-storage migration is performed. In other cases NVRAM does not migrate regardless whether it is backed by a file or not. This enables shadow copy of NVRAM in RAM which is read from a file (if used) and used for reads. Writes to NVRAM are mirrored to the file. This defines a VMSTATE descriptor for NVRAM device so the memory copy of NVRAM can migrate and be flushed to a backing file on the destination if one is specified. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04PPC: E500: Hook up power off GPIO to GPIO controllerAlexander Graf1-0/+24
Now that we have a working GPIO controller on the virt machine, we can use one pin to notify QEMU that the guests wants to power off the system. Signed-off-by: Alexander Graf <agraf@suse.de>
2014-11-04PPC: E500: Instantiate MPC8XXX gpio controller on virt machineAlexander Graf3-0/+34
With the e500 virt machine, we don't have to adhere to the exact hardware layout of an mpc8544ds board. So there we can just add a qoriq compatible GPIO controller into the system that we can add a power off hook to. Signed-off-by: Alexander Graf <agraf@suse.de>