summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* pc: Fix CMOS info for drives defined with -deviceqemu-kvm-0.12.5-gentoo-1qemu-kvm-0.12.5-gentooMarkus Armbruster2010-08-203-37/+77
| | | | | | | | | | | | | | | | | Drives defined with -drive if=ide get get created along with the IDE controller, inside machine->init(). That's before cmos_init(). Drives defined with -device get created during generic device init. That's after cmos_init(). Because of that, CMOS has no information on them (type, geometry, translation). Older versions of Windows such as XP reportedly choke on that. Split off the part of CMOS initialization that needs to know about -device devices, and turn it into a reset handler, so it runs after device creation. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit c0897e0cb94e83ec1098867b81870e4f51f225b9)
* ide: Make PIIX and ISA IDE init functions return the qdevMarkus Armbruster2010-08-203-11/+14
| | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 57c888664b5eb7edbbce4be98cb1406aa0d85c2b)
* Merge branch 'stable-0.12-merge' into stable-0.12qemu-kvm-0.12.5Marcelo Tosatti2010-07-2615-128/+279
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable-0.12-merge: Update for 0.12.5 release audio/alsa: Handle SND_PCM_STATE_SETUP in alsa_poll_handler block: Handle multiwrite errors only when all requests have completed block: Fix early failure in multiwrite vpc: Use bdrv_(p)write_sync for metadata writes vmdk: Use bdrv_(p)write_sync for metadata writes qcow2: Use bdrv_(p)write_sync for metadata writes qcow: Use bdrv_(p)write_sync for metadata writes block: Add bdrv_(p)write_sync qcow2: Restore L1 entry on l2_allocate failure block/vdi: Fix image opening and creation for odd disk sizes block/vpc: Fix conversion from size to disk geometry qcow2: Remove abort on free_clusters failure vmdk: Fix COW qcow2: Fix creation of large images vmdk: fix double free qemu-options: add documentation for stdio signal=on|off Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * Merge commit '174f225e9d62e8f3002e274e4f718bd2a967fbf4' into stable-0.12-mergeMarcelo Tosatti2010-07-2615-128/+279
|/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '174f225e9d62e8f3002e274e4f718bd2a967fbf4': Update for 0.12.5 release audio/alsa: Handle SND_PCM_STATE_SETUP in alsa_poll_handler block: Handle multiwrite errors only when all requests have completed block: Fix early failure in multiwrite vpc: Use bdrv_(p)write_sync for metadata writes vmdk: Use bdrv_(p)write_sync for metadata writes qcow2: Use bdrv_(p)write_sync for metadata writes qcow: Use bdrv_(p)write_sync for metadata writes block: Add bdrv_(p)write_sync qcow2: Restore L1 entry on l2_allocate failure block/vdi: Fix image opening and creation for odd disk sizes block/vpc: Fix conversion from size to disk geometry qcow2: Remove abort on free_clusters failure vmdk: Fix COW qcow2: Fix creation of large images vmdk: fix double free qemu-options: add documentation for stdio signal=on|off Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
| * Update for 0.12.5 releaseAurelien Jarno2010-07-222-1/+48
| | | | | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * audio/alsa: Handle SND_PCM_STATE_SETUP in alsa_poll_handlermalc2010-07-221-0/+4
| | | | | | | | | | Signed-off-by: malc <av1474@comtv.ru> (cherry picked from commit d9812b033a17c82f9e933757c1c3ef364e3ba62d)
| * block: Handle multiwrite errors only when all requests have completedKevin Wolf2010-07-141-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't try to be clever by freeing all temporary data and calling all callbacks when the return value (an error) is certain. Doing so has at least two important problems: * The temporary data that is freed (qiov, possibly zero buffer) is still used by the requests that have not yet completed. * Calling the callbacks for all requests in the multiwrite means for the caller that it may free buffers etc. which are still in use. Just remember the error value and do the cleanup when all requests have completed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit de189a1b4a471d37a2909e97646654fc9751b52f)
| * block: Fix early failure in multiwriteKevin Wolf2010-07-141-7/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bdrv_aio_writev may call the callback immediately (and it will commonly do so in error cases). Current code doesn't consider this. For details see the comment added by this patch. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 453f9a1652629e5805995b165be2e634c8487139) Conflicts: block.c Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * vpc: Use bdrv_(p)write_sync for metadata writesKevin Wolf2010-07-141-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Use bdrv_(p)write_sync to ensure metadata integrity in case of a crash. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 078a458e077d6b0db262c4b05fee51d01de2d1d2) Conflicts: block/vpc.c Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * vmdk: Use bdrv_(p)write_sync for metadata writesKevin Wolf2010-07-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Use bdrv_(p)write_sync to ensure metadata integrity in case of a crash. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit b8852e87d9d113096342c3e0977266cda0fe9ee5) Conflicts: block/vmdk.c Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * qcow2: Use bdrv_(p)write_sync for metadata writesKevin Wolf2010-07-143-48/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use bdrv_(p)write_sync to ensure metadata integrity in case of a crash. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 8b3b720620a1137a1b794fc3ed64734236f94e06) Conflicts: block/qcow2-cluster.c block/qcow2-refcount.c block/qcow2-snapshot.c block/qcow2.c Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * qcow: Use bdrv_(p)write_sync for metadata writesKevin Wolf2010-07-141-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Use bdrv_(p)write_sync to ensure metadata integrity in case of a crash. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 5e5557d97026d1d3325e0e7b0ba593366da2f3dc) Conflicts: block/qcow.c Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * block: Add bdrv_(p)write_syncKevin Wolf2010-07-143-0/+44
| | | | | | | | | | | | | | | | | | | | | | Add new functions that write and flush the written data to disk immediately. This is what needs to be used for image format metadata to maintain integrity for cache=... modes that don't use O_DSYNC. (Actually, we only need barriers, and therefore the functions are defined as such, but flushes is what is implemented in this patch - we can try to change that later) Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit f08145fe16470aca09304099888f68cfbc5d1de7)
| * qcow2: Restore L1 entry on l2_allocate failureKevin Wolf2010-07-141-0/+1
| | | | | | | | | | | | | | | | | | If writing the L1 table to disk failed, we need to restore its old content in memory to avoid inconsistencies. Reported-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 68dba0bf455e60061bb3c9c40ef0d82916372664)
| * block/vdi: Fix image opening and creation for odd disk sizesKevin Wolf2010-07-141-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix is based on a patch from Kevin Wolf. Here his comment: "The number of blocks needs to be rounded up to cover all of the virtual hard disk. Without this fix, we can't even open our own images if their size is not a multiple of the block size." While Kevin's patch addressed vdi_create, my modification also fixes vdi_open which now accepts images with odd disk sizes. v3: Don't allow reading of disk images with too large disk sizes. Neither VBoxManage nor old versions of qemu-img read such images. This change requires rounding of odd disk sizes before we do the checks. Cc: Kevin Wolf <kwolf@redhat.com> Cc: François Revol <revol@free.fr> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit f21dc3a4652eeb82117d7d55d975278fe1444b26) Conflicts: block/vdi.c Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * block/vpc: Fix conversion from size to disk geometryStefan Weil2010-07-141-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The VHD algorithm calculates a disk geometry which is usually smaller than the requested size. QEMU tried to round up but failed for certain sizes: qemu-img create -f vpc disk.vpc 9437184 would create an image with 9435136 bytes (which is too small for qemu-img convert). Instead of hacking the geometry algorithm, the patch increases the number of sectors until we get enough sectors. Cc: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit dede4188cc817a039154ed2ecd7f3285f6b94056)
| * qcow2: Remove abort on free_clusters failureKevin Wolf2010-07-141-1/+1
| | | | | | | | | | | | | | | | | | While it's true that during regular operation free_clusters failure would be a bug, an I/O error can always happen. There's no need to kill the VM, the worst thing that can happen (and it will) is that we leak some clusters. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 003fad6e2cae5311d3aea996388c90e3ab17de90)
| * vmdk: Fix COWKevin Wolf2010-07-141-24/+11
| | | | | | | | | | | | | | | | | | | | | | When trying to do COW, VMDK wrote the data back to the backing file. This problem was revealed by the patch that made backing files read-only. This patch does not only fix the problem, but also simplifies the VMDK code a bit. This fixes the backing file qemu-iotests cases for VMDK. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit c336500df5bf08492f4e7796b2193cd4976f3548)
| * qcow2: Fix creation of large imagesKevin Wolf2010-07-141-9/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qcow_create2 assumes that the new image will only need one cluster for its refcount table initially. Obviously that's not true any more when the image is big enough (exact value depends on the cluster size). This patch calculates the refcount table size dynamically. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 4768fa902c3860f2fe34403e6e1c83bfca6da034) Conflicts: block/qcow2.c Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * vmdk: fix double freeKevin Wolf2010-07-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fail_gd error case would also free rgd_buf that was already freed Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit a161329b61106ab093aab6d3227ac85e0b8251a9) Conflicts: block/vmdk.c Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * qemu-options: add documentation for stdio signal=on|offAurelien Jarno2010-07-131-4/+8
| | | | | | | | | | | | | | Commit 5989020bc11f8ba448d6fb79f4562f882a693d89 introduced a chardev option to disable signals on stdio. Add the corresponding documentation. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* | Fix segfault after device assignment hot removeAlex Williamson2010-07-261-0/+1
| | | | | | | | | | | | | | | | | | | | We keep a qlist of assigned devices for irq updates, but we forgot to remove entries from it if they're hot unplugged. This makes assigned_dev_update_irqs() a timebomb that goes off when the guest is rebooted. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
* | Merge branch 'stable-0.12' of git://git.sv.gnu.org/qemu into stable-0.12Avi Kivity2010-07-0829-67/+173
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'stable-0.12' of git://git.sv.gnu.org/qemu: (29 commits) target-arm : fix parallel saturated subtraction implementation target-arm : fix thumb2 parallel add/sub opcode decoding target-arm: fix addsub/subadd implementation target-i386: fix xchg rax,r8 block/vvfat.c: fix warnings with _FORTIFY_SOURCE audio/alsa: Spelling typo (paramters) target-mips: fix DINSU instruction Correct definitions for FD_CMD_SAVE and FD_CMD_RESTORE qcow2: Fix corruption after error in update_refcount qcow2: Fix corruption after refblock allocation block: Fix multiwrite with overlapping requests qcow2: Fix error handling in l2_allocate qcow2: Clear L2 table cache after write error ide: Fix ide_dma_cancel usb-bus: fix no params Avoid crash on '-usbdevice <device>' without parameters Fix -usbdevice crash Fix multiboot compilation Fix missing symbols in .rel/.rela.plt sections target-ppc: fix RFI by clearing some bits of MSR ... Signed-off-by: Avi Kivity <avi@redhat.com>
| * target-arm : fix parallel saturated subtraction implementationChih-Min Chao2010-07-011-2/+2
| | | | | | | | | | | | Signed-off-by: Chih-Min Chao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 4c4fd3f852dbb3a7dbcc59110d03d3d15ada5f72)
| * target-arm : fix thumb2 parallel add/sub opcode decodingChih-Min Chao2010-07-011-2/+2
| | | | | | | | | | | | Signed-off-by: Chih-Min Chao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit ed89a2f1b11db03fbdb0ddab93c25913a16c0374)
| * target-arm: fix addsub/subadd implementationChih-Min Chao2010-07-011-4/+4
| | | | | | | | | | | | Signed-off-by: Chih-Min Chao <cmchao@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit bb42e28bdb56a05faca83bd760c1581af2f73a4b)
| * target-i386: fix xchg rax,r8Richard Henderson2010-07-011-2/+7
| | | | | | | | | | | | | | | | We were ignoring REX_B while special-casing NOP, i.e. xchg eax,eax. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 7418027ea4fec276455abd4291558bc58a0a7ba7)
| * block/vvfat.c: fix warnings with _FORTIFY_SOURCEKirill A. Shutemov2010-06-301-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CC block/vvfat.o cc1: warnings being treated as errors block/vvfat.c: In function 'commit_one_file': block/vvfat.c:2259: error: ignoring return value of 'ftruncate', declared with attribute warn_unused_result make: *** [block/vvfat.o] Error 1 CC block/vvfat.o In file included from /usr/include/stdio.h:912, from ./qemu-common.h:19, from block/vvfat.c:27: In function 'snprintf', inlined from 'init_directories' at block/vvfat.c:871, inlined from 'vvfat_open' at block/vvfat.c:1068: /usr/include/bits/stdio2.h:65: error: call to __builtin___snprintf_chk will always overflow destination buffer make: *** [block/vvfat.o] Error 1 Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 2dedf83ef0cc3463783d6b71bf1b25476f691f3a)
| * audio/alsa: Spelling typo (paramters)Vagrant Cascadian2010-06-301-1/+1
| | | | | | | | | | | | | | Trivial patch to fix the spelling of "parameters". Signed-off-by: malc <av1474@comtv.ru> (cherry picked from commit f093feb735ab57171b6fe16f54b7d3b989907d98)
| * target-mips: fix DINSU instructionAurelien Jarno2010-06-301-1/+1
| | | | | | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
| * Correct definitions for FD_CMD_SAVE and FD_CMD_RESTOREJes Sorensen2010-06-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Correct definitions for FD_CMD_SAVE and FD_CMD_RESTORE in hw/fdc.c Per https://bugs.launchpad.net/qemu/+bug/424453 the correct values for FD_CMD_SAVE is 0x2e and FD_CMD_RESTORE is 0x4e. Verified against the Intel 82078 manual which can be found at: http://wiki.qemu.org/Documentation/HardwareManuals page 22. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit bb350a5e9b961a8c3940b3451c329ff07c027aa1)
| * qcow2: Fix corruption after error in update_refcountKevin Wolf2010-06-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | After it is done with updating refcounts in the cache, update_refcount writes all changed entries to disk. If a refcount block allocation fails, however, there was no change yet and therefore first_index = last_index = -1. Don't treat -1 as a normal sector index (resulting in a 512 byte write!) but return without updating anything in this case. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 86fa8da83771238de55dc44819a1a27bafef5353)
| * qcow2: Fix corruption after refblock allocationKevin Wolf2010-06-091-2/+9
| | | | | | | | | | | | | | | | | | | | | | Refblock allocation code needs to take into consideration that update_refcount will load a different refcount block into the cache, so it must initialize the cache for a new refcount block only afterwards. Not doing this means that not only the refcount in the wrong block is updated, but also that the caller will work on the wrong block. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 25408c09502be036e5575754fe54019ed4ed5dfa)
| * block: Fix multiwrite with overlapping requestsKevin Wolf2010-06-091-1/+1
| | | | | | | | | | | | | | | | With overlapping requests, the total number of sectors is smaller than the sum of the nb_sectors of both requests. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit cbf1dff2f1033cadcb15c0ffc9c0a3d039d8ed42)
| * qcow2: Fix error handling in l2_allocateKevin Wolf2010-06-091-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | l2_allocate has some intermediate states in which the image is inconsistent. Change the order to write to the L1 table only after the new L2 table has successfully been initialized. Also reset the L2 cache in failure case, it's very likely wrong. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 175e11526e2613b3dc031c23fec3107aa4a80307) Conflicts: block/qcow2-cluster.c Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * qcow2: Clear L2 table cache after write errorKevin Wolf2010-06-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the L2 table was already updated in cache, but writing it to disk has failed, we must not continue using the changed version in the cache to stay consistent with what's on the disk. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 1b7c801b40ce90795397bb566d019c9b76ef9c13) Conflicts: block/qcow2-cluster.c Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * ide: Fix ide_dma_cancelKevin Wolf2010-06-091-4/+4
| | | | | | | | | | | | | | | | | | | | When cancelling a request, bdrv_aio_cancel may decide that it waits for completion of a request rather than for cancellation. IDE therefore can't abandon its DMA status before calling bdrv_aio_cancel; otherwise the callback of a completed request would use invalid data. Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 38d8dfa193e9a45f0f08b06aab2ba2a94f40a041)
| * usb-bus: fix no paramsLuiz Capitulino2010-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | After commit 702f3e0fb52c124c07f215426eeadb70a716643f, the params is nerver NULL. It should check *params instead of params to determine whether the params is empty. Signed-off-by: TeLeMan <geleman@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> (cherry picked from commit 98f22dc172e1ebd5341da3de0d67666442566f72)
| * Avoid crash on '-usbdevice <device>' without parametersJan Kiszka2010-06-091-1/+3
| | | | | | | | | | | | | | | | Many usbdevice_init implementors assume params is non-NULL. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 702f3e0fb52c124c07f215426eeadb70a716643f)
| * Fix -usbdevice crashPaul Brook2010-06-094-0/+12
| | | | | | | | | | | | | | | | | | If -usbdevice is used on a machine with no USB busses, usb_create will fail and return NULL. Patch below handles this failure gracefully rather than crashing when we try to init the device. Signed-off-by: Paul Brook <paul@codesourcery.com> (cherry picked from commit d44168fffa07fc57e61a37da65e9348661dec887)
| * Fix multiboot compilationAlexander Graf2010-06-092-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit dd4239d6574ca41c94fc0d0f77ddc728510ffc57 broke multiboot. It replaced the instruction "rep insb (%dx), %es:(%edi)" by the binary output of "addr32 rep insb (%dx), %es:(%di)". Linuxboot calls the respective helper function in a code16 section. So the original instruction was automatically translated to its "addr32" equivalent. For multiboot, we're running in code32 so gcc didn't add the "addr32" which breaks the instruction. This patch splits that helper function in one which uses addr32 and one which does not, so everyone's happy. The good news is that nobody probably cared so far. The bundled multiboot.bin binary was built before the change and is thus correct. Please also put this patch into -stable. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 590bf491a49670843ee902c47f7ab1de5e9acd06)
| * Fix missing symbols in .rel/.rela.plt sectionsLoïc Minier2010-06-022-4/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix .rel.plt sections in the output to not only include .rel.plt sections from the input but also the .rel.iplt sections and to define the hidden symbols __rel_iplt_start and __rel_iplt_end around .rel.iplt as otherwise we get undefined references to these when linking statically to a multilib libc.a. This fixes the static build under i386. Apply similar logic to rela.plt/.iplt and __rela_iplt/_plt_start/_end to fix the static build under amd64. Signed-off-by: Loïc Minier <lool@dooz.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 845f2c2812d9ed24b36c02a3d06ee83aeafe8b49)
| * target-ppc: fix RFI by clearing some bits of MSRThomas Monjalon2010-05-312-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 2ada0ed, "Return From Interrupt" is broken for PPC processors because some interrupt specifics bits of SRR1 are copied to MSR. SRR1 is a save of MSR during interrupt. During RFI, MSR must be restored from SRR1. But some bits of SRR1 are interrupt-specific and are not used for MSR saving. This is the specification (ISA 2.06) at chapter 6.4.3 (Interrupt Processing): "2. Bits 33:36 and 42:47 of SRR1 or HSRR1 are loaded with information specific to the interrupt type. 3. Bits 0:32, 37:41, and 48:63 of SRR1 or HSRR1 are loaded with a copy of the corresponding bits of the MSR." Below is a representation of MSR bits which are not saved: 0:15 16:31 32 33:36 37:41 42:47 48:63 ——— | ——— | — X X X X — — — — — X X X X X X | ———— 0000 0000 | 7 | 8 | 3 | F | 0000 History: In the initial Qemu implementation (e1833e1), the mask 0x783F0000 was used for saving MSR in SRR1. But all the bits 32:47 were cleared during RFI restoring. This was wrong. The commit 2ada0ed explains that this breaks Altivec. Indeed, bit 38 (for Altivec support) must be saved and restored. The change of 2ada0ed was to restore all the bits of SRR1 to MSR. But it's also wrong. Explanation: As an example, let's see what's happening after a TLB miss. According to the e300 manual (E300CORERM table 5-6), the TLB miss interrupts set the bits 44-47 for KEY, I/D, WAY and S/L. These bits are specifics to the interrupt and must not be copied into MSR at the end of the interrupt. With the current implementation, a TLB miss overwrite bits POW, TGPR and ILE. Fix: It shouldn't be needed to filter-out bits on MSR saving when interrupt occurs. Specific bits overwrite MSR ones in SRR1. But at the end of interrupt (RFI), specifics bits must be cleared before restoring MSR from SRR1. The mask 0x783F0000 apply here. Discussion: The bits of the mask 0x783F0000 are cleared after an interrupt. I cannot find a specification which talks about this but I assume it is the truth since Linux can run this way. Maybe it's not perfect but it's better (works for e300). Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit c3d420ead1aee9fcfd12be11cbdf6b1620134773)
| * Fix typo in balloon helpRiccardo Magliocchetti2010-05-281-1/+1
| | | | | | | | | | | | | | | | Fix launchpad #563883 Signed-off-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit 3c05613a6a51da833105c1bf3db4917d917f5a3a)
| * arm_timer: fix oneshot modeRabin Vincent2010-05-271-1/+1
| | | | | | | | | | | | | | | | | | In oneshot mode, the delta needs to come from the TimerLoad register, not the maximum limit. Signed-off-by: Rabin Vincent <rabin@rab.in> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit a9cf98d939c4f6539fad7e7d812ea16d96ba3dc9)
| * arm_timer: reload timer when enabledRabin Vincent2010-05-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reload the timer when TimerControl is written, if the timer is to be enabled. Otherwise, if an earlier write to TimerLoad was done while periodic mode was not set, s->delta may incorrectly still have the value of the maximum limit instead of the value written to TimerLoad. This problem is evident on versatileap on current linux-next, which enables TIMER_CTRL_32BIT before writing to TimerLoad and then enabling periodic mode and starting the timer. This causes the first periodic tick to be scheduled to occur after 0xffffffff periods, leading to a perceived hang while the kernel waits for the first timer tick. Signed-off-by: Rabin Vincent <rabin@rab.in> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit d6759902cb467c002086853d2eb38fb969c29f7f)
| * qemu-sockets: avoid strlen of NULL pointerJens Osterkamp2010-05-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | If the user wants to create a chardev of type socket but forgets to give a host= option, qemu_opt_get returns NULL. This NULL pointer is then fed into strlen a few lines below without a check which results in a segfault. This fixes it. Signed-off-by: Jens Osterkamp <jens@linux.vnet.ibm.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit e23a22e620e84f42bdbd473b82672654e7c8de73)
| * block: fix aio_flush segfaults for read-only protocols (e.g. curl)Avi Kivity2010-05-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | Not all block format drivers expose an io_flush method (reasonable for read-only protocols), so calling io_flush there will immediately segfault. Fix by checking for the method's existence before calling it. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit c53a7285b4377e91f30b7742c7e12c16d6bf86f0)
| * virtio-blk: fix barrier supportChristoph Hellwig2010-05-271-2/+13
| | | | | | | | | | | | | | | | | | Before issuing the barrier to the block driver we need to flush our oustanding queue of write requests, as the flush is supposed to be issued after them. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 618fbb84299780af96e3d4c4b6f2148656fe3708)
| * block: fix sector comparism in multiwrite_req_compareChristoph Hellwig2010-05-271-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The difference between the start sectors of two requests can be larger than the size of the "int" type, which can lead to a not correctly sorted multiwrite array and thus spurious I/O errors and filesystem corruption due to incorrect request merges. So instead of doing the cute sector arithmetics trick spell out the exact comparisms. Spotted by Kevin Wolf based on a testcase from Michael Tokarev. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 77be4366baface6613cfc312ba281f8e5860997c)