]> Git Repo - qemu.git/log
qemu.git
7 years agoMerge remote-tracking branch 'remotes/kraxel/tags/ui-20171016-pull-request' into...
Peter Maydell [Tue, 17 Oct 2017 09:03:33 +0000 (10:03 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20171016-pull-request' into staging

ui: use keycodemapdb for key code mappings, part one (v2)
ui: add qemu-keymap, update reverse keymaps (for qemu -k $map)
ui: fix for vte 0.50
ui: gtk texture fix

# gpg: Signature made Mon 16 Oct 2017 14:12:49 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-20171016-pull-request:
  gtk: fix wrong id between texture and framebuffer
  ui/gtk: Fix deprecation of vte_terminal_copy_clipboard
  pc-bios/keymaps: keymaps update
  Add pc-bios/keymaps/Makefile
  tools: add qemu-keymap
  ui: don't export qemu_input_event_new_key
  ui: convert key events to QKeyCodes immediately
  ui: convert common input code to keycodemapdb
  ui: add keycodemapdb repository as a GIT submodule
  docker: don't rely on submodules existing in the main checkout
  build: automatically handle GIT submodule checkout for dtc

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/huth/tags/pull-request-2017-10-16' into staging
Peter Maydell [Mon, 16 Oct 2017 17:29:38 +0000 (18:29 +0100)]
Merge remote-tracking branch 'remotes/huth/tags/pull-request-2017-10-16' into staging

Some m68k, qtest and config improvements

# gpg: Signature made Mon 16 Oct 2017 13:38:03 BST
# gpg:                using RSA key 0x2ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <[email protected]>"
# gpg:                 aka "Thomas Huth <[email protected]>"
# gpg:                 aka "Thomas Huth <[email protected]>"
# gpg:                 aka "Thomas Huth <[email protected]>"
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth/tags/pull-request-2017-10-16:
  default-configs: Enable CONFIG_VMXNET3_PCI only on x86
  tests/prom-env: Bump the timeout, and test pseries only in slow mode
  tests: use g_new() family of functions
  M68K: use g_new() family of functions
  hw/m68k: Replace fprintf(stderr, "*\n" with error_report()

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Peter Maydell [Mon, 16 Oct 2017 16:29:16 +0000 (17:29 +0100)]
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pc, pci, virtio: fixes, features

A bunch of fixes all over the place.
A new vmcore device - the user interface around it is still somewhat
controversial, but I feel most of the code is fine, suggestions can be
addressed by adding patches on top.

Signed-off-by: Michael S. Tsirkin <[email protected]>
# gpg: Signature made Sun 15 Oct 2017 04:02:23 BST
# gpg:                using RSA key 0x281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <[email protected]>"
# gpg:                 aka "Michael S. Tsirkin <[email protected]>"
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream: (26 commits)
  tests/pxe: Test more NICs when running in SPEED=slow mode
  pc: remove useless hot_add_cpu initialisation
  isapc: Remove unnecessary migration compatibility code
  virtio-pci: Replace modern_as with direct access to modern_bar
  virtio: fix descriptor counting in virtqueue_pop
  hw/gen_pcie_root_port: make IO RO 0 on IO disabled
  pci: Validate interfaces on base_class_init
  xen/pt: Mark TYPE_XEN_PT_DEVICE as hybrid
  pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
  pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices
  pci: Add interface names to hybrid PCI devices
  pci: conventional-pci-device and pci-express-device interfaces
  PCI: PCIe access should always be little endian
  virtio/pci/migration: Convert to VMState
  hw/pci-bridge/pcie_pci_bridge: properly handle MSI unavailability case
  pci: allow 32-bit PCI IO accesses to pass through the PCI bridge
  virtio/vhost: reset dev->log after syncing
  MAINTAINERS: add Dump maintainers
  scripts/dump-guest-memory.py: add vmcoreinfo
  kdump: set vmcoreinfo location
  ...

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-10-14' into staging
Peter Maydell [Mon, 16 Oct 2017 14:54:42 +0000 (15:54 +0100)]
Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-10-14' into staging

nbd patches for 2017-10-14

- Marc-André Lureau - NBD: use g_new() family of functions
- Vladimir Sementsov-Ogievskiy - first half of 00/13 nbd minimal structured read

# gpg: Signature made Sun 15 Oct 2017 01:38:47 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-10-14:
  nbd: header constants indenting
  nbd/server: simplify reply transmission
  nbd/server: refactor nbd_co_send_simple_reply parameters
  nbd/server: do not use NBDReply structure
  nbd/server: structurize simple reply header sending
  nbd: rename some simple-request related objects to be _simple_
  block/nbd-client: refactor nbd_co_receive_reply
  block/nbd-client: assert qiov len once in nbd_co_request
  NBD: use g_new() family of functions

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Peter Maydell [Mon, 16 Oct 2017 13:28:13 +0000 (14:28 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

# gpg: Signature made Fri 13 Oct 2017 14:49:22 BST
# gpg:                using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <[email protected]>"
# gpg:                 aka "Stefan Hajnoczi <[email protected]>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  block/throttle.c: add bdrv_co_drain_begin/end callbacks
  block: rename bdrv_co_drain to bdrv_co_drain_begin
  block: add bdrv_co_drain_end callback

Signed-off-by: Peter Maydell <[email protected]>
7 years agogtk: fix wrong id between texture and framebuffer
Anthoine Bourgeois [Mon, 2 Oct 2017 12:40:52 +0000 (14:40 +0200)]
gtk: fix wrong id between texture and framebuffer

The gd_gl_area_scanout_texture must destroy framebuffer if there is
no texture id instead of no framebuffer id.
The effect was a black screen with "-vga virtio -display gtk,gl=on"
options.
The bug was introduce by a4f113fd "gtk: use framebuffer helper functions."

Signed-off-by: Anthoine Bourgeois <[email protected]>
Message-id: 20171002124052[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
7 years agoui/gtk: Fix deprecation of vte_terminal_copy_clipboard
Anthony PERARD [Tue, 10 Oct 2017 10:24:18 +0000 (11:24 +0100)]
ui/gtk: Fix deprecation of vte_terminal_copy_clipboard

vte_terminal_copy_clipboard() is deprecated in VTE 0.50.

Signed-off-by: Anthony PERARD <[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
7 years agopc-bios/keymaps: keymaps update
Gerd Hoffmann [Thu, 5 Oct 2017 15:33:30 +0000 (17:33 +0200)]
pc-bios/keymaps: keymaps update

Update the keymaps with the ones generated by qemu-keymap

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20171005153330[email protected]

7 years agoAdd pc-bios/keymaps/Makefile
Gerd Hoffmann [Thu, 5 Oct 2017 15:33:29 +0000 (17:33 +0200)]
Add pc-bios/keymaps/Makefile

Update files where I think I've figured the correct xkb maps.
TODO: nl-be sl sv

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20171005153330[email protected]

7 years agotools: add qemu-keymap
Gerd Hoffmann [Thu, 5 Oct 2017 15:33:28 +0000 (17:33 +0200)]
tools: add qemu-keymap

qemu-keymap generates qemu reverse keymaps from xkb keymaps,
which can be used with the qemu "-k" command line switch.

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20171005153330[email protected]

7 years agoui: don't export qemu_input_event_new_key
Daniel P. Berrange [Fri, 29 Sep 2017 10:12:01 +0000 (11:12 +0100)]
ui: don't export qemu_input_event_new_key

All public code should use qemu_input_event_send_key* functions
instead of creating an event directly.

Signed-off-by: Daniel P. Berrange <[email protected]>
Message-id: 20170929101201[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
7 years agoui: convert key events to QKeyCodes immediately
Daniel P. Berrange [Fri, 29 Sep 2017 10:12:00 +0000 (11:12 +0100)]
ui: convert key events to QKeyCodes immediately

Always use QKeyCode in the InputKeyEvent struct, by converting key
numbers to QKeyCode at the time the event is created. This allows
the code processing / consuming key events to assume QKeyCode is
used. The only place we accept a key number in the InputKeyEvent
struct is with QMP commands sent by the user.

Signed-off-by: Daniel P. Berrange <[email protected]>
Message-id: 20170929101201[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
7 years agoui: convert common input code to keycodemapdb
Daniel P. Berrange [Fri, 29 Sep 2017 10:11:59 +0000 (11:11 +0100)]
ui: convert common input code to keycodemapdb

Replace the number_to_qcode, qcode_to_number and linux_to_qcode
tables with automatically generated tables.

Missing entries in linux_to_qcode now fixed:

  KEY_LINEFEED -> Q_KEY_CODE_LF
  KEY_KPEQUAL -> Q_KEY_CODE_KP_EQUALS
  KEY_COMPOSE -> Q_KEY_CODE_COMPOSE
  KEY_AGAIN -> Q_KEY_CODE_AGAIN
  KEY_PROPS -> Q_KEY_CODE_PROPS
  KEY_UNDO -> Q_KEY_CODE_UNDO
  KEY_FRONT -> Q_KEY_CODE_FRONT
  KEY_COPY -> Q_KEY_CODE_COPY
  KEY_OPEN -> Q_KEY_CODE_OPEN
  KEY_PASTE -> Q_KEY_CODE_PASTE
  KEY_CUT -> Q_KEY_CODE_CUT
  KEY_HELP -> Q_KEY_CODE_HELP
  KEY_MEDIA -> Q_KEY_CODE_MEDIASELECT

In addition, some fixes:

 - KEY_PLAYPAUSE now maps to Q_KEY_CODE_AUDIOPLAY, instead of
   KEY_PLAYCD. KEY_PLAYPAUSE is defined across almost all scancodes
   sets, while KEY_PLAYCD only appears in AT set1, so the former is
   a more useful mapping.

Missing entries in qcode_to_number now fixed:

  Q_KEY_CODE_AGAIN -> 0x85
  Q_KEY_CODE_PROPS -> 0x86
  Q_KEY_CODE_UNDO -> 0x87
  Q_KEY_CODE_FRONT -> 0x8c
  Q_KEY_CODE_COPY -> 0xf8
  Q_KEY_CODE_OPEN -> 0x64
  Q_KEY_CODE_PASTE -> 0x65
  Q_KEY_CODE_CUT -> 0xbc
  Q_KEY_CODE_LF -> 0x5b
  Q_KEY_CODE_HELP -> 0xf5
  Q_KEY_CODE_COMPOSE -> 0xdd
  Q_KEY_CODE_KP_EQUALS -> 0x59
  Q_KEY_CODE_MEDIASELECT -> 0xed

In addition, some fixes:

 - Q_KEY_CODE_MENU was incorrectly mapped to the compose
   scancode (0xdd) and is now mapped to 0x9e
 - Q_KEY_CODE_FIND was mapped to 0xe065 (Search) instead
   of to 0xe041 (Find)
 - Q_KEY_CODE_HIRAGANA was mapped to 0x70 (Katakanahiragana)
   instead of of 0x77 (Hirigana)
 - Q_KEY_CODE_PRINT was mapped to 0xb7 which is not a defined
   scan code in AT set 1, it is now mapped to 0x54 (sysrq)

Signed-off-by: Daniel P. Berrange <[email protected]>
Message-id: 20170929101201[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
7 years agoui: add keycodemapdb repository as a GIT submodule
Daniel P. Berrange [Fri, 29 Sep 2017 10:11:58 +0000 (11:11 +0100)]
ui: add keycodemapdb repository as a GIT submodule

The https://gitlab.com/keycodemap/keycodemapdb/ repo contains a
data file mapping between all the different scancode/keycode/keysym
sets that are known, and a tool to auto-generate lookup tables for
different combinations.

It is used by GTK-VNC, SPICE-GTK and libvirt for mapping keys.
Using it in QEMU will let us replace many hand written lookup
tables with auto-generated tables from a master data source,
reducing bugs. Adding new QKeyCodes will now only require the
master table to be updated, all ~20 other tables will be
automatically updated to follow.

Signed-off-by: Daniel P. Berrange <[email protected]>
Message-id: 20170929101201[email protected]

[ kraxel: fix build ]
[ kraxel: switch repo to qemu.git mirror ]

Signed-off-by: Gerd Hoffmann <[email protected]>
7 years agodocker: don't rely on submodules existing in the main checkout
Daniel P. Berrange [Fri, 29 Sep 2017 10:11:57 +0000 (11:11 +0100)]
docker: don't rely on submodules existing in the main checkout

When building the tarball to pass into the docker/vm test image,
the code relies on the git submodules being checked out in the
main checkout.

ie if the developer has not run 'git submodule update --init dtc'
many of the docker tests will fail due to the libfdt package not
being present in the test images. Patchew manually checks out the
dtc submodule in the main git checkout, but this is a bad idea.

When running tests we want to have a predictable set of submodules
included in the source that's tested. The build environment is
completely independent of the developers host OS, so the submodules
the developer has checked out should not be considered relevant for
the tests.

This changes the archive-source.sh script so that it clones the
current git checkout into a temporary directory, checks out a
fixed set of submodules, builds the tarball and finally removes
the temporary git clone.

Signed-off-by: Daniel P. Berrange <[email protected]>
Message-id: 20170929101201[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
7 years agobuild: automatically handle GIT submodule checkout for dtc
Daniel P. Berrange [Fri, 29 Sep 2017 10:11:56 +0000 (11:11 +0100)]
build: automatically handle GIT submodule checkout for dtc

Currently if DTC is required by configure and not available in the host
OS install, we exit with an error message telling the user to checkout a
git submodule or install the library.

This introduces automatic handling of the git submodule checkout process
and enables it for dtc. This only runs if building from GIT, so users of
release tarballs still need the system library install. The current state
of the git checkout is stashed in .git-submodule-status, and a helper
program is used to determine if this state matches the desired submodule
state. A dependency against 'Makefile' ensures that the submodule state
is refreshed at the start of the build process

Signed-off-by: Daniel P. Berrange <[email protected]>
Message-id: 20170929101201[email protected]

[ kraxel: use /bin/sh not bash for scripts/git-submodule.sh ]
[ kraxel: fix Makefile dependencies ]

Signed-off-by: Gerd Hoffmann <[email protected]>
[fixup] Makefile dep

7 years agoMerge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2017-10-04-3' into...
Peter Maydell [Mon, 16 Oct 2017 12:04:43 +0000 (13:04 +0100)]
Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2017-10-04-3' into staging

Merge tpm 2017/10/04 v3

# gpg: Signature made Fri 13 Oct 2017 12:37:07 BST
# gpg:                using RSA key 0x75AD65802A0B4211
# gpg: Good signature from "Stefan Berger <[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: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211

* remotes/stefanberger/tags/pull-tpm-2017-10-04-3:
  specs: Describe the TPM support in QEMU
  tpm: Move tpm_cleanup() to right place
  tpm: Added support for TPM emulator
  tpm-passthrough: move reusable code to utils
  tpm-backend: Move realloc_buffer() implementation to tpm-tis model
  tpm-backend: Add new API to read backend TpmInfo
  tpm-backend: Made few interface methods optional
  tpm-backend: Initialize and free data members in it's own methods
  tpm-backend: Move thread handling inside TPMBackend
  tpm-backend: Remove unneeded member variable from backend class
  tpm: Use EMSGSIZE instead of EBADMSG to compile on OpenBSD

Signed-off-by: Peter Maydell <[email protected]>
7 years agodefault-configs: Enable CONFIG_VMXNET3_PCI only on x86
Thomas Huth [Thu, 28 Sep 2017 09:52:41 +0000 (11:52 +0200)]
default-configs: Enable CONFIG_VMXNET3_PCI only on x86

The device can not be instantiated on many non-x86 and just prints
some error messages, e.g.:

$ qemu-system-ppc64 -device vmxnet3 -M g3beige
[vmxnet3][WR][vmxnet3_init_msix]: Failed to initialize MSI-X, error -95
[vmxnet3][WR][vmxnet3_pci_realize]: Failed to initialize MSI-X, configuration is inconsistent.

Since vmxnet3 is a para-virtualized device that is only useful on x86,
it should also only be enabled on the x86 targets.

Reviewed-by: Dmitry Fleytman <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
7 years agotests/prom-env: Bump the timeout, and test pseries only in slow mode
Thomas Huth [Thu, 21 Sep 2017 05:39:15 +0000 (07:39 +0200)]
tests/prom-env: Bump the timeout, and test pseries only in slow mode

If QEMU has been compiled with the flags --enable-tcg-interpreter and
--enable-debug, the guest is running incredibly slow. The prom-env
test is approximately 10 times slower than normal in this case, and
it takes up to 500 seconds until the test with the pseries machine
finishs. While we should still look for ways to speed up the test
on the pseries machine here, let's bump the timeout to 600 seconds to
allow the test to pass with this unusal configuration already now.
Also move the pseries test into the "slow" category - since it is
really a very slow test.

Reviewed-by: Stefan Weil <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
7 years agotests: use g_new() family of functions
Marc-André Lureau [Fri, 6 Oct 2017 23:49:56 +0000 (20:49 -0300)]
tests: use g_new() family of functions

Signed-off-by: Marc-André Lureau <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
[PMD: split of some files in other commits of the same series, add libqtest.c]
Acked-by: John Snow <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
7 years agoM68K: use g_new() family of functions
Marc-André Lureau [Fri, 6 Oct 2017 23:49:18 +0000 (20:49 -0300)]
M68K: use g_new() family of functions

Signed-off-by: Marc-André Lureau <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
[PMD: squashed commits]
Reviewed-by: Thomas Huth <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
7 years agohw/m68k: Replace fprintf(stderr, "*\n" with error_report()
Alistair Francis [Sat, 30 Sep 2017 00:16:06 +0000 (17:16 -0700)]
hw/m68k: Replace fprintf(stderr, "*\n" with error_report()

Replace a large number of the fprintf(stderr, "*\n" calls with
error_report(). The functions were renamed with these commands and then
compiler issues where manually fixed.

find ./* -type f -exec sed -i \
    'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
    {} +
find ./* -type f -exec sed -i \
    'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
    {} +
find ./* -type f -exec sed -i \
    'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
    {} +
find ./* -type f -exec sed -i \
    'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
    {} +
find ./* -type f -exec sed -i \
    'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
    {} +
find ./* -type f -exec sed -i \
    'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
    {} +
find ./* -type f -exec sed -i \
    'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
    {} +
find ./* -type f -exec sed -i \
    'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
    {} +
find ./* -type f -exec sed -i \
    'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
    {} +
find ./* -type f -exec sed -i \
    'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
    {} +
find ./* -type f -exec sed -i \
    'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
    {} +

Some lines where then manually tweaked to pass checkpatch.

Signed-off-by: Alistair Francis <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
[thuth: Remove "qemu:" prefix from strings]
Signed-off-by: Thomas Huth <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/elmarco/tags/vu-pull-request' into staging
Peter Maydell [Mon, 16 Oct 2017 09:22:39 +0000 (10:22 +0100)]
Merge remote-tracking branch 'remotes/elmarco/tags/vu-pull-request' into staging

# gpg: Signature made Thu 12 Oct 2017 21:52:28 BST
# gpg:                using RSA key 0xDAE8E10975969CE5
# gpg: Good signature from "Marc-André Lureau <[email protected]>"
# gpg:                 aka "Marc-André Lureau <[email protected]>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* remotes/elmarco/tags/vu-pull-request:
  libvhost-user: Support VHOST_USER_SET_SLAVE_REQ_FD
  libvhost-user: Update and fix feature and request lists
  vhost-user-bridge: Only process received packets on started queues
  libvhost-user: vu_queue_started

Signed-off-by: Peter Maydell <[email protected]>
7 years agotests/pxe: Test more NICs when running in SPEED=slow mode
Thomas Huth [Wed, 20 Sep 2017 09:02:07 +0000 (11:02 +0200)]
tests/pxe: Test more NICs when running in SPEED=slow mode

The pxe-test is a very good test to excercise NICs, thus we should use
it to test all NICs that can be used by the BIOS for booting via network.
However, to avoid that the default testing time increases too much, the
additional NICs are only tested in the "make check SPEED=slow" mode.

The virtio-net NIC on ppc64 is now also only tested in slow mode, since
the test on ppc64 is really quite slow and we've got test coverage for
virtio-net in big endian mode now on s390x, too.

Signed-off-by: Thomas Huth <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agopc: remove useless hot_add_cpu initialisation
Laurent Vivier [Tue, 10 Oct 2017 13:32:41 +0000 (15:32 +0200)]
pc: remove useless hot_add_cpu initialisation

Since 4458fb3a79 (pc: Eliminate pc_default_machine_options()),
hot_add_cpu is set in pc_machine_class_init(), so we don't
need to set it in pc_q35_machine_options(), pc_i440fx_machine_options()
and xenfv_machine_options(), except to clear it in
pc_i440fx_1_4_machine_opt().

Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Igor Mammedov <[email protected]>
Reviewed-by: Eduardo Habkost <[email protected]>
Acked-by: Anthony PERARD <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agoisapc: Remove unnecessary migration compatibility code
Eduardo Habkost [Fri, 6 Oct 2017 13:25:02 +0000 (10:25 -0300)]
isapc: Remove unnecessary migration compatibility code

We don't touch isapc when we change guest ABI and add new entries
to PC_COMPAT_* or new PCMachineClass compat flags.  This means
isapc never guaranteed guest ABI and cross-QEMU-version live
migration compatibility.  There's no point in keeping code for
kvm-pv-eoi and APIC ID compatibility in pc_init_isa().

Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Igor Mammedov <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agovirtio-pci: Replace modern_as with direct access to modern_bar
Alexey Kardashevskiy [Mon, 9 Oct 2017 03:19:41 +0000 (14:19 +1100)]
virtio-pci: Replace modern_as with direct access to modern_bar

The modern bar is accessed now via yet another address space created just
for that purpose and it does not really need FlatView and dispatch tree
as it has a single memory region so it is just a waste of memory. Things
get even worse when there are dozens or hundreds of virtio-pci devices -
since these address spaces are global, changing any of them triggers
rebuilding all address spaces.

This replaces indirect accesses to the modern BAR with a simple lookup
and direct calls to memory_region_dispatch_read/write.

This is expected to save lots of memory at boot time after applying:
[Qemu-devel] [PULL 00/32] Misc changes for 2017-09-22

Signed-off-by: Alexey Kardashevskiy <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agovirtio: fix descriptor counting in virtqueue_pop
Wolfgang Bumiller [Wed, 20 Sep 2017 06:09:33 +0000 (08:09 +0200)]
virtio: fix descriptor counting in virtqueue_pop

While changing the s/g list allocation, commit 3b3b0628
also changed the descriptor counting to count iovec entries
as split by cpu_physical_memory_map(). Previously only the
actual descriptor entries were counted and the split into
the iovec happened afterwards in virtqueue_map().
Count the entries again instead to avoid erroneous
"Looped descriptor" errors.

Reported-by: Hans Middelhoek <[email protected]>
Link: https://forum.proxmox.com/threads/vm-crash-with-memory-hotplug.35904/
Fixes: 3b3b0628217e ("virtio: slim down allocation of VirtQueueElements")
Signed-off-by: Wolfgang Bumiller <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agohw/gen_pcie_root_port: make IO RO 0 on IO disabled
Marcel Apfelbaum [Mon, 2 Oct 2017 10:31:35 +0000 (13:31 +0300)]
hw/gen_pcie_root_port: make IO RO 0 on IO disabled

IO_LIMIT and IO_BASE registers should not be writable if
gen_pcie_root_port's io-reserve property is set to 0.
The COMMAND register should have the IO flag read only.

Signed-off-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agopci: Validate interfaces on base_class_init
Eduardo Habkost [Wed, 27 Sep 2017 19:56:35 +0000 (16:56 -0300)]
pci: Validate interfaces on base_class_init

Make sure we don't forget to add the Conventional PCI or PCI
Express interface names on PCI device classes in the future.

Signed-off-by: Eduardo Habkost <[email protected]>
Revieed-by: David Gibson <[email protected]>
Reviewed-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agoxen/pt: Mark TYPE_XEN_PT_DEVICE as hybrid
Eduardo Habkost [Thu, 5 Oct 2017 12:45:07 +0000 (09:45 -0300)]
xen/pt: Mark TYPE_XEN_PT_DEVICE as hybrid

xen-pt doesn't set the is_express field, but is supposed to be
able to handle PCI Express devices too.  Mark it as hybrid.

Suggested-by: Jan Beulich <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agopci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices
Eduardo Habkost [Wed, 27 Sep 2017 19:56:34 +0000 (16:56 -0300)]
pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices

Add INTERFACE_CONVENTIONAL_PCI_DEVICE to all direct subtypes of
TYPE_PCI_DEVICE, except:

1) The ones that already have INTERFACE_PCIE_DEVICE set:

* base-xhci
* e1000e
* nvme
* pvscsi
* vfio-pci
* virtio-pci
* vmxnet3

2) base-pci-bridge

Not all PCI bridges are Conventional PCI devices, so
INTERFACE_CONVENTIONAL_PCI_DEVICE is added only to the subtypes
that are actually Conventional PCI:

* dec-21154-p2p-bridge
* i82801b11-bridge
* pbm-bridge
* pci-bridge

The direct subtypes of base-pci-bridge not touched by this patch
are:

* xilinx-pcie-root: Already marked as PCIe-only.
* pcie-pci-bridge: Already marked as PCIe-only.
* pcie-port: all non-abstract subtypes of pcie-port are already
  marked as PCIe-only devices.

3) megasas-base

Not all megasas devices are Conventional PCI devices, so the
interface names are added to the subclasses registered by
megasas_register_types(), according to information in the
megasas_devices[] array.

"megasas-gen2" already implements INTERFACE_PCIE_DEVICE, so add
INTERFACE_CONVENTIONAL_PCI_DEVICE only to "megasas".

Acked-by: Alberto Garcia <[email protected]>
Acked-by: John Snow <[email protected]>
Acked-by: Anthony PERARD <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: David Gibson <[email protected]>
Acked-by: David Gibson <[email protected]>
Reviewed-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agopci: Add INTERFACE_PCIE_DEVICE to all PCIe devices
Eduardo Habkost [Wed, 27 Sep 2017 19:56:33 +0000 (16:56 -0300)]
pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices

Change all devices that set is_express=1 to implement
INTERFACE_PCIE_DEVICE.

Cc: Keith Busch <[email protected]>
Cc: Kevin Wolf <[email protected]>
Cc: Max Reitz <[email protected]>
Cc: Dmitry Fleytman <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Marcel Apfelbaum <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: [email protected]
Reviewed-by: Alistair Francis <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: David Gibson <[email protected]>
Reviewed-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agopci: Add interface names to hybrid PCI devices
Eduardo Habkost [Wed, 27 Sep 2017 19:56:32 +0000 (16:56 -0300)]
pci: Add interface names to hybrid PCI devices

The following devices support both PCI Express and Conventional
PCI, by including special code to handle the QEMU_PCI_CAP_EXPRESS
flag and/or conditional pcie_endpoint_cap_init() calls:

* vfio-pci (is_express=1, but legacy PCI handled by
  vfio_populate_device())
* vmxnet3 (is_express=0, but PCIe handled by vmxnet3_realize())
* pvscsi (is_express=0, but PCIe handled by pvscsi_realize())
* virtio-pci (is_express=0, but PCIe handled by
  virtio_pci_dc_realize(), and additional legacy PCI code at
  virtio_pci_realize())
* base-xhci (is_express=1, but pcie_endpoint_cap_init() call
  is conditional on pci_bus_is_express(dev->bus)
  * Note that xhci does not clear QEMU_PCI_CAP_EXPRESS like the
    other hybrid devices

Cc: Dmitry Fleytman <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Alex Williamson <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: David Gibson <[email protected]>
Reviewed-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agopci: conventional-pci-device and pci-express-device interfaces
Eduardo Habkost [Wed, 27 Sep 2017 19:56:31 +0000 (16:56 -0300)]
pci: conventional-pci-device and pci-express-device interfaces

Those two interfaces will be used to indicate which device types
support Conventional PCI or PCI Express buses.  Management
software will be able to use the qom-list-types QMP command to
query that information.

Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: David Gibson <[email protected]>
Reviewed-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agoPCI: PCIe access should always be little endian
Matt Redfearn [Tue, 15 Aug 2017 14:44:17 +0000 (15:44 +0100)]
PCI: PCIe access should always be little endian

PCIe busses are always little endian, so set the endianness of the
memory region to little endian rather than native such that operations
work as expected on big endian targets.

Signed-off-by: Matt Redfearn <[email protected]>
Reviewed-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agovirtio/pci/migration: Convert to VMState
Dr. David Alan Gilbert [Mon, 25 Sep 2017 16:05:17 +0000 (17:05 +0100)]
virtio/pci/migration: Convert to VMState

Convert the 'modern_state' part of virtio-pci to modern migration
macros.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agohw/pci-bridge/pcie_pci_bridge: properly handle MSI unavailability case
Aleksandr Bezzubikov [Sun, 24 Sep 2017 23:21:58 +0000 (02:21 +0300)]
hw/pci-bridge/pcie_pci_bridge: properly handle MSI unavailability case

QEMU with the pcie-pci-bridge device crashes if the guest board doesn't support MSI,
e.g. 'qemu-system-ppc64 -M prep -device pcie-pci-bridge'.
This is caused by wrong pcie-pci-bridge instantiation error handling. This patch fixes this issue
by falling back to legacy INTx if MSI is not available.
Also set the bridge's 'msi' property default value to 'auto' in order to trigger errors
only when user explicitly set msi=on.

Reported-by: Eduardo Habkost <[email protected]>
Signed-off-by: Aleksandr Bezzubikov <[email protected]>
Reviewed-by: Marcel Apfelbaum <[email protected]>
Tested-by: Thomas Huth <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agopci: allow 32-bit PCI IO accesses to pass through the PCI bridge
Mark Cave-Ayland [Fri, 22 Sep 2017 12:18:31 +0000 (13:18 +0100)]
pci: allow 32-bit PCI IO accesses to pass through the PCI bridge

Whilst the underlying PCI bridge implementation supports 32-bit PCI IO
accesses, unfortunately they are truncated at the legacy 64K limit.

Signed-off-by: Mark Cave-Ayland <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agovirtio/vhost: reset dev->log after syncing
Felipe Franciosi [Wed, 20 Sep 2017 18:53:06 +0000 (11:53 -0700)]
virtio/vhost: reset dev->log after syncing

vhost_log_put() is called to decomission the dirty log between qemu and
a vhost device when stopping the device. Such a call can happen from
migration_completion().

Present code sets dev->log_size to zero too early in vhost_log_put(),
causing the sync check to always return false. As a consequence, the
last pass on the dirty bitmap never happens at the end of migration.

If a vhost device was busy (writing to guest memory) until the last
moments before vhost_virtqueue_stop(), this error will result in guest
memory corruption (at least) following migrations.

Signed-off-by: Felipe Franciosi <[email protected]>
Acked-by: Jason Wang <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agoMAINTAINERS: add Dump maintainers
Marc-André Lureau [Mon, 11 Sep 2017 16:59:29 +0000 (18:59 +0200)]
MAINTAINERS: add Dump maintainers

Proposing myself, since I have some familiarity with the code now.

Signed-off-by: Marc-André Lureau <[email protected]>
Acked-by: Laszlo Ersek <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agoscripts/dump-guest-memory.py: add vmcoreinfo
Marc-André Lureau [Mon, 11 Sep 2017 16:59:28 +0000 (18:59 +0200)]
scripts/dump-guest-memory.py: add vmcoreinfo

Add a vmcoreinfo ELF note in the dump if vmcoreinfo device has the
memory location details.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agokdump: set vmcoreinfo location
Marc-André Lureau [Mon, 11 Sep 2017 16:59:27 +0000 (18:59 +0200)]
kdump: set vmcoreinfo location

kdump header provides offset and size of the vmcoreinfo content,
append it if available (skip the ELF note header).

crash-7.1.9 was the first version that started looking in the
vmcoreinfo data for phys_base instead of in the kdump_sub_header.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agodump: update phys_base header field based on VMCOREINFO content
Marc-André Lureau [Mon, 11 Sep 2017 16:59:26 +0000 (18:59 +0200)]
dump: update phys_base header field based on VMCOREINFO content

If the guest note is VMCOREINFO, try to get phys_base from it.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agodump: add guest ELF note
Marc-André Lureau [Mon, 11 Sep 2017 16:59:25 +0000 (18:59 +0200)]
dump: add guest ELF note

Read the guest ELF PT_NOTE from guest memory when fw_cfg
etc/vmcoreinfo entry provides the location, and write it as an
additional note in the dump.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agohw/misc: add vmcoreinfo device
Marc-André Lureau [Mon, 11 Sep 2017 16:59:24 +0000 (18:59 +0200)]
hw/misc: add vmcoreinfo device

See docs/specs/vmcoreinfo.txt for details.

"etc/vmcoreinfo" fw_cfg entry is added when using "-device vmcoreinfo".

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agofw_cfg: add write callback
Marc-André Lureau [Mon, 11 Sep 2017 16:59:23 +0000 (18:59 +0200)]
fw_cfg: add write callback

Reintroduce the write callback that was removed when write support was
removed in commit 023e3148567ac898c7258138f8e86c3c2bb40d07.

Contrary to the previous callback implementation, the write_cb
callback is called whenever a write happened, so handlers must be
ready to handle partial write as necessary.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agopci: Set err to errp directly rather than through error_propagate()
Mao Zhongyi [Sat, 9 Sep 2017 06:22:26 +0000 (14:22 +0800)]
pci: Set err to errp directly rather than through error_propagate()

ioh3420_interrupts_init() pass error message to local_err, then
propagate it to errp by error_propagate(), which is not necessary.
So eliminate it and pass errp directly instead of local_err.

Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Marcel Apfelbaum <[email protected]>
Signed-off-by: Mao Zhongyi <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agoxio3130_downstream: Report error if pcie_chassis_add_slot() failed
Eduardo Habkost [Fri, 25 Aug 2017 19:54:06 +0000 (16:54 -0300)]
xio3130_downstream: Report error if pcie_chassis_add_slot() failed

On commit f8cd1b02 ("pci: Convert to realize"), no error_set*()
call was added for the pcie_chassis_add_slot() error case.
pcie_chassis_add_slot() errors get ignored, making QEMU crash
later.  e.g.:

  $ qemu-system-x86_64 -device ioh3420 -device xio3130-downstream
  qemu-system-x86_64: memory.c:2166: memory_region_del_subregion: Assertion `subregion->container == mr' failed.
  Aborted (core dumped)

Fix it by reporting the error using error_setg().

Fixes: f8cd1b0201c41d88bb97dcafb80348a0e88d8805
Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Marcel Apfelbaum <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
7 years agonbd: header constants indenting
Vladimir Sementsov-Ogievskiy [Thu, 12 Oct 2017 09:53:14 +0000 (12:53 +0300)]
nbd: header constants indenting

Prepare indenting for the following commit.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <20171012095319[email protected]>
Signed-off-by: Eric Blake <[email protected]>
7 years agonbd/server: simplify reply transmission
Vladimir Sementsov-Ogievskiy [Thu, 12 Oct 2017 22:29:00 +0000 (17:29 -0500)]
nbd/server: simplify reply transmission

Send qiov via qio_channel_writev_all instead of calling nbd_write twice
with a cork.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20171012095319[email protected]>
[eblake: rebase to tweaks earlier in series]
Signed-off-by: Eric Blake <[email protected]>
7 years agonbd/server: refactor nbd_co_send_simple_reply parameters
Vladimir Sementsov-Ogievskiy [Thu, 12 Oct 2017 09:53:12 +0000 (12:53 +0300)]
nbd/server: refactor nbd_co_send_simple_reply parameters

Pass client and buffer (*data) parameters directly, to make the function
consistent with further structured reply sending functions.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20171012095319[email protected]>
Signed-off-by: Eric Blake <[email protected]>
7 years agonbd/server: do not use NBDReply structure
Vladimir Sementsov-Ogievskiy [Thu, 12 Oct 2017 22:05:06 +0000 (17:05 -0500)]
nbd/server: do not use NBDReply structure

NBDReply structure will be upgraded in future patches to handle both
simple and structured replies and will be used only in the client

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20171012095319[email protected]>
[eblake: rebase to tweaks earlier in series]
Signed-off-by: Eric Blake <[email protected]>
7 years agoblock/throttle.c: add bdrv_co_drain_begin/end callbacks
Manos Pitsidianakis [Sat, 23 Sep 2017 11:14:11 +0000 (14:14 +0300)]
block/throttle.c: add bdrv_co_drain_begin/end callbacks

Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Fam Zheng <[email protected]>
Signed-off-by: Manos Pitsidianakis <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
7 years agoblock: rename bdrv_co_drain to bdrv_co_drain_begin
Manos Pitsidianakis [Sat, 23 Sep 2017 11:14:10 +0000 (14:14 +0300)]
block: rename bdrv_co_drain to bdrv_co_drain_begin

Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Fam Zheng <[email protected]>
Signed-off-by: Manos Pitsidianakis <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
7 years agoblock: add bdrv_co_drain_end callback
Manos Pitsidianakis [Sat, 23 Sep 2017 11:14:09 +0000 (14:14 +0300)]
block: add bdrv_co_drain_end callback

BlockDriverState has a bdrv_co_drain() callback but no equivalent for
the end of the drain. The throttle driver (block/throttle.c) needs a way
to mark the end of the drain in order to toggle io_limits_disabled
correctly, thus bdrv_co_drain_end is needed.

Signed-off-by: Manos Pitsidianakis <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Fam Zheng <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
7 years agospecs: Describe the TPM support in QEMU
Stefan Berger [Wed, 4 Oct 2017 17:12:09 +0000 (13:12 -0400)]
specs: Describe the TPM support in QEMU

This patch adds a description of the current TPM support in QEMU
to the specs.

Several public specs are referenced via their landing page on the
trustedcomputinggroup.org website.

Signed-off-by: Stefan Berger <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
7 years agotpm: Move tpm_cleanup() to right place
Amarnath Valluri [Fri, 29 Sep 2017 11:10:21 +0000 (14:10 +0300)]
tpm: Move tpm_cleanup() to right place

As Emulator TPM backend uses chardev, tpm cleanup should happen before chardev
similar to other vhost-users.

Signed-off-by: Amarnath Valluri <[email protected]>
Reviewed-by: Stefan Berger <[email protected]>
Signed-off-by: Stefan Berger <[email protected]>
7 years agotpm: Added support for TPM emulator
Amarnath Valluri [Fri, 29 Sep 2017 11:10:20 +0000 (14:10 +0300)]
tpm: Added support for TPM emulator

This change introduces a new TPM backend driver that can communicate with
swtpm(software TPM emulator) using unix domain socket interface. QEMU talks to
the TPM emulator using QEMU's socket-based chardev backend device.

Swtpm uses two Unix sockets for communications, one for plain TPM commands and
responses, and one for out-of-band control messages. QEMU passes the data
socket to be used over the control channel.

The swtpm and associated tools can be found here:
    https://github.com/stefanberger/swtpm

The swtpm's control channel protocol specification can be found here:
    https://github.com/stefanberger/swtpm/wiki/Control-Channel-Specification

Usage:
    # setup TPM state directory
    mkdir /tmp/mytpm
    chown -R tss:root /tmp/mytpm
    /usr/bin/swtpm_setup --tpm-state /tmp/mytpm --createek

    # Ask qemu to use TPM emulator with given tpm state directory
    qemu-system-x86_64 \
        [...] \
        -chardev socket,id=chrtpm,path=/tmp/swtpm-sock \
        -tpmdev emulator,id=tpm0,chardev=chrtpm \
        -device tpm-tis,tpmdev=tpm0 \
        [...]

Signed-off-by: Amarnath Valluri <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Tested-by: Stefan Berger <[email protected]>
Signed-off-by: Stefan Berger <[email protected]>
7 years agotpm-passthrough: move reusable code to utils
Amarnath Valluri [Fri, 29 Sep 2017 11:10:19 +0000 (14:10 +0300)]
tpm-passthrough: move reusable code to utils

Signed-off-by: Amarnath Valluri <[email protected]>
Reviewed-by: Stefan Berger <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Signed-off-by: Stefan Berger <[email protected]>
7 years agotpm-backend: Move realloc_buffer() implementation to tpm-tis model
Amarnath Valluri [Fri, 29 Sep 2017 11:10:18 +0000 (14:10 +0300)]
tpm-backend: Move realloc_buffer() implementation to tpm-tis model

buffer reallocation is very unlikely to be backend specific. Hence move inside
the tis.

Signed-off-by: Amarnath Valluri <[email protected]>
Reviewed-by: Stefan Berger <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Signed-off-by: Stefan Berger <[email protected]>
7 years agotpm-backend: Add new API to read backend TpmInfo
Amarnath Valluri [Fri, 29 Sep 2017 11:10:17 +0000 (14:10 +0300)]
tpm-backend: Add new API to read backend TpmInfo

TPM configuration options are backend implementation details and shall not be
part of base TPMBackend object, and these shall not be accessed directly outside
of the class, hence added a new interface method, get_tpm_options() to
TPMDriverOps., which shall be implemented by the derived classes to return
configured tpm options.

A new tpm backend api - tpm_backend_query_tpm() which uses _get_tpm_options() to
prepare TpmInfo.

Signed-off-by: Amarnath Valluri <[email protected]>
Reviewed-by: Stefan Berger <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Signed-off-by: Stefan Berger <[email protected]>
7 years agotpm-backend: Made few interface methods optional
Amarnath Valluri [Fri, 29 Sep 2017 11:10:16 +0000 (14:10 +0300)]
tpm-backend: Made few interface methods optional

This allows backend implementations left optional interface methods.
For mandatory methods assertion checks added.

Took the opportunity to remove unused methods:
 - tpm_backend_get_desc()
 - TPMDriverOps->handle_startup_error

Signed-off-by: Amarnath Valluri <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Reviewed-by: Stefan Berger<[email protected]>
Signed-off-by: Stefan Berger <[email protected]>
7 years agotpm-backend: Initialize and free data members in it's own methods
Amarnath Valluri [Fri, 29 Sep 2017 11:10:15 +0000 (14:10 +0300)]
tpm-backend: Initialize and free data members in it's own methods

Initialize and free TPMBackend data members in it's own instance_init() and
instance_finalize methods.

Took the opportunity to remove unneeded destroy() method from TpmDriverOps
interface as TPMBackend is a Qemu Object, we can use object_unref() inplace of
tpm_backend_destroy() to free the backend object, hence removed destroy() from
TPMDriverOps interface.

Signed-off-by: Amarnath Valluri <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Reviewed-by: Stefan Berger <[email protected]>
Signed-off-by: Stefan Berger <[email protected]>
7 years agotpm-backend: Move thread handling inside TPMBackend
Amarnath Valluri [Fri, 29 Sep 2017 11:10:14 +0000 (14:10 +0300)]
tpm-backend: Move thread handling inside TPMBackend

Move thread handling inside TPMBackend, this way backend implementations need
not to maintain their own thread life cycle, instead they needs to implement
'handle_request()' class method that always been called from a thread.

This change made tpm_backend_int.h kind of useless, hence removed it.

Signed-off-by: Amarnath Valluri <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Reviewed-by: Stefan Berger <[email protected]>
Signed-off-by: Stefan Berger <[email protected]>
7 years agotpm-backend: Remove unneeded member variable from backend class
Amarnath Valluri [Fri, 29 Sep 2017 11:10:13 +0000 (14:10 +0300)]
tpm-backend: Remove unneeded member variable from backend class

TPMDriverOps inside TPMBackend is not required, as it is supposed to be a class
member. The only possible reason for keeping in TPMBackend was, to get the
backend type in tpm.c where dedicated backend api, tpm_backend_get_type() is
present.

Signed-off-by: Amarnath Valluri <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Reviewed-by: Stefan Berger <[email protected]>
Signed-off-by: Stefan Berger <[email protected]>
7 years agotpm: Use EMSGSIZE instead of EBADMSG to compile on OpenBSD
Stefan Berger [Wed, 11 Oct 2017 12:52:43 +0000 (08:52 -0400)]
tpm: Use EMSGSIZE instead of EBADMSG to compile on OpenBSD

EBADMSG was only added to OpenBSD very recently. To make QEMU compilable
on older OpenBSD versions use EMSGSIZE instead when a mismatch between
number of received bytes and message size indicated in the header was
found.

Return -EMSGSIZE and convert all other errnos in the same functions to
return the negative errno.

Signed-off-by: Stefan Berger <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
7 years agonbd/server: structurize simple reply header sending
Vladimir Sementsov-Ogievskiy [Thu, 12 Oct 2017 09:53:10 +0000 (12:53 +0300)]
nbd/server: structurize simple reply header sending

Use packed structure instead of pointer arithmetics.

Also, merge two redundant traces into one.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Message-Id: <20171012095319[email protected]>
[eblake: tweak and mention impact on traces, fix errp usage]
Signed-off-by: Eric Blake <[email protected]>
7 years agonbd: rename some simple-request related objects to be _simple_
Vladimir Sementsov-Ogievskiy [Thu, 12 Oct 2017 09:53:09 +0000 (12:53 +0300)]
nbd: rename some simple-request related objects to be _simple_

To be consistent when their _structured_ analogs will be introduced.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <20171012095319[email protected]>
[eblake: also tweak trace message contents]
Signed-off-by: Eric Blake <[email protected]>
7 years agoblock/nbd-client: refactor nbd_co_receive_reply
Vladimir Sementsov-Ogievskiy [Thu, 12 Oct 2017 09:53:08 +0000 (12:53 +0300)]
block/nbd-client: refactor nbd_co_receive_reply

Pass handle parameter directly, as the whole request isn't needed.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <20171012095319[email protected]>
Signed-off-by: Eric Blake <[email protected]>
7 years agoblock/nbd-client: assert qiov len once in nbd_co_request
Vladimir Sementsov-Ogievskiy [Thu, 12 Oct 2017 09:53:07 +0000 (12:53 +0300)]
block/nbd-client: assert qiov len once in nbd_co_request

Also improve the assertion: check that qiov is NULL for other commands
than CMD_READ and CMD_WRITE.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <20171012095319[email protected]>
Signed-off-by: Eric Blake <[email protected]>
7 years agoNBD: use g_new() family of functions
Marc-André Lureau [Fri, 6 Oct 2017 23:49:16 +0000 (20:49 -0300)]
NBD: use g_new() family of functions

Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20171006235023[email protected]>
Signed-off-by: Eric Blake <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20171012' into...
Peter Maydell [Thu, 12 Oct 2017 16:06:50 +0000 (17:06 +0100)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20171012' into staging

target-arm queue:
 * v8M: SG, BLXNS, secure-return
 * v8M: fixes for coverity issues in previous patches
 * arm: fix armv7m_init() declaration to match definition
 * watchdog/aspeed: fix variable type to store reload value

# gpg: Signature made Thu 12 Oct 2017 17:02:49 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-20171012:
  nvic: Fix miscalculation of offsets into ITNS array
  nvic: Add missing 'break'
  target/arm: Implement SG instruction corner cases
  target/arm: Support some Thumb insns being always unconditional
  target-arm: Simplify insn_crosses_page()
  target/arm: Pull Thumb insn word loads up to top level
  target-arm: Don't check for "Thumb2 or M profile" for not-Thumb1
  target/arm: Implement secure function return
  target/arm: Implement BLXNS
  target/arm: Implement SG instruction
  target/arm: Add M profile secure MMU index values to get_a32_user_mem_index()
  arm: fix armv7m_init() declaration to match definition
  watchdog/aspeed: fix variable type to store reload value

Signed-off-by: Peter Maydell <[email protected]>
7 years agonvic: Fix miscalculation of offsets into ITNS array
Peter Maydell [Tue, 10 Oct 2017 15:54:16 +0000 (16:54 +0100)]
nvic: Fix miscalculation of offsets into ITNS array

This calculation of the first exception vector in
the ITNS<n> register being accessed:
        int startvec = 32 * (offset - 0x380) + NVIC_FIRST_IRQ;

is incorrect, because offset is in bytes, so we only want
to multiply by 8.

Spotted by Coverity (CID 1381484, CID 1381488), though it is
not correct that it actually overflows the buffer, because
we have a 'startvec + i < s->num_irq' guard.

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

7 years agolibvhost-user: Support VHOST_USER_SET_SLAVE_REQ_FD
Dr. David Alan Gilbert [Mon, 2 Oct 2017 19:15:21 +0000 (20:15 +0100)]
libvhost-user: Support VHOST_USER_SET_SLAVE_REQ_FD

Allow the qemu to pass us a slave fd.  We don't do anything
with it yet.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Message-Id: <20171002191521[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>
7 years agolibvhost-user: Update and fix feature and request lists
Dr. David Alan Gilbert [Mon, 2 Oct 2017 19:15:20 +0000 (20:15 +0100)]
libvhost-user: Update and fix feature and request lists

Update the ProtocolFeature and UserRequest lists to
match hw/virtio/vhost-user.c.
Fix the text labelling in libvhost-user.c to match the list.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Message-Id: <20171002191521[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>
7 years agovhost-user-bridge: Only process received packets on started queues
Dr. David Alan Gilbert [Mon, 2 Oct 2017 19:15:19 +0000 (20:15 +0100)]
vhost-user-bridge: Only process received packets on started queues

Only process received packets if the queue has been started.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-Id: <20171002191521[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>
7 years agolibvhost-user: vu_queue_started
Dr. David Alan Gilbert [Mon, 2 Oct 2017 19:15:18 +0000 (20:15 +0100)]
libvhost-user: vu_queue_started

Add a vu_queue_started method to complement vu_queue_enabled.

Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Message-Id: <20171002191521[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>
7 years agonvic: Add missing 'break'
Peter Maydell [Wed, 11 Oct 2017 17:24:36 +0000 (18:24 +0100)]
nvic: Add missing 'break'

Coverity points out that we forgot the 'break' for
the SAU_CTRL write case (CID1381683). This has
no actual visible consequences because it happens
that the following case is effectively a no-op.

Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 1507742676[email protected]
Reviewed-by: Richard Henderson <[email protected]>
7 years agotarget/arm: Implement SG instruction corner cases
Peter Maydell [Mon, 9 Oct 2017 13:48:39 +0000 (14:48 +0100)]
target/arm: Implement SG instruction corner cases

The common situation of the SG instruction is that it is
executed from S&NSC memory by a CPU in NS state. That case
is handled by v7m_handle_execute_nsc(). However the instruction
also has defined behaviour in a couple of other cases:
 * SG instruction in NS memory (behaves as a NOP)
 * SG in S memory but CPU already secure (clears IT bits and
   does nothing else)
 * SG instruction in v8M without Security Extension (NOP)

These can be implemented in translate.c.

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

7 years agotarget/arm: Support some Thumb insns being always unconditional
Peter Maydell [Mon, 9 Oct 2017 13:48:38 +0000 (14:48 +0100)]
target/arm: Support some Thumb insns being always unconditional

A few Thumb instructions are always unconditional even inside an
IT block (as opposed to being UNPREDICTABLE if used inside an
IT block): BKPT, the v8M SG instruction, and the A profile
HLT (debug halt) instruction.

This means we need to suppress the jump-over-instruction-on-condfail
code generation (though the IT state still advances as usual and
subsequent insns in the IT block may be conditional).

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

7 years agotarget-arm: Simplify insn_crosses_page()
Peter Maydell [Mon, 9 Oct 2017 13:48:37 +0000 (14:48 +0100)]
target-arm: Simplify insn_crosses_page()

Recent changes have left insn_crosses_page() more complicated
than it needed to be:
 * it's only called from thumb_tr_translate_insn() so we know
   for certain that we're looking at a Thumb insn
 * the caller's check for dc->pc >= dc->next_page_start - 3
   means that dc->pc can't possibly be 4 aligned, so there's
   no need to check that (the check was partly there to ensure
   that we didn't treat an ARM insn as Thumb, I think)
 * we now have thumb_insn_is_16bit() which lets us do a precise
   check of the length of the next insn, rather than opencoding
   an inaccurate check

Simplify it down to just loading the first half of the insn
and calling thumb_insn_is_16bit() on it.

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

7 years agotarget/arm: Pull Thumb insn word loads up to top level
Peter Maydell [Mon, 9 Oct 2017 13:48:36 +0000 (14:48 +0100)]
target/arm: Pull Thumb insn word loads up to top level

Refactor the Thumb decode to do the loads of the instruction words at
the top level rather than only loading the second half of a 32-bit
Thumb insn in the middle of the decode.

This is simple apart from the awkward case of Thumb1, where the
BL/BLX prefix and suffix instructions live in what in Thumb2 is the
32-bit insn space.  To handle these we decode enough to identify
whether we're looking at a prefix/suffix that we handle as a 16 bit
insn, or a prefix that we're going to merge with the following suffix
to consider as a 32 bit insn.  The translation of the 16 bit cases
then moves from disas_thumb2_insn() to disas_thumb_insn().

The refactoring has the benefit that we don't need to pass the
CPUARMState* down into the decoder code any more, but the major
reason for doing this is that some Thumb instructions must be always
unconditional regardless of the IT state bits, so we need to know the
whole insn before we emit the "skip this insn if the IT bits and cond
state tell us to" code.  (The always unconditional insns are BKPT,
HLT and SG; the last of these is 32 bits.)

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

7 years agotarget-arm: Don't check for "Thumb2 or M profile" for not-Thumb1
Peter Maydell [Mon, 9 Oct 2017 13:48:35 +0000 (14:48 +0100)]
target-arm: Don't check for "Thumb2 or M profile" for not-Thumb1

The code which implements the Thumb1 split BL/BLX instructions
is guarded by a check on "not M or THUMB2". All we really need
to check here is "not THUMB2" (and we assume that elsewhere too,
eg in the ARCH(6T2) test that UNDEFs the Thumb2 insns).

This doesn't change behaviour because all M profile cores
have Thumb2 and so ARM_FEATURE_M implies ARM_FEATURE_THUMB2.
(v6M implements a very restricted subset of Thumb2, but we
can cross that bridge when we get to it with appropriate
feature bits.)

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

7 years agotarget/arm: Implement secure function return
Peter Maydell [Mon, 9 Oct 2017 13:48:34 +0000 (14:48 +0100)]
target/arm: Implement secure function return

Secure function return happens when a non-secure function has been
called using BLXNS and so has a particular magic LR value (either
0xfefffffe or 0xfeffffff). The function return via BX behaves
specially when the new PC value is this magic value, in the same
way that exception returns are handled.

Adjust our BX excret guards so that they recognize the function
return magic number as well, and perform the function-return
unstacking in do_v7m_exception_exit().

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

7 years agotarget/arm: Implement BLXNS
Peter Maydell [Mon, 9 Oct 2017 13:48:33 +0000 (14:48 +0100)]
target/arm: Implement BLXNS

Implement the BLXNS instruction, which allows secure code to
call non-secure code.

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

7 years agotarget/arm: Implement SG instruction
Peter Maydell [Mon, 9 Oct 2017 13:48:32 +0000 (14:48 +0100)]
target/arm: Implement SG instruction

Implement the SG instruction, which we emulate 'by hand' in the
exception handling code path.

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

7 years agotarget/arm: Add M profile secure MMU index values to get_a32_user_mem_index()
Peter Maydell [Mon, 9 Oct 2017 13:48:31 +0000 (14:48 +0100)]
target/arm: Add M profile secure MMU index values to get_a32_user_mem_index()

Add the M profile secure MMU index values to the switch in
get_a32_user_mem_index() so that LDRT/STRT work correctly
rather than asserting at translate time.

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

7 years agoarm: fix armv7m_init() declaration to match definition
Igor Mammedov [Thu, 12 Oct 2017 12:20:07 +0000 (13:20 +0100)]
arm: fix armv7m_init() declaration to match definition

s/cpu_model/cpu_type/ that has been forgotten during
conversion (ba1ba5cc), while touching the line also
fixup alignment.

Signed-off-by: Igor Mammedov <[email protected]>
Message-id: 1507710805[email protected]
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agowatchdog/aspeed: fix variable type to store reload value
Cédric Le Goater [Thu, 12 Oct 2017 12:20:06 +0000 (13:20 +0100)]
watchdog/aspeed: fix variable type to store reload value

Initially from Anton D. Kachalov" <[email protected]> but the SoB was
missing.

Signed-off-by: Cédric Le Goater <[email protected]>
Acked-by: Andrew Jeffery <[email protected]>
Message-id: 20170920064915[email protected]
[clg: change commit log and subject
      replace UL suffix by ULL ]
Signed-off-by: Cédric Le Goater <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request' into...
Peter Maydell [Thu, 12 Oct 2017 09:02:09 +0000 (10:02 +0100)]
Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request' into staging

Python queue, 2017-10-11

# gpg: Signature made Wed 11 Oct 2017 19:49:40 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/python-next-pull-request:
  scripts: Remove debug parameter from QEMUMachine
  scripts: Remove debug parameter from QEMUMonitorProtocol
  guestperf: Configure logging on all shell frontends
  basevm: Call logging.basicConfig()
  iotests: Set up Python logging

Signed-off-by: Peter Maydell <[email protected]>
7 years agoscripts: Remove debug parameter from QEMUMachine
Eduardo Habkost [Thu, 5 Oct 2017 17:20:13 +0000 (14:20 -0300)]
scripts: Remove debug parameter from QEMUMachine

All scripts that use the QEMUMachine and QEMUQtestMachine classes
(device-crash-test, tests/migration/*, iotests.py, basevm.py)
already configure logging.

The basicConfig() call inside QEMUMachine.__init__() is being
kept just to make sure a script would still work if it didn't
configure logging.

Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20171005172013[email protected]>
Reviewed-by: Lukáš Doktor <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
7 years agoscripts: Remove debug parameter from QEMUMonitorProtocol
Eduardo Habkost [Thu, 5 Oct 2017 17:20:12 +0000 (14:20 -0300)]
scripts: Remove debug parameter from QEMUMonitorProtocol

Use logging module for the QMP debug messages.  The only scripts
that set debug=True are iotests.py and guestperf/engine.py, and
they already call logging.basicConfig() to set up logging.

Scripts that don't configure logging are safe as long as they
don't need debugging output, because debug messages don't trigger
the "No handlers could be found for logger" message from the
Python logging module.

Scripts that already configure logging but don't use debug=True
(e.g. scripts/vm/basevm.py) will get QMP debugging enabled for
free.

Cc: "Alex Bennée" <[email protected]>
Cc: Fam Zheng <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20171005172013[email protected]>
Reviewed-by: Lukáš Doktor <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
7 years agoguestperf: Configure logging on all shell frontends
Eduardo Habkost [Thu, 5 Oct 2017 17:20:11 +0000 (14:20 -0300)]
guestperf: Configure logging on all shell frontends

The logging module will eventually replace the 'debug' parameter
in QEMUMachine and QEMUMonitorProtocol.

Cc: Daniel P. Berrange <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20171005172013[email protected]>
Reviewed-by: Lukáš Doktor <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
7 years agobasevm: Call logging.basicConfig()
Eduardo Habkost [Wed, 27 Sep 2017 13:03:37 +0000 (10:03 -0300)]
basevm: Call logging.basicConfig()

Just setting level=DEBUG when debug is enabled is not enough: we
need to set up a log handler if we want debug messages generated
using logging.getLogger(...).debug() to be printed.

This was not a problem before because logging.debug() calls
logging.basicConfig() implicitly, but it's safer to not rely on
that.

Cc: "Alex Bennée" <[email protected]>
Cc: Fam Zheng <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20170927130339[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
Reviewed-by: Fam Zheng <[email protected]>
Reviewed-by: Lukáš Doktor <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
7 years agoiotests: Set up Python logging
Eduardo Habkost [Wed, 27 Sep 2017 13:03:36 +0000 (10:03 -0300)]
iotests: Set up Python logging

Set up Python logging module instead of relying on
QEMUMachine._debug to enable debugging messages.

Cc: Kevin Wolf <[email protected]>
Cc: Max Reitz <[email protected]>
Cc: [email protected]
Signed-off-by: Eduardo Habkost <[email protected]>
Message-Id: <20170927130339[email protected]>
Reviewed-by: Daniel P. Berrange <[email protected]>
Reviewed-by: Lukáš Doktor <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/elmarco/tags/vus-pull-request' into staging
Peter Maydell [Wed, 11 Oct 2017 12:10:36 +0000 (13:10 +0100)]
Merge remote-tracking branch 'remotes/elmarco/tags/vus-pull-request' into staging

# gpg: Signature made Tue 10 Oct 2017 22:33:56 BST
# gpg:                using RSA key 0xDAE8E10975969CE5
# gpg: Good signature from "Marc-André Lureau <[email protected]>"
# gpg:                 aka "Marc-André Lureau <[email protected]>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* remotes/elmarco/tags/vus-pull-request: (27 commits)
  vhost-user-scsi: remove server_sock from VusDev
  vhost-user-scsi: use libvhost-user glib helper
  libvhost-user: add glib source helper
  vhost-user-scsi: use glib logging
  vhost-user-scsi: simplify source handling
  vhost-user-scsi: drop extra callback pointer
  vhost-user-scsi: don't copy iscsi/scsi-lowlevel.h
  vhost-user-scsi: avoid use of iscsi_ namespace
  vhost-user-scsi: rename VUS types
  vhost-user-scsi: remove unimplemented functions
  vhost-user-scsi: remove VUS_MAX_LUNS
  vhost-user-scsi: remove vdev_scsi_add_iscsi_lun()
  vhost-user-scsi: assert() in iscsi_add_lun()
  vhost-user-scsi: use NULL pointer
  vhost-user-scsi: simplify unix path cleanup
  vhost-user-scsi: remove vdev_scsi_find_by_vu()
  vhost-user-scsi: also free the gtree
  vhost-user-scsi: glib calls that allocate don't return NULL
  vhost-user-scsi: use glib allocation
  vhost-user-scsi: code style fixes
  ...

Signed-off-by: Peter Maydell <[email protected]>
7 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-tcg-20171010' into staging
Peter Maydell [Wed, 11 Oct 2017 08:56:16 +0000 (09:56 +0100)]
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20171010' into staging

Queued TCG patches

# gpg: Signature made Tue 10 Oct 2017 20:23:12 BST
# gpg:                using RSA key 0x64DF38E8AF7E215F
# gpg: Good signature from "Richard Henderson <[email protected]>"
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-tcg-20171010:
  tcg/mips: delete commented out extern keyword.
  tcg: define TCG_HIGHWATER
  util: move qemu_real_host_page_size/mask to osdep.h
  tcg: take .helpers out of TCGContext
  tci: move tci_regs to tcg_qemu_tb_exec's stack
  exec-all: extract tb->tc_* into a separate struct tc_tb
  translate-all: define and use DEBUG_TB_CHECK_GATE
  translate-all: define and use DEBUG_TB_INVALIDATE_GATE
  exec-all: introduce TB_PAGE_ADDR_FMT
  translate-all: define and use DEBUG_TB_FLUSH_GATE
  exec-all: bring tb->invalid into tb->cflags
  tcg: consolidate TB lookups in tb_lookup__cpu_state
  tcg: remove addr argument from lookup_tb_ptr
  tcg/mips: constify tcg_target_callee_save_regs
  tcg/i386: constify tcg_target_callee_save_regs
  cpu-exec: rename have_tb_lock to acquired_tb_lock in tb_find
  translate-all: make have_tb_lock static
  exec-all: fix typos in TranslationBlock's documentation
  tcg: fix corruption of code_time profiling counter upon tb_flush
  cputlb: bring back tlb_flush_count under !TLB_DEBUG

Signed-off-by: Peter Maydell <[email protected]>
7 years agovhost-user-scsi: remove server_sock from VusDev
Marc-André Lureau [Thu, 17 Aug 2017 19:04:56 +0000 (21:04 +0200)]
vhost-user-scsi: remove server_sock from VusDev

It is unneeded in the VusDev device structure, and also simplify a bit
the code.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
7 years agovhost-user-scsi: use libvhost-user glib helper
Marc-André Lureau [Thu, 17 Aug 2017 19:04:56 +0000 (21:04 +0200)]
vhost-user-scsi: use libvhost-user glib helper

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
This page took 0.097949 seconds and 4 git commands to generate.