summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-07-27Add SCM_RIGHTS support to unix socket character devicesMark McLoughlin2-1/+56
If a file descriptor is passed via a message with SCM_RIGHTS ancillary data on a unix socket, store the file descriptor for use in the chr_read() handler. Close the file descriptor if it was not used. The qemu_chr_get_msgfd() API provides access to the passed descriptor. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27Make tcp_chr_read() use recvmsg()Mark McLoughlin1-1/+24
Split out tcp_chr_recv() out of tcp_chr_read() and implement it on non-win32 using recvmsg(). This is needed for a subsequent patch which implements SCM_RIGHTS support. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-27sparc64 really implement itlb/dtlb automatic replacement writesIgor Kovalenko3-90/+84
- implement "used" bit in tlb translation entry - mark tlb entry used if qemu code/data translation succeeds - fold i/d mmu replacement writes code into replace_tlb_1bit_lru which adds 1bit lru replacement algorithm; previously code tried to replace first unlocked entry only - extract more bitmasks to named macros - add "immu" or "dmmu" type name to debugging output where appropriate Signed-off-by: igor.v.kovalenko@gmail.com -- Kind regards, Igor V. Kovalenko
2009-07-27sparc64 name mmu registers and general cleanupIgor Kovalenko4-111/+225
- add names to mmu registers, this helps understanding the code which uses/modifies them. - fold i/d mmu tlb entries tag and tte arrays into arrays of tlb entries - extract demap_tlb routine (code duplication) - extract replace_tlb routine (code duplication) - flush qemu tlb translations when replacing sparc64 mmu tlb entries I have no test case which demands flushing qemu translations, and this patch should have no other visible changes to runtime. Signed-off-by: igor.v.kovalenko@gmail.com -- Kind regards, Igor V. Kovalenko
2009-07-26Give the kernel more roomAlexander Graf1-2/+2
My self-built PPC kernel doesn't fit in the region reserved for the kernel, so I can't use -kernel with it. Let's just extend the region. Signed-off-by: Alexander Graf <agraf@suse.de>
2009-07-26PPC: Round VGA BIOS size to page boundaryAlexander Graf2-0/+8
When giving KVM a slot of a size not on page boundary, it chokes. So let's just round up the VGA BIOS size so nobody complains anymore and we don't need to implement sub-page slots. Required for booting a PPC guest in KVM. Signed-off-by: Alexander Graf <agraf@suse.de>
2009-07-24Fix period initializationmalc1-1/+1
Signed-off-by: malc <av1474@comtv.ru>
2009-07-22provide tests for pit in kernel and irqchip in kernelGlauber Costa2-0/+16
KVM can have an in-kernel pit or irqchip. While we don't implement it yet, having a way for test for it (that always returns zero) will allow us to reuse code in qemu-kvm that tests for it. Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22qemu-thread: use pthread_equalSebastian Herbszt1-1/+1
Fixes qemu-thread.c: In function `qemu_thread_equal': qemu-thread.c:161: error: invalid operands to binary == Use of pthread_equal suggested by Filip Navara. Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22Link bios files when building out of treeJan Kiszka1-1/+4
When starting a qemu binary directly from the build directory and that dir is located outside the source files, the search for bios files fails. Fix this by linking them from the build to the source directory. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22signrom.sh: portability fixChristoph Egger1-2/+3
Attached patch makes signrom.sh working on NetBSD. The output of the 'od' command leads to a syntax error which breaks the build. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22notify io_thread at the end of rx handlingGlauber Costa1-0/+4
This is a backport from qemu-kvm. Just instead of using kvm's specific notification mechanism, we use qemu_notify_event() Signed-off-by: Glauber Costa <glommer@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22introduce on_vcpuGlauber Costa1-6/+29
on_vcpu is a qemu-kvm function that will make sure that a specific piece of code will run on a requested cpu. We don't need that because we're restricted to -smp 1 right now, but those days are likely to end soon. So for the benefit of having qemu-kvm share more code with us, I'm introducing our own version of on_vcpu(). Right now, we either run a function on the current cpu, or abort the execution, because it would mean something is seriously wrong. As an example code, I "ported" kvm_update_guest_debug to use it, with some slight differences from qemu-kvm. This is probably 0.12 material Signed-off-by: Glauber Costa <glommer@redhat.com> CC: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22qemu-io: reject invalid patternChristoph Hellwig1-6/+38
Replace the use of atoi which is used for pattern parsing currently with strtol. Atoi won't parse sedecimal pattern values (it always returns 0), but qemu-iotests use such pattern values. Also reject every pattern that is not a unsigned char as we pass the pattern to memset which expect a bye value (despite having the pattern argument declared as int). Based on an earlier patch by Stefan Weil which did not include the error handling. Signed-off-by: Christoph Hellwig <hch@lst.de> Reported-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22qemu-io: Rework alloc commandKevin Wolf1-8/+14
The alloc command in qemu-io is mostly useless currently. Instead of doing a single call to bdrv_is_allocated, we must call bdrv_is_allocated in a loop until we have found out for each requested sector if it is allocated or not (bdrv_is_allocated returns a number of sectors that are known to be in the same state as the first one, but it is not required to include all of them) This changes the output format of the alloc command so that a change to the expected output of qemu-iotests 019 is necessary once this is included. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22qmu-img: fix qemu-img convert to generate a valid image when the source ↵Akkarit Sangpetch1-7/+13
referenced a backing file Make 'qemu-img convert' copies unallocated parts of the source image when -B option was not specified. Signed-off-by: Akkarit Sangpetch <asangpet@andrew.cmu.edu> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22vmdk: Fix backing file handlingKevin Wolf1-14/+15
Instead of storing the backing file in its own BlockDriverState, VMDK uses the BlockDriverState of the raw image file it opened. This is wrong and breaks functions that access the backing file or protocols. This fix replaces all occurrences of s->hd->backing_* with bs->backing_*. This fixes qemu-iotests failure in 020 (Commit changes to backing file). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22use struct initializer for audio.cJuan Quintela1-26/+26
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22Add save/restore support to the LSI logic SCSI device model.Nolan1-0/+172
This patch requires "Handle BH's queued by AIO completions in qemu_aio_flush()" to work reliably. The combination of those two patches survived 300+ migrations with heavy IO load running in the guest. Signed-off-by: Nolan Leake <nolan <at> sigbus.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22Handle BH's queued by AIO completions in qemu_aio_flush()Nolan1-1/+1
Without this, the call to qemu_aio_flush during migration doesn't actually flush all in-flight SCSI IOs. Signed-off-by: Nolan Leake <nolan <at> sigbus.net> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22Fake dirty loggin when it's not thereAlexander Graf1-1/+12
Some KVM platforms don't support dirty logging yet, like IA64 and PPC, so in order to still have screen updates on those, we need to fake it. This patch just tells the getter function for dirty bitmaps, that all pages within a slot are dirty when the slot has dirty logging enabled. That way we can implement dirty logging on those platforms sometime when it drags down performance, but share the rest of the code with dirty logging capable platforms. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22Use correct input constantAlexander Graf1-1/+9
440 and desktop codes use different input constants for interrupt indication. Let's use the respective ones for KVM. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22Fix warning in kvm-all.cAlexander Graf1-1/+1
This fixes a warning I stumbled across while compiling qemu on PPC64. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22Set PVR in sregsAlexander Graf1-1/+7
We need to tell the kernel about some initial CPU state we don't have yet, so let's use the "sregs" IOCTL for that and simply put the Processor Version Register in there. Now the kernel knows which guest CPU to virtualize. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-22Enable PPC KVM for non-embeddedAlexander Graf1-1/+2
We now have KVM on PPC64 too and might get it on PPC32 as well, as soon as someone writes it. So let's enable KVM for PPC32 and PPC64 targets. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2009-07-21Sparc32: convert Sun4c interrupt controller to qdevBlue Swirl3-20/+57
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21Sparc32: convert SBI to qdevBlue Swirl3-21/+54
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21Fix CONFIG_PROFILERBlue Swirl1-5/+3
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21Sparc32/64: use 64 bit type for memory sizeBlue Swirl2-4/+4
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21qdev: add 64 bit typeBlue Swirl2-0/+62
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21Sparc64: refactor kernel initBlue Swirl1-42/+55
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21Sparc64: refactor CPU initBlue Swirl1-19/+27
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21Sparc64: convert memory to qdevBlue Swirl1-4/+59
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21Sparc64: convert boot prom to qdevBlue Swirl1-29/+62
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21Sparc32: Fix lanceBlue Swirl1-0/+1
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-21Sparc64: convert APB to qdevBlue Swirl2-35/+76
Thanks to Igor Kovalenko for a bugfix. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-20Fix most warnings (errors with -Werror) when debugging is enabledBlue Swirl21-103/+95
I used the following command to enable debugging: perl -p -i -e 's/^\/\/#define DEBUG/#define DEBUG/g' * */* */*/* Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-20Fix build with DEBUG_PCI in pci_host.h enabledBlue Swirl1-5/+8
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-20Clean up fdc qdev conversionBlue Swirl1-74/+65
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2009-07-20Fix rbase initializationmalc1-1/+1
Signed-off-by: malc <av1474@comtv.ru>
2009-07-18Fix a similar configure typo from microblaze.Andrzej Zaborowski1-1/+1
2009-07-18this patch fixes a typo where armv4l was incorrectly spelled arm4l,Laurent Desnogues1-1/+1
preventing the correct handling of --cpu=armv4l. Laurent Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2009-07-18this patch improves the ARM back-end in the following way:Laurent Desnogues2-7/+37
- use movw/movt to load immediate values for ARMv7-A - implement add/sub/and/or/xor with immediate (only 8-bit) Laurent Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2009-07-18tcg: Fix tcg_gen_rotr_i64Aurelien Jarno1-1/+1
Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-07-18Use correct byteswap routine for elf_notemalc1-3/+3
All elf64_note structure members are Elf64_Word (which is 32bit value) hence using bswaptls to byteswap it on 64bit platforms is incorrect. Signed-off-by: malc <av1474@comtv.ru>
2009-07-18Avoid name clashes with symbols that leak from system headersmalc4-41/+46
Signed-off-by: malc <av1474@comtv.ru>
2009-07-18PPC 32/64 GUEST_BASE supportmalc5-41/+130
Signed-off-by: malc <av1474@comtv.ru>
2009-07-18Fix LHZX opcode valuemalc2-2/+2
Signed-off-by: malc <av1474@comtv.ru>
2009-07-17Userspace guest address offsettingJuan Quintela1-1/+1
Fix type in i386 tcg. Signed-off-by: Juan Quintela <quintela@redhat.com>
2009-07-17bsd-users: fix straceChristoph Egger1-2/+2
Hi! Attached patch fixes an unlock bug in strace. Catched by gcc due to an use of uninitialized variable. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632