]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
7 years agoMerge remote-tracking branch 'elmarco/tags/chr-tests-pull-request' into staging
Stefan Hajnoczi [Fri, 5 May 2017 16:04:07 +0000 (17:04 +0100)]
Merge remote-tracking branch 'elmarco/tags/chr-tests-pull-request' into staging

# gpg: Signature made Thu 04 May 2017 12:42:10 PM BST
# gpg:                using RSA key 0xDAE8E10975969CE5
# gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>"
# gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>"
# Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5

* elmarco/tags/chr-tests-pull-request: (21 commits)
  tests: add /char/console test
  tests: add /char/udp test
  tests: add /char/socket test
  tests: add /char/file test
  tests: add /char/pipe test
  tests: add alias check in /char/ringbuf
  char-udp: flush as much buffer as possible
  char-socket: add 'connected' property
  char-socket: add 'addr' property
  char-socket: update local address after listen
  char-socket: introduce update_disconnected_filename()
  char: useless NULL check
  char: remove chardevs list
  char: remove qemu_chardev_add
  char: use /chardevs container instead of chardevs list
  vl: add todo note about root container cleanup
  char: add a /chardevs container
  container: don't leak container reference
  xen: use a better chardev type check
  mux: simplfy muxes_realize_done
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoMerge remote-tracking branch 'cohuck/tags/s390x-3270-20170504' into staging
Stefan Hajnoczi [Fri, 5 May 2017 15:56:23 +0000 (16:56 +0100)]
Merge remote-tracking branch 'cohuck/tags/s390x-3270-20170504' into staging

Basic support for using channel-attached 3270 'green-screen'
devices via tn3270. Actual handling of the data stream is
delegated to x3270; more info at http://wiki.qemu.org/Features/3270

# gpg: Signature made Thu 04 May 2017 11:36:51 AM BST
# gpg:                using RSA key 0xDECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>"
# gpg:                 aka "Cornelia Huck <cohuck@kernel.org>"
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
# gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* cohuck/tags/s390x-3270-20170504:
  s390x/3270: Mark non-migratable and enable the device
  s390x/3270: Detect for continued presence of a 3270 client
  s390x/3270: Add the TCP socket events handler for 3270
  s390x/3270: 3270 data stream handling
  s390x/3270: Add emulated terminal3270 device
  s390x/3270: Add abstract emulated ccw-attached 3270 device
  s390x/css: Add an algorithm to find a free chpid
  chardev: Basic support for TN3270

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoMerge remote-tracking branch 'quintela/tags/migration/20170504' into staging
Stefan Hajnoczi [Fri, 5 May 2017 15:52:12 +0000 (16:52 +0100)]
Merge remote-tracking branch 'quintela/tags/migration/20170504' into staging

migration/next for 20170504

# gpg: Signature made Thu 04 May 2017 10:35:41 AM BST
# gpg:                using RSA key 0xF487EF185872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>"
# gpg:                 aka "Juan Quintela <quintela@trasno.org>"
# Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723

* quintela/tags/migration/20170504:
  migration: Extra tracing
  migration: Move postcopy-ram.h to migration/
  monitor: Move hmp_info_snapshots from savevm.c to hmp.c
  monitor: Move hmp_delvm from savevm.c to hmp.c
  monitor: Move hmp_savevm from savevm.c to hmp.c
  monitor: Move hmp_loadvm from monitor.c to hmp.c
  monitor: Remove monitor parameter from save_vmstate
  migration: to_dst_file at that point is NULL
  migration: setup bi-directional I/O channel for exec: protocol
  ram: Split dirty bitmap by RAMBlock

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoMerge remote-tracking branch 'kraxel/tags/pull-audio-20170504-1' into staging
Stefan Hajnoczi [Fri, 5 May 2017 15:46:51 +0000 (16:46 +0100)]
Merge remote-tracking branch 'kraxel/tags/pull-audio-20170504-1' into staging

audio: cleanups, bugfixes (memory leaks).

# gpg: Signature made Thu 04 May 2017 08:16:50 AM BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* kraxel/tags/pull-audio-20170504-1: (30 commits)
  audio: Use ARRAY_SIZE from qemu/osdep.h
  audio: un-export OPLResetChip
  audio: Remove unused typedefs
  audio: UpdateHandler is not used anymore
  audio: IRQHandler is not used anymore
  audio: OPLSetUpdateHandler is not used anywhere
  audio: OPLSetIRQHandler is not used anywhere
  audio: GUSsample is int16_t
  audio: GUSword is uint16_t
  audio: GUSword is uint16_t
  audio: remove GUSchar
  audio: GUSbyte is uint8_t
  audio: Remove unused fields
  audio: Remove type field
  audio: Remove Unused OPL_TYPE_*
  audio: Unfold OPLSAMPLE
  audio: Remove INT32
  audio: remove INT16
  audio: Remove INT8
  audio: remove UINT32
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoMerge remote-tracking branch 'kraxel/tags/pull-input-20170504-1' into staging
Stefan Hajnoczi [Fri, 5 May 2017 15:30:59 +0000 (16:30 +0100)]
Merge remote-tracking branch 'kraxel/tags/pull-input-20170504-1' into staging

input: limit kbd queue depth
input: don't queue delay if paused
input: Add trace event for empty keyboard queue

# gpg: Signature made Thu 04 May 2017 06:48:37 AM BST
# gpg:                using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* kraxel/tags/pull-input-20170504-1:
  input: Add trace event for empty keyboard queue
  input: don't queue delay if paused
  input: limit kbd queue depth

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoMerge remote-tracking branch 'shorne/tags/pull-or-20170504' into staging
Stefan Hajnoczi [Fri, 5 May 2017 15:21:00 +0000 (16:21 +0100)]
Merge remote-tracking branch 'shorne/tags/pull-or-20170504' into staging

Openrisc Features and Fixes for qemu 2.10

# gpg: Signature made Thu 04 May 2017 01:41:45 AM BST
# gpg:                using RSA key 0xC3B31C2D5E6627E4
# gpg: Good signature from "Stafford Horne <shorne@gmail.com>"
# 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: D9C4 7354 AEF8 6C10 3A25  EFF1 C3B3 1C2D 5E66 27E4

* shorne/tags/pull-or-20170504:
  target/openrisc: Support non-busy idle state using PMR SPR
  target/openrisc: Remove duplicate features property
  target/openrisc: Implement full vmstate serialization
  migration: Add VMSTATE_STRUCT_2DARRAY()
  target/openrisc: implement shadow registers
  migration: Add VMSTATE_UINTTL_2DARRAY()
  target/openrisc: add numcores and coreid support
  target/openrisc: Fixes for memory debugging
  target/openrisc: Implement EPH bit
  target/openrisc: Implement EVBAR register
  MAINTAINERS: Add myself as openrisc maintainer

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoMerge remote-tracking branch 'awilliam/tags/vfio-updates-20170503.0' into staging
Stefan Hajnoczi [Fri, 5 May 2017 15:14:08 +0000 (16:14 +0100)]
Merge remote-tracking branch 'awilliam/tags/vfio-updates-20170503.0' into staging

VFIO fixes 2017-05-03

 - Enable 8-byte memory region accesses (Jose Ricardo Ziviani)
 - Fix vfio-pci error message (Dong Jia Shi)

# gpg: Signature made Wed 03 May 2017 10:28:55 PM BST
# gpg:                using RSA key 0x239B9B6E3BB08B22
# gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>"
# gpg:                 aka "Alex Williamson <alex@shazbot.org>"
# gpg:                 aka "Alex Williamson <alwillia@redhat.com>"
# gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>"
# Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22

* awilliam/tags/vfio-updates-20170503.0:
  vfio/pci: Fix incorrect error message
  vfio: enable 8-byte reads/writes to vfio
  vfio: Set MemoryRegionOps:max_access_size and min_access_size

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoMerge remote-tracking branch 'cohuck/tags/s390x-20170502' into staging
Stefan Hajnoczi [Fri, 5 May 2017 14:59:56 +0000 (15:59 +0100)]
Merge remote-tracking branch 'cohuck/tags/s390x-20170502' into staging

More s390x patches, this time boot related:
- LOADPARM machine property, exposed to the guest via SCLP and
  diagnose 308
- Use LOADPARM in the s390-ccw bios to select a boot entry
- Fix a crash in the ipl device code when a virtio-scsi-pci device
  has been specified

# gpg: Signature made Tue 02 May 2017 02:29:26 PM BST
# gpg:                using RSA key 0xDECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>"
# gpg:                 aka "Cornelia Huck <cohuck@kernel.org>"
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
# gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* cohuck/tags/s390x-20170502:
  hw/s390x/ipl: Fix crash with virtio-scsi-pci device
  pc-bios/s390-ccw.img: update image
  pc-bios/s390-ccw: add boot entry selection to El Torito routine
  pc-bios/s390-ccw: add boot entry selection for ECKD DASD
  pc-bios/s390-ccw: provide entry selection on LOADPARM for SCSI disk
  pc-bios/s390-ccw: provide a function to interpret LOADPARM value
  pc-bios/s390-ccw: get LOADPARM stored in SCP Read Info
  pc-bios/s390-ccw: Make ebcdic/ascii conversion public
  util/qemu-config: Add loadparm to qemu machine_opts
  hw/s390x/sclp: update LOADPARM in SCP Info
  hw/s390x/ipl: enable LOADPARM in IPIB for a boot device
  hw/s390x: provide loadparm property for the machine

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agoMerge remote-tracking branch 'kwolf/tags/for-upstream' into staging
Stefan Hajnoczi [Thu, 4 May 2017 12:44:32 +0000 (13:44 +0100)]
Merge remote-tracking branch 'kwolf/tags/for-upstream' into staging

Block layer patches

# gpg: Signature made Fri 28 Apr 2017 09:20:17 PM BST
# gpg:                using RSA key 0x7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* kwolf/tags/for-upstream: (34 commits)
  progress: Show current progress on SIGINFO
  iotests: fix exclusion option
  iotests: clarify help text
  qemu-img: use blk_co_pwrite_zeroes for zero sectors when compressed
  qemu-img: improve convert_iteration_sectors()
  block: assert no image modification under BDRV_O_INACTIVE
  block: fix obvious coding style mistakes in block_int.h
  qcow2: Allow discard of final unaligned cluster
  block: Add .bdrv_truncate() error messages
  block: Add errp to BD.bdrv_truncate()
  block: Add errp to b{lk,drv}_truncate()
  block/vhdx: Make vhdx_create() always set errp
  qemu-img: Document backing options
  qemu-img/convert: Move bs_n > 1 && -B check down
  qemu-img/convert: Use @opts for one thing only
  block: fix alignment calculations in bdrv_co_do_zero_pwritev
  block: Do not unref bs->file on error in BD's open
  iotests: 109: Filter out "len" of failed jobs
  iotests: Fix typo in 026
  Issue a deprecation warning if the user specifies the "-hdachs" option.
  ...

Message-id: 1493411622-5343-1-git-send-email-kwolf@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agotests: add /char/console test
Marc-André Lureau [Tue, 3 Jan 2017 18:55:55 +0000 (19:55 +0100)]
tests: add /char/console test

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agotests: add /char/udp test
Marc-André Lureau [Tue, 3 Jan 2017 18:22:19 +0000 (19:22 +0100)]
tests: add /char/udp test

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agotests: add /char/socket test
Marc-André Lureau [Tue, 3 Jan 2017 18:22:03 +0000 (19:22 +0100)]
tests: add /char/socket test

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agotests: add /char/file test
Marc-André Lureau [Tue, 3 Jan 2017 18:21:39 +0000 (19:21 +0100)]
tests: add /char/file test

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agotests: add /char/pipe test
Marc-André Lureau [Tue, 3 Jan 2017 18:20:05 +0000 (19:20 +0100)]
tests: add /char/pipe test

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agotests: add alias check in /char/ringbuf
Marc-André Lureau [Tue, 3 Jan 2017 18:21:09 +0000 (19:21 +0100)]
tests: add alias check in /char/ringbuf

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agochar-udp: flush as much buffer as possible
Marc-André Lureau [Fri, 23 Dec 2016 13:55:54 +0000 (14:55 +0100)]
char-udp: flush as much buffer as possible

Instead of flushing the buffer byte by byte, call qemu_chr_be_write()
with as much byte possible accepted by the front-end.

Factor out buffer flushing in a common function udp_chr_flush_buffer().

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7 years agochar-socket: add 'connected' property
Marc-André Lureau [Wed, 21 Dec 2016 14:43:46 +0000 (15:43 +0100)]
char-socket: add 'connected' property

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7 years agochar-socket: add 'addr' property
Marc-André Lureau [Wed, 21 Dec 2016 11:26:38 +0000 (12:26 +0100)]
char-socket: add 'addr' property

Add a property to lookup the connection details.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7 years agochar-socket: update local address after listen
Marc-André Lureau [Tue, 20 Dec 2016 14:36:57 +0000 (15:36 +0100)]
char-socket: update local address after listen

This is mainly useful to know the actual bound port when using port 0.

For example, when starting qemu with socket on port 0, before:
QEMU waiting for connection on: disconnected:tcp:localhost:0,server
After:
QEMU waiting for connection on: disconnected:tcp:localhost:32454,server

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agochar-socket: introduce update_disconnected_filename()
Marc-André Lureau [Tue, 20 Dec 2016 14:32:31 +0000 (15:32 +0100)]
char-socket: introduce update_disconnected_filename()

This helper will be used in yet another place in the following patch.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7 years agochar: useless NULL check
Marc-André Lureau [Wed, 14 Dec 2016 20:15:44 +0000 (23:15 +0300)]
char: useless NULL check

g_strdup(NULL) returns NULL already.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7 years agochar: remove chardevs list
Marc-André Lureau [Wed, 14 Dec 2016 19:47:29 +0000 (22:47 +0300)]
char: remove chardevs list

The list is now empty, the chardev cleanup is taken care of by the unref
of the root container.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agochar: remove qemu_chardev_add
Marc-André Lureau [Wed, 14 Dec 2016 17:58:50 +0000 (20:58 +0300)]
char: remove qemu_chardev_add

qemu_chardev_new() now uses object_new_with_props() with /chardevs
parent container. It will fail to insert the object if the same "id"
already exists. "chardevs" list usage has been removed in previous
commits.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agochar: use /chardevs container instead of chardevs list
Marc-André Lureau [Wed, 14 Dec 2016 13:44:19 +0000 (16:44 +0300)]
char: use /chardevs container instead of chardevs list

Use object_resolve_path_component() and object_child_foreach() on
/chardevs container instead of iterating over chardevs list.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agovl: add todo note about root container cleanup
Marc-André Lureau [Fri, 10 Feb 2017 10:27:28 +0000 (14:27 +0400)]
vl: add todo note about root container cleanup

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agochar: add a /chardevs container
Marc-André Lureau [Wed, 14 Dec 2016 12:23:36 +0000 (15:23 +0300)]
char: add a /chardevs container

Add a /chardevs container object to hold the list of chardevs.
(Note: QTAILQ chardevs is going away in the following commits)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agocontainer: don't leak container reference
Marc-André Lureau [Wed, 14 Dec 2016 19:42:55 +0000 (22:42 +0300)]
container: don't leak container reference

object_property_add_child() references the child, unref it after to
avoid ref leaks.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7 years agoxen: use a better chardev type check
Marc-André Lureau [Wed, 14 Dec 2016 12:23:13 +0000 (15:23 +0300)]
xen: use a better chardev type check

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7 years agomux: simplfy muxes_realize_done
Marc-André Lureau [Wed, 14 Dec 2016 11:40:45 +0000 (14:40 +0300)]
mux: simplfy muxes_realize_done

mux_chr_event() already send events to all backends, rename it,
export it, and use it from muxes_realize_done. This should help abstract
away mux implementation.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7 years agochar: remove qemu_chr_be_generic_open
Marc-André Lureau [Wed, 14 Dec 2016 11:23:02 +0000 (14:23 +0300)]
char: remove qemu_chr_be_generic_open

The function simply alias and hides the real event function.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7 years agomigration: Extra tracing
Dr. David Alan Gilbert [Wed, 26 Apr 2017 18:37:21 +0000 (19:37 +0100)]
migration: Extra tracing

A couple more traces that would have made fixing that postcopy
bug a bit easier.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
7 years agomigration: Move postcopy-ram.h to migration/
Juan Quintela [Thu, 20 Apr 2017 11:12:24 +0000 (13:12 +0200)]
migration: Move postcopy-ram.h to migration/

It is internal to migration, not intended for other users.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agos390x/3270: Mark non-migratable and enable the device
Jing Liu [Thu, 12 Jan 2017 09:38:25 +0000 (10:38 +0100)]
s390x/3270: Mark non-migratable and enable the device

Mark 3270 as non-migratable for the experimental stage. Enable
the 3270 device so that we can use x3270 client to operate the guest.

Run qemu with the arguments:
    -chardev socket,id=char3270_0,host=0.0.0.0,port=23,nowait,server,tn3270 \
    -device x-terminal3270,chardev=char3270_0,devno=fe.0.000a,id=terminal3270_0 \

There are some restrictions for the first stage: We don't support SSL
connections, multiple client connections and client resizing. Only
tested with the x3270 client.

Signed-off-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
Signed-off-by: Yang Chen <bjcyang@linux.vnet.ibm.com>
Reviewed-by: QingFeng Hao <haoqf@linux.vnet.ibm.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agos390x/3270: Detect for continued presence of a 3270 client
Jing Liu [Fri, 14 Oct 2016 09:16:23 +0000 (11:16 +0200)]
s390x/3270: Detect for continued presence of a 3270 client

To ensure that we do not keep any 3270 sockets where the client is not
connected anymore, we send a packet with the timing mark option after
ten minutes of client inactivity. If the client does not answer it,
then the socket will be closed automatically.

This helps to ensure that there is no half-open situation on the 3270
socket.

Signed-off-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
Reviewed-by: QingFeng Hao <haoqf@linux.vnet.ibm.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agos390x/3270: Add the TCP socket events handler for 3270
Jing Liu [Thu, 21 Jul 2016 06:00:58 +0000 (08:00 +0200)]
s390x/3270: Add the TCP socket events handler for 3270

This introduces a chr_event handler to handle the 3270 connection
and disconnection events.

Signed-off-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
Reviewed-by: QingFeng Hao <haoqf@linux.vnet.ibm.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agos390x/3270: 3270 data stream handling
Jing Liu [Fri, 1 Apr 2016 06:32:58 +0000 (08:32 +0200)]
s390x/3270: 3270 data stream handling

This introduces the input and output handlers for 3270 device, setting
up the data tunnel among guest kernel, qemu and the 3270 client.

After the client connected and TN3270 handshake done, signal the not-ready
to ready status by an unsolicited device-end interrupt, and then the 3270
data stream could be handled correctly between the channel and socket.
Multiple commands generated by "Reset" key on x3270 are not supported now,
just simply terminate the connection.

Signed-off-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
Signed-off-by: Yang Chen <bjcyang@linux.vnet.ibm.com>
Reviewed-by: QingFeng Hao <haoqf@linux.vnet.ibm.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agos390x/3270: Add emulated terminal3270 device
Yang Chen [Fri, 19 Feb 2016 09:45:26 +0000 (10:45 +0100)]
s390x/3270: Add emulated terminal3270 device

This is a basic implementation of the emulated ccw-attached 3270
called x-terminal3270, which provides visibility of the device in
the qemu monitor and guest. The x prefix indicates that this is
just an experimental implementation for the current stage. This
device will not be compiled until the basic functions are available.

Signed-off-by: Yang Chen <bjcyang@linux.vnet.ibm.com>
Signed-off-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
Reviewed-by: QingFeng Hao <haoqf@linux.vnet.ibm.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agos390x/3270: Add abstract emulated ccw-attached 3270 device
Yang Chen [Mon, 19 Sep 2016 07:46:33 +0000 (09:46 +0200)]
s390x/3270: Add abstract emulated ccw-attached 3270 device

This introduces the infrastructure for the emulated 3270
devices, which will be attached to the virtual-css-bus.

Signed-off-by: Yang Chen <bjcyang@linux.vnet.ibm.com>
Signed-off-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
Reviewed-by: QingFeng Hao <haoqf@linux.vnet.ibm.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agos390x/css: Add an algorithm to find a free chpid
Jing Liu [Mon, 19 Sep 2016 07:10:43 +0000 (09:10 +0200)]
s390x/css: Add an algorithm to find a free chpid

This introduces a function named css_find_free_chpid() to find a
free channel path. Because virtio-ccw device used zero as its
channel path number, it would be sensible to skip the reserved one
and search upwards.

Signed-off-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
Reviewed-by: QingFeng Hao <haoqf@linux.vnet.ibm.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agochardev: Basic support for TN3270
Jing Liu [Fri, 23 Sep 2016 06:06:11 +0000 (08:06 +0200)]
chardev: Basic support for TN3270

This introduces basic support for TN3270, which needs to negotiate
three Telnet options during handshake:
  - End of Record
  - Binary Transmission
  - Terminal-Type

As a basic implementation, this simply ignores NOP and Interrupt
Process(IP) commands. More work should be done for them later.

For more details, please refer to RFC 854 and 1576.

Signed-off-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
Signed-off-by: Yang Chen <bjcyang@linux.vnet.ibm.com>
Reviewed-by: QingFeng Hao <haoqf@linux.vnet.ibm.com>
Acked-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
7 years agomonitor: Move hmp_info_snapshots from savevm.c to hmp.c
Juan Quintela [Tue, 18 Apr 2017 09:51:06 +0000 (11:51 +0200)]
monitor: Move hmp_info_snapshots from savevm.c to hmp.c

It only uses block/* functions, nothing from migration.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomonitor: Move hmp_delvm from savevm.c to hmp.c
Juan Quintela [Tue, 18 Apr 2017 09:46:23 +0000 (11:46 +0200)]
monitor: Move hmp_delvm from savevm.c to hmp.c

It really uses block/* stuff, not migration one.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomonitor: Move hmp_savevm from savevm.c to hmp.c
Juan Quintela [Tue, 18 Apr 2017 09:44:16 +0000 (11:44 +0200)]
monitor: Move hmp_savevm from savevm.c to hmp.c

It is a monitor command, and has nothing migration specific in it.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomonitor: Move hmp_loadvm from monitor.c to hmp.c
Juan Quintela [Tue, 18 Apr 2017 09:40:56 +0000 (11:40 +0200)]
monitor: Move hmp_loadvm from monitor.c to hmp.c

We are going to move the rest of hmp snapshots functions there instead
of monitor.c.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomonitor: Remove monitor parameter from save_vmstate
Juan Quintela [Tue, 18 Apr 2017 09:35:04 +0000 (11:35 +0200)]
monitor: Remove monitor parameter from save_vmstate

load_vmstate() already use error_report, so be consistent.  There is
an identical error message in load_vmstate() that ends in a
period. Remove it.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
7 years agomigration: to_dst_file at that point is NULL
Juan Quintela [Wed, 5 Apr 2017 15:32:56 +0000 (17:32 +0200)]
migration: to_dst_file at that point is NULL

We have just arrived as:

migration.c: qemu_migrate()
  ....
  s = migrate_init() <- puts it to NULL
  ....
  {tcp,unix}_start_outgoing_migration ->
     socket_outgoing_migration
        migration_channel_connect()
   sets to_dst_file

if tls is enabled, we do another round through
migrate_channel_tls_connect(), but we only set it up if there is no
error.  So we don't need the assignation.  I am removing it to remove
in the follwing patches the knowledge about MigrationState in that two
files.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
7 years agomigration: setup bi-directional I/O channel for exec: protocol
Daniel P. Berrange [Fri, 21 Apr 2017 11:12:20 +0000 (12:12 +0100)]
migration: setup bi-directional I/O channel for exec: protocol

Historically the migration data channel has only needed to be
unidirectional. Thus the 'exec:' protocol was requesting an
I/O channel with O_RDONLY on incoming side, and O_WRONLY on
the outgoing side.

This is fine for classic migration, but if you then try to run
TLS over it, this fails because the TLS handshake requires a
bi-directional channel.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
7 years agoram: Split dirty bitmap by RAMBlock
Juan Quintela [Wed, 22 Mar 2017 14:18:04 +0000 (15:18 +0100)]
ram: Split dirty bitmap by RAMBlock

Both the ram bitmap and the unsent bitmap are split by RAMBlock.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
--

Fix compilation when DEBUG_POSTCOPY is enabled (thanks Hailiang)

7 years agoaudio: Use ARRAY_SIZE from qemu/osdep.h
Juan Quintela [Tue, 25 Apr 2017 22:37:39 +0000 (00:37 +0200)]
audio: Use ARRAY_SIZE from qemu/osdep.h

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20170425223739.6703-27-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: un-export OPLResetChip
Juan Quintela [Tue, 25 Apr 2017 22:37:38 +0000 (00:37 +0200)]
audio: un-export OPLResetChip

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20170425223739.6703-26-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: Remove unused typedefs
Juan Quintela [Tue, 25 Apr 2017 22:37:37 +0000 (00:37 +0200)]
audio: Remove unused typedefs

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-25-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: UpdateHandler is not used anymore
Juan Quintela [Tue, 25 Apr 2017 22:37:36 +0000 (00:37 +0200)]
audio: UpdateHandler is not used anymore

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-24-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: IRQHandler is not used anymore
Juan Quintela [Tue, 25 Apr 2017 22:37:35 +0000 (00:37 +0200)]
audio: IRQHandler is not used anymore

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-23-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: OPLSetUpdateHandler is not used anywhere
Juan Quintela [Tue, 25 Apr 2017 22:37:34 +0000 (00:37 +0200)]
audio: OPLSetUpdateHandler is not used anywhere

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-22-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: OPLSetIRQHandler is not used anywhere
Juan Quintela [Tue, 25 Apr 2017 22:37:33 +0000 (00:37 +0200)]
audio: OPLSetIRQHandler is not used anywhere

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-21-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: GUSsample is int16_t
Juan Quintela [Tue, 25 Apr 2017 22:37:32 +0000 (00:37 +0200)]
audio: GUSsample is int16_t

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-20-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: GUSword is uint16_t
Juan Quintela [Tue, 25 Apr 2017 22:37:31 +0000 (00:37 +0200)]
audio: GUSword is uint16_t

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-19-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: GUSword is uint16_t
Juan Quintela [Tue, 25 Apr 2017 22:37:30 +0000 (00:37 +0200)]
audio: GUSword is uint16_t

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-18-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: remove GUSchar
Juan Quintela [Tue, 25 Apr 2017 22:37:29 +0000 (00:37 +0200)]
audio: remove GUSchar

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-17-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: GUSbyte is uint8_t
Juan Quintela [Tue, 25 Apr 2017 22:37:28 +0000 (00:37 +0200)]
audio: GUSbyte is uint8_t

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-16-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: Remove unused fields
Juan Quintela [Tue, 25 Apr 2017 22:37:27 +0000 (00:37 +0200)]
audio: Remove unused fields

These were used for the remove stuff.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-15-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: Remove type field
Juan Quintela [Tue, 25 Apr 2017 22:37:26 +0000 (00:37 +0200)]
audio: Remove type field

It was not used anymore as now there is only one type of devices.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-14-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: Remove Unused OPL_TYPE_*
Juan Quintela [Tue, 25 Apr 2017 22:37:25 +0000 (00:37 +0200)]
audio: Remove Unused OPL_TYPE_*

Since we removed the previous unused devices, they are not used anymore.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-13-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: Unfold OPLSAMPLE
Juan Quintela [Tue, 25 Apr 2017 22:37:24 +0000 (00:37 +0200)]
audio: Unfold OPLSAMPLE

It was used only once, and now it was always int16_t.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-12-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: Remove INT32
Juan Quintela [Tue, 25 Apr 2017 22:37:23 +0000 (00:37 +0200)]
audio: Remove INT32

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-11-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: remove INT16
Juan Quintela [Tue, 25 Apr 2017 22:37:22 +0000 (00:37 +0200)]
audio: remove INT16

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-10-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: Remove INT8
Juan Quintela [Tue, 25 Apr 2017 22:37:21 +0000 (00:37 +0200)]
audio: Remove INT8

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-9-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: remove UINT32
Juan Quintela [Tue, 25 Apr 2017 22:37:20 +0000 (00:37 +0200)]
audio: remove UINT32

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-8-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: remove UINT16
Juan Quintela [Tue, 25 Apr 2017 22:37:19 +0000 (00:37 +0200)]
audio: remove UINT16

More modernitation.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-7-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: Remove UINT8
Juan Quintela [Tue, 25 Apr 2017 22:37:18 +0000 (00:37 +0200)]
audio: Remove UINT8

uint8_t has existed since ..... all this century?

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-6-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: YM3812 was always defined
Juan Quintela [Tue, 25 Apr 2017 22:37:17 +0000 (00:37 +0200)]
audio: YM3812 was always defined

So, remove the ifdefs.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-5-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: Remove YM3526 support
Juan Quintela [Tue, 25 Apr 2017 22:37:16 +0000 (00:37 +0200)]
audio: Remove YM3526 support

It was never compiled in.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-4-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: remove Y8950 configuration
Juan Quintela [Tue, 25 Apr 2017 22:37:15 +0000 (00:37 +0200)]
audio: remove Y8950 configuration

Include file has never been on qemu and it has been undefined from the very beginning.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-3-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoadlib: Remove support for YMF262
Juan Quintela [Tue, 25 Apr 2017 22:37:14 +0000 (00:37 +0200)]
adlib: Remove support for YMF262

Notice that the code was supposed to be in the file ymf262.h, that has
never been on qemu source tree.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-2-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: fix WAVState leak
Marc-André Lureau [Wed, 3 May 2017 22:38:44 +0000 (02:38 +0400)]
audio: fix WAVState leak

Spotted by ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20170503223846.6559-4-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoaudio: release capture buffers
Gerd Hoffmann [Fri, 28 Apr 2017 07:56:12 +0000 (09:56 +0200)]
audio: release capture buffers

AUD_add_capture() allocates two buffers which are never released.
Add the missing calls to AUD_del_capture().

Impact: Allows vnc clients to exhaust host memory by repeatedly
starting and stopping audio capture.

Fixes: CVE-2017-8309
Cc: P J P <ppandit@redhat.com>
Cc: Huawei PSIRT <PSIRT@huawei.com>
Reported-by: "Jiangxin (hunter, SCC)" <jiangxin1@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-id: 20170428075612.9997-1-kraxel@redhat.com

7 years agohw/audio: convert exit callback in HDACodecDeviceClass to void
Zihan Yang [Wed, 26 Apr 2017 12:53:08 +0000 (20:53 +0800)]
hw/audio: convert exit callback in HDACodecDeviceClass to void

The exit callback always return 0, convert it to void

Signed-off-by: Zihan Yang <tgnyang@gmail.com>
Message-id: 1493211188-24086-5-git-send-email-tgnyang@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agohw/audio: replace exit with unrealize in hda_codec_device_class_init
Zihan Yang [Wed, 26 Apr 2017 12:53:07 +0000 (20:53 +0800)]
hw/audio: replace exit with unrealize in hda_codec_device_class_init

The exit callback of DeviceClass will be removed in the future, so
convert to unrealize in the init functioin

Signed-off-by: Zihan Yang <tgnyang@gmail.com>
Message-id: 1493211188-24086-4-git-send-email-tgnyang@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agotarget/openrisc: Support non-busy idle state using PMR SPR
Stafford Horne [Sun, 23 Apr 2017 21:07:42 +0000 (06:07 +0900)]
target/openrisc: Support non-busy idle state using PMR SPR

The OpenRISC architecture has the Power Management Register (PMR)
special purpose register to manage cpu power states.  The interesting
modes are:

 * Doze Mode (DME) - Stop cpu except timer & pic - wake on interrupt
 * Sleep Mode (SME) - Stop cpu and all units - wake on interrupt
 * Suspend Model (SUME) - Stop cpu and all units - wake on reset

The linux kernel will set DME when idle.

This patch implements the PMR SPR and halts the qemu cpu when there is a
change to DME or SME.  This means that openrisc qemu in no longer peggs
a host cpu at 100%.

In order for this to work we need to kick the CPU when timers are
expired.  Update the cpu timer to kick the cpu upon each timer event.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Stafford Horne <shorne@gmail.com>
7 years agotarget/openrisc: Remove duplicate features property
Stafford Horne [Fri, 21 Apr 2017 15:28:55 +0000 (00:28 +0900)]
target/openrisc: Remove duplicate features property

The features property has stored the exact same thing as the cpucfgr
spr. Remove the feature enum and property as it is not needed.

In order to preserve the behavior or keeping features accross reset this
patch moves cpucfgr into the non reset region of the state struct.  Since
the cpucfgr is read only this means we only need to sset cpucfgr once
during class init.

Signed-off-by: Stafford Horne <shorne@gmail.com>
7 years agotarget/openrisc: Implement full vmstate serialization
Stafford Horne [Sun, 16 Apr 2017 10:44:58 +0000 (19:44 +0900)]
target/openrisc: Implement full vmstate serialization

Previously serialization did not persist the tlb, timer, pic and other
key state items.  This meant snapshotting and restoring a running os
would crash. After adding these I am able to take snapshots of a
running linux os and restore at a later time.

I am currently not trying to maintain capatibility with older versions
as I do not believe this really worked before or anyone used it.

Signed-off-by: Stafford Horne <shorne@gmail.com>
7 years agomigration: Add VMSTATE_STRUCT_2DARRAY()
Stafford Horne [Sun, 16 Apr 2017 10:43:23 +0000 (19:43 +0900)]
migration: Add VMSTATE_STRUCT_2DARRAY()

For openrisc we implement tlb state as a 2d array of tlb entry structs.
This is added to allow easy storing of state of 2d arrays.

Signed-off-by: Stafford Horne <shorne@gmail.com>
7 years agotarget/openrisc: implement shadow registers
Stafford Horne [Wed, 5 Apr 2017 21:44:56 +0000 (06:44 +0900)]
target/openrisc: implement shadow registers

Shadow registers are part of the openrisc spec along with sr[cid], as
part of the fast context switching feature.  When exceptions occur,
instead of having to save registers to the stack if enabled the CID will
increment and a new set of registers will be available.

This patch only implements shadow registers which can be used as extra
scratch registers via the mfspr and mtspr if required.  This is
implemented in a way where it would be easy to add on the fast context
switching, currently cid is hardcoded to 0.

This is need for openrisc linux smp kernels to boot correctly.

Signed-off-by: Stafford Horne <shorne@gmail.com>
7 years agomigration: Add VMSTATE_UINTTL_2DARRAY()
Stafford Horne [Sat, 15 Apr 2017 21:05:58 +0000 (06:05 +0900)]
migration: Add VMSTATE_UINTTL_2DARRAY()

In openRISC we are implementing the shadow registers as a 2d array.
Using this target long method rather than direct 32-bit alternatives is
consistent with the rest of our vm state serialization logic.

Signed-off-by: Stafford Horne <shorne@gmail.com>
7 years agotarget/openrisc: add numcores and coreid support
Stafford Horne [Fri, 14 Apr 2017 22:25:32 +0000 (07:25 +0900)]
target/openrisc: add numcores and coreid support

These are used to identify the processor in SMP system.  Their
definition has been defined in verilog cores but it not yet part of the
spec but it will be soon.

The proposal for this is available:
  https://openrisc.io/proposals/core-identifier-and-number-of-cores

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Stafford Horne <shorne@gmail.com>
7 years agotarget/openrisc: Fixes for memory debugging
Stafford Horne [Mon, 13 Mar 2017 14:53:29 +0000 (23:53 +0900)]
target/openrisc: Fixes for memory debugging

When debugging in gdb you might want to inspect instructions in mapped
pages or in exception vectors like 0x800 etc.  This was previously not
possible in qemu since the *get_phys_page_debug() routine only looked
into the data tlb.

Change to fall back to look into instruction tlb and plain physical
pages.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Stafford Horne <shorne@gmail.com>
7 years agovfio/pci: Fix incorrect error message
Dong Jia Shi [Wed, 3 May 2017 20:52:35 +0000 (14:52 -0600)]
vfio/pci: Fix incorrect error message

When the "No host device provided" error occurs, the hint message
that starts with "Use -vfio-pci," makes no sense, since "-vfio-pci"
is not a valid command line parameter.

Correct this by replacing "-vfio-pci" with "-device vfio-pci".

Signed-off-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
7 years agovfio: enable 8-byte reads/writes to vfio
Jose Ricardo Ziviani [Wed, 3 May 2017 20:52:34 +0000 (14:52 -0600)]
vfio: enable 8-byte reads/writes to vfio

This patch enables 8-byte writes and reads to VFIO. Such implemention
is already done but it's missing the 'case' to handle such accesses in
both vfio_region_write and vfio_region_read and the MemoryRegionOps:
impl.max_access_size and impl.min_access_size.

After this patch, 8-byte writes such as:

qemu_mutex_lock locked mutex 0x10905ad8
vfio_region_write  (0001:03:00.0:region1+0xc0, 0x4140c, 4)
vfio_region_write  (0001:03:00.0:region1+0xc4, 0xa0000, 4)
qemu_mutex_unlock unlocked mutex 0x10905ad8

goes like this:

qemu_mutex_lock locked mutex 0x10905ad8
vfio_region_write  (0001:03:00.0:region1+0xc0, 0xbfd0008, 8)
qemu_mutex_unlock unlocked mutex 0x10905ad8

Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
7 years agovfio: Set MemoryRegionOps:max_access_size and min_access_size
Jose Ricardo Ziviani [Wed, 3 May 2017 20:52:34 +0000 (14:52 -0600)]
vfio: Set MemoryRegionOps:max_access_size and min_access_size

Sets valid.max_access_size and valid.min_access_size to ensure safe
8-byte accesses to vfio. Today, 8-byte accesses are broken into pairs
of 4-byte calls that goes unprotected:

qemu_mutex_lock locked mutex 0x10905ad8
  vfio_region_write  (0001:03:00.0:region1+0xc0, 0x2020c, 4)
qemu_mutex_unlock unlocked mutex 0x10905ad8
qemu_mutex_lock locked mutex 0x10905ad8
  vfio_region_write  (0001:03:00.0:region1+0xc4, 0xa0000, 4)
qemu_mutex_unlock unlocked mutex 0x10905ad8

which occasionally leads to:

qemu_mutex_lock locked mutex 0x10905ad8
  vfio_region_write  (0001:03:00.0:region1+0xc0, 0x2030c, 4)
qemu_mutex_unlock unlocked mutex 0x10905ad8
qemu_mutex_lock locked mutex 0x10905ad8
  vfio_region_write  (0001:03:00.0:region1+0xc0, 0x1000c, 4)
qemu_mutex_unlock unlocked mutex 0x10905ad8
qemu_mutex_lock locked mutex 0x10905ad8
  vfio_region_write  (0001:03:00.0:region1+0xc4, 0xb0000, 4)
qemu_mutex_unlock unlocked mutex 0x10905ad8
qemu_mutex_lock locked mutex 0x10905ad8
  vfio_region_write  (0001:03:00.0:region1+0xc4, 0xa0000, 4)
qemu_mutex_unlock unlocked mutex 0x10905ad8

causing strange errors in guest OS. With this patch, such accesses
are protected by the same lock guard:

qemu_mutex_lock locked mutex 0x10905ad8
vfio_region_write  (0001:03:00.0:region1+0xc0, 0x2000c, 4)
vfio_region_write  (0001:03:00.0:region1+0xc4, 0xb0000, 4)
qemu_mutex_unlock unlocked mutex 0x10905ad8

This happens because the 8-byte write should be broken into 4-byte
writes by memory.c:access_with_adjusted_size() in order to be under
the same lock. Today, it's done in exec.c:address_space_write_continue()
which was able to handle only 4 bytes due to a zero'ed
valid.max_access_size (see exec.c:memory_access_size()).

Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
7 years agoinput: Add trace event for empty keyboard queue
Alexander Graf [Thu, 30 Mar 2017 14:22:55 +0000 (16:22 +0200)]
input: Add trace event for empty keyboard queue

When driving QEMU from the outside, we have basically no chance to
determine how quickly the guest OS picks up key events, so we usually
have to limit ourselves to very slow keyboard presses to make sure
the guest always has enough chance to pick them up.

This patch adds a trace events when the keyboarde queue is drained.
An external driver can use that as hint that new keys can be pressed.

Signed-off-by: Alexander Graf <agraf@suse.de>
Message-id: 1490883775-94658-1-git-send-email-agraf@suse.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoinput: don't queue delay if paused
Marc-André Lureau [Tue, 25 Apr 2017 13:05:20 +0000 (17:05 +0400)]
input: don't queue delay if paused

qemu_input_event_send() discards key event when the guest is paused,
but not the delay.

The delay ends up in the input queue, and qemu_input_event_send_key()
will further fill the queue with upcoming events.

VNC uses qemu_input_event_send_key_delay(), not SPICE, which results
in a different input behaviour on pause: VNC will queue the events
(except the first that is discarded), SPICE will discard all events.

Don't queue delay if paused, and provide same behaviour on SPICE and
VNC clients on resume (and potentially avoid over-allocating the
buffer queue)

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=1444326

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20170425130520.31819-1-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
7 years agoinput: limit kbd queue depth
Gerd Hoffmann [Fri, 28 Apr 2017 08:42:37 +0000 (10:42 +0200)]
input: limit kbd queue depth

Apply a limit to the number of items we accept into the keyboard queue.

Impact: Without this limit vnc clients can exhaust host memory by
sending keyboard events faster than qemu feeds them to the guest.

Fixes: CVE-2017-8379
Cc: P J P <ppandit@redhat.com>
Cc: Huawei PSIRT <PSIRT@huawei.com>
Reported-by: jiangxin1@huawei.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20170428084237.23960-1-kraxel@redhat.com

7 years agoMerge remote-tracking branch 'sthibault/tags/samuel-thibault' into staging
Stefan Hajnoczi [Tue, 2 May 2017 14:16:20 +0000 (15:16 +0100)]
Merge remote-tracking branch 'sthibault/tags/samuel-thibault' into staging

slirp updates

# gpg: Signature made Sat 29 Apr 2017 05:45:24 PM BST
# gpg:                using RSA key 0xB0A51BF58C9179C5
# gpg: Good signature from "Samuel Thibault <samuel.thibault@aquilenet.fr>"
# gpg:                 aka "Samuel Thibault <sthibault@debian.org>"
# gpg:                 aka "Samuel Thibault <samuel.thibault@gnu.org>"
# gpg:                 aka "Samuel Thibault <samuel.thibault@inria.fr>"
# gpg:                 aka "Samuel Thibault <samuel.thibault@labri.fr>"
# gpg:                 aka "Samuel Thibault <samuel.thibault@ens-lyon.org>"
# gpg:                 aka "Samuel Thibault <samuel.thibault@u-bordeaux.fr>"
# Primary key fingerprint: 900C B024 B679 31D4 0F82  304B D017 8C76 7D06 9EE6
#      Subkey fingerprint: AEBF 7448 FAB9 453A 4552  390E B0A5 1BF5 8C91 79C5

* sthibault/tags/samuel-thibault:
  slirp: VMStatify remaining except for loop
  slirp: VMStatify socket level
  slirp: Common lhost/fhost union
  slirp: VMStatify sbuf
  slirp: VMState conversion; tcpcb
  slirp: fix pinging the virtual ipv4 DNS server
  slirp: tftp, copy sockaddr_size
  slirp/smb: Replace constant strings by glib string
  slirp: allow host port 0 for hostfwd

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7 years agohw/s390x/ipl: Fix crash with virtio-scsi-pci device
Thomas Huth [Tue, 25 Apr 2017 13:18:47 +0000 (15:18 +0200)]
hw/s390x/ipl: Fix crash with virtio-scsi-pci device

qemu-system-s390x currently crashes when it is started with a
virtio-scsi-pci device, e.g.:

 qemu-system-s390x -nographic -enable-kvm -device virtio-scsi-pci \
                   -drive file=/tmp/disk.dat,if=none,id=d1,format=raw \
                   -device scsi-cd,drive=d1,bootindex=1

The problem is that the code in s390_gen_initial_iplb() currently assumes
that all SCSI devices are also CCW devices, which is not the case for
virtio-scsi-pci of course. Fix it by adding an appropriate check for
TYPE_CCW_DEVICE here.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-Id: <1493126327-13162-1-git-send-email-thuth@redhat.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agopc-bios/s390-ccw.img: update image
Cornelia Huck [Mon, 24 Apr 2017 13:34:22 +0000 (15:34 +0200)]
pc-bios/s390-ccw.img: update image

Contains the following commits:

- pc-bios/s390-ccw: Make ebcdic/ascii conversion public
- pc-bios/s390-ccw: get LOADPARM stored in SCP Read Info
- pc-bios/s390-ccw: provide a function to interpret LOADPARM value
- pc-bios/s390-ccw: provide entry selection on LOADPARM for SCSI disk
- pc-bios/s390-ccw: add boot entry selection for ECKD DASD
- pc-bios/s390-ccw: add boot entry selection to El Torito routine

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agopc-bios/s390-ccw: add boot entry selection to El Torito routine
Eugene (jno) Dvurechenski [Mon, 18 Apr 2016 11:45:36 +0000 (13:45 +0200)]
pc-bios/s390-ccw: add boot entry selection to El Torito routine

If there is no LOADPARM given or '0' specified, then IPL the first
matched entry. Otherwise IPL the matching entry of that number.

Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agopc-bios/s390-ccw: add boot entry selection for ECKD DASD
Farhan Ali [Mon, 18 Apr 2016 11:45:32 +0000 (13:45 +0200)]
pc-bios/s390-ccw: add boot entry selection for ECKD DASD

1. change a bit definition of ScsiMbr to allow an array of pointers
2. add loadparm fetch to boot script processing
3. apply loadparm index to boot entry selection, if any

Initial patch from Eugene (jno) Dvurechenski.

Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agopc-bios/s390-ccw: provide entry selection on LOADPARM for SCSI disk
Farhan Ali [Mon, 18 Apr 2016 11:45:31 +0000 (13:45 +0200)]
pc-bios/s390-ccw: provide entry selection on LOADPARM for SCSI disk

Fix SCSI bootmap interpreter to make use of any specified entry of the
Program Table using the leftmost numeric value from the LOADPARM, if specified.

Initial patch from Eugene (jno) Dvurechenski.

Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agopc-bios/s390-ccw: provide a function to interpret LOADPARM value
Farhan Ali [Mon, 16 Jan 2017 15:45:49 +0000 (10:45 -0500)]
pc-bios/s390-ccw: provide a function to interpret LOADPARM value

The LOADPARM value is fetched from SCP Read Info, but it's applied
only at the phase of bootmap interpretation. So let's read the LOARPARM
value and store it. Also provide a parsing function to detect numbers in
the LOADPARM which can be used during bootmap interpretation.

Remove a stray whitespace.

Initial patch from Eugene (jno) Dvurechenski.

Signed-off-by: Eugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
7 years agopc-bios/s390-ccw: get LOADPARM stored in SCP Read Info
Farhan Ali [Wed, 30 Nov 2016 19:22:07 +0000 (14:22 -0500)]
pc-bios/s390-ccw: get LOADPARM stored in SCP Read Info

Obtain the loadparm value stored in SCP Read Info by performing
a SCLP Read Info request.

Rename sclp-ascii.c to sclp.c to reflect the changed scope of
the file.

Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>