sdk/emulator/qemu.git
15 years agoprepare pci nic init path for qdev property configuration.
Gerd Hoffmann [Wed, 21 Oct 2009 13:25:29 +0000 (15:25 +0200)]
prepare pci nic init path for qdev property configuration.

Initialization path will work with both converted and not-converted
drivers, so we can convert drivers one by one.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoqdev: add qdev_prop_exists()
Gerd Hoffmann [Wed, 21 Oct 2009 13:25:28 +0000 (15:25 +0200)]
qdev: add qdev_prop_exists()

Function test whenever a driver has a specific property.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agone2k_isa: use qdev properties for configuration.
Gerd Hoffmann [Wed, 21 Oct 2009 13:25:27 +0000 (15:25 +0200)]
ne2k_isa: use qdev properties for configuration.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoqdev/net: common nic property bits
Gerd Hoffmann [Wed, 21 Oct 2009 13:25:26 +0000 (15:25 +0200)]
qdev/net: common nic property bits

Add a new type for properties common to all nics.
Add helper functions and macros to deal with it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoqdev: add vlan property
Gerd Hoffmann [Wed, 21 Oct 2009 13:25:25 +0000 (15:25 +0200)]
qdev: add vlan property

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoqdev: add netdev property
Gerd Hoffmann [Wed, 21 Oct 2009 13:25:24 +0000 (15:25 +0200)]
qdev: add netdev property

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoqdev: mac addr property fixups
Gerd Hoffmann [Wed, 21 Oct 2009 13:25:23 +0000 (15:25 +0200)]
qdev: mac addr property fixups

Make the mac property use the newly added type for the mac address.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agonet: add macaddr type.
Gerd Hoffmann [Wed, 21 Oct 2009 13:25:22 +0000 (15:25 +0200)]
net: add macaddr type.

Add new type for mac addresses.

Add function which sets the qemu default mac address if it finds the mac
address uninitialized (i.e. all zeros).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoSend a RARP packet after migration.
Nolan [Thu, 15 Oct 2009 23:53:55 +0000 (16:53 -0700)]
Send a RARP packet after migration.

Currently, after a migration qemu sends a broadcast packet to update
switches' MAC->port mappings.

Unfortunately, it picks a random (constant) ethertype and crosses its
fingers that no one else is using it.

This patch causes it to send a RARP packet instead.  RARP was chosen for
2 reasons.  One, it is always harmless, and will continue to be so even
as new ethertypes are allocated.  Two, it is what VMware ESX sends, so
people who write filtering rules for switches already know about it.

I also changed the code to send SELF_ANNOUNCE_ROUNDS packets, instead of
SELF_ANNOUNCE_ROUNDS + 1, and added a simple backoff scheme.

Signed-off-by: Nolan Leake <nolan <at> sigbus.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomultiboot.S patch for old as(1) (was: Re: [Qemu-devel] Some OpenBSD/amd64 build fixes)
Juergen Lock [Tue, 13 Oct 2009 21:29:12 +0000 (23:29 +0200)]
multiboot.S patch for old as(1) (was: Re: [Qemu-devel] Some OpenBSD/amd64 build fixes)

On Wed, Sep 23, 2009 at 10:55:02PM +0200, Juergen Lock wrote:
> On Wed, Sep 23, 2009 at 09:31:16PM +0100, Laurence Tratt wrote:
>[...]
> >  then the above error doesn't occur, but
> > pc-bios/optionrom/multiboot.S dies as follows:
> >
> >   $
> >     AS    optionrom/multiboot.o
> >   multiboot.S: Assembler messages:
> >   multiboot.S:116: Error: `%es:-4(%edi)' is not a valid 16 bit base/index
> > expression
> >   $
> >
> > What little Intel assembler I ever knew has long since departed from my
> > brain, so I don't know why that error occurs, nor what a fix might be.
> >
>  It occurs because of too old binutils (as(1) in this case), on FreeBSD
> we now have a port for newer ones,
>  http://www.freshports.org/devel/binutils
> so I depend on that and have the optionrom Makefile use the new as
> like this: (the first change wrt CFLAGS is unrelated and has probably
> been fixed in the meantime; it caused gmake to complain about
> recursive use of CFLAGS.)
>
> Index: qemu/pc-bios/optionrom/Makefile
> @@ -9,10 +9,13 @@
>
>  CFLAGS = -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
>  CFLAGS += -I$(SRC_PATH)
> -CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector,"")
> +CFLAGS := $(CFLAGS) $(call cc-option, $(CFLAGS), -fno-stack-protector,"")
>
>  build-all: multiboot.bin
>
> +%.o: %.S
> + $(CC) -E $(CFLAGS) -o - -c $< |${LOCALBASE}/bin/as -V -Qy -o $@
> +
>  %.img: %.o
>   $(call quiet-command,$(LD) -Ttext 0 -e _start -s -o $@ $<,"  Building $(TARGET_DIR)$@")
>

That patch didn't seem to help on OpenBSD so I now finally got around
making another one that just emits the bytes of the offending insn
instead so people can keep using old assemblers:

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoraw/linux-aio: Also initialize POSIX AIO
Kevin Wolf [Tue, 20 Oct 2009 09:33:12 +0000 (11:33 +0200)]
raw/linux-aio: Also initialize POSIX AIO

When using Linux AIO raw still falls back to POSIX AIO sometimes, so we should
initialize it.

Not initializing it happens to work if POSIX AIO is used by another drive, or
if the format is not specified (probing the format uses POSIX AIO) or by pure
luck (e.g. it doesn't seem to happen any more with qcow2 since we have re-added
synchronous qcow2 functions).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoqcow2: Fix grow_refcount_table error handling
Kevin Wolf [Thu, 15 Oct 2009 15:31:01 +0000 (17:31 +0200)]
qcow2: Fix grow_refcount_table error handling

In case of failure, we haven't increased the refcount for the newly allocated
cluster yet. Therefore we must not free the cluster or its refcount will become
negative (and endless recursion is possible).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agousb-linux: return USB_RET_STALL on -EPIPE
Paul Bolle [Tue, 13 Oct 2009 11:40:08 +0000 (13:40 +0200)]
usb-linux: return USB_RET_STALL on -EPIPE

0) This is an attempt to get an issue in usb-linux.c, for which a patch
was posted about a year ago, finally fixed.

1) Mark Burkley submitted a "EHCI emulation module" for review in in
October 2008 (see:
http://lists.gnu.org/archive/html/qemu-devel/2008-10/msg01326.html). No
EHCI emulation module was ever committed to qemu.

2) Part of that (large) patch was a fix for a separate issue in
usb-linux.c. Max Krasnyansky has ACK'ed that fix (see:
http://lists.gnu.org/archive/html/qemu-devel/2008-11/msg00032.html).

3) I already asked whether this fix was ready to be committed in last
April (see:
http://lists.gnu.org/archive/html/qemu-devel/2009-04/msg01763.html)

4) Maybe submitting this fix as a separate patch (with a really long
commit message but without a Signed-off-by) and cc-ing everbody involved
will help if actually getting this issue fixed.

Paul Bolle

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoMakefile: Change make to be quiet again when doing nothing
Stefan Weil [Tue, 20 Oct 2009 16:17:23 +0000 (18:17 +0200)]
Makefile: Change make to be quiet again when doing nothing

This patch makes make quiet again.

There is already a similar patch from Juan Quintela,
but maybe this shorter form is preferred.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoeepro100: Restructure code
Stefan Weil [Mon, 19 Oct 2009 19:03:26 +0000 (21:03 +0200)]
eepro100: Restructure code

This patch only moves about 150 lines of code from
function eepro100_cu_command to a new function action_command.

A goto statement was replaced by a for loop.

There are no functional changes. Nor did I change comments
starting with // (they will be removed by future patches).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agotarget-arm: use native tcg-ops for ror/bic/vorn
Aurelien Jarno [Thu, 15 Oct 2009 14:45:14 +0000 (16:45 +0200)]
target-arm: use native tcg-ops for ror/bic/vorn

Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: fix neon shift helper functions
Juha Riihimäki [Mon, 26 Oct 2009 07:01:07 +0000 (09:01 +0200)]
target-arm: fix neon shift helper functions

Current code is broken at least on recent compilers, comparison
between signed and unsigned types yield incorrect code and render
the neon shift helper functions defunct. This is the third revision
of this patch, casting all comparisons with the sizeof operator to
signed ssize_t type to force comparisons to be between signed integral
types.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: fix neon vsri, vshl and vsli ops
Juha Riihimäki [Sat, 24 Oct 2009 12:19:05 +0000 (15:19 +0300)]
target-arm: fix neon vsri, vshl and vsli ops

Shift by immediate value is incorrectly overwritten by a temporary
variable in the processing of NEON vsri, vshl and vsli instructions.
This patch has been revised to also include a fix for the special
case where the code would previously try to shift an integer value
over 31 bits left/right.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: allow modifying vfp fpexc en bit only
Juha Riihimäki [Mon, 26 Oct 2009 09:46:42 +0000 (11:46 +0200)]
target-arm: allow modifying vfp fpexc en bit only

All other bits except for the EN in the VFP FPEXC register are defined
as subarchitecture specific and real functionality for any of the
other bits has not been implemented in QEMU. However, current code
allows modifying all bits in the VFP FPEXC register leading to
problems when guest code is writing 1's to the subarchitecture
specific bits and checking whether the bits stay up to verify the
existence of functionality which in fact does not exist in QEMU.
This patch has been revised to include the same behavior change in
the gdb register write function.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: add support for neon vld1.64/vst1.64 instructions
Juha Riihimäki [Sat, 24 Oct 2009 12:19:01 +0000 (15:19 +0300)]
target-arm: add support for neon vld1.64/vst1.64 instructions

Add support for NEON vld1.64 and vst1.64 instructions. This patch is
revised to follow more closely the specification and raises
undefined exception if 64bit element size is used for vld2/vst2 or
vld4/vst4 instructions.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: fix neon vshrn/vrshrn ops
Juha Riihimäki [Sat, 24 Oct 2009 12:19:00 +0000 (15:19 +0300)]
target-arm: fix neon vshrn/vrshrn ops

In the existing code shift value is clobbered during the pass loop.
This patch changes the code so that it stores the intermediate
result in the target neon register directly and eliminates the need
to use a temporary to hold the intermediate value thus leaving the
shift value in the temporary variable intact. This is a new patch
in this version of the patch series.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: fix incorrect temporary variable freeing
Juha Riihimäki [Mon, 26 Oct 2009 11:02:37 +0000 (13:02 +0200)]
target-arm: fix incorrect temporary variable freeing

tmp4 and tmp5 temporary variables are allocated using tcg_const_i32
but incorrectly released using dead_tmp which will cause resource
leak tracking to report false leaks.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agosparc32: tcx: remove unused include directive
Blue Swirl [Sun, 25 Oct 2009 15:04:43 +0000 (15:04 +0000)]
sparc32: tcx: remove unused include directive

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosparc32: convert sbi to VMState, vmsd and vmstate reset
Blue Swirl [Sat, 24 Oct 2009 20:08:43 +0000 (20:08 +0000)]
sparc32: convert sbi to VMState, vmsd and vmstate reset

Also remove unused include directive.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosparc32: convert Sun4c interrupt controller to reset + vmsd
Blue Swirl [Sat, 24 Oct 2009 19:49:15 +0000 (19:49 +0000)]
sparc32: convert Sun4c interrupt controller to reset + vmsd

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosparc32: convert interrupt controller to reset + vmsd
Blue Swirl [Sat, 24 Oct 2009 19:44:37 +0000 (19:44 +0000)]
sparc32: convert interrupt controller to reset + vmsd

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosparc32: convert IOMMU to reset + vmsd
Blue Swirl [Sat, 24 Oct 2009 19:39:17 +0000 (19:39 +0000)]
sparc32: convert IOMMU to reset + vmsd

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosparc32: convert DMA controller to reset + vmsd, fix reset on init
Blue Swirl [Sat, 24 Oct 2009 19:35:32 +0000 (19:35 +0000)]
sparc32: convert DMA controller to reset + vmsd, fix reset on init

Add a missing call to reset on device init.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agom48t59: convert to vmstate reset
Blue Swirl [Sat, 24 Oct 2009 19:22:56 +0000 (19:22 +0000)]
m48t59: convert to vmstate reset

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosparc32: convert slavio_timer to reset + vmsd
Blue Swirl [Sat, 24 Oct 2009 17:35:13 +0000 (17:35 +0000)]
sparc32: convert slavio_timer to reset + vmsd

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agofdc: convert to reset + vmsd
Blue Swirl [Sat, 24 Oct 2009 16:56:20 +0000 (16:56 +0000)]
fdc: convert to reset + vmsd

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoesp: convert to reset + vmsd
Blue Swirl [Sat, 24 Oct 2009 16:34:21 +0000 (16:34 +0000)]
esp: convert to reset + vmsd

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosparc32: convert cs4231 to VMState, vmsd and reset
Blue Swirl [Sat, 24 Oct 2009 16:20:32 +0000 (16:20 +0000)]
sparc32: convert cs4231 to VMState, vmsd and reset

Also remove unused include directive.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoescc: add chipset docs
Blue Swirl [Sat, 24 Oct 2009 16:09:01 +0000 (16:09 +0000)]
escc: add chipset docs

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoescc: convert to VMState, vmsd and reset
Blue Swirl [Sat, 24 Oct 2009 16:07:10 +0000 (16:07 +0000)]
escc: convert to VMState, vmsd and reset

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosparc32: add chipset docs for eccmemctl
Blue Swirl [Sat, 24 Oct 2009 15:27:28 +0000 (15:27 +0000)]
sparc32: add chipset docs for eccmemctl

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosparc32: convert slavio_misc to reset + vmsd
Blue Swirl [Sat, 24 Oct 2009 15:27:23 +0000 (15:27 +0000)]
sparc32: convert slavio_misc to reset + vmsd

Also remove unused include directive.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosparc32: convert eccmemctl to reset + vmsd
Blue Swirl [Sat, 24 Oct 2009 14:14:39 +0000 (14:14 +0000)]
sparc32: convert eccmemctl to reset + vmsd

Also remove unused include directive.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agosparc64: remove unused variables
Blue Swirl [Sat, 24 Oct 2009 09:15:22 +0000 (09:15 +0000)]
sparc64: remove unused variables

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agotarget-arm: optimize thumb 32-bit multiply
Juha.Riihimaki@nokia.com [Wed, 21 Oct 2009 10:17:38 +0000 (12:17 +0200)]
target-arm: optimize thumb 32-bit multiply

Current implementation of thumb mul instruction is implemented as a
32x32->64 multiply which then uses only 32 least significant bits of
the result. Replace that with a simple 32x32->32 multiply.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: cleanup internal resource leaks
Juha Riihimäki [Thu, 22 Oct 2009 12:17:36 +0000 (15:17 +0300)]
target-arm: cleanup internal resource leaks

Revised patch for getting rid of tcg temporary variable leaks in
target-arm/translate.c. This version also includes the leak patch for
gen_set_cpsr macro, now converted as a static inline function, which I
sent earlier as a separate patch on top of this patch.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-i386: implement lzcnt emulation
Andre Przywara [Fri, 23 Oct 2009 11:44:31 +0000 (13:44 +0200)]
target-i386: implement lzcnt emulation

lzcnt is a AMD Phenom/Barcelona added instruction returning the
number of leading zero bits in a word.
As this is similar to the "bsr" instruction, reuse the existing
code. There need to be some more changes, though, as lzcnt always
returns a valid value (in opposite to bsr, which has a special
case when the operand is 0).
lzcnt is guarded by the ABM CPUID bit (Fn8000_0001:ECX_5).

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-ppc: move often used CPU fields at the top of the structure
Aurelien Jarno [Thu, 22 Oct 2009 12:55:37 +0000 (14:55 +0200)]
target-ppc: move often used CPU fields at the top of the structure

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: fix sdiv helper
Aurelien Jarno [Thu, 15 Oct 2009 21:08:46 +0000 (23:08 +0200)]
target-arm: fix sdiv helper

(INT32_MIN / -1) triggers an overflow, and the result depends on the
host architecture (INT32_MIN on arm, -1 on ppc, SIGFPE on x86). Use a
test to output the correct value.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
15 years agotarget-arm: use clz32() instead of a for loop
Aurelien Jarno [Thu, 15 Oct 2009 21:14:52 +0000 (23:14 +0200)]
target-arm: use clz32() instead of a for loop

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Acked-by: Laurent Desnogues <laurent.desnogues@gmail.com>
15 years agoMerge commit 'linux-user/linux-user-for-upstream' into staging
Anthony Liguori [Wed, 21 Oct 2009 18:36:49 +0000 (13:36 -0500)]
Merge commit 'linux-user/linux-user-for-upstream' into staging

15 years agoqdev: add string property.
Gerd Hoffmann [Mon, 12 Oct 2009 11:45:47 +0000 (17:15 +0530)]
qdev: add string property.

Patchworks-ID: 35755
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agochar: emit the OPENED event only when a new char connection is opened
Amit Shah [Wed, 7 Oct 2009 13:01:17 +0000 (18:31 +0530)]
char: emit the OPENED event only when a new char connection is opened

The OPENED event gets sent also when qemu resets its state initially.
The consumers of the event aren't interested in receiving this event
on reset.

Patchworks-ID: 35288
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agochar: rename CHR_EVENT_RESET to CHR_EVENT_OPENED
Amit Shah [Wed, 7 Oct 2009 13:01:16 +0000 (18:31 +0530)]
char: rename CHR_EVENT_RESET to CHR_EVENT_OPENED

The char event RESET is emitted when a char device is opened.
Give it a better name.

Patchworks-ID: 35287
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agochar: check for initial_reset_issued unnecessary
Amit Shah [Wed, 7 Oct 2009 13:01:15 +0000 (18:31 +0530)]
char: check for initial_reset_issued unnecessary

At init, qemu_chr_reset is always called with initial_reset_issued set to 1.
So checking for it to be set is not necessary.

Patchworks-ID: 35286
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agobsd-user: fix breakage by 78cfb07fe0dc556cae662a0fab5fe1bd33daabdb
Blue Swirl [Sun, 18 Oct 2009 18:44:38 +0000 (18:44 +0000)]
bsd-user: fix breakage by 78cfb07fe0dc556cae662a0fab5fe1bd33daabdb

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agoSuppress warnings about 'warn_unused_result' attribute directive
Blue Swirl [Sun, 18 Oct 2009 16:26:06 +0000 (16:26 +0000)]
Suppress warnings about 'warn_unused_result' attribute directive

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agobsd-user: FreeBSD update
Juergen Lock [Fri, 16 Oct 2009 22:34:26 +0000 (00:34 +0200)]
bsd-user: FreeBSD update

basic FreeBSD sysarch(2) handling
fixed syscall errno return

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agox86: add 'static' to please Sparse
Blue Swirl [Sun, 18 Oct 2009 14:51:10 +0000 (14:51 +0000)]
x86: add 'static' to please Sparse

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agotarget-ppc: simpler definitions for microcontrollers based on e300
Thomas Monjalon [Thu, 15 Oct 2009 17:01:21 +0000 (19:01 +0200)]
target-ppc: simpler definitions for microcontrollers based on e300

No need to alias e300 core for each CPU package.
Differences between microcontrollers have to be implemented in a higher layer
than translate_init.c

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-ppc: add declarations of microcontrollers based on e300
Thomas Monjalon [Thu, 15 Oct 2009 17:01:20 +0000 (19:01 +0200)]
target-ppc: add declarations of microcontrollers based on e300

Add CPU declarations of MPC8343, MPC8343E, MPC8347 and MPC8347E.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-ppc: better support of e300 CPU core
Thomas Monjalon [Thu, 15 Oct 2009 17:01:19 +0000 (19:01 +0200)]
target-ppc: better support of e300 CPU core

Declare HID2 register.

Use high BATs for e300 (8 instead of 4).

Fix index of high BATs registers.
Before the fix, IBAT4-7 were overwriting IBAT0-3.

Signed-off-by: François Armand <francois.armand@os4i.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: fix bugs introduced by 1b2b1e547bd912b7d3c4863d0a0f75f6f38330ed
Aurelien Jarno [Sun, 18 Oct 2009 14:00:18 +0000 (16:00 +0200)]
target-arm: fix bugs introduced by 1b2b1e547bd912b7d3c4863d0a0f75f6f38330ed

Use load_reg_var() instead of accessing cpu_R[rn] directly to generate
correct code when rn = 15.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: fix bugs introduced by 3174f8e91fecf8756e861d1febb049f3c619a2c7
Aurelien Jarno [Sun, 18 Oct 2009 13:53:28 +0000 (15:53 +0200)]
target-arm: fix bugs introduced by 3174f8e91fecf8756e861d1febb049f3c619a2c7

Use load_reg_var() instead of accessing cpu_R[rn] directly to generate
correct code when rn = 15.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: remove T0 and T1
Aurelien Jarno [Fri, 16 Oct 2009 20:46:57 +0000 (22:46 +0200)]
target-arm: remove T0 and T1

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: remove cpu_T for ARM once and for all
Filip Navara [Thu, 15 Oct 2009 12:50:27 +0000 (14:50 +0200)]
target-arm: remove cpu_T for ARM once and for all

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: convert VFP not to use cpu_T
Filip Navara [Thu, 15 Oct 2009 12:48:19 +0000 (14:48 +0200)]
target-arm: convert VFP not to use cpu_T

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: convert disas_iwmmxt_insn not to use cpu_T
Filip Navara [Thu, 15 Oct 2009 12:39:02 +0000 (14:39 +0200)]
target-arm: convert disas_iwmmxt_insn not to use cpu_T

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: convert disas_dsp_insn not use cpu_T
Filip Navara [Thu, 15 Oct 2009 12:38:54 +0000 (14:38 +0200)]
target-arm: convert disas_dsp_insn not use cpu_T

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: convert disas_neon_ls_insn not to use cpu_T
Filip Navara [Thu, 15 Oct 2009 11:07:21 +0000 (13:07 +0200)]
target-arm: convert disas_neon_ls_insn not to use cpu_T

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: convert disas_neon_data_insn and helpers not to use cpu_T
Filip Navara [Thu, 15 Oct 2009 11:07:14 +0000 (13:07 +0200)]
target-arm: convert disas_neon_data_insn and helpers not to use cpu_T

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: convert rest of disas_arm_insn / disas_thumb2_insn not to use cpu_T
Filip Navara [Thu, 15 Oct 2009 11:14:28 +0000 (13:14 +0200)]
target-arm: convert rest of disas_arm_insn / disas_thumb2_insn not to use cpu_T

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: replace thumb usage of cpu_T registers by proper register allocations
Filip Navara [Thu, 15 Oct 2009 10:55:34 +0000 (12:55 +0200)]
target-arm: replace thumb usage of cpu_T registers by proper register allocations

The goal is eventually to get rid of all cpu_T register usage and to use
just short-lived tmp/tmp2 registers. This patch converts all the places where
cpu_T was used in the Thumb code and replaces it with explicit TCG register
allocation.

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: fix TANDC and TORC instructions
Filip Navara [Thu, 15 Oct 2009 10:55:26 +0000 (12:55 +0200)]
target-arm: fix TANDC and TORC instructions

Uninitialized register was used instead of proper TCG variable.

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: convert NEON VZIP/VUZP/VTRN helper functions to pure TCG
Filip Navara [Thu, 15 Oct 2009 10:45:57 +0000 (12:45 +0200)]
target-arm: convert NEON VZIP/VUZP/VTRN helper functions to pure TCG

The neon_trn_u8, neon_trn_u16, neon_unzip_u8, neon_zip_u8 and neon_zip_u16
helpers used fixed registers to return values. This patch replaces that with
TCG code, so T0/T1 is no longer directly used by the helper functions.

Bugs in the gen_neon_unzip register load code were also fixed.

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: convert gen_lookup_tb not to use cpu_T
Filip Navara [Thu, 15 Oct 2009 10:45:48 +0000 (12:45 +0200)]
target-arm: convert gen_lookup_tb not to use cpu_T

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: get rid of gen_set_psr_T0 and replace it by gen_set_psr/gen_set_psr_im
Filip Navara [Thu, 15 Oct 2009 10:43:04 +0000 (12:43 +0200)]
target-arm: get rid of gen_set_psr_T0 and replace it by gen_set_psr/gen_set_psr_im

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: fix SRS/RFE instructions
Filip Navara [Thu, 15 Oct 2009 10:12:11 +0000 (12:12 +0200)]
target-arm: fix SRS/RFE instructions

The encoding of 'IA' and 'DB' conditions was swapped.
SRS instruction must store banked SPSR instead of CPSR at the specific address.
Missing 'return' statement at the end of RFE handling.
Fixed write-back code to reference correct registers.

From: Hyeonsung Jang <hsjang@ok-labs.com>
Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: remove unused gen_movl_T2_reg function
Filip Navara [Thu, 15 Oct 2009 10:11:59 +0000 (12:11 +0200)]
target-arm: remove unused gen_movl_T2_reg function

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: remove useless line that sets register that is never used again
Filip Navara [Thu, 15 Oct 2009 10:08:36 +0000 (12:08 +0200)]
target-arm: remove useless line that sets register that is never used again

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: get rid of temporary variable cache
Filip Navara [Thu, 15 Oct 2009 10:00:48 +0000 (12:00 +0200)]
target-arm: get rid of temporary variable cache

The temporary variable cache in no longer need since tcg_temp_free was introduced.

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agotarget-arm: use tcg_global_mem_new_i32 to allocate registers
Filip Navara [Thu, 15 Oct 2009 10:00:41 +0000 (12:00 +0200)]
target-arm: use tcg_global_mem_new_i32 to allocate registers

Currently each read/write of ARM register involves a LD/ST TCG operation. This
patch uses TCG memory-backed registers to represent the ARM register set. With
memory-backed registers the LD/ST operations are transparently generated by TCG
and host registers could be used to optimize the generated code.

Signed-off-by: Filip Navara <filip.navara@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agoRe: linux-user/syscall.c - don't add GUEST_BASE to NULL pointer
Jan-Simon Möller [Sat, 17 Oct 2009 18:52:43 +0000 (21:52 +0300)]
Re: linux-user/syscall.c - don't add GUEST_BASE to NULL pointer

This patch fixes the mount call. GUEST_BASE shouldn't be added to a NULL pointer on arg5 . failing call:
mount("rootfs", "/", 0x47a78, MS_MGC_VAL|MS_REMOUNT, 0x10000) = -1 EFAULT (Bad address)

correct call:
mount("rootfs", "/", 0x37ab0, MS_MGC_VAL|MS_REMOUNT, NULL) = 0

Signed-off-by:  Jan-Simon Möller  <dl9pf@gmx.de>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
15 years agoOnly IDE needs limits for CHS configuration
Blue Swirl [Sat, 17 Oct 2009 09:08:47 +0000 (09:08 +0000)]
Only IDE needs limits for CHS configuration

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
15 years agolinux-user: KD/VT/FB ioctls
Ulrich Hecht [Fri, 16 Oct 2009 15:00:44 +0000 (17:00 +0200)]
linux-user: KD/VT/FB ioctls

everything needed to run SDL on a framebuffer device in the userspace emulator

Signed-off-by: Ulrich Hecht <uli@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
15 years agolinux-user: Update ARM hwcaps
Riku Voipio [Wed, 30 Sep 2009 08:44:34 +0000 (11:44 +0300)]
linux-user: Update ARM hwcaps

Update ARM hwcaps to match Linux kernel 2.6.31 state

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
15 years agolinux-user: don't zero a buffer twice
Paul Bolle [Fri, 2 Oct 2009 12:10:04 +0000 (14:10 +0200)]
linux-user: don't zero a buffer twice

prepare_binprm() zeroes bprm->buf. That buffer is already zeroed in
main() and hasn't been touched since so that is not necessary.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
15 years agolinux-user: fix ppc target_stat64 st_blocks layout
Max Filippov [Tue, 1 Sep 2009 19:27:47 +0000 (23:27 +0400)]
linux-user: fix ppc target_stat64 st_blocks layout

Swap __pad1 and st_blocks fields location to maintain proper alignment.
This fixes incorrect 'du' and 'stat' report on ppc guest.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
15 years agolinux-user: getpriority errno fix
Ulrich Hecht [Thu, 17 Sep 2009 18:08:37 +0000 (21:08 +0300)]
linux-user: getpriority errno fix

getpriority returned wrong errno; fixes LTP test getpriority02.

Signed-off-by: Ulrich Hecht <uli@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
15 years agoimplementations of dup3 and fallocate that are good enough to fool LTP
Ulrich Hecht [Thu, 17 Sep 2009 17:22:14 +0000 (20:22 +0300)]
implementations of dup3 and fallocate that are good enough to fool LTP

updated fallocate check to new configure, added dup3 check as suggested
by Jan-Simon Möller.

Riku: updated to apply to current git.

Signed-off-by: Ulrich Hecht <uli@suse.de>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
15 years agoMIPS jazz: create isa bus
Roy Tam [Thu, 15 Oct 2009 14:07:12 +0000 (22:07 +0800)]
MIPS jazz: create isa bus

As i8259 in mips_jazz.c is not correctly connected to the isa bus, the
mc146818rtc isa devices fails to be created.

Signed-off-by: Roy Tam <roytam@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
15 years agomultiboot: Limit number of multiboot modules
Adam Lackorzynski [Sun, 11 Oct 2009 13:48:41 +0000 (15:48 +0200)]
multiboot: Limit number of multiboot modules

Add size checks to avoid overwriting the multiboot structure
when too many modules are loaded.

Patchworks-ID: 35700
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agomultiboot: Fix cmdline of modules
Adam Lackorzynski [Sun, 11 Oct 2009 13:48:40 +0000 (15:48 +0200)]
multiboot: Fix cmdline of modules

Fix address specified for cmdline value of module in multiboot structure.

Patchworks-ID: 35699
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoksm support
Izik Eidus [Thu, 8 Oct 2009 14:39:39 +0000 (16:39 +0200)]
ksm support

Call MADV_MERGEABLE on guest memory allocations.  MADV_MERGABLE will be
available starting in Linux 2.6.32.  This system call registers a region of
virtual address space with Linux as a candidate for transparent memory
sharing.

Patchworks-ID: 35447
Signed-off-by: Izik Eidus <ieidus@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agopcnet: Extend hardware reset
Jan Kiszka [Thu, 8 Oct 2009 15:53:53 +0000 (17:53 +0200)]
pcnet: Extend hardware reset

Update the IRQ state and stop the poll timer on reset. Moreover,
register the reset function with qemu.

Patchworks-ID: 35462
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoqcow2: Bring synchronous read/write back to life
Kevin Wolf [Thu, 8 Oct 2009 13:02:08 +0000 (15:02 +0200)]
qcow2: Bring synchronous read/write back to life

When the synchronous read and write functions were dropped, they were replaced
by generic emulation functions. Unfortunately, these emulation functions don't
provide the same semantics as the original functions did.

The original bdrv_read would mean that we read some data synchronously and that
we won't be interrupted during this read. The latter assumption is no longer
true with the emulation function which needs to use qemu_aio_poll and therefore
allows the callback of any other concurrent AIO request to be run during the
read. Which in turn means that (meta)data read earlier could have changed and
be invalid now. qcow2 is not prepared to work in this way and it's just scary
how many places there are where other requests could run.

I'm not sure yet where exactly it breaks, but you'll see breakage with virtio
on qcow2 with a backing file. Providing synchronous functions again fixes the
problem for me.

Patchworks-ID: 35437
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoDocumentation: Move msmouse description to an appropriate place
Kevin Wolf [Fri, 9 Oct 2009 08:58:37 +0000 (10:58 +0200)]
Documentation: Move msmouse description to an appropriate place

Putting it right in the middle of the explanation for "-serial udp" probably
wasn't the best idea.

Patchworks-ID: 35603
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoDocumentation: Add missing tags to placeholders
Kevin Wolf [Fri, 9 Oct 2009 08:58:36 +0000 (10:58 +0200)]
Documentation: Add missing tags to placeholders

Not all placeholders in options descriptions had the @var tag on them. Add the
tag so that it's clearly visible that they are placeholders.

Patchworks-ID: 35602
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agoDocumentation: Highlight placeholders in suboptions
Kevin Wolf [Fri, 9 Oct 2009 08:58:35 +0000 (10:58 +0200)]
Documentation: Highlight placeholders in suboptions

Currently, suboptions (i.e. something like file=file for -drive) are rendered
as @code, so we're losing any @var highlighting in the man pages.

Replace them by @option, so that you actually can see what is a placeholder and
what is meant verbatim.

Patchworks-ID: 35601
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agonet: fix multiple NICs causing net opts process to stop
Mark McLoughlin [Mon, 12 Oct 2009 08:52:00 +0000 (09:52 +0100)]
net: fix multiple NICs causing net opts process to stop

For NICs, net_init_client() returns the index into the NICInfo table.

qemu_opts_foreach() interprets non-zero as an error return an stops
iterating over the options.

So, if you have more than one '-net nic' on the command line, subsequent
'-net' options do not get processed.

Fix this by making net_client_init() only return non-zero if
net_init_client() returns an error.

Reported-by: Peter Lieven <pl@dlh.net>
Patchworks-ID: 35736
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agonet: add queue for peer-to-peer packet forwarding
Mark McLoughlin [Thu, 8 Oct 2009 18:58:32 +0000 (19:58 +0100)]
net: add queue for peer-to-peer packet forwarding

Now that we have re-factored the packet queue code, we can re-use
it for peer-to-peer also.

Patchworks-ID: 35520
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agonet: refactor packet queueing code
Mark McLoughlin [Thu, 8 Oct 2009 18:58:31 +0000 (19:58 +0100)]
net: refactor packet queueing code

The packet queue code is fairly standalone, has some complex details and
easily reusable. It makes sense to split it out on its own. This patch
doesn't contain any functional changes.

Patchworks-ID: 35511
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agonet: allow NICs to be connected to netdevs
Mark McLoughlin [Thu, 8 Oct 2009 18:58:30 +0000 (19:58 +0100)]
net: allow NICs to be connected to netdevs

Introduce a 'peer' member to VLANClientState as an alternative
to a vlan. The idea being that packets are transfered directly
from peer clients rather than going through a vlan.

Patchworks-ID: 35516
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agonet: add -net nic,netdev= option
Mark McLoughlin [Thu, 8 Oct 2009 18:58:29 +0000 (19:58 +0100)]
net: add -net nic,netdev= option

Patchworks-ID: 35515
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
15 years agonet: maintain a list of vlan-less clients
Mark McLoughlin [Thu, 8 Oct 2009 18:58:28 +0000 (19:58 +0100)]
net: maintain a list of vlan-less clients

Allows them to be cleaned up at shutdown.

This is pretty lame, but will eventually go away as we make vlans
the special case.

Patchworks-ID: 35518
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>