OSDN Git Service

qmiga/qemu.git
9 years agoqapi: Rename anonymous union type in test
Eric Blake [Mon, 4 May 2015 15:05:11 +0000 (09:05 -0600)]
qapi: Rename anonymous union type in test

Reduce churn in the future patch that replaces anonymous unions
with a new metatype 'alternate' by changing 'AnonUnion' to
'Alternate'.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoqapi: Segregate anonymous unions into alternates in generator
Eric Blake [Mon, 4 May 2015 15:05:10 +0000 (09:05 -0600)]
qapi: Segregate anonymous unions into alternates in generator

Special-casing 'discriminator == {}' for handling anonymous unions
is getting awkward; since this particular type is not always a
dictionary on the wire, it is easier to treat it as a completely
different class of type, "alternate", so that if a type is listed
in the union_types array, we know it is not an anonymous union.

This patch just further segregates union handling, to make sure that
anonymous unions are not stored in union_types, and splitting up
check_union() into separate functions.  A future patch will change
the qapi grammar, and having the segregation already in place will
make it easier to deal with the distinct meta-type.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoqapi: Prepare for catching more semantic parse errors
Eric Blake [Mon, 4 May 2015 15:05:09 +0000 (09:05 -0600)]
qapi: Prepare for catching more semantic parse errors

This patch widens the scope of a try block (with the attending
reindentation required by Python) in preparation for a future
patch adding more instances of QAPIExprError inside the block.
It's easier to separate indentation from semantic changes, so
this patch has no real behavior change.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoqapi: Tighten checking of unions
Eric Blake [Mon, 4 May 2015 15:05:08 +0000 (09:05 -0600)]
qapi: Tighten checking of unions

Previous commits demonstrated that the generator had several
flaws with less-than-perfect unions:
- a simple union that listed the same branch twice (or two variant
names that map to the same C enumerator, including the implicit
MAX sentinel) ended up generating invalid C code
- an anonymous union that listed two branches with the same qtype
ended up generating invalid C code
- the generator crashed on anonymous union attempts to use an
array type
- the generator was silently ignoring a base type for anonymous
unions
- the generator allowed unknown types or nested anonymous unions
as a branch in an anonymous union

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoqapi: Forbid base without discriminator in unions
Eric Blake [Mon, 4 May 2015 15:05:07 +0000 (09:05 -0600)]
qapi: Forbid base without discriminator in unions

None of the existing QMP or QGA interfaces uses a union with a
base type but no discriminator; it is easier to avoid this in the
generator to save room for other future extensions more likely to
be useful.  An earlier commit added a union-base-no-discriminator
test to ensure that we eventually give a decent error message;
likewise, removing UserDefUnion outright is okay, because we moved
all the tests we wish to keep into the tests of the simple union
UserDefNativeListUnion in the previous commit.  Now is the time to
actually forbid simple union with base, and remove the last
vestiges from the testsuite.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoqapi: Clean up test coverage of simple unions
Eric Blake [Mon, 4 May 2015 15:05:06 +0000 (09:05 -0600)]
qapi: Clean up test coverage of simple unions

The tests of UserDefNativeListUnion serve to validate code
generation of simple unions without a base type, except that it
did not have full coverage in the strict test.  The next commits
will remove tests and support for simple unions with a base type,
so there is no real loss at repurposing that test here as
opposed to churn of adding a new test then deleting the old one.

Fix some indentation and long lines while at it.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoqapi: Add some union tests
Eric Blake [Mon, 4 May 2015 15:05:05 +0000 (09:05 -0600)]
qapi: Add some union tests

Demonstrate that the qapi generator doesn't deal well with unions
that aren't up to par. Later patches will update the expected
reseults as the generator is made stricter.  A few tests work
as planned, but most show poor or missing error messages.

Of particular note, qapi-code-gen.txt documents 'base' only for
flat unions, but the tests here demonstrate that we currently allow
a 'base' to a simple union, although it is exercised only in the
testsuite.  Later patches will remove this undocumented feature, to
give us more flexibility in adding other future extensions to union
types.  For example, one possible extension is the idea of a
type-safe simple enum, where added fields tie the discriminator to
a user-defined enum type rather than creating an implicit enum from
the names in 'data'.  But adding such safety on top of a simple
enum with a base type could look ambiguous with a flat enum;
besides, the documentation also mentions how any simple union can
be represented by an equivalent flat union.  So it will be simpler
to just outlaw support for something we aren't using.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoqapi: Better error messages for bad enums
Eric Blake [Mon, 4 May 2015 15:05:04 +0000 (09:05 -0600)]
qapi: Better error messages for bad enums

The previous commit demonstrated that the generator had several
flaws with less-than-perfect enums:
- an enum that listed the same string twice (or two variant
strings that map to the same C enumerator) ended up generating
an invalid C enum
- because the generator adds a _MAX terminator to each enum,
the use of an enum member 'max' can also cause this clash
- if an enum omits 'data', the generator left a python stack
trace rather than a graceful message
- an enum that used a non-array 'data' was silently accepted by
the parser
- an enum that used non-string members in the 'data' member
was silently accepted by the parser

Add check_enum to cover these situations, and update testcases
to match.  While valid .json files won't trigger any of these
cases, we might as well be nicer to developers that make a typo
while trying to add new QAPI code.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoqapi: Add some enum tests
Eric Blake [Mon, 4 May 2015 15:05:03 +0000 (09:05 -0600)]
qapi: Add some enum tests

Demonstrate that the qapi generator doesn't deal well with enums
that aren't up to par. Later patches will update the expected
results as the generator is made stricter.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoqapi: Require ASCII in schema
Eric Blake [Mon, 4 May 2015 15:05:02 +0000 (09:05 -0600)]
qapi: Require ASCII in schema

Python 2 and Python 3 have a wild history of whether strings
default to ascii or unicode, where Python 3 requires checking
isinstance(foo, basestr) to cover all strings, but where that
code is not portable to Python 2.  It's simpler to just state
that we don't care about Unicode strings, and to just always
use the simpler isinstance(foo, str) everywhere.

I'm no python expert, so I'm basing it on this conversation:
https://lists.gnu.org/archive/html/qemu-devel/2014-09/msg05278.html

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoqapi: Fix generation of 'size' builtin type
Eric Blake [Mon, 4 May 2015 15:05:01 +0000 (09:05 -0600)]
qapi: Fix generation of 'size' builtin type

We were missing the 'size' builtin type (which means that QAPI using
[ 'size' ] would fail to compile).

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoqapi: Simplify builtin type handling
Eric Blake [Mon, 4 May 2015 15:05:00 +0000 (09:05 -0600)]
qapi: Simplify builtin type handling

There was some redundancy between builtin_types[] and
builtin_type_qtypes{}.  Merge them into one.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoqapi: Document type-safety considerations
Eric Blake [Mon, 4 May 2015 15:04:59 +0000 (09:04 -0600)]
qapi: Document type-safety considerations

Go into more details about the various types of valid expressions
in a qapi schema, including tweaks to document fixes being done
later in the current patch series.  Also fix some stale and missing
documentation in the QMP specification.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoqapi: Add copyright declaration on docs
Eric Blake [Mon, 4 May 2015 15:04:58 +0000 (09:04 -0600)]
qapi: Add copyright declaration on docs

While our top-level COPYING with its GPLv2+ license applies to
any documentation file that omits explicit instructions, these
days it's better to be a good example of calling out our
intentions.  Correct use of GPL requires the use of a copyright
statement, so I'm adding notice to two QAPI documents, by
attributing these files to the initial authors and major
contributors.  I used:

$ git blame --line-porcelain $file \
  | sed -n 's/^author //p' | sort | uniq -c | sort -rn

to determine authorship of these two files.  qmp-spec.txt blames
entirely to Red Hat (easy, since my contribution falls in that
category); while qapi-code-gen.txt has multiple contributors
representing multiple entities.  But since it was originally
supplied by Michael Roth, the notice I added there copies the
notice he has used in other files.  As there is no intended
change in license from the implicit one previously present from
the top level, I have not bothered to CC other contributors;
if we want to weaken things to something looser (such as LGPL)
so that there is no question that someone re-implementing the
spec is not forced to use GPL, that would be a different commit.

CC: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-20150505-1' into staging
Peter Maydell [Tue, 5 May 2015 13:06:12 +0000 (14:06 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-20150505-1' into staging

sdl2: add opengl support

# gpg: Signature made Tue May  5 10:36:25 2015 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-sdl-20150505-1:
  sdl2: Fix RGB555
  sdl2: add support for display rendering using opengl.
  sdl2: move SDL_* includes to sdl2.h
  console-gl: add opengl rendering helper functions
  opengl: add shader helper functions.
  opengl: add shader build infrastructure

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/armbru/tags/pull-cov-model-2015-05-05' into...
Peter Maydell [Tue, 5 May 2015 09:23:22 +0000 (10:23 +0100)]
Merge remote-tracking branch 'remotes/armbru/tags/pull-cov-model-2015-05-05' into staging

coverity: fix address_space_rw model

# gpg: Signature made Tue May  5 09:44:26 2015 BST using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"

* remotes/armbru/tags/pull-cov-model-2015-05-05:
  coverity: fix address_space_rw model

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agosdl2: Fix RGB555
Max Reitz [Tue, 3 Mar 2015 17:25:27 +0000 (12:25 -0500)]
sdl2: Fix RGB555

Reproducable with:

$ x86_64-softmmu/qemu-system-x86_64 \
    -kernel $vmlinuz_of_your_choice \
    -append vga=0x313 -sdl

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agosdl2: add support for display rendering using opengl.
Gerd Hoffmann [Tue, 11 Nov 2014 15:54:45 +0000 (16:54 +0100)]
sdl2: add support for display rendering using opengl.

Add new sdl2-gl.c file, with display
rendering functions using opengl.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
9 years agosdl2: move SDL_* includes to sdl2.h
Gerd Hoffmann [Wed, 19 Nov 2014 13:19:49 +0000 (14:19 +0100)]
sdl2: move SDL_* includes to sdl2.h

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
9 years agoconsole-gl: add opengl rendering helper functions
Gerd Hoffmann [Fri, 9 Jan 2015 10:40:23 +0000 (11:40 +0100)]
console-gl: add opengl rendering helper functions

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
9 years agoopengl: add shader helper functions.
Gerd Hoffmann [Fri, 24 Apr 2015 05:48:45 +0000 (07:48 +0200)]
opengl: add shader helper functions.

Helper functions to compile, link and run opengl shader programs.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
9 years agocoverity: fix address_space_rw model
Paolo Bonzini [Mon, 4 May 2015 12:18:09 +0000 (14:18 +0200)]
coverity: fix address_space_rw model

If the is_write argument is true, address_space_rw writes to memory
and thus reads from the buffer.  The opposite holds if is_write is
false.  Fix the model.

Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9 years agoopengl: add shader build infrastructure
Gerd Hoffmann [Fri, 16 Jan 2015 12:59:17 +0000 (13:59 +0100)]
opengl: add shader build infrastructure

perl script to transform shader programs into c include files with
static string constands containing the shader programs, so we can
easily embed them into qemu.  Also some Makefile logic for them.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
9 years agoMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Peter Maydell [Thu, 30 Apr 2015 19:34:54 +0000 (20:34 +0100)]
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block patches

# gpg: Signature made Thu Apr 30 19:51:16 2015 BST using RSA key ID C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"

* remotes/kevin/tags/for-upstream:
  Enable NVMe start controller for Windows guest.
  MAINTAINERS: Add qemu-block list where missing
  MAINTAINERS: make block layer core Kevin Wolf's responsibility
  MAINTAINERS: make image fuzzer Stefan Hajnoczi's responsibility
  MAINTAINERS: make block I/O path Stefan Hajnoczi's responsibility
  MAINTAINERS: split out image formats
  MAINTAINERS: make virtio-blk Stefan Hajnoczi's responsibility

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2015-04-30' into...
Peter Maydell [Thu, 30 Apr 2015 14:18:30 +0000 (15:18 +0100)]
Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2015-04-30' into staging

trivial patches for 2015-04-30

# gpg: Signature made Thu Apr 30 14:07:50 2015 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-2015-04-30: (42 commits)
  openrisc: cpu: Remove unused cpu_get_pc
  microblaze: fix memory leak
  tcg: Delete unused cpu_pc_from_tb()
  kvm: Silence warning from valgrind
  vhost-user: remove superfluous '\n' around error_report()
  target-mips: fix memory leak
  qmp-commands: Fix typo
  linux-user/elfload: use QTAILQ_FOREACH instead of open-coding it
  coroutine: remove unnecessary parentheses in qemu_co_queue_empty
  qemu-char: remove unused list node from FDCharDriver
  input: remove unused mouse_handlers list
  cpus: use first_cpu macro instead of QTAILQ_FIRST(&cpus)
  microblaze: cpu: delete unused cpu_interrupts_enabled
  microblaze: cpu: Renumber EXCP_* constants to close gap
  microblaze: cpu: Delete EXCP_NMI
  microblaze: cpu: Remove unused CC_OP enum
  microblaze: cpu: Remote unused cpu_get_pc
  microblaze: mmu: Delete flip_um fn prototype
  defconfigs: Piggyback microblazeel on microblaze
  libcacard: do not use full paths for include files in the same dir
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoEnable NVMe start controller for Windows guest.
Daniel Stekloff [Fri, 24 Apr 2015 18:55:42 +0000 (11:55 -0700)]
Enable NVMe start controller for Windows guest.

Windows seems to send two separate calls to NVMe controller configuration. The
first sends configuration info and the second the enable bit. I couldn't
enable the Windows 8.1 in-box NVMe driver with base Qemu. I made the
following change to store the configuration data and then handle enable and
NVMe driver works on Windows 8.1.

I am not a Windows expert and I'm not entirely sure this is the correct
approach. I'm offering it for anyone who wishes to use NVMe on Windows 8.1
using Qemu.

I have tested this change with Linux and Windows guests with NVMe devices.

Signed-off-by: Daniel Stekloff <dan@wendan.org>
Acked-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9 years agoMerge remote-tracking branch 'remotes/cohuck/tags/s390x-20150430' into staging
Peter Maydell [Thu, 30 Apr 2015 13:15:56 +0000 (14:15 +0100)]
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20150430' into staging

First pile of s390x patches for 2.4, including:
- some cleanup patches
- sort most of the s390x devices into categories
- support for the new STSI post handler, used to insert vm name and
  friends
- support for the new MEM_OP ioctl (including access register mode)
  for accessing guest memory

# gpg: Signature made Thu Apr 30 12:56:58 2015 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-20150430:
  kvm: better advice for failed s390x startup
  s390x/kvm: Support access register mode for KVM_S390_MEM_OP ioctl
  s390x/mmu: Use ioctl for reading and writing from/to guest memory
  s390x/kvm: Put vm name, extended name and UUID into STSI322 SYSIB
  linux-headers: update
  s390x/mmu: Use access type definitions instead of magic values
  s390x/ipl: sort into categories
  sclp: sort into categories
  s390-virtio: sort into categories
  virtio-ccw: sort into categories

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMAINTAINERS: Add qemu-block list where missing
Kevin Wolf [Thu, 30 Apr 2015 13:15:13 +0000 (15:15 +0200)]
MAINTAINERS: Add qemu-block list where missing

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9 years agoMAINTAINERS: make block layer core Kevin Wolf's responsibility
Stefan Hajnoczi [Wed, 29 Apr 2015 14:13:29 +0000 (15:13 +0100)]
MAINTAINERS: make block layer core Kevin Wolf's responsibility

Kevin is now sole maintainer of the core block layer, including
BlockDriverState graphs and monitor commands.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9 years agoMAINTAINERS: make image fuzzer Stefan Hajnoczi's responsibility
Stefan Hajnoczi [Wed, 29 Apr 2015 14:13:28 +0000 (15:13 +0100)]
MAINTAINERS: make image fuzzer Stefan Hajnoczi's responsibility

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9 years agoMAINTAINERS: make block I/O path Stefan Hajnoczi's responsibility
Stefan Hajnoczi [Wed, 29 Apr 2015 14:13:27 +0000 (15:13 +0100)]
MAINTAINERS: make block I/O path Stefan Hajnoczi's responsibility

The block I/O path includes the asynchronous I/O machinery and
read/write/flush/discard processing.  It somewhat arbitrarily also
includes block migration, which I've found myself reviewing patches for
over the years.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9 years agoMAINTAINERS: split out image formats
Stefan Hajnoczi [Wed, 29 Apr 2015 14:13:26 +0000 (15:13 +0100)]
MAINTAINERS: split out image formats

Block driver submaintainers has proven to be a good model.  Kevin and
Stefan are splitting up the unclaimed block drivers so each has a
dedicated maintainer.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9 years agoMAINTAINERS: make virtio-blk Stefan Hajnoczi's responsibility
Stefan Hajnoczi [Wed, 29 Apr 2015 14:13:25 +0000 (15:13 +0100)]
MAINTAINERS: make virtio-blk Stefan Hajnoczi's responsibility

Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9 years agoopenrisc: cpu: Remove unused cpu_get_pc
Peter Crosthwaite [Thu, 30 Apr 2015 07:38:52 +0000 (00:38 -0700)]
openrisc: cpu: Remove unused cpu_get_pc

This function is not used by anything. Remove.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agomicroblaze: fix memory leak
Gonglei [Thu, 5 Mar 2015 03:05:20 +0000 (11:05 +0800)]
microblaze: fix memory leak

When not assign a -dtb argument, the variable dtb_filename
storage returned from qemu_find_file(), which should be freed
after use. Alternatively we define a local variable filename,
with 'char *' type, free after use.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agotcg: Delete unused cpu_pc_from_tb()
Peter Crosthwaite [Wed, 29 Apr 2015 07:52:21 +0000 (00:52 -0700)]
tcg: Delete unused cpu_pc_from_tb()

No code uses the cpu_pc_from_tb() function. Delete from tricore and
arm which each provide an unused implementation. Update the comment
in tcg.h to reflect that this is obsoleted by synchronize_from_tb.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agokvm: Silence warning from valgrind
Thomas Huth [Mon, 27 Apr 2015 16:59:04 +0000 (18:59 +0200)]
kvm: Silence warning from valgrind

valgrind complains here about uninitialized bytes with the following message:

==17814== Syscall param ioctl(generic) points to uninitialised byte(s)
==17814==    at 0x466A780: ioctl (in /usr/lib64/power8/libc-2.17.so)
==17814==    by 0x100735B7: kvm_vm_ioctl (kvm-all.c:1920)
==17814==    by 0x10074583: kvm_set_ioeventfd_mmio (kvm-all.c:574)

Let's fix it by using a proper struct initializer in kvm_set_ioeventfd_mmio().

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agovhost-user: remove superfluous '\n' around error_report()
Gonglei [Tue, 28 Apr 2015 09:11:04 +0000 (17:11 +0800)]
vhost-user: remove superfluous '\n' around error_report()

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agotarget-mips: fix memory leak
Gonglei [Tue, 28 Apr 2015 09:11:02 +0000 (17:11 +0800)]
target-mips: fix memory leak

Coveristy reports that variable prom_buf/params_buf going
out of scope leaks the storage it points to.

Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoqmp-commands: Fix typo
John Snow [Tue, 28 Apr 2015 19:20:41 +0000 (15:20 -0400)]
qmp-commands: Fix typo

Just a trivial patch to correct a QMP example in qmp-commands.hx.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agolinux-user/elfload: use QTAILQ_FOREACH instead of open-coding it
Emilio G. Cota [Mon, 27 Apr 2015 16:45:33 +0000 (12:45 -0400)]
linux-user/elfload: use QTAILQ_FOREACH instead of open-coding it

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agocoroutine: remove unnecessary parentheses in qemu_co_queue_empty
Emilio G. Cota [Mon, 27 Apr 2015 16:45:32 +0000 (12:45 -0400)]
coroutine: remove unnecessary parentheses in qemu_co_queue_empty

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoqemu-char: remove unused list node from FDCharDriver
Emilio G. Cota [Mon, 27 Apr 2015 16:45:30 +0000 (12:45 -0400)]
qemu-char: remove unused list node from FDCharDriver

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoinput: remove unused mouse_handlers list
Emilio G. Cota [Mon, 27 Apr 2015 16:45:29 +0000 (12:45 -0400)]
input: remove unused mouse_handlers list

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agocpus: use first_cpu macro instead of QTAILQ_FIRST(&cpus)
Emilio G. Cota [Mon, 27 Apr 2015 16:45:28 +0000 (12:45 -0400)]
cpus: use first_cpu macro instead of QTAILQ_FIRST(&cpus)

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agomicroblaze: cpu: delete unused cpu_interrupts_enabled
Peter Crosthwaite [Sun, 26 Apr 2015 19:10:24 +0000 (12:10 -0700)]
microblaze: cpu: delete unused cpu_interrupts_enabled

This function is unused. Remove.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agomicroblaze: cpu: Renumber EXCP_* constants to close gap
Michael Tokarev [Wed, 29 Apr 2015 05:34:29 +0000 (08:34 +0300)]
microblaze: cpu: Renumber EXCP_* constants to close gap

After removal of EXCP_NMI there's a gap in EXCP_*
numbering. Let's remove it.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
9 years agomicroblaze: cpu: Delete EXCP_NMI
Peter Crosthwaite [Sun, 26 Apr 2015 19:10:23 +0000 (12:10 -0700)]
microblaze: cpu: Delete EXCP_NMI

This define is unused. Remove.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agomicroblaze: cpu: Remove unused CC_OP enum
Peter Crosthwaite [Sun, 26 Apr 2015 19:10:22 +0000 (12:10 -0700)]
microblaze: cpu: Remove unused CC_OP enum

This enum is not used by anything. Remove.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agomicroblaze: cpu: Remote unused cpu_get_pc
Peter Crosthwaite [Sun, 26 Apr 2015 19:10:21 +0000 (12:10 -0700)]
microblaze: cpu: Remote unused cpu_get_pc

This function is not used by anything. Remove.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agomicroblaze: mmu: Delete flip_um fn prototype
Peter Crosthwaite [Sun, 26 Apr 2015 19:10:20 +0000 (12:10 -0700)]
microblaze: mmu: Delete flip_um fn prototype

This is not implemented or used.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agodefconfigs: Piggyback microblazeel on microblaze
Peter Crosthwaite [Sun, 26 Apr 2015 19:10:19 +0000 (12:10 -0700)]
defconfigs: Piggyback microblazeel on microblaze

Theres no difference in defconfig. Going forward microblazeel should
superset microblaze so use an include.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agolibcacard: do not use full paths for include files in the same dir
Michael Tokarev [Mon, 27 Apr 2015 13:29:58 +0000 (16:29 +0300)]
libcacard: do not use full paths for include files in the same dir

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agolibcacard: stop including qemu-common.h
Paolo Bonzini [Mon, 27 Apr 2015 10:34:18 +0000 (12:34 +0200)]
libcacard: stop including qemu-common.h

This is a small step towards making libcacard standalone.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agodocs/atomics.txt: fix two typos
Laszlo Ersek [Mon, 27 Apr 2015 11:32:35 +0000 (13:32 +0200)]
docs/atomics.txt: fix two typos

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoconfigure: alphabetize tricore in target list
Peter Crosthwaite [Mon, 27 Apr 2015 02:14:26 +0000 (19:14 -0700)]
configure: alphabetize tricore in target list

tricore was out of alphabetical order in the target list. Fix.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Acked-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoarm: cpu.h: Remove unused typdefs
Peter Crosthwaite [Mon, 27 Apr 2015 01:38:18 +0000 (18:38 -0700)]
arm: cpu.h: Remove unused typdefs

These CP accessor function prototypes are unused. Remove them.

Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoutil: Remove unused functions
Thomas Huth [Sat, 14 Mar 2015 06:19:33 +0000 (07:19 +0100)]
util: Remove unused functions

Delete the unused functions qemu_signalfd_available(),
qemu_send_full() and qemu_recv_full().

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agousb: Remove unused functions
Thomas Huth [Sat, 14 Mar 2015 06:19:32 +0000 (07:19 +0100)]
usb: Remove unused functions

Delete set_usb_string(), usb_ep_get_ifnum(), usb_ep_get_max_packet_size()
usb_ep_get_max_streams() and usb_ep_set_pipeline() since they are
not used anymore.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agomonitor: Remove unused functions
Thomas Huth [Sat, 14 Mar 2015 06:19:31 +0000 (07:19 +0100)]
monitor: Remove unused functions

The functions ringbuf_read_completion() and monitor_get_rs()
are not used anywhere anymore, so let's remove them.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agopci: Remove unused function ich9_d2pbr_init()
Thomas Huth [Sat, 14 Mar 2015 06:19:30 +0000 (07:19 +0100)]
pci: Remove unused function ich9_d2pbr_init()

The function ich9_d2pbr_init() is completely unused and
thus can be deleted.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agovmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags()
Thomas Huth [Sat, 14 Mar 2015 06:19:29 +0000 (07:19 +0100)]
vmxnet: Remove unused function vmxnet_rx_pkt_get_num_frags()

The function is not used anymore and thus can be deleted.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoqemu-options: trivial spelling fix (messsage)
Michael Tokarev [Mon, 27 Apr 2015 08:12:49 +0000 (11:12 +0300)]
qemu-options: trivial spelling fix (messsage)

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
9 years agohostmem: Fix mem-path property name in error report
Jan Kiszka [Fri, 24 Apr 2015 17:41:26 +0000 (19:41 +0200)]
hostmem: Fix mem-path property name in error report

The subtle difference between "property not found" and "property not
set" is already confusing enough.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agotpm: fix coding style
Stefan Berger [Wed, 15 Apr 2015 14:18:55 +0000 (10:18 -0400)]
tpm: fix coding style

Fix coding style in one instance.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoqemu-config: remove stray inclusions of hw/ files
Paolo Bonzini [Mon, 13 Apr 2015 15:28:27 +0000 (17:28 +0200)]
qemu-config: remove stray inclusions of hw/ files

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agorange: remove useless inclusions
Paolo Bonzini [Mon, 13 Apr 2015 15:28:26 +0000 (17:28 +0200)]
range: remove useless inclusions

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agomisc: Fix new collection of typos
Stefan Weil [Thu, 9 Apr 2015 18:32:39 +0000 (20:32 +0200)]
misc: Fix new collection of typos

All of them were reported by codespell.
Most typos are in comments, one is in an error message.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agohw/display : remove 'struct' from 'typedef QXL struct'
Chih-Min Chao [Wed, 8 Apr 2015 18:04:14 +0000 (02:04 +0800)]
hw/display : remove 'struct' from 'typedef QXL struct'

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoui/console : remove 'struct' from 'typedef struct' type
Chih-Min Chao [Wed, 8 Apr 2015 18:04:13 +0000 (02:04 +0800)]
ui/console : remove 'struct' from 'typedef struct' type

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoui/vnc : remove 'struct' of 'typedef struct'
Chih-Min Chao [Wed, 8 Apr 2015 18:04:12 +0000 (02:04 +0800)]
ui/vnc : remove 'struct' of 'typedef struct'

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agoui/vnc : fix coding style
Chih-Min Chao [Wed, 8 Apr 2015 18:04:11 +0000 (02:04 +0800)]
ui/vnc : fix coding style

    reported by checkpatch.pl

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agobitops : fix coding style
Chih-Min Chao [Wed, 8 Apr 2015 18:04:10 +0000 (02:04 +0800)]
bitops : fix coding style

    don't mix tab and space. The rule is 4 spaces

Signed-off-by: Chih-Min Chao <cmchao@gmail.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agotpm: Modify DPRINTF to enable -Wformat checking
Stefan Berger [Tue, 31 Mar 2015 18:49:10 +0000 (14:49 -0400)]
tpm: Modify DPRINTF to enable -Wformat checking

Modify DPRINTF to always enable -Wformat checking.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agotpm: Cast 64bit variables to int when used in DPRINTF
Stefan Berger [Tue, 31 Mar 2015 18:49:09 +0000 (14:49 -0400)]
tpm: Cast 64bit variables to int when used in DPRINTF

Cast 64bit variables to int when used in DPRINTF. They only contain
32bit of data.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
9 years agokvm: better advice for failed s390x startup
Cornelia Huck [Thu, 23 Apr 2015 15:03:46 +0000 (17:03 +0200)]
kvm: better advice for failed s390x startup

If KVM_CREATE failed on s390x, we print a hint to enable the switch_amode
kernel parameter. This only applies to old kernels, and only if the
error was -EINVAL. Moreover, with new kernels, the most likely reason
for -EINVAL is that pgstes were not enabled.

Let's update the error message to give a better hint on where things
may need fixing.

Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
9 years agos390x/kvm: Support access register mode for KVM_S390_MEM_OP ioctl
Alexander Yarygin [Thu, 5 Mar 2015 09:36:48 +0000 (12:36 +0300)]
s390x/kvm: Support access register mode for KVM_S390_MEM_OP ioctl

Access register mode is one of the modes that control dynamic address
translation. In this mode the address space is specified by values of
the access registers. The effective address-space-control element is
obtained from the result of the access register translation. See
the "Access-Register Introduction" section of the chapter 5 "Program
Execution" in "Principles of Operations" for more details.

When the CPU is in AR mode, the s390_cpu_virt_mem_rw() function must
know which access register number to use for address translation.
This patch does several things:
- add new parameter 'uint8_t ar' to that function
- decode ar number from intercepted instructions
- pass the ar number to s390_cpu_virt_mem_rw(), which in turn passes it
to the KVM_S390_MEM_OP ioctl.

Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
9 years agos390x/mmu: Use ioctl for reading and writing from/to guest memory
Thomas Huth [Fri, 6 Feb 2015 14:54:58 +0000 (15:54 +0100)]
s390x/mmu: Use ioctl for reading and writing from/to guest memory

Add code to make use of the new ioctl for reading from / writing to
virtual guest memory. By using the ioctl, the memory accesses are now
protected with the so-called ipte-lock in the kernel.

[CH: moved error message into kvm_s390_mem_op()]
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
9 years agos390x/kvm: Put vm name, extended name and UUID into STSI322 SYSIB
Ekaterina Tumanova [Tue, 3 Mar 2015 17:35:27 +0000 (18:35 +0100)]
s390x/kvm: Put vm name, extended name and UUID into STSI322 SYSIB

KVM prefills the SYSIB, returned by STSI 3.2.2. This patch allows
userspace to intercept execution, and fill in the values, that are
known to qemu: machine name (8 chars), extended machine name (256
chars), extended machine name encoding (equals 2 for UTF-8) and UUID.

STSI322 qemu handler also finds a highest virtualization level in
level-3 virtualization stack that doesn't support Extended Names
(Ext Name delimiter) and propagates zero Ext Name to all levels below,
because this level is not capable of managing Extended Names of lower
levels.

Signed-off-by: Ekaterina Tumanova <tumanova@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
9 years agolinux-headers: update
Cornelia Huck [Tue, 31 Mar 2015 14:07:08 +0000 (16:07 +0200)]
linux-headers: update

This updates linux-headers against master 4.1-rc1 (commit
b787f68c36d49bb1d9236f403813641efa74a031).

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
9 years agos390x/mmu: Use access type definitions instead of magic values
Thomas Huth [Thu, 19 Mar 2015 14:04:50 +0000 (15:04 +0100)]
s390x/mmu: Use access type definitions instead of magic values

Since there are now proper definitions for the MMU access type,
let's use them in the s390x MMU code, too, instead of the
hard-to-understand magic values.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
9 years agos390x/ipl: sort into categories
Cornelia Huck [Fri, 20 Mar 2015 09:17:08 +0000 (10:17 +0100)]
s390x/ipl: sort into categories

The s390 ipl device has no real home (it's not really a storage device),
so let's sort it into the misc category.

Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
9 years agosclp: sort into categories
Cornelia Huck [Tue, 17 Mar 2015 12:44:39 +0000 (13:44 +0100)]
sclp: sort into categories

Sort the sclp consoles into the input category, just as virtio-serial.
Various other sclp devices don't have an obvious category, sort them
into misc.

Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
9 years agos390-virtio: sort into categories
Cornelia Huck [Tue, 17 Mar 2015 12:43:26 +0000 (13:43 +0100)]
s390-virtio: sort into categories

Sort the various s390-virtio devices into the same categories as their
virtio-pci counterparts.

Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
9 years agovirtio-ccw: sort into categories
Cornelia Huck [Tue, 17 Mar 2015 12:42:03 +0000 (13:42 +0100)]
virtio-ccw: sort into categories

Sort the various virtio-ccw devices into the same categories as their
virtio-pci counterparts.

Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
9 years agoMerge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Peter Maydell [Thu, 30 Apr 2015 11:04:11 +0000 (12:04 +0100)]
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

- miscellaneous cleanups for TCG (Emilio) and NBD (Bogdan)
- next part in the thread-safe address_space_* saga: atomic access
  to the bounce buffer and the map_clients list, from Fam
- optional support for linking with tcmalloc, also from Fam
- reapplying Peter Crosthwaite's "Respect as_translate_internal
  length clamp" after fixing the SPARC fallout.
- build system fix from Wei Liu
- small acpi-build and ioport cleanup by myself

# gpg: Signature made Wed Apr 29 09:34:00 2015 BST using RSA key ID 78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream: (22 commits)
  nbd/trivial: fix type cast for ioctl
  translate-all: use bitmap helpers for PageDesc's bitmap
  target-i386: disable LINT0 after reset
  Makefile.target: prepend $libs_softmmu to $LIBS
  milkymist: do not modify libs-softmmu
  configure: Add support for tcmalloc
  exec: Respect as_translate_internal length clamp
  ioport: reserve the whole range of an I/O port in the AddressSpace
  ioport: loosen assertions on emulation of 16-bit ports
  ioport: remove wrong comment
  ide: there is only one data port
  gus: clean up MemoryRegionPortio
  sb16: remove useless mixer_write_indexw
  sun4m: fix slavio sysctrl and led register sizes
  acpi-build: remove dependency from ram_addr.h
  memory: add memory_region_ram_resize
  dma-helpers: Fix race condition of continue_after_map_failure and dma_aio_cancel
  exec: Notify cpu_register_map_client caller if the bounce buffer is available
  exec: Protect map_client_list with mutex
  linux-user, bsd-user: Remove two calls to cpu_exec_init_all
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agoMerge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging
Peter Maydell [Thu, 30 Apr 2015 09:10:31 +0000 (10:10 +0100)]
Merge remote-tracking branch 'remotes/jnsnow/tags/ide-pull-request' into staging

# gpg: Signature made Wed Apr 29 00:03:44 2015 BST using RSA key ID AAFC390E
# gpg: Good signature from "John Snow (John Huston) <jsnow@redhat.com>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: FAEB 9711 A12C F475 812F  18F2 88A9 064D 1835 61EB
#      Subkey fingerprint: F9B7 ABDB BCAC DF95 BE76  CBD0 7DEF 8106 AAFC 390E

* remotes/jnsnow/tags/ide-pull-request:
  qtest: Add assertion that required environment variable is set
  qtest/ahci: add flush retry test
  libqos: add blkdebug_prepare_script
  libqtest: add qmp_async
  libqtest: add qmp_eventwait
  qtest/ahci: Allow override of default CLI options
  qtest/ahci: Add simple flush test
  qtest/ahci: test different disk sectors
  qtest/ahci: add qcow2 support to ahci-test
  fdc: remove sparc sun4m mutations

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9 years agonbd/trivial: fix type cast for ioctl
Bogdan Purcareata [Fri, 3 Apr 2015 11:01:54 +0000 (11:01 +0000)]
nbd/trivial: fix type cast for ioctl

This fixes ioctl behavior on powerpc e6500 platforms with 64bit kernel and 32bit
userspace. The current type cast has no effect there and the value passed to the
kernel is still 0. Probably an issue related to the compiler, since I'm assuming
the same configuration works on a similar setup on x86.

Also ensure consistency with previous type cast in TRACE message.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
Message-Id: <1428058914-32050-1-git-send-email-bogdan.purcareata@freescale.com>
Cc: qemu-stable@nongnu.org
[Fix parens as noticed by Michael. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agotranslate-all: use bitmap helpers for PageDesc's bitmap
Emilio G. Cota [Wed, 22 Apr 2015 21:50:52 +0000 (17:50 -0400)]
translate-all: use bitmap helpers for PageDesc's bitmap

Here we have an open-coded byte-based bitmap implementation.
Get rid of it since there's a ulong-based implementation to be
used by all code.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agotarget-i386: disable LINT0 after reset
Nadav Amit [Sun, 12 Apr 2015 23:32:08 +0000 (02:32 +0300)]
target-i386: disable LINT0 after reset

Due to old Seabios bug, QEMU reenable LINT0 after reset. This bug is long gone
and therefore this hack is no longer needed.  Since it violates the
specifications, it is removed.

Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Message-Id: <1428881529-29459-2-git-send-email-namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agoMakefile.target: prepend $libs_softmmu to $LIBS
Wei Liu [Mon, 9 Mar 2015 14:54:33 +0000 (14:54 +0000)]
Makefile.target: prepend $libs_softmmu to $LIBS

I discovered a problem when trying to build QEMU statically with gcc.
libm is an element of LIBS while libpixman-1 is an element in
libs_softmmu. Libpixman references functions in libm, so the original
ordering makes linking fail.

This fix is to reorder $libs_softmmu and $LIBS to make -lm appear after
-lpixman-1. However I'm not quite sure if this is the right fix, hence
the RFC tag.

Normally QEMU is built with c++ compiler which happens to link in libm
(at least this is the case with g++), so building QEMU statically
normally just works and nobody notices this issue.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Message-Id: <1425912873-21215-1-git-send-email-wei.liu2@citrix.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agomilkymist: do not modify libs-softmmu
Paolo Bonzini [Tue, 10 Mar 2015 10:17:48 +0000 (11:17 +0100)]
milkymist: do not modify libs-softmmu

This is better and prepares for the next patch.  When we copy
libs_softmmu's value into LIBS with a := assignment, we cannot
anymore modify libs_softmmu in the Makefiles.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agoconfigure: Add support for tcmalloc
Fam Zheng [Thu, 26 Mar 2015 03:03:12 +0000 (11:03 +0800)]
configure: Add support for tcmalloc

This adds "--enable-tcmalloc" and "--disable-tcmalloc" to allow linking
to libtcmalloc from gperftools.

tcmalloc is a malloc implementation that works well with threads and is
fast, so it is good for performance.

It is disabled by default, because the MALLOC_PERTURB_ flag we use in
tests doesn't work with tcmalloc. However we can enable tcmalloc
specific heap checker and profilers later.

An IOPS gain can be observed with virtio-blk-dataplane, other parts of
QEMU will directly benefit from it as well:

==========================================================
                       glibc malloc
----------------------------------------------------------
rw         bs         iodepth    bw     iops       latency
read       4k         1          150    38511      24
----------------------------------------------------------

==========================================================
                         tcmalloc
----------------------------------------------------------
rw         bs         iodepth    bw     iops       latency
read       4k         1          156    39969      23
----------------------------------------------------------

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <1427338992-27057-1-git-send-email-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9 years agoqtest: Add assertion that required environment variable is set
Ed Maste [Tue, 28 Apr 2015 19:27:51 +0000 (15:27 -0400)]
qtest: Add assertion that required environment variable is set

Signed-off-by: Ed Maste <emaste@freebsd.org>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 1427911244-22565-1-git-send-email-emaste@freebsd.org
Signed-off-by: John Snow <jsnow@redhat.com>
9 years agoqtest/ahci: add flush retry test
John Snow [Tue, 28 Apr 2015 19:27:51 +0000 (15:27 -0400)]
qtest/ahci: add flush retry test

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1426018503-821-7-git-send-email-jsnow@redhat.com

9 years agolibqos: add blkdebug_prepare_script
John Snow [Tue, 28 Apr 2015 19:27:51 +0000 (15:27 -0400)]
libqos: add blkdebug_prepare_script

Pull this helper out of ide-test and into libqos,
to be shared with ahci-test.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1426018503-821-6-git-send-email-jsnow@redhat.com

9 years agolibqtest: add qmp_async
John Snow [Tue, 28 Apr 2015 19:27:51 +0000 (15:27 -0400)]
libqtest: add qmp_async

Add qmp_async, which lets us send QMP commands asynchronously.
This is useful when we want to send commands that will trigger
event responses, but we don't know in what order to expect them.

Sometimes the event responses may arrive even before the command
confirmation will show up, so it is convenient to leave the responses
in the stream.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1426018503-821-5-git-send-email-jsnow@redhat.com

9 years agolibqtest: add qmp_eventwait
John Snow [Tue, 28 Apr 2015 19:27:51 +0000 (15:27 -0400)]
libqtest: add qmp_eventwait

Allow the user to poll until a desired interrupt occurs.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1426018503-821-4-git-send-email-jsnow@redhat.com

9 years agoqtest/ahci: Allow override of default CLI options
John Snow [Tue, 28 Apr 2015 19:27:51 +0000 (15:27 -0400)]
qtest/ahci: Allow override of default CLI options

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1426018503-821-3-git-send-email-jsnow@redhat.com

9 years agoqtest/ahci: Add simple flush test
John Snow [Tue, 28 Apr 2015 19:27:51 +0000 (15:27 -0400)]
qtest/ahci: Add simple flush test

Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1426018503-821-2-git-send-email-jsnow@redhat.com