]> Git Repo - qemu.git/log
qemu.git
7 years agoqemu-iotests/059: Fix leaked image files
Kevin Wolf [Thu, 27 Jul 2017 13:13:20 +0000 (15:13 +0200)]
qemu-iotests/059: Fix leaked image files

qemu-iotests 059 left a whole lot of image files behind in the scratch
directory because VMDK creates additional files for extents and cleaning
them up requires the original image intact (it parses qemu-img info
output to find all extent files), but the image overwrote it many times
like it works for all other image formats.

In addition, _use_sample_img overwrites the TEST_IMG variable, causing
new images created afterwards to reuse the name of the sample file
rather than the usual t.IMGFMT.

This patch adds an intermediate _cleanup_test_img after each subtest
that created an image file with additional extent files, and also after
each use of a sample image. _cleanup_test_img is also changed so that it
resets TEST_IMG after a sample image is cleaned up.

Note that this test was failing before this commit and continues to do
so after it. This failure was introduced in commit 9877860 ('block/vmdk:
Report failures in vmdk_read_cid()') and needs to be dealt with
separately.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
7 years agoqemu-iotests/063: Fix leaked image
Kevin Wolf [Thu, 27 Jul 2017 13:13:20 +0000 (15:13 +0200)]
qemu-iotests/063: Fix leaked image

qemu-iotests 063 left t.raw.raw1 behind in the scratch directory because
it used the wrong suffix. Make sure to clean it up after completing the
test.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
7 years agoqemu-iotests/162: Fix leaked temporary files
Kevin Wolf [Thu, 27 Jul 2017 13:13:20 +0000 (15:13 +0200)]
qemu-iotests/162: Fix leaked temporary files

qemu-iotests 162 left qemu-nbd.pid behind in the scratch directory, and
potentially a file called '42' in the current directory. Make sure to
clean it up after completing the tests.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
7 years agoqemu-iotests/153: Fix leaked scratch images
Kevin Wolf [Thu, 27 Jul 2017 13:13:20 +0000 (15:13 +0200)]
qemu-iotests/153: Fix leaked scratch images

qemu-iotests 153 left t.qcow2.c behind in the scratch directory. Make
sure to clean it up after completing the tests.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
7 years agoqemu-iotests/141: Fix image cleanup
Kevin Wolf [Thu, 27 Jul 2017 13:51:43 +0000 (15:51 +0200)]
qemu-iotests/141: Fix image cleanup

qemu-iotests 141 attempted to use brace expansion to remove all images
with a single command. However, for this to work, the braces shouldn't
be quoted.

With this fix, the tests correctly cleans up its scratch images.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
7 years agoqemu-iotests: Remove blkdebug.conf after tests
Kevin Wolf [Thu, 27 Jul 2017 13:19:12 +0000 (15:19 +0200)]
qemu-iotests: Remove blkdebug.conf after tests

qemu-iotests 074 and 179 left a blkdebug.conf behind in the scratch
directory. Make sure to clean up after completing the tests.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
7 years agoqemu-iotests/041: Fix leaked scratch images
Kevin Wolf [Thu, 27 Jul 2017 13:13:20 +0000 (15:13 +0200)]
qemu-iotests/041: Fix leaked scratch images

qemu-iotests 041 left quorum_snapshot.img and target.img behind in the
scratch directory. Make sure to clean up after completing the tests.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
7 years agoblock: fix leaks in bdrv_open_driver()
Manos Pitsidianakis [Fri, 14 Jul 2017 14:35:48 +0000 (17:35 +0300)]
block: fix leaks in bdrv_open_driver()

bdrv_open_driver() is called in two places, bdrv_new_open_driver() and
bdrv_open_common(). In the latter, failure cleanup in is in its caller,
bdrv_open_inherit(), which unrefs the bs->file of the failed driver open
if it exists.

Let's move the bs->file cleanup to bdrv_open_driver() to take care of
all callers and do not set bs->drv to NULL unless the driver's open
function failed. When bs is destroyed by removing its last reference, it
calls bdrv_close() which checks bs->drv to perform the needed cleanups
and also call the driver's close function. Since it cleans up options
and opaque we must take care not leave dangling pointers.

The error paths in bdrv_open_driver() are now two:
If open fails, drv->bdrv_close() should not be called. Unref the child
if it exists, free what we allocated and set bs->drv to NULL. Return the
error and let callers free their stuff.

If open succeeds but we fail after, return the error and let callers
unref and delete their bs, while cleaning up their allocations.

Signed-off-by: Manos Pitsidianakis <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
7 years agoblock: fix dangling bs->explicit_options in block.c
Manos Pitsidianakis [Fri, 14 Jul 2017 14:35:47 +0000 (17:35 +0300)]
block: fix dangling bs->explicit_options in block.c

In some error paths it is possible to QDECREF a freed dangling
explicit_options, resulting in a heap overflow crash.  For example
bdrv_open_inherit()'s fail unrefs it, then calls bdrv_unref which calls
bdrv_close which also unrefs it.

Signed-off-by: Manos Pitsidianakis <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
7 years agoiotests: Add test of recent fix to 'qemu-img measure'
Eric Blake [Mon, 24 Jul 2017 15:39:52 +0000 (10:39 -0500)]
iotests: Add test of recent fix to 'qemu-img measure'

The new test 190 ensures we don't regress back to an infinite loop when
measuring the size of a 2T+ qcow2 image.  I did not append to test 178,
because that test is also designed to run with format 'raw'; also, this
gives us some coverage of the measure command under the quick group.

Signed-off-by: Eric Blake <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
7 years agoiotests: Check dirty bitmap statistics in 124
Eric Blake [Mon, 24 Jul 2017 15:39:51 +0000 (10:39 -0500)]
iotests: Check dirty bitmap statistics in 124

We had a bug for multiple releases where dirty-bitmap count was
documented in bytes but reported in sectors; enhance the testsuite
to add coverage of DirtyBitmapInfo to ensure we do not regress again.

Signed-off-by: Eric Blake <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: John Snow <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
7 years agoiotests: Redirect stderr to stdout in 186
Max Reitz [Tue, 25 Jul 2017 15:56:44 +0000 (17:56 +0200)]
iotests: Redirect stderr to stdout in 186

Without redirecting qemu's stderr to stdout, _filter_qemu will not apply
to warnings.  This results in $QEMU_PROG not being replaced by QEMU_PROG
which is not great if your qemu executable is not called
qemu-system-x86_64 (e.g. qemu-system-i386).

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
7 years agoiotests: Fix test 156
Max Reitz [Tue, 25 Jul 2017 15:56:43 +0000 (17:56 +0200)]
iotests: Fix test 156

On one hand, the _make_test_img invocation for creating the target image
was missing a -u because its backing file is not supposed to exist at
that point.

On the other hand, nobody noticed probably because the backing file is
created later on and _cleanup failed to remove it: The quotation marks
were misplaced so bash tried to delete a file literally called
"$TEST_IMG{,.target}..." instead of performing brace expansion. Thus, the
files stayed around after the first run and qemu-img create did not
complain about a missing backing file on any run but the first.

Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20170731' into...
Peter Maydell [Mon, 31 Jul 2017 13:45:42 +0000 (14:45 +0100)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20170731' into staging

target-arm queue:
 * fix broken properties on MPS2 SCC device
 * fix MPU trace handling of write vs exec
 * fix MPU M profile bugs:
   - not handling system space or PPB region correctly
   - not resetting state
   - not migrating MPU_RNR

# gpg: Signature made Mon 31 Jul 2017 13:21:40 BST
# gpg:                using RSA key 0x3C2525ED14360CDE
# gpg: Good signature from "Peter Maydell <[email protected]>"
# gpg:                 aka "Peter Maydell <[email protected]>"
# gpg:                 aka "Peter Maydell <[email protected]>"
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* remotes/pmaydell/tags/pull-target-arm-20170731:
  hw/mps2_scc: fix incorrect properties
  target/arm: Migrate MPU_RNR register state for M profile cores
  target/arm: Move PMSAv7 reset into arm_cpu_reset() so M profile MPUs get reset
  target/arm: Rename cp15.c6_rgnr to pmsav7.rnr
  target/arm: Don't allow guest to make System space executable for M profile
  target/arm: Don't do MPU lookups for addresses in M profile PPB region
  target/arm: Correct MPU trace handling of write vs execute

Signed-off-by: Peter Maydell <[email protected]>
7 years agoRevert "syscall: fix dereference of undefined pointer"
Peter Maydell [Mon, 31 Jul 2017 12:56:54 +0000 (13:56 +0100)]
Revert "syscall: fix dereference of undefined pointer"

This reverts commit bc658e4a2e81593f75a3ae34b112be77efbb3e0a.

Some versions of gcc warn about this:

linux-user/syscall.c: In function ‘do_ioctl_rt’:
linux-user/syscall.c:5577:37: error: ‘host_rt_dev_ptr’ may be used uninitialized in this function [-Werror=uninitialized]

and in particular the Travis builds fail; they use
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3.

Revert the change to fix the travis builds.

Signed-off-by: Peter Maydell <[email protected]>
7 years agohw/mps2_scc: fix incorrect properties
Philippe Mathieu-Daudé [Sat, 29 Jul 2017 23:49:30 +0000 (20:49 -0300)]
hw/mps2_scc: fix incorrect properties

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20170729234930[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agotarget/arm: Migrate MPU_RNR register state for M profile cores
Peter Maydell [Thu, 27 Jul 2017 10:59:10 +0000 (11:59 +0100)]
target/arm: Migrate MPU_RNR register state for M profile cores

The PMSAv7 region number register is migrated for R profile
cores using the cpreg scheme, but M profile doesn't use
cpregs, and so we weren't migrating the MPU_RNR register state
at all. Fix that by adding a migration subsection for the
M profile case.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 1501153150[email protected]

7 years agotarget/arm: Move PMSAv7 reset into arm_cpu_reset() so M profile MPUs get reset
Peter Maydell [Thu, 27 Jul 2017 10:59:09 +0000 (11:59 +0100)]
target/arm: Move PMSAv7 reset into arm_cpu_reset() so M profile MPUs get reset

When the PMSAv7 implementation was originally added it was for R profile
CPUs only, and reset was handled using the cpreg .resetfn hooks.
Unfortunately for M profile cores this doesn't work, because they do
not register any cpregs. Move the reset handling into arm_cpu_reset(),
where it will work for both R profile and M profile cores.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 1501153150[email protected]

7 years agotarget/arm: Rename cp15.c6_rgnr to pmsav7.rnr
Peter Maydell [Thu, 27 Jul 2017 10:59:08 +0000 (11:59 +0100)]
target/arm: Rename cp15.c6_rgnr to pmsav7.rnr

Almost all of the PMSAv7 state is in the pmsav7 substruct of
the ARM CPU state structure. The exception is the region
number register, which is in cp15.c6_rgnr. This exception
is a bit odd for M profile, which otherwise generally does
not store state in the cp15 substruct.

Rename cp15.c6_rgnr to pmsav7.rnr accordingly.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 1501153150[email protected]

7 years agotarget/arm: Don't allow guest to make System space executable for M profile
Peter Maydell [Thu, 27 Jul 2017 10:59:07 +0000 (11:59 +0100)]
target/arm: Don't allow guest to make System space executable for M profile

For an M profile v7PMSA, the system space (0xe0000000 - 0xffffffff) can
never be executable, even if the guest tries to set the MPU registers
up that way. Enforce this restriction.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 1501153150[email protected]

7 years agotarget/arm: Don't do MPU lookups for addresses in M profile PPB region
Peter Maydell [Thu, 27 Jul 2017 10:59:06 +0000 (11:59 +0100)]
target/arm: Don't do MPU lookups for addresses in M profile PPB region

The M profile PMSAv7 specification says that if the address being looked
up is in the PPB region (0xe0000000 - 0xe00fffff) then we do not use
the MPU regions but always use the default memory map. Implement this
(we were previously behaving like an R profile PMSAv7, which does not
special case this).

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 1501153150[email protected]

7 years agotarget/arm: Correct MPU trace handling of write vs execute
Peter Maydell [Mon, 24 Jul 2017 14:33:12 +0000 (15:33 +0100)]
target/arm: Correct MPU trace handling of write vs execute

Correct off-by-one bug in the PSMAv7 MPU tracing where it would print
a write access as "reading", an insn fetch as "writing", and a read
access as "execute".

Since we have an MMUAccessType enum now, we can make the code clearer
in the process by using that rather than the raw 0/1/2 values.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-id: 1500906792[email protected]

7 years agoMerge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging
Peter Maydell [Mon, 31 Jul 2017 10:27:43 +0000 (11:27 +0100)]
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging

trivial patches for 2017-07-31

# gpg: Signature made Mon 31 Jul 2017 11:18:57 BST
# gpg:                using RSA key 0x701B4F6B1A693E59
# gpg: Good signature from "Michael Tokarev <[email protected]>"
# gpg:                 aka "Michael Tokarev <[email protected]>"
# gpg:                 aka "Michael Tokarev <[email protected]>"
# Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
#      Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931  4B22 701B 4F6B 1A69 3E59

* remotes/mjt/tags/trivial-patches-fetch: (25 commits)
  docs: fix broken paths to docs/specs/ivshmem-spec.txt
  docs: fix broken paths to docs/config/ich9-ehci-uhci.cfg
  docs: fix broken paths to docs/devel/tracing.txt
  docs: fix broken paths to docs/devel/atomics.txt
  docs: fix broken paths to docs/devel/qapi-code-gen.txt
  docs: fix broken paths to docs/interop/qcow2.txt
  docs: fix broken paths to docs/interop dir
  thunk: assert nb_fields is valid
  syscall: check inotify() and eventfd() return value
  syscall: fix use of uninitialized values
  syscall: fix dereference of undefined pointer
  linux-user/sh4: fix incorrect memory write
  m68k/translate: fix incorrect copy/paste
  net/eth: fix incorrect check of iov_to_buf() return value
  ui/vnc: fix leak of SocketAddress **
  qcow2: fix null pointer dereference
  ivshmem: fix incorrect error handling in ivshmem_recv_msg()
  loader: check get_image_size() return value
  tests: add missing dependency to build QTEST_QEMU_BINARY
  qemu-system-tricore: segfault when entering "x 0" on the monitor
  ...

Signed-off-by: Peter Maydell <[email protected]>
7 years agodocs: fix broken paths to docs/specs/ivshmem-spec.txt
Philippe Mathieu-Daudé [Fri, 28 Jul 2017 22:46:07 +0000 (19:46 -0300)]
docs: fix broken paths to docs/specs/ivshmem-spec.txt

When this file was rewritten/renamed in fdee2025dd,
a reference path was not updated.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agodocs: fix broken paths to docs/config/ich9-ehci-uhci.cfg
Philippe Mathieu-Daudé [Fri, 28 Jul 2017 22:46:06 +0000 (19:46 -0300)]
docs: fix broken paths to docs/config/ich9-ehci-uhci.cfg

With the move of some docs/ to docs/devel/ on ac06724a71,
a reference path was not updated.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agodocs: fix broken paths to docs/devel/tracing.txt
Philippe Mathieu-Daudé [Fri, 28 Jul 2017 22:46:05 +0000 (19:46 -0300)]
docs: fix broken paths to docs/devel/tracing.txt

With the move of some docs/ to docs/devel/ on ac06724a71,
no references were updated.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agodocs: fix broken paths to docs/devel/atomics.txt
Philippe Mathieu-Daudé [Fri, 28 Jul 2017 22:46:04 +0000 (19:46 -0300)]
docs: fix broken paths to docs/devel/atomics.txt

With the move of some docs/ to docs/devel/ on ac06724a71,
a couple of references were not updated.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agodocs: fix broken paths to docs/devel/qapi-code-gen.txt
Philippe Mathieu-Daudé [Fri, 28 Jul 2017 22:46:03 +0000 (19:46 -0300)]
docs: fix broken paths to docs/devel/qapi-code-gen.txt

With the move of some docs to docs/interop on ac06724a71,
a couple of references were not updated.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agodocs: fix broken paths to docs/interop/qcow2.txt
Philippe Mathieu-Daudé [Fri, 28 Jul 2017 22:46:02 +0000 (19:46 -0300)]
docs: fix broken paths to docs/interop/qcow2.txt

With the move of some docs to docs/interop on d59157ea05,
a reference path was not updated.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agodocs: fix broken paths to docs/interop dir
Cleber Rosa [Fri, 28 Jul 2017 22:46:01 +0000 (19:46 -0300)]
docs: fix broken paths to docs/interop dir

With the move of some docs to docs/interop on d59157e, a couple of
references were not updated.

Signed-off-by: Cleber Rosa <[email protected]>
[PMD: fixed a typo and another reference of docs/interop/qmp-spec.txt]
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agothunk: assert nb_fields is valid
Philippe Mathieu-Daudé [Thu, 27 Jul 2017 02:42:20 +0000 (23:42 -0300)]
thunk: assert nb_fields is valid

thunk.c:91:32: warning: Call to 'malloc' has an allocation size of 0 bytes
        se->field_offsets[i] = malloc(nb_fields * sizeof(int));
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agosyscall: check inotify() and eventfd() return value
Philippe Mathieu-Daudé [Thu, 27 Jul 2017 02:42:19 +0000 (23:42 -0300)]
syscall: check inotify() and eventfd() return value

linux-user/syscall.c:555:25: warning: Out of bound memory access (accessed memory precedes memory block)
    target_fd_trans[fd] = trans;
    ~~~~~~~~~~~~~~~~~~~~^~~~~~~

Reported-by: Clang Static Analyzer
Suggested-by: Laurent Vivier <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agosyscall: fix use of uninitialized values
Philippe Mathieu-Daudé [Thu, 27 Jul 2017 02:42:18 +0000 (23:42 -0300)]
syscall: fix use of uninitialized values

linux-user/syscall.c:1627:35: warning: 1st function call argument is an uninitialized value
        target_saddr->sa_family = tswap16(addr->sa_family);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~
linux-user/syscall.c:1629:25: warning: The left operand of '==' is a garbage value
    if (addr->sa_family == AF_NETLINK && len >= sizeof(struct sockaddr_nl)) {
        ~~~~~~~~~~~~~~~ ^

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agosyscall: fix dereference of undefined pointer
Philippe Mathieu-Daudé [Thu, 27 Jul 2017 02:42:17 +0000 (23:42 -0300)]
syscall: fix dereference of undefined pointer

linux-user/syscall.c:5581:9: warning: Dereference of undefined pointer value
    if (*host_rt_dev_ptr != 0) {
        ^~~~~~~~~~~~~~~~

Reported-by: Clang Static Analyzer
Suggested-by: Laurent Vivier <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agolinux-user/sh4: fix incorrect memory write
Philippe Mathieu-Daudé [Thu, 27 Jul 2017 02:42:16 +0000 (23:42 -0300)]
linux-user/sh4: fix incorrect memory write

not hit since 2009! :)

linux-user/elfload.c:1102:20: warning: Out of bound memory access (access exceeds upper limit of memory block)
        (*regs[i]) = tswap32(env->gregs[i]);
        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agom68k/translate: fix incorrect copy/paste
Philippe Mathieu-Daudé [Thu, 27 Jul 2017 02:42:15 +0000 (23:42 -0300)]
m68k/translate: fix incorrect copy/paste

db3d7945ae extended gen_cc_cond() for cond [6, 7, 9, 10] but misswrote [4, 5]

target/m68k/translate.c:1323:70: warning: identical expressions on both sides of logical operator
        if (op == CC_OP_ADDB || op == CC_OP_ADDW || op == CC_OP_ADDL ||
            op == CC_OP_ADDB || op == CC_OP_ADDW || op == CC_OP_ADDL) {
            ~~~~~~~~~~~~~~~~    ~~~~~~~~~~~~~~~~    ~~~~~~~~~~~~~~~~ ^

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agonet/eth: fix incorrect check of iov_to_buf() return value
Philippe Mathieu-Daudé [Thu, 27 Jul 2017 02:42:12 +0000 (23:42 -0300)]
net/eth: fix incorrect check of iov_to_buf() return value

So we have sizeof(struct in6_address) != sizeof(uintptr_t)
and Clang > Coverity on this, see 4555ca6816c :)

net/eth.c:426:30: warning: The code calls sizeof() on a pointer type. This can produce an unexpected result
        return bytes_read == sizeof(dst_addr);
                             ^     ~~~~~~~~~~
net/eth.c:475:34: warning: The code calls sizeof() on a pointer type. This can produce an unexpected result
            return bytes_read == sizeof(src_addr);
                                 ^     ~~~~~~~~~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Dmitry Fleytman <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agoui/vnc: fix leak of SocketAddress **
Philippe Mathieu-Daudé [Thu, 27 Jul 2017 02:42:11 +0000 (23:42 -0300)]
ui/vnc: fix leak of SocketAddress **

Extract the (correct) cleaning code as a new function vnc_free_addresses() then
use it to remove the memory leaks.

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agoqcow2: fix null pointer dereference
Philippe Mathieu-Daudé [Thu, 27 Jul 2017 02:42:10 +0000 (23:42 -0300)]
qcow2: fix null pointer dereference

It seems this assert() was somehow misplaced.

block/qcow2-refcount.c:2193:42: warning: Array access (from variable 'on_disk_reftable') results in a null pointer dereference
        on_disk_reftable[refblock_index] = refblock_offset;
        ~~~~~~~~~~~~~~~~                 ^

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agoivshmem: fix incorrect error handling in ivshmem_recv_msg()
Philippe Mathieu-Daudé [Thu, 27 Jul 2017 02:42:08 +0000 (23:42 -0300)]
ivshmem: fix incorrect error handling in ivshmem_recv_msg()

Screwed up in commit 3a55fc0f, v2.6.0.

If qemu_chr_fe_read_all() returns -EINTR the do {} statement continues and the
n accumulator used to complete reads upto sizeof(msg) is decremented by 4 (the
value of EINTR on Linux).
To avoid that, use simpler if() statements and continue if EINTR occured.

hw/misc/ivshmem.c:650:14: warning: Loss of sign in implicit conversion
    } while (n < sizeof(msg));
             ^

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agoloader: check get_image_size() return value
Philippe Mathieu-Daudé [Thu, 27 Jul 2017 02:42:07 +0000 (23:42 -0300)]
loader: check get_image_size() return value

since a negative value means it errored.

hw/core/loader.c:149:9: warning: Loss of sign in implicit conversion
    if (size > max_sz) {
        ^~~~
hw/core/loader.c:171:9: warning: Loss of sign in implicit conversion
    if (size > memory_region_size(mr)) {
        ^~~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agotests: add missing dependency to build QTEST_QEMU_BINARY
Philippe Mathieu-Daudé [Thu, 27 Jul 2017 02:42:06 +0000 (23:42 -0300)]
tests: add missing dependency to build QTEST_QEMU_BINARY

This allow a one liner from fresh repository clone, i.e.:

  ./configure && make -j check-qtest-aarch64

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: John Snow <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agoqemu-system-tricore: segfault when entering "x 0" on the monitor
Eduardo Otubo [Thu, 27 Jul 2017 14:30:40 +0000 (16:30 +0200)]
qemu-system-tricore: segfault when entering "x 0" on the monitor

Starting Qemu with "qemu-system-tricore -nographic -M tricore_testboard -S"
and entering "x 0" at the monitor prompt leads to Segmentation fault.
This happens because tricore_cpu_get_phys_page_debug() is not implemented
yet, this is a temporary workaround to avoid the crash.

Signed-off-by: Eduardo Otubo <[email protected]>
Tested-by: Thomas Huth <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agobuild-sys: there is no qemu-ga.c
Marc-André Lureau [Thu, 27 Jul 2017 15:45:05 +0000 (17:45 +0200)]
build-sys: there is no qemu-ga.c

It got moved in qga/main.c from commit 2870dc3456c9c.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Michael Roth <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agotests: test-netfilter && pxe-test require slirp
Marc-André Lureau [Thu, 27 Jul 2017 15:45:37 +0000 (17:45 +0200)]
tests: test-netfilter && pxe-test require slirp

If slirp is disabled, it will fail with:

qemu-system-x86_64: -netdev user,id=qtest-bn0: Parameter 'type' expects a netdev backend type

Signed-off-by: Marc-André Lureau <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agoMAINTAINERS: Improve the NetBSD regex pattern
Thomas Huth [Thu, 27 Jul 2017 10:09:34 +0000 (12:09 +0200)]
MAINTAINERS: Improve the NetBSD regex pattern

Currently get_maintainers.pl claims that the configure script is
maintained by Kamil:

 $ scripts/get_maintainer.pl -f configure
 Kamil Rytarowski <[email protected]> (maintainer:NETBSD)
 [email protected] (open list:All patches CC here)

This happens because the regex pattern for the NETBSD entry triggers
on everything that contains the keyword "NetBSD". Ease the situation
a little bit by restricting this to "Subject:" lines only, like
we do it in the "trivial patches" section already.

Reported-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agofix qemu-system-unicore32 crashing when calling without -kernel
Eduardo Otubo [Wed, 26 Jul 2017 15:04:46 +0000 (17:04 +0200)]
fix qemu-system-unicore32 crashing when calling without -kernel

Starting qemu-system-unicore32 without the -kernel parameter results in
an assert() returns false and aborts qemu. This patch replaces it with a
proper error message followed by exit(1).

Signed-off-by: Eduardo Otubo <[email protected]>
Tested-by: Thomas Huth <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agotests: check-qom-proplist: fix leak
Marc-André Lureau [Fri, 9 Jun 2017 13:33:37 +0000 (17:33 +0400)]
tests: check-qom-proplist: fix leak

user_creatable_add_opts() returns a reference (the other reference is
for the root parent/child link).

Leak introduced in commit a1af255f065cc.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.10-20170731' into staging
Peter Maydell [Mon, 31 Jul 2017 08:59:26 +0000 (09:59 +0100)]
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.10-20170731' into staging

ppc patch queue 2017-07-31

This has a couple of last minute bugfixes for qemu 2.10.

# gpg: Signature made Mon 31 Jul 2017 05:25:54 BST
# gpg:                using RSA key 0x6C38CACA20D9B392
# gpg: Good signature from "David Gibson <[email protected]>"
# gpg:                 aka "David Gibson (Red Hat) <[email protected]>"
# gpg:                 aka "David Gibson (ozlabs.org) <[email protected]>"
# gpg:                 aka "David Gibson (kernel.org) <[email protected]>"
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-2.10-20170731:
  Revert "spapr: populate device tree depending on XIVE_EXPLOIT option"
  spapr_drc: fix realize and unrealize

Signed-off-by: Peter Maydell <[email protected]>
7 years agoRevert "spapr: populate device tree depending on XIVE_EXPLOIT option"
David Gibson [Fri, 28 Jul 2017 03:38:50 +0000 (13:38 +1000)]
Revert "spapr: populate device tree depending on XIVE_EXPLOIT option"

This reverts commit b87680427e8a3ff682f66514e99a8344e7437247.

I thought this was a harmless preliminary for XIVE enablement patches
we expect later on.  However, due to some subtle interactions between
qemu and SLOF (guest firmware) this breaks some things.  Revert it for
now, we'll work out how to fix it when the rest of the XIVE patches
are ready.

Signed-off-by: David Gibson <[email protected]>
7 years agospapr_drc: fix realize and unrealize
Greg Kurz [Thu, 27 Jul 2017 13:45:47 +0000 (15:45 +0200)]
spapr_drc: fix realize and unrealize

If object_property_add_alias() returns an error in realize(), we should
propagate it to the caller and certainly not unref the DRC.

Same thing goes for unrealize(). Since object_property_del() is the last
call, we can even get rid of the intermediate Error *.

And finally, unrealize() should undo all registrations performed by
realize().

Signed-off-by: Greg Kurz <[email protected]>
Signed-off-by: David Gibson <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-07-28' into staging
Peter Maydell [Fri, 28 Jul 2017 17:17:44 +0000 (18:17 +0100)]
Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-07-28' into staging

nbd patches for 2017-07-28

- Philippe Mathieu-Daudé - nbd: fix memory leak in nbd_opt_go()

# gpg: Signature made Fri 28 Jul 2017 17:59:39 BST
# gpg:                using RSA key 0xA7A16B4A2527436A
# gpg: Good signature from "Eric Blake <[email protected]>"
# gpg:                 aka "Eric Blake (Free Software Programmer) <[email protected]>"
# gpg:                 aka "[jpeg image of size 6874]"
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A

* remotes/ericb/tags/pull-nbd-2017-07-28:
  nbd: fix memory leak in nbd_opt_go()

Signed-off-by: Peter Maydell <[email protected]>
7 years agonbd: fix memory leak in nbd_opt_go()
Philippe Mathieu-Daudé [Thu, 27 Jul 2017 02:42:09 +0000 (23:42 -0300)]
nbd: fix memory leak in nbd_opt_go()

nbd/client.c:385:12: warning: Potential leak of memory pointed to by 'buf'

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <20170727024224[email protected]>
[introduced in commit 8ecaeae8]
Signed-off-by: Eric Blake <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/yongbok/tags/mips-20170728' into staging
Peter Maydell [Fri, 28 Jul 2017 14:32:44 +0000 (15:32 +0100)]
Merge remote-tracking branch 'remotes/yongbok/tags/mips-20170728' into staging

MIPS patches 2017-07-28

Changes:
* Improve ths MIPS board kernel load error reporting
* Revert unnecessary warning messages

# gpg: Signature made Fri 28 Jul 2017 13:47:52 BST
# gpg:                using RSA key 0x2238EB86D5F797C2
# gpg: Good signature from "Yongbok Kim <[email protected]>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 8600 4CF5 3415 A5D9 4CFA  2B5C 2238 EB86 D5F7 97C2

* remotes/yongbok/tags/mips-20170728:
  Revert "elf-loader: warn about invalid endianness"
  hw/mips: load_elf_strerror to report kernel loading failure

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/kraxel/tags/ui-20170728-pull-request' into...
Peter Maydell [Fri, 28 Jul 2017 13:20:17 +0000 (14:20 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20170728-pull-request' into staging

ui: more keymap fixes for 2.10

# gpg: Signature made Fri 28 Jul 2017 13:59:01 BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>"
# gpg:                 aka "Gerd Hoffmann <[email protected]>"
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20170728-pull-request:
  ui: add pause key to linux_to_qcode
  ui: drop ac_search and ac_stop
  ui: correctly detect spice PAUSE scancode sequence

Signed-off-by: Peter Maydell <[email protected]>
7 years agoRevert "elf-loader: warn about invalid endianness"
Alexey Kardashevskiy [Wed, 26 Jul 2017 23:56:14 +0000 (01:56 +0200)]
Revert "elf-loader: warn about invalid endianness"

This reverts c8e1158cf611 "elf-loader: warn about invalid endianness"
as it produces a useless message every time an LE kernel image is
passed via -kernel on a ppc64-pseries machine. The pseries machine
already checks for ELF_LOAD_WRONG_ENDIAN and tries with big_endian=0.

Signed-off-by: Alexey Kardashevskiy <[email protected]>
Signed-off-by: Aurelien Jarno <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Yongbok Kim <[email protected]>
7 years agohw/mips: load_elf_strerror to report kernel loading failure
Aurelien Jarno [Wed, 26 Jul 2017 23:56:13 +0000 (01:56 +0200)]
hw/mips: load_elf_strerror to report kernel loading failure

Emulated MIPS boards bail out with a simple "could not load kernel" when
a kernel could not be load, without specifying the underlying reason.
Fix that by calling load_elf_strerror.

At the same time use error_report to report the error instead of
fprintf.

Signed-off-by: Aurelien Jarno <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Yongbok Kim <[email protected]>
7 years agoui: add pause key to linux_to_qcode
Gerd Hoffmann [Fri, 28 Jul 2017 06:34:32 +0000 (08:34 +0200)]
ui: add pause key to linux_to_qcode

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
Message-id: 20170728063432[email protected]

7 years agoui: drop ac_search and ac_stop
Gerd Hoffmann [Fri, 28 Jul 2017 06:34:15 +0000 (08:34 +0200)]
ui: drop ac_search and ac_stop

Both keys exist already: "ac_search" is "find" and "ac_stop" is "stop".

Fixes: 37810e80553c19f0dac3644924895a9bf5c70785
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
Message-id: 20170728063415[email protected]

7 years agoui: correctly detect spice PAUSE scancode sequence
Daniel P. Berrange [Thu, 27 Jul 2017 17:46:40 +0000 (18:46 +0100)]
ui: correctly detect spice PAUSE scancode sequence

The SPICE input code is currently detcting 0xe1 0x1d 0x45 as
the PAUSE key make sequence and 0xe1 0x9d 0xc5 as the break
sequence. This is incorrect, because all 6 scancodes together
are the make sequence, and there is no break sequence.

Signed-off-by: Daniel P. Berrange <[email protected]>
Message-id: 20170727174640[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/cohuck/tags/s390x-20170728' into staging
Peter Maydell [Fri, 28 Jul 2017 09:35:02 +0000 (10:35 +0100)]
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20170728' into staging

More s390x fixes: Correct ilen, and ccw checking.

# gpg: Signature made Fri 28 Jul 2017 10:13:42 BST
# gpg:                using RSA key 0xDECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <[email protected]>"
# gpg:                 aka "Cornelia Huck <[email protected]>"
# gpg:                 aka "Cornelia Huck <[email protected]>"
# gpg:                 aka "Cornelia Huck <[email protected]>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20170728:
  s390x/css: fix bits must be zero check for TIC
  s390x/css: check ccw address validity
  target/s390x: fix pgm irq ilen in translate_pages()
  target/s390x: fix pgm irq ilen for stsi

Signed-off-by: Peter Maydell <[email protected]>
7 years agos390x/css: fix bits must be zero check for TIC
Halil Pasic [Tue, 25 Jul 2017 22:44:42 +0000 (00:44 +0200)]
s390x/css: fix bits must be zero check for TIC

According to the PoP bit positions 0-3 and 8-32 of the format-1 CCW must
contain zeros.  Bits 0-3 are already covered by cmd_code validity
checking, and bit 32 is covered by the CCW address checking.

Bits 8-31 correspond to CCW1.flags and CCW1.count.  Currently we only
check for the absence of certain flags.  Let's fix this.

Signed-off-by: Halil Pasic <[email protected]>
Message-Id: <20170725224442[email protected]>
Reviewed-by: Dong Jia Shi <[email protected]>
[CH: tweaked comment]
Signed-off-by: Cornelia Huck <[email protected]>
7 years agos390x/css: check ccw address validity
Halil Pasic [Thu, 27 Jul 2017 15:48:42 +0000 (17:48 +0200)]
s390x/css: check ccw address validity

According to the PoP channel command words (CCW) must be doubleword
aligned and 31 bit addressable for format 1 and 24 bit addressable for
format 0 CCWs.

If the channel subsystem encounters a ccw address which does not satisfy
this alignment requirement a program-check condition is recognised.

The situation with 31 bit addressable is a bit more complicated: both the
ORB and a format 1 CCW TIC hold the address of (the rest of) the channel
program, that is the address of the next CCW in a word, and the PoP
mandates that bit 0 of that word shall be zero -- or a program-check
condition is to be recognized -- and does not belong to the field holding
the ccw address.

Since in code the corresponding fields span across the whole word (unlike
in PoP where these are defined as 31 bit wide) we can check this by
applying a mask. The 24 addressable case isn't affecting TIC because the
address is composed of a halfword and a byte portion (no additional zero
bit requirements) and just slightly complicates the ORB case where also
bits 1-7 need to be zero.

The same requirements (especially n-bit addressability) apply to the
ccw addresses generated while chaining.

Let's make our CSS implementation follow the AR more closely.

Signed-off-by: Halil Pasic <[email protected]>
Message-Id: <20170727154842[email protected]>
Reviewed-by: Dong Jia Shi <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agotarget/s390x: fix pgm irq ilen in translate_pages()
David Hildenbrand [Fri, 21 Jul 2017 12:56:05 +0000 (14:56 +0200)]
target/s390x: fix pgm irq ilen in translate_pages()

0 is certainly wrong. Let's use ILEN_AUTO.

Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <20170721125609[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agotarget/s390x: fix pgm irq ilen for stsi
David Hildenbrand [Fri, 21 Jul 2017 12:56:04 +0000 (14:56 +0200)]
target/s390x: fix pgm irq ilen for stsi

The instruction is 4 bytes long.

Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <20170721125609[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/kraxel/tags/ui-20170727-pull-request' into...
Peter Maydell [Thu, 27 Jul 2017 14:27:06 +0000 (15:27 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20170727-pull-request' into staging

ui: keymap fixes for 2.10

# gpg: Signature made Thu 27 Jul 2017 15:00:06 BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>"
# gpg:                 aka "Gerd Hoffmann <[email protected]>"
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20170727-pull-request:
  ps2: fix sending of PAUSE/BREAK scancodes
  ui: drop altgr and altgr_r QKeyCodes
  ps2: enable multimedia keys
  ui: add multimedia keys
  ui: update keymaps
  ui: move qemu_input_linux_to_qcode()
  ui: add next and prior keysyms

Signed-off-by: Peter Maydell <[email protected]>
7 years agops2: fix sending of PAUSE/BREAK scancodes
Daniel P. Berrange [Thu, 27 Jul 2017 11:32:43 +0000 (12:32 +0100)]
ps2: fix sending of PAUSE/BREAK scancodes

The processing of the scancodes for PAUSE/BREAK  has been broken since
the conversion to qcodes in:

  commit 8c10e0baf0260b59a4e984744462a18016662e3e
  Author: Hervé Poussineau <[email protected]>
  Date:   Thu Sep 15 22:06:26 2016 +0200

    ps2: use QEMU qcodes instead of scancodes

When using a VNC client, with the raw scancode extension, the client
will send a scancode of 0xc6 for both PAUSE and BREAK. There is mistakenly
no entry in the qcode_to_number table for this scancode, so
ps2_keyboard_event() just generates a log message and discards the
scancode

When using a SPICE client, it will also send 0xc6 for BREAK, but
will send 0xe1 0x1d 0x45 0xe1 0x9d 0xc5 for PAUSE. There is no
entry in the qcode_to_number table for the scancode 0xe1 because
it is a special XT keyboard prefix not mapping to any QKeyCode.
Again ps2_keyboard_event() just generates a log message and discards
the scancode. The following 0x1d, 0x45, 0x9d, 0xc5 scancodes get
handled correctly. Rather than trying to handle 3 byte sequences
of scancodes in the PS/2 driver, special case the SPICE input
code so that it captures the 3 byte pause sequence and turns it
into a Pause QKeyCode.

Signed-off-by: Daniel P. Berrange <[email protected]>
Message-id: 20170727113243[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
7 years agoui: drop altgr and altgr_r QKeyCodes
Gerd Hoffmann [Thu, 27 Jul 2017 10:47:20 +0000 (12:47 +0200)]
ui: drop altgr and altgr_r QKeyCodes

The right alt key (alt_r aka KEY_RIGHTALT) is used for AltGr.
The altgr and altgr_r keys simply don't exist.  Drop them.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20170727104720[email protected]

7 years agops2: enable multimedia keys
Gerd Hoffmann [Wed, 26 Jul 2017 15:29:18 +0000 (17:29 +0200)]
ps2: enable multimedia keys

Fixes: 8c10e0baf0260b59a4e984744462a18016662e3e
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20170726152918[email protected]

7 years agoui: add multimedia keys
Gerd Hoffmann [Wed, 26 Jul 2017 15:29:17 +0000 (17:29 +0200)]
ui: add multimedia keys

Add multimedia keys to QKeyCodes and to the keymaps.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20170726152918[email protected]

7 years agoui: update keymaps
Gerd Hoffmann [Wed, 26 Jul 2017 15:29:16 +0000 (17:29 +0200)]
ui: update keymaps

Add recently added QKeyCodes to the keymaps.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20170726152918[email protected]

7 years agoui: move qemu_input_linux_to_qcode()
Gerd Hoffmann [Wed, 26 Jul 2017 15:29:15 +0000 (17:29 +0200)]
ui: move qemu_input_linux_to_qcode()

Move from input-linux.c to input-keymap.c and export it,
so the function is available elsewhere too.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20170726152918[email protected]

7 years agoui: add next and prior keysyms
Gerd Hoffmann [Wed, 26 Jul 2017 15:29:14 +0000 (17:29 +0200)]
ui: add next and prior keysyms

Page-up and Page-down were renamed.  Add the names to the keysym list
so we can parse both old and new names.  The keypad versions are already
present in the vnc map.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20170726152918[email protected]

7 years agoMerge remote-tracking branch 'remotes/awilliam/tags/vfio-fixes-20170726.0' into staging
Peter Maydell [Thu, 27 Jul 2017 09:49:05 +0000 (10:49 +0100)]
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-fixes-20170726.0' into staging

VFIO fixes 2017-07-26

 - Error path use after free bug fixes (Philippe Mathieu-Daudé)

# gpg: Signature made Wed 26 Jul 2017 18:49:00 BST
# gpg:                using RSA key 0x239B9B6E3BB08B22
# gpg: Good signature from "Alex Williamson <[email protected]>"
# gpg:                 aka "Alex Williamson <[email protected]>"
# gpg:                 aka "Alex Williamson <[email protected]>"
# gpg:                 aka "Alex Williamson <[email protected]>"
# Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22

* remotes/awilliam/tags/vfio-fixes-20170726.0:
  vfio/pci: fix use of freed memory
  vfio/platform: fix use of freed memory

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging
Peter Maydell [Thu, 27 Jul 2017 09:15:11 +0000 (10:15 +0100)]
Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging

x86 bug fix for -rc1

Fix for a bug in "-cpu max" that breaks libvirt usage of
query-cpu-model-expansion.

# gpg: Signature made Wed 26 Jul 2017 19:35:28 BST
# gpg:                using RSA key 0x2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <[email protected]>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-pull-request:
  target/i386: Don't use x86_cpu_load_def() on "max" CPU model
  target/i386: Define CPUID_MODEL_ID_SZ macro
  target/i386: Use host_vendor_fms() in max_x86_cpu_initfn()

Signed-off-by: Peter Maydell <[email protected]>
7 years agotarget/i386: Don't use x86_cpu_load_def() on "max" CPU model
Eduardo Habkost [Wed, 12 Jul 2017 16:20:58 +0000 (13:20 -0300)]
target/i386: Don't use x86_cpu_load_def() on "max" CPU model

When commit 0bacd8b3046f ('i386: Don't set CPUClass::cpu_def on
"max" model') removed the CPUClass::cpu_def field, we kept using
the x86_cpu_load_def() helper directly in max_x86_cpu_initfn(),
emulating the previous behavior when CPUClass::cpu_def was set.

However, x86_cpu_load_def() is intended to help initialization of
CPU models from the builtin_x86_defs table, and does lots of
other steps that are not necessary for "max".

One of the things x86_cpu_load_def() do is to set the properties
listed at tcg_default_props/kvm_default_props.  We must not do
that on the "max" CPU model, otherwise under KVM we will
incorrectly report all KVM features as always available, and the
"svm" feature as always unavailable.  The latter caused the bug
reported at:

  https://bugzilla.redhat.com/show_bug.cgi?id=1467599
  ("Unable to start domain: the CPU is incompatible with host CPU:
  Host CPU does not provide required features: svm")

Replace x86_cpu_load_def() with simple object_property_set*()
calls.  In addition to fixing the above bug, this makes the KVM
branch in max_x86_cpu_initfn() very similar to the existing TCG
branch.

For reference, the full list of steps performed by
x86_cpu_load_def() is:

* Setting min-level and min-xlevel.  Already done by
  max_x86_cpu_initfn().
* Setting family/model/stepping/model-id.  Done by the code added
  to max_x86_cpu_initfn() in this patch.
* Copying def->features.  Wrong because "-cpu max" features need to
  be calculated at realize time.  This was not a problem in the
  current code because host_cpudef.features was all zeroes.
* x86_cpu_apply_props() calls.  This causes the bug above, and
  shouldn't be done.
* Setting CPUID_EXT_HYPERVISOR.  Not needed because it is already
  reported by x86_cpu_get_supported_feature_word(), and because
  "-cpu max" features need to be calculated at realize time.
* Setting CPU vendor to host CPU vendor if on KVM mode.
  Redundant, because max_x86_cpu_initfn() already sets it to the
  host CPU vendor.

Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20170712162058[email protected]>
Reviewed-by: Igor Mammedov <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
7 years agotarget/i386: Define CPUID_MODEL_ID_SZ macro
Eduardo Habkost [Wed, 12 Jul 2017 16:20:57 +0000 (13:20 -0300)]
target/i386: Define CPUID_MODEL_ID_SZ macro

Document cpu_x86_fill_model_id() and define CPUID_MODEL_ID_SZ to
help callers use the right buffer size.

Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20170712162058[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
7 years agotarget/i386: Use host_vendor_fms() in max_x86_cpu_initfn()
Eduardo Habkost [Wed, 12 Jul 2017 16:20:56 +0000 (13:20 -0300)]
target/i386: Use host_vendor_fms() in max_x86_cpu_initfn()

The existing code duplicated the logic in host_vendor_fms(), so
reuse the helper function instead.

Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20170712162058[email protected]>
Reviewed-by: Igor Mammedov <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
7 years agovfio/pci: fix use of freed memory
Philippe Mathieu-Daudé [Wed, 26 Jul 2017 17:38:18 +0000 (11:38 -0600)]
vfio/pci: fix use of freed memory

hw/vfio/pci.c:308:29: warning: Use of memory after it is freed
        qemu_set_fd_handler(*pfd, NULL, NULL, vdev);
                            ^~~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Williamson <[email protected]>
7 years agovfio/platform: fix use of freed memory
Philippe Mathieu-Daudé [Wed, 26 Jul 2017 17:38:17 +0000 (11:38 -0600)]
vfio/platform: fix use of freed memory

free the data _after_ using it.

hw/vfio/platform.c:126:29: warning: Use of memory after it is freed
        qemu_set_fd_handler(*pfd, NULL, NULL, NULL);
                            ^~~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Alex Williamson <[email protected]>
7 years agoUpdate version for v2.10.0-rc0 release
Peter Maydell [Tue, 25 Jul 2017 16:13:09 +0000 (17:13 +0100)]
Update version for v2.10.0-rc0 release

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2017-07-25' into staging
Peter Maydell [Tue, 25 Jul 2017 15:27:54 +0000 (16:27 +0100)]
Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2017-07-25' into staging

Block patches for 2.10-rc0

# gpg: Signature made Tue 25 Jul 2017 15:35:12 BST
# gpg:                using RSA key 0xF407DB0061D5CF40
# gpg: Good signature from "Max Reitz <[email protected]>"
# Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40

* remotes/maxreitz/tags/pull-block-2017-07-25:
  qemu-iotests: Fix reference output for 186
  qcow2-bitmap: fix bitmap_free
  qcow: fix memory leaks related to encryption

Signed-off-by: Peter Maydell <[email protected]>
7 years agoqemu-iotests: Fix reference output for 186
Kevin Wolf [Tue, 25 Jul 2017 08:59:36 +0000 (10:59 +0200)]
qemu-iotests: Fix reference output for 186

Commits 70f17a1 ('error: Revert unwanted change of warning messages')
and e1824e5 ('qemu-iotests: Test 'info block'') had a semantic merge
conflict, which results in failure for qemu-iotests case 186. Fix the
reference output to consider the changes of 70f17a1.

Signed-off-by: Kevin Wolf <[email protected]>
Message-id: 1500973176[email protected]
Reviewed-by: Markus Armbruster <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
7 years agoqcow2-bitmap: fix bitmap_free
Vladimir Sementsov-Ogievskiy [Fri, 14 Jul 2017 12:33:41 +0000 (15:33 +0300)]
qcow2-bitmap: fix bitmap_free

Fix possible crash on error path in
qcow2_remove_persistent_dirty_bitmap. Although bitmap_free was added in
88ddffae8fc the bug was introduced later in commit 469c71edc72 (when
qcow2_remove_persistent_dirty_bitmap was added).

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-id: 20170714123341[email protected]
Signed-off-by: Max Reitz <[email protected]>
7 years agoqcow: fix memory leaks related to encryption
Daniel P. Berrange [Fri, 14 Jul 2017 10:31:05 +0000 (11:31 +0100)]
qcow: fix memory leaks related to encryption

Fix leak of the 'encryptopts' string, which was mistakenly
declared const.

Fix leak of QemuOpts entry which should not have been deleted
from the opts array.

Reported by: coverity
Signed-off-by: Daniel P. Berrange <[email protected]>
Message-id: 20170714103105[email protected]
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
7 years agohw/display/sm501: Don't use vmstate_register_ram_global()
Peter Maydell [Mon, 17 Jul 2017 16:37:42 +0000 (17:37 +0100)]
hw/display/sm501: Don't use vmstate_register_ram_global()

The sm501 device uses vmstate_register_ram_global() to register its
memory region for migration.  This means it gets a name that is
assumed to be global to the whole system, which in turn means that if
you create two of the device we assert because of the duplication:

qemu-system-ppc -device sm501 -device sm501
RAMBlock "sm501.local" already registered, abort!
Aborted (core dumped)

Changing this to just use memory_region_init_ram()'s automatic
registration of the memory region with a device-local name fixes
this.  The downside is that it breaks migration compatibility, but
luckily we only added migration support to this device in the 2.10
release cycle so we haven't released a QEMU version with the broken
implementation.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Dr. David Alan Gilbert <[email protected]>
Message-id: 1500309462[email protected]

7 years agoMerge remote-tracking branch 'remotes/cohuck/tags/s390x-20170725' into staging
Peter Maydell [Tue, 25 Jul 2017 10:28:58 +0000 (11:28 +0100)]
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20170725' into staging

Various changes for the s390x code:
- updates for cpu model handling
- fix compilation with --disable-tcg
- fixes in vfio-ccw and I/O instruction handling

# gpg: Signature made Tue 25 Jul 2017 10:15:37 BST
# gpg:                using RSA key 0xDECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <[email protected]>"
# gpg:                 aka "Cornelia Huck <[email protected]>"
# gpg:                 aka "Cornelia Huck <[email protected]>"
# gpg:                 aka "Cornelia Huck <[email protected]>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20170725:
  s390x/css: fix ilen in IO instruction handlers
  target/s390x: Add remaining switches to compile with --disable-tcg
  target/s390x: Move exception-related functions to a new excp_helper.c file
  target/s390x: Rework program_interrupt() and related functions
  target/s390x: Move diag helpers to a separate file
  target/s390x: Move s390_cpu_dump_state() to helper.c
  target/s390x: improve baselining if certain base features are missing
  s390x/kvm: better comment regarding zPCI feature availability
  target/s390x: introduce (test|set)_be_bit
  target/s390x: indicate query subfunction in s390_fill_feat_block
  target/s390x: drop BE_BIT()
  s390/cpumodel: remove KSS from the default model of z14
  vfio/ccw: fix initialization of the Object DeviceState pointer in the common base-device
  vfio/ccw: allocate irq info with the right size

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.10-20170725' into staging
Peter Maydell [Tue, 25 Jul 2017 09:04:39 +0000 (10:04 +0100)]
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.10-20170725' into staging

ppc patch queue 2017-07-25

Last pull request for the 2.10 hard freeze, and correspondingly small.
There are a handful of bugfixes here plus an update for the "pseries"
guest firmware (SLOF).

This is later than ideal for a guest firmware update.  However, this
does include a number of fixes in that guest firmware, so I think it's
worth the risk of squeezing this in just before the hard freeze.

# gpg: Signature made Tue 25 Jul 2017 06:43:14 BST
# gpg:                using RSA key 0x6C38CACA20D9B392
# gpg: Good signature from "David Gibson <[email protected]>"
# gpg:                 aka "David Gibson (Red Hat) <[email protected]>"
# gpg:                 aka "David Gibson (ozlabs.org) <[email protected]>"
# gpg:                 aka "David Gibson (kernel.org) <[email protected]>"
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-2.10-20170725:
  pseries: Update SLOF firmware image
  spapr: Fix QEMU abort during memory unplug
  spapr/htab: fix savevm
  spapr_pci: Fix obsolete comment about MSIX encoding in addr/data

Signed-off-by: Peter Maydell <[email protected]>
7 years agos390x/css: fix ilen in IO instruction handlers
Halil Pasic [Mon, 24 Jul 2017 14:34:52 +0000 (16:34 +0200)]
s390x/css: fix ilen in IO instruction handlers

When initiating a program check interruption by calling program_interrupt
the instruction length (ilen) of the current instruction is supplied as
the third parameter.

On s390x all the IO instructions are of instruction format S and their
ilen is 4.  The calls to program_interrupt (introduced by commits
7b18aad543 ("s390: Add channel I/O instructions.", 2013-01-24) and
61bf0dcb2e ("s390x/ioinst: Add missing alignment checks for IO
instructions", 2013-06-21)) however use ilen == 2.

This is probably due to a confusion between ilen which specifies the
instruction length in bytes and ILC which does the same but in halfwords.
If kvm_enabled() this does not actually matter, because the ilen
parameter of program_interrupt is effectively unused.

Let's provide the correct ilen to program_interrupt.

Signed-off-by: Halil Pasic <[email protected]>
Fixes: 7b18aad543 ("s390: Add channel I/O instructions.")
Fixes: 61bf0dcb2e ("s390x/ioinst: Add missing alignment checks for IO instructions")
Reviewed-by: David Hildenbrand <[email protected]>
Message-Id: <20170724143452[email protected]>
Reviewed-by: Dong Jia Shi <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agotarget/s390x: Add remaining switches to compile with --disable-tcg
Thomas Huth [Mon, 24 Jul 2017 08:52:50 +0000 (10:52 +0200)]
target/s390x: Add remaining switches to compile with --disable-tcg

Adding some CONFIG_TCG tests to be finally able to compile QEMU
on s390x also without TCG.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
Message-Id: <1500886370[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agotarget/s390x: Move exception-related functions to a new excp_helper.c file
Thomas Huth [Mon, 24 Jul 2017 08:52:49 +0000 (10:52 +0200)]
target/s390x: Move exception-related functions to a new excp_helper.c file

These functions can not be compiled with --disable-tcg. But since we
need the other functions from helper.c in the non-tcg build, we can also
not simply remove helper.c from the non-tcg builds. Thus the problematic
functions have to be moved into a separate new file instead that we
can later omit in the non-tcg builds.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
Message-Id: <1500886370[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agotarget/s390x: Rework program_interrupt() and related functions
Thomas Huth [Mon, 24 Jul 2017 08:52:48 +0000 (10:52 +0200)]
target/s390x: Rework program_interrupt() and related functions

misc_helper.c won't be compiled with --disable-tcg anymore, but we
still need the program_interrupt() function in that case. Move it
to interrupt.c instead, and refactor it to re-use the code from
trigger_pgm_exception() (for TCG) and enter_pgmcheck() (for KVM,
which now got renamed to kvm_s390_program_interrupt() for
clarity).

Signed-off-by: Thomas Huth <[email protected]>
Message-Id: <1500886370[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agotarget/s390x: Move diag helpers to a separate file
Thomas Huth [Mon, 24 Jul 2017 08:52:47 +0000 (10:52 +0200)]
target/s390x: Move diag helpers to a separate file

misc_helper.c won't be compiled with --disable-tcg anymore, but we
still need the diag helpers in KVM builds, too, so move the helper
functions to a separate file.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
Message-Id: <1500886370[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agotarget/s390x: Move s390_cpu_dump_state() to helper.c
Thomas Huth [Mon, 24 Jul 2017 08:52:46 +0000 (10:52 +0200)]
target/s390x: Move s390_cpu_dump_state() to helper.c

translate.c can not be compiled with --disable-tcg, but we need
the s390_cpu_dump_state() in KVM-only builds, too. So let's move
that function to helper.c instead, which will also be compiled
when --disable-tcg has been specified.

Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
Message-Id: <1500886370[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agotarget/s390x: improve baselining if certain base features are missing
David Hildenbrand [Thu, 20 Jul 2017 12:37:21 +0000 (14:37 +0200)]
target/s390x: improve baselining if certain base features are missing

There are certain features that we put into base models, but that are
not relevant for the actual search. The most famous example are
MSA subfunctions that might be disabled on certain real hardware out
there.

While the kvm host model detection will usually detect the correct model
on such machines (as it will in the common case not pass features to check
for into s390_find_cpu_def()), baselining will fall back to a quite old
model just because some MSA subfunctions are missing.

Let's improve that by ignoring lack of these features while performing
the search for a base model.

Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <20170720123721[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agos390x/kvm: better comment regarding zPCI feature availability
David Hildenbrand [Thu, 20 Jul 2017 12:37:20 +0000 (14:37 +0200)]
s390x/kvm: better comment regarding zPCI feature availability

Acked-by: Christian Borntraeger <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <20170720123721[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agotarget/s390x: introduce (test|set)_be_bit
David Hildenbrand [Thu, 20 Jul 2017 12:37:19 +0000 (14:37 +0200)]
target/s390x: introduce (test|set)_be_bit

Using ordinary bitmap operations to set/test bits does not work properly
on architectures !s390x. Let's drop (test|set)_bit_inv and introduce
(test|set)_be_bit instead. These functions work on uint8_t array, not on
unsigned longs arrays and are for now only used in the context of
CPU features.

Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <20170720123721[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agotarget/s390x: indicate query subfunction in s390_fill_feat_block
David Hildenbrand [Thu, 20 Jul 2017 12:37:18 +0000 (14:37 +0200)]
target/s390x: indicate query subfunction in s390_fill_feat_block

We'll have to do the same for TCG, so let's just move it in there.

Reviewed-by: Christian Borntraeger <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <20170720123721[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agotarget/s390x: drop BE_BIT()
David Hildenbrand [Thu, 20 Jul 2017 12:37:17 +0000 (14:37 +0200)]
target/s390x: drop BE_BIT()

Unused and broken, let's just get rid of it.

Acked-by: Christian Borntraeger <[email protected]>
Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <20170720123721[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
7 years agos390/cpumodel: remove KSS from the default model of z14
Christian Borntraeger [Thu, 20 Jul 2017 11:27:31 +0000 (13:27 +0200)]
s390/cpumodel: remove KSS from the default model of z14

The SIE_KSS feature will allow a guest to use KSS for a nested guest.
To create a nested guest the SIE_F2 facility is still necessary.
Since SIE_F2 is not part of the default model it does not make
a lot of sense to provide the SIE_KSS feature in the default model.
Let's also create a dependency check.

Signed-off-by: Christian Borntraeger <[email protected]>
Reviewed-by: Jason J. Herne <[email protected]>
Reviewed-by: Janosch Frank <[email protected]>
Message-Id: <1500550051[email protected]>
Acked-by: David Hildenbrand <[email protected]>
Signed-off-by: Cornelia Huck <[email protected]>
This page took 0.094901 seconds and 4 git commands to generate.