summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* hw/pcnet-pci.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-4/+4
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/ne2000.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-3/+3
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/lsi53c895a.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-9/+4
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/ivshmem.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-5/+3
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/ioh3420.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-4/+3
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/intel-hda.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-4/+4
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/ide/via.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-4/+4
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/ide/ich.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-5/+4
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/ide/cmd646.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-6/+4
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/gt64xxx.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-4/+4
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/grackle_pci.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-4/+4
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/es1370.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-13/+11
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/e1000.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-4/+4
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/cirrus_vga.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-5/+5
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/bonito.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-4/+5
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/acpi_piix4.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-4/+4
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* hw/ac97.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-5/+4
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* vmware_vga.c: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-7/+6
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* ide/piix: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-22/+10
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* apb_pci: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-7/+6
| | | | | | | Use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* dec_pci: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-19/+7
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* eepro100: convert to PCIDeviceInfo to initialize idsIsaku Yamahata2011-06-121-41/+33
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* usb-uhci: convert to PCIDEviceInfo to initialize idsIsaku Yamahata2011-06-121-29/+17
| | | | | | | use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* pci: move ids of config space into PCIDeviceInfoIsaku Yamahata2011-06-122-14/+39
| | | | | | | | | vender id/device id... in configuration space are read-only registers which are commonly defined for all pci devices. So move those initialization into common place. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* CPUPhysMemoryClient: batch addresses in catchupAlex Williamson2011-06-121-6/+33
| | | | | | | | | | | When a phys memory client registers and we play catchup by walking the page tables, we can make a huge improvement in the number of times the set_memory callback is called by batching contiguous pages together. With a 4G guest, this reduces the number of callbacks at registration from 1048866 to 296. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* ich/ahci: fix uninitialized memory useMichael S. Tsirkin2011-05-161-2/+2
| | | | | | | | | | | | The commit 667bb59d2358daeef179583c944becba3f1f9680 uses d->ahci.mem before it is initialized by ahci_init(). Fix this by calling ahci_init() first thing so that it's safe to use all fields in the ahci state struct. Reported-by: Alexey Zaytsev <alexey.zaytsev@gmail.com> Reported-by: Jan Kiszka <jan.kiszka@web.de> Tested-by: Alexey Zaytsev <alexey.zaytsev@gmail.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
* Merge remote branch 'origin/master' into pciMichael S. Tsirkin2011-05-05393-6353/+32099
|\ | | | | | | | | Conflicts: exec.c
| * NBD: Avoid leaking a couple of strings when the NBD device is closedNick Thomas2011-05-031-0/+4
| | | | | | | | | | Signed-off-by: Nick Thomas <nick@bytemark.co.uk> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * qemu-progress.c: printf isn't signal safeJes Sorensen2011-05-031-1/+6
| | | | | | | | | | | | | | | | | | | | Change the signal handling to indicate a signal is pending, rather then printing directly from the signal handler. In addition make the signal prints go to stderr, rather than stdout. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * ide/atapi: fix set but unusedAlon Levy2011-05-031-3/+1
| | | | | | | | | | | | Signed-off-by: Alon Levy <alevy@redhat.com> Acked-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * atapi: Explain why we need a 'media not present' stateAmit Shah2011-05-031-1/+7
| | | | | | | | | | | | | | | | | | After the re-org of the atapi code, it might not be intuitive for a reader of the code to understand why we're inserting a 'media not present' state between cd changes. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * atapi: Move comment to proper placeAmit Shah2011-05-031-1/+1
| | | | | | | | | | | | | | Move misplaced comment for media_is_dvd() Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * qemu-img resize: Fix option parsingKevin Wolf2011-05-031-2/+11
| | | | | | | | | | | | | | | | | | | | | | For shrinking images, you're supposed to use a negative size. However, the leading minus makes getopt think that it's an option and so you get the help text if you don't use -- like in 'qemu-img resize test.img -- -1G'. This patch handles the size first and removes it from the argument list so that getopt won't even try to interpret it and you don't need -- any more. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * lm32: add Milkymist Minimac2 supportMichael Walle2011-05-035-176/+168
| | | | | | | | | | | | | | | | This patch adds support for Milkymist's minimal Ethernet MAC v2. It superseds minimac1. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
| * milkymist-sysctl: fix timersMichael Walle2011-05-031-19/+7
| | | | | | | | | | | | | | Prevent timers from firing right after starting. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
| * milkymist-vgafb: fix console resizingMichael Walle2011-05-031-0/+3
| | | | | | | | | | | | | | After enabling the framebuffer, ensure that the console is resized. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
| * lm32: fix exception handlingMichael Walle2011-05-032-31/+1
| | | | | | | | | | | | | | | | | | | | Global interrupt enable bit is already saved within the exception handler helper routine. Thus remove extra code in translation routines. Additionally, debug exceptions has always DEBA as base address. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
| * kvm: use qemu_free consistentlyPaolo Bonzini2011-05-022-3/+3
| | | | | | | | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * fix crash in migration, 32-bit userspace on 64-bit hostMichael Tokarev2011-05-021-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes a long-standing immediate crash (memory corruption and abort in glibc malloc code) in migration on 32bits. The bug is present since this commit: commit 692d9aca97b865b0f7903565274a52606910f129 Author: Bruce Rogers <brogers@novell.com> Date: Wed Sep 23 16:13:18 2009 -0600 qemu-kvm: allocate correct size for dirty bitmap The dirty bitmap copied out to userspace is stored in a long array, and gets copied out to userspace accordingly. This patch accounts for that correctly. Currently I'm seeing kvm crashing due to writing beyond the end of the alloc'd dirty bitmap memory, because the buffer has the wrong size. Signed-off-by: Bruce Rogers Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ int kvm_get_dirty_pages_range(kvm_context_t kvm, unsigned long phys_addr, - buf = qemu_malloc((slots[i].len / 4096 + 7) / 8 + 2); + buf = qemu_malloc(BITMAP_SIZE(slots[i].len)); r = kvm_get_map(kvm, KVM_GET_DIRTY_LOG, i, buf); BITMAP_SIZE is now open-coded in that function, like this: size = ALIGN(((mem->memory_size) >> TARGET_PAGE_BITS), HOST_LONG_BITS) / 8; The problem is that HOST_LONG_BITS in 32bit userspace is 32 but it's 64 in 64bit kernel. So userspace aligns this to 32, and kernel to 64, but since no length is passed from userspace to kernel on ioctl, kernel uses its size calculation and copies 4 extra bytes to userspace, corrupting memory. Here's how it looks like during migrate execution: our=20, kern=24 our=4, kern=8 ... our=4, kern=8 our=4064, kern=4064 our=512, kern=512 our=4, kern=8 our=20, kern=24 our=4, kern=8 ... our=4, kern=8 our=4064, kern=4064 *** glibc detected *** ./x86_64-softmmu/qemu-system-x86_64: realloc(): invalid next size: 0x08f20528 *** (our is userspace size above, kern is the size as calculated by the kernel). Fix this by always aligning to 64 in a hope that no platform will have sizeof(long)>8 any time soon, and add a comment describing it all. It's a small price to pay for bad kernel design. Alternatively it's possible to fix that in the kernel by using different size calculation depending on the current process. But this becomes quite ugly. Special thanks goes to Stefan Hajnoczi for spotting the fundamental cause of the issue, and to Alexander Graf for his support in #qemu. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> CC: Bruce Rogers <brogers@novell.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * kvm: Install specialized interrupt handlerJan Kiszka2011-05-021-0/+11
| | | | | | | | | | | | | | | | | | | | KVM only requires to set the raised IRQ in CPUState and to kick the receiving vcpu if it is remote. Installing a specialized handler allows potential future changes to the TCG code path without risking KVM side effects. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * Redirect cpu_interrupt to callback handlerJan Kiszka2011-05-022-2/+16
| | | | | | | | | | | | | | | | This allows to override the interrupt handling of QEMU in system mode. KVM will make use of it to set a specialized handler. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * Break up user and system cpu_interrupt implementationsJan Kiszka2011-05-021-4/+10
| | | | | | | | | | | | | | | | | | Both have only two lines in common, and we will convert the system service into a callback which is of no use for user mode operation. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> CC: Riku Voipio <riku.voipio@iki.fi> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * kvm: create kvmclock when one of the flags are presentGlauber Costa2011-05-021-1/+5
| | | | | | | | | | | | | | | | kvmclock presence can be signalled by two different flags. So for device creation, we have to test for both. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * kvm: add kvmclock to its second bitGlauber Costa2011-05-021-1/+1
| | | | | | | | | | | | | | | | | | We have two bits that can represent kvmclock in cpuid. They signal the guest which msr set to use. When we tweak flags involving this value - specially when we use "-", we have to act on both. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * x86: Allow multiple cpu feature matches of lookup_featureJan Kiszka2011-05-021-6/+8
| | | | | | | | | | | | | | | | | | kvmclock is represented by two feature bits. Therefore, lookup_feature needs to continue its search even after the first match. Enhance it accordingly and switch to a bool return type at this chance. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * kvm: use kernel-provided para_features instead of statically coming up with ↵Glauber Costa2011-05-021-29/+49
| | | | | | | | | | | | | | | | | | | | | | | | new capabilities Use the features provided by KVM_GET_SUPPORTED_CPUID directly to mask out features from guest-visible cpuid. The old get_para_features() mechanism is kept for older kernels that do not implement it. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * Don't zero out buffer in sched_getaffinityMike McCormack2011-05-021-12/+1
| | | | | | | | | | | | | | | | | | The kernel doesn't fill the buffer provided to sched_getaffinity with zero bytes, so neither should QEMU. Signed-off-by: Mike McCormack <mj.mccormack@samsung.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
| * Fix buffer overrun in sched_getaffinityMike McCormack2011-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Zeroing of the cpu array should start from &cpus[kernel_ret] not &cpus[num_zeros_to_fill]. This fixes a crash in EFL's edje_cc running under qemu-arm. Signed-off-by: Mike McCormack <mj.mccormack@samsung.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
| * linux-user: Fix compilation for "old" linux versionsStefan Weil2011-05-021-0/+12
| | | | | | | | | | | | | | | | | | Debian Lenny and other installations with older linux versions failed to compile linux-user because some CLONE_xxx macros are undefined. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
| * Merge branch 'patches' of git://qemu.weilnetz.de/git/qemuBlue Swirl2011-04-292-28/+128
| |\ | | | | | | | | | | | | | | | | | | | | | * 'patches' of git://qemu.weilnetz.de/git/qemu: qemu-timer: Fix timers for w32 qemu-timer: Avoid type casts qemu-timer: Remove unneeded include statement (w32) qemu-timer: Add and use new function qemu_timer_expired_ns
OpenPOWER on IntegriCloud