Compile dma only once
Use a qemu_irq to request CPU exit.
7 compilations less for the full build.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
pckbd: improve debugging
Compile pckbd only once
Use a qemu_irq to indicate A20 line changes. Move I/O port 92to pckbd.c.
linux-user: do not warn for missing pselect6
Libc will fallback gracefully if pselect6 is not available. Thus putpselect6 to nowarn until the atomicity issues of the original pselect6patch are dealt with.
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>...
tcg: Initialize the prologue after GUEST_BASE is fixed.
This will allow backends to make intelligent choices about howto implement GUEST_BASE.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg-hppa: Load GUEST_BASE as an immediate.
Now that the prologue is generated after GUEST_BASE is fixed,we can load it as an immediate, and also avoid reserving theregister if it isn't necessary.
tcg-ia64: Fix some register usage issues.
(1) The output registers were not marked call-clobbered, even though they can be modified by called functions.(2) The thread pointer was not marked reserved.(3) R4-R6 are call-saved, but not saved by the prologue. Rather than...
tcg-ia64: Load GUEST_BASE into a register.
Saves one bundle per memory operation.
alpha-linux-user: Fix getxpid.
Put ppid in the second return register.
alpha-linux-user: Fix sigsuspend parameters.
Alpha passes the signal set in a register, not by reference.
alpha-linux-user: Fix sigprocmask.
Alpha passes oldset by value in a register, and returns the newsetas the return value; as compared to the standard implementation inwhich both are passed by reference. This requires being able todistinguish negative return values that are not errors. Do this in...
alpha-linux-user: Fix brk error return.
alpha-linux-user: Fix siginfo.si_addr for SIGSEGV and SIGBUS.
alpha-linux-user: Add correct sigaction constants.
alpha-linux-user: Fix pipe return mechanism.
At the same time, tidy the code wrt MIPS and SH4 which have thesame two register return mechanism. Fix confusion between pipeand pipe2 with an explicit flags=0, when the guest will not beusing the two register return mechanism....
tcg-i386: Use lea for three-operand add.
The result is shorter than the mov+add that TCG wouldotherwise generate for us.
tcg-i386: Nuke trailing whitespace.
tcg-i386: Tidy ext8u and ext16u operations.
Define OPC_MOVZBL and OPC_MOVZWL. Factor opcode emission toseparate functions.
tcg-i386: Tidy ext8s and ext16s operations.
Define OPC_MOVSBL and OPC_MOVSWL. Factor opcode emission toseparate functions.
tcg-i386: Tidy immediate arithmetic operations.
Define OPC_ARITH_EvI[bz]; use throughout. Use tcg_out_ext8udirectly in setcond. Use tgen_arithi in qemu_ld/st.
tcg-i386: Tidy non-immediate arithmetic operations.
Add more OPC values, and tgen_arithr. Use the later throughout.
Note that normal reg/reg arithmetic now uses the Gv,Ev opcode forminstead of the Ev,Gv opcode form used previously. Both formsdisassemble properly, and so there's no visible change when diffing...
tcg-i386: Tidy movi.
Define and use OPC_MOVL_Iv.
tcg-i386: Tidy push/pop.
Move tcg_out_push/pop up in the file so that they can be usedby qemu_ld/st. Define a tcg_out_pushi to be used as well.
tcg-i386: Tidy calls.
Define OPC_CALL_Jz, generated by tcg_out_calli; use the laterthroughout. Unify the calls within qemu_st; adjust the stackwith a single pop if applicable.
Define and use EXT_CALLN_Ev for indirect calls.
Signed-off-by: Richard Henderson <rth@twiddle.net>...
tcg-i386: Tidy ret.
Define and use OPC_RET.
tcg-i386: Tidy setcc.
Define and use OPC_SETCC.
tcg-i386: Tidy unary arithmetic.
Define OPC_GRP3 and EXT3_FOO to match. Use them instead ofbare constants.
Define OPC_GRP5 and rename the existing EXT_BAR to EXT5_BAR tomake it clear which extension should be used with which opcode.
tcg-i386: Tidy multiply.
Define and use OPC_IMUL_GvEv{,Ib,Iz}.
tcg-i386: Tidy xchg.
Define and use OPC_XCHG_ax_r32.
tcg-i386: Tidy lea.
Implement full modrm+sib addressing mode processing.Use that in qemu_ld/st to output the LEA.
axisdev88: Fix passing of kernel cmdline.
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
Replace \0s with spaces before sending strings to curses.
Signed-off-by: Bernhard Kauer <kauer@tudos.org>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
arm_timer: reload timer when enabled
Reload the timer when TimerControl is written, if the timer is to beenabled. Otherwise, if an earlier write to TimerLoad was done whileperiodic mode was not set, s->delta may incorrectly still have the valueof the maximum limit instead of the value written to TimerLoad....
arm_timer: fix oneshot mode
In oneshot mode, the delta needs to come from the TimerLoad register,not the maximum limit.
Signed-off-by: Rabin Vincent <rabin@rab.in>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pflash_cfi01: add device ID read command
Add support to read manufacturer and device ID. For everything else (eg.lock bits) 0 is returned.
Signed-off-by: Michael Walle <michael@walle.cc>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
pc: fix segfault introduced by 3d53f5c36ff6
Commit 3d53f5c36ff6 introduced a segfault by erroneously making fw_cfg a'void **' and passing it around in different ways.
Signed-off-by: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-sparc: Inline some generation of carry for ADDX/SUBX.
Computing carry is trivial for some inputs. By avoiding anexternal function call, we generate near-optimal code forthe common cases of add+addx (double-word arithmetic) andcmp+addx (a setcc pattern)....
tcg-i386: Tidy jumps.
Define OPC_JCC*, OC_JMP*, and EXT_JMPN_Ev. Use them throughout.
tcg-i386: Eliminate extra move from qemu_ld64.
If the address register overlaps one of the output registerssimply issue the clobbering load last, rather than emittingan extra move of the address register.
tcg-i386: Tidy move operations.
Define OPC_MOVB* and OPC_MOVL*; use them throughout.Use tcg_out_ld/st instead of bare tcg_out_modrm_offsetwhen it makes sense.
tcg-i386: Tidy shift operations.
Define OPC_SHIFT_{1,Ib,cl}. Factor opcode emission to a function.
Remove i386 from .gitignore
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg-i386: Tidy bswap operations.
Define OPC_BSWAP. Factor opcode emission to separate functions.
target-sparc: Simplify ICC generation.
Use int32 types instead of target_ulong when computing ICC. Thissimplifies the generated code for 32-bit host and 64-bit guest.Use the same simplified expressions for ICC as were already usedfor XCC in carry flag generation....
target-sparc: Fix compilation with --enable-debug.
Return a target_ulong from compute_C_icc to match the width of the users.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix VA__ARGS typo in cris mmu.c
Fix compilation with DEBUG defined
Signed-off-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
linux-user: fix 32-bit host breakage
Fix breakage introduced by commit 81bbe906c89b6b7af58a1eeb96ec5a0bfdc3386f.
microblaze: Update elf machine nums.
189 was allocated in upstream binutils.
0xbaab was the old temporary value. Still used by some tools and thelinux kernel.
I've seen 115 in older gdb versions, but lets ignore that one.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
microblaze: Add linux-user core dumping support.
Fix cross compilation
This patch enhances the algorithm which finds the correct settings for SDL.For cross compilations (when cross_prefix is set), it looks for sdl-configwith cross prefix. Here is the complete search order:
$(cross_prefix}pkg-config (old, only used for cross compilation)...
tcg-i386: Allocate call-saved registers first.
tcg-i386: Tidy initialization of tcg_target_call_clobber_regs.
Setting the registers one by one is easier to read, and getsoptimized by the compiler just the same.
target-s390: enable SIGP Initial Reset
For SMP to work with KVM, we need to properly emulate the SIGP Initial ResetCommand. Recent (2.6.32) kernels issue that before the SIGP Reset command thatactually wakes up the vcpu.
This patch makes -smp work on S390x....
target-ppc: remove dead code
This function had been disabled from the beginning:see 9fddaa0c0cabb610947146a79b4a9a38b0a216e5
cpu_reset() function is in target-ppc/helper.c
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>Acked-by: Alexander Graf <agraf@suse.de>...
target-s390: add firmware code
This patch adds a firmware blob to the S390 target. The blob is a simpleimplementation of a virtio client that tries to read the second stagebootloader from sectors described as of offset 0x20 in the MBR.
In combination with an updated zipl this allows for booting from virtio...
PPC/KVM: make iothread work
When running with --enable-io-thread the timer we have doesn't help,because it doesn't wake up the CPU thread. So instead we need toactually kick it.
While at it I refined the logic a bit to not dumbly trigger a timerevery 500ms, but rather do it more often after an interrupt got injected....
fix chardev_init for win32
chardev_init functions use socket,so socket_init() shoud be placed atthe front of chardev_init on win32.
Signed-off-by: TeLeMan <geleman@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
qemu-sockets: avoid strlen of NULL pointer
If the user wants to create a chardev of type socket but forgets to give ahost= option, qemu_opt_get returns NULL. This NULL pointer is then fed intostrlen a few lines below without a check which results in a segfault....
linux-user: rlimit conversion between host and target.
rlim_t conversion between host and target added.Otherwise there are some incorrect case like- RLIM_INFINITY on 32bit target > 64bit host. RLIM_INFINITY on 64bit host > mips and sparc target ? Big value(for 32bit target) on 64bit host -> 32bit target....
Compile acpi_piix4, apm and pm_smbus only once
12 compilations less for the full build.
Merge remote branch 'kwolf/for-anthony' into staging
Merge remote branch 'mst/for_anthony' into staging
bochs: use qemu block API
Use bdrv_pwrite to access the backing device instead of pread, andconvert the driver to implementing the bdrv_open method which givesit an already opened BlockDriverState for the underlying device.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
block: Avoid unchecked casts for AIOCBs
Use container_of for one direction and &acb->common for the other one.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Fix protocol detection for Windows devices
We can't assume the file protocol for Windows devices, they need the samedetection as other files for which an explicit protocol is not specified.
block: Fix bdrv_commit
When reopening the image, don't guess the driver, but use the same driver aswas used before. This is important if the format=... option was used for thatimage.
block/vdi: Allow disk images of size 0
Even it is not very useful, users may create images of size 0.
Without the special option CONFIG_ZERO_MALLOC, qemu_malloczaborts execution when it is told to allocate 0 bytes,so avoid this kind of call.
Cc: Kevin Wolf <kwolf@redhat.com>...
parallels: use pread
Use pread instead of lseek + read in preparation of using the qemublock API.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
parallels: use qemu block API
block/vpc: Fix conversion from size to disk geometry
The VHD algorithm calculates a disk geometrywhich is usually smaller than the requested size.
QEMU tried to round up but failed for certain sizes:
qemu-img create -f vpc disk.vpc 9437184would create an image with 9435136 bytes...
dmg: fix reading of uncompressed chunks
When dmg_read_chunk encounters an uncompressed chunk it currentlycalls read without any previous adjustment of the file postion.
This seems very wrong, and the "reference" implementation indmg2img does a search to the same offset as done in the various...
dmg: use pread
Use pread instead of lseek + read in preparation of using the qemublock API. Note that dmg actually uses the implicit file offseta lot in dmg_open, and we had to replace it with an offset variable.
dmg: use qemu block API
Dmg actually does an lseek to a negative offset in the open routine,...
block/vdi: Fix image opening and creation for odd disk sizes
The fix is based on a patch from Kevin Wolf. Here his comment:
"The number of blocks needs to be rounded up to cover all of the virtual harddisk. Without this fix, we can't even open our own images if their size is not...
use qemu_free() instead of free()
There is a call to free() where qemu_free() should instead be used.
Signed-off-by: Bruce Rogers <brogers@novell.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Fix docs for block stats monitor command
The 'parent' field in the 'query-blockstats' monitor command ispart of the top level block device QDict, not part of the 2ndlevel 'stats' QDict.
block: Remove special case for vvfat
The special case doesn't really us buy anything. Without it vvfat works moreconsistently as a protocol. We get raw on top of vvfat now, which works justas well as using vvfat directly.
block: Remove semicolon in BDRV_SECTOR_MASK macro
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-nbd: Improve error reporting
- use err(3) instead of errx(3) if errno is available to report why failed- let fail prior to daemon(3) if opening a nbd file is likely to fail after daemonizing to avoid silent failure exit- add missing 'ret = 1' when unix_socket_outgoing failed...
cloop: use pread
cloop: use qemu block API
ide: Fix ide_dma_cancel
When cancelling a request, bdrv_aio_cancel may decide that it waits forcompletion of a request rather than for cancellation. IDE therefore can'tabandon its DMA status before calling bdrv_aio_cancel; otherwise the callbackof a completed request would use invalid data....
bochs: use pread
sparc: move DT and QT defines to op_helper.c
sparc64: fix TT_WOTHER value
- fix off by one error in spill trap number bit for other window (must be bit 5)- fixes invalid instruction issue with HelenOS
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
sparc64: fix mmu demap operand typo
- must use store address operand to demap, not store value
Update to a hopefully more future proof FSF address
See also 70539e1850ddd3a7ee6f9a8db7bd8e81b85225a4,8167ee883931cb20c6264fc19d040ce2dc6ceaaa,530e7615ce3c01882e582c84dc6304ab98a3d5c5 andfad6cb1a565bb73f83fc0e2654489457b489e436.
Trim unnecessary includes
mc146818rtc: remove #ifdef DEBUG_CMOS.
remove #ifdef DEBUG_CMOS by using macro.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
apm: remove #ifdef DEBUG.
remove #ifdef DEBUG by using macro.
acpi_piix4: remove #ifdef DEBUG.
removed #ifdef DEBUG by using macro.
pm_smbus: remove #ifdef DEBUG.
pci hotadd, acpi_piix4: remove global variables
remove global variables, gpe and pci0_status by moving theminto PIIX4PMState.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
pci hotplug: add argument to pci hot plug callback.
Add argument, DeviceState*, to pci hot plug callback.The argument will be used later to remove global variable.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
acpi_piix4: qdevfy.
qdevfy acpi_piix4.
rtc: make rtc_xxx accept/return ISADevice instead of RTCState.
To match rtc_xxx with qdev, make rtc_xxx accept and return ISADeviceinstead of RTCState.
pc: move rtc declarations from pc.h into a dedicated header file.
Move rtc_xxx declarations from pc.h into mc146818rtc.h.
pc: split out piix specific part from pc.c into pc_piix.c
Finally, we can safely split out the piix specific part from pc.cinto pc_piix.c.
pc: split out pci device init from pc_init1() into pc_pci_device_init()
Split out pci device initialization from pc_init1() into pc_pci_device_init().and removed unnecessary braces.
pc: split out basic device init from pc_init1() into pc_basic_device_init()
Split out basic device, i.e. legacy devices like floppy, initializationfrom pc_init1() into pc_basic_device_init().Later it will be used.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>...