]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
8 years agoqcow2: fix condition in is_zero_cluster
Denis V. Lunev [Tue, 17 May 2016 09:15:42 +0000 (12:15 +0300)]
qcow2: fix condition in is_zero_cluster

We should check for (res & BDRV_BLOCK_ZERO) only. The situation when we
will have !(res & BDRV_BLOCK_DATA) and will not have BDRV_BLOCK_ZERO is
not possible for images with bdi.unallocated_blocks_are_zero == true.

For those images where it's false, however, it can happen and we must
not consider the data zeroed then or we would corrupt the image.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoblock: Propagate AioContext change to all children
Max Reitz [Tue, 17 May 2016 11:38:04 +0000 (13:38 +0200)]
block: Propagate AioContext change to all children

Instead of propagating any change of a BDS's AioContext only to its file
and backing children and letting driver-specific code do the rest, just
propagate it to all and drop the thus superfluous implementations of
bdrv_{at,de}tach_aio_context() in Quorum, blkverify and VMDK.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
8 years agoblock: Remove BlockDriverState.blk
Kevin Wolf [Tue, 22 Mar 2016 17:38:44 +0000 (18:38 +0100)]
block: Remove BlockDriverState.blk

This patch removes the remaining users of bs->blk, which will allow us
to have multiple BBs on top of a single BDS. In the meantime, all checks
that are currently in place to prevent the user from creating such
setups can be switched to bdrv_has_blk() instead of accessing BDS.blk.

Future patches can allow them and e.g. enable users to mirror to a block
device that already has a BlockBackend on it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
8 years agoblock: Don't return throttling info in query-named-block-nodes
Kevin Wolf [Tue, 22 Mar 2016 19:20:29 +0000 (20:20 +0100)]
block: Don't return throttling info in query-named-block-nodes

query-named-block-nodes should not return information that is related
to the attached BlockBackend rather than the node itself, so throttling
information needs to be removed from it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
8 years agoblock: Avoid bs->blk in bdrv_next()
Kevin Wolf [Tue, 22 Mar 2016 17:58:50 +0000 (18:58 +0100)]
block: Avoid bs->blk in bdrv_next()

We need to introduce a separate BdrvNextIterator struct that can keep
more state than just the current BDS in order to avoid using the bs->blk
pointer.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
8 years agoblock: Add bdrv_has_blk()
Kevin Wolf [Mon, 29 Feb 2016 09:50:38 +0000 (10:50 +0100)]
block: Add bdrv_has_blk()

In many cases we just want to know whether a BDS has at least one BB
attached, without needing to know the exact BB that is attached. In
contrast to bs->blk, this is still a valid question when more than one
BB can be attached, so just answer it by checking the parents list.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
8 years agoblock: Remove bdrv_aio_multiwrite()
Kevin Wolf [Fri, 26 Feb 2016 12:50:43 +0000 (13:50 +0100)]
block: Remove bdrv_aio_multiwrite()

Since virtio-blk implements request merging itself these days, the only
remaining users are test cases for the function. That doesn't make the
function exactly useful any more.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
8 years agoblockjob: Don't touch BDS iostatus
Kevin Wolf [Mon, 18 Apr 2016 13:14:11 +0000 (15:14 +0200)]
blockjob: Don't touch BDS iostatus

Block jobs don't actually make use of the iostatus for their BDSes, but
they manage a separate block job iostatus. Still, they require that it
is enabled for the source BDS and they enable it automatically for the
target and set the error handling mode - which ends up never being used
by the job.

This patch removes all of the BDS iostatus handling from the block job,
which removes another few bs->blk accesses.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
8 years agoblockjob: Don't set iostatus of target
Kevin Wolf [Mon, 18 Apr 2016 09:36:38 +0000 (11:36 +0200)]
blockjob: Don't set iostatus of target

When block job errors were introduced, we assigned the iostatus of the
target BDS "just in case". The field has never been accessible for the
user because the target isn't listed in query-block.

Before we can allow the user to have a second BlockBackend on the
target, we need to clean this up. If anything, we would want to set the
iostatus for the internal BB of the job (which we can always do later),
but certainly not for a separate BB which the job doesn't even use.

As a nice side effect, this gets us rid of another bs->blk use.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
8 years agoblock: User BdrvChild callback for device name
Kevin Wolf [Fri, 26 Feb 2016 09:22:16 +0000 (10:22 +0100)]
block: User BdrvChild callback for device name

In order to get rid of bs->blk for bdrv_get_device_name() and
bdrv_get_device_or_node_name(), ask all parents for their name and
simply pick the first one.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
8 years agoblock: Use BdrvChild callbacks for change_media/resize
Kevin Wolf [Wed, 24 Feb 2016 14:13:35 +0000 (15:13 +0100)]
block: Use BdrvChild callbacks for change_media/resize

We want to get rid of BlockDriverState.blk in order to allow multiple
BlockBackends per BDS. Converting the device callbacks in block.c (which
assume a single BlockBackend) to per-child callbacks gets us rid of the
first few instances.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
8 years agoblock: Don't check throttled reqs in bdrv_requests_pending()
Kevin Wolf [Tue, 22 Mar 2016 15:11:33 +0000 (16:11 +0100)]
block: Don't check throttled reqs in bdrv_requests_pending()

Checking whether there are throttled requests requires going to the
associated BlockBackend, which we want to avoid.

All users of bdrv_requests_pending() in block/io.c already call
bdrv_parent_drained_begin() first, which restarts all throttled
requests, so no throttled requests can be left here and this is removal
of dead code.

The remaining users (assertions during graph manipulation in block.c)
don't care about requests that are still queued in the BlockBackend and
haven't been issued for a BlockDriverState yet.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoRevert "block: Forbid I/O throttling on nodes with multiple parents for 2.6"
Kevin Wolf [Tue, 5 Apr 2016 09:10:50 +0000 (11:10 +0200)]
Revert "block: Forbid I/O throttling on nodes with multiple parents for 2.6"

This reverts commit 76b223200ef4fb09dd87f0e213159795eb68e7a5.

Now that I/O throttling is fully done on the BlockBackend level, there
is no reason any more to block I/O throttling for nodes with multiple
parents as the parents don't influence each other any more.

Conflicts:
block.c

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: Remove bdrv_move_feature_fields()
Kevin Wolf [Mon, 29 Feb 2016 12:56:21 +0000 (13:56 +0100)]
block: Remove bdrv_move_feature_fields()

bdrv_move_feature_fields() and swap_feature_fields() are empty now, they
can be removed.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: Decouple throttling from BlockDriverState
Kevin Wolf [Tue, 22 Mar 2016 12:00:08 +0000 (13:00 +0100)]
block: Decouple throttling from BlockDriverState

This moves the throttling related part of the BDS life cycle management
to BlockBackend. The throttling group reference is now kept even when no
medium is inserted.

With this commit, throttling isn't disabled and then re-enabled any more
during graph reconfiguration. This fixes the temporary breakage of I/O
throttling when used with live snapshots or block jobs that manipulate
the graph.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock/io: Quiesce parents between drained_begin/end
Kevin Wolf [Wed, 11 May 2016 12:57:23 +0000 (14:57 +0200)]
block/io: Quiesce parents between drained_begin/end

So far, bdrv_parent_drained_begin/end() was called for the duration of
the actual bdrv_drain() at the beginning of a drained section, but we
really should keep parents quiesced until the end of the drained
section.

This does not actually change behaviour at this point because the only
user of the .drained_begin/end BdrvChildRole callback is I/O throttling,
which already doesn't send any new requests after flushing its queue in
.drained_begin. The patch merely removes a trap for future users.

Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: Drain throttling queue with BdrvChild callback
Kevin Wolf [Tue, 22 Mar 2016 11:05:35 +0000 (12:05 +0100)]
block: Drain throttling queue with BdrvChild callback

This removes the last part of I/O throttling from block/io.c and moves
it to the BlockBackend.

Instead of having knowledge about throttling inside io.c, we can call a
BdrvChild callback .drained_begin/end, which happens to drain the
throttled requests for BlockBackend parents.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: Introduce BdrvChild.opaque
Kevin Wolf [Wed, 24 Feb 2016 14:13:35 +0000 (15:13 +0100)]
block: Introduce BdrvChild.opaque

BlockBackends use it to get a back pointer from BdrvChild to
BlockBackend in any BdrvChildRole callbacks.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: Move I/O throttling configuration functions to BlockBackend
Kevin Wolf [Mon, 21 Mar 2016 12:53:52 +0000 (13:53 +0100)]
block: Move I/O throttling configuration functions to BlockBackend

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: Move actual I/O throttling to BlockBackend
Kevin Wolf [Mon, 21 Mar 2016 12:30:30 +0000 (13:30 +0100)]
block: Move actual I/O throttling to BlockBackend

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: Move throttling fields from BDS to BB
Kevin Wolf [Mon, 21 Mar 2016 11:56:44 +0000 (12:56 +0100)]
block: Move throttling fields from BDS to BB

This patch changes where the throttling state is stored (used to be the
BlockDriverState, now it is the BlockBackend), but it doesn't actually
make it a BB level feature yet. For example, throttling is still
disabled when the BDS is detached from the BB.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: Convert throttle_group_get_name() to BlockBackend
Kevin Wolf [Mon, 21 Mar 2016 10:58:21 +0000 (11:58 +0100)]
block: Convert throttle_group_get_name() to BlockBackend

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: throttle-groups: Use BlockBackend pointers internally
Kevin Wolf [Mon, 21 Mar 2016 10:30:57 +0000 (11:30 +0100)]
block: throttle-groups: Use BlockBackend pointers internally

As a first step towards moving I/O throttling to the BlockBackend level,
this patch changes all pointers in struct ThrottleGroup from referencing
a BlockDriverState to referencing a BlockBackend.

This change is valid because we made sure that throttling can only be
enabled on BDSes which have a BB attached.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: Introduce BlockBackendPublic
Kevin Wolf [Mon, 21 Mar 2016 10:27:04 +0000 (11:27 +0100)]
block: Introduce BlockBackendPublic

Some features, like I/O throttling, are implemented outside
block-backend.c, but still want to keep information in BlockBackend,
e.g. list entries that allow keeping a list of BlockBackends.

In order to avoid exposing the whole struct layout in the public header
file, this patch introduces an embedded public struct where such
information can be added and a pair of functions to convert between
BlockBackend and BlockBackendPublic.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agoblock: Make sure throttled BDSes always have a BB
Kevin Wolf [Mon, 21 Mar 2016 09:49:51 +0000 (10:49 +0100)]
block: Make sure throttled BDSes always have a BB

It was already true in principle that a throttled BDS always has a BB
attached, except that the order of operations while attaching or
detaching a BDS to/from a BB wasn't careful enough.

This commit breaks graph manipulations while I/O throttling is enabled.
It would have been possible to keep things working with some temporary
hacks, but quite cumbersome, so it's not worth the hassle. We'll fix
things again in a minute.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
8 years agohw: clean up hw/hw.h includes
Paolo Bonzini [Wed, 16 Mar 2016 09:24:54 +0000 (10:24 +0100)]
hw: clean up hw/hw.h includes

Include qom/object.h and exec/memory.h instead of exec/ioport.h;
exec/ioport.h was almost everywhere required only for those two
includes, not for the content of the header itself.

Remove block/aio.h, everybody is already including it through
another path.

With this change, include/hw/hw.h is freed from qemu-common.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agohw: remove pio_addr_t
Paolo Bonzini [Wed, 16 Mar 2016 09:20:34 +0000 (10:20 +0100)]
hw: remove pio_addr_t

pio_addr_t is almost unused, because these days I/O ports are simply
accessed through the address space.  cpu_{in,out}[bwl] themselves are
almost unused; monitor.c and xen-hvm.c could use address_space_read/write
directly, since they have an integer size at hand.  This leaves qtest as
the only user of those functions.

On the other hand even portio_* functions use this type; the only
interesting use of pio_addr_t thus is include/hw/sysbus.h.  I guess I
could move it there, but I don't see much benefit in that either.  Using
uint32_t is enough and avoids the need to include ioport.h everywhere.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agocpu: move exec-all.h inclusion out of cpu.h
Paolo Bonzini [Tue, 15 Mar 2016 12:18:37 +0000 (13:18 +0100)]
cpu: move exec-all.h inclusion out of cpu.h

exec-all.h contains TCG-specific definitions.  It is not needed outside
TCG-specific files such as translate.c, exec.c or *helper.c.

One generic function had snuck into include/exec/exec-all.h; move it to
include/qom/cpu.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoexec: extract exec/tb-context.h
Paolo Bonzini [Tue, 15 Mar 2016 12:16:36 +0000 (13:16 +0100)]
exec: extract exec/tb-context.h

TCG backends do not need most of exec-all.h; extract what they actually
need to a separate file or move it directly to tcg.h.  The next patch
will stop including exec-all.h from everywhere.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agohw: explicitly include qemu/log.h
Paolo Bonzini [Tue, 15 Dec 2015 12:16:16 +0000 (13:16 +0100)]
hw: explicitly include qemu/log.h

Move the inclusion out of hw/hw.h, most files do not need it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agomips: move CP0 functions out of cpu.h
Paolo Bonzini [Tue, 15 Dec 2015 12:49:17 +0000 (13:49 +0100)]
mips: move CP0 functions out of cpu.h

These are here for historical reasons: they are needed from both gdbstub.c
and op_helper.c, and the latter was compiled with fixed AREG0.  It is
not needed anymore, so uninline them.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoarm: move arm_log_exception into .c file
Paolo Bonzini [Fri, 4 Dec 2015 11:28:03 +0000 (12:28 +0100)]
arm: move arm_log_exception into .c file

Avoid need for qemu/log.h inclusion, and make the function static too.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoqemu-common: push cpu.h inclusion out of qemu-common.h
Paolo Bonzini [Tue, 15 Mar 2016 15:58:45 +0000 (16:58 +0100)]
qemu-common: push cpu.h inclusion out of qemu-common.h

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoacpi: do not use TARGET_PAGE_SIZE
Paolo Bonzini [Thu, 31 Mar 2016 08:56:54 +0000 (10:56 +0200)]
acpi: do not use TARGET_PAGE_SIZE

This is a #define used by the CPU.  NVDIMM can just use 4K
unconditionally.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agos390x: reorganize CSS bits between cpu.h and other headers
Paolo Bonzini [Fri, 4 Dec 2015 11:06:26 +0000 (12:06 +0100)]
s390x: reorganize CSS bits between cpu.h and other headers

Move cpu_inject_* to the only C file where they are used.

Move ioinst.h declarations that need S390CPU to cpu.h, to make
ioinst.h independent of cpu.h.

Move channel declarations that only need SubchDev from cpu.h
to css.h, to make more channel users independent of cpu.h.

Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agodma: do not depend on kvm_enabled()
Paolo Bonzini [Wed, 17 Sep 2014 10:21:29 +0000 (12:21 +0200)]
dma: do not depend on kvm_enabled()

Memory barriers are needed also by Xen and, when the ioeventfd
bugs are fixed, by TCG as well.

sysemu/kvm.h is not anymore needed in sysemu/dma.h, move it to
the actual users.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agogdbstub: remove unnecessary includes from gdbstub-xml.c
Paolo Bonzini [Mon, 25 Aug 2014 14:27:30 +0000 (16:27 +0200)]
gdbstub: remove unnecessary includes from gdbstub-xml.c

gdbstub-xml.c defines a bunch of arrays of strings; there is no
need to include anything.  Keep osdep.h for consistency, but remove
the rest.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoqemu-common: stop including qemu/host-utils.h from qemu-common.h
Paolo Bonzini [Tue, 15 Mar 2016 14:36:13 +0000 (15:36 +0100)]
qemu-common: stop including qemu/host-utils.h from qemu-common.h

Move it to the actual users.  There are some inclusions of
qemu/host-utils.h in headers, but they are all necessary.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoqemu-common: stop including qemu/bswap.h from qemu-common.h
Paolo Bonzini [Tue, 15 Mar 2016 16:22:36 +0000 (17:22 +0100)]
qemu-common: stop including qemu/bswap.h from qemu-common.h

Move it to the actual users.  There are still a few includes of
qemu/bswap.h in headers; removing them is left for future work.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agocpu: move endian-dependent load/store functions to cpu-all.h
Paolo Bonzini [Fri, 27 Jun 2014 06:33:38 +0000 (08:33 +0200)]
cpu: move endian-dependent load/store functions to cpu-all.h

Disentangle cpu-common.h and memory.h from NEED_CPU_H.  Prototypes are
not defined for !NEED_CPU_H, so remove them from poison.h too.  Only
macros need poisoning.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agohw: cannot include hw/hw.h from user emulation
Paolo Bonzini [Fri, 27 Jun 2014 06:40:04 +0000 (08:40 +0200)]
hw: cannot include hw/hw.h from user emulation

All qdev definitions are available from other headers, user-mode
emulation does not need hw/hw.h.

By considering system emulation only, it is simpler to disentangle
hw/hw.h from NEED_CPU_H.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agohw: move CPU state serialization to migration/cpu.h
Paolo Bonzini [Tue, 15 Mar 2016 11:51:18 +0000 (12:51 +0100)]
hw: move CPU state serialization to migration/cpu.h

Remove usage of NEED_CPU_H from hw/hw.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agohw: do not use VMSTATE_*TL
Paolo Bonzini [Fri, 27 Jun 2014 05:58:27 +0000 (07:58 +0200)]
hw: do not use VMSTATE_*TL

Reserve this to CPU state serialization.

Luckily, they were only used by sPAPR devices and these are ppc64
only.  So there is no change to migration format.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoinclude: poison symbols in osdep.h
Paolo Bonzini [Tue, 15 Mar 2016 11:46:10 +0000 (12:46 +0100)]
include: poison symbols in osdep.h

Ensure that all target-independent files ignore poisoned symbols,
and fix the fallout.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoapic: move target-dependent definitions to cpu.h
Paolo Bonzini [Fri, 4 Dec 2015 10:04:13 +0000 (11:04 +0100)]
apic: move target-dependent definitions to cpu.h

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoexplicitly include linux/kvm.h
Paolo Bonzini [Fri, 4 Dec 2015 10:03:51 +0000 (11:03 +0100)]
explicitly include linux/kvm.h

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoexplicitly include hw/qdev-core.h
Paolo Bonzini [Fri, 4 Dec 2015 10:10:27 +0000 (11:10 +0100)]
explicitly include hw/qdev-core.h

exec/cpu-all.h includes qom/cpu.h, which includes hw/qdev-core.h.
Explicit inclusion will keep things working when cpu.h will not be
included indirectly almost everywhere (either directly or through
qemu-common.h).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoexplicitly include qom/cpu.h
Paolo Bonzini [Fri, 4 Dec 2015 10:10:07 +0000 (11:10 +0100)]
explicitly include qom/cpu.h

exec/cpu-all.h includes qom/cpu.h.  Explicit inclusion
will keep things working when cpu.h will not be included
indirectly almost everywhere (either directly or through
qemu-common.h).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoarm: remove useless cpu.h inclusion
Paolo Bonzini [Mon, 25 Aug 2014 16:06:56 +0000 (18:06 +0200)]
arm: remove useless cpu.h inclusion

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoppc: use PowerPCCPU instead of CPUPPCState
Paolo Bonzini [Tue, 15 Mar 2016 13:32:19 +0000 (14:32 +0100)]
ppc: use PowerPCCPU instead of CPUPPCState

This changes a cpu.h dependency for hw/ppc/ppc.h into a cpu-qom.h
dependency.  For it to compile we also need to clean up a few unused
definitions.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agomips: use MIPSCPU instead of CPUMIPSState
Paolo Bonzini [Tue, 15 Mar 2016 13:32:19 +0000 (14:32 +0100)]
mips: use MIPSCPU instead of CPUMIPSState

This changes a cpu.h dependency into a cpu-qom.h dependency.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoalpha: include cpu-qom.h in files that require AlphaCPU
Paolo Bonzini [Tue, 15 Mar 2016 13:32:19 +0000 (14:32 +0100)]
alpha: include cpu-qom.h in files that require AlphaCPU

This will keep things working when cpu.h will not be included
indirectly almost everywhere (either directly or through
qemu-common.h).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agosh4: include cpu-qom.h in files that require SuperHCPU
Paolo Bonzini [Tue, 15 Mar 2016 13:32:19 +0000 (14:32 +0100)]
sh4: include cpu-qom.h in files that require SuperHCPU

This will keep things working when cpu.h will not be included
indirectly almost everywhere (either directly or through
qemu-common.h).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agom68k: include cpu-qom.h in files that require M68KCPU
Paolo Bonzini [Tue, 15 Mar 2016 13:32:19 +0000 (14:32 +0100)]
m68k: include cpu-qom.h in files that require M68KCPU

This will keep things working when cpu.h will not be included
indirectly almost everywhere (either directly or through
qemu-common.h).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoarm: include cpu-qom.h in files that require ARMCPU
Paolo Bonzini [Tue, 15 Mar 2016 13:32:02 +0000 (14:32 +0100)]
arm: include cpu-qom.h in files that require ARMCPU

This will keep things working when cpu.h will not be included
indirectly almost everywhere (either directly or through
qemu-common.h).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-xtensa: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-xtensa: make cpu-qom.h not target specific

Make XtensaCPU an opaque type within cpu-qom.h, and move all definitions
of private methods, as well as all type definitions that require knowledge
of the layout to cpu.h.  Conversely, move all definitions needed to
define a class to cpu-qom.h.  This helps making files independent of
NEED_CPU_H if they only need to pass around CPU pointers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-unicore32: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-unicore32: make cpu-qom.h not target specific

Make UniCore32CPU an opaque type within cpu-qom.h, and move all
definitions of private methods, as well as all type definitions that
require knowledge of the layout to cpu.h.  This helps making files
independent of NEED_CPU_H if they only need to pass around CPU pointers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-tricore: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-tricore: make cpu-qom.h not target specific

Make TriCoreCPU an opaque type within cpu-qom.h, and move all definitions
of private methods, as well as all type definitions that require knowledge
of the layout to cpu.h.  This helps making files independent of NEED_CPU_H
if they only need to pass around CPU pointers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-sparc: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-sparc: make cpu-qom.h not target specific

Make SPARCCPU an opaque type within cpu-qom.h, and move all definitions
of private methods, as well as all type definitions that require knowledge
of the layout to cpu.h.  This helps making files independent of NEED_CPU_H
if they only need to pass around CPU pointers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-sh4: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-sh4: make cpu-qom.h not target specific

Make SuperHCPU an opaque type within cpu-qom.h, and move all definitions
of private methods, as well as all type definitions that require knowledge
of the layout to cpu.h.  This helps making files independent of NEED_CPU_H
if they only need to pass around CPU pointers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-s390x: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-s390x: make cpu-qom.h not target specific

Make S390XCPU an opaque type within cpu-qom.h, and move all definitions
of private methods, as well as all type definitions that require knowledge
of the layout to cpu.h.  This helps making files independent of NEED_CPU_H
if they only need to pass around CPU pointers.

Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-ppc: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-ppc: make cpu-qom.h not target specific

Make PowerPCCPU an opaque type within cpu-qom.h, and move all definitions
of private methods, as well as all type definitions that require knowledge
of the layout to cpu.h.  Conversely, move all definitions needed to define
a class to cpu-qom.h.  This helps making files independent of NEED_CPU_H
if they only need to pass around CPU pointers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-ppc: do not make PowerPCCPUClass depend on target-specific symbols
Paolo Bonzini [Wed, 18 May 2016 11:24:27 +0000 (13:24 +0200)]
target-ppc: do not make PowerPCCPUClass depend on target-specific symbols

Just leave some members in even if they are unused on e.g.
32-bit PPC or user-mode emulation.  This avoids complications
when using PowerPCCPUClass in code that is compiled just
once (because it applies to both 32-bit and 64-bit PPC
for example) but still needs to peek at PPC-specific members.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-ppc: do not use target_ulong in cpu-qom.h
Paolo Bonzini [Tue, 15 Mar 2016 14:12:16 +0000 (15:12 +0100)]
target-ppc: do not use target_ulong in cpu-qom.h

Bring the PowerPCCPUClass handle_mmu_fault method type into line with
the one in CPUClass.

Using vaddr also makes the cpu-qom.h file target independent.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-mips: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-mips: make cpu-qom.h not target specific

Make MIPSCPU an opaque type within cpu-qom.h, and move all definitions of
private methods, as well as all type definitions that require knowledge
of the layout to cpu.h.  This helps making files independent of NEED_CPU_H
if they only need to pass around CPU pointers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-microblaze: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-microblaze: make cpu-qom.h not target specific

Make MicroBlazeCPU an opaque type within cpu-qom.h, and move all
definitions of private methods, as well as all type definitions that
require knowledge of the layout to cpu.h.  This helps making files
independent of NEED_CPU_H if they only need to pass around CPU pointers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-m68k: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-m68k: make cpu-qom.h not target specific

Make M68KCPU an opaque type within cpu-qom.h, and move all definitions of
private methods, as well as all type definitions that require knowledge
of the layout to cpu.h.  This helps making files independent of NEED_CPU_H
if they only need to pass around CPU pointers.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-lm32: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-lm32: make cpu-qom.h not target specific

Make LM32CPU an opaque type within cpu-qom.h, and move all definitions of
private methods, as well as all type definitions that require knowledge
of the layout to cpu.h.  This helps making files independent of NEED_CPU_H
if they only need to pass around CPU pointers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-i386: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-i386: make cpu-qom.h not target specific

Make X86CPU an opaque type within cpu-qom.h, and move all definitions of
private methods, as well as all type definitions that require knowledge
of the layout to cpu.h.  This helps making files independent of NEED_CPU_H
if they only need to pass around CPU pointers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-cris: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-cris: make cpu-qom.h not target specific

Make CRISCPU an opaque type within cpu-qom.h, and move all definitions of
private methods, as well as all type definitions that require knowledge
of the layout to cpu.h.  This helps making files independent of NEED_CPU_H
if they only need to pass around CPU pointers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-arm: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-arm: make cpu-qom.h not target specific

Make ARMCPU an opaque type within cpu-qom.h, and move all definitions of
private methods, as well as all type definitions that require knowledge
of the layout to cpu.h.  This helps making files independent of NEED_CPU_H
if they only need to pass around CPU pointers.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agotarget-alpha: make cpu-qom.h not target specific
Paolo Bonzini [Tue, 15 Mar 2016 12:49:25 +0000 (13:49 +0100)]
target-alpha: make cpu-qom.h not target specific

Make AlphaCPU an opaque type within cpu-qom.h, and move all definitions
of private methods, as well as all type definitions that require knowledge
of the layout to cpu.h.  This helps making files independent of NEED_CPU_H
if they only need to pass around CPU pointers.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agocpu: make cpu-qom.h only include-able from cpu.h
Paolo Bonzini [Tue, 15 Sep 2015 14:00:56 +0000 (16:00 +0200)]
cpu: make cpu-qom.h only include-able from cpu.h

Make cpu-qom.h so that it is only included from cpu.h.  Then there
is no need for it to include cpu.h again.

Later we will make cpu-qom.h target independent and we will _want_
to include it from elsewhere, but for now reduce the number of cases
to handle.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agolog: do not use CONFIG_USER_ONLY
Paolo Bonzini [Fri, 4 Dec 2015 12:12:57 +0000 (13:12 +0100)]
log: do not use CONFIG_USER_ONLY

This decouples logging further from config-target.h

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoinclude: move CPU-related definitions out of qemu-common.h
Paolo Bonzini [Tue, 15 Mar 2016 15:47:38 +0000 (16:47 +0100)]
include: move CPU-related definitions out of qemu-common.h

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agos390x: move .needed functions for subsections to machine.c
Paolo Bonzini [Wed, 18 May 2016 11:08:02 +0000 (13:08 +0200)]
s390x: move .needed functions for subsections to machine.c

These functions are only used when defining subsections, so move
them there.

Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoscripts: add script to build QEMU and analyze inclusions
Paolo Bonzini [Thu, 31 Mar 2016 10:36:43 +0000 (12:36 +0200)]
scripts: add script to build QEMU and analyze inclusions

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
8 years agoMerge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2016-05-18' into...
Peter Maydell [Thu, 19 May 2016 08:27:28 +0000 (09:27 +0100)]
Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2016-05-18' into staging

trivial patches for 2016-05-18

# gpg: Signature made Wed 18 May 2016 13:04:43 BST using RSA key ID A4C3D7DB
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
# gpg:                 aka "Michael Tokarev <mjt@debian.org>"

* remotes/mjt/tags/pull-trivial-patches-2016-05-18:
  Fix some typos found by codespell
  9p: drop unused declaration from coth.h
  smbios: fix typo
  accel: make configure_accelerator return void
  configure: Use uniform description for devel packages
  ipack: Update e-mail address
  util: fix comment typos
  qdict: fix unbounded stack warning for qdict_array_entries
  Fix typo in variable name (found and fixed by codespell)
  vl: fix comment about when parsing cpu definitions
  loader: fix potential memory leak
  remove comment for nonexistent structure member
  s390: remove misleading comment

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8 years agoFix some typos found by codespell
Stefan Weil [Wed, 23 Mar 2016 14:59:57 +0000 (15:59 +0100)]
Fix some typos found by codespell

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years ago9p: drop unused declaration from coth.h
Greg Kurz [Tue, 3 May 2016 08:22:00 +0000 (10:22 +0200)]
9p: drop unused declaration from coth.h

Commit "ebac1202c95a virtio-9p: use QEMU thread pool" dropped function
v9fs_init_worker_threads.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agosmbios: fix typo
Cao jin [Tue, 29 Mar 2016 09:48:44 +0000 (17:48 +0800)]
smbios: fix typo

The spec says: "on paragraph (16-byte) boundaries"

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoaccel: make configure_accelerator return void
Wei Jiangang [Thu, 14 Apr 2016 03:58:02 +0000 (11:58 +0800)]
accel: make configure_accelerator return void

Return the negated value of accel_initialised is meaningless,
and the caller vl doesn't check it.

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoconfigure: Use uniform description for devel packages
Stefan Weil [Fri, 8 Apr 2016 16:11:13 +0000 (18:11 +0200)]
configure: Use uniform description for devel packages

As all other devel packages are written in the form "name devel",
use this form for libcap devel and libattr devel, too.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoipack: Update e-mail address
Alberto Garcia [Tue, 23 Feb 2016 08:44:25 +0000 (10:44 +0200)]
ipack: Update e-mail address

I'm not really using the old one anymore.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoutil: fix comment typos
Wei Jiangang [Mon, 14 Mar 2016 09:58:29 +0000 (17:58 +0800)]
util: fix comment typos

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoqdict: fix unbounded stack warning for qdict_array_entries
Peter Xu [Tue, 22 Mar 2016 02:37:26 +0000 (10:37 +0800)]
qdict: fix unbounded stack warning for qdict_array_entries

Here we use one g_strdup_printf() to replace the two stack allocated
array, considering it's more convenient, safe, and as long as it's
called rarely only when quorum device opens. This will remove the
unbound stack warning when compiling with "-Wstack-usage=1000000".

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoFix typo in variable name (found and fixed by codespell)
Stefan Weil [Mon, 21 Mar 2016 18:21:26 +0000 (19:21 +0100)]
Fix typo in variable name (found and fixed by codespell)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agovl: fix comment about when parsing cpu definitions
Wei Jiangang [Wed, 16 Mar 2016 09:40:40 +0000 (17:40 +0800)]
vl: fix comment about when parsing cpu definitions

machine->init() was replaced with machine_class->init()
in 958db90cd54823c33345000c995453a8c9b7a005.

Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoloader: fix potential memory leak
Cao jin [Wed, 24 Feb 2016 09:12:47 +0000 (17:12 +0800)]
loader: fix potential memory leak

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoremove comment for nonexistent structure member
Cao jin [Thu, 18 Feb 2016 08:18:56 +0000 (16:18 +0800)]
remove comment for nonexistent structure member

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agos390: remove misleading comment
Michael Tokarev [Tue, 16 Feb 2016 06:29:07 +0000 (09:29 +0300)]
s390: remove misleading comment

The comment talks about a non-ELF object while the
example gives ELF object.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
8 years agoMerge remote-tracking branch 'remotes/cohuck/tags/s390x-20160517' into staging
Peter Maydell [Tue, 17 May 2016 15:49:11 +0000 (16:49 +0100)]
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20160517' into staging

First batch of s390x patches for 2.7:
- The new machine for 2.7
- Make use of the runtime instrumentation support introduced in
  the kernel
- Enhance our ipl (boot) process: We can now start from devices
  in subchannel sets > 0 as well. As a bonus, the conversion to
  diag308 in the bios allows us to get rid of the gr7 hack.
- Xiaoqiang Zhao's SCLP qomification patches
- Several fixes in the s390x pci implementation

# gpg: Signature made Tue 17 May 2016 15:35:32 BST using RSA key ID C6F02FAF
# gpg: Good signature from "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"

* remotes/cohuck/tags/s390x-20160517:
  s390x/pci: remove whitespace
  s390x/pci: add length checking for pci sclp handlers
  s390x/pci: enhance mpcifc_service_call
  s390x/pci: fix s390_pci_sclp_deconfigure
  s390x/pci: introduce S390PCIBusDevice.iommu_enabled
  s390x/pci: export pci_dereg_ioat and pci_dereg_irqs
  s390x/pci: separate s390_pcihost_iommu_configure function
  s390x/pci: separate s390_sclp_configure function
  s390x/pci: fix reg_irqs()
  hw/char: QOM'ify sclpconsole.c
  hw/char: QOM'ify sclpconsole-lm.c
  s390x/ipl: Remove redundant usage of gr7
  s390-ccw.img: rebuild image
  pc-bios/s390-ccw: Get device address via diag 308/6
  s390x/ipl: Add ssid field to IplParameterBlock
  s390x/ipl: Provide ipl parameter block
  s390x/ipl: Add type and length checks for IplParameterBlock values
  s390x/ipl: Extend the IplParameterBlock struct
  s390x: enable runtime instrumentation
  s390x: add compat machine for 2.7

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8 years agos390x/pci: remove whitespace
Yi Min Zhao [Mon, 9 May 2016 10:26:44 +0000 (18:26 +0800)]
s390x/pci: remove whitespace

Fix indentation of PciCfgSccb struct.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
8 years agos390x/pci: add length checking for pci sclp handlers
Yi Min Zhao [Wed, 4 May 2016 07:56:53 +0000 (15:56 +0800)]
s390x/pci: add length checking for pci sclp handlers

The configure/deconfigure sclp commands need a SCCB with a length of
at least 16. Indicate in the response code if this is not fulfilled.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
8 years agos390x/pci: enhance mpcifc_service_call
Yi Min Zhao [Thu, 28 Apr 2016 05:24:07 +0000 (13:24 +0800)]
s390x/pci: enhance mpcifc_service_call

Enhance error handling for mpcifc_service_call() to propagate errors
to guest by setting status codes or triggering program interrupts.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
8 years agos390x/pci: fix s390_pci_sclp_deconfigure
Yi Min Zhao [Thu, 28 Apr 2016 05:22:51 +0000 (13:22 +0800)]
s390x/pci: fix s390_pci_sclp_deconfigure

When deconfiguring a s390 pci device, we should deconfigure the
corresponding IOMMU memory region and the IRQs for the device.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
8 years agos390x/pci: introduce S390PCIBusDevice.iommu_enabled
Yi Min Zhao [Wed, 4 May 2016 07:07:11 +0000 (15:07 +0800)]
s390x/pci: introduce S390PCIBusDevice.iommu_enabled

We introduce iommu_enabled field for S390PCIBusDevice struct to
track whether the iommu has been enabled for the device. This allows
us to stop temporarily changing ->configured while en/disabling the
iommu and to do conditional cleanup later.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
8 years agos390x/pci: export pci_dereg_ioat and pci_dereg_irqs
Yi Min Zhao [Tue, 26 Apr 2016 06:50:16 +0000 (14:50 +0800)]
s390x/pci: export pci_dereg_ioat and pci_dereg_irqs

dereg_irqs and dereg_ioat are needed by external functions. Let's
rename and export both of them in s390-pci-inst.h.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
8 years agos390x/pci: separate s390_pcihost_iommu_configure function
Yi Min Zhao [Wed, 4 May 2016 07:06:44 +0000 (15:06 +0800)]
s390x/pci: separate s390_pcihost_iommu_configure function

Split s390_pcihost_iommu_configure() into separate functions for
configuring and deconfiguring in order to make the code more readable.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
8 years agos390x/pci: separate s390_sclp_configure function
Yi Min Zhao [Thu, 28 Apr 2016 04:33:53 +0000 (12:33 +0800)]
s390x/pci: separate s390_sclp_configure function

Split s390_sclp_configure() into separate functions for sclp
configuring and deconfiguring in order to make the code more readable.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>