Commit graph

68806 commits

Author SHA1 Message Date
Matt Borgerson 6c11490a35 apu: Add license for ADPCM decoder files 2019-07-12 18:42:03 -07:00
Matt Borgerson dd20a673ed apu: Fix unused var warnings used only in debug prints 2019-07-12 18:42:03 -07:00
Matt Borgerson ededef3b38 apu: Use MCPX_DPRINTF instead of printf 2019-07-12 18:42:03 -07:00
Matt Borgerson 3ae172c209 apu: Fix indentation for step_envelope 2019-07-12 18:42:03 -07:00
Matt Borgerson e90304a223 apu: Buffer playback cleanup and build fixes 2019-07-12 18:42:03 -07:00
Matt Borgerson 4073c3200e apu: Import JayFoxRox's basic buffer sampling code
This patch adds the code necessary to perform basic buffer sampling for
HW voices. Includes new register definitions, support for a few new
methods, envelope stepping, ADPCM decoding, and the individual voice
buffer sampling to be added to the VP output mixbufs. This code does not
add system audio playback nor streaming support.

Some portions are disabled as they will need to be fixed up for
compilation in this new tree.

This code originates from Jannik Vogel's 2017 audio branch. Copied into
the current, recently LGPL-licensed version of this file with
permission.

https://github.com/JayFoxRox/xqemu-espes/commits/audio
2019-07-12 18:42:03 -07:00
Lucas d1e77ec0c4 xid: Swap SDL binding for black and white buttons 2019-07-05 15:14:08 -07:00
Matt Borgerson 3b29f0888a build: Specify Xenial (16.04) for TravisCI 2019-07-04 12:11:37 -07:00
Matt Borgerson 8d17b4d772 smbus: Fixup potential buffer oob on ADM1032 2019-07-04 12:11:28 -07:00
Matt Borgerson 0550699026 Merge branch 'master' into merge-v4.0.0 2019-07-04 00:59:25 -07:00
Matt Borgerson 15331ac2da build: Update deps, always update homebrew 2019-07-04 00:57:49 -07:00
Stefan Schmidt e8680193c6 build.sh: Fix macOS; add path to libffi pkgconfig to PKG_CONFIG_PATH 2019-07-04 00:57:06 -07:00
Stefan Schmidt 4147b42afd ci: Update homebrew on macOS before installing packages 2019-07-04 00:57:06 -07:00
Matt Borgerson 130965646a build: Fixup Git dirty detector 2019-07-04 00:20:25 -07:00
Matt Borgerson 973a0c0409 build: Fixup Git commit detector
For XQEMU, we do not currently use dotted-version notation style
tag names, instead we simply use the raw commit-id. This returns
the Makefile to the simple commit-id style.
2019-07-04 00:14:56 -07:00
Matt Borgerson bc049f43e1 smbus: Fixup smbus_read/write_block calls 2019-07-04 00:04:00 -07:00
Matt Borgerson bc4bc54621 hvf: Use target-specific printf formatters 2019-07-04 00:04:00 -07:00
Matt Borgerson ec30903326 build: Remove --with-sdlabi option 2019-07-04 00:04:00 -07:00
Matt Borgerson 5054f03d10 hvf: Disable dirty tracking in hvf_log_sync
This seems to be causing an issue resulting in HV_ERRORs. Needs
further debugging, but this seems to do the trick for now.
2019-07-04 00:04:00 -07:00
Matt Borgerson 1c7025faf6 hvf: Fixup get_reg_ref prototype 2019-07-04 00:04:00 -07:00
Matt Borgerson 68bfbf65a3 smbus: Cleanup SMC device and track cmd 2019-07-04 00:04:00 -07:00
Matt Borgerson 1f2ae93e5c smbus: Cleanup CX25871 device and track cmd 2019-07-04 00:04:00 -07:00
Matt Borgerson edf04b1364 smbus: Cleanup ADM1032 device and track cmd 2019-07-04 00:04:00 -07:00
Matt Borgerson ab5027a5ea smbus: Fixup headers 2019-07-04 00:04:00 -07:00
Matt Borgerson 818f31a04f chihiro: Fixup headers 2019-07-04 00:04:00 -07:00
Matt Borgerson fc559b1aed lpc: Update qemu_chr_new call arguments 2019-07-04 00:04:00 -07:00
Matt Borgerson 28dd7de81d xbox_pci: Replace deprecated init func with realize 2019-07-04 00:04:00 -07:00
Matt Borgerson 00c2a0c5b2 xbox: Fixup headers 2019-07-04 00:04:00 -07:00
Matt Borgerson 67359423a6 xbox: Rename pit to pit_enabled per pcms change 2019-07-03 23:42:53 -07:00
Matt Borgerson a1b119ce44 v4.0.0 release
-----BEGIN PGP SIGNATURE-----
 
 iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAly/PhEZHHBldGVyLm1h
 eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3kAfD/9SnusF4bCaeHG+oq/cRhte
 LbS1uCoSxynMKRvhx+s/tk7kzovW9twChMfE4xVcxHBY9hUFgMLnnq1lrJZ9GN9B
 6zTrO9UDnkAfgkUq9B3lL0b+OVn4QFlcOFUl6U0q9E3zFUiCneLK9cEpw20t+2EL
 78sjrpENms7nCeuUhiwZm00lbn4stY9vAiOZpu8qrg9lzDVaRivK5BrtkutfmDRn
 REHll2gduZp3FNkexiJs73YU+BFZMBXM+PqldU+c4iU4Cq2lUNco+Q4Ks32Q7Nf7
 9/U1j5znW9M4X9jDi8jSU5Bd0rJQMid1h0wV0SrE1PWKJOAvF8w+0FPmEJDERRx/
 W7Pz7+rYr2iOsOyJT4CuJQZUvJmIyMUz7JNVHOh/P8Hmb1PKp7Egy5Kamo2o7slA
 I/5wmI6HDAizyjaV6UL2D8KqfedihZoTS6HmCc2eX75nfa0eauDFKCMwZKOb1FYI
 dldRhOE1wiFKCV/jPEdBNJbE8jH9e5kH3CpcB1vnmphqkmHz1yKIToFgTDGrc8e3
 mj7e67iNG1oIUys/w3zgEUYI6iSbkSyIYv9nlUv8NNSTUKK2kfpUMbJW3FyXrFR2
 QvaaNOYJJHG+x8sCpPwWRBQiix/x5F/s6RKMpRgIa/QYKPwGKniEjgqcGSMdmyxM
 RnuxJvLfYcyAILZx20nCIA==
 =92OI
 -----END PGP SIGNATURE-----

Merge tag 'v4.0.0' into merge-v4.0.0

v4.0.0 release
2019-07-03 22:58:05 -07:00
Jannik Vogel cfef2c3e4a build: Disable unused features 2019-06-22 19:54:20 +01:00
wutno 787012e012 ci: Fix compiling with macOS on travis-ci 2019-05-29 15:21:43 -07:00
wutno 8d05bc917e ci: Stop updating the MSYS2 platform on AppVeyor 2019-05-28 23:49:04 -07:00
wutno dc3bf97fcc ci: Fix MSYS2 upgrade process for AppVeyor 2019-05-28 22:19:30 -07:00
Stefan Schmidt 729e52662f build.sh: Disable GlusterFS support 2019-04-24 15:36:44 -07:00
Peter Maydell 131b9a0570 Update version for v4.0.0 release
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-04-23 17:32:17 +01:00
Peter Maydell eeba63fc7f Update version for v4.0.0-rc4 release
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-04-16 21:53:00 +01:00
Daniel P. Berrangé 375cb86d9f usb-mtp: fix bounds check for guest provided filename
The ObjectInfo struct has a variable length array containing the UTF-16
encoded filename. The number of characters of trailing data is given by
the 'length' field in the struct and this must be validated against the
size of the data packet received from the guest.

Since the data is UTF-16, we must convert the byte count we have to a
character count before validating. This must take care to truncate if
a malicious guest sent an odd number of bytes.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Bandan Das <bsd@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-04-16 20:43:39 +01:00
Peter Maydell dbfc49b69a Block layer patches:
- qcow2: Fix potential corruption for preallocated resize with external data file
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJcteVnAAoJEH8JsnLIjy/WNxMP/1Vca3Ws2lt/lHDqvyQtwbfu
 L0ZAEyZBonoVzxSRgtSj+ZDfgKKTCECDtCAB1mDxFK3GfbvlCDGf20UvOKeDXtLX
 nMfllTnvPOk1lveKjTu82r0aOOnnfaZF6fbJkaV214zipXXQIB1x3J724n+/0kvI
 AlYpgOtskNnAIYAL233IIuktvVJiPJsvsdKGhswcCVSmMcXZ9N+/1wd9sWIdxglW
 YpmkOBZfZRIG6T52ZNXLoeCZdSLpozPJPmAvUbfBdcevOjT2ljQ9Sk+j87mv0SWg
 Bk+Nc7aCC61SPlkjc2A1KtJi68rP6zTFyXMkjC9tXLPf6bMSJVTY8Xv8x8lgscf5
 9xIUhnJHNgILASI6KvJuHjrn0HU4ck4L5k1M3FMrQ/LbnI4wHPHmp4HGLxh/9NnU
 M70uUwVyWgZfFh20D6HvY7bA9Wv5JA3vh9EFwZMn/ZNyKqnAPyIl/DttILgjDEmM
 WItok/l3ri1wXFlaCIWrwm++LJhKFlnyJTfbuHZ96xWYil7cc111ler+WM0h+PFD
 cxsakE1efpOfbBcVNeLzDwNpt1AkxsUQbnTh37dICR7WbqbuXpcmXTb5xK3yYK2P
 WiQRnBZuKk8oGjhBpYtWt/yW5V8hZrZTRNO8u73vz5p+PnPsZFgiVYt2UXnQaPzy
 bKgnpYfa+GrGR/TexOQu
 =ezFB
 -----END PGP SIGNATURE-----

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

Block layer patches:

- qcow2: Fix potential corruption for preallocated resize with external data file

# gpg: Signature made Tue 16 Apr 2019 15:23:35 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:
  qcow2: Fix preallocation bdrv_pwrite to wrong file

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-04-16 15:33:38 +01:00
Kevin Wolf 93e32b3e20 qcow2: Fix preallocation bdrv_pwrite to wrong file
With an external data file, preallocate_co() must write the final byte
to the external data file, not to the qcow2 image file.

This is harmless for preallocation of newly created images (only the
qcow2 file size is increased to the virtual disk size while it should be
much smaller), but with preallocated resize, it could in theory cause
visible corruption if the metadata of the image is larger than the data
(e.g. lots of bitmaps).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2019-04-16 16:23:24 +02:00
Marc-André Lureau a9b305ba29 socket: allow wait=false for client socket
Commit 767abe7 ("chardev: forbid 'wait' option with client sockets")
is a bit too strict. Current libvirt always set wait=false, and will
thus fail to add client chardev.

Make the code more permissive, allowing wait=false with client socket
chardevs. Deprecate usage of 'wait' with client sockets.

Fixes: 767abe7f49
Cc: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20190415163337.2795-1-marcandre.lureau@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-04-16 10:40:43 +01:00
Peter Maydell 677746b39f Slirp updates
Dr. David Alan Gilbert (1):
   slirp: Gcc 9 -O3 fix
 -----BEGIN PGP SIGNATURE-----
 
 iQIyBAABCgAdFiEE5h27FdQXK97JfpLZ21UOifD6VPMFAly0x/MACgkQ21UOifD6
 VPOLBQ/3UNeMla5djuv7ZnsQdGUoaRbZiHRIIFm5S30tpX7DozRd/Wtx9Cyt2+/w
 GsfnNR+7b+rtzfYFqaBlU5RTsd6pqThX9ODcZ/80ecOn8RCgdjeipH7sZpj9wYne
 xjO+23SpWmKgnO798JmJou9w/URX4tmp9tqZJF1722BAbcgd48vIlztHl0gAaypP
 bytSvTmxuTmERLsuKJ6NbrEVM3W19upHEeUuCj3wmB50oU3WCoUcIkolfd7WUQ8D
 lMjkATFMa8lC0+feIo7ICNOeD/9Z9vRn+ffmPj9+Gt8aLI/8akzxIIYNGBKcnT2C
 ERkQFAOlZ34a39xcWMqJOOWFUonM+nEYrw3Fg6CHEREXuRMOp3fV1kKS+xq4jUf+
 miRxqw5jEcPYyxATfYFYcfIXSaKGSlaQ4UGjVANNUN8tLC1FKod5xD3KfDxik+3o
 SeLXrPRNrkHcj1OcpHNzL+mhnMvu9reLWiV/VccmgN6YAugPm19R7r3bLqbcCIkT
 jWzT2/AFg+L+ShAHyZVwbFeepI1CYx2ZstAmpX2VYYg4l7IUfozoOG8SwEn31MI9
 yQ9ZUfe4v8mPIzEMnZlgF9w6gclSfxSR3lKOB1TWnRGgyLIo0GAphQieWNajzM8g
 rUM+b8FGJWlXoLBT2nMOq0Va3zUiqeRTG2iyypBA7aASmYpmdw==
 =qwoq
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging

Slirp updates

Dr. David Alan Gilbert (1):
  slirp: Gcc 9 -O3 fix

# gpg: Signature made Mon 15 Apr 2019 19:05:39 BST
# gpg:                using RSA key E61DBB15D4172BDEC97E92D9DB550E89F0FA54F3
# gpg: Good signature from "Samuel Thibault <samuel.thibault@aquilenet.fr>" [unknown]
# gpg:                 aka "Samuel Thibault <sthibault@debian.org>" [marginal]
# gpg:                 aka "Samuel Thibault <samuel.thibault@gnu.org>" [unknown]
# gpg:                 aka "Samuel Thibault <samuel.thibault@inria.fr>" [marginal]
# gpg:                 aka "Samuel Thibault <samuel.thibault@labri.fr>" [marginal]
# gpg:                 aka "Samuel Thibault <samuel.thibault@ens-lyon.org>" [marginal]
# gpg:                 aka "Samuel Thibault <samuel.thibault@u-bordeaux.fr>" [unknown]
# 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: 900C B024 B679 31D4 0F82  304B D017 8C76 7D06 9EE6
#      Subkey fingerprint: E61D BB15 D417 2BDE C97E  92D9 DB55 0E89 F0FA 54F3

* remotes/thibault/tags/samuel-thibault:
  slirp: Gcc 9 -O3 fix

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-04-16 09:27:35 +01:00
Dr. David Alan Gilbert 6fabae61a9 slirp: Gcc 9 -O3 fix
Gcc 9 needs some convincing that sopreprbuf really is going to fill
in iov in the call from soreadbuf, even though the failure case
shouldn't happen.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190415121740.9881-1-dgilbert@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2019-04-15 20:01:18 +02:00
Peter Maydell afccfc0c4c Block layer patches:
- iotests fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJcsLb5AAoJEH8JsnLIjy/WtTIQAJBiNOGPVQoenGjxUhacFLB2
 Lylqif8kc0OXemhyiu6V36HCQbUH6+QY1NyjStiJXfzd9yMLyRpOFPhnZpfOZJuh
 xNeln6GxmSDyD5d+NlfVVvJylDzk13mV/s3RkTkw0VW7FwygfMWH4h7pa8jJT/b6
 dFdvBZB/+GhhYUVquxiNSYgIQ5KwK/oovZQnkeq//KVSf2wdHq9i7dvIT4BIXj5Z
 aINQlk48OBmlGmevMzhS99AKZpAz2j4zGVagrwj9dCrkDc29d1TOw75UcPTLw0OS
 2FqhHI+P435+O5VTQxEVW0sx5C5N8FNkjsA0E33XkgdSLHZSFWuyG73H8HtjwCkB
 BuQ3G+JQ5AexvCWdz+zBaE/aKbmcopasXcpzV+DxXVBXmj6Gx7rMvKY8RYiBwZWc
 oIPUCPc2vwKgnx3KPnAAJoKbhpiEhiXPQam20rIoySyzuEDHOQN/kiDQQB+b+PPK
 aYkdWHknkurG+ioUq1F5OwCw5cOw1AKbVNmtRFKD59wBQB/G/gDGgtlWhEALFMyf
 0ZpKaH+c+QJPbaMagCMgwPJ8DgKLb6yJGLwmK/M2CbIYW/2bVMel65YRT67Z+l2H
 Va0vxFqMeVkSRcezUAAXbxMaaLHa9AMQV1V+KAXguYPa7Uqz7p05d9N88r7q87Ui
 FNE+xchmUSdS695h0Gkl
 =46wR
 -----END PGP SIGNATURE-----

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

Block layer patches:

- iotests fixes

# gpg: Signature made Fri 12 Apr 2019 17:04:09 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:
  iotest: Fix 241 to run in generic directory
  iotests: Let 245 pass on tmpfs

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-04-12 17:06:49 +01:00
Eric Blake 9749636b00 iotest: Fix 241 to run in generic directory
Filter the qemu-nbd server output to get rid of a direct reference
to my build directory.

Fixes: e9dce9cb
Reported-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2019-04-12 18:03:01 +02:00
Max Reitz 23e1d05411 iotests: Let 245 pass on tmpfs
tmpfs does not support O_DIRECT.  Detect this case, and skip flipping
@direct if the filesystem does not support it.

Fixes: bf3e50f623
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2019-04-12 18:03:01 +02:00
John Snow 13c24edaa7 qemu-img: fix .hx and .texi disparity
It turns out that having options listed in three places continues to be
a bad idea. I'm still toying with the idea of an improved infrastructure
here, but in the meantime, another bandaid.

There are three locations:
(1) .hx file, formatted as texi
(2) .hx file, formatted as human readable.
(3) .texi file, as section headers, formatted as texi.

You can compare the two summaries within the .hx file like so:

Human-readable command summaries:
`./qemu-img --help | grep 'Command syntax' -A14`
Detokenized texi command summaries:
`grep "@item" qemu-img-cmds.hx | sed -E 's|@var\{([^\}]*?)\}|\1|g'`

You can compare the two separate texi summaries like so:

Texi command summaries:
`grep "@item" qemu-img-cmds.hx"`
Texi command headers:
grep -E "@item.*@var" qemu-img.texi | tail -14

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 20190409210655.777-1-jsnow@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-04-12 14:17:10 +01:00
Gerd Hoffmann e1be98540e curses: fix wchar_t printf warning
On some systems wchar_t is "long int", on others just "int".
So go cast to "long int" and adjust the printf format accordingly.

Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190402073018.17747-1-kraxel@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-04-12 12:58:00 +01:00
Peter Maydell 9e4a484b4a ppc patch queue for 2018-04-12
Here's a last minute pull request for 4.0.  Turns out my last pull
 request, to fix a regression in extended config space access for the
 pseries machine didn't fix things hard enough.  This PR has a single
 patch which improves the fix to work in more cases.
 
 It's a ghastly, ghastly hack, but it's simple and localized.  I
 already have patches almost ready to go in 4.1 that provides a simpler
 and cleaner solution to all this.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAlywI1gACgkQbDjKyiDZ
 s5JDchAAy5LBsVDPH3W/X3Btbrfmk8aY92pWbfZZBfCKVTRYD2HrQ9bqUgK8rDXe
 TIPhVLhZsZdxJX6aAMRgymeO8vDdoksSmldGSQe9nBrnywgwoWBMEC4P5anVNGQv
 8SSZBuhBaea3lBk8mF2vgJsP9QiLtQvHy/l9lTDaUSVNgws3fqGf5/YBjx7h6E+R
 aUdgTvlDvPkm14vZN7W1bkpGYk3J74rVo6qu91zRD9hKzHTuFnRxZE4EQpOKvaNa
 Tq8we05kfKdct5JoJXj+NvsT77lgynyt0AXT/TGtRdS2cgZ3JtHq2ZD/93dBMS/d
 A5fNClEQ45XW/0dLMzzTN4xP3yII5N4mY78kB58L5PNezxCa+7MvxW/2QEHFskyi
 MaWXN/2Dchx9cBvQuueulpaQHUiAYpFVIG9S0OPxG/SDdyqo929F2Z/P152scp3a
 ChG9JKVgXtp3JHMWlBPFdOPJhNhtUN9HiqTrydbVka1rMJyAU+8hXpo96BvPZGdf
 oH+nEqoDiJLGHp930esQ0F7wTQbSaIF+nEVkF8Q71NLDELnpTBMOc02TLhLocuqJ
 cwlDHkw+LN+h+gdzxKtOMMVmL3MG47zsgvY8pgqKItP5i7k3gqEq4lUc75P6Athe
 ULVHYQukowD4ns5ngBPZXZyv0zq7EAa8xoT/FAMx92UcNdshqKg=
 =sN2O
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.0-20190412' into staging

ppc patch queue for 2018-04-12

Here's a last minute pull request for 4.0.  Turns out my last pull
request, to fix a regression in extended config space access for the
pseries machine didn't fix things hard enough.  This PR has a single
patch which improves the fix to work in more cases.

It's a ghastly, ghastly hack, but it's simple and localized.  I
already have patches almost ready to go in 4.1 that provides a simpler
and cleaner solution to all this.

# gpg: Signature made Fri 12 Apr 2019 06:34:16 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.0-20190412:
  spapr_pci: Fix broken naming of PCI bus

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-04-12 11:23:14 +01:00
Greg Kurz 4560116e42 spapr_pci: Fix broken naming of PCI bus
Recent commit 5cf0d326a0 fixed a regression which was preventing the
guest to access the extended config space of a PCIe device. This was
done by introducing a new PCI bus subtype for PAPR. The original fix
was causing PCI busses to be named "spapr-pci-host-bridge-root-bus.N"
instead of "pci.N", which was making upper layers unhappy of course.
This got worked around by hardcoding the PCI bus name to "pci.0", but
this only works for the default PHB. And we're now hitting:

# qemu-system-ppc64 \
             -device spapr-pci-host-bridge,index=1 \
             -device e1000e,bus=pci.0 \
             -device e1000e,bus=pci.1
qemu-system-ppc64: -device e1000e,bus=pci.1: Bus 'pci.1' not found

David already posted some patches [1] to control PCI extended config
space accesses with a new flag in the base PCI bus class instead of
subtyping. These patches are a bit more intrusive though, and
are targetted for 4.1.

When no name is passed to pci_register_bus(), the core device code
generates a lowercase name based on the QOM typename. The typename
for the base PCI bus class is "PCI", hence the "pci.0", "pci.1"
bus names. Rename the type of the PAPR PCI bus to "pci", so that
the QOM code can generate proper names. This is a hack but it is
enough to fix the regression. And all this will be reworked properly
in 4.1.

[1] https://patchwork.ozlabs.org/project/qemu-devel/list/?series=100486

Fixes: 5cf0d326a0
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <155500034416.646888.1307366522340665522.stgit@bahia.lab.toulouse-stg.fr.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-04-12 12:23:02 +10:00