summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-11-09hpet: fix infinite loop in qemu_run_timers with -icount enabledMax Filippov1-2/+2
hpet_timer timer callback rearms itself based on difference between current HPET tick counter and comparator value. Difference calculated by the hpet_calculate_diff function is limited to non-negative values. cur_tick is calculated via hpet_get_ticks that uses qemu_get_clock_ns(vm_clock). With -icount enabled vm_clock doesn't advance during qemu_run_timers loop thus once difference is zero, qemu_run_timers loops forever handling hpet_timer. Limit hpet_calculate_diff results to positive only values to avoid that infinite loop. This fixes the following qemu-system-x86_64 hang when it reaches timer_irq_works() in the linux bootup: [ 0.000000] Fast TSC calibration using PIT [ 0.000000] Detected 1000.054 MHz processor. [ 0.000031] Calibrating delay loop (skipped), value calculated using timer frequency.. 2000.10 BogoMIPS (lpj=10000540) [ 0.000404] pid_max: default: 32768 minimum: 301 [ 0.001138] Mount-cache hash table entries: 256 [ 0.003883] Initializing cgroup subsys ns [ 0.004035] Initializing cgroup subsys cpuacct [ 0.004280] Initializing cgroup subsys freezer [ 0.004790] Performance Events: AMD PMU driver. [ 0.004985] ... version: 0 [ 0.005134] ... bit width: 48 [ 0.005285] ... generic registers: 4 [ 0.005437] ... value mask: 0000ffffffffffff [ 0.005625] ... max period: 00007fffffffffff [ 0.005807] ... fixed-purpose events: 0 [ 0.005957] ... event mask: 000000000000000f [ 0.006275] SMP alternatives: switching to UP code Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-09hw/omap_gpmc.c: Add missing 'break's to fix 8 bit NAND writesPeter Maydell1-0/+2
Add missing 'break' statements which would have meant that writing to an 8 bit NAND device was broken. Spotted by Coverity (see bug 887883). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-09hw/omap_dss.c: Fix !-vs-~ bug in handling DISPC_CONTROLPeter Maydell1-4/+5
Fix a bug revealed by a coverity scan (see bug 887883) which meant that we would never print the warning about unpredictable behaviour if a nonexistent overlay is enabled. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-09i386: derive '-cpu host' from KVM_GET_SUPPORTED_CPUIDAvi Kivity1-23/+4
The fact that a host cpu supports a feature doesn't mean that QEMU and KVM will also support it, yet -cpuid host brings host features wholesale. We need to whitelist each feature separately to make sure we support it. This patch adds KVM whitelisting (by simply using KVM_GET_SUPPORTED_CPUID instead of the CPUID instruction). Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-09configure: fix detection for xattr.h on modern distributionsAvi Kivity7-7/+45
Modern distributions place xattr.h in /usr/include/sys, and fold libattr.so into libc. They also don't have an ENOATTR. Make configure detect this, and add a qemu-xattr.h file that directs the #include to the right place. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-09Clean up assertion in get_boot_devices_list()Markus Armbruster1-1/+1
g_strdup() can't fail, remove assertion. Assert its argument can't be null, because that's not obvious (add_boot_device_path() ensures it). Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-09Replace WriteFileEx with WriteFile in qemu_create_pidfileFabien Chouteau1-3/+4
The function that writes pidfile for win32 uses WriteFileEx which is an asynchronous IO function. The arguments given to WriteFileEx are allocated on the stack and one of them is "in out". When the IO operation is actually executed the calling function has already returned, so the arguments are no longer allocated or allocated to another frame. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-09win32: remove broken timersPaolo Bonzini1-3/+1
The non-dynticks timer variations are broken, so they can be removed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-08virtex: Remove memset of clk_setupEdgar E. Iglesias1-1/+0
clk_setup is now a function. Fixes a segfault. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-11-07Update version for v1.0-rc1v1.0-rc1Anthony Liguori1-1/+1
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-07console: Fix rendering of VGA underlineMarkus Armbruster1-3/+3
vga_putcharxy()'s underline code sets font_data to 0xffff instead of 0xff. vga_putcharxy() then reads dmask16[0xffff >> 4] and dmask4[0xffff >> 6]. In practice, these out-of-bounds subscripts "only" put a few crap bits into the display surface. For 32 bit pixels, there's no array access. font_data's extra bits go straight into the display surface. Broken when commit 6d6f7c28 implemented underline. Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-07qemu_timedate_diff() shouldn't modify its argument.Gleb Natapov1-2/+5
The caller of qemu_timedate_diff() does not expect that tm it passes to the function will be modified, but mktime() is destructive and modifies its argument. Pass a copy of tm to it and set tm_isdst so that mktime() will not rely on it since its value may be outdated. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-07reenable vm_clock when resuming all vcpusWen Congyang1-0/+1
We disable vm_clock when pausing all vcpus, but we forget to reenable it when resuming all vcpus. It will cause that the guest can not be rebooted. Tested-by: Zhi Yong Wu <zwu.kernel@gmai.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-07qxl: fix vga port initialization.Gerd Hoffmann1-5/+17
Commit 0a039dc70096b768d3810afa50ba1d214768aaf4 broke vga modes for qxl-vga by loosing vga_ioport_read windup. qxl needs to hook into vga port writes only and used to realize that by letting vga_init() do the work for both reads and writes, then overwrite the write function. That little detail was missed while doing the conversion ... This patch fixes it. It also switch qxl vga ioport registration to portio lists while being at it. Cc: Hans de Goede <hdegoede@redhat.com> Acked-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-07ac97: don't override the pci subsystem idGerd Hoffmann2-5/+27
This patch removes the code lines which set the subsystem id for the emulated ac97 card to 8086:0000. Due to the device id being zero the subsystem id isn't vaild anyway. With the patch applied the sound card gets the default qemu subsystem id (1af4:1100) instead. [ v2: old & broken id is maintained for -M pc-$oldqemuversion ] Cc: Takashi Iwai <tiwai@suse.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-07pc: add 1.0 machine typeGerd Hoffmann1-3/+11
This patch adds a pc-1.0 machine type. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-07disable automatic loading of sgabios when -nographicPaolo Bonzini1-9/+0
sgabios hasn't gotten a lot of coverage since it was not shipped. For 1.0, let's disable the automatic loading of the option ROM in -nographic mode. We can put it back for 1.1. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-07add sgabios blob and submodulePaolo Bonzini5-1/+10
The rom was not added together with the sgabios device and is not installed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-07Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori4-88/+138
2011-11-07Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori3-96/+92
2011-11-07xen-platform: Fix IO port read/write functionsAnthony PERARD1-9/+9
Somehow, the read/write functions handle an offset that does not exist anymore. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-07readline: Fix buffer overrun on re-add to historyMarkus Armbruster1-1/+1
readline_hist_add() moves the history entry to the end of history. It uses memmove() to move rs->history[idx + 1..] to rs->history[idx..]. However, its size argument is off by two array elements, so it writes one element beyond rs->history[], and reads two. On my system, this clobbers rs->hist_entry and the hole right after it. Since the function assigns to rs->hist_entry in time, the bug has no ill effects for me. Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-07cmd: Fix potential memory leakPavel Borzenkov1-2/+7
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-07cmd: Fix potential NULL pointer dereferencePavel Borzenkov1-8/+3
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-07cmd: Fix coding style in cmd.cPavel Borzenkov1-86/+82
Before the next patches, fix coding style of the affected functions. Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-11-06arm_gic: handle banked enable bits for per-cpu interruptsRabin Vincent1-15/+20
The first enable set/clear register (which controls the PPIs and SGIs) is supposed to be banked for each processor. Currently it is just handled globally and this prevents recent SMP Linux kernels from booting, because CPU0 stops receiving localtimer interrupts when CPU1 disables them locally. To fix this, allow the enable bits to be enabled per-cpu. For SPIs, always enable/disable ALL_CPU_MASK. Signed-off-by: Rabin Vincent <rabin@rab.in> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2011-11-04vvfat: reorganize computation of disk geometryPaolo Bonzini1-16/+24
First determine FAT12/16/32, then compute geometry from that for both FDD and HDD. For 1.44MB floppies, and 2.88MB floppies using FAT16, change to 1 sector/cluster. The default remains 2.88MB with FAT12 and 2 sectors/cluster. Both DOS and mkdosfs by default format a 2.88MB floppy as FAT12. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-04vvfat: do not hardcode sector counts in error messagePaolo Bonzini1-5/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-04vvfat: unify and correct computation of sector countPaolo Bonzini1-3/+3
The sector count is stored in the partition and hence must not include the sectors before its start. At the same time, remove the useless special casing for 1.44 MB floppies. This fixes fsck on VVFAT hard disks, which otherwise tries to seek past the end of the disk. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-04vvfat: need to use first_sectors_number to distinguish fdd/hddPaolo Bonzini1-2/+2
This is consistent with what "real" floppies have, so file(1) now actually recognizes the VVFAT image as a 1.44 MB floppy. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-04vvfat: do not fail if the disk has spare sectorsPaolo Bonzini1-2/+2
If the number of "faked sectors" + the number of sectors that are part of a cluster does not sum up to the total number of sectors, qemu-img convert fails. Read these spare sectors as all zeros. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-04vvfat: fix out of bounds array_get usagePaolo Bonzini1-0/+1
When reading the address of the first free entry, you cannot use array_get without first marking all entries as occupied. This is visible if you change the sectors per cluster on a floppy from 2 to 1. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-04block/cloop: Use g_free instead of freeDong Xu Wang1-3/+3
Fix mismatching allocation and deallocation: g_free should be used to pair with g_malloc. Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed_by: Ray Wang <raywang@linux.vnet.ibm.com> Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-04block/cloop: Fix coding styleDong Xu Wang1-52/+63
Fix coding style in block/cloop.c. Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed_by: Ray Wang <raywang@linux.vnet.ibm.com> Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-04dma: Avoid reentrancy in DMA transfer handlersKevin Wolf1-0/+10
With the conversion of the block layer to coroutines, bdrv_read/write have changed to run a nested event loop that calls qemu_bh_poll. Consequently a scheduled BH can be called while a DMA transfer handler runs and this means that DMA_run becomes reentrant. Devices haven't been designed to cope with that, so instead of running a nested transfer handler just wait for the next invocation of the BH from the main loop. This fixes some problems with the floppy device. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-04qemu-io: Fix multiwrite_f error handlingKevin Wolf1-3/+6
Without this fix, some qiovs can be leaked if an error occurs. Also a semicolon at the end of the command line would make the code walk beyond the end of argv. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-04qemu-io: Handle create_iovec errorsKevin Wolf1-4/+24
Callers of create_iovec() didn't check for failure and continued with uninitialised data in error cases. This patch adds checks to each call. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-11-02Merge branch 'xtensa' of git://jcmvbkbc.spb.ru/dumb/qemu-xtensaBlue Swirl6-18/+135
* 'xtensa' of git://jcmvbkbc.spb.ru/dumb/qemu-xtensa: xtensa_lx60: fix build date code and change memory region names xtensa_lx60: pass kernel arguments from -append xtensa_lx60: add FLASH support target-xtensa: raise an exception for invalid and reserved opcodes target-xtensa: handle cache options in the overlay tool target-xtensa: mask out undefined bits of WINDOWSTART SR
2011-11-02Merge branch 'tci' of git://qemu.weilnetz.de/qemuBlue Swirl14-12/+2545
* 'tci' of git://qemu.weilnetz.de/qemu: tcg: Add tcg interpreter to configure / make tcg: Add tci disassembler tcg: Add interpreter for bytecode tcg: Add bytecode generator for tcg interpreter tcg: Make ARRAY_SIZE(tcg_op_defs) globally available tcg: TCG targets may define tcg_qemu_tb_exec
2011-11-02Merge remote-tracking branch 'aneesh/for-upstream-8' into stagingAnthony Liguori1-99/+4
2011-11-02Merge remote-tracking branch 'qemu-kvm-tmp/memory/int128' into stagingAnthony Liguori3-81/+231
2011-11-02Fix X86 CPU topology in KVM modeBharata B Rao2-1/+1
apic id returned to guest kernel in ebx for cpuid(function=1) depends on CPUX86State->cpuid_apic_id which gets populated after the cpuid information is cached in the host kernel. This results in broken CPU topology in guest. Fix this by setting cpuid_apic_id before cpuid information is passed to the host kernel. This is done by moving the setting of cpuid_apic_id to cpu_x86_init() where it will work for both KVM as well as TCG modes. Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Bharata B Rao <bharata.rao@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-02intel-hda: fix stream searchGerd Hoffmann1-1/+1
commit ba43d28916c4f51c19bd7366089155ce81bee058 introduces a bug: The stream-not-found case doesn't error out any more, instead the code silently uses the first stream. Fix it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-02virtio-blk: pass full status to the guestPaolo Bonzini1-1/+15
When SCSI passthrough is being used by the guest with virtio-blk, the guest is not able to detect disk failures. This is because the status field is expected by the guest driver to include also the msg_status, host_status and driver_status fields, but the device is only passing down the SCSI status. The patch fixes this, and also makes sure that the guest always sees a CHECK_CONDITION status when there is valid sense data. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-11-02hw/9pfs: use g_vasprintf() instead of rolling our ownStefan Hajnoczi1-99/+4
Markus Armbruster <armbru@redhat.com> sent fixes for va_list vararg issues in v9fs_string_alloc_printf(). It turns out the function duplicates g_vasprintf() and can therefore be eliminated entirely. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2011-11-02xtensa_lx60: fix build date code and change memory region namesMax Filippov1-4/+4
Fix date code to uses MMDDYYYY notation. Change memory region names to reflect specification that defines them. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2011-11-02xtensa_lx60: pass kernel arguments from -appendMax Filippov2-4/+45
Create boot parameters in the end of SRAM region, insert kernel arguments specified in -append there. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2011-11-02xtensa_lx60: add FLASH supportMax Filippov3-8/+73
LX60 carry 4 Mbyte FLASH and 128 Kbyte SRAM, LX200 carry 16 Mbyte FLASH and 32 Mbyte SRAM. Either of these memories may be mapped to the system ROM region. Select boot from FLASH if -kernel option is not specified, otherwise boot from SRAM. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2011-11-02target-xtensa: raise an exception for invalid and reserved opcodesMax Filippov1-1/+6
This includes opcodes from disabled features and those marked reserved in the ISA. Also end TB on opcodes that definitely generate an exception: illegal instructions, syscall and privileged instructions. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2011-11-02target-xtensa: handle cache options in the overlay toolMax Filippov1-0/+6
Cache options must be enabled for the cores that have cache to avoid illegal instruction exceptions. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>