Commit Graph

70890 Commits

Author SHA1 Message Date
Peter Maydell 3bd6cbbb18 Update version for v4.1.0-rc3 release
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-30 22:02:05 +01:00
Peter Maydell 4366e7cfb4 pci: bugfix
A last minute fix to cross-version migration.
 Better late than never.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJdQGtOAAoJECgfDbjSjVRp/7YH/1XrwwWpjRI3DKM3c4VZCGPW
 8MYROepOYuHf/hJmxRzlg46LjojNtj+ro2NghPKHhg/veHc1F/S0IWmrlYF8sNqV
 SdkK+teaGP/VxgKKV4mFYqujO/OMGsm4giAUAZUHACtJdUuwNOwuVY3zAzaOwYh3
 q2rFlVQjGenM528r5fJFLkkWfPSbGQMFZUVt6TgZy9Xi7a2gl77+iy/rqmPFhpZg
 kuwwViDpDiMNqBOChhi/UFlmAgbYr5mxq/n5KWp5FMnNL3t7KzaPtUsQSqKoj7Jt
 3IaHFk5yLj+mAb0TmvQhIpzl/C7E/XzOzEhZzS4iiSzUNk0xJktZ8tKQGfPJduw=
 =QdwK
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pci: bugfix

A last minute fix to cross-version migration.
Better late than never.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Tue 30 Jul 2019 17:07:42 BST
# gpg:                using RSA key 281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  pcie_root_port: Disable ACS on older machines
  pcie_root_port: Allow ACS to be disabled

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-30 20:53:26 +01:00
Dr. David Alan Gilbert c8557f1b48 pcie_root_port: Disable ACS on older machines
ACS got added in 4.0 unconditionally,  that broke older<->4.0 migration
where there was a PCIe root port.
Fix this by turning it off for 3.1 and older machines; note this
fixes compatibility for older QEMUs but breaks compatibility with 4.0
for older machine types.

    machine type    source qemu   dest qemu
       3.1             3.1           4.0        broken
       3.1             3.1           4.1rc2     broken
       3.1             3.1           4.1+this   OK ++
       3.1             4.0           4.1rc2     OK
       3.1             4.0           4.1+this   broken --
       4.0             4.0           4.1rc2     OK
       4.0             4.0           4.1+this   OK

So we gain and lose; the consensus seems to be treat this as a
fix for older machine types.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190730093719.12958-3-dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-07-30 12:07:07 -04:00
Dr. David Alan Gilbert a58dfba201 pcie_root_port: Allow ACS to be disabled
ACS was added in 4.0 unconditionally, this breaks migration
compatibility.
Allow ACS to be disabled by adding a property that's
checked by pcie_root_port.

Unfortunately pcie-root-port doesn't have any instance data,
so there's no where for that flag to live, so stuff it into
PCIESlot.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190730093719.12958-2-dgilbert@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-07-30 12:07:07 -04:00
Peter Maydell 987a232242 target/arm: Deliver BKPT/BRK exceptions to correct exception level
Most Arm architectural debug exceptions (eg watchpoints) are ignored
if the configured "debug exception level" is below the current
exception level (so for example EL1 can't arrange to get debug exceptions
for EL2 execution). Exceptions generated by the BRK or BPKT instructions
are a special case -- they must always cause an exception, so if
we're executing above the debug exception level then we
must take them to the current exception level.

This fixes a bug where executing BRK at EL2 could result in an
exception being taken at EL1 (which is strictly forbidden by the
architecture).

Fixes: https://bugs.launchpad.net/qemu/+bug/1838277
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190730132522.27086-1-peter.maydell@linaro.org
2019-07-30 17:05:22 +01:00
Peter Maydell 62ae78c77a Block layer patches:
- fdc: Fix inserting read-only media in empty drive
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJdQGL+AAoJEH8JsnLIjy/WAQwQAIjFzuqJA9f+51n61zwo9Aj5
 BnkHK8C7Y+DYapTpXQzg/SS5zyS7MVFXqzPX+riAnP3n4rFKk8GsfIUR97i+bo4D
 mIgyfiVicVSpIIhdQUW3RIrYF4BrN4vV8Mz5Bclej89BO6Yh57FLyzmXHLyhbtO+
 qRXDUE8F5tlv81W/ljye1iUqA9HkrullKNW8SsakK0G7YWrGdHXewCb3xeSIxeCs
 cYkCQsU0fbnJgrdpSIIxxDn2AItLqLJOfSKbisMavAkzKyT9mQM+sw/ng6JrClBI
 1tqkNXynZ1lUX34tj4WXoDrpfYPyc6k013AgqjCQOdTGqkbUZIT9dRJWc4W+QP2J
 8OpJKx8lCnRhzdqYXxoptIUW/z/gLMW8877RJl03D0O7OLOrGHvFE9ow25uXBpNH
 74Iq5aKZAn8XJdO/QfWI9nYolQk04J7dxBs+evsdyUz2K1QsnZBaiKn5BLvskYPA
 +dB0BoD2T99SApCb8KbTWCqYqRWJraWBc5Dml2PoU1ffjfiZdbQUdoCRkuLTvNn8
 KsXG4Seg8UA3S4gMKdTnCXZNkOTflFOLH1Sor3JbVROp4ii0t4zORcAXA43T0+QP
 To0UyS/OhSk3RlzofG1IPEBuk2i1VYaCZSllj1sWbSY6XftLp+75JZd2gVPBy8/b
 TAmvsQYf36gP6yNL1Tga
 =lrIS
 -----END PGP SIGNATURE-----

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

Block layer patches:

- fdc: Fix inserting read-only media in empty drive

# gpg: Signature made Tue 30 Jul 2019 16:32:14 BST
# gpg:                using RSA key 7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  iotests/118: Test inserting a read-only medium
  fdc: Fix inserting read-only media in empty drive

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-30 16:35:17 +01:00
Kevin Wolf 6817416014 iotests/118: Test inserting a read-only medium
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
2019-07-30 17:32:01 +02:00
Kevin Wolf 0b9e918f03 fdc: Fix inserting read-only media in empty drive
In order to insert a read-only medium (i.e. a read-only block node) to
the BlockBackend of a floppy drive, we must not have taken write
permissions on that BlockBackend, or the operation will fail with the
error message "Block node is read-only".

The device already takes care to remove all permissions when the medium
is ejected, but the state isn't correct if the drive is initially empty:
It uses blk_is_read_only() to check whether write permissions should be
taken, but this function returns false for empty BlockBackends in the
common case.

Fix floppy_drive_realize() to avoid taking write permissions if the
drive is empty.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
2019-07-30 17:31:58 +02:00
Peter Maydell 8517bf8405 Block patch for 4.1.0-rc3:
- Fix CID 1403771 in block/nvme.c
 -----BEGIN PGP SIGNATURE-----
 
 iQFGBAABCAAwFiEEkb62CjDbPohX0Rgp9AfbAGHVz0AFAl1APWgSHG1yZWl0ekBy
 ZWRoYXQuY29tAAoJEPQH2wBh1c9AeN0H/0DBLJz9Jcc679RCGg4JPCrOcfvusHzr
 rUd5lxx9al9c3VoSHqXFb0QIYNJnFP+ylLT/Pbt7KrXBimT2xpGEpsoSYv59OYA7
 qcOrHqVkUeIB8CWxA7qQxZC6ZHWvRApZqsIsNzcm/KBNd25gpmZO507ByEefZzYQ
 3RenEhpZQIfsbdgMgkXW/xh1o2JrCas4JbHrwJQKF0NfmLSOMvJx9lflOf7dEkQw
 nTa/UwfBiA2e5tzcnl89BS2/kZ6g4Ug1h1IYk7g63QTcYeb88jjxLQltmoSR+daG
 5hza5M5OJw98fFIOZOiYbwdPTaeHjcTTeuJXbb1Em8A1S95Pe2eTWg0=
 =oi2U
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2019-07-30' into staging

Block patch for 4.1.0-rc3:
- Fix CID 1403771 in block/nvme.c

# gpg: Signature made Tue 30 Jul 2019 13:51:52 BST
# gpg:                using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40
# gpg:                issuer "mreitz@redhat.com"
# gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full]
# Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40

* remotes/maxreitz/tags/pull-block-2019-07-30:
  nvme: Limit blkshift to 12 (for 4 kB blocks)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-30 14:23:07 +01:00
Max Reitz 1120407bdf nvme: Limit blkshift to 12 (for 4 kB blocks)
Linux does not support blocks greater than 4 kB anyway, so we might as
well limit blkshift to 12 and thus save us from some potential trouble.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Suggested-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20190730114812.10493-1-mreitz@redhat.com
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Coverity: CID 1403771
Signed-off-by: Max Reitz <mreitz@redhat.com>
2019-07-30 14:49:24 +02:00
Peter Maydell 6e9a6cbe7d Block layer patches:
- scsi-cd: Fix inserting read-only media in empty drive
 - block/copy-on-read: Fix permissions for inactive node
 - Test case fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJdQChMAAoJEH8JsnLIjy/WXmgQAItW4Nqmd8NynwWMCLEBRRIV
 4PUa8w0uUQ/5C+CVc0RYzYWtSg9+GRqaMufT1TAAxFaBAavCF7gc6xty9cufCoQY
 LpJRn1PhOzuVpPjALnkjEnlhFAKIvgBkq/lSIq0Ly0gkGN/nlnwohndXQnazjvIp
 +fU8i65kSaCTPJtXC9TSiKWuRewHIcqP1mVuzfjD+arzqB8yQOiOIAj/GB243cGE
 1WbVJPRQhRQ5DDYFMI44mnZcewKjyFMinRzONLuFkn1QoRCV54+5suhcfhdGwUj2
 Qgovg5kZ7TDRO0u3P/S+KJwwLJ1x1wpdq/5Xa8S3UmdRVfujlNcrkR814e43qdLz
 DwrCa0XnQnZKbmkAcOGx5Fi8wt0wo9Yl8Ymyo6mMyNJpgG5hd4NU1Lx6SUkLwir+
 E1Jd8u2HCsOMZeiyAr80/fhp3Lx8eBsALZITJISUTx7oNY5b7+fmXqFr470v58u5
 Q3MkZ3FC1uIJzAQEXA9r+3XrRkxSAFxDyp/Swlwkm1891CkrGXqtE0WohLirgYJs
 alAFJT7nI8tcXmtPLfO+oAbPZY+EGgI/q2puHDNEIMJ/11X/RGi7/4SBWyiAEdtx
 +uLTYK2w5X87QhZHfyr0YSGmOq2WV7BdqTN8a++gf8z31++lmAHKi1/8a887mgeF
 8PDAPMO8z20U2FxU0Z3a
 =Xbui
 -----END PGP SIGNATURE-----

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

Block layer patches:

- scsi-cd: Fix inserting read-only media in empty drive
- block/copy-on-read: Fix permissions for inactive node
- Test case fixes

# gpg: Signature made Tue 30 Jul 2019 12:21:48 BST
# gpg:                using RSA key 7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  scsi-cd: Fix inserting read-only media in empty drive
  block/copy-on-read: Fix permissions for inactive node
  Fixes: add read-zeroes to 051.out
  tests/multiboot: Fix load address of test kernels

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-30 12:25:35 +01:00
Kevin Wolf 7cef3d1290 scsi-cd: Fix inserting read-only media in empty drive
scsi-disks decides whether it has a read-only device by looking at
whether the BlockBackend specified as drive=... is read-only. In the
case of an anonymous BlockBackend (with a node name specified in
drive=...), this is the read-only flag of the attached node. In the case
of an empty anonymous BlockBackend, it's always read-write because
nothing prevented it from being read-write.

This is a problem because scsi-cd would take write permissions on the
anonymous BlockBackend of an empty drive created without a drive=...
option. Using blockdev-insert-medium with a read-only node fails then
with the error message "Block node is read-only".

Fix scsi_realize() so that scsi-cd devices always take read-only
permissions on their BlockBackend instead.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1733920
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
2019-07-30 13:21:38 +02:00
Kevin Wolf 2b23f28639 block/copy-on-read: Fix permissions for inactive node
The copy-on-read drive must not request the WRITE_UNCHANGED permission
for its child if the node is inactive, otherwise starting a migration
destination with -incoming will fail because the child cannot provide
write access yet:

  qemu-system-x86_64: -blockdev copy-on-read,file=img,node-name=cor: Block node is read-only

Earlier QEMU versions additionally ran into an abort() on the migration
source side: bdrv_inactivate_recurse() failed to update permissions.
This is silently ignored today because it was only supposed to loosen
restrictions. This is the symptom that was originally reported here:

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

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
2019-07-30 12:25:43 +02:00
Andrey Shinkevich 251071e0c0 Fixes: add read-zeroes to 051.out
The patch "iotests: Set read-zeroes on in null block driver for Valgrind"
with the commit ID a6862418fe needs the change in 051.out when
compared against on the s390 system.

Fixes: a6862418fe
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2019-07-30 12:25:43 +02:00
Kevin Wolf 6078a0b64f tests/multiboot: Fix load address of test kernels
While older toolchains produced binaries where the physical load address
of ELF segments was the same as the virtual address, newer versions seem
to choose a different physical address if it isn't specified explicitly.
The means that the test kernel doesn't use the right addresses to access
e.g. format strings any more and the whole output disappears, causing
all test cases to fail.

Fix this by specifying the physical load address of sections explicitly.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2019-07-30 12:25:43 +02:00
Peter Maydell ee9545ed15 virtio, pc: fixes
A couple of last minute bugfixes.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJdP2FyAAoJECgfDbjSjVRpv7wIAIuhmRkH9b5qEolv6aYU9/n5
 RaSai5bs0l+KO7SRGzpjf6AJkg2szV0Txxx4+YCg8xSkWumrE6XTRNq3/qKxRkJk
 KP1pzq0n01YTMoH7aEVTxPTgeOEnYu9yctQ0qgR513FK+2tkaN54LAQd4paHdTLZ
 bU0n3D0ao1mwKIoXjkw86qdOk2gCKuatda1UMGiH0eY6nZgyI/Uft5LaFfD+17PT
 7DbLVER+jGdtX3MNH6JZEVciFSyn8Z6h8A5CegsR94UVYqIdARXYgtBDTlJDKOYG
 L1IyRelMvRn3DibNyr0qN0uCoYCSZAvWBgOsaIbHWlipPzYXq2UW/jR0X2pLSf0=
 =iiAT
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

virtio, pc: fixes

A couple of last minute bugfixes.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Mon 29 Jul 2019 22:13:22 BST
# gpg:                using RSA key 281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  pc-dimm: fix crash when invalid slot number is used
  Revert "hw: report invalid disable-legacy|modern usage for virtio-1-only devs"
  Revert "Revert "globals: Allow global properties to be optional""

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-30 09:43:32 +01:00
Igor Mammedov 22235bb609 pc-dimm: fix crash when invalid slot number is used
QEMU will crash with:
  Segmentation fault (core dumped)
when negative slot number is used, ex:
  qemu-system-x86_64 -m 1G,maxmem=20G,slots=256 \
      -object memory-backend-ram,id=mem1,size=1G \
      -device pc-dimm,id=dimm1,memdev=mem1,slot=-2

fix it by checking that slot number is within valid range.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20190723160859.27250-1-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Igor Mammedov &lt;<a href="mailto:imammedo@redhat.com" target="_blank">imammedo@redhat.com</a>&gt;<br></blockquote><div><br></div><div>Reviewed-by: Li Qiang &lt;<a href="mailto:liq3ea@gmail.com">liq3ea@gmail.com</a>&gt;<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Reviewed-by: Pankaj Gupta <pagupta@redhat.com>
2019-07-29 16:57:27 -04:00
Dr. David Alan Gilbert dd56040d29 Revert "hw: report invalid disable-legacy|modern usage for virtio-1-only devs"
This reverts commit f2784eed30
since that accidentally removes the PCIe capabilities from virtio
devices because virtio_pci_dc_realize is called before the new 'mode'
flag is set.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190729162903.4489-3-dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
2019-07-29 16:57:27 -04:00
Dr. David Alan Gilbert 92fd453c67 Revert "Revert "globals: Allow global properties to be optional""
This reverts commit 8fa70dbd8b.

Because we're about to revert it's neighbour and thus uses an optional
again.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190729162903.4489-2-dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
2019-07-29 16:57:27 -04:00
Peter Maydell 34e2746bca x86 queue for 4.1
* Rename and fix SnowRidge CPU model (Paul Lai)
 -----BEGIN PGP SIGNATURE-----
 
 iQJIBAABCAAyFiEEWjIv1avE09usz9GqKAeTb5hNxaYFAl0/Gj4UHGVoYWJrb3N0
 QHJlZGhhdC5jb20ACgkQKAeTb5hNxab/Zw/+LQxNhWnDyBSijgiopD8ghdkV/NVs
 eQNBBVkBoiJ8uPaA+sj7891iZnRSrqDFV+9WM2ZUQQTahvA7wZ7PIz1i7PqsICf0
 1uvJb+c5P+PLUDqs9rJTKC5+jocBo/h1gUKFnyMDwLC+atohmge1pz/ZrKiFw03e
 TvKE0ffNUcIsDaPHsF4HgEho9RT8gtlHCFJsnD8A8/ea8Xz1bL6JCMdsCewg+FlK
 u17s+nJ+Jy6U8OeE78TbablMzXIo8yU9fDdzP+2TuGm4Lfv9yBFjJMxynEsLexc4
 CTrp8NtYQNXEZR0KGHpBx2DBXbtsvZS2eoFE5PgPzjh4nXHeNvGISnkWVeM8cmVl
 BtBKK1XLBuIigl4FaJ71EZb19Z7wC719PHa00Y2bDMH7ij6kIymDIcgG0N1D3amN
 vnn11DfVylGmSpVdOYTbD4XPmqj8BwNfzW5qimW+tXFp7p8FjIxzYYuJiaO10mN9
 1QSNB/knOzVrKODx6w9cusGfwQmDwZDpMxJbs9TAf9y9AmCo8O9VxMET77595XpF
 UTH6iSKSJIUus2cUwCPqCb7H/CIJnAYJIi2ePbt0n3lw2dkWuZCWWoeZNkSlB8Nv
 P1/y9omY/tpCkRJrV7CPl7sqLkPUTK79+Blh+V9xwDA/DcughSzsnOEHFhPjWysY
 a0VrXq8Xj/AwDXs=
 =XiSq
 -----END PGP SIGNATURE-----

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

x86 queue for 4.1

* Rename and fix SnowRidge CPU model (Paul Lai)

# gpg: Signature made Mon 29 Jul 2019 17:09:34 BST
# gpg:                using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
# gpg:                issuer "ehabkost@redhat.com"
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full]
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-next-pull-request:
  i386: Fix Snowridge CPU model name and features

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-29 17:11:18 +01:00
Paul Lai ff656fcd33 i386: Fix Snowridge CPU model name and features
Changing the name to Snowridge from SnowRidge-Server.
There is no client model of Snowridge, so "-Server" is unnecessary.

Removing CPUID_EXT_VMX from Snowridge cpu feature list.

Signed-off-by: Paul Lai <paul.c.lai@intel.com>
Tested-by: Tao3 Xu <tao3.xu@intel.com>
Message-Id: <20190716155808.25010-1-paul.c.lai@intel.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-07-29 13:08:02 -03:00
Peter Maydell 893dc8300c -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
 
 iQEcBAABAgAGBQJdPq64AAoJEO8Ells5jWIR790H/RVKgnVALMyXYQ7l1ftVRvzA
 IJ6o8LHS2MlSbcyh182/tRl2LHGDEnnu3YfktocwnuRVQauS5QOebLwUB8oA41Uf
 LeLeVmxQtQE/7b1czQjxCl9jCnaY3tmkAAhkEOT/cXBrM6JlujgEWS8cKi3jqbMS
 grGpeOKCjZX4F3HI47J2Tgij1KKTOz/Roj+mqzC1+o9twN9k32W0DRovTnGWUu09
 6vzSS8UkfdyTfQk+OCVaxloXP3CMqKMeWNsWTRSk+yKbk7kKBoW3goF5N3AAjEl6
 5JYcAqP8suhaYQalk+6Q3XFPy7wMPOZAmRKyK49eGyXimim8zJals/fZiSDyC0w=
 =cM2i
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging

# gpg: Signature made Mon 29 Jul 2019 09:30:48 BST
# gpg:                using RSA key EF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211

* remotes/jasowang/tags/net-pull-request:
  net/colo-compare.c: Fix memory leak and code style issue.
  net: tap: replace snprintf with g_strdup_printf calls
  qemu-bridge-helper: move repeating code in parse_acl_file
  qemu-bridge-helper: restrict interface name to IFNAMSIZ
  e1000: don't raise interrupt in pre_save()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-29 12:04:53 +01:00
Peter Maydell 08831f67d3 ppc patch queue (for 4.1) 2019-07-28
Here's a pull request for qemu-4.1, which I hope will be the last from
 the ppc tree.  This applies a couple of last minute fixes for the XIVE
 code.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAl09Q8MACgkQbDjKyiDZ
 s5IxcA//U+2ooozi128VDRFH7JUHqDs+riCE9Pz87NSmu54+/QqI9JeH2RlahXLW
 lQMXAz0kPY5mb42oYgOYldSRRGfWwtnJvgtjyMa6lASQ6M84w005mbRNDdfP5/uA
 n/JSXEJbupfWKxsBC4HNrLv13HcfCUp66JGZbrHxM7L2yb3GoNmC1yCqcxfEDq8w
 a5TxB6MK1k/BrXJdImdNxYCF43kyLJvRT3it0n1ZGn0iqebrOx8KF/zuyPTbE8Sl
 rlJBEAnxUceYB046a5C2WaZ2DgprHW8dUofNADQ+3dOkfQkc7DyXNwLDjzguV9si
 DBvEpi1yGliJTzH3UhJUWrflJ6ceYY937ZlDMiLunY1JYlQ5J8D7+FAt6Z19Fxe4
 APD+AbB4DcNY8nfynSB1sdKwSD4++JAANznqegHbKYNr8g2InTMaeiyrGKni1eA5
 sl1QLnUHD8BMfULgyKDRmxiS6R1wp5k2QhLBDMmNzLK7WKU8hMNKcwLkanVRgfw6
 3hgC0fNeml7ZEMdWZ/re4UADrGXeBuURw+4+gGlJxzQq4wPBC0ZfFfgW0W6n/9T1
 XEx3m0aXgx2F+Yu/kivvqEgSqqQVOsjj+s+krkWiIHoaXeIppe4RrqBnWLbu+b1b
 XXW0C+09PqgXGJA0noKAbhWJoX9JrWxtOfFCTH4k+E6AS+kOPog=
 =YqKA
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.1-20190728' into staging

ppc patch queue (for 4.1) 2019-07-28

Here's a pull request for qemu-4.1, which I hope will be the last from
the ppc tree.  This applies a couple of last minute fixes for the XIVE
code.

# gpg: Signature made Sun 28 Jul 2019 07:42:11 BST
# gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
# gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full]
# gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full]
# gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" [full]
# gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>" [unknown]
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-4.1-20190728:
  xics/kvm: Fix fallback to emulated XICS
  spapr/irq: Inform the user when falling back to emulated IC

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-29 11:34:54 +01:00
Peter Maydell 5132f6ea62 RISC-V Patch for 4.1-rc3
This contains a single patch that fixes the warning introduced as part
 of the OpenSBI integration.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEAM520YNJYN/OiG3470yhUCzLq0EFAl07hvMTHHBhbG1lckBk
 YWJiZWx0LmNvbQAKCRDvTKFQLMurQQ85D/9DURex3sBcgszAlfsMMkqAfKnSko+E
 O0nl5xpvPibo8j8RR6cyn6hZoUHZc70tR1OK5EtKsaJx44c0JPxwQJJs8mS9cVZc
 4aKGVHBfXlfNrLli7uAUNsTI3pAcc/dxlCP8hXfvuqXWzNPDJto1Uq06KMm9jAPx
 31m9MYTZJPp/ig6CbkAc/8OO75SbJan6CtPOQ4goMXuMnlGNTpuuboS8/MPdIMwm
 51WR+/rwYlngb29ldIi6kAZw8jekwB7RIj1L9tTMfDlFc6ASXF1bTksm1euwNS2Z
 zmIwQmT5A2RNkEvN0KABtH8wopYc7QA3d4rgL3i1PLMtWEAbFFi8RuHzNc4MB18W
 gVPHkSWKiyBqly1EkPv43H4HwbgsRZjhCkd6WEvk5wXuuT8tJe1KjQj/LmXPYFfO
 e/0k/BKdyvG45WYeLk3cp3xZCzvjYer3PuLxuTRx0xN8rzqrE7Z+t/60ERBxBPUg
 TvOPLh4Zb4EIDk0q4szvoSsRB6pBhcO09bN2a+JTT29tu/ZdMhlei3XYB4ot5tBm
 +szgGzwQrEa0X8gtLsrT4WMW1XIXNfzscdKCBlI6kLAjzmslolZPF3Ogz09g7VMg
 KtSnzdIp38DF1e/WFeOp2NA2wUuLOZTDIYnw4eJpFm/Z9bpK2mLPfYnzXRCooN9r
 XM7965OL9L5zvg==
 =j5RK
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-4.1-rc3' into staging

RISC-V Patch for 4.1-rc3

This contains a single patch that fixes the warning introduced as part
of the OpenSBI integration.

# gpg: Signature made Sat 27 Jul 2019 00:04:19 BST
# gpg:                using RSA key 00CE76D1834960DFCE886DF8EF4CA1502CCBAB41
# gpg:                issuer "palmer@dabbelt.com"
# gpg: Good signature from "Palmer Dabbelt <palmer@dabbelt.com>" [unknown]
# gpg:                 aka "Palmer Dabbelt <palmer@sifive.com>" [unknown]
# 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: 00CE 76D1 8349 60DF CE88  6DF8 EF4C A150 2CCB AB41

* remotes/palmer/tags/riscv-for-master-4.1-rc3:
  riscv/boot: Fixup the RISC-V firmware warning

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-29 10:14:24 +01:00
Zhang Chen f77bed14f0 net/colo-compare.c: Fix memory leak and code style issue.
This patch to fix the origin "char *data" memory leak, code style issue
and add necessary check here.
Reported-by: Coverity (CID 1402785)

Signed-off-by: Zhang Chen <chen.zhang@intel.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2019-07-29 16:29:30 +08:00
Prasad J Pandit 389abe1dd1 net: tap: replace snprintf with g_strdup_printf calls
When invoking qemu-bridge-helper in 'net_bridge_run_helper',
instead of using fixed sized buffers, use dynamically allocated
ones initialised and returned by g_strdup_printf().

Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2019-07-29 16:29:30 +08:00
Prasad J Pandit 3283dde4b5 qemu-bridge-helper: move repeating code in parse_acl_file
Move repeating error handling sequence in parse_acl_file routine
to an 'err' label.

Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2019-07-29 16:29:30 +08:00
Prasad J Pandit 6f5d867122 qemu-bridge-helper: restrict interface name to IFNAMSIZ
The network interface name in Linux is defined to be of size
IFNAMSIZ(=16), including the terminating null('\0') byte.
The same is applied to interface names read from 'bridge.conf'
file to form ACL rules. If user supplied '--br=bridge' name
is not restricted to the same length, it could lead to ACL bypass
issue. Restrict interface name to IFNAMSIZ, including null byte.

Reported-by: Riccardo Schirone <rschiron@redhat.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2019-07-29 16:29:30 +08:00
Jason Wang f46efa9b08 e1000: don't raise interrupt in pre_save()
We should not raise any interrupt after VM has been stopped but this
is what e1000 currently did when mit timer is active in
pre_save(). Fixing this by scheduling a timer in post_load() which can
make sure the interrupt was raised when VM is running.

Reported-and-tested-by: Longpeng <longpeng2@huawei.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2019-07-29 16:29:30 +08:00
Greg Kurz 8d216d8c53 xics/kvm: Fix fallback to emulated XICS
Commit 4812f26152 tried to fix rollback path of xics_kvm_connect() but
it isn't enough. If we fail to create the KVM device, the guest fails
to boot later on with:

[    0.010817] pci 0000:00:00.0: Adding to iommu group 0
[    0.010863] irq: unknown-1 didn't like hwirq-0x1200 to VIRQ17 mapping (rc=-22)
[    0.010923] pci 0000:00:01.0: Adding to iommu group 0
[    0.010968] irq: unknown-1 didn't like hwirq-0x1201 to VIRQ17 mapping (rc=-22)
[    0.011543] EEH: No capable adapters found
[    0.011597] irq: unknown-1 didn't like hwirq-0x1000 to VIRQ17 mapping (rc=-22)
[    0.011651] audit: type=2000 audit(1563977526.000:1): state=initialized audit_enabled=0 res=1
[    0.011703] ------------[ cut here ]------------
[    0.011729] event-sources: Unable to allocate interrupt number for /event-sources/epow-events
[    0.011776] WARNING: CPU: 0 PID: 1 at arch/powerpc/platforms/pseries/event_sources.c:34 request_event_sources_irqs+0xbc/0x150
[    0.011828] Modules linked in:
[    0.011850] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.1.17-300.fc30.ppc64le #1
[    0.011886] NIP:  c0000000000d4fac LR: c0000000000d4fa8 CTR: c0000000018f0000
[    0.011923] REGS: c00000001e4c38d0 TRAP: 0700   Not tainted  (5.1.17-300.fc30.ppc64le)
[    0.011966] MSR:  8000000002029033 <SF,VEC,EE,ME,IR,DR,RI,LE>  CR: 28000284  XER: 20040000
[    0.012012] CFAR: c00000000011b42c IRQMASK: 0
[    0.012012] GPR00: c0000000000d4fa8 c00000001e4c3b60 c0000000015fc400 0000000000000051
[    0.012012] GPR04: 0000000000000001 0000000000000000 0000000000000081 772d6576656e7473
[    0.012012] GPR08: 000000001edf0000 c0000000014d4830 c0000000014d4830 6e6576652f20726f
[    0.012012] GPR12: 0000000000000000 c0000000018f0000 c000000000010bf0 0000000000000000
[    0.012012] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    0.012012] GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    0.012012] GPR24: 0000000000000000 0000000000000000 c000000000ebbf00 c0000000000d5570
[    0.012012] GPR28: c000000000ebc008 c00000001fff8248 0000000000000000 0000000000000000
[    0.012372] NIP [c0000000000d4fac] request_event_sources_irqs+0xbc/0x150
[    0.012409] LR [c0000000000d4fa8] request_event_sources_irqs+0xb8/0x150
[    0.012445] Call Trace:
[    0.012462] [c00000001e4c3b60] [c0000000000d4fa8] request_event_sources_irqs+0xb8/0x150 (unreliable)
[    0.012513] [c00000001e4c3bf0] [c000000001042848] __machine_initcall_pseries_init_ras_IRQ+0xc8/0xf8
[    0.012563] [c00000001e4c3c20] [c000000000010810] do_one_initcall+0x60/0x254
[    0.012611] [c00000001e4c3cf0] [c000000001024538] kernel_init_freeable+0x35c/0x444
[    0.012655] [c00000001e4c3db0] [c000000000010c14] kernel_init+0x2c/0x148
[    0.012693] [c00000001e4c3e20] [c00000000000bdc4] ret_from_kernel_thread+0x5c/0x78
[    0.012736] Instruction dump:
[    0.012759] 38a00000 7c7f1b78 7f64db78 2c1f0000 2fbf0000 78630020 4180002c 409effa8
[    0.012805] 7fa4eb78 7f43d378 48046421 60000000 <0fe00000> 3bde0001 2c1e0010 7fde07b4
[    0.012851] ---[ end trace aa5785707323fad3 ]---

This happens because QEMU fell back on XICS emulation but didn't unregister
the RTAS calls from KVM. The emulated RTAS calls are hence never called and
the KVM ones return an error to the guest since the KVM device is absent.

The sanity checks in xics_kvm_disconnect() are abusive since we're freeing
the KVM device. Simply drop them.

Fixes: 4812f26152 "xics/kvm: Add proper rollback to xics_kvm_init()"
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <156398744035.546975.7029414194633598474.stgit@bahia.lan>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-07-28 11:50:26 +10:00
Greg Kurz f5bda01066 spapr/irq: Inform the user when falling back to emulated IC
Just to give an indication to the user that the error condition is
handled and how.

Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <156398743479.546975.14566809803480887488.stgit@bahia.lan>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-07-28 11:50:26 +10:00
Alistair Francis 75ea2529cf
riscv/boot: Fixup the RISC-V firmware warning
Fix a typo in the warning message displayed to users, don't print the
message when running inside qtest and don't mention a specific QEMU
version for the deprecation.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2019-07-26 16:03:48 -07:00
Peter Maydell 0c6f3e948c Fix multi-threaded go runtime crash
-----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAl07OYgSHGxhdXJlbnRA
 dml2aWVyLmV1AAoJEPMMOL0/L748pj0P/R7v5AhooXuIMfbOfXR1pn2c3P7lxyEV
 uPZD+Q+VRHqATQoSOdFlX8Ky4B4vC8VMl/1ruABhwNOJtTbRdpdQtw4mG05qSyt6
 MZLq2diNgYRlc91Mt8gPrNc4jW7keeOONWXDCUXcJG22uLaoV+h4AHXiu/Y29whu
 3ESkr9fgcg4JgPggN8+IpBdfsEjiKZTvmKi4d0/61J9Umbv8MMeHpC1g84P6K17L
 xEjw7JlEnl65SwfAx96iEQuBonCzMexItlVcl6k+QBuJLXcss3m9P8tq6FGQMqN0
 cDgcTq3oEykaiY6ZLIQSwah73ldFmwmQcZSicAdDxlPqQQeDm31Vj4RFL6lydZDa
 rkR2DXqeBSrimput6/amQJI2NBFRq0b/zle1MOZG4ygHiXmoxrIcsFYM2O0UJhw/
 s3AmmLV7J9cMLDv4TUh5AH/JQhJjRSK28KgZSkEvbV+S9a5MaLCp9B8gF02KAoJE
 M6MFUKk69MG3m/5WuxnIhDxSMpWkAUTBwQP65slrXy3rXvr2ryQ3DbP1IzH/kfDO
 kNvoryfDvaPeqQx8xt8kdKWc3b8Qd9TVNSO+ZBtPaDpfVHmyOXDkkm2fkFEwSj+0
 jbW8RtSTgyZrxWpK6bsPFoIYR/XImWQjBvPhYH0UV+SNCp5sDUabhBvPai2ZyjRt
 TsvKvvBthZPi
 =KSrK
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-4.1-pull-request' into staging

Fix multi-threaded go runtime crash

# gpg: Signature made Fri 26 Jul 2019 18:34:00 BST
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-4.1-pull-request:
  linux-user: Make sigaltstack stacks per-thread

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-26 18:36:05 +01:00
Peter Maydell 5bfce0b74f linux-user: Make sigaltstack stacks per-thread
The alternate signal stack set up by the sigaltstack syscall is
supposed to be per-thread.  We were incorrectly implementing it as
process-wide.  This causes problems for guest binaries that rely on
this.  Notably the Go runtime does, and so we were seeing crashes
caused by races where two guest threads might incorrectly both
execute on the same stack simultaneously.

Replace the global target_sigaltstack_used with a field
sigaltstack_used in the TaskState, and make all the references to the
old global instead get a pointer to the TaskState and use the field.

Fixes: https://bugs.launchpad.net/qemu/+bug/1696773
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20190725131645.19501-1-peter.maydell@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2019-07-26 19:24:33 +02:00
Peter Maydell fff3159900 target-arm queue:
* Fix broken migration on pl330 device
  * Fix broken migration on stellaris-input device
  * Add type checks to vmstate varry macros to avoid this class of bugs
  * hw/arm/boot: Fix some remaining cases where we would put the
    initrd on top of the kernel image
 -----BEGIN PGP SIGNATURE-----
 
 iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAl07GfUZHHBldGVyLm1h
 eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3lCNEACw3dTka4tHyObmf3a5KYcO
 tbPJPGXKexYW+Zx681qtqDN1pe4/2U42rSHjYYeOFoKMXrDc1Jr30upPxVsek8yk
 nUmYIZo89G4nP5G0EYWhwYZbIT7qsrT8mtx4KezS1l6pi8w+UVDb9N9TmcdcjvBP
 fxqofNczeoNKZz2T3229G2ENyhbU9Pq0h5LpvT7zNHAS5IE7Du2eb0PWQ1AH7cJN
 c8NY/24vNSzbxf0Zj9jFaKSc1LbxBgvqqb2KRTcVMl1pcIgY+Ljc+lN+bJVHPSZ/
 fx9zBbUh5OF3YNipYIRcjPOGTfKeGu9OyeDhAcI38QT00NfnjAWXcxjITijQBWnW
 IMsAbmLsamx/BvqW3D+F0kbRpJu4c+2Ge465PnvX7xduivm1kWoJM4Q8YvZWI5Y7
 TVLfvjNtg9sjOB5tmSNzlhRj7PrsyELhR2p9YWCqZKQmc0jRaQjYtRRduRKREfdT
 Vv/qTbQmiNMAxyP3v6C1jhk/t+NZ5l8PBwr1mYFYSUj4uhz09ckVatimJsd11hiZ
 TZRfBFIjKDFGO6/FeVBgN5lirlmlWF/HIbijGqh5A25eUsBMhitrkHIoDZxqnneG
 cdLpYB1SAT+oY97KYFynrhW9OErSrKHs5Of5c443CgWoZb7Q9rOhyJUqAdDf4MaZ
 LzcRBfrNoD4042GihD9XCg==
 =OwrX
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190726' into staging

target-arm queue:
 * Fix broken migration on pl330 device
 * Fix broken migration on stellaris-input device
 * Add type checks to vmstate varry macros to avoid this class of bugs
 * hw/arm/boot: Fix some remaining cases where we would put the
   initrd on top of the kernel image

# gpg: Signature made Fri 26 Jul 2019 16:19:17 BST
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* remotes/pmaydell/tags/pull-target-arm-20190726:
  hw/arm/boot: Further improve initrd positioning code
  hw/arm/boot: Rename elf_{low, high}_addr to image_{low, high}_addr
  vmstate.h: Type check VMSTATE_STRUCT_VARRAY macros
  stellaris_input: Fix vmstate description of buttons field
  pl330: fix vmstate description

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-26 16:23:07 +01:00
Peter Maydell 67505c114e hw/arm/boot: Further improve initrd positioning code
In commit e6b2b20d97 we made the boot loader code try to avoid
putting the initrd on top of the kernel.  However the expression used
to calculate the start of the initrd:

    info->initrd_start = info->loader_start +
        MAX(MIN(info->ram_size / 2, 128 * 1024 * 1024), kernel_size);

incorrectly uses 'kernel_size' as the offset within RAM of the
highest address to avoid.  This is incorrect because the kernel
doesn't start at address 0, but slightly higher than that.  This
means that we can still incorrectly end up overlaying the initrd on
the kernel in some cases, for example:

* The kernel's image_size is 0x0a7a8000
* The kernel was loaded at   0x40080000
* The end of the kernel is   0x4A828000
* The DTB was loaded at      0x4a800000

To get this right we need to track the actual highest address used
by the kernel and use that rather than kernel_size. We already
set image_low_addr and image_high_addr for ELF images; set them
also for the various other image types we support, and then use
image_high_addr as the lowest allowed address for the initrd.
(We don't use image_low_addr, but we set it for consistency
with the existing code path for ELF files.)

Fixes: e6b2b20d97
Reported-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Message-id: 20190722151804.25467-3-peter.maydell@linaro.org
2019-07-26 16:17:56 +01:00
Peter Maydell d5fef92f6a hw/arm/boot: Rename elf_{low, high}_addr to image_{low, high}_addr
Rename the elf_low_addr and elf_high_addr variables to image_low_addr
and image_high_addr -- in the next commit we will extend them to
be set for other kinds of image file and not just ELF files.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Message-id: 20190722151804.25467-2-peter.maydell@linaro.org
2019-07-26 16:17:56 +01:00
Peter Maydell 0c413ba0d8 vmstate.h: Type check VMSTATE_STRUCT_VARRAY macros
The VMSTATE_STRUCT_VARRAY_UINT32 macro is intended to handle
migrating a field which is an array of structs, but where instead of
migrating the entire array we only migrate a variable number of
elements of it.

The VMSTATE_STRUCT_VARRAY_POINTER_UINT32 macro is intended to handle
migrating a field which is of pointer type, and points to a
dynamically allocated array of structs of variable size.

We weren't actually checking that the field passed to
VMSTATE_STRUCT_VARRAY_UINT32 really is an array, with the result that
accidentally using it where the _POINTER_ macro was intended would
compile but silently corrupt memory on migration.

Add type-checking that enforces that the field passed in is
really of the right array type. This applies to all the VMSTATE
macros which use flags including VMS_VARRAY_* but not VMS_POINTER.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
Tested-by: Damien Hedde <damien.hedde@greensocs.com>
Message-id: 20190725163710.11703-3-peter.maydell@linaro.org
2019-07-26 16:17:56 +01:00
Peter Maydell 372e458ebc stellaris_input: Fix vmstate description of buttons field
gamepad_state::buttons is a pointer to an array of structs,
not an array of structs, so should be declared in the vmstate
with VMSTATE_STRUCT_VARRAY_POINTER_INT32; otherwise we
corrupt memory on incoming migration.

We bump the vmstate version field as the easiest way to
deal with the migration break, since migration wouldn't have
worked reliably before anyway.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
Message-id: 20190725163710.11703-2-peter.maydell@linaro.org
2019-07-26 16:17:56 +01:00
Damien Hedde 830fc739d0 pl330: fix vmstate description
Fix the pl330 main and queue vmstate description.
There were missing POINTER flags causing crashes during
incoming migration because:
+ PL330State chan field is a pointer to an array
+ PL330Queue queue field is a pointer to an array

Also bump corresponding vmsd version numbers.

Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: 20190724143553.21557-1-damien.hedde@greensocs.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-26 15:40:27 +01:00
Peter Maydell c985266ea5 MAINTAINERS update for vfio-ccw
-----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEw9DWbcNiT/aowBjO3s9rk8bwL68FAl064oISHGNvaHVja0By
 ZWRoYXQuY29tAAoJEN7Pa5PG8C+vPZUQAJFhqtkAFXCChUeNlNoCFAERQ82YEgEj
 WMPM6IFUseTxf3prVq5lB5qoMv6e9yvMpyuG+orUJEFI3qkGaNcqy2FA+qb+xfza
 F3lZeD90N59UfVyff9ZN0M8xPtjzGlD0YN+vmgpYcv3zUjZNdwvBEmPN2U8+yL7o
 tkikAQDK/0RpYTvb5BFKM4d1cFy+7eiQvf3eDCf8JcHX9RaR2KrSsN09uxemyXmd
 iZl7Ijr7uRSzNQrHgDrf8AG92ydIwfDGdj0KPO7ZY4FOVB7FzONBlVbwRgnLjEUp
 AhwJ7WpQURJ5mHSCuq2+kb/qqUD9DB+6nfxG9846a+5lT/U/G3J0E7yRq3lcox7X
 vliKs1Hnbur7wfFyBDZX3hir1Ipda19eFfgqRZVddzbwZh77ngVBwtNY2/L8YEKL
 ArDJACp3M1qS+FiyHr3SBsZU7I/1LtLBHSJ8IYI0CBecDavMbv8RZYIeiqXXOrr5
 O9BXUFhwJvKJJzfwrP5sn6Erg0LFHjlvd1tuDNu0lb5nBZ6q7B43s0fMVvr6HbeL
 OQOxixRuQ9+RNFmc+i01Wvtgn7iwFARe+HtsPjzCDdUCX3+Rgp+oW+zBSWcbbcYl
 yze/1kZ/Pm+jZ846XB7kwB4/kyb4/ja0RFRzc3PpBfqOer+QR7ZVmH1i+XPcQK2T
 5hs84IOWFE7h
 =NxUf
 -----END PGP SIGNATURE-----

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

MAINTAINERS update for vfio-ccw

# gpg: Signature made Fri 26 Jul 2019 12:22:42 BST
# gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
# gpg:                issuer "cohuck@redhat.com"
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [unknown]
# gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [unknown]
# gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [unknown]
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20190726:
  MAINTAINERS: vfio-ccw: Remove myself as the maintainer

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-26 13:52:06 +01:00
Peter Maydell 9246fade39 Merge tpm 2019/07/25 v1
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJdOc2GAAoJEHWtZYAqC0IRYw4IAMnwlPSQKe7LvVA3ye4FYFRM
 5g2PPZbveQVHGGEIuCfPkDRRGdiXPIxEdX+Z5pUGYZhYbk9ZBw/iBjCtVsyEJn1r
 b1/gwQYytZ/oSk2ENLtOmYN0grZ27J2LmAjBEH4Acal3NT/Pk89FtnVVLydxY9/h
 Fl5een8lT7c5bi4dayEXuVz88TOqsTxEUm84IexBNMh0wi9n/yGdib0Jr48HTunw
 WNB0vGzK/aeFApEqEsJVrL/SRW3F4xzFkArwHgMMyLhgVps3RnyAqsNPIq9Opln/
 7QMv7xd7DRf3lwqDHW5Uo8BdPx5Z5b3rb/jvU2SYxkvb8hrSsg7NiRMoyH8uoVY=
 =hU9e
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2019-07-25-1' into staging

Merge tpm 2019/07/25 v1

# gpg: Signature made Thu 25 Jul 2019 16:40:54 BST
# gpg:                using RSA key 75AD65802A0B4211
# gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211

* remotes/stefanberger/tags/pull-tpm-2019-07-25-1:
  tpm_emulator: Translate TPM error codes to strings
  tpm: Exit in reset when backend indicates failure

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-26 10:53:20 +01:00
Peter Maydell 61c1e6a97d virtio, pc: fixes, cleanups
A bunch of fixes all over the place.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJdOciFAAoJECgfDbjSjVRp/FwH/jNag2BkBfyvTNibuZi0V4uH
 1nXmZQI9gQye6eDmkg0T0fl+8zpMNO7OIGRjhOemMOpfJ1yAYrkFI4OrbTV40lOe
 UvH/6s8m5DlWPXrVvkv52esLPrV9cV4kULpS0yDfngfJ7CuQTMc/er9ZBav38iSG
 kDH92LTWqIoZq08JUkdOxqjl5me8vnvQHieo/SgFNhuJon+RkGZvcN7j4zj/l1cg
 ozeXoyBve27TnirGfgjY7/z3kTDTAKW8wWFj/gV2TllmPx4ReH6a6IYwPWrZaOXA
 m4ZhTK0D8C2UPtbseHrfriYHkuL4eBK95OJvXc3vC/w14ZmP4tuaipOL7If9oRk=
 =oU7D
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

virtio, pc: fixes, cleanups

A bunch of fixes all over the place.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Thu 25 Jul 2019 16:19:33 BST
# gpg:                using RSA key 281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  virtio-balloon: free pbp more aggressively
  virtio-balloon: don't track subpages for the PBP
  virtio-balloon: Use temporary PBP only
  virtio-balloon: Rework pbp tracking data
  virtio-balloon: Better names for offset variables in inflate/deflate code
  virtio-balloon: Simplify deflate with pbp
  virtio-balloon: Fix QEMU crashes on pagesize > BALLOON_PAGE_SIZE
  virtio-balloon: Fix wrong sign extension of PFNs
  i386/acpi: show PCI Express bus on pxb-pcie expanders
  ioapic: kvm: Skip route updates for masked pins
  i386/acpi: fix gint overflow in crs_range_compare
  docs: clarify multiqueue vs multiple virtqueues

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-07-25 16:38:24 +01:00
Stefan Berger 7e095e84ba tpm_emulator: Translate TPM error codes to strings
Implement a function to translate TPM error codes to strings so that
at least the most common error codes can be translated to human
readable strings.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-07-25 11:37:10 -04:00
Michael S. Tsirkin 1b47b37c33 virtio-balloon: free pbp more aggressively
Previous patches switched to a temporary pbp but that does not go far
enough: after device uses a buffer, guest is free to reuse it, so
tracking the page and freeing it later is wrong.

Free and reset the pbp after we push each element.

Fixes: ed48c59875 ("virtio-balloon: Safely handle BALLOON_PAGE_SIZE < host page size")
Cc: qemu-stable@nongnu.org #v4.0.0
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-07-25 11:19:25 -04:00
Stefan Berger bcfd16fe26 tpm: Exit in reset when backend indicates failure
Exit() in the frontend reset function when the backend indicates
intialization failure.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-07-25 11:04:54 -04:00
David Hildenbrand 9a7ca8a7c9 virtio-balloon: don't track subpages for the PBP
As ramblocks cannot get removed/readded while we are processing a bulk
of inflation requests, there is no more need to track the page size
in form of the number of subpages.

Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190725113638.4702-8-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-07-25 07:58:10 -04:00
David Hildenbrand a8cd64d488 virtio-balloon: Use temporary PBP only
We still have multiple issues in the current code
- The PBP is not freed during unrealize()
- The PBP is not reset on device resets: After a reset, the PBP is stale.
- We are not indicating VIRTIO_BALLOON_F_MUST_TELL_HOST, therefore
  guests (esp. legacy guests) will reuse pages without deflating,
  turning the PBP stale. Adding that would require compat handling.

Instead, let's use the PBP only temporarily, when processing one bulk of
inflation requests. This will keep guest_page_size > 4k working (with
Linux guests). There is nothing to do for deflation requests anymore.
The pbp is only used for a limited amount of time.

Fixes: ed48c59875 ("virtio-balloon: Safely handle BALLOON_PAGE_SIZE < host page size")
Cc: qemu-stable@nongnu.org #v4.0.0
Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190722134108.22151-7-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
2019-07-25 07:58:03 -04:00
David Hildenbrand 1c5cfc2b71 virtio-balloon: Rework pbp tracking data
Using the address of a RAMBlock to test for a matching pbp is not really
safe. Instead, let's use the guest physical address of the base page
along with the page size (via the number of subpages).

Also, let's allocate the bitmap separately. This makes the code
easier to read and maintain - we can reuse bitmap_new().

Prepare the code to move the PBP out of the device.

Fixes: ed48c59875 ("virtio-balloon: Safely handle BALLOON_PAGE_SIZE < host page size")
Fixes: b27b323914 ("virtio-balloon: Fix possible guest memory corruption with inflates & deflates")
Cc: qemu-stable@nongnu.org #v4.0.0
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190722134108.22151-6-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-07-25 07:57:59 -04:00
David Hildenbrand e6129b271b virtio-balloon: Better names for offset variables in inflate/deflate code
"host_page_base" is really confusing, let's make this clearer, also
rename the other offsets to indicate to which base they apply.

offset -> mr_offset
ram_offset -> rb_offset
host_page_base -> rb_aligned_offset

While at it, use QEMU_ALIGN_DOWN() instead of a handcrafted computation
and move the computation to the place where it is needed.

Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190722134108.22151-5-david@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-07-25 07:57:57 -04:00