Aurelien Jarno [Mon, 1 Mar 2010 21:33:48 +0000 (22:33 +0100)]
tcg/arm: implement setcond
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Aurelien Jarno [Tue, 2 Mar 2010 19:19:18 +0000 (20:19 +0100)]
tcg/arm: fix div2/divu2
When restoring register values, increase the stack register for skipped
values.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Paul Brook [Mon, 1 Mar 2010 03:31:14 +0000 (03:31 +0000)]
Avoid tlb_set_page in userspace emulation
tlb_set_page isn't meaningful for userspace emulation, so remove it.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Paul Brook [Mon, 1 Mar 2010 03:31:14 +0000 (03:31 +0000)]
Move subpage definitions
Move definitions for subpage handling into !CONFIG_USER_ONLY code.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Paul Brook [Mon, 1 Mar 2010 03:55:48 +0000 (03:55 +0000)]
Disassembler symbol lookup fix
Fix function signature for userspace disassembler symbol lookup.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Paul Brook [Mon, 1 Mar 2010 03:29:21 +0000 (03:29 +0000)]
Move ioport.h out of cpu-all.h
Only include ioport.h where it is actually needed.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Paul Brook [Mon, 1 Mar 2010 00:08:59 +0000 (00:08 +0000)]
Remove bogus cpu_physical_memory_rw
Userspace doesn't have physical memory, so cpu_physical_memory_rw
makes no sense. This is only used to implement cpu_memory_rw_debug, so
just implement that directly instead.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Paul Brook [Sun, 28 Feb 2010 23:55:53 +0000 (23:55 +0000)]
Remove l1_phys_map from userspace emulation
Userspace emulation doesn't have a physical address space, so
l1_phys_map makes no sense. This code is never actually used, so don't
try and build it.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Paul Brook [Sun, 28 Feb 2010 23:47:45 +0000 (23:47 +0000)]
Fix userspace breakpoint invalidation
Remove bogus virtual->physical address translation in
breakpoint_invalidate for userspace emulation.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Juha Riihimäki [Fri, 5 Feb 2010 15:52:29 +0000 (15:52 +0000)]
target-arm: neon vshll instruction fix
implementation only widened the 32bit source vector elements into a
64bit destination vector but forgot to perform the actual shifting
operation.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Riku Voipio [Fri, 5 Feb 2010 15:52:28 +0000 (15:52 +0000)]
target-arm: neon - fix VRADDHN/VRSUBHN vs VADDHN/VSUBHN
The rounding/truncating options were inverted. truncating
was done when rounding was meant and vice verse.
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Jason Wessel [Tue, 26 Jan 2010 22:29:50 +0000 (16:29 -0600)]
target-i386: fix crash on x86 32bit linux host with hw breakpoint exceptions
If you make use of hw breakpoints on a 32bit x86 linux host, qemu
will segmentation fault when processing the exception.
The problem is that the value of env is stored in $ebp in the op_helper
raise_exception() function, and it can have the wrong value when
calling it from non generated code.
It is possible to work around the problem by restoring the value of
env before calling raise_exception() using a new helper function that
takes (CPUState *) as one of the arguments.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Mon, 28 Dec 2009 02:30:03 +0000 (18:30 -0800)]
alpha-linux-user: Implement signals.
Move userland PALcode handling into linux-user main loop so that
we can send signals from there. This also makes alpha_palcode.c
system-level only, so don't build it for userland. Add defines
for GENTRAP PALcall mapping to signals.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Mon, 4 Jan 2010 22:27:23 +0000 (14:27 -0800)]
target-alpha: Implement IEEE FP qualifiers.
IEEE FP instructions are split up so that the rounding mode
coming from the instruction and exceptions (both masking and
delivery) are handled external to the base FP operation.
FP exceptions are properly raised for non-finite inputs to
instructions that do not indicate software completion.
A shortcut is applied if CONFIG_SOFTFLOAT_INLINE is defined
at the top of translate.c: data is loaded and stored into
FP_STATUS directly instead of using the functional interface
defined by "softfloat.h".
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sun, 28 Feb 2010 15:04:09 +0000 (16:04 +0100)]
target-ppc: don't print invalid opcode messages on the console
Invalid opcode messages can be perfectly normal, for example if this
code is never executed. Don't print an error message on the console,
but keep the message in the log for debugging purposes.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sun, 28 Feb 2010 15:02:28 +0000 (16:02 +0100)]
Revert "target-ppc: stop translation after a trap instruction"
This reverts commit
6454e7be1b2504533f7ffb190d54ebe2993cb434.
malc [Sun, 28 Feb 2010 15:34:21 +0000 (18:34 +0300)]
audio/alsa: Handle SND_PCM_STATE_SETUP in alsa_poll_handler
Signed-off-by: malc <av1474@comtv.ru>
Vagrant Cascadian [Fri, 26 Feb 2010 21:39:46 +0000 (13:39 -0800)]
audio/alsa: Spelling typo (paramters)
Trivial patch to fix the spelling of "parameters".
Signed-off-by: malc <av1474@comtv.ru>
Aurelien Jarno [Sun, 28 Feb 2010 13:11:06 +0000 (14:11 +0100)]
target-ppc: stop translation after a trap instruction
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Jan Kiszka [Mon, 18 Jan 2010 11:15:01 +0000 (12:15 +0100)]
qemu-char.c: drop debug printfs from qemu_chr_parse_compat
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Liu Yu [Tue, 2 Feb 2010 08:49:03 +0000 (16:49 +0800)]
powerpc/e500: adjust fdt and ramdisk loading addr
Since kernel uimage is getting bigger,
old fixed loading bases will result in regions overlap.
Add pad for fdt and ramdisk, so that they won't overlap with uimage.
Signed-off-by: Liu Yu <yu.liu@freescale.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 27 Feb 2010 18:47:22 +0000 (19:47 +0100)]
powerpc: fix compilation with CONFIG_FDT undefined
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Liu Yu [Tue, 2 Feb 2010 08:49:02 +0000 (16:49 +0800)]
powerpc/booke: move fdt loading to rom infrastructure
It's convinent to use rom to checking overlap, to reset etc.
And uImage and ramdisk loading has already moved to it.
Also, after we add fdt to rom, free it.
Signed-off-by: Liu Yu <yu.liu@freescale.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Liu Yu [Wed, 27 Jan 2010 06:14:09 +0000 (14:14 +0800)]
target-ppc: add synchronize register for booke init
So that the following registers init could be flushed back to kvm.
Signed-off-by: Liu Yu <yu.liu@freescale.com>
Acked-by: Hollis Blanchard <hollis@penguinppc.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
takasi-y@ops.dti.ne.jp [Wed, 17 Feb 2010 15:53:29 +0000 (00:53 +0900)]
target-sh4: Fix gdb read/write register
cpu_gdb_read_register(): Fix n={8...15} case.
cpu_gdb_write_register(): Fix n={8...15} case and runaway "case:".
Signed-off-by: Takashi YOSHII <takasi-y@ops.dti.ne.jp>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Tue, 23 Feb 2010 20:21:31 +0000 (12:21 -0800)]
target-ppc: fix SPE evsplat* instructions
The shifts in the gen_evsplat* functions were expecting rA to be masked,
not extracted, and so used the wrong shift amounts to sign-extend or pad
with zeroes.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Tue, 23 Feb 2010 19:55:14 +0000 (11:55 -0800)]
target-ppc: fix SPE evcmp* instructions
The CRF_{CH,CL,CH_OR_CL,CH_AND_CL} constants were all off by one bit
position. Because of this, the SPE evcmp* family of instructions would
store values in the result condition register that were also off by one
bit position.
Fixed by using the CRF_{LT,GT,EQ,SO} constants for the shift amounts.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Stefan Weil [Tue, 23 Feb 2010 21:32:23 +0000 (22:32 +0100)]
arm host: Fix linker warning (m68k targets)
Compilation of m68k-softmmu or m68k-linux-user on arm host
(or cross compilation for arm) results in a linker warning:
LINK m68k-softmmu/qemu-system-m68k
m68k-dis.o: warning: definition of `floatformat_ieee_single_little' overriding common
arm-dis.o: warning: common is here
/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../../arm-linux-gnueabi/bin/ld: Warning: size of symbol `floatformat_ieee_single_little' changed from 4 in arm-dis.o to 48 in m68k-dis.o
floatformat_ieee_single_little is declared in arm-dis.c and m68k-dis.c,
and both declarations don't match, so this is an error.
The symbol is not needed in arm-dis.c, so I removed it there.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Amit Shah [Fri, 26 Feb 2010 08:30:28 +0000 (14:00 +0530)]
Fix 'make install' from non-srcdir build
Commit
b5ec5ce0 broke 'make install' from non source-dir build. Fix.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Daniel Gutson [Fri, 26 Feb 2010 17:13:50 +0000 (14:13 -0300)]
Fix to 'gdb detach' stub
With this patch, 'gdb detach' correctly resumes the inferior execution
after detaching the debugger.
The bug was caused by qemu asking gdb to execute a syscall (isatty)
after the detach, and then waiting (forever) for the reply. I fixed this
by properly setting gdb_syscall_mode appropriately in the 'detach'
packet handling, so subsequent syscalls are solved by qemu rather than gdb.
Signed-off-by: Daniel Gutson <dgutson@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Sat, 27 Feb 2010 09:50:32 +0000 (10:50 +0100)]
Fix qemu -net user,hostfwd= example
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
malc [Fri, 26 Feb 2010 22:59:47 +0000 (01:59 +0300)]
tcg/ppc: Fix right rotation
Signed-off-by: malc <av1474@comtv.ru>
Stefan Weil [Thu, 25 Feb 2010 18:05:41 +0000 (19:05 +0100)]
target-sparc: fix --enable-debug build for 64 bit host
b551ec04ca45d1925417dd2ec7c1b7f115c84f1d fixed
the compilation for 32 bit hosts, but introduced
a new error for 64 bit hosts:
tcg_temp_new_ptr needs a matching tcg_temp_free_ptr.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Paul Brook [Thu, 25 Feb 2010 13:29:06 +0000 (13:29 +0000)]
Fix -usbdevice crash
If -usbdevice is used on a machine with no USB busses, usb_create
will fail and return NULL. Patch below handles this failure gracefully
rather than crashing when we try to init the device.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Paul Brook [Tue, 23 Feb 2010 23:31:53 +0000 (23:31 +0000)]
ARM defconfig fix
Tix typo in default-configs/arm-softmmu.mak
Signed-off-by: Paul Brook <paul@codesourcery.com>
Richard Henderson [Mon, 4 Jan 2010 19:25:22 +0000 (11:25 -0800)]
target-alpha: Mark helper_excp as NORETURN.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Mon, 4 Jan 2010 19:24:04 +0000 (11:24 -0800)]
target-alpha: Clean up arithmetic traps.
Replace the EXCP_ARITH_OVERFLOW placeholder with the complete
set of bits from the EXC_SUM IPR. Use them in the existing
places where we raise arithmetic exceptions.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Mon, 4 Jan 2010 19:19:14 +0000 (11:19 -0800)]
target-alpha: Reduce internal processor registers for user-mode.
The existing set of IPRs is totally irrelevant to user-mode emulation.
Indeed, they most are irrelevant to implementing kernel-mode emulation,
and would only be relevant to PAL-mode emulation, which I suspect that
no one will ever attempt.
Reducing the set of processor registers reduces the size of the CPU state.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Thu, 31 Dec 2009 20:41:07 +0000 (12:41 -0800)]
target-alpha: Split up FPCR value into separate fields.
The fpcr_exc_status, fpcr_exc_mask, and fpcr_dyn_round fields
are stored in <softfloat.h> format for convenience during
regular execution.
Revert the addition of float_exception_mask to float_status,
added in
ba0e276db4b51bd2255a5d5ff8902c70d32ade40.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Richard Henderson [Thu, 31 Dec 2009 19:54:01 +0000 (11:54 -0800)]
target-alpha: Fix gdb access to fpcr and unique.
cpu_gdb_read/write_register need to access the fpcr via the
cpu_alpha_load/store_fpcr functions.
The unique register is number 66 in the gdb remote protocol.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Blue Swirl [Tue, 23 Feb 2010 22:01:36 +0000 (22:01 +0000)]
Fix OpenBSD linker warning
helper.o(.text+0x11e0): In function `listflags':
/src/qemu/target-i386/helper.c:661: warning: sprintf() is often misused, please use snprintf()
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Tue, 23 Feb 2010 21:46:32 +0000 (21:46 +0000)]
Fix i386-bsd-user build
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Tue, 23 Feb 2010 21:46:28 +0000 (21:46 +0000)]
Fix mingw32 build
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Markus Armbruster [Mon, 14 Dec 2009 09:48:05 +0000 (10:48 +0100)]
Simplify qemu_realloc()
No functional change. Bonus: looks just like qemu_malloc() now.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Anthony Liguori [Tue, 23 Feb 2010 19:35:12 +0000 (13:35 -0600)]
pc-bios: update to latest Seabios
- 0360e8e Seabios e820 reservation portion v3
- 7149fc8 Initial support for booting from USB drives.
- 3c160dd Introduce helper functions for finding USB end-points.
- 9571439 USB UHCI cleanups.
- a4bd919 Minor - arrange struct drive_s to clarify field roles.
- dac46b1 Fix off by one error in strtcpy.
- d2d1de0 Don't require a valid physical cylinders/heads/spt for logical mapping.
- 76977b2 Move common "command data block" functions to new file blockcmd.c.
- d7e998f Dynamically allocate each drive_g with malloc_fseg().
- 525be69 Add *.pyc to .gitignore.
- 7d70025 Add common "block command" definitions and update cdrom code.
- 68caaa7 Optimize ntohl() code.
- 42157c8 Minor - sort ATA CMD definitions.
- 54671c1 Initial support for USB hubs.
- 7852331 Minor - increase debug level of some USB debug statements.
- ba94a68 Don't leave USB UHCI ports disabled for extended time during reset.
- 49a0aa6 Don't parallelize USB OHCI root port reset.
- cfdc13f Introduce standard warnings for allocation failures and timeouts.
- 8bbc79c Add symbolic definitions for USB delays.
- 991eaff Support USB interrupt schedules on OHCI and UHCI.
- 59c7574 Add some ASSERT32FLAT() to help compiler eliminate dead code.
- e1920be seabios: acpi: fix memory leak in build_srat().
- 84a4d4b Support USB keyboard auto-repeat.
- bf7f1f3 mptable: Pull cpuid_signature/features setting out of loop.
- 6f702dd Rework disabling of ps2 port irqs.
- 2d3f0f5 Go back to using 0xf0000000 for PCI memory start.
- 41c0957 Read APIC version from APIC instead of using a hard-coded value.
- 7a98fd0 Work around bochs floppy issue with wait_irq().
- 4d07902 Add CONFIG_ATA_DMA option; default to off for now.
- 3012af1 Fix PkgLength calculation for the SSDT.
- 92a5742 Add explicit Program Headers to linker scripts.
- 6fc91b2 Prep version for next release.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Gleb Natapov [Sun, 21 Feb 2010 14:23:20 +0000 (16:23 +0200)]
fix 'i' format handling in memory dump
It was broken by
09b9418c6d0. (!env && !is_physical) != (!is_physical)
when env is true.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Frediano Ziglio [Sat, 20 Feb 2010 17:50:27 +0000 (18:50 +0100)]
rewrote timer implementation for rtl8139.
Add a QEMU timer only when needed (timeout status not set, timeout
irq wanted and timer set).
This patch is required for Darwin. Patch has been tested under
FreeBSD, Darwin and Linux.
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Kevin Wolf [Tue, 23 Feb 2010 15:06:20 +0000 (16:06 +0100)]
qcow2: Fix image creation regression
When checking for errors, commit
db89119d compares with the wrong values,
failing image creation even when there was no error. Additionally, if an
error has occured, we can't preallocate the image (it's likely broken).
This unbreaks test 023 of qemu-iotests.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Kevin Wolf [Tue, 23 Feb 2010 15:40:54 +0000 (16:40 +0100)]
qcow2: More checks for qemu-img check
Implement some more refcount block related checks
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Kevin Wolf [Tue, 23 Feb 2010 15:40:53 +0000 (16:40 +0100)]
qcow2: Rewrite alloc_refcount_block/grow_refcount_table
The current implementation of alloc_refcount_block and grow_refcount_table has
fundamental problems regarding error handling. There are some places where an
I/O error means that the image is going to be corrupted. I have found that the
only way to fix this is to completely rewrite the thing.
In detail, the problem is that the refcount blocks itself are allocated using
alloc_refcount_noref (to avoid endless recursion when updating the refcount of
the new refcount block, which migh access just the same refcount block but its
allocation is not yet completed...). Only at the end of the refcount allocation
the refcount of the refcount block is increased. If an error happens in
between, the refcount block is in use, but has a refcount of zero and will
likely be overwritten later.
The new approach is explained in comments in the code. The trick is basically
to let new refcount blocks describe their own refcount, so their refcount will
be automatically changed when they are hooked up in the refcount table.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Kevin Wolf [Tue, 23 Feb 2010 15:40:52 +0000 (16:40 +0100)]
qcow2: Factor next_refcount_table_size out
When the refcount table grows, it doesn't only grow by one entry but reserves
some space for future refcount blocks. The algorithm to calculate the number of
entries stays the same with the fixes, so factor it out before replacing the
rest.
As Juan suggested take the opportunity to simplify the code a bit.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Paolo Bonzini [Tue, 23 Feb 2010 18:21:00 +0000 (19:21 +0100)]
declare saved_env_reg as volatile
This ensures that the compiler does not move it away from
the "env = env1;" assignment. Fixes a miscompilation
on gcc 4.4, reported by Jay Foad.
Cc: <jay.foad@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Nathan Froyd [Sat, 20 Feb 2010 18:24:07 +0000 (10:24 -0800)]
target-mips: fix ROTR and DROTR by zero
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Nathan Froyd [Sat, 20 Feb 2010 18:19:09 +0000 (10:19 -0800)]
target-mips: fix CpU exception for coprocessor 0
When we signal a CpU exception for coprocessor 0, we should indicate
that it's for coprocessor 0 instead of coprocessor 1.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Aurelien Jarno [Wed, 10 Feb 2010 17:19:36 +0000 (18:19 +0100)]
target-mips: remove useless sign extension
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Avi Kivity [Tue, 23 Feb 2010 09:16:53 +0000 (10:16 +0100)]
Fix qemu_eventfd compile when !CONFIG_EVENTFD
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Paul Brook [Tue, 23 Feb 2010 14:45:16 +0000 (14:45 +0000)]
ARM CP15 tls fix
Fix temporary handling in cp15 tls register load/store.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Anthony Liguori [Mon, 22 Feb 2010 22:16:22 +0000 (16:16 -0600)]
Merge remote branch 'qemu-kvm/uq/master' into staging
john cooper [Sat, 20 Feb 2010 17:14:59 +0000 (11:14 -0600)]
Add cpu model configuration support..
This is a reimplementation of prior versions which adds
the ability to define cpu models for contemporary processors.
The added models are likewise selected via -cpu <name>,
and are intended to displace the existing convention
of "-cpu qemu64" augmented with a series of feature flags.
A primary motivation was determination of a least common
denominator within a given processor class to simplify guest
migration. It is still possible to modify an arbitrary model
via additional feature flags however the goal here was to
make doing so unnecessary in typical usage. The other
consideration was providing models names reflective of
current processors. Both AMD and Intel have reviewed the
models in terms of balancing generality of migration vs.
excessive feature downgrade relative to released silicon.
This version of the patch replaces the prior hard wired
definitions with a configuration file approach for new
models. Existing models are thus far left as-is but may
easily be transitioned to (or may be overridden by) the
configuration file representation.
Proposed new model definitions are provided here for current
AMD and Intel processors. Each model consists of a name
used to select it on the command line (-cpu <name>), and a
model_id which corresponds to a least common denominator
commercial instance of the processor class.
A table of names/model_ids may be queried via "-cpu ?model":
:
x86 Opteron_G3 AMD Opteron 23xx (Gen 3 Class Opteron)
x86 Opteron_G2 AMD Opteron 22xx (Gen 2 Class Opteron)
x86 Opteron_G1 AMD Opteron 240 (Gen 1 Class Opteron)
x86 Nehalem Intel Core i7 9xx (Nehalem Class Core i7)
x86 Penryn Intel Core 2 Duo P9xxx (Penryn Class Core 2)
x86 Conroe Intel Celeron_4x0 (Conroe/Merom Class Core 2)
:
Also added is "-cpu ?dump" which exhaustively outputs all config
data for all defined models, and "-cpu ?cpuid" which enumerates
all qemu recognized CPUID feature flags.
The pseudo cpuid flag 'check' when added to the feature flag list
will warn when feature flags (either implicit in a cpu model or
explicit on the command line) would have otherwise been quietly
unavailable to a guest:
# qemu-system-x86_64 ... -cpu Nehalem,check
warning: host cpuid 0000_0001 lacks requested flag 'sse4.2|sse4_2' [0x00100000]
warning: host cpuid 0000_0001 lacks requested flag 'popcnt' [0x00800000]
A similar 'enforce' pseudo flag exists which in addition
to the above causes qemu to error exit if requested flags are
unavailable.
Configuration data for a cpu model resides in the target config
file which by default will be installed as:
/usr/local/etc/qemu/target-<arch>.conf
The format of this file should be self explanatory given the
definitions for the above six models and essentially mimics
the structure of the static x86_def_t x86_defs.
Encoding of cpuid flags names now allows aliases for both the
configuration file and the command line which reconciles some
Intel/AMD/Linux/Qemu naming differences.
This patch was tested relative to qemu.git.
Signed-off-by: john cooper <john.cooper@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
David Ahern [Thu, 11 Feb 2010 01:27:17 +0000 (18:27 -0700)]
add close callback for tty-based char device
v1 -> v2 coding style changes
Add a tty close callback. Right now if a guest device that is connected
to a tty-based chardev in the host is removed, the tty is not closed.
With this patch it is closed.
Example use case is connecting an emulated USB serial cable in the guest
to ttyS0 of the host using the monitor command:
usb_add serial::/dev/ttyS0
and then removing the device with:
usb_del serial::/dev/ttyS0
Signed-off-by: David Ahern <daahern@cisco.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Justin T. Gibbs [Wed, 10 Feb 2010 21:35:54 +0000 (14:35 -0700)]
Fix lost serial TX interrupts. Report receive overruns.
o Implement receive overrun status. The FreeBSD uart driver
relies on this status in it's probe routine to determine the size
of the FIFO supported.
o As per the 16550 spec, do not overwrite the RX FIFO on an RX overrun.
o Do not allow TX or RX FIFO overruns to increment the data valid count
beyond the size of the FIFO.
o For reads of the IIR register, only clear the "TX holding register
emtpy interrupt" if the read reports this interrupt. This is required
by the specification and avoids losing TX interrupts when other,
higher priority interrupts (usually RX) are reported first.
Signed-off-by: Justin T. Gibbs <gibbs@FreeBSD.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
malc [Mon, 22 Feb 2010 21:50:03 +0000 (00:50 +0300)]
tcg/ppc: Fix typo
Signed-off-by: malc <av1474@comtv.ru>
Michael S. Tsirkin [Mon, 22 Feb 2010 10:38:25 +0000 (12:38 +0200)]
apc_pci: simplify using rwhandler
Use rwhandler to simplify apb_pci.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Michael S. Tsirkin [Mon, 22 Feb 2010 09:40:19 +0000 (11:40 +0200)]
apb_pci: minor cleanup
pci_data_write ignores high 8 bit in address,
so there seems to be no need to set them
in apb_pci.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Mon, 22 Feb 2010 20:42:56 +0000 (20:42 +0000)]
Update OpenBIOS images to r683
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Mon, 22 Feb 2010 20:42:51 +0000 (20:42 +0000)]
Fix arm-softmmu compile
cc1: warnings being treated as errors
/src/qemu/hw/pl181.c: In function 'pl181_fifo_run':
/src/qemu/hw/pl181.c:185: error: 'value' may be used uninitialized in this function
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
malc [Mon, 22 Feb 2010 18:56:35 +0000 (21:56 +0300)]
tcg/ppc64: Use C90 style comments
Signed-off-by: malc <av1474@comtv.ru>
malc [Mon, 22 Feb 2010 18:50:01 +0000 (21:50 +0300)]
tcg/ppc: Implement some of the optional ops
Signed-off-by: malc <av1474@comtv.ru>
Marcelo Tosatti [Mon, 22 Feb 2010 16:57:54 +0000 (13:57 -0300)]
kvm-all.c: define smp_wmb and use it for coalesced mmio
Acked-by: "Michael S. Tsirkin" <mst@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Jay Foad [Mon, 22 Feb 2010 15:53:55 +0000 (15:53 +0000)]
tcg: fix build on 32-bit hppa, ppc and sparc hosts
The qemu_ld32s op is only defined if TCG_TARGET_REG_BITS == 64.
Signed-off-by: Jay Foad <jay.foad@gmail.com>
Signed-off-by: malc <av1474@comtv.ru>
Paul Brook [Mon, 22 Feb 2010 15:33:59 +0000 (15:33 +0000)]
PL181 write fix
The PL181 data transfer loop incorrectly terminates after the last FIFO
word is popped, discarding the last 3 bytes of data on a write transfer.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Marcelo Tosatti [Wed, 17 Feb 2010 22:14:43 +0000 (20:14 -0200)]
kvm: remove pre-entry exit_request check with iothread enabled
With SIG_IPI blocked vcpu loop exit notification happens via -EAGAIN
from KVM_RUN.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Marcelo Tosatti [Wed, 17 Feb 2010 22:14:42 +0000 (20:14 -0200)]
kvm: consume internal signal with sigtimedwait
Change the way the internal qemu signal, used for communication between
iothread and vcpus, is handled.
Block and consume it with sigtimedwait on the outer vcpu loop, which
allows more precise timing control.
Change from standard signal (SIGUSR1) to real-time one, so multiple
signals are not collapsed.
Set the signal number on KVM's in-kernel allowed sigmask.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Marcelo Tosatti [Wed, 17 Feb 2010 22:14:41 +0000 (20:14 -0200)]
kvm specific wait_io_event
In KVM mode the global mutex is released when vcpus are executing,
which means acquiring the fairness mutex is not required.
Also for KVM there is one thread per vcpu, so tcg_has_work is meaningless.
Add a new qemu_wait_io_event_common function to hold common code
between TCG/KVM.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Marcelo Tosatti [Wed, 17 Feb 2010 22:14:40 +0000 (20:14 -0200)]
block SIGCHLD in vcpu thread(s)
Otherwise a vcpu thread can run the sigchild handler causing
waitpid() from iothread to fail.
Signed-off-by: Marcelo Tosatti <mtosa...@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Blue Swirl [Sun, 21 Feb 2010 16:01:30 +0000 (16:01 +0000)]
Allow const QemuOptDesc
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Jes Sorensen [Fri, 19 Feb 2010 06:43:24 +0000 (07:43 +0100)]
kvm: Kill CR3_CACHE feature references
Remove all references to KVM_CR3_CACHE as it was never implemented.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Jan Kiszka [Fri, 19 Feb 2010 17:21:20 +0000 (18:21 +0100)]
kvm: Fix eflags corruption in kvm mode
This should explain a lot of the weird breakages of upstream KVM we've
seen recently (actually we should have seen it much earlier):
Stop translating eflags into TCG format when in kvm mode as we never
translate it back and rather sync this broken state into the kernel.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Edgar E. Iglesias [Sat, 20 Feb 2010 18:51:56 +0000 (19:51 +0100)]
cris: Add CRISv10 gdbstub support.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Edgar E. Iglesias [Sat, 20 Feb 2010 18:17:29 +0000 (19:17 +0100)]
cris: Mask interrupts on dslots for CRISv10.
CRISv10 cores (unlike v32) do not take any interrupts while delayed
jumps are pending (delay slots).
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Edgar E. Iglesias [Sat, 20 Feb 2010 13:04:01 +0000 (14:04 +0100)]
microblaze: Improve brk emulation.
brk insns while in user mode raise priv insn exceptions.
This commit makes gdbserver work on linux guests.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
Edgar E. Iglesias [Sat, 20 Feb 2010 13:03:14 +0000 (14:03 +0100)]
microblaze: Dont segfault when singlestepping first insn.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
Jay Foad [Sat, 20 Feb 2010 10:45:23 +0000 (10:45 +0000)]
target-sparc: fix --enable-debug build
Use 32-bit arithmetic for the address offset calculation to fix a
build failure on 32-bit hosts.
Signed-off-by: Jay Foad <jay.foad@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Jay Foad [Sat, 20 Feb 2010 10:08:33 +0000 (10:08 +0000)]
tcg: fix assertion with --enable-debug
On 32-bit hosts op_qemu_ld32s is unused. Remove it to fix the
following assertion failure:
qemu-alpha: tcg/tcg.c:1055:
tcg_add_target_add_op_defs: Assertion `tcg_op_defs[op].used' failed.
Signed-off-by: Jay Foad <jay.foad@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Sat, 20 Feb 2010 09:27:38 +0000 (09:27 +0000)]
Don't compile rwhandler.c for user targets
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Thu, 18 Feb 2010 22:44:39 +0000 (14:44 -0800)]
tcg: Add comments for all optional instructions not implemented.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Tue, 16 Feb 2010 22:23:39 +0000 (14:23 -0800)]
tcg-sparc: Implement ORC.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Tue, 16 Feb 2010 22:21:19 +0000 (14:21 -0800)]
tcg-sparc: Implement ANDC.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Tue, 16 Feb 2010 22:15:28 +0000 (14:15 -0800)]
tcg: Optional target implementation of ORC.
Previously ORC was always implemented by tcg-op.h with
an explicit NOT opcode. Allow a target implementation.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Tue, 16 Feb 2010 22:10:13 +0000 (14:10 -0800)]
tcg: Optional target implementation of ANDC.
Previously ANDC was always implemented by tcg-op.h with
an explicit NOT opcode. Allow a target implementation.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Tue, 16 Feb 2010 22:02:04 +0000 (14:02 -0800)]
tcg-sparc: Implement not.
The fallback implementation of "ret = arg1 ^ -1" isn't ideal
because of the extra tcg op to load the minus one.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Richard Henderson [Tue, 16 Feb 2010 21:55:15 +0000 (13:55 -0800)]
tcg-sparc: Implement neg.
The fallback implementation of "ret = 0 - arg1" isn't ideal,
first because of the extra tcg op to load the zero, and second
because we fail to handle zero as %g0 for arg1 of the sub.
Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Sat, 20 Feb 2010 08:29:17 +0000 (08:29 +0000)]
Fix warning on mingw32
/src/qemu/hw/ide/core.c: In function 'ide_drive_pre_save':
/src/qemu/hw/ide/core.c:2740: warning: comparison is always false due to limited range of data type
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Blue Swirl [Sat, 20 Feb 2010 08:20:18 +0000 (08:20 +0000)]
Fix warning on OpenBSD
/src/qemu/net.c: In function `net_check_clients':
/src/qemu/net.c:1287: warning: `has_nic' might be used uninitialized in this function
/src/qemu/net.c:1287: warning: `has_host_dev' might be used uninitialized in this function
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
malc [Fri, 19 Feb 2010 22:47:35 +0000 (01:47 +0300)]
tcg/ppc: Consistently use calling convention selection macros
Signed-off-by: malc <av1474@comtv.ru>
Juergen Lock [Fri, 19 Feb 2010 18:30:07 +0000 (19:30 +0100)]
Use ppc host calling convention definitions to set TCG_TARGET_CALL_{ALIGN_ARGS,STACK_OFFSET}.
New version after malc's comments. (This avoids having to do
#if defined __linux__ || defined __FreeBSD__ || defined __FreeBSD_kernel__
for the third case.)
Submitted by: Andreas Tobler <andreast@fgznet.ch> (original version)
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: malc <av1474@comtv.ru>
Juergen Lock [Fri, 19 Feb 2010 18:29:25 +0000 (19:29 +0100)]
Add FreeBSD/ppc host ucontext definitions.
Submitted by: Andreas Tobler <andreast@fgznet.ch>
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: malc <av1474@comtv.ru>
Juergen Lock [Fri, 19 Feb 2010 18:28:23 +0000 (19:28 +0100)]
Add FreeBSD/ppc host ppc_init_cacheline_sizes() implementation.
New version after malc's comments. (Added error handling.)
Submitted by: Andreas Tobler <andreast@fgznet.ch>
Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: malc <av1474@comtv.ru>
Kevin Wolf [Wed, 17 Feb 2010 11:33:17 +0000 (12:33 +0100)]
qemu-img: Fix error message
When qemu-img can't open the new backing file for a rebase, it prints an error
message which contains the file name of the old backing file. This is wrong,
obviously.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Kevin Wolf [Wed, 17 Feb 2010 11:32:59 +0000 (12:32 +0100)]
qemu-img: Fix segfault during rebase
This fixes a possible read beyond the end of the temporary buffers used for
comparing data in the old and the new backing file.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>