sdk/emulator/qemu.git
12 years agokvm: Add support for direct MSI injections
Jan Kiszka [Wed, 16 May 2012 18:41:14 +0000 (15:41 -0300)]
kvm: Add support for direct MSI injections

If the kernel supports KVM_SIGNAL_MSI, we can avoid the route-based
MSI injection mechanism.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
12 years agokvm: Update kernel headers
Jan Kiszka [Wed, 16 May 2012 18:41:13 +0000 (15:41 -0300)]
kvm: Update kernel headers

Corresponding kvm.git hash: f2569053e0

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
12 years agokvm: x86: Wire up MSI support for in-kernel irqchip
Jan Kiszka [Wed, 16 May 2012 18:41:12 +0000 (15:41 -0300)]
kvm: x86: Wire up MSI support for in-kernel irqchip

Catch writes to the MSI MMIO region in the KVM APIC and forward them to
the kernel. Provide the kernel support GSI routing, this allows to
enable MSI support also for in-kernel irqchip mode.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
12 years agopc: Enable MSI support at APIC level
Jan Kiszka [Wed, 16 May 2012 18:41:11 +0000 (15:41 -0300)]
pc: Enable MSI support at APIC level

Push msi_supported enabling to the APIC implementations where we can
encapsulate the decision more cleanly, hiding the details from the
generic code.

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
12 years agokvm: Introduce basic MSI support for in-kernel irqchips
Jan Kiszka [Wed, 16 May 2012 18:41:10 +0000 (15:41 -0300)]
kvm: Introduce basic MSI support for in-kernel irqchips

This patch basically adds kvm_irqchip_send_msi, a service for sending
arbitrary MSI messages to KVM's in-kernel irqchip models.

As the original KVM API requires us to establish a static route from a
pseudo GSI to the target MSI message and inject the MSI via toggling
that virtual IRQ, we need to play some tricks to make this interface
transparent. We create those routes on demand and keep them in a hash
table. Succeeding messages can then search for an existing route in the
table first and reuse it whenever possible. If we should run out of
limited GSIs, we simply flush the table and rebuild it as messages are
sent.

This approach is rather simple and could be optimized further. However,
latest kernels contains a more efficient MSI injection interface that
will obsolete the GSI-based dynamic injection.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
12 years agoIntroduce MSIMessage structure
Jan Kiszka [Wed, 16 May 2012 18:41:09 +0000 (15:41 -0300)]
Introduce MSIMessage structure

Will be used for generating and distributing MSI messages, both in
emulation mode and under KVM.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
12 years agokvm: Refactor KVMState::max_gsi to gsi_count
Jan Kiszka [Wed, 16 May 2012 18:41:08 +0000 (15:41 -0300)]
kvm: Refactor KVMState::max_gsi to gsi_count

Instead of the bitmap size, store the maximum of GSIs the kernel
support. Move the GSI limit assertion to the API function
kvm_irqchip_add_route and make it stricter.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
12 years agokvm: Fix dirty tracking with large kernel page size
David Gibson [Wed, 4 Apr 2012 01:15:54 +0000 (11:15 +1000)]
kvm: Fix dirty tracking with large kernel page size

If the kernel page size is larger than TARGET_PAGE_SIZE, which
happens for example on ppc64 with kernels compiled for 64K pages,
the dirty tracking doesn't work.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Avi Kivity <avi@redhat.com>
12 years agofix build with pulseaudio versions older than 0.9.11
Gerd Hoffmann [Thu, 3 May 2012 20:41:28 +0000 (22:41 +0200)]
fix build with pulseaudio versions older than 0.9.11

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
12 years agoBail out if CONFIG_TCG_PASS_AREG0 is defined
malc [Thu, 3 May 2012 11:48:49 +0000 (15:48 +0400)]
Bail out if CONFIG_TCG_PASS_AREG0 is defined

Signed-off-by: malc <av1474@comtv.ru>
12 years agoRestore consistent formatting
malc [Thu, 3 May 2012 11:47:39 +0000 (15:47 +0400)]
Restore consistent formatting

Signed-off-by: malc <av1474@comtv.ru>
12 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Wed, 2 May 2012 19:49:53 +0000 (14:49 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

* kwolf/for-anthony:
  ATA: Allow WIN_SECURITY_FREEZE_LOCK as nop
  rbd: add discard support
  qcow2: fix the return value -ENOENT -> -EEXIST
  qcow2: Don't hold cache references across yield
  qcow2: Remove unused parameter in do_alloc_cluster_offset
  qemu-iotests: Many parallel allocating I/O requests
  docs: fix one issue in qcow2 specs
  block/qcow2: Add missing GCC_FMT_ATTR to function report_unsupported()
  qemu-iotests: ignore fragmentation information for qed

12 years agoATA: Allow WIN_SECURITY_FREEZE_LOCK as nop
Alexander Graf [Thu, 26 Apr 2012 10:45:07 +0000 (12:45 +0200)]
ATA: Allow WIN_SECURITY_FREEZE_LOCK as nop

When using Windows 8 with an AHCI disk drive, it issues a blue screen.
The reason is that WIN_SECURITY_FREEZE_LOCK / CFA_WEAR_LEVEL is not
supported by our ATA implementation, but Windows expects it to be there.

Since without security stuff implemented, the lock would be a nop anyway
and CFA_WEAR_LEVEL already is treated as a nop, let's just allow the cmd
for HD drives as well. That way Windows is happy.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agorbd: add discard support
Josh Durgin [Tue, 1 May 2012 06:16:45 +0000 (23:16 -0700)]
rbd: add discard support

Change the write flag to an operation type in RBDAIOCB, and make the
buffer optional since discard doesn't use it.

Discard is first included in librbd 0.1.2 (which is in Ceph 0.46).
If librbd is too old, leave out qemu_rbd_aio_discard entirely,
so the old behavior is preserved.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqcow2: fix the return value -ENOENT -> -EEXIST
Zhi Yong Wu [Thu, 26 Apr 2012 08:11:37 +0000 (16:11 +0800)]
qcow2: fix the return value -ENOENT -> -EEXIST

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqcow2: Don't hold cache references across yield
Kevin Wolf [Tue, 24 Apr 2012 14:10:56 +0000 (16:10 +0200)]
qcow2: Don't hold cache references across yield

If cache references are held while the coroutine has yielded, the cache
may get used up and abort() when it can't find a free entry.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqcow2: Remove unused parameter in do_alloc_cluster_offset
Kevin Wolf [Tue, 24 Apr 2012 14:10:03 +0000 (16:10 +0200)]
qcow2: Remove unused parameter in do_alloc_cluster_offset

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-iotests: Many parallel allocating I/O requests
Kevin Wolf [Tue, 24 Apr 2012 14:30:23 +0000 (16:30 +0200)]
qemu-iotests: Many parallel allocating I/O requests

This test case manages to let qcow2 abort because its cache is used up
and it can't find free cache entries for new requests any more.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agodocs: fix one issue in qcow2 specs
Zhi Yong Wu [Tue, 24 Apr 2012 07:11:27 +0000 (15:11 +0800)]
docs: fix one issue in qcow2 specs

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoblock/qcow2: Add missing GCC_FMT_ATTR to function report_unsupported()
Stefan Weil [Mon, 23 Apr 2012 20:54:38 +0000 (22:54 +0200)]
block/qcow2: Add missing GCC_FMT_ATTR to function report_unsupported()

Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoqemu-iotests: ignore fragmentation information for qed
Dong Xu Wang [Mon, 23 Apr 2012 09:14:16 +0000 (17:14 +0800)]
qemu-iotests: ignore fragmentation information for qed

We added image fragmentation statistics functions to qemu-img several days
ago, those patches will cause "./check -qed" failed. This patch will ignore
fragmentation statistics information of qed format, and then "./check -qed"
will work.

Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
12 years agoUpdate version for 1.1-rc0 release
Anthony Liguori [Wed, 2 May 2012 12:32:09 +0000 (07:32 -0500)]
Update version for 1.1-rc0 release

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMerge remote-tracking branch 'kiszka/queues/slirp' into staging
Anthony Liguori [Tue, 1 May 2012 23:48:01 +0000 (18:48 -0500)]
Merge remote-tracking branch 'kiszka/queues/slirp' into staging

* kiszka/queues/slirp:
  Declare state directory in smb.conf
  slirp: don't use "smb ports = 0" option

12 years agoMerge remote-tracking branch 'stefanha/tracing' into staging
Anthony Liguori [Tue, 1 May 2012 23:46:52 +0000 (18:46 -0500)]
Merge remote-tracking branch 'stefanha/tracing' into staging

* stefanha/tracing:
  configure: check for supported Python 2.x versions
  tracetool: avoid pkgutil.iter_modules() Python 2.7 function
  tracetool: avoid str.rpartition() Python 2.5 function
  tracetool: use Python 2.4-compatible __import__() arguments
  tracetool: use Python 2.4-compatible exception handling syntax

12 years agoMerge remote-tracking branch 'agraf/s390-for-upstream' into staging
Anthony Liguori [Tue, 1 May 2012 23:46:39 +0000 (18:46 -0500)]
Merge remote-tracking branch 'agraf/s390-for-upstream' into staging

* agraf/s390-for-upstream:
  s390: reset avail and used index on reboot
  S390: dont call system_shutdown on disabled wait
  S390: remove default cdrom, sd-card and floppy support
  S390: support reboot for kvm on s390
  S390: reboot: reset device pages on reboot
  S390: fix error handling on kernel and initrd failures
  S390: fix kernel_commandline handling

12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Tue, 1 May 2012 23:46:19 +0000 (18:46 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

* stefanha/trivial-patches:
  iohandler: Use bool for boolean struct member and remove holes
  async: Use bool for boolean struct members and remove a hole
  configure: Fix creation of symbolic links for MinGW toolchain

12 years agoMerge remote-tracking branch 'agraf/ppc-for-upstream' into staging
Anthony Liguori [Tue, 1 May 2012 23:46:05 +0000 (18:46 -0500)]
Merge remote-tracking branch 'agraf/ppc-for-upstream' into staging

* agraf/ppc-for-upstream:
  linux-user: Fix invalid TARGET_ABI_BITS usage on ppc hosts
  target-ppc: Some support for dumping TLB_EMB TLBs
  ppce500_spin: Replace assert by hw_error (fixes compiler warning)
  pseries: Fix use of global CPU state
  pseries: Use the same interrupt swizzling for host bridges as p2p bridges
  pseries: Implement automatic PAPR VIO address allocation
  PPC: Fix up e500 cache size setting
  booke:Use MMU API for creating initial mapping for secondary cpus

12 years agoMerge remote-tracking branch 'mdroth/qga-pull-4-27-12' into staging
Anthony Liguori [Tue, 1 May 2012 23:44:03 +0000 (18:44 -0500)]
Merge remote-tracking branch 'mdroth/qga-pull-4-27-12' into staging

* mdroth/qga-pull-4-27-12:
  qemu-ga: persist tracking of fsfreeze state via filesystem
  qemu-ga: add a whitelist for fsfreeze-safe commands
  qemu-ga: improve recovery options for fsfreeze

12 years agoDeclare state directory in smb.conf
Nikolaus Rath [Wed, 25 Apr 2012 13:57:19 +0000 (09:57 -0400)]
Declare state directory in smb.conf

The smb.conf generated by the userspace networking does not include a state directory
directive. Samba therefore falls back to the default value. Since the user generally
does not have write access to this path, smbd immediately crashes.

The "state directory" option was added in Samba 3.4.0 (commit
http://gitweb.samba.org/?p=samba.git;a=commit;h=7b02e05eb64f3ffd7aa1cf027d10a7343c0da757).

This patch adds the missing option.

Signed-off-by: Nikolaus Rath <Nikolaus@rath.org>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agoslirp: don't use "smb ports = 0" option
Nikolaus Rath [Wed, 25 Apr 2012 22:51:27 +0000 (18:51 -0400)]
slirp: don't use "smb ports = 0" option

The "smb ports = 0" option causes recent samba versions to crash. It was
introduced in commit 157777ef3e with log message "Samba 3 support".
However, a value of 0 has never been officially supported by smb and is
also not necessary: if stdin is a socket, smb does not try to listen on
any ports and uses just stdin. This is necessary to support inetd based
operation (otherwise smbd would always fail when called from inetd,
because inetd already listens on the SMB port). Since samba has
supported inetd operation since pre-3.x, it should be safe to rely on
this feature. I have tested it with Samba 3.6.4 -- communication works
fine, and smbd is not listening on any ports.

I suspect the "smb ports = 0" hack may have been introduced when someone
tested the qemu generated samba config from the command line with "smbd
-i" and found it to fail (because then stdin isn't a socket).

Signed-off-by: Nikolaus Rath <Nikolaus@rath.org>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
12 years agolinux-user: Fix invalid TARGET_ABI_BITS usage on ppc hosts
Alexander Graf [Mon, 30 Apr 2012 22:58:55 +0000 (22:58 +0000)]
linux-user: Fix invalid TARGET_ABI_BITS usage on ppc hosts

When trying to evaluate the size of the _host_ type size for olddev_t,
we need to expose the host's pointer size, not the guest pointer size.

This usage got introduced accidently in commit b754e4fc1.

Fix things by not using TARGET_.*, but rather use host sizeof()
information, which gives us the correct size.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agotarget-ppc: Some support for dumping TLB_EMB TLBs
François Revol [Tue, 24 Apr 2012 06:48:34 +0000 (06:48 +0000)]
target-ppc: Some support for dumping TLB_EMB TLBs

Add mmubooke_dump_mmu().

TODO: Add printing of individual flags.

Signed-off-by: François Revol <revol@free.fr>
[agraf: fix coding style]
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agoppce500_spin: Replace assert by hw_error (fixes compiler warning)
Stefan Weil [Sat, 28 Apr 2012 15:52:31 +0000 (17:52 +0200)]
ppce500_spin: Replace assert by hw_error (fixes compiler warning)

The default case in function spin_read should never be reached,
therefore the old code used assert(0) to abort QEMU.

This does not work when QEMU is compiled with macro NDEBUG defined.
In this case (and also when the compiler does not know that assert
never returns), there is a compiler warning because of the missing
return value.

Using hw_error allows an improved error message and aborts always.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
[agraf: use __func__]
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agopseries: Fix use of global CPU state
Peter Portante [Mon, 23 Apr 2012 07:27:56 +0000 (07:27 +0000)]
pseries: Fix use of global CPU state

Commit ed120055c7f9b26b5707d3ceabbe5a3f06aaf937 (Implement PAPR VPA
functions for pSeries shared processor partitions) introduced the
deregister_dtl() function and typo "emv" as name of its argument.
This went unnoticed because the code in that function can access the
global variable "env" so that no build failure resulted.

Fix the argument to read "env". Resolves LP#986241.

Signed-off-by: Peter Portante <peter.portante@redhat.com>
Acked-by: Andreas Färber <afaerber@suse.de>
[agraf: fixed typo in commit message]
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agopseries: Use the same interrupt swizzling for host bridges as p2p bridges
David Gibson [Wed, 25 Apr 2012 17:55:42 +0000 (17:55 +0000)]
pseries: Use the same interrupt swizzling for host bridges as p2p bridges

Currently the pseries PCI code uses a somewhat strange scheme of PCI irq
allocation - one per slot up to a maximum that's greater than the usual 4.
This scheme more or less worked, because we were able to tell the guest the
irq mapping in the device tree, however it's a bit odd and may break
assumptions in the future.  Worse, the array used to construct the dev
tree interrupt map was mis-sized, we got away with it only because it
happened that our SPAPR_PCI_NUM_LSI value was greater than 7.

This patch changes the pseries PCI code to use the same interrupt swizzling
scheme as is standardized for PCI to PCI bridges.  This makes for better
consistency, deals better with any devices which use multiple interrupt
pins and will make life easier in the future when we add passthrough of
what may be either a host bridge or a PCI to PCI bridge.  This won't break
existing guests, because they don't assume a particular mapping scheme for
host bridges, but just follow what we tell them in the device tree (also
updated to match, of course).  This patch also fixes the allocation of the
irq map.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agopseries: Implement automatic PAPR VIO address allocation
David Gibson [Wed, 25 Apr 2012 17:55:41 +0000 (17:55 +0000)]
pseries: Implement automatic PAPR VIO address allocation

PAPR virtual IO (VIO) devices require a unique, but otherwise arbitrary,
"address" used as a token to the hypercalls which manipulate them.

Currently the pseries machine code does an ok job of allocating these
addresses when the legacy -net nic / -serial and so forth options are used
but will fail to allocate them properly when using -device.

Specifically, you can use -device if all addresses are explicitly assigned.
Without explicit assignment, only one VIO device of each type (network,
console, SCSI) will be assigned properly, any further ones will attempt
to take the same address leading to a fatal error.

This patch fixes the situation by adding a proper address allocator to the
VIO "bus" code.  This is used both by -device and the legacy options and
default devices.  Addresses can still be explicitly assigned with -device
options if desired.

This patch changes the (guest visible) numbering of VIO devices, but since
their addresses are discovered using the device tree and already differ
from the numbering found on existing PowerVM systems, this does not break
compatibility.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agoPPC: Fix up e500 cache size setting
Alexander Graf [Thu, 19 Apr 2012 13:34:06 +0000 (15:34 +0200)]
PPC: Fix up e500 cache size setting

When initializing the e500 code, we need to expose its
cache line size for user and system mode, while the mmu
details are only interesting for system emulation.

Split the 2 switch statements apart, allowing us to #ifdef
out the mmu parts for user mode emulation while keeping all
cache information consistent.

Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agobooke:Use MMU API for creating initial mapping for secondary cpus
Bharat Bhushan [Mon, 26 Mar 2012 17:56:46 +0000 (17:56 +0000)]
booke:Use MMU API for creating initial mapping for secondary cpus

Initial Mapping creation for secondary CPU in SMP was missing new MMU API.

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agolinux-user: Fix undefined HOST_LONG_SIZE on PPC hosts
Alexander Graf [Mon, 30 Apr 2012 22:58:55 +0000 (22:58 +0000)]
linux-user: Fix undefined HOST_LONG_SIZE on PPC hosts

On my PPC host, HOST_LONG_SIZE is not defined even after
running configure. Use the normal C way of determining the
long size instead.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: malc <av1474@comtv.ru>
12 years agoRevert "Remove stray HOST_LONG_SIZE"
malc [Tue, 1 May 2012 19:41:08 +0000 (23:41 +0400)]
Revert "Remove stray HOST_LONG_SIZE"

This reverts commit b754e4fc1e8e68af975c545c38ebc3b001ebc98f.

12 years agoconfigure: check for supported Python 2.x versions
Stefan Hajnoczi [Fri, 27 Apr 2012 12:11:39 +0000 (13:11 +0100)]
configure: check for supported Python 2.x versions

The tracetool code requires Python 2.4, which was released in 2004.
Check for a supported Python version so we can give a clear error
message.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotracetool: avoid pkgutil.iter_modules() Python 2.7 function
Stefan Hajnoczi [Mon, 30 Apr 2012 11:00:23 +0000 (12:00 +0100)]
tracetool: avoid pkgutil.iter_modules() Python 2.7 function

The pkgutil.iter_modules() function provides a way to enumerate child
modules.  Unfortunately it's missing in Python <2.7 so we must implement
similar behavior ourselves.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotracetool: avoid str.rpartition() Python 2.5 function
Stefan Hajnoczi [Fri, 27 Apr 2012 14:12:04 +0000 (15:12 +0100)]
tracetool: avoid str.rpartition() Python 2.5 function

The str.rpartition() function is related to str.split() and is used for
splitting strings.  It was introduced in Python 2.5 and therefore cannot
be used in tracetool as Python 2.4 compatibility is required.

Replace the code using str.rsplit().

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotracetool: use Python 2.4-compatible __import__() arguments
Stefan Hajnoczi [Fri, 27 Apr 2012 13:24:41 +0000 (14:24 +0100)]
tracetool: use Python 2.4-compatible __import__() arguments

In Python 2.5 keyword arguments were added to __import__().  Avoid using
them to achieve Python 2.4 compatibility.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agotracetool: use Python 2.4-compatible exception handling syntax
Stefan Hajnoczi [Wed, 25 Apr 2012 09:39:42 +0000 (10:39 +0100)]
tracetool: use Python 2.4-compatible exception handling syntax

The newer "except <exception-type> as <exception>:" syntax is not
supported by Python 2.4, we need to use "except <exception-type>,
<exception>:".

Tested all trace backends with Python 2.4.

Reported-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Reviewed-by: Lluís Vilanova <vilanova@ac.upc.edu>
12 years agos390: reset avail and used index on reboot
Jens Freimann [Thu, 26 Apr 2012 09:03:36 +0000 (09:03 +0000)]
s390: reset avail and used index on reboot

reset the guest vring avail/used idx fields, otherwise it's possible
that old values remain in memory which would cause a reboot to fail
with a "Guest moved used index" message

Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agoS390: dont call system_shutdown on disabled wait
Christian Borntraeger [Sun, 22 Apr 2012 23:52:25 +0000 (23:52 +0000)]
S390: dont call system_shutdown on disabled wait

A disabled wait usually indicates a guest problem. Dont shutdown the
guest to allow guest dumping.
Have some special cases, e.g. a quiesce disabled wait. In that case
we want to shutdown.

Long term solution might be a crashed/panic indication.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agoS390: remove default cdrom, sd-card and floppy support
Einar Lueck [Sun, 22 Apr 2012 23:52:24 +0000 (23:52 +0000)]
S390: remove default cdrom, sd-card and floppy support

This patch simply disables CDROM, SD card and floppy support for the
s390 virtio machine. Without this patch, a default CDROM drive would
get added which has currently no backing on s390.

Signed-off-by: Einar Lueck <elelueck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agoS390: support reboot for kvm on s390
Jens Freimann [Sun, 22 Apr 2012 23:52:23 +0000 (23:52 +0000)]
S390: support reboot for kvm on s390

This patch adds reboot support for s390x-softmmu by calling
the generic reboot support in kvm.

Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agoS390: reboot: reset device pages on reboot
Jens Freimann [Sun, 22 Apr 2012 23:52:21 +0000 (23:52 +0000)]
S390: reboot: reset device pages on reboot

This patch fixes reboot on s390 by resetting the device
page on reboot.

Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agoS390: fix error handling on kernel and initrd failures
Christian Borntraeger [Sun, 22 Apr 2012 23:52:20 +0000 (23:52 +0000)]
S390: fix error handling on kernel and initrd failures

If the user specifies a non-existing or non-accessable kernel or initrd
qemu does not fail, instead it ipls into the system, which then falls
into a program check loop due to the zeroed memory with no kernel.
Lets add some sanity checks.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agoS390: fix kernel_commandline handling
Christian Borntraeger [Sun, 22 Apr 2012 23:52:19 +0000 (23:52 +0000)]
S390: fix kernel_commandline handling

The current handling of kernel parameters is broken. The pointer
is always valid, even if no -kernel or -append is specified.
We must check if the kernel rom address is valid instead,
otherwise qemu might segfault.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
12 years agoRemove stray HOST_LONG_SIZE
malc [Tue, 1 May 2012 14:23:04 +0000 (18:23 +0400)]
Remove stray HOST_LONG_SIZE

Signed-off-by: malc <av1474@comtv.ru>
12 years agopc-bios: update OpenBIOS images
Blue Swirl [Tue, 1 May 2012 10:56:46 +0000 (10:56 +0000)]
pc-bios: update OpenBIOS images

Update OpenBIOS images to SVN r1056.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoconfigure: Add libraries for qemu-ga on Solaris
Andreas Färber [Mon, 30 Apr 2012 16:00:55 +0000 (18:00 +0200)]
configure: Add libraries for qemu-ga on Solaris

Move socket-related Solaris libraries to $solarisnetlibs and use them
for both $LIBS and $libs_qga.

Fixes build on illumos without --disable-guest-agent.

Signed-off-by: Lee Essen <lee.essen@nowonline.co.uk>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoqemu-ga: Implement alternative to O_ASYNC
Andreas Färber [Mon, 30 Apr 2012 16:00:54 +0000 (18:00 +0200)]
qemu-ga: Implement alternative to O_ASYNC

ga_channel_open() was using open flag O_ASYNC for SIGIO-driven I/O.
This breaks on illumos, so fall back to POSIX I_SETSIG ioctl (SIGPOLL).

Signed-off-by: Lee Essen <lee.essen@nowonline.co.uk>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agomain-loop: Calculate poll timeout using timeout argument
Stefan Weil [Sun, 29 Apr 2012 17:15:02 +0000 (19:15 +0200)]
main-loop: Calculate poll timeout using timeout argument

The timeout argument was unused up to now,
but it can be used to reduce the poll_timeout when it is infinite
(negative value) or larger than timeout.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agovga: Don't switch to 1 x 1 character text screen
Stefan Weil [Sat, 28 Apr 2012 19:16:21 +0000 (21:16 +0200)]
vga: Don't switch to 1 x 1 character text screen

Initially, vga_get_text_resolution returns a text resolution of 1 x 1
(vga register values are 0).

This is visible during MIPS Malta boot with SDL. It also occurs with the
i386 or x86_64 system emulation when it runs in single step mode:

QEMU changes the size of the SDL window to the smallest possible value
which is supported by the window manager. As this is not the calculated
size, QEMU switches to scaled mode. When the BIOS or the VGA driver sets
the normal text resolution, the window stays small and displays
microscopic characters.

Ignoring text resolutions of 1 x 1 or less avoids these problems.
A similar workaround already exists for too large resolutions.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agomemory: move functions is_romd and section_addr to memory API
Blue Swirl [Mon, 9 Apr 2012 17:38:52 +0000 (17:38 +0000)]
memory: move functions is_romd and section_addr to memory API

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agocputlb: prepare private memory API for public consumption
Blue Swirl [Sat, 14 Apr 2012 14:56:48 +0000 (14:56 +0000)]
cputlb: prepare private memory API for public consumption

Fold is_ram_rom and is_ram_rom_romd() into callers.

Change is_romd() and section_addr() to take MemoryRegion
instead of MemoryRegionSection for consistency and
use memory_region_ prefix.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agocputlb: move TLB handling to a separate file
Blue Swirl [Mon, 9 Apr 2012 16:50:52 +0000 (16:50 +0000)]
cputlb: move TLB handling to a separate file

Move TLB handling and softmmu code load helpers to cputlb.c,
compile only for softmmu targets.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoexec: prepare for splitting
Blue Swirl [Sat, 21 Apr 2012 13:08:33 +0000 (13:08 +0000)]
exec: prepare for splitting

Make s_cputlb_empty_entry 'const'.

Rename tlb_flush_jmp_cache() to tb_flush_jmp_cache().

Refactor code to add cpu_tlb_reset_dirty_all(),
memory_region_section_get_iotlb() and
memory_region_is_unassigned().

Remove unused cpu_tlb_update_dirty().

Fix coding style in areas to be moved.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMerge branch 'maintainers-up' of git://repo.or.cz/qemu/afaerber
Blue Swirl [Tue, 1 May 2012 09:29:44 +0000 (09:29 +0000)]
Merge branch 'maintainers-up' of git://repo.or.cz/qemu/afaerber

* 'maintainers-up' of git://repo.or.cz/qemu/afaerber:
  MAINTAINERS: Document all stable trees
  MAINTAINERS: Fix SCM tree for virtio-9p
  MAINTAINERS: Indicate type of SCM
  MAINTAINERS: Fix TCI file pattern
  MAINTAINERS: Fix virtio-9p file pattern
  MAINTAINERS: Fix PC file pattern

12 years agoMerge branch 'cocoa-for-upstream' of git://repo.or.cz/qemu/afaerber
Blue Swirl [Tue, 1 May 2012 09:29:23 +0000 (09:29 +0000)]
Merge branch 'cocoa-for-upstream' of git://repo.or.cz/qemu/afaerber

* 'cocoa-for-upstream' of git://repo.or.cz/qemu/afaerber:
  Drop darwin-user
  configure: add '--disable-cocoa' switch
  raw-posix: Do not use CONFIG_COCOA macro

12 years agoMerge branch 'prep-up' of git://repo.or.cz/qemu/afaerber
Blue Swirl [Tue, 1 May 2012 09:28:59 +0000 (09:28 +0000)]
Merge branch 'prep-up' of git://repo.or.cz/qemu/afaerber

* 'prep-up' of git://repo.or.cz/qemu/afaerber:
  prep: Move int-ack register from PReP to Raven PCI emulation
  prep: Initialize PC speaker
  isa: Add isa_bus_from_device() method
  fdc: Parametrize ISA base, IRQ and DMA
  i82378/i82374: Do not create DMA controller twice

12 years agoMerge branch 'qom-cpu-rest.v1' of git://github.com/afaerber/qemu-cpu
Blue Swirl [Tue, 1 May 2012 09:27:53 +0000 (09:27 +0000)]
Merge branch 'qom-cpu-rest.v1' of git://github.com/afaerber/qemu-cpu

* 'qom-cpu-rest.v1' of git://github.com/afaerber/qemu-cpu:
  Makefile: Simplify compilation of target-*/cpu.c
  target-mips: Start QOM'ifying CPU init
  target-mips: QOM'ify CPU
  target-m68k: Add QOM CPU subclasses
  target-m68k: Start QOM'ifying CPU init
  target-m68k: QOM'ify CPU reset
  target-m68k: QOM'ify CPU
  target-sh4: Start QOM'ifying CPU init
  target-sh4: QOM'ify CPU reset
  target-sh4: QOM'ify CPU
  MAINTAINERS: Downgrade target-mips and target-sh4 to Odd Fixes
  MAINTAINERS: Downgrade target-m68k to Odd Fixes

12 years agoiohandler: Use bool for boolean struct member and remove holes
Stefan Weil [Sun, 29 Apr 2012 17:08:46 +0000 (19:08 +0200)]
iohandler: Use bool for boolean struct member and remove holes

Using bool reduces the size of the structure and improves readability.
Two holes in the structure were removed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoasync: Use bool for boolean struct members and remove a hole
Stefan Weil [Sun, 29 Apr 2012 17:08:45 +0000 (19:08 +0200)]
async: Use bool for boolean struct members and remove a hole

Using bool reduces the size of the structure and improves readability.
A hole in the structure was removed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconfigure: Fix creation of symbolic links for MinGW toolchain
Stefan Weil [Mon, 19 Mar 2012 12:20:47 +0000 (13:20 +0100)]
configure: Fix creation of symbolic links for MinGW toolchain

The MinGW toolchain on w32/w64 hosts does not create symbolic links,
but implements 'ln -s' similar to 'cp -r'.

In incremental out of tree builds, this resulted in files which
were not updated when their counterparts in the QEMU source tree
changed. Especially for Makefile* this happened very often.

With this patch, the 'symlinked' files are now always updated for
out of tree builds. Similar code was already used for the symbolic
link of libcacard/Makefile.

The symlink macro always removes the target before it is created
again, therefore the rm command for libcacard/Makefile was redundant
and is removed now.

Macro symlink is also used with directories. To remove them on w32
hosts, a recursive rm is needed.

v2:
Quote arguments in shell function symlink, and also quote any argument
which is passed to symlink and which contains macros. This should reduce
the chance of accidents caused by rm -rf.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoDrop darwin-user
Andreas Färber [Mon, 16 Apr 2012 04:31:11 +0000 (04:31 +0000)]
Drop darwin-user

It's been orphaned, not compiling for a long time and despite Apple's
drop of their Rosetta ppc emulation technology with Mac OS X Lion no one
has stepped up to fix it.

Testing necessary changes wrt QOM'ification thus is impossible, so we
might as well remove it completely.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoconfigure: add '--disable-cocoa' switch
Pavel Borzenkov [Thu, 10 Nov 2011 18:40:07 +0000 (22:40 +0400)]
configure: add '--disable-cocoa' switch

When SDL support is disabled, there is no way to build QEMU without
Cocoa support on MacOS X. This patch adds '--disable-cocoa' switch and
allows to build QEMU without both SDL and Cocoa frontends.

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
[AF: Adapt help output]
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
12 years agoraw-posix: Do not use CONFIG_COCOA macro
Pavel Borzenkov [Thu, 10 Nov 2011 18:40:06 +0000 (22:40 +0400)]
raw-posix: Do not use CONFIG_COCOA macro

Use __APPLE__ and __MACH__ macros instead of CONFIG_COCOA to detect Mac
OS X host. The patch is based on Ben Leslie's patch:
http://patchwork.ozlabs.org/patch/97859/

Signed-off-by: Ben Leslie <benno@benno.id.au>
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
12 years agoprep: Move int-ack register from PReP to Raven PCI emulation
Hervé Poussineau [Sat, 14 Apr 2012 20:48:37 +0000 (22:48 +0200)]
prep: Move int-ack register from PReP to Raven PCI emulation

Register is one byte-wide (as per specification), so there is no need
to specify endianness.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
[AF: Limit access validity to size 1]
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
12 years agoqemu-ga: persist tracking of fsfreeze state via filesystem
Michael Roth [Wed, 18 Apr 2012 21:28:01 +0000 (16:28 -0500)]
qemu-ga: persist tracking of fsfreeze state via filesystem

Currently, qemu-ga may die/get killed/go away for whatever reason after
guest-fsfreeze-freeze has been issued, and before guest-fsfreeze-thaw
has been issued. This means the only way to unfreeze the guest is via
VNC/network/console access, but obtaining that access after-the-fact can
often be very difficult when filesystems are frozen. Logins will almost
always hang, for instance. In many cases the only recourse would be to
reboot the guest without any quiescing of volatile state, which makes
this a corner-case worth giving some attention to.

A likely failsafe for this situation would be to use a watchdog to
restart qemu-ga if it goes away. There are some precautions qemu-ga
needs to take in order to avoid immediately hanging itself on I/O,
however, namely, we must disable logging and defer to processing/creation
of user-specific logfiles, along with creation of the pid file if we're
running as a daemon. We also need to disable non-fsfreeze-safe commands,
as we normally would when processing the guest-fsfreeze-freeze command.

To track when we need to do this in a way that persists between multiple
invocations of qemu-ga, we create a file on the guest filesystem before
issuing the fsfreeze, and delete it when doing the thaw. On qemu-ga
startup, we check for the existance of this file to determine
the need to take the above precautions.

We're forced to do it this way since a more traditional approach such as
reading/writing state to a dedicated state file will cause
access/modification time updates, respectively, both of which will hang
if the file resides on a frozen filesystem. Both can occur even if
relatime is enabled. Checking for file existence will not update the
access time, however, so it's a safe way to check for fsfreeze state.

An actual watchdog-based restart of qemu-ga can itself cause an access
time update that would thus hang the invocation of qemu-ga, but the
logic to workaround that can be handled via the watchdog, so we don't
address that here (for relatime we'd periodically touch the qemu-ga
binary if the file $qga_statedir/qga.state.isfrozen is not present, this
avoids qemu-ga updates or the 1 day relatime threshold causing an
access-time update if we try to respawn qemu-ga shortly after it goes
away)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
12 years agoqemu-ga: add a whitelist for fsfreeze-safe commands
Michael Roth [Wed, 18 Apr 2012 00:01:45 +0000 (19:01 -0500)]
qemu-ga: add a whitelist for fsfreeze-safe commands

Currently we rely on fsfreeze/thaw commands disabling/enabling logging
then having other commands check whether logging is disabled to avoid
executing if they aren't safe for running while a filesystem is frozen.

Instead, have an explicit whitelist of fsfreeze-safe commands, and
consolidate logging and command enablement/disablement into a pair
of helper functions: ga_set_frozen()/ga_unset_frozen()

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
12 years agoqemu-ga: improve recovery options for fsfreeze
Michael Roth [Tue, 17 Apr 2012 00:52:17 +0000 (19:52 -0500)]
qemu-ga: improve recovery options for fsfreeze

guest-fsfreeze-thaw relies on state information obtained from
guest-fsfreeze-freeze to determine what filesystems to unfreeze.
This is unreliable due to the fact that that state does not account
for FIFREEZE being issued by other processes, or previous instances
of qemu-ga. This means in certain situations we cannot thaw
filesystems even with a responsive qemu-ga instance at our disposal.

This patch allows guest-fsfreeze-thaw to be issued unconditionally.
It also adds some additional logic to allow us to thaw filesystems
regardless of how many times the filesystem's "frozen" refcount has
been incremented by any guest processes.

Also, guest-fsfreeze-freeze now operates atomically: on success all
freezable filesystems are frozen, and on error all filesystems are
thawed. The ambiguous "GUEST_FSFREEZE_STATUS_ERROR" state is no
longer entered.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
12 years agoMakefile: Simplify compilation of target-*/cpu.c
Andreas Färber [Mon, 20 Feb 2012 05:28:33 +0000 (06:28 +0100)]
Makefile: Simplify compilation of target-*/cpu.c

All targets except for ppc now have a standalone cpu.c file.

Signed-off-by: Andreas Färber <afaerber@suse.de>
12 years agotarget-mips: Start QOM'ifying CPU init
Andreas Färber [Mon, 16 Apr 2012 00:37:56 +0000 (02:37 +0200)]
target-mips: Start QOM'ifying CPU init

Move code not dependent on mips_def_t from cpu_mips_init() into a
QOM initfn, as a start.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agotarget-mips: QOM'ify CPU
Andreas Färber [Sun, 15 Apr 2012 21:29:19 +0000 (23:29 +0200)]
target-mips: QOM'ify CPU

Embed CPUMIPSState as first member of QOM MIPSCPU.

Let CPUClass::reset() call cpu_state_reset() for now.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Richard Henderson <rth@twiddle.net>
12 years agotarget-m68k: Add QOM CPU subclasses
Andreas Färber [Sun, 15 Apr 2012 01:30:10 +0000 (03:30 +0200)]
target-m68k: Add QOM CPU subclasses

Move code from cpu_m68k_set_model() into model-specific initfns
and inline the remaining parts into cpu_m68k_init().

Let m68k_cpu_list() print CPU classes alphabetically except for "any".

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Laurent Vivier <Laurent@Vivier.EU>
Tested-by: Laurent Vivier <Laurent@Vivier.EU>
12 years agotarget-m68k: Start QOM'ifying CPU init
Andreas Färber [Sat, 14 Apr 2012 23:10:56 +0000 (01:10 +0200)]
target-m68k: Start QOM'ifying CPU init

Move model-independent code from cpu_m68k_init() into a QOM initfn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Laurent Vivier <Laurent@Vivier.EU>
Tested-by: Laurent Vivier <Laurent@Vivier.EU>
12 years agotarget-m68k: QOM'ify CPU reset
Andreas Färber [Sat, 14 Apr 2012 22:59:50 +0000 (00:59 +0200)]
target-m68k: QOM'ify CPU reset

Move code from cpu_state_reset() into QOM m68k_cpu_reset().

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Laurent Vivier <Laurent@Vivier.EU>
Tested-by: Laurent Vivier <Laurent@Vivier.EU>
12 years agotarget-m68k: QOM'ify CPU
Andreas Färber [Sat, 14 Apr 2012 22:35:50 +0000 (00:35 +0200)]
target-m68k: QOM'ify CPU

Embed CPUM68KState as first member of QOM M68kCPU.
Drop cpu_m68k_close() in favor of object_delete().

Let CPUClass::reset() call cpu_state_reset() for now.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Laurent Vivier <Laurent@Vivier.EU>
Tested-by: Laurent Vivier <Laurent@Vivier.EU>
12 years agotarget-sh4: Start QOM'ifying CPU init
Andreas Färber [Fri, 13 Apr 2012 00:32:12 +0000 (02:32 +0200)]
target-sh4: Start QOM'ifying CPU init

Move code from cpu_sh4_init() into a QOM initfn.

Signed-off-by: Andreas Färber <afaerber@suse.de>
12 years agotarget-sh4: QOM'ify CPU reset
Andreas Färber [Fri, 13 Apr 2012 00:16:02 +0000 (02:16 +0200)]
target-sh4: QOM'ify CPU reset

Move code from cpu_state_reset() to QOM superh_cpu_reset().

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
12 years agotarget-sh4: QOM'ify CPU
Andreas Färber [Sat, 11 Feb 2012 16:26:17 +0000 (17:26 +0100)]
target-sh4: QOM'ify CPU

Embed CPUSH4State as first member of SuperHCPU.

Let CPUClass::reset() call cpu_state_reset() for now.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
12 years agoMAINTAINERS: Downgrade target-mips and target-sh4 to Odd Fixes
Andreas Färber [Fri, 13 Apr 2012 16:33:43 +0000 (18:33 +0200)]
MAINTAINERS: Downgrade target-mips and target-sh4 to Odd Fixes

Patches are not being handled, so let's downgrade to Odd Fixes.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Aurélien Jarno <aurelien@aurel32.net>
12 years agoMAINTAINERS: Downgrade target-m68k to Odd Fixes
Andreas Färber [Fri, 13 Apr 2012 16:30:29 +0000 (18:30 +0200)]
MAINTAINERS: Downgrade target-m68k to Odd Fixes

m68k patches are not being handled, so let's downgrade to Odd Fixes.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Paul Brook <paul@codesourcery.com>
12 years agoprep: Initialize PC speaker
Hervé Poussineau [Sat, 14 Apr 2012 20:51:34 +0000 (22:51 +0200)]
prep: Initialize PC speaker

Speaker init has been added in 506b7ddf889312659b36c667f7ae17bc9e909418,
but audio subsystem init was missing.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
12 years agoisa: Add isa_bus_from_device() method
Hervé Poussineau [Sat, 17 Mar 2012 14:39:43 +0000 (15:39 +0100)]
isa: Add isa_bus_from_device() method

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
12 years agofdc: Parametrize ISA base, IRQ and DMA
Hervé Poussineau [Sat, 17 Mar 2012 14:39:44 +0000 (15:39 +0100)]
fdc: Parametrize ISA base, IRQ and DMA

Keep the PC values as defaults but allow to override them for PReP.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
12 years agoi82378/i82374: Do not create DMA controller twice
Hervé Poussineau [Sat, 17 Mar 2012 14:39:41 +0000 (15:39 +0100)]
i82378/i82374: Do not create DMA controller twice

This fixes a crash in PReP emulation when using DMA controller to access
floppy drive.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
12 years agomain-loop: Fix build for w32 and w64
Stefan Weil [Fri, 27 Apr 2012 15:02:08 +0000 (17:02 +0200)]
main-loop: Fix build for w32 and w64

This patch fixes a build regression with MinGW which was introduced by
commit 7c7db75576bd5a31508208f153c5aada64b2c8df.

The 3rd argument of g_main_context_query must point to a gint value.
Using a pointer to an uint32_t value is wrong.

The timeout argument of function os_host_main_loop_wait was never
used for w32 / w64.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoconfigure: Don't build bsd-user on Mac OS X by default
Andreas Färber [Thu, 26 Apr 2012 09:57:39 +0000 (11:57 +0200)]
configure: Don't build bsd-user on Mac OS X by default

Fixes the build when combined with the drop of darwin-user.
Enthusiasts can still try building it using --enable-bsd-user.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Cc: Bernhard Walle <bernhard@bwalle.de>
Tested-by: Bernhard Walle <bernhard@bwalle.de> [Mac OS 10.7.3]
Acked-by: Bernhard Walle <bernhard@bwalle.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agosoftfloat: Replace int16 type with int_fast16_t
Andreas Färber [Wed, 25 Apr 2012 22:15:56 +0000 (00:15 +0200)]
softfloat: Replace int16 type with int_fast16_t

Based on the following Coccinelle patch:

@@
typedef int16, int_fast16_t;
@@
-int16
+int_fast16_t

Avoids a workaround for AIX.

Add typedef for pre-10 Solaris.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: malc <av1474@comtv.ru>
Cc: Ben Taylor <bentaylor.solx86@gmail.com>
Tested-by: Bernhard Walle <bernhard@bwalle.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agosoftfloat: Replace uint16 type with uint_fast16_t
Andreas Färber [Wed, 25 Apr 2012 22:15:55 +0000 (00:15 +0200)]
softfloat: Replace uint16 type with uint_fast16_t

Based on the following Coccinelle patch:

@@
typedef uint16, uint_fast16_t;
@@
-uint16
+uint_fast16_t

Fixes the build of the Cocoa frontend on Mac OS X and avoids a
workaround for AIX.

For pre-10 Solaris include osdep.h.

Reported-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
Reported-by: Rui Carmo <rui.carmo@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Juan Pineda <juan@logician.com>
Cc: malc <av1474@comtv.ru>
Cc: Ben Taylor <bentaylor.solx86@gmail.com>
Tested-by: Bernhard Walle <bernhard@bwalle.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agotarget-mips: Move definition of uint_fast{8, 16}_t to osdep.h
Andreas Färber [Wed, 25 Apr 2012 22:15:54 +0000 (00:15 +0200)]
target-mips: Move definition of uint_fast{8, 16}_t to osdep.h

osdep.h is included via qemu-common.h.

Prepares for use of [u]int_fast*_t types in softfloat code.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Ben Taylor <bentaylor.solx86@gmail.com>
Cc: Aurélien Jarno <aurelien@aurel32.net>
Cc: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Bernhard Walle <bernhard@bwalle.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agosoftfloat: Fix mixups of int and int16
Andreas Färber [Wed, 25 Apr 2012 22:15:53 +0000 (00:15 +0200)]
softfloat: Fix mixups of int and int16

normalizeFloat{32,64}Subnormal() expect the exponent as int16, not int.
This went unnoticed since int16 and uint16 were both typedef'ed to int.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Bernhard Walle <bernhard@bwalle.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMerge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm
Blue Swirl [Sat, 28 Apr 2012 08:57:56 +0000 (08:57 +0000)]
Merge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm

* 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm:
  target-arm: Make SETEND respect bswap_code (BE8) setting
  target-arm: Move A9 config_base_address reset value to ARMCPU
  target-arm: Change cpu_arm_init() return type to ARMCPU

12 years agoMerge branch 'timer' of git://qemu.weilnetz.de/qemu
Blue Swirl [Sat, 28 Apr 2012 08:19:50 +0000 (08:19 +0000)]
Merge branch 'timer' of git://qemu.weilnetz.de/qemu

* 'timer' of git://qemu.weilnetz.de/qemu:
  qemu-timer: Optimize data structures
  qemu-timer: Remove function alarm_has_dynticks
  qemu-timer: Use bool, false, true for boolean values
  qemu-timer: Remove unused function qemu_alarm_pending
  qemu-timer: Remove redundant include statements