]> Git Repo - qemu.git/log
qemu.git
8 years agoblock: Add "read-only" to the options QDict
Alberto Garcia [Thu, 15 Sep 2016 14:53:02 +0000 (17:53 +0300)]
block: Add "read-only" to the options QDict

This adds the "read-only" option to the QDict. One important effect of
this change is that when a child inherits options from its parent, the
existing "read-only" mode can be preserved if it was explicitly set
previously.

This addresses scenarios like this:

   [E] <- [D] <- [C] <- [B] <- [A]

In this case, if we reopen [D] with read-only=off, and later reopen
[B], then [D] will not inherit read-only=on from its parent during the
bdrv_reopen_queue_child() stage.

The BDRV_O_RDWR flag is not removed yet, but its keep in sync with the
value of the "read-only" option.

Signed-off-by: Alberto Garcia <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
8 years agoblock: Update bs->open_flags earlier in bdrv_open_common()
Alberto Garcia [Thu, 15 Sep 2016 14:53:01 +0000 (17:53 +0300)]
block: Update bs->open_flags earlier in bdrv_open_common()

We're only doing this immediately before opening the image, but
bs->open_flags is used earlier in the function. At the moment this is
not causing problems because none of the checked flags are modified by
update_flags_from_options(), but this will change when we introduce
the "read-only" option.

This patch calls update_flags_from_options() at the beginning of the
function, immediately after creating the QemuOpts.

Signed-off-by: Alberto Garcia <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
8 years agoblock: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flags
Alberto Garcia [Thu, 15 Sep 2016 14:53:00 +0000 (17:53 +0300)]
block: Set BDRV_O_ALLOW_RDWR and snapshot_options before storing the flags

If an image is opened with snapshot=on, its flags are modified by
bdrv_backing_options() and then bs->open_flags is updated accordingly.
This last step is unnecessary if we calculate the new flags before
setting bs->open_flags.

Soon we'll introduce the "read-only" option, and then we'll need to
be able to modify its value in the QDict when snapshot=on. This is
more cumbersome if bs->options is already set. This patch simplifies
that. Other than that, there are no semantic changes. Although it
might seem that bs->options can have a different value now because
it is stored after calling bdrv_backing_options(), this call doesn't
actually modify them in this scenario.

The code that sets BDRV_O_ALLOW_RDWR is also moved for the same
reason.

Signed-off-by: Alberto Garcia <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
8 years agoblock: Remove bdrv_is_snapshot
Alberto Garcia [Thu, 15 Sep 2016 14:52:59 +0000 (17:52 +0300)]
block: Remove bdrv_is_snapshot

This is unnecessary and has been unused since 5433c24f0f9306c82ad9bcc.

Signed-off-by: Alberto Garcia <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
8 years agotests: allow to specify list of formats to test for check-block.sh
Denis V. Lunev [Thu, 15 Sep 2016 16:42:49 +0000 (19:42 +0300)]
tests: allow to specify list of formats to test for check-block.sh

This would make code better and allow to test specific format.

Signed-off-by: Denis V. Lunev <[email protected]>
CC: Stefan Hajnoczi <[email protected]>
CC: Kevin Wolf <[email protected]>
CC: Paolo Bonzini <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
8 years agohmp: Remove dead code in hmp_qemu_io()
Kevin Wolf [Thu, 15 Sep 2016 15:44:16 +0000 (17:44 +0200)]
hmp: Remove dead code in hmp_qemu_io()

blk can never be NULL, drop the check. This fixes a Coverity warning.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
8 years agoqcow2: fix encryption during cow of sectors
Daniel P. Berrange [Tue, 6 Sep 2016 14:26:37 +0000 (15:26 +0100)]
qcow2: fix encryption during cow of sectors

Broken in previous commit:

  commit aaa4d20b4972bb1a811ce929502e6741835d584e
  Author: Kevin Wolf <[email protected]>
  Date:   Wed Jun 1 15:21:05 2016 +0200

      qcow2: Make copy_sectors() byte based

The copy_sectors() code was originally using the 'sector'
parameter for encryption, which was passed in by the caller
from the QCowL2Meta.offset field (aka the guest logical
offset).

After the change, the code is using 'cluster_offset' which
was passed in from QCow2L2Meta.alloc_offset field (aka the
host physical offset).

This would cause the data to be encrypted using an incorrect
initialization vector which will in turn cause later reads
to return garbage.

Although current qcow2 built-in encryption is blocked from
usage in the emulator, one could still hit this if writing
to the file via qemu-{img,io,nbd} commands.

Cc: [email protected]
Signed-off-by: Daniel P. Berrange <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
8 years agoMerge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
Peter Maydell [Fri, 23 Sep 2016 11:12:55 +0000 (12:12 +0100)]
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

* More KVM LAPIC fixes
* fix divide-by-zero regression on libiscsi SG devices
* fix qemu-char segfault
* add scripts/show-fixed-bugs.sh

# gpg: Signature made Thu 22 Sep 2016 19:20:57 BST
# gpg:                using RSA key 0xBFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <[email protected]>"
# gpg:                 aka "Paolo Bonzini <[email protected]>"
# 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:
  kvm: fix events.flags (KVM_VCPUEVENT_VALID_SMM) overwritten by 0
  scripts: Add a script to check for bug URLs in the git log
  msmouse: Fix segfault caused by free the chr before chardev cleanup.
  iscsi: Fix divide-by-zero regression on raw SG devices
  kvm: apic: set APIC base as part of kvm_apic_put
  target-i386: introduce kvm_put_one_msr

Signed-off-by: Peter Maydell <[email protected]>
8 years agolinux-user: Add missing Mips syscalls items in strace.list
Aleksandar Markovic [Mon, 19 Sep 2016 11:44:44 +0000 (13:44 +0200)]
linux-user: Add missing Mips syscalls items in strace.list

Without this patch, a number of Mips syscalls will be logged in the following
way (in this example, this is an invocation of accept4()):

  86906 Unknown syscall 4334

This patch provides standard Qemu's strace output for such cases, like this:

  95861 accept4(3,1996486000,1996486016,128,0,0) = 5

Such output may be further improved by providing strace-related functions
that handle only particular syscalls, but this is beyond the scope of
this patch.

Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Acked-by: Riku Voipio <[email protected]>
Signed-off-by: Leon Alrae <[email protected]>
8 years agolinux-user: Add missing TARGET_EDQUOT error code for Mips
Aleksandar Markovic [Mon, 19 Sep 2016 11:44:43 +0000 (13:44 +0200)]
linux-user: Add missing TARGET_EDQUOT error code for Mips

EDQUOT is defined for Mips platform in Linux kernel in such a way
that it has different value than on most other platforms. However,
correspondent TARGET_EDQUOT for Mips is missing in Qemu code. Moreover,
TARGET_EDQUOT is missing from the table for conversion of error codes
from host to target. This patch fixes these problems.

Without this patch, syscalls add_key(), keyctl(), link(), mkdir(), mknod(),
open(), rename(), request_key(), setxattr(), symlink(), and write() will not
be able to return the right error code in some scenarios on Mips platform.
(Some of these syscalls are not yet supported in Qemu, but once they are
supported, they will need correct EDQUOT handling.)

Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Acked-by: Riku Voipio <[email protected]>
Signed-off-by: Leon Alrae <[email protected]>
8 years agolinux-user: Fix certain argument alignment cases for Mips64
Aleksandar Markovic [Mon, 19 Sep 2016 11:44:42 +0000 (13:44 +0200)]
linux-user: Fix certain argument alignment cases for Mips64

The function that is changed in this patch is supposed to indicate that
there was certain argument rearrangement related to 64-bit arguments on
32-bit platforms. The background on such rearrangements can be found,
for example, in the man page for syscall(2).

However, for 64-bit Mips architectures there is no such rearrangement,
and this patch reflects it.

Signed-off-by: Aleksandar Rikalo <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Reviewed-by: Leon Alrae <[email protected]>
Acked-by: Riku Voipio <[email protected]>
Signed-off-by: Leon Alrae <[email protected]>
8 years agolinux-user: Fix structure target_semid64_ds definition for Mips
Aleksandar Markovic [Mon, 19 Sep 2016 11:44:41 +0000 (13:44 +0200)]
linux-user: Fix structure target_semid64_ds definition for Mips

This patch corrects target_semid64_ds structure definition for Mips.

See, for example definition of semid64_ds for Mips in Linux kernel:
arch/mips/include/uapi/asm/sembuf.h#L13.

This patch will also fix certain semaphore-related LTP tests for Mips,
if they are executed in Qemu user mode for any Mips platform.

Signed-off-by: Miodrag Dinic <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Reviewed-by: Leon Alrae <[email protected]>
Acked-by: Riku Voipio <[email protected]>
Signed-off-by: Leon Alrae <[email protected]>
8 years agolinux-user: Fix structure target_flock definition for Mips
Aleksandar Markovic [Mon, 19 Sep 2016 11:44:40 +0000 (13:44 +0200)]
linux-user: Fix structure target_flock definition for Mips

Structure flock is defined for Mips in a way different from any
other platform. For reference, see Linux kernel source code files:

arch/mips/include/uapi/asm/fcntl.h, line 63 (for Mips)
include/uapi/asm-generic/fcntl.h, line 195 (for all other platforms)

This patch fix this problem, by amending structure target_flock,
for Mips only.

Besides, this patch fixes LTP tests fcntl11, fcntl17, fcntl19, fcntl20,
and fcntl21, which are currently failing, if executed in Qemu user mode
for Mips platforms.

Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Reviewed-by: Leon Alrae <[email protected]>
Acked-by: Riku Voipio <[email protected]>
Signed-off-by: Leon Alrae <[email protected]>
8 years agolinux-user: Fix TARGET_F_GETOWN definition for Mips
Aleksandar Markovic [Mon, 19 Sep 2016 11:44:39 +0000 (13:44 +0200)]
linux-user: Fix TARGET_F_GETOWN definition for Mips

For some reason, Qemu's TARGET_F_GETOWN constant for Mips does not
match the correct value of correspondent F_GETOWN. This patch fixes
this problem.

For reference, see Mips' F_GETOWN definition in Linux kernel at
arch/mips/include/uapi/asm/fcntl.h#L44.

This patch also fixes some fcntl()-related LTP tests for Qemu
user mode for Mips.

Signed-off-by: Miodrag Dinic <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Reviewed-by: Leon Alrae <[email protected]>
Acked-by: Riku Voipio <[email protected]>
Signed-off-by: Leon Alrae <[email protected]>
8 years agolinux-user: Fix TARGET_SIOCATMARK definition for Mips
Aleksandar Markovic [Mon, 19 Sep 2016 11:44:38 +0000 (13:44 +0200)]
linux-user: Fix TARGET_SIOCATMARK definition for Mips

This patch fixes wrong definition of TARGET_SIOCATMARK for mips,
alpha, and sh4.

The current definition is:

  #define SIOCATMARK      0x8905

while the correct definition is:

  #define SIOCATMARK      TARGET_IOR('s', 7, int)

See Linux kernel source file arch/mips/include/uapi/asm/sockios.h#L19
for reference.

This patch also a fixes LTP test failure for test sockioctl01, for
mips, alpha, and sh4.

Signed-off-by: Aleksandar Rikalo <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Laurent Vivier <[email protected]>
Reviewed-by: Leon Alrae <[email protected]>
Acked-by: Riku Voipio <[email protected]>
Signed-off-by: Leon Alrae <[email protected]>
8 years agotarget-mips: generate fences
Leon Alrae [Thu, 8 Sep 2016 10:01:01 +0000 (11:01 +0100)]
target-mips: generate fences

Make use of memory barrier TCG opcode in MIPS front end.

Signed-off-by: Leon Alrae <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
8 years agotarget-mips: add 24KEc CPU definition
André Draszik [Mon, 25 Jul 2016 23:42:45 +0000 (00:42 +0100)]
target-mips: add 24KEc CPU definition

Define a new CPU definition supporting 24KEc cores, similar to
the existing 24Kc, but with added support for DSP instructions
and MIPS16e (and without FPU).

Signed-off-by: André Draszik <[email protected]>
Signed-off-by: Leon Alrae <[email protected]>
8 years agodocker: exec $CMD
Fam Zheng [Wed, 21 Sep 2016 03:49:28 +0000 (11:49 +0800)]
docker: exec $CMD

This is the last command to run (unless DEBUG), make it 'exec' to
simplify the process tree.

Signed-off-by: Fam Zheng <[email protected]>
Message-Id: <1474429768[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
8 years agodocker: Terminate instances at SIGTERM and SIGHUP
Fam Zheng [Wed, 21 Sep 2016 03:49:27 +0000 (11:49 +0800)]
docker: Terminate instances at SIGTERM and SIGHUP

Signed-off-by: Fam Zheng <[email protected]>
Message-Id: <1474429768[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
8 years agodocker: Support showing environment information
Fam Zheng [Wed, 21 Sep 2016 03:49:26 +0000 (11:49 +0800)]
docker: Support showing environment information

Add a make variable SHOW_ENV. When it's set to non empty, print the
package information and environment variables.

Signed-off-by: Fam Zheng <[email protected]>
Message-Id: <1474429768[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
8 years agodocker: Print used options before doing configure
Fam Zheng [Wed, 21 Sep 2016 03:49:25 +0000 (11:49 +0800)]
docker: Print used options before doing configure

This makes the configure command more obvious which usually has useful
information.

Signed-off-by: Fam Zheng <[email protected]>
Message-Id: <1474429768[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
8 years agodocker: Flatten default target list in test-quick
Fam Zheng [Wed, 21 Sep 2016 03:49:24 +0000 (11:49 +0800)]
docker: Flatten default target list in test-quick

Previously it is expanded to a whitespace separated list which is not
the most appropriate format. Since it's only two items, flatten it.

Signed-off-by: Fam Zheng <[email protected]>
Message-Id: <1474429768[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
8 years agodocker: Update fedora image to latest
Fam Zheng [Wed, 21 Sep 2016 03:49:23 +0000 (11:49 +0800)]
docker: Update fedora image to latest

Now that 23 is becoming an "old" release with 24 available. Fedora has a
quick release cycle, so use latest to follow more closely.

Signed-off-by: Fam Zheng <[email protected]>
Message-Id: <1474429768[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
8 years agodocker: Generate /packages.txt in ubuntu image
Fam Zheng [Wed, 21 Sep 2016 03:49:22 +0000 (11:49 +0800)]
docker: Generate /packages.txt in ubuntu image

Put the list of package names in an environment, and output their
package names to the target file in the end.

Signed-off-by: Fam Zheng <[email protected]>
Message-Id: <1474429768[email protected]>
Reviewed-by: Daniel. P. Berrange <[email protected]>
8 years agodocker: Generate /packages.txt in fedora image
Fam Zheng [Wed, 21 Sep 2016 03:49:21 +0000 (11:49 +0800)]
docker: Generate /packages.txt in fedora image

Put the list of package names in an environment, and output their
package names to the target file in the end.

Signed-off-by: Fam Zheng <[email protected]>
Message-Id: <1474429768[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
8 years agodocker: Generate /packages.txt in centos6 image
Fam Zheng [Wed, 21 Sep 2016 03:49:20 +0000 (11:49 +0800)]
docker: Generate /packages.txt in centos6 image

Put the list of package names in an environment, and output their
package names to the target file in the end.

Signed-off-by: Fam Zheng <[email protected]>
Message-Id: <1474429768[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
8 years agotests: Ignore test-uuid
Fam Zheng [Wed, 21 Sep 2016 04:27:26 +0000 (12:27 +0800)]
tests: Ignore test-uuid

Signed-off-by: Fam Zheng <[email protected]>
Message-Id: <1474432046[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
8 years agoAdd UUID files to MAINTAINERS
Fam Zheng [Wed, 21 Sep 2016 04:27:25 +0000 (12:27 +0800)]
Add UUID files to MAINTAINERS

I understand that we've been keeping eyes on the uncovered files. Since
I'm adding some more files I volunteer to look after them in the futuer.

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-Id: <1474432046[email protected]>

8 years agotests: Add uuid tests
Fam Zheng [Wed, 21 Sep 2016 04:27:24 +0000 (12:27 +0800)]
tests: Add uuid tests

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-Id: <1474432046[email protected]>

8 years agouuid: Tighten uuid parse
Fam Zheng [Wed, 21 Sep 2016 04:27:23 +0000 (12:27 +0800)]
uuid: Tighten uuid parse

sscanf is relatively loose (tolerate) on some invalid formats that we
should fail instead of generating a wrong uuid structure, like with
whitespaces and short strings.

Add and use a helper function to first check the format.

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-Id: <1474432046[email protected]>

8 years agovl: Switch qemu_uuid to QemuUUID
Fam Zheng [Wed, 21 Sep 2016 04:27:22 +0000 (12:27 +0800)]
vl: Switch qemu_uuid to QemuUUID

Update all qemu_uuid users as well, especially get rid of the duplicated
low level g_strdup_printf, sscanf and snprintf calls with QEMU UUID API.

Since qemu_uuid_parse is quite tangled with qemu_uuid, its switching to
QemuUUID is done here too to keep everything in sync and avoid code
churn.

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-Id: <1474432046[email protected]>

8 years agoconfigure: Remove detection code for UUID
Fam Zheng [Wed, 21 Sep 2016 04:27:21 +0000 (12:27 +0800)]
configure: Remove detection code for UUID

All code now uses built-in UUID implementation. Remove the code of
libuuid and make --enable-uuid and --disable-uuid only print a message.

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-Id: <1474432046[email protected]>

8 years agotests: No longer dependent on CONFIG_UUID
Fam Zheng [Wed, 21 Sep 2016 04:27:20 +0000 (12:27 +0800)]
tests: No longer dependent on CONFIG_UUID

crypto now uses built-in uuid implementation, so this check is not
needed.

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-Id: <1474432046[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
8 years agocrypto: Switch to QEMU UUID API
Fam Zheng [Wed, 21 Sep 2016 04:27:19 +0000 (12:27 +0800)]
crypto: Switch to QEMU UUID API

The uuid generation doesn't return error, so update the function
signature and calling code accordingly.

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-Id: <1474432046[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
8 years agovpc: Use QEMU UUID API
Fam Zheng [Wed, 21 Sep 2016 04:27:18 +0000 (12:27 +0800)]
vpc: Use QEMU UUID API

Previously we conditionally generated footer->uuid, when libuuid was
available. Now that we have a built-in implementation, we can switch to
it.

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-Id: <1474432046[email protected]>

8 years agovdi: Use QEMU UUID API
Fam Zheng [Wed, 21 Sep 2016 04:27:17 +0000 (12:27 +0800)]
vdi: Use QEMU UUID API

The UUID operations we need from libuuid are fully supported by QEMU UUID
implementation. Use it, and remove the unused code.

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-Id: <1474432046[email protected]>

8 years agovhdx: Use QEMU UUID API
Fam Zheng [Wed, 21 Sep 2016 04:27:16 +0000 (12:27 +0800)]
vhdx: Use QEMU UUID API

This removes our dependency to libuuid, so that the driver can always be
built.

Similar to how we handled data plane configure options, --enable-vhdx
and --disable-vhdx are also changed to a nop with a message saying it's
obsolete.

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-Id: <1474432046[email protected]>

8 years agouuid: Make null_uuid static
Fam Zheng [Wed, 21 Sep 2016 04:27:15 +0000 (12:27 +0800)]
uuid: Make null_uuid static

So that it doesn't have to be zeroed at each call.

Suggested-by: Eric Blake <[email protected]>
Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-Id: <1474432046[email protected]>

8 years agoutil: Add UUID API
Fam Zheng [Wed, 21 Sep 2016 04:27:14 +0000 (12:27 +0800)]
util: Add UUID API

A number of different places across the code base use CONFIG_UUID. Some
of them are soft dependency, some are not built if libuuid is not
available, some come with dummy fallback, some throws runtime error.

It is hard to maintain, and hard to reason for users.

Since UUID is a simple standard with only a small number of operations,
it is cleaner to have a central support in libqemuutil. This patch adds
qemu_uuid_* functions that all uuid users in the code base can
rely on. Except for qemu_uuid_generate which is new code, all other
functions are just copy from existing fallbacks from other files.

Note that qemu_uuid_parse is moved without updating the function
signature to use QemuUUID, to keep this patch simple.

Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Jeff Cody <[email protected]>
Message-Id: <1474432046[email protected]>

8 years agodocker: Handle exceptions when looking for docker command
Eduardo Habkost [Tue, 20 Sep 2016 11:05:59 +0000 (08:05 -0300)]
docker: Handle exceptions when looking for docker command

When trying to run docker tests on a host without the docker
command,  we get the following Python backtrace:

  $ make docker-test-quick@centos6 V=1
  .../qemu/tests/docker/docker.py build qemu:centos6 .../qemu/tests/docker/dockerfiles/centos6.docker
  Traceback (most recent call last):
    File ".../qemu/tests/docker/docker.py", line 339, in <module>
      sys.exit(main())
    File ".../qemu/tests/docker/docker.py", line 336, in main
      return args.cmdobj.run(args, argv)
    File ".../qemu/tests/docker/docker.py", line 231, in run
      dkr = Docker()
    File ".../qemu/tests/docker/docker.py", line 98, in __init__
      self._command = _guess_docker_command()
    File ".../qemu/tests/docker/docker.py", line 41, in _guess_docker_command
      stdout=DEVNULL, stderr=DEVNULL) == 0:
    File "/usr/lib64/python2.7/subprocess.py", line 523, in call
      return Popen(*popenargs, **kwargs).wait()
    File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
      errread, errwrite)
    File "/usr/lib64/python2.7/subprocess.py", line 1343, in _execute_child
      raise child_exception
  OSError: [Errno 2] No such file or directory
  .../qemu/tests/docker/Makefile.include:47: recipe for target 'docker-image-centos6' failed
  make: *** [docker-image-centos6] Error 1

Change _guess_docker_command() to handle OSError exceptions
raised by subprocess.call(), so we will keep looking for other
commands and print a better error message.

New output will be:

  $ make docker-test-quick@centos6 V=1
  .../qemu/tests/docker/docker.py build qemu:centos6 .../qemu/tests/docker/dockerfiles/centos6.docker
  Traceback (most recent call last):
    File ".../qemu/tests/docker/docker.py", line 343, in <module>
      sys.exit(main())
    File ".../qemu/tests/docker/docker.py", line 340, in main
      return args.cmdobj.run(args, argv)
    File ".../qemu/tests/docker/docker.py", line 235, in run
      dkr = Docker()
    File ".../qemu/tests/docker/docker.py", line 102, in __init__
      self._command = _guess_docker_command()
    File ".../qemu/tests/docker/docker.py", line 49, in _guess_docker_command
      commands_txt)
  Exception: Cannot find working docker command. Tried:
    docker
    sudo -n docker
  .../qemu/tests/docker/Makefile.include:47: recipe for target 'docker-image-centos6' failed
  make: *** [docker-image-centos6] Error 1

Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <1474369559[email protected]>
[exceptions.OSError -> OSError and drop the import. - Fam]
Signed-off-by: Fam Zheng <[email protected]>
8 years agospapr_pci: Add numa node id
Alexey Kardashevskiy [Wed, 27 Jul 2016 08:03:38 +0000 (18:03 +1000)]
spapr_pci: Add numa node id

This adds a numa id property to a PHB to allow linking passed PCI device
to CPU/memory. It is up to the management stack to do CPU/memory pinning
to the node with the actual PCI device.

Signed-off-by: Alexey Kardashevskiy <[email protected]>
[dwg: Renamed property from "node" to "numa_node" to match the similar
 one in the pxb device]
Signed-off-by: David Gibson <[email protected]>
8 years agomonitor: fix crash for platforms without a CPU 0
David Gibson [Wed, 21 Sep 2016 05:29:26 +0000 (15:29 +1000)]
monitor: fix crash for platforms without a CPU 0

Now that we allow CPU hot unplug on a few platforms, we can end up in a
situation where we don't have a CPU with index 0.  Or at least we could,
if we didn't have code to explicitly prohibit unplug of CPU 0.

Longer term we want to allow CPU 0 unplug, this patch is an early step in
allowing this, by removing an assumption in the monitor code that CPU 0
always exists.

Signed-off-by: Cédric Le Goater <[email protected]>
[dwg: Rewrote commit message to better explain background]
Reviewed-by: Igor Mammedov <[email protected]>
Reviewed-by: Eduardo Habkost <[email protected]>
Reviewed-by: Luiz Capitulino <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agolinux-user: ppc64: fix ARCH_206 bit in AT_HWCAP
Michael Walle [Wed, 21 Sep 2016 09:57:05 +0000 (11:57 +0200)]
linux-user: ppc64: fix ARCH_206 bit in AT_HWCAP

Only the POWER[789] CPUs should have the ARCH_206 bit set. This is what the
linux kernel does. I guess this was also the intention of commit 0e019746.
We have to make sure all *206 bits are set.

Before this patch, the flags check in the GET_FEATURES2 macro returned true
if _any_ bit was set. This worked well as long as there was only one bit
set in the 'flag' parameter. But as explained before, we have to make sure
all bits in the 'flag' parameter are set.

Signed-off-by: Michael Walle <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agoppc/kvm: Mark 64kB page size support as disabled if not available
Thomas Huth [Wed, 21 Sep 2016 09:42:15 +0000 (11:42 +0200)]
ppc/kvm: Mark 64kB page size support as disabled if not available

QEMU currently refuses to start with KVM-PR and only prints out

qemu: fatal: Unknown MMU model 851972

when being started there. This is because commit 4322e8ced5aaac719
("ppc: Fix 64K pages support in full emulation") introduced a new
POWERPC_MMU_64K bit to indicate support for this page size, but
it never gets cleared on KVM-PR if the host kernel does not support
this. Thus we've got to turn off this bit in the mmu_model for KVM-PR.

Signed-off-by: Thomas Huth <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agoppc/xics: An ICS with offset 0 is assumed to be uninitialized
Benjamin Herrenschmidt [Mon, 19 Sep 2016 06:29:32 +0000 (11:59 +0530)]
ppc/xics: An ICS with offset 0 is assumed to be uninitialized

This will make life easier for dealing with dynamically configured
ICSes such as PHB3

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Reviewed-by: David Gibson <[email protected]>
Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agoppc/xics: account correct irq status
Nikunj A Dadhania [Mon, 19 Sep 2016 06:29:29 +0000 (11:59 +0530)]
ppc/xics: account correct irq status

Fix inconsistent irq status, because of this in the trace logs, for e.g.
LSI status was 0x7, i.e. XICS_STATUS_ASSERTED, XICS_STATUS_SENT and
XICS_STATUS_REJECTED all set, which did not make sense. So the REJECTED
would have been set in earlier interrupt cycle, and then asserted and
sent in this current one.

Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agoEnable H_CLEAR_MOD and H_CLEAR_REF hypercalls on KVM/PPC64.
Nathan Whitehorn [Tue, 30 Aug 2016 01:02:47 +0000 (01:02 +0000)]
Enable H_CLEAR_MOD and H_CLEAR_REF hypercalls on KVM/PPC64.

These are mandatory per PAPR and available on Linux 4.3 and newer kernels. The calls in question are required to run FreeBSD guests with reasonable performance, so enable them if possible.

Signed-off-by: Nathan Whitehorn <[email protected]>
[dwg: Added a stub to fix compile without KVM (e.g. on x86 host)]
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: tlbie/tlbivax should have global effect
Nikunj A Dadhania [Tue, 20 Sep 2016 16:35:01 +0000 (22:05 +0530)]
target-ppc: tlbie/tlbivax should have global effect

tlbie (BookS) and tlbivax (BookE) plus the H_CALLs(pseries) should have
a global effect.

Introduces TLB_NEED_GLOBAL_FLUSH flag. During lazy tlb flush, after
taking care of pending local flushes, check broadcast flush(at context
synchronizing event ptesync/tlbsync, etc) is needed. Depending on the
bitmask state of the tlb_need_flush, tlb is flushed from other cpus if
needed and the flags are cleared.

Suggested-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Nikunj A Dadhania <[email protected]>
Reviewed-by: David Gibson <[email protected]>
[dwg: Use 'true' instead of '1' for call to check_tlb_flush()]
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: add flag in check_tlb_flush()
Nikunj A Dadhania [Tue, 20 Sep 2016 16:35:00 +0000 (22:05 +0530)]
target-ppc: add flag in check_tlb_flush()

We flush the qemu TLB lazily. check_tlb_flush is called whenever we hit
a context synchronizing event or instruction that requires a pending
flush to be performed.

However, we fail to handle broadcast TLB flush operations. In order to
fix that efficiently, we want to differentiate whether check_tlb_flush()
needs to only apply pending local flushes (isync instructions,
interrupts, ...) or also global pending flush operations. The latter is
only needed when executing instructions that are defined architecturally
as synchronizing global TLB flush operations. This in our case is
ptesync on BookS and tlbsync on BookE along with the paravirtualized
hypervisor calls.

Signed-off-by: Nikunj A Dadhania <[email protected]>
[dwg: Changed gen_check_tlb_flush() to also take a bool, and fixed
 some spelling errors in commit message]
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: add TLB_NEED_LOCAL_FLUSH flag
Nikunj A Dadhania [Tue, 20 Sep 2016 16:34:59 +0000 (22:04 +0530)]
target-ppc: add TLB_NEED_LOCAL_FLUSH flag

Introduces bit-flag in CPUPPCState::tlb_need_flush:

  TLB_NEED_LOCAL_FLUSH (0x1) - Flush local tlb

This would indicate a pending local tlb flush (isync instructions,
interrupts, ...)

Signed-off-by: Nikunj A Dadhania <[email protected]>
Reviewed-by: David Gibson <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agospapr: Introduce sPAPRCPUCoreClass
Bharata B Rao [Mon, 12 Sep 2016 07:57:20 +0000 (13:27 +0530)]
spapr: Introduce sPAPRCPUCoreClass

Each spapr cpu core type defines an instance_init routine which just
populates the CPU class name. This can be done in the class_init
commonly for all core types which simplifies the registration.
This is inspired by how PowerNV core types are registered.

Certain types of spapr cpu cores ('host' and generic type based on host
CPU) are initialized in target-ppc/kvm.c. To convert these type
registrations to use class_init, we need to expose
spapr_cpu_core_class_init() outside of spapr_cpu_core.c.

Commit d11b268e1765 added a generic sPAPR CPU core family
type to support cases like POWER8 CPU type on POWER8E host CPU.
Switching to class_init would fix such scenarios to use the right
CPU thread type instead of defaulting to host-powerpc64-cpu.

In an unrelated cleanup, fix a typo in .get_hotplug_handler routine.

Signed-off-by: Bharata B Rao <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: implement darn instruction
Ravi Bangoria [Fri, 16 Sep 2016 10:51:47 +0000 (16:21 +0530)]
target-ppc: implement darn instruction

darn: Deliver A Random Number

Currently return invalid random number for all the case. This needs
proper algorithm to provide cryptographically suitable random data.
Reading from /dev/random can block and that is not an expected behaviour
while the cpu instruction is getting executed. Moreover, /dev/random
would only work for linux-user

Signed-off-by: Ravi Bangoria <[email protected]>
Signed-off-by: Nikunj A Dadhania <[email protected]>
[dwg: Added minor clang warning fix for ppc32 target]
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: add stxsi[bh]x instruction
Nikunj A Dadhania [Mon, 12 Sep 2016 06:41:42 +0000 (12:11 +0530)]
target-ppc: add stxsi[bh]x instruction

stxsibx - Store VSX Scalar as Integer Byte Indexed
stxsihx - Store VSX Scalar as Integer Halfword Indexed

Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: add lxsi[bw]zx instruction
Nikunj A Dadhania [Mon, 12 Sep 2016 06:41:41 +0000 (12:11 +0530)]
target-ppc: add lxsi[bw]zx instruction

lxsibzx - Load VSX Scalar as Integer Byte & Zero Indexed
lxsihzx - Load VSX Scalar as Integer Halfword & Zero Indexed

Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: add xxspltib instruction
Nikunj A Dadhania [Mon, 12 Sep 2016 06:41:39 +0000 (12:11 +0530)]
target-ppc: add xxspltib instruction

xxspltib: VSX Vector Splat Immediate Byte

Copy the immediate byte in each byte of target VSR

Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: consolidate store conditional
Nikunj A Dadhania [Mon, 12 Sep 2016 06:41:38 +0000 (12:11 +0530)]
target-ppc: consolidate store conditional

Use tcg_gen_qemu_st store conditional instructions.

Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: move out stqcx impementation
Nikunj A Dadhania [Mon, 12 Sep 2016 06:41:37 +0000 (12:11 +0530)]
target-ppc: move out stqcx impementation

Being a 16byte operation, qemu_ld/st still does not support this. Move
this out so other store operation can use qemu_ld/st in the following
patch. Also, convert it to two MO_Q operations for stqcx.

Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: consolidate load with reservation
Nikunj A Dadhania [Mon, 12 Sep 2016 06:41:36 +0000 (12:11 +0530)]
target-ppc: consolidate load with reservation

Use tcg_gen_qemu_ld in the load with reservation instructions.

Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: convert st[16,32,64]r to use new macro
Nikunj A Dadhania [Mon, 12 Sep 2016 06:41:35 +0000 (12:11 +0530)]
target-ppc: convert st[16,32,64]r to use new macro

Make byte-swap routines use the common GEN_QEMU_STORE macro

Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: convert st64 to use new macro
Nikunj A Dadhania [Mon, 12 Sep 2016 06:41:34 +0000 (12:11 +0530)]
target-ppc: convert st64 to use new macro

Use macro for st64 as well, this changes the function signature from
gen_qemu_st64 => gen_qemu_st64_i64. Replace this at all the call sites.

Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: consolidate store operations
Nikunj A Dadhania [Mon, 12 Sep 2016 06:41:33 +0000 (12:11 +0530)]
target-ppc: consolidate store operations

Implement macro to consolidate store operations using newer
tcg_gen_qemu_st function.

Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: convert ld[16,32,64]ur to use new macro
Nikunj A Dadhania [Mon, 12 Sep 2016 06:41:32 +0000 (12:11 +0530)]
target-ppc: convert ld[16,32,64]ur to use new macro

Make byte-swap routines use the common GEN_QEMU_LOAD macro

Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: convert ld64 to use new macro
Nikunj A Dadhania [Mon, 12 Sep 2016 06:41:31 +0000 (12:11 +0530)]
target-ppc: convert ld64 to use new macro

Use macro for ld64 as well, this changes the function signature from
gen_qemu_ld64 => gen_qemu_ld64_i64. Replace this at all the call sites.

Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: consolidate load operations
Nikunj A Dadhania [Mon, 12 Sep 2016 06:41:30 +0000 (12:11 +0530)]
target-ppc: consolidate load operations

Implement macro to consolidate load operations using newer
tcg_gen_qemu_ld functions.

Signed-off-by: Nikunj A Dadhania <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agospapr_vscsi: convert to trace framework instead of DPRINTF
Laurent Vivier [Fri, 16 Sep 2016 12:39:11 +0000 (14:39 +0200)]
spapr_vscsi: convert to trace framework instead of DPRINTF

Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agospapr_llan: convert to trace framework instead of DPRINTF
Laurent Vivier [Wed, 14 Sep 2016 18:48:26 +0000 (20:48 +0200)]
spapr_llan: convert to trace framework instead of DPRINTF

Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agospapr_vio: convert to trace framework instead of DPRINTF
Laurent Vivier [Wed, 14 Sep 2016 18:48:25 +0000 (20:48 +0200)]
spapr_vio: convert to trace framework instead of DPRINTF

Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agospapr_rtas: convert to trace framework instead of DPRINTF
Laurent Vivier [Wed, 14 Sep 2016 18:48:24 +0000 (20:48 +0200)]
spapr_rtas: convert to trace framework instead of DPRINTF

Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agospapr_drc: convert to trace framework instead of DPRINTF
Laurent Vivier [Wed, 14 Sep 2016 18:48:23 +0000 (20:48 +0200)]
spapr_drc: convert to trace framework instead of DPRINTF

Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agoadb.c: prevent NO_KEY value from going to guest
John Arbuckle [Thu, 18 Aug 2016 02:27:50 +0000 (22:27 -0400)]
adb.c: prevent NO_KEY value from going to guest

The NO_KEY value should not be sent to the guest. This patch drops that value.

Signed-off-by: John Arbuckle <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agoadb.c: correct several key assignments
John Arbuckle [Thu, 18 Aug 2016 02:27:49 +0000 (22:27 -0400)]
adb.c: correct several key assignments

The original pc_to_adb_keycode mapping did have several keys that were
incorrectly mapped. This patch fixes these mappings.

Signed-off-by: John Arbuckle <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agoadb.c: add support for QKeyCode
John Arbuckle [Thu, 18 Aug 2016 02:27:48 +0000 (22:27 -0400)]
adb.c: add support for QKeyCode

The old pc scancode translation is replaced with QEMU's QKeyCode. This is just
a mechanical substitution, which a number of broken mappings left in.

Signed-off-by: John Arbuckle <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agoadb-keys.h: initial commit
John Arbuckle [Thu, 18 Aug 2016 02:27:47 +0000 (22:27 -0400)]
adb-keys.h: initial commit

Add the adb-keys.h file. It maps ADB transition key codes with values.

Signed-off-by: John Arbuckle <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agoMAINTAINERS: add sPAPR tests
Greg Kurz [Wed, 14 Sep 2016 11:23:57 +0000 (13:23 +0200)]
MAINTAINERS: add sPAPR tests

Signed-off-by: Greg Kurz <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotests: add RTAS command in the protocol
Laurent Vivier [Tue, 13 Sep 2016 12:52:45 +0000 (14:52 +0200)]
tests: add RTAS command in the protocol

Add a first test to validate the protocol:

- rtas/get-time-of-day compares the time
  from the guest with the time from the host.

Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Greg Kurz <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agolibqos: define SPAPR libqos functions
Laurent Vivier [Tue, 13 Sep 2016 12:52:44 +0000 (14:52 +0200)]
libqos: define SPAPR libqos functions

Define spapr_alloc_init()/spapr_alloc_init_flags()/spapr_alloc_uninit()

  to allocate and use SPAPR guest memory

Define qtest_spapr_vboot()/qtest_spapr_boot()/qtest_spapr_shutdown()

  to start SPAPR guest with QOSState initialized for it (memory management)

Move qtest_irq_intercept_in() from generic part to PC part.

Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Greg Kurz <[email protected]>
Reviewed-by: David Gibson <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agoqtest: replace strtoXX() by qemu_strtoXX()
Laurent Vivier [Tue, 13 Sep 2016 12:52:43 +0000 (14:52 +0200)]
qtest: replace strtoXX() by qemu_strtoXX()

Check the result of qemu_strtoXX() and assert
if the string cannot be converted.

Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: David Gibson <[email protected]>
Reviewed-by: Greg Kurz <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agoppc: Fix signal delivery in ppc-user and ppc64-user
Benjamin Herrenschmidt [Wed, 3 Aug 2016 12:38:51 +0000 (22:38 +1000)]
ppc: Fix signal delivery in ppc-user and ppc64-user

There were a number of bugs in the implementation:

 - The structure alignment was wrong for 64-bit.

 - Also 64-bit only does RT signals.

 - On 64-bit, we need to put a pointer to the (aligned) vector registers
   in the frame and use it for restoring

 - We had endian bugs when saving/restoring vector registers

 - My recent fixes for exception NIP broke sigreturn in user mode
   causing us to resume one instruction too far.

 - Add VSR second halves

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: add vector permute right indexed instruction
Rajalakshmi Srinivasaraghavan [Tue, 6 Sep 2016 05:04:10 +0000 (10:34 +0530)]
target-ppc: add vector permute right indexed instruction

Add vpermr instruction from ISA 3.0.

Signed-off-by: Rajalakshmi Srinivasaraghavan <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: add vector bit permute doubleword instruction
Rajalakshmi Srinivasaraghavan [Tue, 6 Sep 2016 05:04:09 +0000 (10:34 +0530)]
target-ppc: add vector bit permute doubleword instruction

Add vbpermd instruction from ISA 3.0.

Signed-off-by: Rajalakshmi Srinivasaraghavan <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: add vector count trailing zeros instructions
Rajalakshmi Srinivasaraghavan [Tue, 6 Sep 2016 05:04:08 +0000 (10:34 +0530)]
target-ppc: add vector count trailing zeros instructions

The following vector count trailing zeros instructions are
added from ISA 3.0.

vctzb - Vector Count Trailing Zeros Byte
vctzh - Vector Count Trailing Zeros Halfword
vctzw - Vector Count Trailing Zeros Word
vctzd - Vector Count Trailing Zeros Doubleword

Signed-off-by: Rajalakshmi Srinivasaraghavan <[email protected]>
Reviewed-by: David Gibson <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: add vector extract instructions
Rajalakshmi Srinivasaraghavan [Tue, 6 Sep 2016 05:04:07 +0000 (10:34 +0530)]
target-ppc: add vector extract instructions

The following vector extract instructions are added from ISA 3.0.

vextractub - Vector Extract Unsigned Byte
vextractuh - Vector Extract Unsigned Halfword
vextractuw - Vector Extract Unsigned Word
vextractd - Vector Extract Unsigned Doubleword

Signed-off-by: Rajalakshmi Srinivasaraghavan <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agotarget-ppc: add vector insert instructions
Rajalakshmi Srinivasaraghavan [Tue, 6 Sep 2016 05:04:06 +0000 (10:34 +0530)]
target-ppc: add vector insert instructions

The following vector insert instructions are added from ISA 3.0.

vinsertb - Vector Insert Byte
vinserth - Vector Insert Halfword
vinsertw - Vector Insert Word
vinsertd - Vector Insert Doubleword

Signed-off-by: Rajalakshmi Srinivasaraghavan <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agoppc: restrict the use of the rfi instruction
Benjamin Herrenschmidt [Thu, 8 Sep 2016 07:32:42 +0000 (09:32 +0200)]
ppc: restrict the use of the rfi instruction

Power ISA 2.x has deleted the rfi instruction and rfid shoud be used
instead on cpus following this instruction set or later.

This will raise an invalid exception when rfi is used on such
processors: Book3S 64-bit processors.

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Reviewed-by: David Gibson <[email protected]>
[clg: the required fix in openbios, commit b747b6acc272 ('ppc: use
      rfid when running under a CPU from the 970 family.'), is now
      merged in qemu under commit 5cebd885d0d2 ('Update OpenBIOS
      images to b747b6a built from submodule.') ]
Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agoMAINTAINERS: Add some missing ppc-related files
Thomas Huth [Mon, 5 Sep 2016 20:03:36 +0000 (22:03 +0200)]
MAINTAINERS: Add some missing ppc-related files

There are some powerpc related files in the QEMU source tree
which are currently not covered by the MAINTAINERS file and
thus not properly classified by the get_maintainer.pl script.
So let's add them to the proper sections.

Signed-off-by: Thomas Huth <[email protected]>
Signed-off-by: David Gibson <[email protected]>
8 years agokvm: fix events.flags (KVM_VCPUEVENT_VALID_SMM) overwritten by 0
Herongguang (Stephen) [Thu, 22 Sep 2016 07:56:28 +0000 (15:56 +0800)]
kvm: fix events.flags (KVM_VCPUEVENT_VALID_SMM) overwritten by 0

Fix events.flags (KVM_VCPUEVENT_VALID_SMM) overwritten by 0.

Signed-off-by: He Rongguang <[email protected]>
Message-Id: <57E38EAC.3020108@huawei.com>
Signed-off-by: Paolo Bonzini <[email protected]>
8 years agoscripts: Add a script to check for bug URLs in the git log
Thomas Huth [Wed, 21 Sep 2016 19:42:22 +0000 (21:42 +0200)]
scripts: Add a script to check for bug URLs in the git log

Basic idea of this script is to check the git log for URLs
to the QEMU bugtracker at launchpad.net and to figure out
whether the related bug has been marked there as "Fix released"
(i.e. closed) already. So this script can e.g. be used after
each public release of QEMU to check whether there are any
bug tickets that could be moved from "Fix committed" (or another
state if the author of the patch forgot to update the bug ticket)
to "Fix released".

Signed-off-by: Thomas Huth <[email protected]>
Message-Id: <1474486942[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
8 years agomsmouse: Fix segfault caused by free the chr before chardev cleanup.
Lin Ma [Thu, 15 Sep 2016 14:31:58 +0000 (22:31 +0800)]
msmouse: Fix segfault caused by free the chr before chardev cleanup.

Segfault happens when leaving qemu with msmouse backend:

 #0  0x00007fa8526ac975 in raise () at /lib64/libc.so.6
 #1  0x00007fa8526add8a in abort () at /lib64/libc.so.6
 #2  0x0000558be78846ab in error_exit (err=16, msg=0x558be799da10 ...
 #3  0x0000558be7884717 in qemu_mutex_destroy (mutex=0x558be93be750) at ...
 #4  0x0000558be7549951 in qemu_chr_free_common (chr=0x558be93be750) at ...
 #5  0x0000558be754999c in qemu_chr_free (chr=0x558be93be750) at ...
 #6  0x0000558be7549a20 in qemu_chr_delete (chr=0x558be93be750) at ...
 #7  0x0000558be754a8ef in qemu_chr_cleanup () at qemu-char.c:4643
 #8  0x0000558be755843e in main (argc=5, argv=0x7ffe925d7118, ...

The chr was freed by msmouse close callback before chardev cleanup,
Then qemu_mutex_destroy triggered raise().

Because freeing chr is handled by qemu_chr_free_common, Remove the free from
msmouse_chr_close to avoid double free.

Fixes: c1111a24a3358ecd2f17be7c8b117cfe8bc5e5f8
Cc: [email protected]
Signed-off-by: Lin Ma <[email protected]>
Message-Id: <20160915143158[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
8 years agoiscsi: Fix divide-by-zero regression on raw SG devices
Eric Blake [Wed, 7 Sep 2016 21:27:20 +0000 (16:27 -0500)]
iscsi: Fix divide-by-zero regression on raw SG devices

When qemu uses iscsi devices in sg mode, iscsilun->block_size
is left at 0.  Prior to commits cf081fca and similar, when
block limits were tracked in sectors, this did not matter:
various block limits were just left at 0.  But when we started
scaling by block size, this caused SIGFPE.

Then, in a later patch, commit a5b8dd2c added an assertion to
bdrv_open_common() that request_alignment is always non-zero;
which was not true for SG mode.  Rather than relax that assertion,
we can just provide a sane value (we don't know of any SG device
with a block size smaller than qemu's default sizing of 512 bytes).

One possible solution for SG mode is to just blindly skip ALL
of iscsi_refresh_limits(), since we already short circuit so
many other things in sg mode.  But this patch takes a slightly
more conservative approach, and merely guarantees that scaling
will succeed, while still using multiples of the original size
where possible.  Resulting limits may still be zero in SG mode
(that is, we mostly only fix block_size used as a denominator
or which affect assertions, not all uses).

Reported-by: Holger Schranz <[email protected]>
Signed-off-by: Eric Blake <[email protected]>
CC: [email protected]
Message-Id: <1473283640[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
8 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160922' into...
Peter Maydell [Thu, 22 Sep 2016 17:23:14 +0000 (18:23 +0100)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20160922' into staging

target-arm queue:
 * add Cortex-A7 CPU
 * new ast2500 SoC model and evaluation board
 * palmetto-bmc: remove stray double assignment
 * aspeed: clean up RAM size handling
 * ptimer: framework for defining policy bits to change
   behaviour choices for different timer devices
 * ptimer: add some test cases
 * cadence_gem: add queue support
 * loader: support loading images to specified address spaces
 * loader: support auto-detect of ELF architecture from file
 * dma: xlnx-zynq-devcfg: Fix up XLNX_ZYNQ_DEVCFG_R_MAX
 * vmstateify ssd0323
 * vmstateify ssi-sd
 * disas/arm.c: remove unused macros
 * imx: use 'const char', not 'char const'

# gpg: Signature made Thu 22 Sep 2016 18:20:22 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-20160922: (36 commits)
  imx: Use 'const char', not 'char const'
  disas/arm.c: Remove unused macro definitions
  vmstateify ssi-sd
  vmstateify ssd0323 display
  dma: xlnx-zynq-devcfg: Fix up XLNX_ZYNQ_DEVCFG_R_MAX
  loader: Add AddressSpace loading support to targphys
  loader: Add AddressSpace loading support to uImages
  loader: Add AddressSpace loading support to ELFs
  loader: Allow a custom AddressSpace when loading ROMs
  loader: Use the specified MemoryRegion
  loader: Allow ELF loader to auto-detect the ELF arch
  xlnx-zynqmp: Set the number of priority queues
  cadence_gem: Correct indentation
  cadence_gem: Add queue support
  cadence_gem: Add support for screening
  cadence_gem: Add the num-priority-queues property
  cadence_gem: QOMify Cadence GEM
  tests: Add ptimer tests
  hw/ptimer: Suppress error messages under qtest
  hw/ptimer: Introduce timer policy feature
  ...

Signed-off-by: Peter Maydell <[email protected]>
8 years agoimx: Use 'const char', not 'char const'
Peter Maydell [Thu, 22 Sep 2016 17:13:09 +0000 (18:13 +0100)]
imx: Use 'const char', not 'char const'

'char const' means the same thing as 'const char', but we
use the former in only a handful of places and we use the
latter over six thousand times. Switch the imx reg_name()
functions to bring them in line with everything else.

Signed-off-by: Peter Maydell <[email protected]>
8 years agodisas/arm.c: Remove unused macro definitions
Peter Maydell [Thu, 22 Sep 2016 17:13:09 +0000 (18:13 +0100)]
disas/arm.c: Remove unused macro definitions

The macros ISSPACE, strneq, NUM_ELEMS and NUM_ARM_REGNAMES
are defined in disas/arm.c but never used. Remove the
unnecessary definitions.

Signed-off-by: Peter Maydell <[email protected]>
8 years agovmstateify ssi-sd
Dr. David Alan Gilbert [Thu, 22 Sep 2016 17:13:08 +0000 (18:13 +0100)]
vmstateify ssi-sd

Changed a few types to fixed sized types in the ssi_sd_state
Now saving/loading a byte for the cmdarg/response bytes that were
  previously saved as uint32
Bumped version number to deal with those changes.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Message-id: 1472035246[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
8 years agovmstateify ssd0323 display
Dr. David Alan Gilbert [Thu, 22 Sep 2016 17:13:08 +0000 (18:13 +0100)]
vmstateify ssd0323 display

   Bumps version number because we now use the VMSTATE_SSI_SLAVE that
only uses a byte rather than a 32bit (for saving a bool 'cs').

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Message-id: 1472035246[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
8 years agodma: xlnx-zynq-devcfg: Fix up XLNX_ZYNQ_DEVCFG_R_MAX
Nathan Rossi [Thu, 22 Sep 2016 17:13:08 +0000 (18:13 +0100)]
dma: xlnx-zynq-devcfg: Fix up XLNX_ZYNQ_DEVCFG_R_MAX

Whilst according to the Zynq TRM this device covers a register region of
0x000 - 0x120. The register region is also shared with XADCIF prefix
registers at 0x100 and above. Due to how the devcfg and the xadc devices
are implemented in QEMU these are separate models with individual mmio
regions. As such the region registered by the devcfg overlaps with the
xadc when initialized in a machine model (e.g. xilinx-zynq-a9).

This patch fixes up the incorrect region size, where
XLNX_ZYNQ_DEVCFG_R_MAX is missing its '/ 4' causing it to be 0x460 in
size. As well as setting the region size to the 0x0 - 0x100 region so
that an xadc device instance can be registered in the correct region to
pair with the devcfg device instance.

Mapping with XLNX_ZYNQ_DEVCFG_R_MAX = 0x118:
  dev: xlnx.ps7-dev-cfg, id ""
    mmio 00000000f8007000/0000000000000460
  dev: xlnx,zynq-xadc, id ""
    mmio 00000000f8007100/0000000000000020

Mapping with XLNX_ZYNQ_DEVCFG_R_MAX = 0x100 / 4:
  dev: xlnx.ps7-dev-cfg, id ""
    mmio 00000000f8007000/0000000000000100
  dev: xlnx,zynq-xadc, id ""
    mmio 00000000f8007100/0000000000000020

Signed-off-by: Nathan Rossi <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-id: 20160921180911[email protected]
Signed-off-by: Peter Maydell <[email protected]>
8 years agoloader: Add AddressSpace loading support to targphys
Alistair Francis [Thu, 22 Sep 2016 17:13:08 +0000 (18:13 +0100)]
loader: Add AddressSpace loading support to targphys

Add a new function load_image_targphys_as() that allows the caller
to specify an AddressSpace to use when loading a targphys. The
original load_image_targphys() function doesn't have any change in
functionality.

Signed-off-by: Alistair Francis <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Message-id: 87de45de7acf02cbe6bae9d6c4d6fb8f3aba4f61.1474331683[email protected]
Signed-off-by: Peter Maydell <[email protected]>
8 years agoloader: Add AddressSpace loading support to uImages
Alistair Francis [Thu, 22 Sep 2016 17:13:08 +0000 (18:13 +0100)]
loader: Add AddressSpace loading support to uImages

Add a new function load_uimage_as() that allows the caller to
specify an AddressSpace to use when loading the uImage. The
original load_uimage() function doesn't have any change in
functionality.

Signed-off-by: Alistair Francis <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Message-id: 1254092e6b80d3cd3cfabafe165d56a96c54c0b5.1474331683[email protected]
Signed-off-by: Peter Maydell <[email protected]>
8 years agoloader: Add AddressSpace loading support to ELFs
Alistair Francis [Thu, 22 Sep 2016 17:13:08 +0000 (18:13 +0100)]
loader: Add AddressSpace loading support to ELFs

Add a new function load_elf_as() that allows the caller to specify an
AddressSpace to use when loading the ELF. The original load_elf()
function doesn't have any change in functionality.

Signed-off-by: Alistair Francis <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Message-id: 8b5cefecdf56fba4ccdff2db880f0b6b264cf16f.1474331683[email protected]
Signed-off-by: Peter Maydell <[email protected]>
8 years agoloader: Allow a custom AddressSpace when loading ROMs
Alistair Francis [Thu, 22 Sep 2016 17:13:08 +0000 (18:13 +0100)]
loader: Allow a custom AddressSpace when loading ROMs

When loading ROMs allow the caller to specify an AddressSpace to use for
the load.

Signed-off-by: Alistair Francis <[email protected]>
Message-id: 85f86b94ea94879e7ce8b12e85ac8de26658f7eb.1474331683[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
8 years agoloader: Use the specified MemoryRegion
Alistair Francis [Thu, 22 Sep 2016 17:13:08 +0000 (18:13 +0100)]
loader: Use the specified MemoryRegion

Prevously the specified MemoryRegion was ignored during the rom register
reset. This patch uses the rom MemoryRegion is avaliable.

Signed-off-by: Alistair Francis <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Message-id: d63fef5524deeb88e0068ca9d3fd4c8344f54dd4.1474331683[email protected]
Signed-off-by: Peter Maydell <[email protected]>
This page took 0.09085 seconds and 4 git commands to generate.