Commit graph

33333 commits

Author SHA1 Message Date
Sean Bruno 605474815d bsd-user: Implement strace support for __acl_* syscalls
Signed-off-by: Sean Bruno <sbruno@freebsd.org>
Message-id: 1402246651-71099-7-git-send-email-sbruno@freebsd.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-11 00:25:06 +01:00
Sean Bruno b85159a3a3 bsd-user: Implement strace support for print_ioctl syscall
Signed-off-by: Sean Bruno <sbruno@freebsd.org>
Message-id: 1402246651-71099-5-git-send-email-sbruno@freebsd.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-11 00:25:06 +01:00
Sean Bruno 80b346040d bsd-user: Implement strace support for print_sysctl syscall
Signed-off-by: Sean Bruno <sbruno@freebsd.org>
Message-id: 1402246651-71099-4-git-send-email-sbruno@freebsd.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-11 00:25:06 +01:00
Sean Bruno 88dae46d18 bsd-user: GPL v2 attribution update and style
Signed-off-by: Sean Bruno <sbruno@freebsd.org>
Message-id: 1402246651-71099-3-git-send-email-sbruno@freebsd.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-11 00:25:06 +01:00
Stacey Son adfc3e91e2 bsd-user: add HOST_VARIANT_DIR for various *BSD dependent code
This change adds HOST_VARIANT_DIR so the various BSD OS dependent
code can be separated into its own directories rather than
using #ifdef's.

This may also allow an BSD variant OS to host another BSD variant's
executable as a target.

Signed-off-by: Sean Bruno <sbruno@freebsd.org>
Message-id: 1402246651-71099-2-git-send-email-sbruno@freebsd.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-11 00:25:06 +01:00
Natanael Copa 7224f66ec3 exec: replace ffsl with ctzl
See commit fbeadf50 (bitops: unify bitops_ffsl with the one in
host-utils.h, call it bitops_ctzl) on why ctzl should be used instead
of ffsl.

This is also needed for musl libc which does not implement ffsl.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-11 00:25:06 +01:00
Natanael Copa 747eb78baa vhost: replace ffsl with ctzl
Avoid using the GNU extesion ffsl which is not implemented in musl libc.

The atomic_xchg() means we know that vhost_log_chunk_t will never be
larger than the 'long' type, so ctzl() is always sufficient.

See also commit fbeadf50 (bitops: unify bitops_ffsl with the one in
host-utils.h, call it bitops_ctzl) on why ctzl should be used instead
of ffsl.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-11 00:25:06 +01:00
Natanael Copa adf9d70b0d xen: replace ffsl with ctzl
ffsl is a GNU extension and not available in musl libc.

See also commit fbeadf50 (bitops: unify bitops_ffsl with the one in
host-utils.h, call it bitops_ctzl) on why ctzl should be used instead
of ffsl.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
[PMM: rebased to accommodate file rename to xen-hvm.c]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-11 00:25:06 +01:00
Natanael Copa 6ad3f09bd4 util/qemu-openpty: fix build with musl libc by include termios.h as fallback
Include termios.h as POSIX fallback when not glibc, bsd or solaris.
POSIX says that termios.h should define struct termios and TCAFLUSH.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/termios.h.html

This fixes the following compile errors with musl libc:

util/qemu-openpty.c: In function 'qemu_openpty_raw':
util/qemu-openpty.c:112:20: error: storage size of 'tty' isn't known
     struct termios tty;
                    ^
...
util/qemu-openpty.c:128:24: error: 'TCSAFLUSH' undeclared (first use in this function)
     tcsetattr(*aslave, TCSAFLUSH, &tty);
                        ^

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-11 00:25:06 +01:00
Peter Maydell b7b5233ad7 bsd-user/mmap.c: Don't try to override g_malloc/g_free
Trying to override the implementations of g_malloc and g_free is
a really bad idea -- it means statically linked builds fail to
link (because of the multiple definitions provided by this file
and by glib), and non-statically linked builds segfault as soon
as they try to do anything more complicated than printing the
usage message. Remove these overridden versions and just use
the glib ones.

This is sufficient that bsd-user can run basic x86-64
binaries on OpenBSD again; FreeBSD and NetBSD seem to have
further issues.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Sean Bruno <sbruno@freebsd.org>
Reviewed-by: Ed Maste <emaste@freebsd.org>
2014-06-11 00:25:06 +01:00
Peter Maydell 591b320ad0 util/hbitmap.c: Use ctpopl rather than reimplementing a local equivalent
The function popcountl() in hbitmap.c is effectively a reimplementation
of what host-utils.h provides as ctpopl(). Use ctpopl() directly; this fixes
a failure to compile on NetBSD (whose strings.h erroneously exposes a
system popcountl() which clashes with this one).

Reported-by: Martin Husemann <martin@duskware.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-11 00:25:06 +01:00
Stacey Son 6b24119b7f bsd-user: refresh freebsd system call numbers
Update FreeBSD system call numbers in freebsd/syscall_nr.h.


Signed-off-by: Stacey Son <sson@FreeBSD.org>
Reviewed-by: Ed Maste <emaste@freebsd.org>
Signed-off-by: Sean Bruno <sbruno@freebsd.org>
Message-id: 1401220104-7147-2-git-send-email-sbruno@freebsd.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-11 00:25:06 +01:00
Peter Maydell b780bf8eff trivial patches for 2014-06-10
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQEcBAABAgAGBQJTly03AAoJEL7lnXSkw9fbFqUH/jokkFQDO9XJ7+SuU/DC1GMH
 JtJZIyLjwu3LmvlsGlCjHcBD/vCF2HLdYWxo+wdiY2kxJdoY3VDhiCpVA4m+U+Lb
 R7L2NV/YsCnTPsDrlm2G8TydowkqUJWzOUrISjM1o+xryL3KG6/QR7+2tksdWJ5J
 T6zD8MX3QsM1j6u5+JdrkAwDSf8oegHS56KSA5vZrRth2/rg++LXMm1J932HLnwa
 Nkb8ymmkUGtErj2x0qBcv6wNQ53u7tpX3RjOWI7t9ripXICH+3a5ZMFiaM2E37Ws
 hJDfGoDZ/N19d+cxLJBxvUrfZKwCdWvvDYHx3XyXIW3HkB6UKaG7DwMENWDoGck=
 =7cOf
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-06-10' into staging

trivial patches for 2014-06-10

# gpg: Signature made Tue 10 Jun 2014 17:07:19 BST using RSA key ID A4C3D7DB
# gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
# gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
# gpg:                 aka "Michael Tokarev <mjt@debian.org>"
# 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: 6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
#      Subkey fingerprint: 6F67 E18E 7C91 C5B1 5514  66A7 BEE5 9D74 A4C3 D7DB

* remotes/mjt/tags/trivial-patches-2014-06-10: (25 commits)
  virtio.c: fix error message
  hw: vmware_vga: don't return cursorx when the driver asks for cursory register
  migration: Plug memory leak in migrate-set-cache-size command
  libcacard: Clean up dead stores before g_free()
  libcacard: Drop superfluous conditionals around g_free()
  cpu/x86: correctly set errors in x86_cpu_parse_featurestr
  smbios: use g_free directly on NULL pointers
  vdi: remove double conversion
  apb: Fix compiler warnings (large constants)
  hw/net/ne2000-isa: Register vmstate struct
  target-microblaze: Delete unused sign_extend() function
  hw/misc/milkymist-softusb: Remove unused softusb_{read, write}_pmem()
  target-i386/translate.c: Remove unused tcg_gen_lshift()
  hw/isa/pc87312: Remove unused function is_parallel_epp()
  hw/intc/openpic: Remove unused function IRQ_testbit()
  hw/dma/xilinx_axidma: Remove unused stream_halted() function
  util/qemu-sockets.c: Avoid unused variable warnings
  hw/sd/sd.c: Drop unused sd_acmd_type[] array
  hw/i386/pc.c: Remove unused parallel_io and parallel_irq variables
  slirp: Remove unused zero_ethaddr[] variable
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-10 17:16:03 +01:00
Michael Tokarev 1a2858995d virtio.c: fix error message
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 20:07:01 +04:00
Nicolas Owens e2bb4ae746 hw: vmware_vga: don't return cursorx when the driver asks for cursory register
hello qemu-*@nongnu.org, this is my first contribution. apologies if
something is incorrect.

this patch fixes vmware_vga.c so that it actually returns the cursory
register when asked for, instead of cursorx.

Signed-off-by: Nicolas Owens <mischief@offblast.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 20:06:48 +04:00
Chen Gang 4380be0e99 migration: Plug memory leak in migrate-set-cache-size command
We call g_free() after cache_fini() in migration_end(), but we don't
call it after cache_fini() in xbzrle_cache_resize(), leaking the
memory.

cache_init() and cache_fini() are a pair.  Since cache_init()
allocates the cache, let cache_fini() free it.  This plugs the leak.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:54:43 +04:00
Markus Armbruster fec0da9cbf libcacard: Clean up dead stores before g_free()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Markus Armbruster ec15993d9d libcacard: Drop superfluous conditionals around g_free()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Paolo Bonzini 6b1dd54b6a cpu/x86: correctly set errors in x86_cpu_parse_featurestr
Because of the "goto out", the contents of local_err are leaked
and lost.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Paolo Bonzini a10678b08e smbios: use g_free directly on NULL pointers
No need to wrap it with an if.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Paolo Bonzini 6998b6c11b vdi: remove double conversion
This should be a problem when running on big-endian machines.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Stefan Weil d1180c1e57 apb: Fix compiler warnings (large constants)
Both constants need more than 32 bit.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Maydell 89218c218f hw/net/ne2000-isa: Register vmstate struct
The ne2000-isa device defines a VMState struct for migration, but
we forgot to actually register it. Correct this deficiency by
setting dc->vmsd.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Maydell fc4bde9025 target-microblaze: Delete unused sign_extend() function
The sign_extend() function is unused; delete it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Maydell 029ad4bcf3 hw/misc/milkymist-softusb: Remove unused softusb_{read, write}_pmem()
The functions softusb_read_pmem() and softusb_write_pmem() are unused;
remove them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Maydell e3a17ef6cc target-i386/translate.c: Remove unused tcg_gen_lshift()
The function tcg_gen_lshift() is unused; remove it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Maydell f46b9cc71c hw/isa/pc87312: Remove unused function is_parallel_epp()
The function is_parallel_epp() is unused; remove it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Maydell c1d7572793 hw/intc/openpic: Remove unused function IRQ_testbit()
The IRQ_testbit() function is never used; remove it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Maydell a1fa7992a9 hw/dma/xilinx_axidma: Remove unused stream_halted() function
The stream_halted() function is never used; remove it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Maydell f9b5426fd5 util/qemu-sockets.c: Avoid unused variable warnings
The 'on' variable is never used, and 'off' is only used
if IPV6_V6ONLY is defined; delete 'on' and move 'off' to
the point where it is used. This avoids warnings from
clang 3.4.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Maydell 7179585688 hw/sd/sd.c: Drop unused sd_acmd_type[] array
Drop the sd_acmd_type[] array: it is never used. (The equivalent
sd_cmd_type[] array for normal commands is used to identify
those commands whose argument includes the card address in the
top 16 bits; but for app commands the card address is passed
with the APP_CMD prefix, not with the argument to the app command
itself.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Maydell 831f4d27b6 hw/i386/pc.c: Remove unused parallel_io and parallel_irq variables
The variables parallel_io and parallel_irq are unused; delete them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Maydell 49bba868df slirp: Remove unused zero_ethaddr[] variable
The zero_ethaddr[] array is never used; delete it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Sergey Fedorov 2a802aaf63 qtest: fix hex2nib for capital characters
Signed-off-by: Sergey Fedorov <serge.fdrv@gmail.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Crosthwaite ef18c2f54e net: cadence_gem: Remove &desc[0] usages
Just use desc instead.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Crosthwaite 3048ed6aac net: cadence_gem: Comment spelling sweep
Fix some typos in comments.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Crosthwaite fa15286a75 net: cadence_gem: Add Tx descriptor fetch printf
Add a debug printf for TX descriptor fetching. This is helpful to anyone
needing to debug TX ring buffer traversal. It is also now consistent with
the RX code which has a similar printf.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Crosthwaite 6ab57a6b80 net: cadence_gem: Fix Tx descriptor update
The local variable "desc" was being used to read-modify-write the
first descriptor (of a multi-desc packet) upon packet completion.
desc however continues to be used by the code as the current
descriptor. Give this first desc RMW it's own local variable to
avoid trampling.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-06-10 19:39:34 +04:00
Peter Maydell 3334e929ae console: two little bugfixes.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTluVzAAoJEEy22O7T6HE4MeoP/iZaSBWUpSfku0opAEmJAEso
 fiO+yFEwMNWCGhUVwQTOo5p7JqmOzGoBKNjy4WFtMY3tA1FZGPnh5WH/0pVUQu5C
 X3n4X4wI4xcY9jSPGtan9T5MlZZ92Zmi6NuSxdVxMTtn+DI9GGki8Jo23Fveezo5
 gAhkApy2T8eYK3jdXgzQHawMLw+V2/E/FU5Xxd6+v1EzQooLgODc3QkB25+OFl6n
 5TBo8Rmyfyi70mi2PDX++S3zGr5aRfDLKcfRX+3ZM2NRBGmRJkhinBuaaHrT/d4Q
 dWlKe3da89SbfEbFgd4jeaXXJBVQPXJXT1uj+S4W1DMDwTFCwBj8y+WTHhJD85iF
 N1YyvuI9TEzfvSf3Pq91KXyZ/RGfCfE/4VsNd/dohB8mXmIEZCJVIrBwnOKeyCSa
 viaalNDIRTrwiBvegxAQ95Zweh1KWcOa9qa8UwwG3jzp79iEBzxb+MXWV2QVnyuY
 AK3jWP8Jfyfh8xeG/MW3Wy753IACTREckDe4UGb/bSk8upoiWoH4ZAfqRF8PlLTt
 +YFhGudTxnLsXTvu5SYmGNcIDIQ1fMBT9d+Tm+Qxy4w9m9dqpJT7UvIxiPP//dUW
 1RDM4HjNNutY5JYGbxvgblXTkQeiLOCtw/VFjXVjGV87Ev89Dw6Xa0doX4PEw5I0
 cPaJXKWj7hMws/xgXZTG
 =MgVB
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-console-20140610-1' into staging

console: two little bugfixes.

# gpg: Signature made Tue 10 Jun 2014 12:01:07 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-console-20140610-1:
  console: fix -vga none -sdl crash
  console: kill MAX_CONSOLES, alloc consoles dynamically

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-10 12:06:17 +01:00
Gerd Hoffmann 333cb18ff4 console: fix -vga none -sdl crash
Call get_alloc_displaystate() for proper initialization
instead of allocating with g_new().

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-10 12:36:36 +02:00
Gerd Hoffmann a1d2db08d8 console: kill MAX_CONSOLES, alloc consoles dynamically
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2014-06-10 12:36:36 +02:00
Peter Maydell 7b0140e49b Several patches for s390:
- bugfixes: A fix for a long-standing bug in the css code as well as
   a fixup for the recent I/O adapter support.
 - Exploitation of the userspace cmma enablement/reset interface, if
   it is present.
 - Some debuggability improvements by logging unmanageable conditions.
 - virtio-ccw finally gets migration support for its structures.
 - Some cleanup as to how floating interrupts are injected.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJTlrqEAAoJEN7Pa5PG8C+v+C0P/iuCl+hMUosrTSry7Gww75S3
 pdjr0Bs2b6Wsql8EOwaR4yj3DfNWoXOw9AYoESz7R2fn82TbONq+NHz+c/cUxCqB
 B5aTSc/sSn6in4xSxSWuOMyQDu7yosRBPRqhgtxvWm0OEbWFBfC1A08C3tQY8EZm
 Sis1JEYVKBQcI1jzT+JVuKEUWZK5aqidcTzN1LeDUHVL6tEEkmboEG1ZsxNsaYW5
 YOhLXjH5N0of7Rqk+U2r5S9/ZC5SqxjipvEblc9eLKY1AmkP7kboL6R7kXYWmlND
 QBq8pCCCr9kh5g6gTDylgBQhR2KAtyN+H9tueVBBY/hMBJOk4ZexLxrtp0QiItdg
 eCeee/6sIJp2GtarwoPzZJnm0CbPmIWDmoOobmAfp/q6MA34sjlKD+VETuQk0iUp
 7nHgecbNIuWN1Tm2hGJvVo8DtGyr9jEW0xURMTfb1sRyXzH/2eL93i7/VpHcIsMM
 fwmI48vWSFrMDKGSBli/dgQe6TQkYfeM0z6pDWKfIKeaLWx+XZ2vgP4txfuSajVT
 A09bXo83jnNZ9UhkyQtXAyNqHAx6De/blbrQw9nvMp+n9NFpQFxUSfHsNBDcVHso
 lwfBT7RXatfgp5NpQp8rCNn6LLI2jbCLyxJoeosx+cgnKSQFCC76ijuFkNPPMUZk
 DVakR1WqCEg9VFPQy8ug
 =c2hc
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20140610' into staging

Several patches for s390:

- bugfixes: A fix for a long-standing bug in the css code as well as
  a fixup for the recent I/O adapter support.
- Exploitation of the userspace cmma enablement/reset interface, if
  it is present.
- Some debuggability improvements by logging unmanageable conditions.
- virtio-ccw finally gets migration support for its structures.
- Some cleanup as to how floating interrupts are injected.

# gpg: Signature made Tue 10 Jun 2014 08:57:56 BST using RSA key ID C6F02FAF
# gpg: Can't check signature: public key not found

* remotes/cohuck/tags/s390x-20140610:
  s390x/kvm: inject via flic
  s390x: cleanup interrupt injection
  s390x/kvm: add alternative injection interface
  s390x: consolidate floating interrupts
  s390/virtio-ccw: migration support
  s390x/kvm: Log unmanageable program interruptions
  s390x/kvm: Log unmanageable external interruptions
  s390x/kvm: enable/reset cmma via vm attributes
  s390x/kvm: make flic play well with old kernels
  s390x/css: handle emw correctly for tsch

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-06-10 10:59:26 +01:00
Cornelia Huck bbd8bb8e32 s390x/kvm: inject via flic
Try to inject floating interrupts via the flic if it is available.
This allows us to inject the full range of floating interrupts.

Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-10 09:50:27 +02:00
Cornelia Huck de13d21614 s390x: cleanup interrupt injection
Remove the need for a cpu to inject a floating interrupt on kvm.

Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-10 09:50:27 +02:00
Cornelia Huck 66ad0893f0 s390x/kvm: add alternative injection interface
Add kvm_s390_{vcpu,floating}_interrupt, which offer the possibility
to inject interrupts with larger payloads (when a kvm backend becomes
available).

Moreover, kvm_s390_floating_interrupt() does no longer have the bogus
requirement for a vcpu.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-10 09:50:27 +02:00
Cornelia Huck 79afc36d91 s390x: consolidate floating interrupts
Move the injection code for all floating interrupts to interrupt.c
and add a comment.

Also get rid of the #ifdef CONFIG_KVM for the service interrupt.

Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-10 09:50:27 +02:00
Jens Freimann bcb2b582f3 s390/virtio-ccw: migration support
This patch adds live migration support for virtio-ccw devices.
It's not done with vmstate because virtio itself is not yet ported
to vmstate either.

Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-10 09:50:27 +02:00
Thomas Huth 6449a41a4d s390x/kvm: Log unmanageable program interruptions
The kernel only drops to userspace if an endless program interrupt loop
has been detected. Let's print an error message in this case to inform
the user about the crash and stop the affected CPU with a panic event,
just like it is already done for the external interruption loop detection.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-10 09:50:27 +02:00
Thomas Huth a2689242b1 s390x/kvm: Log unmanageable external interruptions
Interception code 0x14 only drops to userspace when an unmanageable
external interruption interception occured (e.g. if the External New
PSW does not disable external interruptions). Instead of bailing out
via the default handler, it is better to inform the user with a
proper error message that also includes the bad PSW, and to stop
the affected CPU with a panic event instead.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-10 09:50:27 +02:00
Dominik Dingel 4cb88c3c37 s390x/kvm: enable/reset cmma via vm attributes
Exploit the new api for userspace-controlled cmma. If supported, enable
cmma during kvm initialization and register a reset handler for cmma,
which is also called directly from the load IPL code.

The reset functionality is needed to reset the cmma state of the guest
pages, e.g. if a system reset is triggered via qemu monitor; otherwise
this could result in data corruption.

A guest triggered reboot may now lead to multiple cmma resets; this is
OK, however, as this is slowpath anyway and the simplest way to achieve
the intended effects.

Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2014-06-10 09:50:27 +02:00