target-ppc: fix RFI by clearing some bits of MSR
Since commit 2ada0ed, "Return From Interrupt" is broken for PPC processorsbecause some interrupt specifics bits of SRR1 are copied to MSR.
SRR1 is a save of MSR during interrupt.During RFI, MSR must be restored from SRR1....
mc146818rtc: improve debugging
Add a separate flag for debugging coalesced interrupts.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
sparc32 SuperSPARC MMU Breakpoint Action register (SS-20 OBP fix)
SuperSPARC MMU Breakpoint Action register is used by OBP at boot
The patch allows booting Solaris and some other OS withSPARCStation-20 OBP.
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>...
pc: improve debugging
Add a DPRINTF macro and use it for ISA and PIC interrupts.
apic: improve debugging
Add a DPRINTF macro. Use TARGET_FMT_plx for printing target_phys_addr_titems. Add a separate flag for debugging coalescing interrupts.
i8259: improve debugging
Add a DPRINTF macro.
sparc64: fix user emulator build
Accesses with _nucleus prefix are not available when building useremulators: CC sparc64-linux-user/op_helper.occ1: warnings being treated as errors/src/qemu/target-sparc/op_helper.c: In function 'helper_ldda_asi':...
Pad iommu with an empty slot (necessary for SunOS 4.1.4)
On the real hardware (SS-5, LX) the MMU is not padded, but aliased.Software shouldn't use aliased addresses, neither should it crashwhen it uses (on the real hardware it wouldn't). Using empty_slot...
sparc64: fix 128-bit atomic load from nucleus context v1
- change 128-bit atomic loads to reference nucleus contextv0->v1: dropped disassembler changeSigned-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Pre-allocate guest address space
Allow pre-allocation of the guest virtual address space in usermode emulation.
Signed-off-by: Paul Brook <paul@codesourcery.com>
alpha-linux-user: Fill in SI_CODE for SIGSEGV.
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Use calloc in qemu_mallocz.
Avoids the memset if the allocator has gotten new zeroedstorage from the operating system.
linux-user: Use qemu-malloc.c.
Since we're no longer setting PAGE_RESERVED, there's no need toimplement qemu_malloc via mmap.
linux-user: Fix compilation with DEBUG defined
Signed-off-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix hw/gt64xxx.c compilation with DEBUG defined
Use TARGET_FMT_plx as format placeholder for target_phys_addr_t
Fix typo in balloon help
Fix launchpad #563883
musicpal: Drop redundant reset call
Reset is now triggered after init, no need for explicit calls anymore.
Signed-off-by: Jan Kiszka <jan.kiszka@web.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
doc: Update monitor info subcommands
The "info blockstats" documentation was copy-pasted as "info block" instead of "info blockstats". The documentation for "commands", "jit","numa", "qdm", and "roms" is missing. This patch resolves these issuesin qemu-monitor.hx....
Fix overflow in i440fx_init()
The ram_size parameter can be larger than an int, so it may be truncated.
Fix by using the correct type.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
arm: prevent coprocessor IO reset
This prevent coprocessor IO structure from being reset on cpu reset. This wasa problem for PXA which uses coprocessor 6 and 14.
Signed-off-by: Lars Munch <lars@segv.dk>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg: Use INDEX_op_qemu_ld32 for 32-bit results.
vhost_net.c: v2 Fix build failure introduced by 0bfcd599e3f5c5679cc7d0165a0a1822e2f60de2
Fix build failure introduced by 0bfcd599e3f5c5679cc7d0165a0a1822e2f60de2
The format statement expects unsigned long on x86_64, but receivesunsigned long long, so gcc exits with an error....
Make cache=unsafe the default for -snapshot
When using -snapshot we don't care about data integrity of the cow fileat all, so let's disable flushing there and squeeze out the last dropof performance we could possibly get.
Signed-off-by: Alexander Graf <agraf@suse.de>...
sparc64: clean up pci bridge map
- remove unused host state and store pci bus pointer only- do not map host state access into unused 1fe.10000000 range- reorder pci region registration- assign pci i/o region to isa_mem_base
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>...
sparc64: rename sun4u cpu to Ultrasparc IIi
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Add cache=unsafe parameter to -drive
Usually the guest can tell the host to flush data to disk. In some cases wedon't want to flush though, but try to keep everything in cache.
So let's add a new cache value to -drive that allows us to set the cachepolicy to most aggressive, disabling flushes. We call this mode "unsafe",...
use new cursor struct + functions for vmware vga and sdl.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
vnc: rich cursor support.
Uses VNC_ENCODING_RICH_CURSOR. Adding XCURSOR support should bepossible without much trouble. Shouldn't be needed though asRICH_CURSOR is a superset of XCURSOR.
sdl: Do not disable screensaver by default
Unless we are running in full-screen mode, QEMU's SDL window should notdisable the host's screensaver. The user can still change this behaviourby setting the environment variable SDL_VIDEO_ALLOW_SCREENSAVER as...
Virtio-net: Replace the hardcode 6 with defined ETN_ALEN
hw/virtio-net.h: #define ETH_ALEN 6ETH_ALEN was defined by commit 7967406801aa897fae83caad3278ac85a342adaa
Signed-off-by: Amos Kong <akong@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix error handling in qemu_read_config_file
We need to close the file even in error case. While at it, make the callerscatch all kind of errors. ENOENT is allowed for default config files, theyare optional.
Reported-by: Luiz Capitulino <lcapitulino@redhat.com>...
cursor: add cursor functions.
Add a new cursor type to console.h and a bunch of functions todeal with cursors the (new) cursor.c file.
Merge remote branch 'kwolf/for-anthony' into staging
Merge remote branch 'qmp/for-anthony' into staging
microblaze: Handle new elf mach nr for sysemu.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
lsi: Fix value overflow in request tag processing
This fixes a mismerge of 64d564094cac5f72eeaeb950c442b773a00d3586 (wrongpatch version): We need to mask the tag value properly to obtain itsdevice ID.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
sparc64: flush translations on mmu context change
- two pairs of softmmu indexes bind softmmu tlb to cpu tlb in fault handlers using value of DMMU primary and secondary context registers, so we need to flush softmmu translations when context registers are changed...
sparc64: fix mmu context at trap levels above zero
- cpu_mmu_index return MMU_NUCLEUS_IDX if trap level is not zero- cpu_get_tb_cpu_state: store trap level and primary context in flags this allows to restart code translation when address translation is changed...
sparc64: fix dump_mmu to look for global bit in tte value instead of tag
sparc64: fix pstate privilege bits
- refactor code to handle hpstate only if available for current cpu- conditionally set hypervisor bit in hpstate register- reorder softmmu indices so user accessable ones go first, translation context macros supervisor() and hypervisor() adjusted as well...
sparc64: generate data access exception on RW violation
- separate PRIV and PROT handling- DPRINTF_MMU macro to clean up debug code- dump mmu_idx, trap level and mmu context registers along with address translation values
sparc32 protect read-only bits in DMA CSR registers
On a real hardware changing read-only bits has no effectUse a mask common for SCSI and Ethernet registers. The crucialbit is DMA_INTR, because setting or clearing it may producespurious interrupts.
This patch allows booting Solaris 2.3...
vmstate: fix breakage by 7e72abc382b700a72549e8147bdea413534eeedc
cirrus_post_load() will be executed twice when loading vm states and then thewrong physical memory will be registered. This issue may lead to crash qemu.
Signed-off-by: TeLeMan <geleman@gmail.com>...
Fix -device help and documentation
Commit 6616b2ad reverted commit 40ea285c. Looks like a mismerge tome.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Acked-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix tarbin Makefile rule
The 'tarbin' Makefile rule doesn't include qemu-system-sparc64, butshould do, now that sparc64-softmmu is in the default target list.
The rule attempts to tar up binaries that were not built if a targetlist was passed to the configure script -- in which case, it will...
hxtool: Add syntax error detection
Add basic imbalance detection for STEXT/ETEXI.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix TEXI section mark imbalance in qemu-img-cmd.hx
Put dependency files in proper subdir
This seems to resolve subtle breakages of our build system:
Dependency files generated for targets like 'dir/foo.o' were saved as'foo.d'. Now, if there was also a target 'foo.o', one of the dependencyfile was overwritten. Concrete example: libhw*/macio.o vs....
Clean libhw subdirs as well
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Acked-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Fix %lld or %llx printf format use
Compile dma only once
Use a qemu_irq to request CPU exit.
7 compilations less for the full build.
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.
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>
virtio-blk: fix barrier support
Before issuing the barrier to the block driver we need to flush our oustandingqueue of write requests, as the flush is supposed to be issued after them.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: fix sector comparism in multiwrite_req_compare
The difference between the start sectors of two requests can be largerthan the size of the "int" type, which can lead to a not correctlysorted multiwrite array and thus spurious I/O errors and filesystem...
block: Make find_image_format() return 'raw' BlockDriver for SG_IO devices
This patch adds a special BlockDriverState->sg check in block.c:find_image_format()after bdrv_file_open() -> block/raw-posix.c:hdev_open() has been called to determineif we are dealing with a Linux host scsi-generic device....
block: Add SG_IO device check in refresh_total_sectors()
This patch adds a special case check for scsi-generic devices inrefresh_total_sectors() to skip the subsequent BlockDriver->bdrv_getlength()that will be returning -ESPIPE from block/raw-posic.c:raw_getlength() for...
vvfat: Fix compilation with DEBUG defined
gcc does not like passing a NULL where an int value is expected:
block/vvfat.c: In function ‘checkpoint’:block/vvfat.c:2868: error: passing argument 2 of ‘remove_mapping’ makes integer from pointer without a cast...
vvfat: More build fixes with DEBUG
Casting a pointer to an int doesn't work on 64 bit platforms. Use the %p printfconversion specifier instead.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: fix aio_flush segfaults for read-only protocols (e.g. curl)
Not all block format drivers expose an io_flush method (reasonable forread-only protocols), so calling io_flush there will immediately segfault.
Fix by checking for the method's existence before calling it....
virtio-blk: Avoid zeroing every request structure
The VirtIOBlockRequest structure is about 40 KB in size. This patchavoids zeroing every request by only initializing fields that are read.The other fields are either written to or may not be used at all....
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.
tcg-i386: Tidy bswap operations.
Define OPC_BSWAP. Factor opcode emission to separate functions.