target-sparc: fix --enable-debug build for 64 bit host
b551ec04ca45d1925417dd2ec7c1b7f115c84f1d fixedthe compilation for 32 bit hosts, but introduceda new error for 64 bit hosts:
tcg_temp_new_ptr needs a matching tcg_temp_free_ptr.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
Fix -usbdevice crash
If -usbdevice is used on a machine with no USB busses, usb_createwill fail and return NULL. Patch below handles this failure gracefullyrather than crashing when we try to init the device.
Signed-off-by: Paul Brook <paul@codesourcery.com>
ARM defconfig fix
Tix typo in default-configs/arm-softmmu.mak
target-alpha: Fix gdb access to fpcr and unique.
cpu_gdb_read/write_register need to access the fpcr via thecpu_alpha_load/store_fpcr functions.
The unique register is number 66 in the gdb remote protocol.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
target-alpha: Split up FPCR value into separate fields.
The fpcr_exc_status, fpcr_exc_mask, and fpcr_dyn_round fieldsare stored in <softfloat.h> format for convenience duringregular execution.
Revert the addition of float_exception_mask to float_status,...
target-alpha: Reduce internal processor registers for user-mode.
The existing set of IPRs is totally irrelevant to user-mode emulation.Indeed, they most are irrelevant to implementing kernel-mode emulation,and would only be relevant to PAL-mode emulation, which I suspect that...
target-alpha: Clean up arithmetic traps.
Replace the EXCP_ARITH_OVERFLOW placeholder with the completeset of bits from the EXC_SUM IPR. Use them in the existingplaces where we raise arithmetic exceptions.
target-alpha: Mark helper_excp as NORETURN.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix OpenBSD linker warning
helper.o(.text+0x11e0): In function `listflags':/src/qemu/target-i386/helper.c:661: warning: sprintf() is often misused, please use snprintf()
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix i386-bsd-user build
Fix mingw32 build
Simplify qemu_realloc()
No functional change. Bonus: looks just like qemu_malloc() now.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pc-bios: update to latest Seabios
- 0360e8e Seabios e820 reservation portion v3 - 7149fc8 Initial support for booting from USB drives. - 3c160dd Introduce helper functions for finding USB end-points. - 9571439 USB UHCI cleanups. - a4bd919 Minor - arrange struct drive_s to clarify field roles....
declare saved_env_reg as volatile
This ensures that the compiler does not move it away fromthe "env = env1;" assignment. Fixes a miscompilationon gcc 4.4, reported by Jay Foad.
Cc: <jay.foad@gmail.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
qcow2: Factor next_refcount_table_size out
When the refcount table grows, it doesn't only grow by one entry but reservessome space for future refcount blocks. The algorithm to calculate the number ofentries stays the same with the fixes, so factor it out before replacing the...
qcow2: Rewrite alloc_refcount_block/grow_refcount_table
The current implementation of alloc_refcount_block and grow_refcount_table hasfundamental problems regarding error handling. There are some places where anI/O error means that the image is going to be corrupted. I have found that the...
qcow2: More checks for qemu-img check
Implement some more refcount block related checks
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qcow2: Fix image creation regression
When checking for errors, commit db89119d compares with the wrong values,failing image creation even when there was no error. Additionally, if anerror has occured, we can't preallocate the image (it's likely broken)....
rewrote timer implementation for rtl8139.
Add a QEMU timer only when needed (timeout status not set, timeoutirq wanted and timer set).
This patch is required for Darwin. Patch has been tested underFreeBSD, Darwin and Linux.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>...
fix 'i' format handling in memory dump
It was broken by 09b9418c6d0. (!env && = (!is_physical)when env is true.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
target-mips: fix ROTR and DROTR by zero
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-mips: remove useless sign extension
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-mips: fix CpU exception for coprocessor 0
When we signal a CpU exception for coprocessor 0, we should indicatethat it's for coprocessor 0 instead of coprocessor 1.
Fix qemu_eventfd compile when !CONFIG_EVENTFD
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
ARM CP15 tls fix
Fix temporary handling in cp15 tls register load/store.
Merge remote branch 'qemu-kvm/uq/master' into staging
add close callback for tty-based char device
v1 -> v2 coding style changes
Add a tty close callback. Right now if a guest device that is connectedto a tty-based chardev in the host is removed, the tty is not closed.With this patch it is closed.
Example use case is connecting an emulated USB serial cable in the guest...
Add cpu model configuration support..
This is a reimplementation of prior versions which addsthe ability to define cpu models for contemporary processors.The added models are likewise selected via -cpu <name>,and are intended to displace the existing convention...
Fix lost serial TX interrupts. Report receive overruns.
o Implement receive overrun status. The FreeBSD uart driver relies on this status in it's probe routine to determine the size of the FIFO supported. o As per the 16550 spec, do not overwrite the RX FIFO on an RX overrun....
tcg/ppc: Fix typo
Signed-off-by: malc <av1474@comtv.ru>
apc_pci: simplify using rwhandler
Use rwhandler to simplify apb_pci.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
apb_pci: minor cleanup
pci_data_write ignores high 8 bit in address,so there seems to be no need to set themin apb_pci.
Update OpenBIOS images to r683
Fix arm-softmmu compile
cc1: warnings being treated as errors/src/qemu/hw/pl181.c: In function 'pl181_fifo_run':/src/qemu/hw/pl181.c:185: error: 'value' may be used uninitialized in this function
tcg/ppc64: Use C90 style comments
tcg/ppc: Implement some of the optional ops
kvm-all.c: define smp_wmb and use it for coalesced mmio
Acked-by: "Michael S. Tsirkin" <mst@redhat.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
tcg: fix build on 32-bit hppa, ppc and sparc hosts
The qemu_ld32s op is only defined if TCG_TARGET_REG_BITS == 64.
Signed-off-by: Jay Foad <jay.foad@gmail.com>Signed-off-by: malc <av1474@comtv.ru>
PL181 write fix
The PL181 data transfer loop incorrectly terminates after the last FIFOword is popped, discarding the last 3 bytes of data on a write transfer.
block SIGCHLD in vcpu thread(s)
Otherwise a vcpu thread can run the sigchild handler causingwaitpid() from iothread to fail.
Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
kvm specific wait_io_event
In KVM mode the global mutex is released when vcpus are executing,which means acquiring the fairness mutex is not required.
Also for KVM there is one thread per vcpu, so tcg_has_work is meaningless.
Add a new qemu_wait_io_event_common function to hold common code...
kvm: consume internal signal with sigtimedwait
Change the way the internal qemu signal, used for communication betweeniothread and vcpus, is handled.
Block and consume it with sigtimedwait on the outer vcpu loop, whichallows more precise timing control....
kvm: remove pre-entry exit_request check with iothread enabled
With SIG_IPI blocked vcpu loop exit notification happens via -EAGAINfrom KVM_RUN.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
Allow const QemuOptDesc
kvm: Kill CR3_CACHE feature references
Remove all references to KVM_CR3_CACHE as it was never implemented.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Avi Kivity <avi@redhat.com>
kvm: Fix eflags corruption in kvm mode
This should explain a lot of the weird breakages of upstream KVM we'veseen recently (actually we should have seen it much earlier):
Stop translating eflags into TCG format when in kvm mode as we nevertranslate it back and rather sync this broken state into the kernel....
cris: Add CRISv10 gdbstub support.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
cris: Mask interrupts on dslots for CRISv10.
CRISv10 cores (unlike v32) do not take any interrupts while delayedjumps are pending (delay slots).
microblaze: Improve brk emulation.
brk insns while in user mode raise priv insn exceptions.This commit makes gdbserver work on linux guests.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
microblaze: Dont segfault when singlestepping first insn.
target-sparc: fix --enable-debug build
Use 32-bit arithmetic for the address offset calculation to fix abuild failure on 32-bit hosts.
Signed-off-by: Jay Foad <jay.foad@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tcg: fix assertion with --enable-debug
On 32-bit hosts op_qemu_ld32s is unused. Remove it to fix thefollowing assertion failure:
qemu-alpha: tcg/tcg.c:1055:tcg_add_target_add_op_defs: Assertion `tcg_op_defs[op].used' failed.
Signed-off-by: Jay Foad <jay.foad@gmail.com>...
Don't compile rwhandler.c for user targets
tcg: Add comments for all optional instructions not implemented.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tcg-sparc: Implement ORC.
tcg-sparc: Implement ANDC.
tcg: Optional target implementation of ORC.
Previously ORC was always implemented by tcg-op.h withan explicit NOT opcode. Allow a target implementation.
tcg: Optional target implementation of ANDC.
Previously ANDC was always implemented by tcg-op.h withan explicit NOT opcode. Allow a target implementation.
tcg-sparc: Implement not.
The fallback implementation of "ret = arg1 ^ -1" isn't idealbecause of the extra tcg op to load the minus one.
tcg-sparc: Implement neg.
The fallback implementation of "ret = 0 - arg1" isn't ideal,first because of the extra tcg op to load the zero, and secondbecause we fail to handle zero as %g0 for arg1 of the sub.
Fix warning on mingw32
/src/qemu/hw/ide/core.c: In function 'ide_drive_pre_save':/src/qemu/hw/ide/core.c:2740: warning: comparison is always false due to limited range of data type
Fix warning on OpenBSD
/src/qemu/net.c: In function `net_check_clients':/src/qemu/net.c:1287: warning: `has_nic' might be used uninitialized in this function/src/qemu/net.c:1287: warning: `has_host_dev' might be used uninitialized in this function
tcg/ppc: Consistently use calling convention selection macros
Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
New version after malc's comments. (Added error handling.)
Submitted by: Andreas Tobler <andreast@fgznet.ch>
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>Signed-off-by: malc <av1474@comtv.ru>
Add FreeBSD/ppc host ucontext definitions.
Use ppc host calling convention definitions to set TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET}.
New version after malc's comments. (This avoids having to do #if defined linux || defined FreeBSD || defined FreeBSD_kernelfor the third case.)...
QEMU e820 reservation patch
Hi,
Kevin and I have agreed on the approach for this one now. So here isthe latest version of the patch for QEMU, submitting e820 reservationentries via fw_cfg.
Cheers,Jes
Use qemu-cfg to provide the BIOS with an optional table of e820 entries....
qdev: Free opts on failed do_device_add
If the device can't be created, don't leak the QemuOpts and release the id ofthe device that should have been added by the failed device_add.
qcow2: Fix access after end of array
If a write requests crosses a L2 table boundary and all clusters until theend of the L2 table are usable for the request, we must not look at the nextL2 entry because we already have arrived at the end of the array....
qemu-img: Fix segfault during rebase
This fixes a possible read beyond the end of the temporary buffers used forcomparing data in the old and the new backing file.
qemu-img: Fix error message
When qemu-img can't open the new backing file for a rebase, it prints an errormessage which contains the file name of the old backing file. This is wrong,obviously.
ide save/restore pio/atapi cmd transfer fields and io buffer
Save/restore information necessary to continue in progress PIO/ATAPI CMDtransfers.
This includes the IO buffer.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
USB HID does not support Set_Idle
I found that the QEMU USB keyboard support does not work properly withthe Set_Idle command. Once a non-zero value is given to Set_Idle,then the keyboard reports an event on every poll - not based on thetime issued in the Set_Idle command....
pc: Bump up pc version to 0.13 and add a 0.12 compat version
The version 0.13 will be the new default and compatibility options willbe added to the 0.12 version.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc: Add backward compatibility options for virtio-serial
virtio-serial-pci can support multiple ports in the current developmentversion that will become 0.13. Add compatibility options for the 0.12and 0.11 pc machine types.
Signed-off-by: Amit Shah <amit.shah@redhat.com>...
virtio-serial: don't set MULTIPORT for 1 port dev
Since commit 98b19252cf1bd97c54bc4613f3537c5ec0aae263, allserial devices declare MULTIPORT feature.To allow 0.12 compatibility, we should clear this whenmax_nr_ports is 1.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
virtio-serial: pci: Allow MSI to be disabled
Michael noted we don't allow disabling of MSI for the virtio-serial-pcidevice. Fix that.
Signed-off-by: Amit Shah <amit.shah@redhat.com>CC: "Michael S. Tsirkin" <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix hanging user monitor when using balloon command
Arghh... Adding missing S-O-B
Hi Anthony. I wonder if there was a problem when importing my asynccommand handler patchset. Since the 'balloon' command completesimmediately, it must call the completion callback before returning....
mingw32: Enable C99/POSIX format strings
Starting with mingw32-runtime 3.15, C99/POSIXformat strings (%zu, %lld, ...) are supportedby defining __USE_MINGW_ANSI_STDIO=1.
As QEMU uses such format strings, unconditionallydefine this macro. It won't hurt on older revisions...
block: more read-only changes, related to backing files
Open backing file read-only where possibleUpgrade backing file to read-write during commit, back to read-only after commit If upgrade fail, back to read-only. If also fail, "disconnect" the drive....
Monitor: Debugging support
Add configure options (--enable-debug-mon and --disable-debug-mon)plus the MON_DEBUG() macro.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Monitor: Drop the print disabling mechanism
We can ignore calls to monitor_vprintf() in QMP mode and usemonitor_puts() directly in monitor_json_emitter().
This allows us to drop this ugly hack.
Monitor: Audit handler return
This commit verifies the following two rules specified byMarkus Armbruster:
1. If the handler returns failure, it must have passed an error.
If it didn't, it's broken. Report an internal error to the client, and report the bug to the programmer....
Monitor: Debug stray prints the right way
QObject Monitor handlers should not call any Monitor printfunction: they should only build objects, printing is doneby common code.
Current QMP code will ignore such calls, as we can't sendgarbage to clients, additionally it will also emit an...
Monitor: Report more than one error in handlers
Handlers can generate only one error in a call, we let theprogrammer know if they brake this rule and clients will onlyget the first generated error.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>...
Monitor: Convert do_getfd() to cmd_new_ret()
Monitor: Convert do_closefd() to cmd_new_ret()
Monitor: Convert pci_device_hot_add() to cmd_new_ret()
Monitor: Convert pci_device_hot_remove() to cmd_new_ret()
Monitor: Convert do_migrate() to cmd_new_ret()
While there I'm also dropping a unneeded else clause (the lastone in the function).
Monitor: Convert do_memory_save() to cmd_new_ret()
Monitor: Convert do_physical_memory_save() to cmd_new_ret()
Monitor: Convert do_info() to cmd_new_ret()
Note that this function only fails in QMP, in the user Monitorit prints the help text instead.
Monitor: Convert do_change() to cmd_new_ret()
Not that trivial as the call chain also has to be modified.
Monitor: Rename cmd_new_ret()
Now that all handlers are converted to cmd_new_ret(), we can renameit back to cmd_new(). But now it returns a value.
Monitor: Convert simple handlers to cmd_new_ret()
The following handlers always succeed and hence can be convertedto cmd_new_ret() in the same commit.
- do_stop()- do_quit()- do_system_reset()- do_system_powerdown()- do_migrate_cancel()- do_qmp_capabilities()...
Monitor: Convert do_cont() to cmd_new_ret()
Monitor: Convert do_eject() to cmd_new_ret()
Monitor: Convert do_cpu_set() to cmd_new_ret()
Monitor: Convert do_block_set_passwd() to cmd_new_ret()