s390x: fix smp support for kvm
Currently smp support for kvm does not work. Qemu does a kvm run even onsecondary CPUs which dont have a sane state (initial psw == 0)triggering some program faults. Architecturally these cpus are in the stoppedstate, so we should not do the kvm run ioctl. (these CPUs will be started...
tcg: extend max tcg opcodes when using 64-on-32bit
When running a 64 bit guest on a 32 bit host, we tend to use more TCG opsthan on a 64 bit host. Reflect that in the reserved opcode amount constant.
Signed-off-by: Alexander Graf <agraf@suse.de>
s390x: s390x-linux-user support
This patch adds support for running s390x binaries in the linux-user emulationcode.
Signed-off-by: Ulrich Hecht <uli@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
ahci: Fix non-NCQ accesses for LBA > 16bits
AHCI provides two ways of reading/writing data:
1) NCQ 2) ATA commands with the LBA in the command FIS
In the second code path, we didn't handle any LBAs that were bigger than16 bits, so whenever a guest that used high LBA numbers wanted to access...
block: Remove type hint, it's guest matter, doesn't belong here
No users of bdrv_get_type_hint() left. bdrv_set_type_hint() can makethe media removable by side effect. Make that explicit.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev: Store -drive option media in DriveInfo
DriveInfo is closely tied to -drive, and like -drive, it mixesinformation about host and guest part of the block device. UnlikeDriveInfo, BlockDriverState should be about the host part only.
One of the remaining guest bits there is the "type hint". -drive...
block QMP: Deprecate query-block's "type", drop info block's "type="
query-block's specification documents response member "type" withvalues "hd", "cdrom", "floppy", "unknown".
Its value is unreliable: a block device used as floppy has type"floppy" if created with if=floppy, but type "hd" if created with...
defaults: ide-cd, ide-hd and scsi-cd devices suppress default CD-ROM
ide-hd has to suppress the default CD-ROM, or else you can't put oneon secondary master without -nodefaults.
Unlike legacy scsi-disk, scsi-cd suppresses default CD-ROM.
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
scsi: Split qdev "scsi-disk" into "scsi-hd" and "scsi-cd"
A "scsi-disk" is either a hard disk or a CD-ROM, depending on theassociated BlockDriverState's type hint. Unclean; disk vs. CD belongsto the guest part, not the host part.
Have separate qdevs "scsi-hd" and "scsi-cd" to model disk vs. CD in...
ide: Split qdev "ide-drive" into "ide-hd" and "ide-cd"
An "ide-drive" is either a hard disk or a CD-ROM, depending on theassociated BlockDriverState's type hint. Unclean; disk vs. CD belongsto the guest part, not the host part.
Have separate qdevs "ide-hd" and "ide-cd" to model disk vs. CD in...
qemu_img: is_not_zero() optimization
I run qemu-img under profiler and realized, that most of CPU time isconsumed by is_not_zero() function. I had made a couple of optimizationson it and got the following output for `time qemu-img convert -O qcow2volume.qcow2 snapshot.qcow2`:...
qed: support for growing images
The .bdrv_truncate() operation resizes images and growing is easy toimplement in QED. Simply check that the new size is valid and thenupdate the image_size header field to reflect the new size.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
ahci: Fix crashes on duplicate BH registration
If ahci_dma_set_inactive is called a while there is still a pending BHfrom a previous run, we will crash on the second run ofahci_check_cmd_bh as it overwrites AHCIDevice::check_bh. Avoid thisbroken and redundant duplicate registration....
qemu-tool: Stub out qemu-timer functions
Block drivers may use timers for flushing metadata to disk orreconnecting to a network drive. Stub out the following functions inqemu-tool.c:
QEMUTimer *qemu_new_timer_ns(QEMUClock *clock, int scale, QEMUTimerCB *cb, void *opaque)...
qed: Periodically flush and clear need check bit
One strategy to limit the startup delay of consistency check whenopening image files is to ensure that the file is marked dirty for aslittle time as possible.
QED currently marks the image dirty when the first allocating write...
ide: cleanup warnings
Add \n.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
posix-aio-compat: Fix idle_threads counter
A thread should only be counted as idle when it really is waiting for newrequests. Without this patch, sometimes too few threads are started as busythreads are counted as idle.
Not sure if it makes a difference in practice outside some artificial...
qemu-img.c: Remove superfluous parenthesis
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/xen_disk: Remove unused local variable
cppcheck report:hw/xen_disk.c:309: style: Variable 'len' is assigned a value that is never used
Cc: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: Turn debug messages into assertions
These printfs aren't really debug messages, but clearly indicate a bug if theyever become effective. Noone uses DEBUG_IDE, let's re-enable the checkunconditionally and make it an assertion instead of printfs in the device...
Add documentation for qemu_progress_{init,print}()
ahci: Unbreak bar registration
Fix regression of 667bb59: ahci_init initializes ahci.mem, so we have tomove bar registration after it.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
w32: Fix missing declaration of ffs()
target-ppc/cpu.h now needs ffs(), too, so ffs() must be declaredbefore this file is included.
Moving the declaration from qemu-common.h to qemu-os-win32.h(which is included in qemu-common.h early) fixes the compiler...
set $SDL_VIDEODRIVER=x11 on Linux to prevent sudo kvm from fighting for video card
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
configure: List available targets in --help output
Include the list of available targets in the --help outputfor the --target-list= option.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Acked-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-mips: Fix warning caused by unused local variable
Fix compilation with gcc-4.6, based on a patch from StefanWeil <weil@mail.berlios.de>.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
configure: quote kvm_ppc_pvr
target-lm32: Remove unused local variables
cppcheck report:target-lm32/translate.c:587: style: Variable 't0' is assigned a value that is never usedtarget-lm32/translate.c:588: style: Variable 'l1' is assigned a value that is never used
Remove both variables. Please check whether that is the correct solution....
target-arm: Fix VMLA, VMLS, VNMLS, VNMLA handling of NaNs
Correct handling of NaNs for VFP VMLA, VMLS, VNMLS and VNMLA requires thatwe implement the set of negations and additions specified by the ARM ARM;plausible looking simplifications like turning (-A + B) into (B - A) or...
doc: Add explanation that -alt-grab and -ctrl-grab affect special keys
Phillip Merensky reported that the special keys (e.g. Ctrl-Alt-f for fullscreen) did not work correctly if -alt-grab is used.
BUG: 696530
Review of ui/sdl.c:sdl_refresh indicates that this is the intended behaviour,...
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
sparc64: fix incorrect BPcc target sign extension
Fix wrong number of bits used when sign extending the branch offset of BPccinstructions.
Reported-by: Artyom Tarasenko <atar4qemu@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
sparc64: fix wrpstate and wrtl on delay slot
Use TCG local to work around TCG register flush due to a branch.
Thanks to Artyom Tarasenko, Igor Kovalenko and Aurelien Jarno.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Conflicts: cpu-all.h
Merge remote-tracking branch 'agraf/xen-next' into staging
PPC: Qdev'ify e500 pci
The e500 PCI controller isn't qdev'ified yet. This leads to severe issueswhen running with -drive.
To be able to use a virtio disk with an e500 VM, let's convert the PCIcontroller over to qdev.
Reviewed-by: Paul Brook <paul@codesourcery.com>...
PPC: Make MPC8544DS obey -cpu switch
The MPC8544DS board emulation code ignored the user defined -cpu switch.This patch enables it to only provide a sane default, not force an e500v2CPU inside.
PPC: Make MPC8544DS emulation work w/o KVM
The MPC8544DS board emulation was only used with KVM so far, so someparts of the code didn't provide proper values for non-KVM execution.
This patch makes the machine work without KVM enabled. To actually usethis, you also need proper e500v2 MMU emulation....
PPC: Add GS MSR definition
The BookE specification defines MSR bit 28 as Guest State. Add itto the list of MSR macros.
PPC: Add another 64 bits to instruction feature mask
To enable quick runtime detection of instruction groups to the currentlyselected CPU emulation, we have a feature mask of what exactly the respectiveinstruction supports.
This feature mask is 64 bits long and we just successfully exceeded those 64...
PPC: Implement e500 (FSL) MMU
Most of the code to support e500 style MMUs is already in place, butwe're missing on some of the special TLB0-TLB1 handling code and slightlydifferent TLB modification.
This patch adds support for the FSL style MMU.
PPC MPC7544DS: Use new TLB helper function
Now that we have some nice helpers that can find us a TLB entry, let'suse that on the machine initialization code, so we don't need to knowabout the internals of the TLB array.
Fix off-by-one error in sizing pSeries hcall table
The pSeries machine uses two tables to look up guest hcalls for emulation.One of these is exactly one entry too small to hold all the hcalls it needsto, leading to memory corruption.
This patch fixes the bug, and while we're at it, make both tables 'static'...
kvm: ppc: detect old headers
When compiling Qemu with older kernel headers, the PVR settingmechanism isn't available yet. Unfortunately, back then I didn't adda capability we could check against, so all we can do is add a configuretest to see if we support PVR setting. For BookE, we don't care yet....
kvm: ppc: warn user on PAGE_SIZE mismatch
On PPC, the default PAGE_SIZE is 64kb. Unfortunately, the hardwarealignments don't match here: There are RAM and MMIO regions withina single page when it's 64kb in size.
So the only way out for now is to tell the user that he should use 4k...
ppc64: Fix out-of-tree builds
On ppc64 host, recursion into pc-bios/spapr-rtas/ fails forout-of-tree builds. Add missing dir and symlink.
Cc: David Gibson <david@gibson.dropbear.id.au>Cc: Alexander Graf <agraf@suse.de>Signed-off-by: Andreas Färber <andreas.faerber@web.de>...
pseries: Increase maximum CPUs to 256
The original pSeries machine was limited to 32 CPUs, more or lessarbitrarily. Particularly when we get SMT KVM guests it will bepretty easy to exceed this. Therefore, raise the max number of CPUsin a pseries machine guest to 256....
Make pSeries 'model' property more closely resemble real hardware
Currently, the qemu emulated pseries machine puts"qemu,emulated-pSeries-LPAR" in the device tree's root level 'model'property. Unfortunately this confuses some installers and ybin, which...
Place pseries vty devices at addresses more similar to existing machines
Currently the qemu pseries machine numbers its virtual serial devicesfrom 0. However, existing pSeries machines running pHyp number them from0x30000000.
In theory these indices are arbitrary, since everything necessary for the...
ppc64: Don't try to build sPAPR RTAS on Darwin
The Darwin assembler fails to build it.
Cc: David Gibson <david@gibson.dropbear.id.au>Cc: Alexander Graf <agraf@suse.de>Signed-off-by: Andreas Färber <andreas.faerber@web.de>Signed-off-by: Alexander Graf <agraf@suse.de>
kvm: ppc: fixes for KVM_SET_SREGS on init
Classic/server ppc has had SREGS for a while now (though I think notalways?), but it's still missing for booke. Check the capability beforecalling KVM_SET_SREGS.
Without this, booke kvm fails to boot as of commit...
monitor: add PPC BookE SPRs
Read them via KVM_GET_SREGS in kvm_arch_get_registers(),and display them in "info registers".
Also get CR and PID from the existing KVM_GET_REGS.
Signed-off-by: Scott Wood <scottwood@freescale.com>Signed-off-by: Alexander Graf <agraf@suse.de>
usb-linux: Add missing break statement
cppcheck report:usb-linux.c:661: warning: Redundant assignment of "len" in switch
Cc: Hans de Goede <hdegoede@redhat.com>Cc: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb-musb: uninline functions
Prototype without "inline" keyword breaks the build with some gccversions. Noticed by Alexander Graf.
Fix this by removing the inline keywork everywhere. Some functionscan't be inlined anyway as the are referenced using function pointers....
irq: Privatize CPU_INTERRUPT_NMI.
This interrupt name is used by i386, CRIS, and MicroBlaze.Copy the name into each target.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
irq: Introduce CPU_INTERRUPT_TGT_* defines.
These defines will be place-holders for cpu-specific functionality.Generic code will, at the end of the patch series, no longer have toconcern itself about how SMI, NMI, etc should be handled. Instead,generic code will know only that the interrupt is internal or external....
irq: Introduce and use CPU_INTERRUPT_SSTEP_MASK.
This mask contains all of the bits that should be ignored while singlestepping in the debugger. The mask contains 2 bits that are not currentlycleared, but are also never set. The bits are included in the mask for...
target-mips: Do not check CPU_INTERRUPT_TIMER.
This bit is never set, therefore we should not read it either.
target-sparc: Do not check CPU_INTERRUPT_TIMER.
irq: Remove CPU_INTERRUPT_TIMER.
It is no longer used anywhere.
target-arm: Privatize CPU_INTERRUPT_FIQ.
This interrupt name was only used by the ARM port.
target-i386: Privatize some i386-specific interrupt names.
SMI, VIRQ, INIT, SIPI, and MCE are all only used by the i386 port.
lsi53c895a: Rename 'sense' to 'status'
The 'sense' field in the HBA status structure is misnamed, as itactually carries the SCSI status. Rename it.
Signed-off-by: Hannes Reinecke <hare@suse.de>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
libcacard: add correct subdirectory dependencies
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Cc: qemu-trivial@nongnu.orgSigned-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
linux-user: Replace deprecated function
Function bzero is deprecated, so replace it by function memset.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fix spelling in comments (intruction -> instruction)
ac97: Remove unused local variables
cppcheck report:hw/ac97.c:1004: style: Variable 'written' is assigned a value that is never usedhw/ac97.c:1072: style: Variable 'written' is assigned a value that is never used
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
Fix typos in comments (instanciation -> instantiation)
Fix typos in comments (neccessary -> necessary)
Fix typos in comments and code (occured -> occurred and related)
The code changed here is an unused data type name (evt_flush_occurred).
Fix typo in comment (relevent -> relevant)
Fix typo in comment (responsiblity -> responsibility)
Fix typo in comment (truely -> truly)
Fix typos in comment (threshhold -> threshold, mapp -> map)
Fix typo in comment (dieing -> dying)
Fix typos in comments (imediately -> immediately)
Fix typos in comments (existance -> existence)
Fix typos in comments (interupt -> interrupt)
Fix typos in comments (dependancy -> dependency)
Fix typos in comments (accross -> across)
Fix typos in comments (accessable -> accessible, priveleged -> privileged)
Fix typo in comment (colum -> column)
Fix typo in comment (auxilliary -> auxiliary)
Fix typo in comment (embeded -> embedded)
Fix typo in comment (consistant -> consistent)
xen: Set running state in xenstore.
This tells to the xen management tool that the machine can begin run.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Acked-by: Alexander Graf <agraf@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
xen: Add Xen hypercall for sleep state in the cmos_s3 callback.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Alexander Graf <agraf@suse.de>
xen: Introduce Xen Interrupt Controller
Every set_irq call makes a Xen hypercall.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Signed-off-by: Alexander Graf <agraf@suse.de>
xen: Introduce the Xen mapcache
On IA32 host or IA32 PAE host, at present, generally, we can't createan HVM guest with more than 2G memory, because generally it's almostimpossible for Qemu to find a large enough and consecutive virtualaddress space to map an HVM guest's whole physical address space....
xen: Adds a cap to the number of map cache entries.
Adds a cap to the number of map cache entries. This prevents the mapcache from overwhelming system memory.
I also removed the bitmap macros and #included bitmap.h instead.
Signed-off-By: John Baboval <john.baboval@virtualcomputer.com>...
Introduce qemu_put_ram_ptr
This function allows to unlock a ram_ptr give by qemu_get_ram_ptr. Aftera call to qemu_put_ram_ptr, the pointer may be unmap from QEMU whenused with Xen.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Acked-by: Alexander Graf <agraf@suse.de>...
configure: Always use 64bits target physical addresses with xen enabled.
With MapCache, we can handle a 64b target, even with a 32b host/qemu.So, we need to have target_phys_addr_t to 64bits.
pci: Use of qemu_put_ram_ptr in pci_add_option_rom.
Prevent a deadlock caused by leaving a map cache bucket locked by thepreceding qemu_get_ram_ptr() call.
Signed-off-By: John Baboval <john.baboval@virtualcomputer.com>Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>...
vl.c: Introduce getter for shutdown_requested and reset_requested.
Introduce two functions qemu_shutdown_requested_get andqemu_reset_requested_get to get the value of shutdown/reset_requestedwithout reset it.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>...
xen: Initialize event channels and io rings
Open and bind event channels; map ioreq and buffered ioreq rings.
Signed-off-by: Arun Sharma <arun.sharma@intel.com>Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>...
xen: Add initialisation of Xen
The xenpv machine use the common init function.
pc_memory_init: Move memory calculation to the caller.
This patch moves above_4g_mem_size and below_4g_mem_size calculation inthe caller of pc_memory_init (pc_init1). And the prototype ofpc_memory_init is changed because there is no need anymore to have...
xen: Add xenfv machine
Introduce the Xen FV (Fully Virtualized) machine to Qemu, some more Xenspecific call will be added in further patches.
pc, Disable vmport initialisation with Xen.
This is because there is not synchronisation of the vcpu registerbetween Xen and QEMU, so vmport can't work properly.
This patch introduces no_vmport parameter to pc_basic_device_init.
piix_pci: Introduces Xen specific call for irq.
This patch introduces Xen specific call in piix_pci.
The specific part for Xen is in write_config, set_irq and get_pirq.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>...