AgeCommit message (Collapse)Author
2013-05-20random build hacksaarch64-bustedPeter Maydell
2013-05-20linux-user: AArch64 requires at least 3.8.0Alexander Graf
Glibc 1.17 checks for the host kernel version on startup. Unfortunately, it also checks whether the host kernel version is recent enough for the target to run at all. Since AArch64 support only got introduced in 3.8.0, that means that glibc refuses to run on any older kernel version than that. To allow for execution of linux-user guests even on older host kernels, let's always fake the kernel version to 3.8.0 on AArch64 guests. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: John Rigby <john.rigby@linaro.org> Message-id: 1368505980-17151-13-git-send-email-john.rigby@linaro.org
2013-05-20ARM: Add aarch64 target to configureAlexander Graf
If we want to compile a target machine type that is AArch64 capable, we need to add a new 64-bit capable ARM target. Use AArch64 since that is the official ARM LTD name. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: John Rigby <john.rigby@linaro.org> Message-id: 1368505980-17151-12-git-send-email-john.rigby@linaro.org
2013-05-20linux-user: Add AArch64 supportAlexander Graf
This patch adds support for AArch64 in all the small corners of linux-user and beyond. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: John Rigby <john.rigby@linaro.org> Message-id: 1368505980-17151-11-git-send-email-john.rigby@linaro.org
2013-05-20linux-user: Add signal handling for AArch64Andreas Schwab
This patch adds signal handling for AArch64. The code is based on the respective source in the Linux kernel. Signed-off-by: Andreas Schwab <schwab@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: John Rigby <john.rigby@linaro.org> Message-id: 1368505980-17151-10-git-send-email-john.rigby@linaro.org
2013-05-20linux-user: Fix up AArch64 syscall handlersAlexander Graf
Some syscall handlers have special code for ARM enabled that we don't need on AArch64. Exclude AArch64 in those cases. In other places we can share struct definitions with other targets or have to provide our own. With this patch applied, most syscall definitions in linux-user should be sound for AArch64. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: John Rigby <john.rigby@linaro.org> Message-id: 1368505980-17151-9-git-send-email-john.rigby@linaro.org
2013-05-20linux-user: Add syscall handling for AArch64Alexander Graf
The AArch64 syscall definitions are all publicly available in the Linux kernel. Let's add them to our linux-user emulation target, so that we can easily handle AArch64 syscalls. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: John Rigby <john.rigby@linaro.org> Message-id: 1368505980-17151-8-git-send-email-john.rigby@linaro.org
2013-05-20linux-user: Don't treat aarch64 cpu names speciallyAlexander Graf
32-bit ARM has a lot of different names for different types of CPUs it supports. On AArch64, we don't have this, so we really don't want to execute the 32-bit logic. Stub it out for AArch64 linux-user guests. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: John Rigby <john.rigby@linaro.org> Message-id: 1368505980-17151-7-git-send-email-john.rigby@linaro.org
2013-05-20AArch64: Add gdb stubAlexander Graf
We want to be able to debug AArch64 guests. So let's add the respective gdb stub functions and xml descriptions that allow us to do so. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: John Rigby <john.rigby@linaro.org> Message-id: 1368505980-17151-6-git-send-email-john.rigby@linaro.org
2013-05-20ARM: Add AArch64 translation stubAlexander Graf
We should translate AArch64 mode separately from AArch32 mode. In AArch64 mode, registers look vastly different, instruction encoding is completely different, basically the system turns into a different machine. So let's do a simple if() in translate.c to decide whether we can handle the current code in the legacy AArch32 code or in the new AArch64 code. So far, the translation always complains about unallocated instructions. There is no emulator functionality in this patch! Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: John Rigby <john.rigby@linaro.org> Message-id: 1368505980-17151-5-git-send-email-john.rigby@linaro.org
2013-05-20ARM: Prepare translation for AArch64 codeAlexander Graf
This patch adds all the prerequisites for AArch64 support that didn't fit into split up patches. It extends important bits in the core cpu headers to also take AArch64 mode into account. Add new ARM_TBFLAG_AARCH64_STATE translation buffer flag indicate an ARMv8 cpu running in aarch64 mode vs aarch32 mode. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: John Rigby <john.rigby@linaro.org> Message-id: 1368505980-17151-4-git-send-email-john.rigby@linaro.org
2013-05-20ARM: Export cpu_envAlexander Graf
The cpu_env tcg variable will be used by both the AArch32 and AArch64 handling code. Unstaticify it, so that both sides can make use of it. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: John Rigby <john.rigby@linaro.org> Message-id: 1368505980-17151-3-git-send-email-john.rigby@linaro.org
2013-05-20ARM: Extract the disas struct to a header fileAlexander Graf
We will need to share the disassembly status struct between AArch32 and AArch64 modes. So put it into a header file that both sides can use. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: John Rigby <john.rigby@linaro.org> Message-id: 1368505980-17151-2-git-send-email-john.rigby@linaro.org
2013-05-20tcg/aarch64: implement new TCG target for aarch64Claudio Fontana
add preliminary support for TCG target aarch64. Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
2013-05-20include/elf.h: add aarch64 ELF machine and relocsClaudio Fontana
we will use the 26bit relative relocations in the aarch64 tcg target. Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
2013-05-20configure: permit compilation on arm aarch64Claudio Fontana
support compiling on aarch64. Signed-off-by: Claudio Fontana <claudio.fontana@huawei.com>
2013-05-20target-arm: Explicitly convert TCGv to/from TCGv_i32 for qemu_ld/stPeter Maydell
The tcg_gen_qemu_{ld,st}* functions take a TCGv (whose type may change depending on TARGET_LONG_BITS) but the 32 bit ARM code generation always wants to work with 32 bit values. Rather than relying on TCGv and TCGv_i32 being the same type, convert explicitly if necessary. This will allow the code to continue to work when compiled into an AArch64 QEMU. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-05-20target-arm: Don't use TCGv when we mean TCGv_i32Peter Maydell
TCGv changes size depending on the compile time value of TARGET_LONG_BITS. This is useful for generating code for MIPS style "instructions are the same but the register width changes" CPUs, and also for the generic bits of QEMU which operate on "width of a virtual address" values, but mostly in the ARM target code we were using it purely as a shorthand for "any 32 bit value". This needs to change in preparation for AArch64 support, since an AArch64-capable v8 core will have 64 bit virtual addresses but still use 32 bit values for the 32 bit instruction set. This patch mechanically converts all the occurrences of TCGv, tcg_temp_new(), tcg_temp_free(), tcg_temp_local_new() and TCGV_UNUSED() to their explicitly 32 bit counterparts. This is correct for everything except the arguments to tcg_gen_qemu_{ld,st}*, which really do need to be TCGv and so will require a 32-to-64 conversion when building the 32 bit code for AArch64. Those changes will be in a separate patch for easier review. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-05-20configure: Report unknown target names more helpfullyPeter Maydell
If the user specifies a target list themselves, check each entry to make sure it's a target we recognise. This allows us to print a helpful error message, rather than falling through (where we would probably eventually end up hitting the uninformative "ERROR: Unsupported target CPU"). Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-05-20configure: Autogenerate default target listPeter Maydell
Autogenerate the default target list based on what files exist in default-configs; this allows us to remove one of the places that has to be kept up to date with a complete list of every target we support. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-05-20qapi-schema.json: Reformat TargetType enum to one-per-linePeter Maydell
Reformat the qapi-schema TargetType enumeration so that it has just one target architecture name per line. This allows patches for adding new targets to just add a single line, rather than having to reformat most of the list (resulting in a hard-to-check diff). Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-05-10target-i386: ROR r8/r16 imm instruction fixAurelien Jarno
Fix EFLAGS corruption by ROR r8/r16 imm instruction located at the end of the TB, similarly to commit 089305ac for the non-immediate case. Reported-by: Hervé Poussineau <hpoussin@reactos.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-05-09tcg/optimize: fix setcond2 optimizationAurelien Jarno
When setcond2 is rewritten into setcond, the state of the destination temp should be reset, so that a copy of the previous value is not used instead of the result. Reported-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-05-08Update version for 1.5.0-rc1Anthony Liguori
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-08Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori
# By Kevin Wolf (7) and Fam Zheng (3) # Via Kevin Wolf * kwolf/for-anthony: qemu-iotests: fix 017 018 for vmdk qemu-iotests: exclude vmdk and qcow from 043 qemu-iotests: exclude vmdk for test 042 qtest/ide-test: Test short and long PRDTs qtest/ide-test: Add simple DMA read/write test case qtest: Add IDE test case libqos/pci: Enable bus mastering ide: Reset BMIDEA bit when the bus master is stopped de_DE.po: Add missing leading spaces ahci: Don't allow creating slave drives Message-id: 1368023344-29731-1-git-send-email-kwolf@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-08virtio: properly validate address before accessing configJason Wang
There are several several issues in the current checking: - The check was based on the minus of unsigned values which can overflow - It was done after .{set|get}_config() which can lead crash when config_len is zero since vdev->config is NULL Fix this by: - Validate the address in virtio_pci_config_{read|write}() before .{set|get}_config - Use addition instead minus to do the validation Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Petr Matousek <pmatouse@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Petr Matousek <pmatouse@redhat.com> Message-id: 1367905369-10765-1-git-send-email-jasowang@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-08virtio-pci: fix level interruptsMichael S. Tsirkin
mask notifiers are never called without msix, so devices with backend masking like vhost don't work. Call mask notifiers explicitly at startup/cleanup to make it work. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-08Merge branch 'ppc-for-upstream' of git://github.com/agraf/qemuAurelien Jarno
* 'ppc-for-upstream' of git://github.com/agraf/qemu: PPC: Depend behavior of cmp instructions only on instruction encoding
2013-05-08PPC: Fix rldclAlexander Graf
The implementation for rldcl tried to always fetch its parameters from the opcode, even though the opcode was already passed in in decoded and different forms. Use the parameters instead, fixing rldcl. Reported-by: Torbjorn Granlund <tg@gmplib.org> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-05-08PPC: Depend behavior of cmp instructions only on instruction encodingAlexander Graf
When running an L=1 cmp instruction on a 64bit PPC CPU with SF off, it still behaves identical to what it does when SF is on. Remove the implicit difference in the code. Also, on most 32bit CPUs we should always treat the compare as 32bit compare, as the CPU will ignore the L bit. This is not true for e500mc, but that's up for a different patch. Reported-by: Torbjorn Granlund <tg@gmplib.org> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-05-08target-mips: fix incorrect behaviour for INSVPetar Jovanovic
Corner case for INSV instruction when size=32 has not been correctly implemented. The mask for size should be one bit wider, and preparing the filter variable should be aware of this case too. The test for INSV has been extended to include the case that triggers the bug. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-05-08target-mips: add missing check_dspr2 for multiply instructionsPetar Jovanovic
The emulator needs to check in hflags if DSP unit has been turned off before it generates code for MUL_PH, MUL_S_PH, MULQ_S_W, and MULQ_RS_W. Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2013-05-08qemu-iotests: fix 017 018 for vmdkFam Zheng
017 and 018 use /bin/mv to move base img from t.IMGFMG to t.IMGFMT.base after filling data, this is not enough for vmdk, when t.IMGFMT is only a description text file who points to t-{flat,s001,f001,...}.IMGFMT as data extent, so testing such subformats alway fails on them. This patch use the trick of temprorily changing TEST_IMG to avoid using /bin/mv. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-08qemu-iotests: exclude vmdk and qcow from 043Fam Zheng
043 tests recursive backing file by changing backing file. VMDK has not implemented this yet, and qcow1 probably never will. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-08qemu-iotests: exclude vmdk for test 042Fam Zheng
Zero sized disk is not supported by qemu vmdk driver, exclude vmdk from the test script. As tested on vmware-vdiskmanager and vmware workstation, zero sized disk is not supported by vmware, either. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-08qtest/ide-test: Test short and long PRDTsKevin Wolf
This tests the behaviour of the DMA engine when the given PRDT contains physical region descriptors for either more or less bytes than the IDE request is for. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-08qtest/ide-test: Add simple DMA read/write test caseKevin Wolf
This tests that single sectors can be successfully written and correctly read back. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-08qtest: Add IDE test caseKevin Wolf
This adds a simple IDE test case and starts by verifying that IDENTIFY can be successfully used and return the correct serial number, version and the WCE flag is set for cache=writeback. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-08libqos/pci: Enable bus masteringKevin Wolf
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-08ide: Reset BMIDEA bit when the bus master is stoppedKevin Wolf
The device is supposed to reset the Bus Master IDE Active bit in the status register when 0 is written to the Start/Stop Bus Master bit in the command register. In the common cases this happens automatically because bdrv_drain_all() flushes the requests, but with a large PRDT it could remain set. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-08de_DE.po: Add missing leading spacesKevin Wolf
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-08ahci: Don't allow creating slave drivesKevin Wolf
An IDE bus provided by AHCI can only take a single IDE drive. If you add a drive as slave, qemu used to accept the command line but the device wouldn't be actually usable. Catch the situation instead and error out. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-05-07Update version for qemu-1.5.0-rc0Anthony Liguori
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-07Merge remote-tracking branch 'kraxel/usb.82' into stagingAnthony Liguori
# By Gerd Hoffmann (3) and Hans de Goede (1) # Via Gerd Hoffmann * kraxel/usb.82: xhci: handle USB_RET_BABBLE uhci: Use an intermediate buffer for usb packet data usb-host: add usb_host_full_speed_compat usb-host: live migration support for the libusb version Message-id: 1367920207-1404-1-git-send-email-kraxel@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-07qga: set umask 0077 when daemonizing (CVE-2013-2007)Laszlo Ersek
The qemu guest agent creates a bunch of files with insecure permissions when started in daemon mode. For example: -rw-rw-rw- 1 root root /var/log/qemu-ga.log -rw-rw-rw- 1 root root /var/run/qga.state -rw-rw-rw- 1 root root /var/log/qga-fsfreeze-hook.log In addition, at least all files created with the "guest-file-open" QMP command, and all files created with shell output redirection (or otherwise) by utilities invoked by the fsfreeze hook script are affected. For now mask all file mode bits for "group" and "others" in become_daemon(). Temporarily, for compatibility reasons, stick with the 0666 file-mode in case of files newly created by the "guest-file-open" QMP call. Do so without changing the umask temporarily. Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-07virtio-net: properly check the vhost status during status setJason Wang
Commit 32993698 (vhost: disable on tap link down) tries to disable the vhost also when the peer's link is down. But the check was not done properly, the vhost were only started when: 1) peer's link is not down 2) virtio-net has already been started. Since == have a higher precedence than &&, place a brace to make sure both the conditions were met then does the check. This fixes the crash when doing a savem after set the link off which let qemu crash and complains: virtio_net_save: Assertion `!n->vhost_started' failed. Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Message-id: 1366972060-21606-1-git-send-email-jasowang@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-05-07Merge remote-tracking branch 'afaerber/qom-cpu' into stagingAnthony Liguori
# By Eduardo Habkost (6) and others # Via Andreas Färber * afaerber/qom-cpu: target-i386: n270 can MOVBE target-i386: Introduce generic CPUID feature compat function target-i386: Change CPUID model of 486 to 8 target-i386: Emulate X86CPU subclasses for global properties qdev: Introduce qdev_prop_set_globals_for_type() qdev: Let qdev_prop_parse() pass through Error target-i386: Add "filtered-features" property to X86CPU target-i386: Introduce X86CPU::filtered_features field target-i386: Add "feature-words" property to X86CPU target-i386: Use FeatureWord loop on filter_features_for_kvm() target-i386: Add ECX information to FeatureWordInfo
2013-05-07xhci: handle USB_RET_BABBLEGerd Hoffmann
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-05-07uhci: Use an intermediate buffer for usb packet dataHans de Goede
Due to various unfortunate reasons we cannot reliable detect a guest cancelling a packet as soon as it happens, instead we detect cancels with some delay. When packets are handled async, and we directly pass the guest memory for the packet to the usb-device as iovec, this means that the usb-device can write to guest-memory which the guest has already re-used for other purposes -> not good! This patch fixes this by adding an intermediate buffer and writing back not only the result, but also the data, of async completed packets when scanning the schedule. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-05-07usb-host: add usb_host_full_speed_compatGerd Hoffmann
Alloes to pass through usb2 devices on usb1 host controllers if possible. Brings the libusb implementation to feature-parity with the linux usbfs code, so the usb-host implementation in 1.5 (libusb) doesn't regress compared to 1.4 (usbfs). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>