aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-08-14linux-user: ARM: Ignore immediate value for svc in thumb modelinux-user.for-upstreamAlexander Graf
When running in thumb mode, Linux doesn't evaluate the immediate value of the svc instruction, but instead just always assumes the syscall number to be in r7. This fixes executing go_bootstrap while building go for me. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-08-14linux-user: Use init_guest_space when -R and -B are specifiedMeador Inge
Roll the code used to initialize the guest memory space when -R or -B is used into 'init_guest_space' and then call 'init_guest_space' from the driver. This way the reserved guest memory space can be probed for. Calling 'mmap' just once as is currently done is not guaranteed to succeed since the host address space validation might fail. Signed-off-by: Meador Inge <meadori@codesourcery.com> [PMM: Fixed minor whitespace errors.] Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-08-14linux-user: Factor out guest space probing into a functionMeador Inge
Signed-off-by: Meador Inge <meadori@codesourcery.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-08-14flatload: fix bss clearingMike Frysinger
The current bss clear logic assumes the target mmap address and host address are the same. Use g2h to translate from the target address space to the host so we can call memset on it. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-08-14linux-user: make host_to_target_cmsg support SO_TIMESTAMP cmsg_typeJing Huang
Signed-off-by: Jing Huang <jing.huang.pku@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-08-14linux-user: make do_setsockopt support SOL_RAW ICMP_FILTER socket optionJing Huang
Signed-off-by: Jing Huang <jing.huang.pku@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-08-14linux-user: pass sockaddr from host to targetJing Huang
Signed-off-by: Jing Huang <jing.huang.pku@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-08-13linux-user: Move target_to_host_errno_table[] setup out of ioctl loopPeter Maydell
The code to initialise the target_to_host_errno_table[] array was accidentally inside the loop through checking and initialising all the supported ioctls. This was harmless but meant that we reinitialised the array several hundred times on startup. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-08-13linux-user: Fix SNDCTL_DSP_MAP{IN, OUT}BUF ioctl definitionsPeter Maydell
Fix the SNDCTL_DSP_MAP{IN,OUT}BUF ioctl definitions so that they refer to a suitably defined target struct layout rather than hardcoding the ioctl number. This fixes complaints from the syscall_init() consistency check when running an x86_64-to-x86_64 linux-user qemu. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-08-13linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSETPeter Maydell
The definitions for the ioctl numbers TARGET_BLKBSZGET and TARGET_BLKBSZSET had the wrong size parameters (they are defined with size_t, not int, even though the ioctl implementations themselves read and write integers). Since commit 354a0008 we now have an ioctl wrapper definition for BLKBSZGET and so on an x86-64-to-x86-64 linux-user binary we were triggering the mismatch warning in syscall_init(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-08-13qom: Reimplement InterfacesAnthony Liguori
The current implementation of Interfaces is poorly designed. Each interface that an object implements ends up being an object that's tracked by the implementing object. There's all sorts of gymnastics to deal with casting between these objects. But an interface shouldn't be associated with an Object. Interfaces are global to a class. This patch moves all Interface knowledge to ObjectClass eliminating the relationship between Object and Interfaces. Interfaces are now abstract (as they should be) but this is okay. Interfaces essentially act as additional parents for the classes and are treated as such. With this new implementation, we should fully support derived interfaces including reimplementing an inherited interface. PC: Rebased against qom-next merge Jun-2012. PC: Removed replication of cast logic for interfaces, i.e. there is only one cast function - object_dynamic_cast() (and object_dynamic_cast_assert()) Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-08-13xilinx_axi*: Re-implemented interconnectPeter A. G. Crosthwaite
Re-implemented the interconnect between the Xilinx AXI ethernet and DMA controllers. A QOM interface "stream" is created, for the two stream interfaces. As per Edgars request, this is designed to be more generic than AXI-stream, so in the future we may see more clients of this interface beyond AXI stream. This is based primarily on Paolos original refactoring of the interconnect. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter A.G. Crosthwaite <peter.crosthwaite@petalogix.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-08-11Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori
* stefanha/trivial-patches: target-arm: Fix typos in comments arm: translate: comment typo - s/middel/middle/ vl.c: Exit QEMU early if no machine is found
2012-08-11Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori
* kwolf/for-anthony: qemu-iotests: skip 039 with ./check -nocache block: add BLOCK_O_CHECK for qemu-img check qcow2: mark image clean after repair succeeds qed: mark image clean after repair succeeds blockdev: flip default cache mode from writethrough to writeback virtio-blk: disable write cache if not negotiated virtio-blk: support VIRTIO_BLK_F_CONFIG_WCE qemu-iotests: Save some sed processes ahci: Fix sglist memleak in ahci_dma_rw_buf() ahci: Fix ahci cdrom read corruptions for reads > 128k virtio-blk: fix use-after-free while handling scsi commands
2012-08-11Merge remote-tracking branch 'bonzini/scsi-next' into stagingAnthony Liguori
* bonzini/scsi-next: scsi-disk: add support for the UNMAP command scsi-disk: improve out-of-range LBA detection for WRITE SAME scsi-disk: more assertions and resets for aiocb virtio-scsi: do not compare 32-bit QEMU tags against 64-bit virtio-scsi tags iscsi: Pick default initiator-name based on the name of the VM iscsi: reorganize code for parse_initiator_name iscsi: do not leak initiator_name
2012-08-11configure: fix double check tests with ClangBlue Swirl
Configuring with Clang compiler with -Werror would not work after improved checks: /tmp/qemu-conf--25992-.c:4:32: error: self-comparison always evaluates to true [-Werror,-Wtautological-compare] int main(void) { return preadv == preadv; } /tmp/qemu-conf--25992-.c:13:26: error: self-comparison always evaluates to true [-Werror,-Wtautological-compare] return epoll_create1 == epoll_create1; /tmp/qemu-conf--25992-.c:3:13: error: explicitly assigning a variable of type 'char **' to itself [-Werror,-Wself-assign] environ = environ; Avoid the errors by adjusting the tests. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11configure: Check for -Werror causing failures when compiling testsPeter Maydell
Add support for checking whether test case code can compile without warnings, by recompiling each successful test with -Werror. If the -Werror version doesn't pass, we bail out. This gives us the same level of visibility of warnings in test code as --enable-werror provides for the main compile. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11exec.c: fix dirty bitmap reallocationIgor Mitsyanko
For each newly created RAM block, dirty bitmap is reallocated with g_realloc, which doesn't make any promises on initial content of new extra data in returned buffer. In theory, we initialize this new data with cpu_physical_memory_set_dirty_range() call. The problem is, cpu_physical_memory_set_dirty_range() has a side effect of incrementing ram_list.dirty_pages variable, but only for pages which are not already dirty. And page "cleanliness" is determined using the same not yet uninitialized dirty bitmap we've just reallocated. This results in inconsistency between real dirty page number and value in ram_list.dirty_pages variable, which in turn could (and will) result in errors during VM migration. Zero initialize new dirty bitmap bytes to fix this problem. Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11Makefile: add qapi.py dependenciesStefan Hajnoczi
Commit 427a1a2cb1d35b83b6302886f46289f6d617134d ("qapi: avoid reserved keywords") modifies qapi.py, which is used by qapi-types.py and other Python scripts. Because Makefile has no dependencies for qapi.py the qapi code generator will not be rerun and the following build error is produced: net/slirp.c: In function ‘net_init_slirp’: net/slirp.c:721:50: error: ‘NetdevUserOptions’ has no member named ‘q_restrict’ Fix this issue by adding the missing qapi.py dependencies. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Add a minimal curses screen supportGuan Xuetao
This patch adds a minimal curses screen support for unicore32-softmmu. We assume 80*30 screen size to minimize the implementation. Two problems are not solved, but they are innocuous. 1. curses windows will be blank when switching to monitor screen and back 2. backspace is not handled yet v1->v2: add extra handler for '\r' Signed-off-by: Zhang Mengchi <zhangmengchi@mprc.pku.edu.cn> Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32: Close dump-option of cpu_dump_state_ucf64 functionGuan Xuetao
Since of tedious output, we close dump-option of cpu_dump_state_ucf64 function. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32: Disintegrate cpu_dump_state_ucf64 functionGuan Xuetao
This patch disintegrates cpu_dump_state_ucf64 function from cpu_dump_state. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32: Split UniCore-F64 instruction helpers from helper.cGuan Xuetao
This patch just splits ucf64 instruction simulation helpers from helper.c. Also, two checkpatch warnings are solved. v1->v2: adjust copyright information for new ucf64_helper.c Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Add is_default setting for puv3 machineGuan Xuetao
This patch sets is_default to 1 for puv3 machine, so that find_default_machine() returns puv3 machine. Thanks Dunrong for pointing it out. Cc: Dunrong Huang <riegamaths@gmail.com> Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Add maintainer information for UniCore32 machineGuan Xuetao
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Add ps2 supportGuan Xuetao
This patch adds ps2/keyboard support, and enables CONFIG_PCKBD. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Add puv3 dma supportGuan Xuetao
This patch adds puv3 dma (Direct Memory Access) support, include dma device simulation for kernel booting. v1->v2: Add initialization to ret in puv3_dma_read. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Add puv3 pm supportGuan Xuetao
This patch adds puv3 pm (power management) support, include pm device simulation for kernel booting. Thank Blue Swirl for pointing out the missing "break". v1->v2: Add initialization to ret in puv3_pm_read. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Add puv3 gpio supportGuan Xuetao
This patch adds puv3 gpio (General Purpose Input/Output) support, include gpio device simulation and its interrupt support. v1->v2: Add initialization to ret in puv3_gpio_read. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Add puv3 ostimer supportGuan Xuetao
This patch adds puv3 ostimer support, include os timer device simulation and ptimer support in puv3 machine. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Add puv3 interrupt supportGuan Xuetao
This patch adds puv3 interrupt support, include interrupt controler device simulation and interrupt handler in puv3 machine. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Add puv3 soc/board supportGuan Xuetao
This patch only add puv3 soc/board support, which introduces puv3 machine description, and specifies console type. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Make sure that kernel can access user spaceGuan Xuetao
As a matter of course, we need to access user space in kernel code, so we need to correct load/store decoders to indicate correct memory region. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Implement softmmu specific functionsGuan Xuetao
This patch implements softmmu specific functions, include tlb_fill, switch_mode, do_interrupt and uc32_cpu_handle_mmu_fault. So the full exception handlers and page table walking could work now. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11target-unicore32: Drop UC32_CPUID macrosAndreas Färber
Any code that depends on a particular CPU type can now go through callbacks on the QOM UniCore32CPUClass. Signed-off-by: Andreas Färber <afaerber@suse.de Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Make UniCore32 cpuid & exceptions correct and runableGuan Xuetao
This patch initializes the cpuid to exactly correct value because linux kernel will check it. In addition, the exception types are specified in proper situations. Then it could make exceptions generated correctly and timely. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Add coprocessor 0(sysctrl) and 1(ocd) instruction supportGuan Xuetao
Coprocessor 0 is system control coprocessor, and we need get/set its contents. Also, all cache/tlb ops shoule be implemented here, but just ignored with no harm. Coprocessor 1 is OCD (on-chip-debugger), which is used for faked console, so we could output chars to this console without graphic card. TODO: curses display should be added lator for screen output. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-11unicore32-softmmu: Add unicore32-softmmu build supportGuan Xuetao
This patch adds unicore32-softmmu build support, include configure, makefile, arch_init, and all missing functions needed by softmmu. Although all missing functions are empty, unicore32-softmmu could be build successfully. By 20120804: change QEMU_ARCH_UNICORE32 to 0x4000 Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-08-10target-arm: Fix typos in commentsPeter Maydell
Fix a variety of typos in comments in target-arm files. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@petalogix.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-08-10arm: translate: comment typo - s/middel/middle/Peter A. G. Crosthwaite
Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-08-10vl.c: Exit QEMU early if no machine is foundDunrong Huang
We check whether the variable machine is NULL or not before accessing it. If machine is NULL, exit QEMU with an error, this can avoids a segfault error. Markus Armbruster <armbru@redhat.com> adds that the segfault can be reproduced as follows: $ qemu-system-xtensa -cpu help Signed-off-by: Dunrong Huang <riegamaths@gmail.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-08-10qemu-iotests: skip 039 with ./check -nocacheStefan Hajnoczi
When the qemu-io --nocache option is used the 039 test case cannot abort QEMU at a point where the image is dirty. Skip the test case. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-10block: add BLOCK_O_CHECK for qemu-img checkStefan Hajnoczi
Image formats with a dirty bit, like qed and qcow2, repair dirty image files upon open with BDRV_O_RDWR. Performing automatic repair when qemu-img check runs is not ideal because the bdrv_open() call repairs the image before the actual bdrv_check() call from qemu-img.c. Fix this "double repair" since it leads to confusing output from qemu-img check. Tell the block driver that this image is being opened just for bdrv_check(). This skips automatic repair and qemu-img.c can invoke it manually with bdrv_check(). Update the golden output for qemu-iotests 039 to reflect the new qemu-img check output. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-10qcow2: mark image clean after repair succeedsStefan Hajnoczi
The dirty bit is cleared after image repair succeeds in qcow2_open(). Move this into qcow2_check() so that all callers benefit from this behavior when fix mode is enabled. This is necessary so qemu-img check can call .bdrv_check() and mark the image clean. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-10qed: mark image clean after repair succeedsStefan Hajnoczi
The dirty bit is cleared after image repair succeeds in qed_open(). Move this into qed_check() so that all callers benefit from this behavior when fix=true. This is necessary so qemu-img check can call .bdrv_check() and mark the image clean. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-10blockdev: flip default cache mode from writethrough to writebackPaolo Bonzini
Now all major device models (IDE, SCSI, virtio) can choose between writethrough and writeback at run-time, and virtio will even revert to writethrough if the guest is not capable of sending flushes. So we can change the default to writeback at last. Tested, for lack of a better idea, with a breakpoint on bdrv_open and all cache choices one by one. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-10virtio-blk: disable write cache if not negotiatedPaolo Bonzini
If the guest does not support flushes, we should run in writethrough mode. The setting is temporary until the next reset, so that for example the BIOS will run in writethrough mode while Linux will run with a writeback cache. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-10virtio-blk: support VIRTIO_BLK_F_CONFIG_WCEPaolo Bonzini
Also rename VIRTIO_BLK_F_WCACHE to VIRTIO_BLK_F_WCE for consistency with the spec. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-08-10qemu-iotests: Save some sed processesKevin Wolf
Instead of building a huge pipeline, just pass all expressions to a single sed process. Suggested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2012-08-10ahci: Fix sglist memleak in ahci_dma_rw_buf()Jason Baron
I noticed that in hw/ide/ahci:ahci_dma_rw_buf() we do not free the sglist. Thus, I've added a call to qemu_sglist_destroy() to fix this memory leak. In addition, I've adeed a call in qemu_sglist_destroy() to 0 all of the sglist fields, in case there is some other codepath that tries to free the sglist. Signed-off-by: Jason Baron <jbaron@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>