Commit Graph

37449 Commits

Author SHA1 Message Date
zhanghailiang 6adfdc5a6a virtio-balloon: Add some trace events
Add some trace events for easier debugging

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2015-03-04 13:00:04 -05:00
zhanghailiang 463756d031 virtio-balloon: Fix balloon not working correctly when hotplug memory
When do memory balloon, it takes the 'ram_size' as the VM's current ram size,
But 'ram_size' is the startup configured ram size, it does not take into
account the hotplugged memory.

As a result, the balloon result will be confused.
Steps to reproduce:
(1)Start VM: qemu -m size=1024,slots=4,maxmem=8G
(2)In VM: #free -m : 1024M
(3)qmp balloon 512M
(4)In VM: #free -m : 512M
(5)hotplug pc-dimm 1G
(6)In VM: #free -m : 1512M
(7)qmp balloon 256M
(8)In VM: #free -m :1256M
We expect the VM's available ram size to be 256M after 'qmp balloon 256M'
command, but VM's real available ram size is 1256M.

For "qmp balloon" is not performance critical code, we use function
'get_current_ram_size' to get VM's current ram size.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2015-03-04 13:00:04 -05:00
zhanghailiang 87a45cfee6 pc-dimm: add a function to calculate VM's current RAM size
The global parameter 'ram_size' does not take into account
the hotplugged memory.

In some codes, we use 'ram_size' as current VM's real RAM size,
which is not correct.

Add function 'get_current_ram_size' to calculate VM's current RAM size,
it will enumerate present memory devices and also plus ram_size.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2015-03-04 13:00:04 -05:00
Peter Maydell 3539bbb93e Updates for QEMU 2.3-rc0:
- Error reporting and static cleanup (Alexey Kardashevskiy)
  - Runtime mmap disable for tracing (Samuel Pitoiset)
  - Support for host directed device request (Alex Williamson)
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJU9K8qAAoJECObm247sIsiiEEP/icPd/4UGOUwKGS0BgLS+dCH
 YhCxul/el8rQ7620Zndi7VIBml8GvUPssV3hGA0flyuWXD4eWyObMa6ovuDout1d
 lo/0Qcz/3Z5CYXVcNnB1vUXN9JLhPsRxZKwMTfX/cZn4X2gTP6hydin1tUJ0rtJe
 SvlGegE0/NeUpQQsS7gHqePBPqpB+XypOPvcnXtk3gpNfFo6suZVxzzrUImeSIcv
 KMpNLr6hKl/Nv0lRAEt59LhoCc6FFhmXhgQEpoebIyMPl26o9T9irX6uB/TYfn+m
 YvV0IFzYtIrPivnvP2NDPYJ3fvSViGCRNB2eGZYOFTrHeCKxFSGQopjeUnI7qzHX
 JyytAKS4S7XnXJvWBoO7IEDwcsaxfb4nUtl62kaoruBZsROd7qQdhpyCz5ckTsJh
 wMwch5uA3VibWe5QAUV0b4hJIwz4ttD1kJKOT7IaHfM7/sd4TjlSJaVGAToBwSTW
 53G24P5SN6n/WRFnocGMi8AkXNzP2/hDaJIvwlOWfdjFWhuJJce+CwPA99oPznPI
 FlwIofmDeKaFEb6xakUEAf+NvzpiSpYurAuqqUxdQE/BmEq7vS3TQac7tDT36aqa
 KFPNAvPXUZLe3YK/YcsIy6cX6bzGEbJAmgwyDkcWQA/wcgZWoUMSpMwYiBM25PYv
 NotvWxD+zA2q1NAehrS9
 =RsA3
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150302.0' into staging

Updates for QEMU 2.3-rc0:
 - Error reporting and static cleanup (Alexey Kardashevskiy)
 - Runtime mmap disable for tracing (Samuel Pitoiset)
 - Support for host directed device request (Alex Williamson)

# gpg: Signature made Mon Mar  2 18:42:50 2015 GMT using RSA key ID 3BB08B22
# 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>"

* remotes/awilliam/tags/vfio-update-20150302.0:
  vfio-pci: Enable device request notification support
  vfio: allow to disable MMAP per device with -x-mmap=off option
  vfio: Make type1 listener symbols static
  vfio: Add ioctl number to error report

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-04 14:37:31 +00:00
Paolo Bonzini 576a94d8bc vl: take iothread lock very early
If the iothread lock isn't taken by the main thread, the RCU callbacks
might run concurrently with the main thread.  QEMU's not ready for that.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Tested-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-03 13:21:53 +00:00
Peter Maydell 3180aadb1f - more config options
- bootdevice, iscsi, virtio-scsi fixes
 - build system patches for MinGW and config-devices.mak
 - qemu_mutex_lock_iothread deadlock fixes
 - another tiny patch from the record/replay series
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQEcBAABAgAGBQJU9DRyAAoJEL/70l94x66D5ZkH/2SPp4rrLIgotyzHTIaMvi+2
 0gB7Bks9cDisFyiSgr6dqLp9CV1XMlv/NZl+z+H/7og96qhBWjAKVpG1J/En55bS
 vanFeWGYjINuQLnhC3pqBi2kmEkzBQSIMJZt9WnDydfQj/6Wgcr6iabOpd8eTjTz
 rqE/UcV2L1baFPLy/Wky2vg/a5Ug2rj+fqvjRdFB/Zx8yDYLcKYJlI8utSQexamE
 tUcxr/AqxNOoe6WZD7CCVNmHMHvajoOhWnVY4EgHDg8L3nNSgvDF3AjYfntU6A2y
 HjkS0ktvQK666oNo+ORRBzLe3s9nCfB1dMK2ZiKKyFfyuYD50d2N3oHKSAIsEJo=
 =AQjO
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

- more config options
- bootdevice, iscsi, virtio-scsi fixes
- build system patches for MinGW and config-devices.mak
- qemu_mutex_lock_iothread deadlock fixes
- another tiny patch from the record/replay series

# gpg: Signature made Mon Mar  2 09:59:14 2015 GMT using RSA key ID 78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.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: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream:
  cpus: be more paranoid in avoiding deadlocks
  cpus: fix deadlock and segfault in qemu_mutex_lock_iothread
  virtio-scsi: Allocate op blocker reason before blocking
  Makefile.target: binary depends on config-devices
  Makefile: don't silence mak file test with V=1
  Makefile: fix up parallel building under MSYS+MinGW
  iscsi: Handle write protected case in reopen
  Give ivshmem its own config option
  Create specific config option for "platform-bus"
  Add specific config options for PCI-E bridges
  bootdevice: fix segment fault when booting guest with '-kernel' and '-initrd'
  timer: replace time() with QEMU_CLOCK_HOST
  virtio-scsi-dataplane: Call blk_set_aio_context within BQL
  block: Forbid bdrv_set_aio_context outside BQL
  scsi: give device a parent before setting properties

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-03 12:07:47 +00:00
Peter Maydell 5efde22aa7 QemuOpts: Convert various setters to Error
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJU7yYbAAoJEDhwtADrkYZTjHwP/RPQk8i+cehRVwvxgUFjNwRC
 BIEt0WxKLBqKKOdnzsB3xZAg3LZ2LyL4bnUXnOtd1Qlh1HNdMhn+Dwp7eEMOsjGG
 z8Kheaq8Bcf7eZXQ8KrHG2ZMWk/mXdMJ/hpUVzyOydoHreJYdmBesnZwdxSkNSCm
 x2iTWfTkUP/28CoqW5JuXMNOHT3spnmGyCpeL64PbEXWilHu2NajH4xAnn8VAliC
 jeIjkOBt9E+H9JZ1yuRp9KhzjczC2AXK2rCKaFKXzNXlDpJvPubUP+GA5N6t9u6T
 QpmDRsai1xUGzwJ656DhpGHRnrWO4euCnck1IvMmLtMi94IdRV0P13kER0CIWz1T
 K21m6R0gnW8Ko+svnmyYLAuEonLJ2JJBxHj4F5lw+EsEuIEKcDWZRYukclx6cF+1
 rQMyxGyMeIV9sKxCfs+6fSe8fPhUo9rklCQwNcRZdzKlF2vw9qzqy0lowosrlTQm
 dkJWJ0CMpIWP2j9alLTH1lJNHr7ADRnnBjlzYJJB0Rezgi4DvE9qUlCYwCNwWswN
 4HQ6sYJxfUGbBKvifFPGIoqrUoYyoYTYnJ/R9EuRg7xVtZ0Zuzbl9Ax1qtssoUbm
 6QH/5kCWy9v9WUt43WwY3yJiK3dupS35roswec2bNpCnF2QMkFOPz+VjmOAx276o
 BJFeJwcRskSpx3+ZWlHT
 =0lJo
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2015-02-26' into staging

QemuOpts: Convert various setters to Error

# gpg: Signature made Thu Feb 26 13:56:43 2015 GMT using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"

* remotes/armbru/tags/pull-error-2015-02-26:
  qtest: Use qemu_opt_set() instead of qemu_opts_parse()
  pc: Use qemu_opt_set() instead of qemu_opts_parse()
  qemu-sockets: Simplify setting numeric and boolean options
  block: Simplify setting numeric options
  qemu-img: Suppress unhelpful extra errors in convert, amend
  QemuOpts: Propagate errors through opts_parse()
  QemuOpts: Propagate errors through opts_do_parse()
  QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use
  block: Suppress unhelpful extra errors in bdrv_img_create()
  qemu-img: Suppress unhelpful extra errors in convert, resize
  QemuOpts: Convert qemu_opts_set() to Error, fix its use
  QemuOpts: Convert qemu_opt_set_number() to Error, fix its use
  QemuOpts: Convert qemu_opt_set_bool() to Error, fix its use

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-03 01:28:54 +00:00
Peter Maydell 0856579cac Revert "Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging"
This reverts commit b8a173b25c, reversing
changes made to 5de090464f.

(I applied this pull request when I should not have done so, and
am now immediately reverting it.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-03 00:29:17 +00:00
Alex Williamson 47cbe50cc8 vfio-pci: Enable device request notification support
Linux v4.0-rc1 vfio-pci introduced a new virtual interrupt to allow
the kernel to request a device from the user.  When signaled, QEMU
will by default attmempt to hot-unplug the device.  This is a one-
shot attempt with the expectation that the kernel will continue to
poll for the device if it is not returned.  Returning the device when
requested is the expected standard model of cooperative usage, but we
also add an option option to disable this feature.  Initially this
opt-out is set as an experimental option because we really should
honor kernel requests for the device.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2015-03-02 11:38:55 -07:00
Samuel Pitoiset 6ee47c9008 vfio: allow to disable MMAP per device with -x-mmap=off option
Disabling MMAP support uses the slower read/write accesses but allows to
trace all MMIO accesses, which is not good for performance, but very
useful for reverse engineering PCI drivers. This option allows to
disable MMAP per device without a compile-time change.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2015-03-02 11:38:55 -07:00
Alexey Kardashevskiy 51b833f440 vfio: Make type1 listener symbols static
They are not used from anywhere but common.c which is where these are
defined so make them static.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2015-03-02 11:38:55 -07:00
Alexey Kardashevskiy 46f770d4a5 vfio: Add ioctl number to error report
This makes the error report more informative.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2015-03-02 11:38:54 -07:00
Peter Maydell b8a173b25c -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
 
 iQIcBAABCAAGBQJU7ijMAAoJECgHk2+YTcWmwJIP/AmP43pmLkFcHx8OorEUS0QR
 2hEVv4uuoUlq2SL/EN/tF/jkU8B2z6IVFmYGows4njYQuBGfQ0QKu18h8AN7Ce+R
 ew6OVIlEScniuPggdodEpq44xsEWN/1G2qlffIDX2eBH26MUdWf+WraKiVk6cif/
 BCY6VqhxSpZ3TRGG3rVoGOOhj9s2eed+BBZ5pDnXz+TH0TBEzrkg/iuHhXlFTh7B
 7ouU9P6KVPt8NZVa3UQrL8apztYdteKclb9424puJXLwi7NoTtwG+rBUavYGrP40
 g/UfDsJiyPszwR0DlABd5XkxUUZhnunSbcc2T/OTHV5hQ1CkugaY2Tf4Sghf9M2k
 nfhUpiizKPnXp9GE8b7NuK3WvzN011+TJHw40kh60ZNAoYf4K8RW1316rkDzZjf7
 KsD6mHUAW36jlbYhBO8dTlHI+ui1c3GeTt/WUbS0o9dPwiIWzGKBgNI0yHpbZAzL
 fZsTJB/Uo6DNbofLyNvAqRq7l1OG7+XK7KLR4iCAYIJsz7871GZvuI7iGP0A1wcH
 bGHsqdT1ZYvXVBMgfkPNZ6Eqn2imINizA+ISxW3abY/Tij8GEaYCnCu8g5DvH3S4
 FmFe8mNIdcj3VWvS/olyHNvaZGi8/KosKoxrmg6I4RaTcyl+inh4pr7fMhsilVyW
 Io0tF4h8tpbcp6L1fLoK
 =+Vbk
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging

* remotes/ehabkost/tags/x86-pull-request:
  target-i386: Move APIC ID compatibility code to pc.c
  target-i386: Require APIC ID to be explicitly set before CPU realize
  target-i386: Set APIC ID using cpu_index on CONFIG_USER
  linux-user: Check for cpu_init() errors
  target-i386: Move CPUX86State.cpuid_apic_id to X86CPU.apic_id
  target-i386: Simplify error handling on cpu_x86_init_user()
  target-i386: Eliminate cpu_init() function
  target-i386: Rename cpu_x86_init() to cpu_x86_init_user()
  target-i386: Move topology.h to include/hw/i386
  target-i386: Eliminate unnecessary get_cpuid_vendor() function
  target-i386: Simplify listflags() function

Conflicts:
	target-i386/cpu.c

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-02 14:25:48 +00:00
Peter Maydell 5de090464f QOM infrastructure fixes and device conversions
* Assertion fix for device_add with non-device types
 * Documentation fix
 * qdev_init() error reporting cleanups
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJU7IMRAAoJEPou0S0+fgE/C+kP/AkIe+Uc9cotMxiJG7n7e1tB
 VN/hfPJWvRkC7Ap1PuJ/0+/cJyEALzsvj4DuUq+K7daiQfNppHhOeaHEpsDfYA02
 Jsg8JHDGJxIQNRDcSMSFYTbZaY3WGQssp1q5ossRgo3I9Vc34Fdyo7hIE55bEO3K
 sHofEDQ3B6dG7CsZohd+yWstrq0L4T7KQGRWSaBX2s30o8pn61xYyIKITDkDQr9r
 /zshiyD7pPV7p0szW8MtRPk1ku3l6DRCAEjTl4OfY0FIDaOBJPRtMCCAqrbPL2If
 B6+um62/Os3uhR3RV39scxBDq29flbYo3qc5UHZH8ry2OWPeA1Qgld8bydovS/Ge
 ZLQjBbgMjrJySC8aoa2xl7u2+wPypZB7bMWm+ipnE4EQJ49eCnC2vW6RnMJ/KS+3
 cOp0U7hdsFwrvcWYna8Mclp3tzhji8ysQMdl5p5eeHzq+0auo7ccsE9/o6VJv9Wb
 VbJlzahEkGT6qaiGhgtk3rU2PMrAHUkG6yDKiox9pW1uw4iV/4icKRsbipqLs5pO
 jR1ygWT9oELf205HmgrAHUTd9Lk2pPhwfcdsznw0IMuZR2BYogD2M9p6kpCQmJiu
 dYBKUB+qCWrlpuIzFwlK36bqrGT6dsfLTujwyzGIigyO5L8UN3CThWUUIkMW4q1A
 ZMVNGtBuvdW/WlzoO1QB
 =p+Qd
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging

QOM infrastructure fixes and device conversions

* Assertion fix for device_add with non-device types
* Documentation fix
* qdev_init() error reporting cleanups

# gpg: Signature made Tue Feb 24 13:56:33 2015 GMT using RSA key ID 3E7E013F
# gpg: Good signature from "Andreas Färber <afaerber@suse.de>"
# gpg:                 aka "Andreas Färber <afaerber@suse.com>"

* remotes/afaerber/tags/qom-devices-for-peter:
  parallel: parallel_hds_isa_init() shouldn't fail
  parallel: Factor out common parallel_hds_isa_init()
  serial: serial_hds_isa_init() shouldn't fail
  serial: Factor out common serial_hds_isa_init()
  etsec: Replace qdev_init() by qdev_init_nofail()
  leon3: Replace unchecked qdev_init() by qdev_init_nofail()
  ide/isa: Replace unchecked qdev_init() by qdev_init_nofail()
  qdev: Improve qdev_init_nofail()'s error reporting
  qom: Fix typo, 'my_class_init' -> 'derived_class_init'
  qdev: Avoid type assertion in qdev_build_hotpluggable_device_list()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-02 13:20:43 +00:00
Peter Maydell 2dffe5516e NUMA fixes queue
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJU639qAAoJECgHk2+YTcWmIC0QAK36G9LpeDOJONxt7LNOCMes
 Oplwp11RRA5zs5YHVCzTL0NMZEf59xRs/35r1iIrt238clmFGpUdZRpdlsZdDMZL
 ThwxgrV7/aZH/+HyZVSTCh5FL+fTyl+DjVQ1cZqNUWQRQ6KO2AjSxA53gCoFEZ+L
 1Vg6A41u1UOdO3tMOosuDcZtkN4fXevHTuIFFzfzW4WhJuctU2P/VPsHKxESKxYH
 1Kz0S9CCr6meIqZ8DE9y5qhCUdXBj9VYbEY2JZUYVaeB8q+smY7Lz1cV7MABrD3T
 EoJa3/53b4DFl4wNkLJsuqQNFHiOrQadgmbhocgEYp3u96/7cKa+pZ8mTKgvZ14D
 kxtpcL1TeiyA3b7UfITPhqLY3mKvN7UIKh/vo0haAxj5B3H6QhemkO76oA1/zkJR
 zI3mm6trnxurZm1gBtkZwPbKoDi7OuS7lYxW3GT7K5nJBMCEAbFGXFzmoHomVDVZ
 phYGwihzUg/LWMwaZRT0bbUd2GOVAXGY7Zy9Kg0p8nvPtcEYDwp0spQDfyrnwEWu
 Bohi80x97ayRXrvY1mP5mdYg1Jj8jR4qPdwnoW6M2UHXvtdQsjfFoSj4/xbVMCb9
 l5y1vH+DHG/ZNQB0URjBoXmttWkZjpbiAbo0daPFDaZ1QRfdXx6JgdkTKtA8ozQ9
 Xvh4hVGPeLAPvRjzaesa
 =0V2i
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/ehabkost/tags/numa-pull-request' into staging

NUMA fixes queue

# gpg: Signature made Mon Feb 23 19:28:42 2015 GMT using RSA key ID 984DC5A6
# gpg: Can't check signature: public key not found

* remotes/ehabkost/tags/numa-pull-request:
  numa: Rename set_numa_modes() to numa_post_machine_init()
  numa: Rename option parsing functions
  numa: Move QemuOpts parsing to set_numa_nodes()
  numa: Make max_numa_nodeid static
  numa: Move NUMA globals to numa.c
  vl.c: Remove unnecessary zero-initialization of NUMA globals
  numa: Move NUMA declarations from sysemu.h to numa.h

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-03-02 12:13:45 +00:00
Paolo Bonzini 21618b3e55 cpus: be more paranoid in avoiding deadlocks
For good measure, ensure that the following sequence:

   thread 1 calls qemu_mutex_lock_iothread
   thread 2 calls qemu_mutex_lock_iothread
   VCPU thread are created
   VCPU thread enters execution loop

results in the VCPU threads letting the other two threads run
and obeying iothread_requesting_mutex even if the VCPUs are
not halted.  To do this, check iothread_requesting_mutex
before execution starts.

Tested-by: Leon Alrae <leon.alrae@imgtec.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-02 10:57:07 +01:00
Paolo Bonzini 6b49809c59 cpus: fix deadlock and segfault in qemu_mutex_lock_iothread
When two threads (other than the low-priority TCG VCPU thread)
are competing for the iothread lock, a deadlock can happen.  This
is because iothread_requesting_mutex is set to false by the first
thread that gets the mutex, and then the VCPU thread might never
yield from the execution loop.  If iothread_requesting_mutex is
changed from a bool to a counter, the deadlock is fixed.

However, there is another bug in qemu_mutex_lock_iothread that
can be triggered by the new call_rcu thread.  The bug happens
if qemu_mutex_lock_iothread is called before the CPUs are
created.  In that case, first_cpu is NULL and the caller
segfaults in qemu_mutex_lock_iothread.  To fix this, just
do not do the kick if first_cpu is NULL.

Reported-by: Leon Alrae <leon.alrae@imgtec.com>
Reported-by: Andreas Gustafsson <gson@gson.org>
Tested-by: Leon Alrae <leon.alrae@imgtec.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-02 10:57:07 +01:00
Max Reitz f6758f7d6b virtio-scsi: Allocate op blocker reason before blocking
s->blocker is really only used in hw/scsi/virtio-scsi.c; the only places
where it is used in hw/scsi/virtio-scsi-dataplane.c is when it is
allocated and when it is freed. That does not make a whole lot of sense
(and is actually wrong because this leads to s->blocker potentially
being NULL when blk_op_block_all() is called in virtio-scsi.c), so move
the allocation and destruction of s->blocker to the device realization
and unrealization in virtio-scsi.c, respectively.

Case in point:

$ echo -e 'eject drv\nquit' | \
    x86_64-softmmu/qemu-system-x86_64 \
        -monitor stdio -machine accel=qtest -display none \
        -object iothread,id=thr -device virtio-scsi-pci,iothread=thr \
        -drive if=none,file=test.qcow2,format=qcow2,id=drv \
        -device scsi-cd,drive=drv

Without this patch:

(qemu) eject drv
[1]    10102 done
       10103 segmentation fault (core dumped)

With this patch:

(qemu) eject drv
Device 'drv' is busy: block device is in use by data plane
(qemu) quit

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <1425057113-26940-1-git-send-email-mreitz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-03-02 10:57:07 +01:00
Michael S. Tsirkin a9ad5e1efc Makefile.target: binary depends on config-devices
relink binary whenever config-devices.mak changes:
this makes sense as we are adding/removing devices,
so binary has to be relinked to be up to date.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <1424332114-13440-2-git-send-email-mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-27 19:42:45 +01:00
Michael S. Tsirkin 12ccfec968 Makefile: don't silence mak file test with V=1
V=1 should show what's going on, it's not nice
to silence things unconditionally.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <1424332114-13440-1-git-send-email-mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-27 19:42:45 +01:00
Vasily Efimov 23cab7b7a9 Makefile: fix up parallel building under MSYS+MinGW
This patch enables parallel building of QEMU in MSYS+MinGW environment.
Currently an attempt to build QEMU in parallel fails on generation of
version.lo (and version.o too).

The cause of the failure is that when listing prerequisites "Makefile"
references "config-host.h" by absolute path in some rules and by relative
path in others. Make cannot figure out that these references points to the
same file which leads to the race: the generation of "version.*" which
requires "$(BUILD_DIR)/config-host.h" is launched in parallel with the
generation of "config-host.h" needed by other "Makefile" targets.

This patch removes "$(BUILD_DIR)/" prefix from corresponding prerequisite
of "version.*". There is no other prerequisites "$(BUILD_DIR)/config-host.h"
found.

Also note that not every version of MSYS is able to build QEMU in parallel,
see: "http://sourceforge.net/p/mingw/bugs/1950/". The suggested version is
1.0.17.

Signed-off-by: Vasily Efimov <real@ispras.ru>
Message-Id: <1424264377-5992-1-git-send-email-real@ispras.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-27 18:26:31 +01:00
Fam Zheng 43ae8fb10c iscsi: Handle write protected case in reopen
Save the write protected flag and check before reopen.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <1424839208-5195-1-git-send-email-famz@redhat.com>
[Fixed typo in the name of the new field. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-27 18:26:31 +01:00
David Gibson 8af738b3ee Give ivshmem its own config option
Currently the ivshmem device is built whenever both PCI and KVM support are
included.  This patch gives it its own config option to allow easier
customization of whether to include it.  It's enabled by default in the
same circumstances as now - when both PCI and KVM are available.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-Id: <1425017077-18487-4-git-send-email-david@gibson.dropbear.id.au>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-27 15:17:46 +01:00
David Gibson 2296594257 Create specific config option for "platform-bus"
Currently the "platform-bus" device is included for all softmmu builds.
This bridge is intended for use on any platforms that require dynamic
creation of sysbus devices.  However, at present it is used only for the
PPC E500 target, with plans for the ARM "virt" target in the immediate
future.

To avoid a not-very-useful entry appearing in "qemu -device ?" output on
other targets, this patch makes a specific config option for platform-bus
and enables it (for now) only on ppc configurations which include E500
and on ARM (which always includes the "virt" target).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <1425017077-18487-3-git-send-email-david@gibson.dropbear.id.au>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-27 15:17:42 +01:00
David Gibson 4681867544 Add specific config options for PCI-E bridges
The i82801b11, ioh3420 and xio3130 PCI Express devices are currently
included in the build unconditionally.

While they could theoretically appear on any target platform with PCI-E,
they're pretty unlikely to appear on platforms that aren't Intel derived.

Therefore, to avoid presenting unlikely-to-be-relevant devices to the user,
add config options to enable these components, and enable them by default
only on x86 and arm platforms.

(Note that this patch does include these for aarch64, via its inclusion of
arm-softmmu.mak).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-Id: <1425017077-18487-2-git-send-email-david@gibson.dropbear.id.au>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-27 15:17:35 +01:00
Gonglei 57fe6a6e4a bootdevice: fix segment fault when booting guest with '-kernel' and '-initrd'
Reproducer:

 $./qemu-system-x86_64 --enable-kvm -kernel /home/vmlinuz-2.6.32.12-0.7-default \
  -initrd /home/initrd-2.6.32.12-0.7-default -append \
 "root=/dev/ram rw console=ttyS0,115200" -dtb guest.dtb -vnc :10 --monitor stdio -smp 2
QEMU 2.2.50 monitor - type 'help' for more information
(qemu) Segmentation fault (core dumped)

Reported-by: Edivaldo de Araujo Pereira <edivaldoapereira@yahoo.com.br>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Message-Id: <1425001784-6752-1-git-send-email-arei.gonglei@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-27 15:15:56 +01:00
Pavel Dovgalyuk 2ed1ebcf65 timer: replace time() with QEMU_CLOCK_HOST
This patch replaces time() function calls with calls to
qemu_clock_get_ns(QEMU_CLOCK_HOST). It makes such requests deterministic
in record/replay mode of icount.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Message-Id: <20150227131102.11912.89850.stgit@PASHA-ISP>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-27 15:15:50 +01:00
Fam Zheng 0543055967 virtio-scsi-dataplane: Call blk_set_aio_context within BQL
It's not safe to call blk_set_aio_context from outside BQL because of
the bdrv_drain_all there. Let's put it in the hotplug callback which
will be called by qdev device realization for each scsi device attached
to the bus.

Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <1423969591-23646-3-git-send-email-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-27 14:43:45 +01:00
Fam Zheng 2e5b887cfc block: Forbid bdrv_set_aio_context outside BQL
Even if the caller has both the old and the new AioContext's, there can
be a deadlock, due to the leading bdrv_drain_all.

Suppose there are four io threads (A, B, A0, B0) with A and B owning a
BDS for each (bs_a, bs_b); Now A wants to move bs_a to iothread A0, and
B wants to move bs_b to B0, at the same time:

  iothread A                           iothread B
--------------------------------------------------------------------------
  aio_context_acquire(A0) /* OK */     aio_context_acquire(B0) /* OK */
  bdrv_set_aio_context(bs_a, A0)       bdrv_set_aio_context(bs_b, B0)
  -> bdrv_drain_all()                  -> bdrv_drain_all()
     -> acquire A /* OK */               -> acquire A /* blocked */
     -> acquire B /* blocked */          -> acquire B
     ...                                 ...

Deadlock happens because A is waiting for B, and B is waiting for A.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1423969591-23646-2-git-send-email-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-27 14:43:45 +01:00
Paolo Bonzini 2264750483 scsi: give device a parent before setting properties
This mimics what is done in qdev_device_add, and lets the device be
freed in case something goes wrong.  Otherwise, object_unparent returns
immediately without freeing the device, which is on the other hand left
in the parent bus's list of children.

scsi_bus_legacy_handle_cmdline then returns an error, and the HBA is
destroyed as well with object_unparent.  But the lingering device that
was not removed in scsi_bus_legacy_add_drive cannot be removed now either,
and bus_unparent gets stuck in an infinite loop trying to empty the list
of children.

The right fix of course would be to assert in bus_add_child that the
device already has a bus, and remove the "safety net" that adds the
drive to the QOM tree in device_set_realized.  I am not yet sure whether
that would entail changing all callers to qdev_create (as well as
isa_create and usb_create and the corresponding _try_create versions).

Reported-by: Markus Armbruster <armbru@redhat.com>
Tested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-02-27 14:43:44 +01:00
Markus Armbruster b3adf5acb5 qtest: Use qemu_opt_set() instead of qemu_opts_parse()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26 14:52:13 +01:00
Markus Armbruster 5bdb59a290 pc: Use qemu_opt_set() instead of qemu_opts_parse()
Less code, same result.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26 14:52:07 +01:00
Markus Armbruster 62b3de6934 qemu-sockets: Simplify setting numeric and boolean options
Don't convert numbers or bools to strings for use with qemu_opt_set(),
simply use qemu_opt_set_number() or qemu_opt_set_bool() instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26 14:51:53 +01:00
Markus Armbruster a8b18f8fd2 block: Simplify setting numeric options
Don't convert numbers to strings for use with qemu_opt_set(), simply
use qemu_opt_set_number() instead.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26 14:51:46 +01:00
Markus Armbruster dc523cd348 qemu-img: Suppress unhelpful extra errors in convert, amend
img_convert() and img_amend() use qemu_opts_do_parse(), which reports
errors with qerror_report_err().  Its error messages aren't helpful
here, the caller reports one that actually makes sense.  Reproducer:

    $ qemu-img convert -o backing_format=raw in.img out.img
    qemu-img: Invalid parameter 'backing_format'
    qemu-img: Invalid options for file format 'raw'

To fix, propagate errors through qemu_opts_do_parse().  This lifts the
error reporting into callers.  Drop it from img_convert() and
img_amend(), keep it in qemu_chr_parse_compat(), bdrv_img_create().

Since I'm touching qemu_opts_do_parse() anyway, write a function
comment for it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26 14:51:21 +01:00
Markus Armbruster 4f81273dd9 QemuOpts: Propagate errors through opts_parse()
Since I'm touching qemu_opts_parse() anyway, write a function comment
for it.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26 14:49:58 +01:00
Markus Armbruster d93ae3cfb9 QemuOpts: Propagate errors through opts_do_parse()
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26 14:49:52 +01:00
Markus Armbruster f43e47dbf6 QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use
qemu_opt_set() is a wrapper around qemu_opt_set() that reports the
error with qerror_report_err().

Most of its users assume the function can't fail.  Make them use
qemu_opt_set_err() with &error_abort, so that should the assumption
ever break, it'll break noisily.

Just two users remain, in util/qemu-config.c.  Switch them to
qemu_opt_set_err() as well, then rename qemu_opt_set_err() to
qemu_opt_set().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26 14:49:31 +01:00
Markus Armbruster 6be4194b92 block: Suppress unhelpful extra errors in bdrv_img_create()
bdrv_img_create() uses qemu_opt_set(), which reports errors with
qerror_report_err().  Its error messages aren't helpful here, the
caller reports one that actually makes sense.  I don't know how to
trigger the error conditions, though.

Switch to qemu_opt_set_err() to get rid of the unwanted messages.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26 14:48:31 +01:00
Markus Armbruster 6750e795b1 qemu-img: Suppress unhelpful extra errors in convert, resize
add_old_style_options() for img_convert() and img_resize() use
qemu_opt_set(), which reports errors with qerror_report_err().  Its
error messages aren't helpful here, the caller reports one that
actually makes sense.  Reproducer:

    $ qemu-img convert -B raw in.img out.img
    qemu-img: Invalid parameter 'backing_file'
    qemu-img: Backing file not supported for file format 'raw'

Switch to qemu_opt_set_err() to get rid of the unwanted messages.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26 14:48:16 +01:00
Markus Armbruster 79087c782e QemuOpts: Convert qemu_opts_set() to Error, fix its use
Return the Error object instead of reporting it with
qerror_report_err().

Change callers that assume the function can't fail to pass
&error_abort, so that should the assumption ever break, it'll break
noisily.

Turns out all callers outside its unit test assume that.  We could
drop the Error ** argument, but that would make the interface less
regular, so don't.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26 14:47:49 +01:00
Markus Armbruster 39101f2511 QemuOpts: Convert qemu_opt_set_number() to Error, fix its use
Return the Error object instead of reporting it with
qerror_report_err().

Change callers that assume the function can't fail to pass
&error_abort, so that should the assumption ever break, it'll break
noisily.

Turns out all callers outside its unit test assume that.  We could
drop the Error ** argument, but that would make the interface less
regular, so don't.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26 14:47:32 +01:00
Markus Armbruster cccb7967bd QemuOpts: Convert qemu_opt_set_bool() to Error, fix its use
Return the Error object instead of reporting it with
qerror_report_err().

Change callers that assume the function can't fail to pass
&error_abort, so that should the assumption ever break, it'll break
noisily.

Turns out all callers outside its unit test assume that.  We could
drop the Error ** argument, but that would make the interface less
regular, so don't.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2015-02-26 14:46:32 +01:00
Peter Maydell 041ccc922e Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging
* remotes/qmp-unstable/queue/qmp:
  qapi-types: add C99 index names to arrays
  monitor: Fix missing err = NULL in client_migrate_info()
  balloon: Fix typo
  hmp: Fix warning from smatch (wrong argument in function call)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-02-26 12:16:46 +00:00
Peter Maydell 2559db0696 seabios: update to 1.8.0 release
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJU5aCOAAoJEEy22O7T6HE4nWwP/1UNtnD/aFOUJPIWGqHOQcLm
 IWHW9It4XtzYItQsURqpGNe++AJZo2Cwpnf+LnODbBDn0jOVInzeszFS/ni4O+K7
 Apva3OSj8PKveftMt7cks9Yd2zNTxNrWu5a5BT2haVy/UmBKIuyv0WmfT74/4XSF
 9oFIOhoBFvlhl9/v2Zg/21iDyjOkwV0Ip4q84sxX/tkQ83GciSeNmSzRvnXJ+Orb
 iw7xigBI9/5tvtWgd/68GO3EGzdHhJj6kVs7kxxokjt5azq1jojesShVM9LrRk6A
 PIB8eVBDFsO2ilhLNfzBJqTsHB3E5YsjI6Es9selUIbH4YRQsIafU/n9T7PlQSpB
 5bPk0iwIVdUlRjnAMauebhpe480hyzZMnF2Z9KsgJ2vzTQSkTOs+5fv3EOCezTHW
 Yx7tbpDOpMUdbYFfFbcDEL5MlShChfRnRbmHDF8osHMzR7a/VVseVV6ziDU5o/9Z
 x/oSOJHPF8huSYoGvLPMMx7K7X+2+Uk+HZ+6V1VZhQrozkUtLoM5DrszoTJWBVuu
 XKNPMfC21kGVgAE2WcFxCD3z04DM4d6tJHTlYr3eh0HxD8AcQcrI7gEH/imh/izb
 31BqYQjqK/RXHZvmTtMjmh2t4U+DNOOJTzVV/C+NxIycaGxhfngoS4QX+R1ze3Bq
 pZxHFb0N/Zdx0AleQoiy
 =Qffc
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/pull-roms-20150219-1' into staging

seabios: update to 1.8.0 release

# gpg: Signature made Thu Feb 19 08:36:30 2015 GMT 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-roms-20150219-1:
  seabios: update to 1.8.0 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-02-26 11:18:30 +00:00
Peter Maydell 11d39a1310 Features for s390x/kvm
1. guest reIPL changes (Fan Zhang)
 Implements subcode 5 and 6 of diag 0x308. This allows to use
 /sys/firmware/[re]ipl/ccw/* and the chreipl and lsreipl tools in
 Linux. In addition to the normal "change the disk" this also
 allows to switch from booting an external kernel into rebooting
 from a disk.
 
 2. Memory page table walking (Thomas Huth)
 Fix several page table walking functions, used in several places
 like gdb server and instruction handling. Also use these functions
 in several I/O related functions.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJU5FeyAAoJEBF7vIC1phx84EkP/jtg2H2I9/WY2BcHcuDNQCzX
 FJdeQ06NVxNZD4kez4gqLx7ps4gy+IJpLGOsscuqfh4GakvoTh1Z/Y4gLD0n/6UC
 DyuX+IM56Cfzn3reIBig/A6s/VZFtNfIeoKYWL8UCA/f8lzzfKBaBjpUhijEsBQK
 SazqzCPqeSULCJnhJbpYMKvzG9GI+E4YbgIMN0//aoRX/ODbYUO/4QVKrXz5m7if
 MKOuyQyg6XjmD2+pVXlqfTh0wqF8a5e3tjjnAFc0+vpmqN1q4g13593qkhRWQGBT
 0pBTs2PsJ7q9+tplndTqm0a6NRnVcPPdp9YvDwTz8bN/f+DHpWiI1vxDp1SeoLEg
 uYCUzX5dMp2/QXe9xJqNeLOHJt/XSxw0n7ujZ+AkBtcjYBe8qI0C3DtnpG/Uu/sJ
 jNb5bNhwqfdLmtjFx9LhHy2vEuu6JxNeAGec8hdysv21Eg+mi6LkOBkHzm1zlaly
 RGSOUydukwm6UT+MIMBkcJLGUEPj4mTk/mvQ7VCKedG5Rs6pwdwLFPojWzhhZwLS
 zYuRf/bzJodORfchbUMAj+X46IvarOelK5hF6oNGlKl1xoGww0Mbc7XPosmxy6g8
 4UvlopNORnjZ05DA0qJM9i9Dar6JZ6V1qzKOUdt6FGrxTVZlByc79uaC8wiyZlth
 pLHxteJ6WsEf/gqI9KGu
 =lR0Q
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/borntraeger/tags/s390x-20150218' into staging

Features for s390x/kvm

1. guest reIPL changes (Fan Zhang)
Implements subcode 5 and 6 of diag 0x308. This allows to use
/sys/firmware/[re]ipl/ccw/* and the chreipl and lsreipl tools in
Linux. In addition to the normal "change the disk" this also
allows to switch from booting an external kernel into rebooting
from a disk.

2. Memory page table walking (Thomas Huth)
Fix several page table walking functions, used in several places
like gdb server and instruction handling. Also use these functions
in several I/O related functions.

# gpg: Signature made Wed Feb 18 09:13:22 2015 GMT using RSA key ID B5A61C7C
# gpg: Good signature from "Christian Borntraeger (IBM) <borntraeger@de.ibm.com>"

* remotes/borntraeger/tags/s390x-20150218: (29 commits)
  s390x/helper: Remove s390_cpu_physical_memory_map
  s390x/pci: Rework memory access in zpci instruction
  s390x/ioinst: Rework memory access in TPI instruction
  s390x/ioinst: Rework memory access in CHSC instruction
  s390x/ioinst: Rework memory access in STCRW instruction
  s390x/ioinst: Rework memory access in TSCH instruction
  s390x/ioinst: Set condition code in ioinst_handle_tsch() handler
  s390x/ioinst: Rework memory access in STSCH instruction
  s390x/ioinst: Rework memory access in SSCH instruction
  s390x/ioinst: Rework memory access in MSCH instruction
  s390x/css: Make schib parameter of css_do_msch const
  s390x/mmu: Add function for accessing guest memory
  s390x/kvm: Add function for injecting pgm access exceptions
  s390x/mmu: Clean up mmu_translate_asc()
  s390x/mmu: Check bit 52 in page table entry
  s390x/mmu: Renaming related to the ASCE confusion
  s390x/mmu: Add support for read-only regions
  s390x/mmu: Fix the exception codes for illegal table entries
  s390x/mmu: Fix exception types when checking the ASCEs
  s390x/mmu: Fix translation exception code in lowcore
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-02-26 09:08:54 +00:00
Peter Maydell c5c6d7f81a Clean up around error_get_pretty(), qerror_report_err()
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJU5GT/AAoJEDhwtADrkYZT6H8QAJSdCnymglYhsJ0L8Pn+mFbw
 ukAxSBjZ+XJXwSBCjSLB9e2Tb6PJZAbAdQJjmI1Ijb+3cXqjRURErTsp+Caz1pjj
 Zw4v4whxNedXl+WeZEwX7sU6WlDhMEk51E1NHssd9dyZ/noEqHiw/XzoqimaYlPK
 nrSTBZ94N+F+Daw1d/cjbRMHHGVSjpVraDEPvZIkC6Mv43dGhSdCT529FXthMpUd
 OhoaQvEdy/75RqFwd4gbjHzA2qHVVsKdq8EfDdHAlcg2LSGB8zM4LlRmYxMKmy2g
 ylZLXtm6v7Pm+tYFVdLc7xWnRIh4vFXBHFJ8O9jFXziV4Nkj7s7qXdLJXxYWfRXU
 KC4/vw9IEkHWWUtn1A69ktyPFjEcnW0ieiEOA7/2FXiH7RARnWTl/YChlQrSgSAM
 zh+/01UhHvKBkxmkJIWpHzR+70A/GyubvlrcSd0g6L+g1hXEw78aryivCoFTKocl
 MNTlI7AcaGW2qpSUn5kr99aBdKD1sSdGPbNqqZMOzUekGQHeUuNNrFlvsTibMo5G
 OikdrgygmoLHBcMCgVykYoHen5lMcz+PS5aGFoGwvMV3DQZAsAwltXGeJSNck143
 WuEatwA0PhuA0S/dZMELC27kUdsbvpBUhboHuShz4pvytihWu0HmVAWDeShd9uPB
 r/WSqvETUcdSOqExGEP2
 =g7dZ
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2015-02-18' into staging

Clean up around error_get_pretty(), qerror_report_err()

# gpg: Signature made Wed Feb 18 10:10:07 2015 GMT using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"

* remotes/armbru/tags/pull-error-2015-02-18:
  qemu-char: Avoid qerror_report_err() outside QMP command handlers
  qemu-img: Avoid qerror_report_err() outside QMP command handlers
  vl: Avoid qerror_report_err() outside QMP command handlers
  tpm: Avoid qerror_report_err() outside QMP command handlers
  numa: Avoid qerror_report_err() outside QMP command handlers
  net: Avoid qerror_report_err() outside QMP command handlers
  monitor: Avoid qerror_report_err() outside QMP command handlers
  monitor: Clean up around monitor_handle_fd_param()
  error: Use error_report_err() where appropriate
  error: New convenience function error_report_err()
  vhost-scsi: Improve error reporting for invalid vhostfd

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2015-02-26 07:01:08 +00:00
Eduardo Habkost de13197a38 target-i386: Move APIC ID compatibility code to pc.c
The APIC ID compatibility code is required only for PC, and now that
x86_cpu_initfn() doesn't use x86_cpu_apic_id_from_index() anymore, that
code can be moved to pc.c.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2015-02-25 15:00:07 -03:00
Eduardo Habkost e1356dd70a target-i386: Require APIC ID to be explicitly set before CPU realize
Instead of setting APIC ID automatically when creating a X86CPU, require
the property to be set before realizing the object (which all callers of
cpu_x86_create() already do).

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2015-02-25 15:00:07 -03:00
Eduardo Habkost 9c235e83f1 target-i386: Set APIC ID using cpu_index on CONFIG_USER
The PC CPU initialization code already sets apic-id based on the CPU
topology, and CONFIG_USER doesn't need the topology-based APIC ID
calculation code.

Make CONFIG_USER set apic-id before realizing the CPU (just like PC
already does), so we can simplify x86_cpu_initfn later. As there is no
CPU topology configuration in CONFIG_USER, just use cpu_index as the
APIC ID.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2015-02-25 15:00:07 -03:00