vnc: don't set the quality if lossy encoding are disabled
This should not change the current behavior, but if any newencoding try to use the tight quality, it will always be setto -1 when lossy encodings are disabled.
Signed-off-by: Corentin Chary <corentincj@iksaif.net>...
vnc: add a way to get the update frequency for a given region
This patch compute the update frequency (in Hz) for each 64x64 rects.Any adaptive encoding can get this value using vnc_update_freq(), andswitch to a lossy encoding if the value is too high....
vnc: refresh lossy rect after a given timeout
If an adaptive encoding has choosen to send a lossy updatebased on the result of vnc_update_freq(), then it should advertiseit with vnc_sent_lossy_rect(). This will allow to automatically refreshthis rect once it's static again....
vnc: tight: use the update frequency to choose between lossy and lossless
Use the new update frequency infrastructure to use jpeg for regions withhigh update frequency.
Signed-off-by: Corentin Chary <corentincj@iksaif.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vnc: palette: use a pool to reduce memory allocations
We now that the palette will never have more than 256elements. Let's use a pool to reduce malloc calls.
vnc: palette: add palette_init calls
This allow to use palette on the stack instead of alwaysallocating them.
vnc: palette: and fill and color calls.
These two helpers are needed for zrle and zywrle.
vnc: Add ZRLE and ZYWRLE encodings.
Add ZRLE [1] and ZYWRLE [2] encodings. The code is inspire^W stolenfrom libvncserver (again), but have been rewriten to match QEMU codingstyle.
[1] http://www.realvnc.com/docs/rfbproto.pdf[2] http://micro-vnc.jp/research/remote_desktop_ng/ZYWRLE/publications/...
pls3adsp1800: Base load_elf endianness on target endianness
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
microblaze: Allow targeting little-endian mb
do not use qemu_icount_delta in the !use_icount case
The !use_icount code is the same for iothread and non-iothread,except that the timeout is different. Since the timeout might aswell be infinite and is only masking bugs, use the higher value.With this change the !use_icount code is handled equivalently...
hw/irq.h: Remove unused SetIRQFunc typedef
Remove the typedef SetIRQFunc, as it is not used by anything.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Revert "prep: Disable second IDE channel, as long as ISA IDE emulation doesn't support same irq for both channels"
This reverts commit 491e2a338fdf8310c84f6ebaed1683a871a0700e.
isa-bus: Remove bogus IRQ sharing check
Nothing prevented IRQ sharing on the ISA bus in principle. Not allboards supported this, neither each and every card nor driver and OS.Still, there existed valid IRQ sharing scenarios, (at least) two of themcan also be found in QEMU: >2 PC UARTs and the PREP IDE buses....
PS/2 keyboard Scancode Set 3 support
The following patch adds PS/2 keyboard Scancode Set 3 support.
Signed-off-by: Roy Tam <roytam@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-arm: Fix shift by immediate and narrow where src, dest overlap
For Neon shifts by immediate and narrow, correctly handle the casewhere the source registers and the destination registers overlap(the second pass should use the original register contents, not the...
target-arm: Refactor to pull narrowing decode into separate function
Pull the code which decodes narrowing operations as being eithersigned/unsigned saturate or plain out into its own function.
w32: Remove implementation of function ffs
This implementation is no longer needed.
ffs is either a built-in function (for compilations with optimisation)or taken from libiberty.a (which was added by the previous patch).
Cc: Anthony Liguori <aliguori@us.ibm.com>...
w32: Use additional library libiberty.a
libiberty.a is part of MinGW and provides useful functionslike ffs (MinGW) and getopt (MinGW-w64).
It is needed for w64 compilations and allows simpler code for w32.
Cc: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
Fix obvious mistake in pxa2xx i2s driver
RST bit is (1 << 4) bit, not (1 << 3), fix conditionthat enables i2s if ENB is set and RST is not set.
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pxa2xx_keypad: Handle 0xe0xx keycodes
Add handling of 0xe0xx keycodes to pxa2xx_driver.Extended keycodes in keymap should be marked with most significantbit set (i.e. 0x80). Without this patch it's not possible to handlei.e. cursor keys.
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>...
pxa2xx_keypad: enhance emulation of KPAS, KPASMKP regs
Add emulation of KPAS register and proper emulation ofKPASMKP regs, so now driver supports multipresses and properlyworks with Linux driver.
qdev: Fix printout of bit device properties with bit index >= 8
Signed-off-by: David 'Digit' Turner <digit@google.com>Acked-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
check-qdict: Fix possible crash
This warning is reported by cppcheck:
check-qdict.c:270: warning: scanf without field width limits can crash with huge input data
Fix it by limiting the field widths to 127 (both key and value take127 characters + a terminating '\0' byte)....
tests: Fix two memory leaks
Although both leaks are not really important, fix themto avoid cppcheck warnings:
tests/linux-test.c:433: error: Memory leak: stack1tests/linux-test.c:433: error: Memory leak: stack2
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
qemu-char: Check for missing backend name
Check if the backend option is missing before searching the backendtable. This fixes a NULL pointer dereference when QEMU is invoked withthe following invalid command-line:
$ qemu -chardev id=foo,path=/tmp/socket...
ppc405: Fix memory leak
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Acked-by: Andreas Färber <andreas.faerber@web.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
s390: Fix memory leak
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pci: Fix memory leak
vhost: disable on tap link down
qemu makes it possible to disable link at tap which is not communicatedto the guest but causes all packets to be dropped.
When vhost-net is enabled, vhost needs to be aware of both the virtiolink_down and the peer link_down. we switch to userspace emulation when...
net: notify peer about link status change
This works for virtio userspace, as qemu stops giving it packets, butnot for virtio-net connected to vhost-net as that does not get notified...
w32: Fix arguments for GetProcessAffinityMask, SetProcessAffinityMask
These functions take arguments of type PDWORD_PTR which is apointer to a DWORD_PTR, not a pointer to a DWORD.
target-arm: Fix rounding constant addition for Neon shifts
Handle cases where adding the rounding constant could overflow in Neonshift instructions: VRSHR, VRSRA, VQRSHRN, VQRSHRUN, VRSHRN.
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>[peter.maydell@linaro.org: fix handling of large shifts in rshl_s32,...
target-arm: Fix signed VRSHL by large shift counts
Correctly handle VRSHL of signed values by a shift count of thewidth of the data type or larger, which must be special-cased in thershl_s* helper functions.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
target-arm: Fix unsigned VRSHL.s8 and .s16 right shifts by type width
Fix handling of unsigned VRSHL.s8 and .s16 right shifts by the typewidth.
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
target-arm: fix unsigned 64 bit right shifts.
Fix range of shift amounts which always give 0 as result.
Signed-off-by: Christophe Lyon <christophe.lyon@st.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-arm: Fix saturated values for Neon right shifts
Fix value returned by signed 8 and 16 bit qrshl helperswhen the result has saturated.
target-arm: fix Neon VQSHRN and VSHRN.
Call the normal shift helpers instead of the rounding ones.
target-arm: fix decoding of Neon 64 bit shifts.
Fix decoding of 64 bits variants of VSHRN, VRSHRN, VQSHRN, VQSHRUN,VQRSHRN, VQRSHRUN, taking into account whether inputs are unsignedor not.
target-arm: Fix signed VQRSHL by large shift counts
Handle the case of signed VQRSHL by a shift count of the width of thedata type or larger, which must be special cased in the qrshl_s*helper functions.
target-arm: Fix unsigned VQRSHL by large shift counts
Correctly handle VQRSHL of unsigned values by a shift count of thewidth of the data type or larger, which must be special-cased in theqrshl_u* helper functions.
target-arm: Move Neon VZIP to helper functions
Move the implementation of the Neon VUZP unzip instruction from inlinecode to helper functions. (At 50+ TCG ops it was well over therecommended limit for coding inline.) The helper implementations alsogive the correct answers where the inline implementation did not....
target-arm: Move Neon VUZP to helper functions
Move the implementation of the Neon VUZP unzip instruction from inlinecode to helper functions. (At 50+ TCG ops it was well over therecommended limit for coding inline.) The helper implementations alsofix the handling of the quadword version of the instruction....
target-arm: Correct conversion of Thumb Neon dp encodings into ARM
We handle Thumb Neon data processing instructions by converting theminto the equivalent ARM encoding, as the two are very close. Howeverthe ARM encoding should have bit 28 set, not clear. This wasn't causing...
target-arm: Fix Neon VQDMLSL instruction
For VQDMLSL, negation has to occur after saturation, not before.
target-arm: Refactor handling of VQDMULL
Refactor the handling of VQDMULL so that it is dealt with inits own if() case rather than together with the accumulatinginstructions.
target-arm: Implement VMULL.P8
Implement VMULL.P8 (the 32x32->64 version of the polynomial multiplyinstruction).
qemu-lock.h: Remove non-pthreads spinlock implementations
Since configure guarantees us that we have pthreads on all hostsexcept mingw (which doesn't support a USER_ONLY config), we canand should use the pthread_mutex based implementation of spin_lock()...
e1000: verify we have buffers, upfront
The spec says: Any descriptor with a non-zero status byte has beenprocessed by the hardware, and is ready to be handled by the software.
Thus, once we change a descriptor status to non-zero we shouldnever move the head backwards and try to reuse this...
e1000: clear EOP for multi-buffer descriptors
The e1000 spec says: if software statically allocatesbuffers, and uses memory read to check for completed descriptors, itsimply has to zero the status byte in the descriptor to make it readyfor reuse by hardware. This is not a hardware requirement (moving the...
e1000: multi-buffer packet support
e1000 supports multi-buffer packets larger than rxbuf_size.
This fixes the following (on linux):- in guest: ifconfig eth1 mtu 16110- in host: ifconfig tap0 mtu 16110 ping -s 16082 <guest-ip>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
pc: remove test on TARGET_PHYS_ADDR_BITS == 32
Both i386 and x86_64 targets are now using target_phys_bits=64. Removeuseless code.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-i386: set target_phys_bits to 64
qemu i386 used to support more than 4GB of RAM through PAE, but it hasbeen disabled for an unknown reason. Reenable it.
Note that simply running qemu x86_64 and emulating a 32-bit CPU is nota solution to this problem as it is about 15% slower (it needs to...
Merge branch 'linux-user-for-upstream' of git://gitorious.org/qemu-maemo/qemu
i8254: convert to qdev
Convert to qdev. Don't expose PITState.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
vga-isa: make optional
Ignore failure with vga-isa device creation, but print a warningmessage.
vga-isa: convert to qdev
applesmc: make optional
Based on patch by David Ahern.
fdc: make optional
Ignore failure with fdc device creation.
fdc: refactor device creation
Turn fdc_init_isa into an inline function.
Get floppy geometry directly from the drives.
Don't expose FDCtrl.
fdc: use FDriveType for floppy drive type
fdc: move floppy geometry guessing to block.c
Other geometry guessing functions already reside in block.c.
Remove some unused or debugging only fields.
serial: make optional
Ignore failure with serial device creation.
serial: refactor device creation
Turn serial_init into an inline function.
ne2000_isa: make optional
Ignore failure with ne2000_isa device creation.
ne2000_isa: refactor device creation
Turn isa_ne2000_init into an inline function.
parallel: make optional
Ignore failure with parallel device creation.
parallel: refactor device creation
Turn parallel_init into an inline function.
Don't expose ParallelState.
Fix vmport segfault (v2)
Fix regression caused by qdev conversion.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
linux-user: add rmdir() strace
Signed-off-by: Laurent Vivier <laurent@vivier.eu>Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
linux-user: in linux-user/strace.c, tswap() is useless
Syscall parameters are already swapped by the caller.
This patch removes useless tswap() from strace.c
$ QEMU_STRACE=1 chroot /m68k mknod myramdisk b 1 1with tswap()...29944 mknod("myramdisk",026630200000) = 0...
linux-user: Support the epoll syscalls
Support the epoll family of syscalls: epoll_create(), epoll_create1(),epoll_ctl(), epoll_wait() and epoll_pwait(). Note that epoll_create1()and epoll_pwait() are later additions, so we have to test separatelyin configure for their presence....
linux-user: Define target alignment size
Datatype alignment can be found using following application:
int main(void) { printf("alignof(short) %ld\n", alignof(short)); printf("alignof(int) %ld\n", alignof(int)); printf("alignof(long) %ld\n", alignof(long));...
linux-user: correct core dump format
This patch allows to really use the core dumped by qemu with guestarchitecture tools.
- it adds a missing bswap_phdr() for the program headers of memory regions.
"objdump -x" sample:
BEFORE:
0x1000000 off 0x00200000 vaddr 0x00000400 paddr 0x00000000 align 2**21...
Merge remote branch 'kwolf/for-anthony' into staging
Merge remote branch 'qemu-kvm/uq/master' into staging
Handle icount for powerpc tbl/tbu/decr load and store.
Handle option '-icount X' on powerpc targets.
Signed-off-by: Tristan Gingold <gingold@adacore.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
Merge mainstone.h header into mainstone.c
Now the only user of mainstone.h is mainstone.c file. Merge headerinto board file.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
mainstone: convert FPGA emulation code to use QDev/SysBus
mainstone: correct and simplify irq handling
Simplify IRQ handling to stop setting an input irq pin. As a win, also getcorrect IRQ status after save/load cycle.
Fix build from previous commit
I unfortunately got on an unnamed branch and pushed the wrong bits
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
PATCH] slirp: fix buffer overrun
Since the addition of the slirp member to struct mbuf, the value ofSLIRP_MSIZE and the initialization of m_size have not been correct,resulting in overrunning the end of the malloc'd buffer in some cases.
Signed-off-by: Bruce Rogers <brogers@novell.com>...
io-thread: make sure to initialize qemu_work_cond and qemu_cpu_cond
correctly check ppr priority during interrupt injection]
TPR blocks all interrupts in a priority class, so simple "less orequal" check is not enough.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
kvm: x86: Introduce kvmclock device to save/restore its state
If kvmclock is used, which implies the kernel supports it, register akvmclock device with the sysbus. Its main purpose is to save and restorethe kernel state on migration, but this will also allow to visualize it...
Introduce log_start/log_stop in CPUPhysMemoryClient
In order to use log_start/log_stop with Xen as well in the vga code,this two operations have been put in CPUPhysMemoryClient.
The two new functions cpu_physical_log_start,cpu_physical_log_stop areused in hw/vga.c and replace the kvm_log_start/stop. With this, vga does...
cirrus: Remove obsolete kvm.h include
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
kvm: Make kvm_state globally available
KVM-assisted devices need access to it but we have no clean channel todistribute a reference. As a workaround until there is a bettersolution, export kvm_state for global use, though use should remainrestricted to the mentioned scenario....
kvm: make tsc stable over migration and machine start
If the machine is stopped, we should not record two different tsc valuesupon a save operation. The same problem happens with kvmclock.
But kvmclock is taking a different diretion, being now seen as a separate...
Refactor kvm&tcg function names in cpus.c
Pure interface cosmetics: Ensure that only kvm core services (asdeclared in kvm.h) start with "kvm_". Prepend "qemu_" to those thatviolate this rule in cpus.c. Also rename the corresponding tcg functionsfor the sake of consistency....
Refactor cpu_has_work/any_cpu_has_work in cpus.c
Avoid duplicate use of the function name cpu_has_work, it's confusing,also their scope. Refactor cpu_has_work to cpu_thread_is_idle and do thesame with any_cpu_has_work.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Fix a few coding style violations in cpus.c
No functional changes.
Improve vm_stop reason declarations
Define and use dedicated constants for vm_stop reasons, they actuallyhave nothing to do with the EXCP_* defines used so far. At this chance,specify more detailed reasons so that VM state change handlers canevaluate them....
Refactor debug and vmstop request interface
Instead of fiddling with debug_requested and vmstop_requested directly,introduce qemu_system_debug_request and turn qemu_system_vmstop_requestinto a public interface. This aligns those services with exiting ones in...
Move debug exception handling out of cpu_exec
To prepare splitting up KVM and TCG CPU entry/exit, move the debugexception into cpus.c and invoke cpu_handle_debug_exception on returnfrom qemu_cpu_exec.
This also allows to clean up the debug request signaling: We can assign...
kvm: Separate TCG from KVM cpu execution
Mixing up TCG bits with KVM already led to problems around eflagsemulation on x86. Moreover, quite some code that TCG requires on cpuenty/exit is useless for KVM. So dispatch between tcg_cpu_exec andkvm_cpu_exec as early as possible....
kvm: x86: Prepare VCPU loop for in-kernel irqchip
Effectively no functional change yet as kvm_irqchip_in_kernel still onlyreturns 0, but this patch will allow qemu-kvm to adopt the VCPU loop ofupsteam KVM.
kvm: Drop return values from kvm_arch_pre/post_run
We do not check them, and the only arch with non-empty implementationsalways returns 0 (this is also true for qemu-kvm).
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>CC: Alexander Graf <agraf@suse.de>...
kvm: x86: Catch and report failing IRQ and NMI injections
We do not need to abort, but the user should be notified that weirdthings go on.
kvm: Remove unneeded memory slot reservation
The number of slots and the location of private ones changed severaltimes in KVM's early days. However, it's stable since 2.6.29 (ourrequired baseline), and slots 8..11 are no longer reserved since then.So remove this unneeded restriction....