OSDN Git Service

qmiga/qemu.git
14 years agousb-bus: fix no params
TeLeMan [Tue, 30 Mar 2010 01:33:24 +0000 (09:33 +0800)]
usb-bus: fix no params

After commit 702f3e0fb52c124c07f215426eeadb70a716643f, the params is
nerver NULL. It should check *params instead of params to determine
whether the params is empty.

Signed-off-by: TeLeMan <geleman@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoUpdate PowerPC OpenBIOS image to r721
Aurelien Jarno [Fri, 2 Apr 2010 08:07:44 +0000 (10:07 +0200)]
Update PowerPC OpenBIOS image to r721

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agowin32: Fix compiler errors from u_int64_t
Stefan Weil [Thu, 1 Apr 2010 21:59:51 +0000 (16:59 -0500)]
win32: Fix compiler errors from u_int64_t

u_int64_t raises compiler error messages:

  CC    libhw32/virtio.o
/qemu/ar7/hw/virtio.c: In function ‘virtio_queue_get_avail_size’:
/qemu/ar7/hw/virtio.c:776: error: ‘u_int64_t’ undeclared (first use in this function)
/qemu/ar7/hw/virtio.c:776: error: (Each undeclared identifier is reported only once
/qemu/ar7/hw/virtio.c:776: error: for each function it appears in.)

Replacing u_int64_t by uint64_t helps.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agotcg/TODO: remove setcond
Aurelien Jarno [Thu, 1 Apr 2010 20:00:41 +0000 (22:00 +0200)]
tcg/TODO: remove setcond

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix compilation with missing inotify_init1
Stefan Weil [Sun, 28 Mar 2010 09:44:41 +0000 (11:44 +0200)]
Fix compilation with missing inotify_init1

Commit c05c7a7306a23a4b01d1606172b142c45caffc92
breaks cross compilation for mips (and other
compilations without CONFIG_INOTIFY1):

make[1]: Entering directory `/qemu/bin/mips'
  CC    i386-linux-user/syscall.o
cc1: warnings being treated as errors
/qemu/linux-user/syscall.c: In function ‘do_syscall’:
/qemu/linux-user/syscall.c:7067: error: implicit declaration of function ‘sys_inotify_init1’

Cc: Riku Voipio <riku.voipio@nokia.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoS390: Tell user why VM creation failed
Alexander Graf [Thu, 1 Apr 2010 16:42:37 +0000 (18:42 +0200)]
S390: Tell user why VM creation failed

The KVM kernel module on S390 refuses to create a VM when the switch_amode
kernel parameter is not used.

Since that is not exactly obvious, let's give the user a nice warning.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoS390: Add stub for cpu_get_phys_page_debug
Alexander Graf [Thu, 1 Apr 2010 16:42:36 +0000 (18:42 +0200)]
S390: Add stub for cpu_get_phys_page_debug

We don't implement any virtual memory in the S390 target so far, so let's
add a stub for this now mandatory function.

Fixes building of S390 target.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: initial ia64 support
Aurelien Jarno [Mon, 29 Mar 2010 00:12:51 +0000 (02:12 +0200)]
tcg: initial ia64 support

A few words about design choices:
* On IA64, instructions should be grouped by bundle, and dependencies
  between instructions declared. A first version of this code tried to
  schedule instructions automatically, but was very complex and too
  invasive for the current common TCG code (ops not ending at
  instruction boundaries, code retranslation breaking already generated
  code, etc.)  It was also not very efficient, as dependencies between
  TCG ops is not available.
  Instead the option taken by the current implementation does not try
  to fill the bundle by scheduling instructions, but by providing ops
  not available as an ia64 instruction, and by offering 22-bit constant
  loading for most of the instructions. With both options the bundle are
  filled at approximately the same level.

* Up to 128 registers can be affected to a function on IA64, but TCG
  limits this number to 64, which is actually more than enough. The
  register affectation is the following:
  - r0: used to map a constant argument with value 0
  - r1: global pointer
  - r2, r3: internal use
  - r4 to r6: not used to avoid saving them
  - r7: env structure
  - r8 to r11: free for TCG (call clobbered)
  - r12: stack pointer
  - r13: thread pointer
  - r14 to r31: free for TCG (call clobbered)
  - r32: reserved (return address)
  - r33: reserved (PFS)
  - r33 to r63: free for TCG

* The IA64 architecture has only 64-bit registers and no 32-bit
  instructions (the only exception being cmp4). Therefore 64-bit
  registers and instructions are used for 32-bit ops. The adopted
  strategy is the same as the ABI, that is the higher 32 bits are
  undefined. Most ops (and, or, add, shl, etc.) can directly use
  the 64-bit registers, while some others have to sign-extend (sar,
  div, etc.) or zero-extend (shr, divu, etc.) the register first.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: align static_code_gen_buffer to CODE_GEN_ALIGN
Aurelien Jarno [Mon, 29 Mar 2010 00:12:51 +0000 (02:12 +0200)]
tcg: align static_code_gen_buffer to CODE_GEN_ALIGN

On ia64, the default memory alignement is not enough for a code
alignement. To fix that, force static_code_gen_buffer alignment
to CODE_GEN_ALIGN.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoia64 disas support
Aurelien Jarno [Mon, 29 Mar 2010 00:12:51 +0000 (02:12 +0200)]
ia64 disas support

Taken from binutils SVN, using last GPLv2 version.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agolinux-user: fix page_unprotect when host page size > target page size
Aurelien Jarno [Mon, 29 Mar 2010 00:12:51 +0000 (02:12 +0200)]
linux-user: fix page_unprotect when host page size > target page size

When the host page size is bigger that the target one, unprotecting a
page should:
- mark all the target pages corresponding to the host page as writable
- invalidate all tb corresponding to the host page (and not the target
  page)

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agolinux-user/ia64: workaround ia64 strangenesses
Aurelien Jarno [Mon, 29 Mar 2010 00:12:51 +0000 (02:12 +0200)]
linux-user/ia64: workaround ia64 strangenesses

ia64 has some strangenesses that need to be workaround:
- it has a __clone2() syscall instead of the using clone() one, with
  different arguments, and which is not declared in the usual headers.
- ucontext.uc_sigmask is declared with type long int, while it is
  actually of type sigset_t.
- uc_mcontext, uc_sigmask, uc_stack, uc_link are declared using #define,
  which clashes with the target_ucontext fields. Change their names to
  tuc_*, as already done for some target architectures.

14 years agovirtio-net: vhost net support
Michael S. Tsirkin [Wed, 17 Mar 2010 11:08:42 +0000 (13:08 +0200)]
virtio-net: vhost net support

This connects virtio-net to vhost net backend.
The code is structured in a way analogous to what we have with vnet
header capability in tap.

We start/stop backend on driver start/stop as
well as on save and vm start (for migration).

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agotap: add API to retrieve vhost net header
Michael S. Tsirkin [Wed, 17 Mar 2010 11:08:38 +0000 (13:08 +0200)]
tap: add API to retrieve vhost net header

will be used by virtio-net for vhost net support

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agotap: add vhost/vhostfd options
Michael S. Tsirkin [Wed, 17 Mar 2010 11:08:24 +0000 (13:08 +0200)]
tap: add vhost/vhostfd options

This adds vhost binary option to tap, to enable vhost net accelerator.
Default is off for now, we'll be able to make default on long term
when we know it's stable.

vhostfd option can be used by management, to pass in the fd. Assigning
vhostfd implies vhost=on.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovhost: vhost net support
Michael S. Tsirkin [Wed, 17 Mar 2010 11:08:17 +0000 (13:08 +0200)]
vhost: vhost net support

This adds vhost net device support in qemu. Will be tied to tap device
and virtio by following patches.  Raw backend is currently missing,
will be worked on/submitted separately.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-pci: fill in notifier support
Michael S. Tsirkin [Wed, 17 Mar 2010 11:08:13 +0000 (13:08 +0200)]
virtio-pci: fill in notifier support

Support host/guest notifiers in virtio-pci.
The last one only with kvm, that's okay
because vhost relies on kvm anyway.

Note on kvm usage: kvm ioeventfd API
is implemented on non-kvm systems as well,
this is the reason we don't need if (kvm_enabled())
around it.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio: move typedef to qemu-common
Michael S. Tsirkin [Wed, 17 Mar 2010 11:08:10 +0000 (13:08 +0200)]
virtio: move typedef to qemu-common

make it possible to use type without header include,
simplifying header dependencies.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio: add set_status callback
Michael S. Tsirkin [Wed, 17 Mar 2010 11:08:05 +0000 (13:08 +0200)]
virtio: add set_status callback

vhost net backend needs to be notified when
frontend status changes. Add a callback,
similar to set_features.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio: notifier support + APIs for queue fields
Michael S. Tsirkin [Wed, 17 Mar 2010 11:08:02 +0000 (13:08 +0200)]
virtio: notifier support + APIs for queue fields

vhost needs physical addresses for ring and other queue fields,
so add APIs for these. In particular, add binding API to set
host/guest notifiers.  Will be used by vhost.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agonotifier: event notifier implementation
Michael S. Tsirkin [Wed, 17 Mar 2010 11:07:58 +0000 (13:07 +0200)]
notifier: event notifier implementation

event notifiers are slightly generalized eventfd descriptors. Current
implementation depends on eventfd because vhost is the only user, and
vhost depends on eventfd anyway, but a stub is provided for non-eventfd
case.

We'll be able to further generalize this when another user comes along
and we see how to best do this.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agokvm: add API to set ioeventfd
Michael S. Tsirkin [Wed, 17 Mar 2010 11:07:54 +0000 (13:07 +0200)]
kvm: add API to set ioeventfd

Comment on kvm usage: rather than require users to do if (kvm_enabled())
and/or ifdefs, this patch adds an API that, internally, is defined to
stub function on non-kvm build, and checks kvm_enabled for non-kvm
run.

While rest of qemu code still uses if (kvm_enabled()), I think this
approach is cleaner, and we should convert rest of code to it
long term.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agotap: add interface to get device fd
Michael S. Tsirkin [Wed, 17 Mar 2010 11:07:50 +0000 (13:07 +0200)]
tap: add interface to get device fd

Will be used by vhost to attach/detach to backend.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agovirtio-pci: compile per-target
Anthony Liguori [Wed, 31 Mar 2010 16:52:44 +0000 (11:52 -0500)]
virtio-pci: compile per-target

With vhost, virtio-pci needs to include kvm.h and kvm.h needs to be built
per-target.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoFix -enable-kvm
Anthony Liguori [Thu, 1 Apr 2010 13:33:06 +0000 (08:33 -0500)]
Fix -enable-kvm

Make vl.o compiled per target and fix a thinko in hw/acpi.c.  It's not trivial
to make kvm.h consumable by compiled-once files.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoRestore terminal monitor attributes - addition
Shahar Havivi [Sun, 14 Mar 2010 20:41:15 +0000 (22:41 +0200)]
Restore terminal monitor attributes - addition

Patch 2d753894c7553d6a05e8fdbed5f4704398919a35 was missing this check,
when running monitor as /dev/tty and other serial device, i.e:
  qemu -monitor /dev/tty -serial /dev/pts/1

Without this patch any serial device will override the monitor stored
attributes. (monitor is called in main() before any serial device).

Signed-off-by: Shahar Havivi <shaharh@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoDon't check for bus master for old guests
Alexander Graf [Tue, 16 Mar 2010 18:18:07 +0000 (19:18 +0100)]
Don't check for bus master for old guests

Older Linux guests don't activate the bus master enable bit. So for those we
can just try to be clever and track if they set the DEVICE_OK bit even though
bus mastering is still disabled.

Under that condition we can disable the windows safety check. With that logic
in place both guests should work just fine. Without PCI hotplug breaks
virtio-net in Linux < 2.6.34 guests.

Signed-off-by: Alexander Graf <agraf@suse.de>
CC: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agousb: class specific interface requests
Max Reitz [Sun, 14 Mar 2010 11:19:03 +0000 (12:19 +0100)]
usb: class specific interface requests

Mass Storage Reset and Get Max LUN are class specific requests, but
they were not marked as such in hw/usb-msd.c, moved therefore
ClassInterfaceRequest and ClassInterfaceOutRequest from hw/usb-net.c
to hw/usb.h.
Furthermore there was a problem in hw/usb-ohci.c when using DEBUG
concerning systems where size_t is a 32 bit integer (printf resulted
in a segmentation fault).

Signed-off-by: Max Reitz <max@tyndur.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
14 years agoAdd missing #include needed for madvise() on OpenBSD
Blue Swirl [Tue, 30 Mar 2010 19:27:34 +0000 (19:27 +0000)]
Add missing #include needed for madvise() on OpenBSD

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix i386-bsd-user build
Blue Swirl [Tue, 30 Mar 2010 18:24:49 +0000 (18:24 +0000)]
Fix i386-bsd-user build

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoGet bsd-user host page protection code working on FreeBSD hosts
Juergen Lock [Thu, 25 Mar 2010 21:32:16 +0000 (22:32 +0100)]
Get bsd-user host page protection code working on FreeBSD hosts

Use kinfo_getvmmap(3) on FeeBSD >= 7.x and /compat/linux/proc on older
FreeBSD.  (kinfo_getvmmap is preferred since /compat/linux/proc is
usually only mounted on hosts also using the Linuxolator.)

This patch is a bit hacky because the includes needed for kinfo_getvmmap
conflict with other definitions in exec.c by default so I had to `trick
around' a little, but I built the result in FreeBSD 6.4-stable and
7.2-stable tbs and on 8-stable on the host so the hacks at least
should be stable.  (If this is a problem maybe we could also move the
kinfo_getvmmap invocations into a seperate source file but that would
be more work...)

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix bsd-user qemu_vmalloc() host page protection code
Juergen Lock [Thu, 25 Mar 2010 21:11:17 +0000 (22:11 +0100)]
Fix bsd-user qemu_vmalloc() host page protection code

Just do the same as linux-user does.

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix some compilation warnings on FreeBSD hosts
Juergen Lock [Thu, 25 Mar 2010 21:34:00 +0000 (22:34 +0100)]
Fix some compilation warnings on FreeBSD hosts

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoUse sysctl instead of /proc to find executable path on FreeBSD
Juergen Lock [Thu, 25 Mar 2010 21:07:12 +0000 (22:07 +0100)]
Use sysctl instead of /proc to find executable path on FreeBSD

..since /proc usually isn't mounted on FreeBSD.

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCompile most PPC devices only once
Blue Swirl [Tue, 30 Mar 2010 17:36:23 +0000 (17:36 +0000)]
Compile most PPC devices only once

Make byte swapping unconditional since PPC is big endian.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCompile prep_pci only once
Blue Swirl [Mon, 29 Mar 2010 19:24:04 +0000 (19:24 +0000)]
Compile prep_pci only once

Make byte swapping unconditional since PPC is big endian.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCompile qemu-timer only once
Blue Swirl [Mon, 29 Mar 2010 19:24:00 +0000 (19:24 +0000)]
Compile qemu-timer only once

Arrange various declarations so that also non-CPU code can access
them, adjust users.

Move CPU specific code to cpus.c.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCompile openpic only once
Blue Swirl [Mon, 29 Mar 2010 19:23:59 +0000 (19:23 +0000)]
Compile openpic only once

Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditional
since PPC is big endian.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCompile ide/macio only once
Blue Swirl [Mon, 29 Mar 2010 19:23:57 +0000 (19:23 +0000)]
Compile ide/macio only once

Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditional
since PPC is big endian.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCompile pflash_cfi01 only once
Blue Swirl [Mon, 29 Mar 2010 19:23:56 +0000 (19:23 +0000)]
Compile pflash_cfi01 only once

Push TARGET_WORDS_BIGENDIAN dependency to board level.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCompile pflash_cfi02 only once
Blue Swirl [Mon, 29 Mar 2010 19:23:55 +0000 (19:23 +0000)]
Compile pflash_cfi02 only once

Push TARGET_WORDS_BIGENDIAN dependency to board level.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCompile acpi only once
Blue Swirl [Mon, 29 Mar 2010 19:23:52 +0000 (19:23 +0000)]
Compile acpi only once

Use qemu_irqs to trigger CMOS S3 and SMI events.

Avoid using kvm.h, which uses CPUState.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoRefactor target specific handling, compile vl.c only once
Blue Swirl [Mon, 29 Mar 2010 19:23:52 +0000 (19:23 +0000)]
Refactor target specific handling, compile vl.c only once

Move target specific functions and RAM handling to arch_init.c.

Add a flag to QEMUOptions structure to indicate for which
architectures the option is allowed, check the flag
in run time and remove conditional code in option handling.

Now that no target dependencies remain, compile vl.c only once
for all targets.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoRefactor CPUState handling out of vl.c
Blue Swirl [Mon, 29 Mar 2010 19:23:50 +0000 (19:23 +0000)]
Refactor CPUState handling out of vl.c

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoRefactor a few architecture dependent pieces in vl.c
Blue Swirl [Mon, 29 Mar 2010 19:23:50 +0000 (19:23 +0000)]
Refactor a few architecture dependent pieces in vl.c

These will be moved later.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoMove KVM and Xen global flags to vl.c
Blue Swirl [Mon, 29 Mar 2010 19:23:49 +0000 (19:23 +0000)]
Move KVM and Xen global flags to vl.c

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoMove cpu_exec_init_all() declaration to qemu-common.h
Blue Swirl [Mon, 29 Mar 2010 19:23:48 +0000 (19:23 +0000)]
Move cpu_exec_init_all() declaration to qemu-common.h

Let cpu_exec_init_all() be called from non-CPU code.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoAllow various header files to be included from non-CPU code
Blue Swirl [Mon, 29 Mar 2010 19:23:47 +0000 (19:23 +0000)]
Allow various header files to be included from non-CPU code

Allow balloon.h, gdbstub.h and kvm.h to be included from
non-CPU code.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoAdjust debug handling
Blue Swirl [Mon, 29 Mar 2010 19:23:46 +0000 (19:23 +0000)]
Adjust debug handling

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotcg/mips: fix branch offset during retranslation
Aurelien Jarno [Mon, 29 Mar 2010 00:09:23 +0000 (02:09 +0200)]
tcg/mips: fix branch offset during retranslation

Branch offsets should only be overwritten during relocation, to support
partial retranslation.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoexec: remove dead code
Aurelien Jarno [Sun, 28 Mar 2010 16:47:25 +0000 (18:47 +0200)]
exec: remove dead code

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agolinux-user/ppc: use the Linux register layout
Rob Landley [Sun, 28 Mar 2010 14:51:43 +0000 (16:51 +0200)]
linux-user/ppc: use the Linux register layout

The dynamic linker converts the Linux layout to the AIX layout and is
reentrant so it won't do it a second time if it's already been
converted. In short it work just fine with either register layout.

OTOH, statically linked binaries expect a Linux layout.

Remove code converting the Linux layout to AIX layout so that all
binaries are presented the Linux Layout.

Signed-off-by: Rob Landley <rob@landley.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoqemu-io: fix aio help texts
Christoph Hellwig [Sun, 28 Mar 2010 10:19:31 +0000 (12:19 +0200)]
qemu-io: fix aio help texts

Fix a few typos in the help texts for the various aio commands.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg/arm: Replace qemu_ld32u (left over from previous commit)
Stefan Weil [Sun, 28 Mar 2010 09:44:29 +0000 (11:44 +0200)]
tcg/arm: Replace qemu_ld32u (left over from previous commit)

Commit 86feb1c860dc38e9c89e787c5210e8191800385e
did not change all occurrences of INDEX_op_qemu_ld32u
for tcg/arm.

Please note that I could not test this patch
(I have currently no arm system available).

Cc: Richard Henderson <rth@twiddle.net>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix driftfix option
Blue Swirl [Sat, 27 Mar 2010 21:33:46 +0000 (21:33 +0000)]
Fix driftfix option

Based on patch by Zachary Amsden.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix BSD and win32 builds
Blue Swirl [Sat, 27 Mar 2010 18:41:08 +0000 (18:41 +0000)]
Fix BSD and win32 builds

  CC    net/tap-bsd.o
/src/qemu/net/tap-bsd.c: In function `tap_open':
/src/qemu/net/tap-bsd.c:93: warning: implicit declaration of function `error_report'

  CC    sparc-softmmu/../net/tap-win32.o
cc1: warnings being treated as errors
/src/qemu/target-sparc/../net/tap-win32.c: In function 'net_init_tap':
/src/qemu/target-sparc/../net/tap-win32.c:709: warning: implicit declaration of function 'error_report'

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoRefactor numa mode setting
Blue Swirl [Sat, 27 Mar 2010 18:24:45 +0000 (18:24 +0000)]
Refactor numa mode setting

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agopflash_cfi02: fix incorrect TARGET_FMT_lx/d use
Blue Swirl [Sat, 27 Mar 2010 18:24:35 +0000 (18:24 +0000)]
pflash_cfi02: fix incorrect TARGET_FMT_lx/d use

Also use target_phys_addr_t for addresses.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCompile vmware_vga only once
Blue Swirl [Sat, 27 Mar 2010 18:18:17 +0000 (18:18 +0000)]
Compile vmware_vga only once

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotcg-mips: add guest base support
Aurelien Jarno [Sat, 27 Mar 2010 16:31:04 +0000 (17:31 +0100)]
tcg-mips: add guest base support

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg/mips: implement the not_i32 op the same way as gcc
Aurelien Jarno [Sat, 27 Mar 2010 15:50:55 +0000 (16:50 +0100)]
tcg/mips: implement the not_i32 op the same way as gcc

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-mips: implement nor
Aurelien Jarno [Sat, 27 Mar 2010 15:32:55 +0000 (16:32 +0100)]
tcg-mips: implement nor

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agobe more specific in -mem-path error messages
Michael Tokarev [Sat, 27 Mar 2010 13:35:37 +0000 (16:35 +0300)]
be more specific in -mem-path error messages

Signed-Off-By: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoAdd a missing #include for FreeBSD hosts
Juergen Lock [Thu, 25 Mar 2010 21:35:03 +0000 (22:35 +0100)]
Add a missing #include for FreeBSD hosts

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoerror: Move qerror_report() from qemu-error.[ch] to qerror.[ch]
Markus Armbruster [Mon, 22 Mar 2010 09:29:05 +0000 (10:29 +0100)]
error: Move qerror_report() from qemu-error.[ch] to qerror.[ch]

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoerror: Link qemu-img, qemu-nbd, qemu-io with qemu-error.o
Markus Armbruster [Mon, 22 Mar 2010 09:29:04 +0000 (10:29 +0100)]
error: Link qemu-img, qemu-nbd, qemu-io with qemu-error.o

The location tracking interface is used by code shared with qemi-img,
qemu-nbd and qemu-io, so it needs to be available there.  Commit
827b0813 provides it in a rather hamfisted way: it adds a dummy
implementation to qemu-tool.c.

It's cleaner to provide the real thing, and put a few more dummy
monitor functions into qemu-tool.c.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoerror: Make use of error_set_progname() optional
Markus Armbruster [Mon, 22 Mar 2010 09:29:03 +0000 (10:29 +0100)]
error: Make use of error_set_progname() optional

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoerror: Trim includes after "Infrastructure to track locations..."
Markus Armbruster [Mon, 22 Mar 2010 09:29:02 +0000 (10:29 +0100)]
error: Trim includes after "Infrastructure to track locations..."

Missed in commit 827b0813.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoerror: Trim includes in qerror.c
Markus Armbruster [Mon, 22 Mar 2010 09:29:01 +0000 (10:29 +0100)]
error: Trim includes in qerror.c

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoerror: Trim includes after "Move qemu_error & friends..."
Markus Armbruster [Mon, 22 Mar 2010 09:29:00 +0000 (10:29 +0100)]
error: Trim includes after "Move qemu_error & friends..."

Missed in commit 2f792016.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agolinux-user: Use RLIMIT_STACK for default stack size.
Richard Henderson [Fri, 19 Mar 2010 21:21:13 +0000 (14:21 -0700)]
linux-user: Use RLIMIT_STACK for default stack size.

The current default stack limit of 512kB is far too small; a fair
number of gcc testsuite failures (for all guests) are directly
attributable to this.  Using the -s option in every invocation of
the emulator is annoying to say the least.

A reasonable compromise seems to be to honor the system rlimit.
At least on two Linux distributions, this is set to 8MB and 10MB
respectively.  If the system does not limit the stack, then we're
no worse off than before.

At the same time, rename the variable from x86_stack_size and
change the ultimate fallback size from 512kB to 8MB.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-arm: disable PAGE_EXEC for XN pages
Rabin Vincent [Fri, 19 Mar 2010 20:58:03 +0000 (02:28 +0530)]
target-arm: disable PAGE_EXEC for XN pages

Don't set PAGE_EXEC for XN pages, to avoid a bypass of XN protection
checking if the page is already in the TLB.

Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agofix race between timer firing vs. alarm_timer->pending = 0
Paolo Bonzini [Fri, 19 Mar 2010 10:30:35 +0000 (11:30 +0100)]
fix race between timer firing vs. alarm_timer->pending = 0

The period for Win32 timers is very short and always the same
independent of dynticks, so it's possible that the timer fires
before qemu_run_all_timers has reset alarm_timer->pending to zero.
Reset alarm_timer->pending before rearming.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoqemu-io: Fix return value handling of bdrv_open
Ryota Ozaki [Sat, 20 Mar 2010 07:08:38 +0000 (16:08 +0900)]
qemu-io: Fix return value handling of bdrv_open

bdrv_open may return -errno so we have to check
if the return value is '< 0', not '== -1'.

Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoqemu-nbd: Fix invalid usage of the first argument of errx
Ryota Ozaki [Sat, 20 Mar 2010 06:23:23 +0000 (15:23 +0900)]
qemu-nbd: Fix invalid usage of the first argument of errx

errx takes the exit status of a process as the first
argument. Passing errno to it is wrong. Instead the
patch lets errx take EXIT_FAILURE.

Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoqemu-nbd: Fix return value handling of bdrv_open
Ryota Ozaki [Sat, 20 Mar 2010 06:23:22 +0000 (15:23 +0900)]
qemu-nbd: Fix return value handling of bdrv_open

bdrv_open may return -errno so we have to check
if the return value is '< 0', not '== -1'.

Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoballoon: Fix overflow when reporting actual memory size
Adam Litke [Thu, 25 Mar 2010 13:58:17 +0000 (08:58 -0500)]
balloon: Fix overflow when reporting actual memory size

Beginning with its introduction, the virtio balloon has had an overflow error
that causes 'info balloon' to misreport the actual memory size when the balloon
itself becomes larger than 4G.  Use a cast when converting dev->actual from
pages to kB to prevent overflows.

Before:
(qemu) info balloon
balloon: actual=5120
(qemu) balloon 1025
(qemu) info balloon
balloon: actual=1025
(qemu) balloon 1024
(qemu) info balloon
balloon: actual=5120

After:
(qemu) info balloon
balloon: actual=5120
(qemu) balloon 1025
(qemu) info balloon
balloon: actual=1025
(qemu) balloon 1024
(qemu) info balloon
balloon: actual=1024

Signed-off-by: Adam Litke <agl@us.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agojson-parser: Output the content of invalid keyword
Amos Kong [Wed, 24 Mar 2010 15:12:05 +0000 (23:12 +0800)]
json-parser: Output the content of invalid keyword

When input some invalid word 'unknowcmd' through QMP port, qemu outputs
this error message:
  "parse error: invalid keyword `%s'"

This patch makes qemu output the content of invalid keyword, like:

  "parse error: invalid keyword `unknowcmd'"

Signed-off-by: Amos Kong <akong@redhat.com>
Acked-by: Richard Henderson <rth@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoraw-posix: Better error return values for hdev_create
Kevin Wolf [Fri, 12 Mar 2010 12:52:31 +0000 (13:52 +0100)]
raw-posix: Better error return values for hdev_create

Now that we output an error message according to the returned error code in
qemu-img, let's return the real error codes. "Input/output error" for
everything isn't helpful.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoqemu-options.hx: fix a typo
Aurelien Jarno [Sat, 27 Mar 2010 10:52:05 +0000 (11:52 +0100)]
qemu-options.hx: fix a typo

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoCompile some MIPS devices only once
Blue Swirl [Sat, 27 Mar 2010 07:26:16 +0000 (07:26 +0000)]
Compile some MIPS devices only once

Move CPU specific declarations to a separate file.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoFix build
Blue Swirl [Sat, 27 Mar 2010 06:58:53 +0000 (06:58 +0000)]
Fix build

Actually some systems don't define PAGE_SIZE. Fixes build breakage
by f7736b91c40a617e93505e32dcbd2cb56aad8a23.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agoCompile ide/core only once
Blue Swirl [Sat, 27 Mar 2010 06:20:53 +0000 (06:20 +0000)]
Compile ide/core only once

Make win2k install hack unconditional as it is still restricted to
x86 only in vl.c.

Replace TARGET_PAGE_SIZE and 4096 with PAGE_SIZE.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 years agotarget-s390: Don't compile in virtio-pci
Alexander Graf [Thu, 25 Mar 2010 13:59:02 +0000 (14:59 +0100)]
target-s390: Don't compile in virtio-pci

As soon as virtio-pci.c gets compiled and used on S390 the internal qdev magic
gets confused and tries to give us PCI devices instead of S390 virtio devices.

Since we don't have PCI on S390, we can safely not compile virtio-pci at all.

In order to do this I added a new config option "CONFIG_VIRTIO_PCI" that I
enabled for every platform except S390. Thanks to this the change should be a
complete nop for every other platform.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-ppc: generic PowerPC TBL
Dmitry Ilyevsky [Fri, 26 Mar 2010 00:25:36 +0000 (03:25 +0300)]
target-ppc: generic PowerPC TBL

Time base SPRs TBL/TBU should be accessible in user/priv modes for reading
as specified in POWER ISA documentation. Therefore SPRs permissions were
changed in gen_tbl function.

Signed-off-by: Dmitry Ilyevsky <ilyevsky@gmail.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: Disambiguate qemu_ld32u with 32-bit and 64-bit outputs.
Richard Henderson [Fri, 19 Mar 2010 19:00:26 +0000 (12:00 -0700)]
tcg: Disambiguate qemu_ld32u with 32-bit and 64-bit outputs.

Some targets (e.g. Alpha and MIPS64) need to keep 32-bit operands
sign-extended in 64-bit registers (regardless of the "real" sign
of the operand).  For that, we need to be able to distinguish
between a 32-bit load with a 32-bit result and a 32-bit load with
a given extension to a 64-bit result.  This distinction already
exists for the ld* loads, but not the qemu_ld* loads.

Reserve qemu_ld32u for 64-bit outputs and introduce qemu_ld32 for
32-bit outputs.  Adjust all code generators to match.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: Allow target-specific implementation of NOR.
Richard Henderson [Fri, 19 Mar 2010 20:08:56 +0000 (13:08 -0700)]
tcg: Allow target-specific implementation of NOR.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: Allow target-specific implementation of NAND.
Richard Henderson [Fri, 19 Mar 2010 20:03:58 +0000 (13:03 -0700)]
tcg: Allow target-specific implementation of NAND.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: Allow target-specific implementation of EQV.
Richard Henderson [Fri, 19 Mar 2010 20:02:02 +0000 (13:02 -0700)]
tcg: Allow target-specific implementation of EQV.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: Use not_i32 to implement not_i64.
Richard Henderson [Fri, 19 Mar 2010 19:44:47 +0000 (12:44 -0700)]
tcg: Use not_i32 to implement not_i64.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: Change TCGType to an enumeration.
Richard Henderson [Fri, 19 Mar 2010 18:36:30 +0000 (11:36 -0700)]
tcg: Change TCGType to an enumeration.

The TCGType name was already used consistently.  Changing it
to an enumeration instead of a set of defines aids debugging.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: Use TCGCond where appropriate.
Richard Henderson [Fri, 19 Mar 2010 18:26:05 +0000 (11:26 -0700)]
tcg: Use TCGCond where appropriate.

Use the TCGCond enumeration type in the brcond and setcond
related prototypes in tcg-op.h and each code generator.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg: Name the opcode enumeration.
Richard Henderson [Fri, 19 Mar 2010 18:12:29 +0000 (11:12 -0700)]
tcg: Name the opcode enumeration.

Give the enumeration formed from tcg-opc.h a name: TCGOpcode.
Use that enumeration type instead of "int" whereever appropriate.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoremove remaining occurrences AREG[1-9] and TCG_AREG[1-9]
Paolo Bonzini [Fri, 19 Mar 2010 10:31:15 +0000 (11:31 +0100)]
remove remaining occurrences AREG[1-9] and TCG_AREG[1-9]

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agolinux-user: Add the syscall id for pselect6 on ARM
Michael Casadevall [Fri, 26 Mar 2010 15:25:10 +0000 (15:25 +0000)]
linux-user: Add the syscall id for pselect6 on ARM

As this is now supported in newer linux kernels.

Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com>
Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agolinux-user: add inotify_init1 syscall support
Riku Voipio [Fri, 26 Mar 2010 15:25:11 +0000 (15:25 +0000)]
linux-user: add inotify_init1 syscall support

New syscall which gets actively used when you have a
fresh kernel.

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotarget-arm: Fix handling of AL condition in IT instruction
Johan Bengtsson [Wed, 17 Mar 2010 12:56:07 +0000 (13:56 +0100)]
target-arm: Fix handling of AL condition in IT instruction

Do not try to insert a conditional jump over next instruction when the
condition code is AL as this will trigger an internal error.

Signed-off-by: Johan Bengtsson <teofrastius@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-hppa: Fix 64-bit argument ordering
Richard Henderson [Sat, 20 Feb 2010 19:32:23 +0000 (11:32 -0800)]
tcg-hppa: Fix 64-bit argument ordering

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agotcg-hppa: Fix const errors in hppa-dis.c
Richard Henderson [Sat, 20 Feb 2010 19:31:31 +0000 (11:31 -0800)]
tcg-hppa: Fix const errors in hppa-dis.c

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
14 years agoFix bsd-user broken by commit b5ec5ce0e39d6e7ea707d5604a5f6d567dfd2f48
Juergen Lock [Mon, 22 Mar 2010 18:12:43 +0000 (19:12 +0100)]
Fix bsd-user broken by commit b5ec5ce0e39d6e7ea707d5604a5f6d567dfd2f48

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>