pflash_cfi02: Fix a typo in debug code (TARGET_FMT_pld -> TARGET_FMT_plx)
Thanks to Tobias Hoffmann <th55@gmx.de> for this patch.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Fix spelling in comment (additon -> addition)
bitbang_i2c: Fix spurious slave read after NACK
After NACKing a read operation, a raising SCL should not trigger a newread from the slave. Introduce a new state which just waits for a stopor start condition after NACK.
Signed-off-by: Marcus Comstedt <marcus@mc.pp.se>...
Move user emulator stuff from cpu-exec.c to user-exec.c
Simplify cpu-exec.c by refactoring.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
cpu-exec: prepare for user and softmmu split
There is little in common with user and softmmu versions of cpu_resume_signal(),split them.
Fix coding style for the user emulator part.
Merge remote-tracking branch 'kraxel/CVE-2011-1751' into staging
configure: Document --disable-slirp option in --help
The --disable-slirp option was undocumented; add it to configure's--help output.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
target-arm/exec.h: Remove unused #define of M0
Remove a preprocessor #define which is never used.
target-arm: Signal Underflow when denormal flushed to zero on output
On ARM the architecture mandates that when an output denormal is flushed tozero we must set the FPSCR UFC (underflow) bit, so map softfloat'sfloat_flag_output_denormal accordingly.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
target-arm: Use correct float status for Neon int-float conversions
The Neon versions of int-float conversions must use the "standard FPSCR" rather than the default FPSCR. Implement this by having the helperfunctions take a pointer to the appropriate float_status value rather...
target-arm: Signal InvalidOp for Neon GE and GT compares of QNaN
If the input to a Neon float comparison is a quiet NaN, the ARM ARMspecifies that we should raise InvalidOp if the comparison is GE or GTbut not for EQ. (Signaling NaNs raise InvalidOp regardless). This means...
target-arm: Signal InputDenormal for VRECPE, VRSQRTE, VRECPS, VRSQRTS
The helpers for VRECPE.F32, VSQRTE.F32, VRECPS and VRSQRTS handle denormalsas special cases, so we must set the InputDenormal exception flag ourselves.
softfloat: Add new flag for when denormal result is flushed to zero
Add a new float_flag_output_denormal which is set when the resultof a floating point operation would be denormal but is flushed tozero because we are in flush_to_zero mode. This is necessary because...
target-arm: Don't set FP exceptions in recip, recip_sqrt estimate fns
The functions which do the core estimation algorithms for the VRSQRTEand VRECPE instructions should not set floating point exception flags,so use a local fp status for doing these calculations....
tcg: don't keep dead outputs in registers
If an op with dead outputs is not removed, because it has side effectsor has multiple output and only one dead, mark the registers as deadinstead of saving them. This avoid a few register spills on TCG targetswith low register count, especially with div2 and mul2 ops, or when a...
tcg: mark dead output argument in op_dead_args
If an op is not removed and has dead output arguments, mark itin op_dead_args similarly to what is done for input arguments.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg: replace op_dead_iargs by op_dead_args
Allow all args to be dead by replacing the input specific op_dead_iargsvariable by op_dead_args. Note this is a purely mechanical change.
Merge branch 'trivial-patches' of git://repo.or.cz/qemu/stefanha
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
Merge branch 's390-next' of git://repo.or.cz/qemu/agraf
piix_pci: fix piix3_set_irq_pic()
If pic_irq is greater than 7, the irq level is always 0 on 32bits.
Signed-off-by: TeLeMan <geleman@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/realview.c: Remove duplicate #include line
Remove a duplicate #include of sysbus.h.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/sd.c: Don't complain about SDIO commands CMD52/CMD53
The SDIO specification introduces new commands 52 and 53.Handle as illegal command but do not complain on stderr,as SDIO-aware OSes (including Linux) may legitimately usethese in their probing for presence of an SDIO card....
Fix typos in comments (chek -> check)
Delete unused tb_invalidate_page_range
tb_invalidate_page_range() was intended to be used to invalidate anarea of a TB which the guest explicitly flushes from i-cache. However,QEMU detects writes to code areas where TBs have been generated, sohis has never been useful....
w32: Fix compilation and replace non-portable usage of ulong
ulong is undefined for w32 (and maybe other) compilations.Replace it by uintptr_t (which also fixes compilation for w64and is a better choice for pointer to integer conversions).
Cc: Aurelien Jarno <aurelien@aurel32.net>...
pSeries: Clean up write-only variables
A few pieces of the pSeries emulation code have variables which are setbut never used, which causes warnings on gcc 4.6. This patch removesthese instances.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
Fix a bug in mtsr/mtsrin emulation on ppc64
Early ppc64 CPUs include a hack to partially simulate the ppc32 segmentregisters, by translating writes to them into writes to the SLB. This isnot used by any current Linux kernel, but it is used by the openbios used...
s390x: Fix debugging for unknown sigp order codes
On unknown sigp order codes we print a debug message. This patchfixes the output, since we want to see the order_code and notthe register numbers.Patch applies on agraf tree.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>...
s390x: change mapping base to allow guests > 2GB
the current s390x qemu memory layout is
0x1000000: guest start0x80000000: qemu binary
which limits the amount of available memory to <2GB.This patch moves the guest pages to 32GB to not collide with the binary...
s390x: fix memory detection for guests > 64GB
the s390 memory detection has a 16bit field that specifies the amount ofincrements. This patch adopts the memory size to always fit into thatscheme. This also fixes virtio detection for these guests, since the...
s390x: complain when allocating ram fails
While trying out the > 64GB guest RAM patch, I hit some virtual addresslimitations of my host system, which resulted in mmap failing. Unfortunately,qemu didn't tell me about this failure, but just used the NULL pointer...
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>
s390x: make kvm exported functions conditional on kvm
We have some helper functions we use to directly invoke KVMfunctionality from device emulation code.
This patch replaces those exported functions with static inlinestubs when not building with KVM enabled....
s390x: keep hint on virtio managing size
The s390x virtio bus keeps management information on virtio after the topof the guest's RAM. We need to be able to tell the guest the size of itsRAM (without virtio stuff), but also be able to trap when the guest accesses...
s390x: Shift variables in CPUState for memset(0)
The default reset handler does a memset(0) until right in between CPU_COMMON.I incorrectly changed that behavior on the s390x port, so let's move the fieldsin CPUState around to reflect the correct split up to which point memset(0)...
s390x: helper functions for system emulation
When running system emulation, we need to transverse through the MMU anddeliver interrupts according to the specification.
This patch implements those two pieces and in addition adjusts the CPUinitialization code to account for the new fields in CPUState....
s390x: Implement opcode helpers
There are some instructions that can't (or shouldn't) be expressed by puretcg code. For those, we call into externally compiled C functions.
This patch implements those C functions.
s390x: Adjust internal kvm code
We're now finally emulating an s390x CPU, so we can move quite some logicfrom the kvm code out into generic CPU code.
This patch does this and adjusts the interfaces according to what the codearound now expects to be able to call....
s390x: translate engine for s390x CPU
This is the main meat part of the patch set. It implements emulation for ans390x CPU.
The code does all the optimizations that are common for TCG code:
- direct branches - cc optimization - unrolling of simple microcode loops...
s390x: Adjust GDB stub
We have successfully lazilized cc computation, so we need to manuallytrigger its calculation when gdb wants to fetch it. We also changed thevariable name, so writing it writes into a different field now.
s390x: remove compatibility cc field
Remove the now unused cc field that was only required to not breakbisectability.
s390x: build s390x by default
This patch enables building of s390x-softmmu and s390x-linux-usertargets by default.
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...
Ignore pci unplug requests for unpluggable devices (CVE-2011-1751)
This patch makes qemu ignore unplug requests from the guest for pcidevices which are tagged as non-hotpluggable. Trouble spot is thepiix4 chipset with the ISA bridge. Requests to unplug that one will...
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>.
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,...
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.
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>
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.