Clean up slb_lookup() function
The slb_lookup() function, used in the ppc translation path returns anumber of slb entry fields in reference parameters. However, only oneof the two callers of slb_lookup() actually wants this information.
This patch, therefore, makes slb_lookup() return a simple pointer to the...
Parse SDR1 on mtspr instead of at translate time
On ppc machines with hash table MMUs, the special purpose register SDR1contains both the base address of the encoded size (hashed) page tables.
At present, we interpret the SDR1 value within the address translation...
Use "hash" more consistently in ppc mmu code
Currently, get_segment() has a variable called hash. However it doesn't(quite) get the hash value for the ppc hashed page table. Instead itgets the hash shifted - effectively the offset of the hash bucket within...
Better factor the ppc hash translation path
Currently the path handling hash page table translation in get_segment()has a mix of common and 32 or 64 bit specific code. However thedivision is not done terribly well which results in a lot of messy codeflipping between common and divided paths....
Support 1T segments on ppc
Traditionally, the "segments" used for the two-stage translation used onpowerpc MMUs were 256MB in size. This was the only option on all hashpage table based 32-bit powerpc cpus, and on the earlier 64-bit hash pagetable based cpus. However, newer 64-bit cpus also permit 1TB segments...
Add POWER7 support for ppc
This adds emulation support for the recent POWER7 cpu to qemu. It's farfrom perfect - it's missing a number of POWER7 features so far, includingany support for VSX or decimal floating point instructions. However, it'sclose enough to boot a kernel with the POWER7 PVR....
Start implementing pSeries logical partition machine
This patch adds a "pseries" machine to qemu. This aims to emulate alogical partition on an IBM pSeries machine, compliant to the"PowerPC Architecture Platform Requirements" (PAPR) document.
This initial version is quite limited, it implements a basic machine...
Clean up PowerPC SLB handling code
Currently the SLB information when emulating a PowerPC 970 isstoreed in a structure with the unhelpfully named fields 'tmp'and 'tmp64'. While the layout in these fields does match thedescription of the SLB in the architecture document, it is not...
Allow qemu_devtree_setprop() to take arbitrary values
Currently qemu_devtree_setprop() expects the new property value to begiven as a uint32_t *. While property values consisting of u32s arecommon, in general they can have any bytestring value.
Therefore, this patch alters the function to take a void * instead,...
Add a hook to allow hypercalls to be emulated on PowerPC
PowerPC and POWER chips since the POWER4 and 970 have a specialhypervisor mode, and a corresponding form of the system callinstruction which traps to the hypervisor.
qemu currently has stub implementations of hypervisor mode. That...
Implement PowerPC slbmfee and slbmfev instructions
For a 64-bit PowerPC target, qemu correctly implements translationthrough the segment lookaside buffer. Likewise it supports theslbmte instruction which is used to load entries into the SLB.
However, it does not emulate the slbmfee and slbmfev instructions...
Implement missing parts of the logic for the POWER PURR
The PURR (Processor Utilization Resource Register) is a register foundon recent POWER CPUs. The guts of implementing it at least enough toget by are already present in qemu, however some of the helper...
Correct ppc popcntb logic, implement popcntw and popcntd
qemu already includes support for the popcntb instruction introducedin POWER5 (although it doesn't actually allow you to choose POWER5).
However, the logic is slightly incorrect: it will generate results...
target-ppc: ext32u instead of andi with constant
Cc: Alexander Graf <agraf@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>Signed-off-by: Alexander Graf <agraf@suse.de>
lm32: rename raise opcode to scall
To be consistent with the new reference manual.
Signed-off-by: Michael Walle <michael@walle.cc>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
lm32: use lookup table for opcodes
Instead of a for loop use a faster lookup table.
add a service to reap zombies, use it in SLIRP
SLIRP -smb support wants to fork a process and forget about reaping it.To please it, add a generic service to register a process id and letQEMU reap it. In the future it could be enhanced to pass a status,...
extract I/O handler lists to iohandler.c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-pci: fix bus master work around on load
Commit c81131db15dd1844d0db1d51f3cd7a105cfd2cf3detects old guests by comparing virtio andPCI status. It attempts to do this on load,as well, but load_config callback in a bindingis invoked too early and so the virtio status...
e1000: check buffer availability
Reduce spurious packet drops on RX ring emptyby verifying that we have at least 1 bufferahead of the time.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
virtio-serial: don't crash on invalid input
Fix crash on invalid input in virtio-serial.Discovered by code review, untested.
vhost: fix dirty page handling
vhost was passing a physical address to cpu_physical_memory_set_dirty,which is wrong: we need to translate to ram address first.
Note: this lead to crashes during migration, so the patch...
pci: replace the magic, 256, for the maximum of devfn
Introduce symbol PCI_SLOT_MAX for the # of slots,and replace the magic, 256.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
pci: use devfn for pci_find_device() instead of (slot, fn) pair
(slot, fn) pair is somewhat confusing because of ARI.So use devfn for pci_find_device() instead of (slot, fn).
pci: use PCI_DEVFN in pci_get_bus_devfn()
Replace hardcoded logic by a common macro.
pci: use uint8_t for devfn_min
use uint8_t for devfn_min instead of int.
report that QEMU process was killed by a signal
Currently when rogue script kills QEMU process (using TERM/INT/HUPsignal) it looks indistinguishable from system shutdown. Lets reportthat QEMU was killed and leave some clues about the killer identity.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
rtl8139: add vlan tag insertion
Add support to the emulated hardware to insert vlan tags in packetsgoing from the guest to the network.
Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>Cc: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>Cc: Jason Wang <jasowang@redhat.com>...
rtl8139: add vlan tag extraction
Add support to the emulated hardware to extract vlan tags in packetsgoing from the network to the guest.
rtl8139: cleanup FCS calculation
clean out ifdef's around ethernet checksum calculation
Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>Acked-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>Cc: Jason Wang <jasowang@redhat.com>Cc: Michael S. Tsirkin <mst@redhat.com>...
severe memory leak caused by broken palette_destroy() function
The following commit breaks the code of the function palette_destroy().
http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commit;h=e31e3694afef58ba191cbcc6875ec243e5971268
The broken code causes a severe memory leak of 'VncPalette' structures...
vl.c: Fix compilation failure if CONFIG_SDL isn't defined
Fix a compilation failure if CONFIG_SDL isn't defined (gcc complainedthat the label 'invalid_display' wasn't used).
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote branch 'amit/for-anthony' into staging
tcg/arm: Support host code being compiled for Thumb
Although the TCG generated code is always in ARM mode, it is possiblethat the host code was compiled by gcc in Thumb mode (this is often thedefault for Linux distributions targeting ARM v7 only). Handle this...
Revert "x86: Save/restore PAT MSR"
This reverts commit c995b495b9d6e60ab1e390bd398a22425d0b3c8c.
From Jan Kiszka:
Ouch, indeed. Moreover, CPU_SAVE_VERSION was not updated (likely the reason for the breakage). Thanks for debugging this!
Anthony (or whoever), please revert this unneeded commit in qemu.git....
vnc: fix build error from VNC_DIRTY_WORDS
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
error message if user specifies SDL cmd line option when SDL is disabled
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
error message if user specifies curses on cmd line when curses is disabled
Make VNC support optional
Per default VNC is enabled.
qmp-commands.hx: Clean up mess of client_migrate_info
client_migrate_info was put into qmp-commands.hx in the middle ofmigrate_set_speed, between the command and it's description. Inaddition client_migrate_info put the description before the commanditself, which is the wrong order....
fix vnc regression
This patch fix the following regression:1. we should use bitmap_set() and bitmap_clear() to replace vnc_set_bits().
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Consolidate DisplaySurface allocation in qemu_alloc_display()
This removes various code duplication from console.e and sdl.c
Introduce -display argument
This patch introduces a -display argument which consolidates thesetting of the display mode. Valid options are:sdl/curses/default
Introduce -display none
New option -display none. This option differs from -nographic by nottrying to take control of stdio etc. but instead behaves as if agraphics display is enabled, except that it doesn't show one.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>...
Add support for -display vnc
target-arm: use make_float32() to make constant floats for VRSQRTS
The preferred way to create a constant floating point value is to usemake_float32() rather than doing a runtime int32_to_float32().Convert the code in the VRSQRTS helper to work this way....
target-arm: Fix VRECPS edge cases handling
Correct the handling of edge cases for the VRECPS instruction: * this is a Neon instruction so uses the "standard FPSCR value" * (zero, inf) is a special case which returns 2.0
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
target-arm: Fix TCG temporary leaks for scalar VMULL
Fix a TCG temporary leak when translating 32-bit scalar VMULL.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-arm: Set Q bit for overflow in SMUAD and SMLAD
SMUAD and SMLAD are supposed to set the Q bit if the addition ofthe two 16x16 multiply products and optional accumulator overflowsconsidered as a signed value. However we were only doing this checkfor the addition of the accumulator, not when adding the products,...
target-arm: Fix GE bits for v6media signed modulo arithmetic
Fix the signed modulo arithmetic helpers for the v6mediainstructions (SADD8, SSUB8, SADD16, SSUB16, SASX, SSAX) to setthe GE bits correctly (based on the result of the add or subtractbefore it is truncated to 16 bits, not after)....
target-arm: Fix UNDEF cases in Thumb load/store
Decode of Thumb load/store was merging together the cases of 'bit 11==0'(reg+reg LSL imm) and 'bit 11==1' (reg+imm). This happens to work forvalid instruction patterns but meant that we would not UNDEF for the...
linux-user: Fix unlock_user() call in return from poll()
Correct the broken attempt to calculate the third argumentto unlock_user() in the code path which unlocked the pollfdarray on return from poll() and ppoll() emulation. (Thisonly caused a problem if unlock_user() wasn't a no-op, eg...
vmmouse: Fix initialization
Latest refactorings left vmmouse nonfunctional behind. Fix it by addingthe required device initialization.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
vmmouse: Register vmstate via qdev
vmmouse: Fix typo preventing x86-64 build
fix applesmc REV key
Fix applesmc REV key string literal hex encoding.
Signed-off-by: René Rebe <rene@exactcode.de>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
enable kvm for ppc(32) on ppc64
ppc64 is backward compatible, likewise.
target-ppc: add support for 6 SPE instructions
Add support for 6 SPE instructions: evmra, evmwsmi{a{a}}, evmwumi{a{a}}
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pc-bios: update linuxboot.bin and multiboot.bin
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
fix linuxboot.bin and multiboot.bin to not hijack int19
Currently linuxboot.bin and multiboot.bin option roms override int19vector to intercept boot process. No sane option rom should do that.Provide bev entry instead that will be called by BIOS if option rom...
Merge remote branch 'qemu-kvm/uq/master' into staging
Fix migration uint8 arrys handled
commit 82fa39b75181b730d6d4d09f443bd26bcfcd045c
only contains half of the fix. It forgots the save state fix forUINT8 indexes.
Anthony, please apply, without this migration using hpet is broken.(only current user)....
seabios: update to latest git
- cc97564 Add config option to permit running option roms with bad checksums. - 424f217 Add config option to disable MTRR initialization. - fb2f10d Prep version for next release. - f18b09b Update version to 0.6.2 - 20fcf9b lets pretend that RTC can be used to wakeup from S4...
softfloat: Drop [s]bits{8, 16, 32, 64} types in favor of [u]int{8, 16, 32, 64}_t
They are defined with the same semantics as the POSIX types,so prefer those for consistency. Suggested by Peter Maydell.
Cc: Peter Maydell <peter.maydell@linaro.org>Cc: Aurelien Jarno <aurelien@aurel32.net>...
softfloat: Resolve type mismatches between declaration and implementation
The original SoftFloat 2.0b library avoided the use of custom integer typesin its public headers. This requires the definitions of int{8,16,32,64} tomatch the assumptions in the declarations. This breaks on BeOS R5 and Haiku/x86,...
softfloat: Prepend QEMU-style header with derivation notice
The SoftFloat license requires "prominent notice that the workis derivative". Having added features like improved 16-bit supportfor arm already, add such a notice to the sources.
softfloat-native.[ch] are not under the SoftFloat license...
e1000: Fix multi-descriptor packet checksum offload
The PCI/PCI-X Family of Gigabit Ethernet Controllers SoftwareDeveloper’s Manual states the following about the POPTS field:
Provides a number of options which control the handling of this packet. This field is ignored except on the first data descriptor of...
Merge branch 'for-anthony' of git://github.com/bonzini/qemu
Merge branch 'for-anthony' of git://repo.or.cz/qemu/kevin
rbd: don't link with -lcrypto
rbd support tries to both link with -lrados and -lcrypto. While thefirst one is of course necessary, the second is not necessary (onlylibrados ifself needs to link with libcrypto).
This fixes a licensing issue: qemu as a whole is GPL v2, and thus can't...
hw/arm_sysctl.c: Add the Versatile Express system registers
Add support for the Versatile Express SYS_CFG registers, which providea generic means of reading or writing configuration information fromvarious parts of the board. We only implement shutdown and reset....
char: Prevent multiple devices opening same chardev
Prevent:
-chardev socket,path=/tmp/foo,server,nowait,id=c0 \-device virtserialport,chardev=c0,id=vs0 \-device virtserialport,chardev=c0,id=vs1
Reported-by: Mike Cao <bcao@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-console: Keep chardev open for other users after hot-unplug
After a hot-unplug operation, the previous behaviour was to close thechardev. That meant the chardev couldn't be re-used. Also, sincechardev hot-plug isn't possible so far, this means virtio-console...
virtio-serial: Enable ioeventfd
Enable ioeventfd for virtio-serial devices by default. Commit25db9ebe15125deb32958c6df74996f745edf1f9 lists the benefits of usingioeventfd.
Copying a file from guest to host over a virtio-serial channel didn'tshow much difference in time or io_exit rate....
virtio-serial-bus: Simplify handle_output() function
There's no code change, just re-arrangement to simplify the functionafter recent modifications.
Reported-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-serial: Don't clear ->have_data() pointer after unplug
After a port unplug operation, the port->info->have_data() pointer wasset to NULL. The problem is, the ->info struct is shared by all ports,effectively disabling writes to other ports.
Reported-by: juzhang <juzhang@redhat.com>...
virtio-serial: Use a struct to pass config information from proxy
Instead of using a single variable to pass to the virtio_serial_initfunction, use a struct so that expanding the number of variables to bepassed on later is easier.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-serial: Disallow generic ports at id 0
Port 0 is reserved for virtconsole devices for backward compatibilitywith the old -virtioconsole (from qemu 0.12) device type.
libvirt prior to commit 8e28c5d40200b4c5d483bd585d237b9d870372e5 usedport 0 for generic ports. libvirt will no longer do that, but disallow...
add more helper functions with explicit milli/nanosecond resolution
The code doesn't make much sense right now, but it will assoon as timers will be able to scale their resolution arbitrarily.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
change all rt_clock references to use millisecond resolution accessors
This was done with:
sed -i '/get_clock\>.*rt_clock/s/get_clock\>/get_clock_ms/' \ $(git grep -l 'get_clock\>.*rt_clock' ) sed -i '/new_timer\>.*rt_clock/s/new_timer\>/new_timer_ms/' \...
change all other clock references to use nanosecond resolution accessors
sed -i 's/qemu_get_clock\>/qemu_get_clock_ns/' \ $(git grep -l 'qemu_get_clock\>' ) sed -i 's/qemu_new_timer\>/qemu_new_timer_ns/' \ $(git grep -l 'qemu_new_timer\>' )...
add a generic scaling mechanism for timers
This enables rt_clock timers to use nanosecond resolution, just byusing the _ns functions; there is really no reason to forbid that.
Migrated timers are all using vm_clock (of course; but I checked thatanyway) so the timers in the savevm files are already in nanosecond...
remove qemu_get_clock
These patches are already not doing a great service to out-of-treemodifications to QEMU. However, at least we can warn them by gettingrid of the old confusing functions, or otherwise causing compilationerrors. This patch removes qemu_get_clock; the previous one changed...
Fix conversions from pointer to int and vice versa
Here the int values fds0, sigfd, s, sock and fd are convertedto void pointers which are later converted back to an int value.
These conversions should always use intptr_t instead of unsigned long.
They are needed for environments where sizeof(long) != sizeof(void *)....
petalogix_ml605_mmu: remove unused variable
Remove a write-only variable, spotted by GCC 4.6.0:/src/qemu/hw/petalogix_ml605_mmu.c: In function 'petalogix_ml605_init':/src/qemu/hw/petalogix_ml605_mmu.c:153:11: error: variable 'serial' set but not used [-Werror=unused-but-set-variable]...
qemu-thread: delete unused functions
qemu_mutex_timedlock() and qemu_cond_timedwait() are no longer used.
Remove them and their helper timespec_add_ms().
Reported-by: François Revol <revol@free.fr>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
w32: Add missing functions qemu_mutex_destroy, qemu_cond_destroy
These functions were missing in commit9257d46d55f1fe4e8209be9a6870e339ac3266fe.
Both functions are needed for compilations withconfiguration --enable-vnc-thread.
Cc: Paolo Bonzini <pbonzini@redhat.com>...
i8254: Fix migration from older versions
qdev conversion broke migration as the previous version used vmstateinstance IDs derived from the iobase. Fix it by registering a legacyalias.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Expose thread_id in info cpus
Based on patch by Glauber Costa:
To allow management applications like libvirt to apply CPU affinities tothe VCPU threads, expose their ID via info cpus. This patch provides thepre-existing and used interface from qemu-kvm....
kvm: Consider EXIT_DEBUG unknown without CAP_SET_GUEST_DEBUG
Without KVM_CAP_SET_GUEST_DEBUG, we neither motivate the kernel toreport KVM_EXIT_DEBUG nor do we expect such exits. So fall through tothe arch code which will simply report an unknown exit reason....
kvm: Keep KVM_RUN return value in separate variable
Avoid using 'ret' both for the return value of KVM_RUN as well as thecode kvm_cpu_exec is supposed to return. Both have no direct relation.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
kvm: Reorder error handling of KVM_RUN
Test for general errors first as this is the slower path.
kvm: Rework inner loop of kvm_cpu_exec
Let kvm_cpu_exec return EXCP_* values consistently and generate thosecodes already inside its inner loop. This means we will now re-enter thekernel while ret == 0.
Update kvm_handle_internal_error accordingly, but keep...
kvm: Align kvm_arch_handle_exit to kvm_cpu_exec changes
Make the return code of kvm_arch_handle_exit directly usable forkvm_cpu_exec. This is straightforward for x86 and ppc, just s390would require more work. Avoid this for now by pushing the return code...
kvm: x86: Reorder functions in kvm.c
Required for next patch which will access guest debug services fromkvm_arch_handle_exit. No functional changes.
kvm: x86: Push kvm_arch_debug to kvm_arch_handle_exit
There are no generic bits remaining in the handling of KVM_EXIT_DEBUG.So push its logic completely into arch hands, i.e. only x86 so far.
kvm: Mark VCPU state dirty on creation
This avoids that early cpu_synchronize_state calls try to retrieve anuninitialized state from the kernel. That even causes a deadlock ifio-thread is enabled.
x86: Properly reset PAT MSR
Conforming to the Intel spec, set the power-on value of PAT also onreset, but save it across INIT.
x86: Save/restore PAT MSR
kvm: x86: Synchronize PAT MSR with the kernel