Commit Graph

94811 Commits

Author SHA1 Message Date
Gleb Popov 7e9a0c1510 Add stub signal.c implementation for e2k. 2022-06-18 21:08:07 +03:00
Gleb Popov 666002ab09 Adapt to changed e2k_psp_new() signature. 2022-06-18 21:06:37 +03:00
Gleb Popov 37a9e357c6 Use force_sig_fault() provided by bsd-user instead of gen_signal() 2022-06-18 20:55:51 +03:00
Gleb Popov 7848f92afa Remove TARGET_ERESTARTSYS handling from target_cpu_loop() 2022-06-18 20:55:46 +03:00
Gleb Popov d028b700a1 Fix gdbstub failure when debugging e2k executables. 2022-06-09 09:59:26 +03:00
Gleb Popov 9bed0fa1ca Follow linux-user changes. 2022-06-09 09:59:26 +03:00
Gleb Popov 086c2ff54a Add cross-ref comment for target_cpu_init() 2022-06-09 09:59:26 +03:00
Gleb Popov 09cfc463d1 Follow linux-user changes for CPU loop. 2022-06-09 09:59:26 +03:00
Gleb Popov f0a90e0403 Handle EXCP_DEBUG. 2022-06-09 09:59:26 +03:00
Gleb Popov 73c0abe4f2 Handle EXCP_INTERRUPT 2022-06-09 09:59:25 +03:00
Gleb Popov be35b8cfb4 Make setup_sigtramp return 0 on e2k. 2022-06-09 09:59:25 +03:00
Gleb Popov a14229721a Add TARGET_SZSIGCODE define 2022-06-09 09:59:25 +03:00
Gleb Popov 8aeb5f2c3c Implement EXCP_DATA_PAGE and EXCP_SYSCALL cases in the CPU loop. 2022-06-09 09:59:25 +03:00
Gleb Popov c726be4547 Stub out regs->sbr setting in target_thread_init() 2022-06-09 09:59:25 +03:00
Gleb Popov 96d258f523 Replace target_cpu_clone_regs with a stub 2022-06-09 09:59:25 +03:00
Gleb Popov 404755cb7e Implement target_cpu_init() 2022-06-09 09:59:25 +03:00
Gleb Popov 8d0de0a9eb Implement target_thread_init() 2022-06-09 09:59:25 +03:00
Gleb Popov 9525353a2d Improve definition of elf_check_arch() 2022-06-09 09:59:25 +03:00
Gleb Popov f416f4bbac Fix get_sp_from_cpustate definition 2022-06-09 09:59:25 +03:00
Gleb Popov f8535a69f3 Initial commit for bsd-user-e2k 2022-06-09 09:59:25 +03:00
Peter Maydell 823a3f11fb Update version for v7.0.0 release
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-19 18:44:36 +01:00
Peter Maydell 81c7ed41a1 Update version for v7.0.0-rc4 release
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-12 17:01:34 +01:00
Wentao Liang 4bf58c7213 virtio-iommu: use-after-free fix
A potential Use-after-free was reported in virtio_iommu_handle_command
when using virtio-iommu:

> I find a potential Use-after-free in QEMU 6.2.0, which is in
> virtio_iommu_handle_command() (./hw/virtio/virtio-iommu.c).
>
>
> Specifically, in the loop body, the variable 'buf' allocated at line 639 can be
> freed by g_free() at line 659. However, if the execution path enters the loop
> body again and the if branch takes true at line 616, the control will directly
> jump to 'out' at line 651. At this time, 'buf' is a freed pointer, which is not
> assigned with an allocated memory but used at line 653. As a result, a UAF bug
> is triggered.
>
>
>
> 599     for (;;) {
> ...
> 615         sz = iov_to_buf(iov, iov_cnt, 0, &head, sizeof(head));
> 616         if (unlikely(sz != sizeof(head))) {
> 617             tail.status = VIRTIO_IOMMU_S_DEVERR;
> 618             goto out;
> 619         }
> ...
> 639             buf = g_malloc0(output_size);
> ...
> 651 out:
> 652         sz = iov_from_buf(elem->in_sg, elem->in_num, 0,
> 653                           buf ? buf : &tail, output_size);
> ...
> 659         g_free(buf);
>
> We can fix it by set ‘buf‘ to NULL after freeing it:
>
>
> 651 out:
> 652         sz = iov_from_buf(elem->in_sg, elem->in_num, 0,
> 653                           buf ? buf : &tail, output_size);
> ...
> 659         g_free(buf);
> +++ buf = NULL;
> 660     }

Fix as suggested by the reporter.

Signed-off-by: Wentao Liang <Wentao_Liang_g@163.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 20220407095047.50371-1-mst@redhat.com
Message-ID: <20220406040445-mutt-send-email-mst@kernel.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-08 15:02:09 +01:00
Peter Maydell dde8689d1f two cursor/qxl related security fixes.
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmJPu/wACgkQTLbY7tPo
 cTj+JRAAkPmHGgICyETafBCFJbaDD6ySLxUjPbvzz1ng3OT/pzUMDIyJZn5AgKBK
 4pnLQIFHBCO7JRAFaI85bUmvZUcLIca+5wmWcqeiRkrqD/FMqWPFQv6uLlJSVHri
 BsR6ZGgeqkiw743syZfWfuHLU0OgoirwihkymJe7hpiQ21isb/k6b2iqD9gVSgsJ
 fbMQ9byLeTPrm3W/znNhXe3zAGPd2hCmXFp1+UGkMYhIU3hSJpOz0CCCKBLoEVS1
 F2dGMtdZw65eaUe61TLO8TYHhjm6bbXwtKIKRs+81Nb/zhavOoR7g0u5MfwPLnme
 +UxUUGV3o+ziVM7lmwwImTLA2qr4VQHQ87sN9kDmBKOcAhYKv04UYSAQaQ9zOA+s
 FN+oQLxUL0TsYj2I6AAcLJ+zrnsZas1h1MptJTGBvUV3MU33qDvwJbk12EjiaRnK
 zy46J66QmwaNWJa0IMW9rnBcOkMu+qEshYmJZPsy8U1dif33fY4pGOeGoHzXmxVd
 RB94tXE/s/noBmNHw952a9SAGBKUFpQd8wPPNoYUlUV3qdg1wbf+babEr4Wxh8YE
 EBlBuWjSJoa0EWDAmtTo/52j2dup+aw90COsLrDZrJm/9nOiJSz0EfkxJsVzIjFn
 qfgzfEEdjHcMp2WqRip/eoHkAgtP7KGy7vO+11jHOXix93CJo1Y=
 =5ZKq
 -----END PGP SIGNATURE-----

Merge tag 'fixes-20220408-pull-request' of git://git.kraxel.org/qemu into staging

two cursor/qxl related security fixes.

# gpg: Signature made Fri 08 Apr 2022 05:37:16 BST
# gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* tag 'fixes-20220408-pull-request' of git://git.kraxel.org/qemu:
  ui/cursor: fix integer overflow in cursor_alloc (CVE-2021-4206)
  display/qxl-render: fix race condition in qxl_cursor (CVE-2021-4207)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-08 10:43:30 +01:00
Mauro Matteo Cascella fa892e9abb ui/cursor: fix integer overflow in cursor_alloc (CVE-2021-4206)
Prevent potential integer overflow by limiting 'width' and 'height' to
512x512. Also change 'datasize' type to size_t. Refer to security
advisory https://starlabs.sg/advisories/22-4206/ for more information.

Fixes: CVE-2021-4206
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220407081712.345609-1-mcascell@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-04-07 12:30:54 +02:00
Mauro Matteo Cascella 9569f5cb5b display/qxl-render: fix race condition in qxl_cursor (CVE-2021-4207)
Avoid fetching 'width' and 'height' a second time to prevent possible
race condition. Refer to security advisory
https://starlabs.sg/advisories/22-4207/ for more information.

Fixes: CVE-2021-4207
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220407081106.343235-1-mcascell@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-04-07 12:30:54 +02:00
Peter Maydell 95a3fcc748 Update version for v7.0.0-rc3 release
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-06 21:26:13 +01:00
Dr. David Alan Gilbert a83c284490 acpi: fix acpi_index migration
vmstate_acpi_pcihp_use_acpi_index() was expecting AcpiPciHpState
as state but it actually received PIIX4PMState, because
VMSTATE_PCI_HOTPLUG is a macro and not another struct.
So it ended up accessing random pointer, which resulted
in 'false' return value and acpi_index field wasn't ever
sent.

However in 7.0 that pointer de-references to value > 0, and
destination QEMU starts to expect the field which isn't
sent in migratioon stream from older QEMU (6.2 and older).
As result migration fails with:
  qemu-system-x86_64: Missing section footer for 0000:00:01.3/piix4_pm
  qemu-system-x86_64: load of migration failed: Invalid argument

In addition with QEMU-6.2, destination due to not expected
state, also never expects the acpi_index field in migration
stream.

Q35 is not affected as it always sends/expects the field as
long as acpi based PCI hotplug is enabled.

Fix issue by introducing compat knob to never send/expect
acpi_index in migration stream for 6.2 and older PC machine
types and always send it for 7.0 and newer PC machine types.

Diagnosed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Fixes: b32bd76 ("pci: introduce acpi-index property for PCI device")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/932
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-06 20:03:26 +01:00
Peter Maydell f53faa70bb * fix vss-win32 compilation with clang++
* update Coverity model
 
 * add measurement calculation to amd-memory-encryption docs
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmJMARMUHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroPOQAf/Y/peton1kjPBAbn4G6nD2qjpUoiW
 YDP0/q8D6GhHotnU3MStTc4ntJp9AElCEerUHEXp/bLnqlnnD9q5bRGk56X5NmKI
 x1BFLXEVuAtBnQ31Me5gTINtrlzVTXlJ2d2aePJOID4GSBalc3tj7nkVJ7CBbUIL
 BuTVmy+eDirllBelmLqjKjyeTsMbtj7VGfy+rG4mbLo9caQv/RJyrkU7JZ8DC5Oi
 p0iUWAL7JjApeBz2Ak4AQQzDQn6uhmmQbLUOdQ3WWzqds8Q3iCQQ8wceUrK7gHHC
 JnVkYVj5ku6YpX65TCYVG7dPQyNI3iAyT5Fu8WDLFve5YoTwE7w4hL+fmQ==
 =NO6n
 -----END PGP SIGNATURE-----

Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging

* fix vss-win32 compilation with clang++

* update Coverity model

* add measurement calculation to amd-memory-encryption docs

# gpg: Signature made Tue 05 Apr 2022 09:42:59 BST
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# 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

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu:
  docs/system/i386: Add measurement calculation details to amd-memory-encryption
  qga/vss-win32: fix compilation with clang++
  coverity: update model for latest tools

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-05 16:14:28 +01:00
Peter Maydell 2e185fb65e QAPI patches patches for 2022-04-05
-----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmJMGqUSHGFybWJydUBy
 ZWRoYXQuY29tAAoJEDhwtADrkYZT95AP/0kRQuCXINeU80pSPB2bPmZsZqv8klbE
 9KgK+naZvjZKNJ+2b4Dut8wx6zhKjfrA+kQWq31GpEapxIq+ewQuLHljych1P/pw
 KIxW1h71xmrAsqpMWmsFsYon/Qo7UsgU4tTl9MX9rlcanXesTclPLm4IIaI7+Dsr
 weB+OQHqN92AoGhdAbTBEq3FIYYe/FCLW54qRwO9ULFFg22JcwKEY70teKHwv7Tw
 CZsRvsJgQR24JLvaLEO3Da1dFfGgjvgrfFDDC80PaUQBznO/gFtoefzyrTvhYahH
 kz4+IhWNJEdGjasWbp/Nb/2aTHgpR0gNTb6KxBT2KQ/gfFRIHx2jbZT9ODV3KDEX
 4dxXRzKA09y2c5dGSfWlXGyHKUkruxXouJuo6a1KaViUkhytE5WbJVQM1WmkSOyK
 c2FfoXIuQT40yMZk/GDatY1SAztLy7VK2hekvb/hdHOLuDCSGbgDA5xBH/2LtH1h
 h4UcK8XvsC1Zy5dsaxjjH9/2KRZ8faYUjBXWUtCtOL4Yq1CDgwPjdIpmlYsQKkAe
 fePMsWx7QKsTes5zPVUVH2hWBWzRDPLY6lpPhwzVmXcLSuKdUva6Ww2cWxNdz5g0
 bQrMy6EGaznOWjYZ7RX/fDwwXfDMiynHwlAMv4zYhMfl8xD5cCso6nqqnXE08Mwf
 YDYLz3gCQzQW
 =X3H5
 -----END PGP SIGNATURE-----

Merge tag 'pull-qapi-2022-04-05' of git://repo.or.cz/qemu/armbru into staging

QAPI patches patches for 2022-04-05

# gpg: Signature made Tue 05 Apr 2022 11:32:05 BST
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* tag 'pull-qapi-2022-04-05' of git://repo.or.cz/qemu/armbru:
  qapi: Fix calc-dirty-rate example
  qapi: fix example of query-memdev command
  qapi: fix example of query-cpus-fast command
  qapi: fix example of trace-event-get-state command
  qapi: fix example of query-colo-status command
  qapi: fix example of query-vnc command
  qapi: fix example of query-spice command
  qapi: fix example of query-named-block-nodes command
  qapi: fix examples: replay-break and replay-seek
  qapi: fix example of netdev_add command

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-05 14:02:01 +01:00
Peter Maydell 223a8671ca target-arm queue:
* docs/system/devices/can.rst: correct links to CTU CAN FD IP core documentation.
  * xlnx-bbram: hw/nvram: Fix uninitialized Error *
 -----BEGIN PGP SIGNATURE-----
 
 iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmJMCz0ZHHBldGVyLm1h
 eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3gwdEACkbPhCOGeFT5FWyUhjc/41
 fyWV6aHPwuADY8FAOYlkxSi9KXPOxMTD+QjKJk7j/RS1GIN1jBteXYB+BFg4iAlg
 5NQUL2rOjYjvQ9jDXg/DCRRjw1DPUNHmYbNuTKP1Rbu8NIaJX6ZAoJedzYo9BXIw
 WCnf38xpc9sHFEFenKaePAIP/0M2E4E/3oqzvKHLCJlgxwQDiW8cHiX0ymJt0OlO
 EjRivYDobDMdcR0+yokX5uIzyqhhOQqVUjD03baaOxb0xhJc1cXfz9KmVlXRz/V2
 5jhN5XssHdzAbtHTe91fcT/knEObxPQZFQl9zRW1PCLT5iEQ4BRmPmr+oLOrrS8x
 3TK400ft6uvh2ml7mLIg55xq/J05Sl+8CprH5GSKHe2Cp32/StgMj2eRTYFbRyf/
 DhwcdCX1YeqR6xeNT+ZXYbjdhhvqdKuBUOnsXK3+KdoQBHYHMY9htAO5g2gywWgC
 Zexbtq9GuzMgTuAroRgzmgYUu41N7aPDDqIc0Qy1z5zZAqvHAzOOLLk0KNjYO2ic
 PDHGSldbHty075NUTYHy55LEKHo07EGjZ38Nb8I7Qb3o7UjGU+yxWXvjuJwDLeAh
 xF+/xzqdPwhtIFfkPa3iPgpGcMvyeggL0lxUr31+mALdA8/5QHkX6QIp6+d4re3a
 gKlx9eITt5FGk7PQXNVBIg==
 =RaRD
 -----END PGP SIGNATURE-----

Merge tag 'pull-target-arm-20220405' of https://git.linaro.org/people/pmaydell/qemu-arm into staging

target-arm queue:
 * docs/system/devices/can.rst: correct links to CTU CAN FD IP core documentation.
 * xlnx-bbram: hw/nvram: Fix uninitialized Error *

# gpg: Signature made Tue 05 Apr 2022 10:26:21 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

* tag 'pull-target-arm-20220405' of https://git.linaro.org/people/pmaydell/qemu-arm:
  docs/system/devices/can.rst: correct links to CTU CAN FD IP core documentation.
  xlnx-bbram: hw/nvram: Fix uninitialized Error *

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-05 12:43:12 +01:00
Markus Armbruster 8230f3389c qapi: Fix calc-dirty-rate example
The example shows {"command": ...}, which is wrong.  Fix it to
{"execute": ...}.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20220401082028.3583296-1-armbru@redhat.com>
Reviewed-by: Victor Toso <victortoso@redhat.com>
2022-04-05 12:30:45 +02:00
Victor Toso 7c90031d80 qapi: fix example of query-memdev command
Example output is missing mandatory argument @share for the return
JSON object. Add it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Message-Id: <20220331190633.121077-10-victortoso@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-04-05 12:30:45 +02:00
Victor Toso 28c1ec60aa qapi: fix example of query-cpus-fast command
Example output contains member @arch that was removed in 445a5b4087
"machine: remove 'arch' field from 'query-cpus-fast' QMP command". Fix
it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Message-Id: <20220331190633.121077-9-victortoso@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-04-05 12:30:45 +02:00
Victor Toso 6352c81b24 qapi: fix example of trace-event-get-state command
The example output is missing the mandatory member @vcpu. Fix it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Message-Id: <20220331190633.121077-8-victortoso@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-04-05 12:30:45 +02:00
Victor Toso 51ec294d8e qapi: fix example of query-colo-status command
The example output is missing the mandatory member @last-mode in the
return value. Fix it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Message-Id: <20220331190633.121077-7-victortoso@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-04-05 12:30:45 +02:00
Victor Toso c7f4a0fc78 qapi: fix example of query-vnc command
The return value is missing the mandatory member @websocket. Fix it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Message-Id: <20220331190633.121077-6-victortoso@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-04-05 12:30:45 +02:00
Victor Toso 74dd52e556 qapi: fix example of query-spice command
Example output is missing mandatory members @migrated and @mouse-mode.
Fix it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Message-Id: <20220331190633.121077-5-victortoso@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-04-05 12:30:45 +02:00
Victor Toso 016b835949 qapi: fix example of query-named-block-nodes command
Example output is missing mandatory member @detect_zeroes. Fix it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Message-Id: <20220331190633.121077-4-victortoso@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-04-05 12:30:45 +02:00
Victor Toso 227a762bef qapi: fix examples: replay-break and replay-seek
Both examples outputs are using @data member for the arguments. This
is wrong. The expected member for the QMP is @arguments. Fix it.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Message-Id: <20220331190633.121077-3-victortoso@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-04-05 12:30:45 +02:00
Victor Toso 9a9d101c5b qapi: fix example of netdev_add command
Example output has the optional member @dnssearch as string type. It
should be an array of String objects instead. Fix it.

For reference, see NetdevUserOptions.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Message-Id: <20220401110712.26911-1-victortoso@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Commit message tweaked for precision]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2022-04-05 12:30:45 +02:00
Dov Murik 776a6a32b4 docs/system/i386: Add measurement calculation details to amd-memory-encryption
Add a section explaining how the Guest Owner should calculate the
expected guest launch measurement for SEV and SEV-ES.

Also update the name and links to the SEV API Spec document.

Signed-off-by: Dov Murik <dovmurik@linux.ibm.com>
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20220217110059.2320497-1-dovmurik@linux.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-04-05 10:42:06 +02:00
Helge Konetzka 7bd16378bb qga/vss-win32: fix compilation with clang++
This fixes:

qga/vss-win32/install.cpp:49:24: error: cannot initialize a variable of
type 'char *' with an rvalue of type 'const char *'
    char *msg = NULL, *nul = strchr(text, '(');
                       ^     ~~~~~~~~~~~~~~~~~

Signed-off-by: Helge Konetzka <hk@zapateado.de>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Message-Id: <39400817-3dc9-516d-9096-bc1f68862531@zapateado.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-04-05 10:42:06 +02:00
Paolo Bonzini fae4fad5b4 coverity: update model for latest tools
Coverity is now rejecting incomplete types in the modeling file.
Just use a random number (in the neighborhood of the actual one)
for the size of a GIOChannel.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-04-05 10:42:06 +02:00
Pavel Pisa 80b952bb69 docs/system/devices/can.rst: correct links to CTU CAN FD IP core documentation.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Message-id: 20220402204523.32643-1-pisa@cmp.felk.cvut.cz
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-05 09:29:28 +01:00
Tong Ho 2e9ce53200 xlnx-bbram: hw/nvram: Fix uninitialized Error *
This adds required initialization of Error * variable.

Signed-off-by: Tong Ho <tong.ho@xilinx.com>
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-05 09:28:04 +01:00
Peter Maydell 20661b75ea ppc-7.0 queue:
* Coverity fixes
 * Fix for a memory leak issue
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEoPZlSPBIlev+awtgUaNDx8/77KEFAmJKsD8ACgkQUaNDx8/7
 7KHPLw//VwXltsrxSUA1ND8gIIoKloWBwMv966Rdy5zCHf+s3JwUnW8Kb9y0WzTT
 WY7DDnZjojMWgcIegFO25rB/T+8dKTLlmDmz2V0o80NOKwXjZm5LpIqk3U0g2vHA
 6S+rnMPK+5jfBgV5x38bSOELri8mhv05MQeFC3JlIzKo7+tV7AJ3bExQ53N042tC
 8mpNCayqR3JhEaOql2sGg1SbC6Sz/gf5tPJo+LD2miMUg54jdcO2E9gdun1qSdKk
 +HwMzjzTv3FnuwpIPs50c/DzFqrYzsva+k1+6mrTcEkB4JTBqXNlUNIuTZaaEAkB
 tgjKPw7AR3KVzj//YnoY6J2emfyAUqYcQwxU8y8lBAgEQmvG95TK1K10XDlPbtlg
 8Q4v9IgsaFAZEQhC5+pAJYBHJpKIXtGylFz0z6TooZroIhkbr6HlZSdhs7OUZdbf
 MyIgr12uTT9uwK2wtlt4hsQ8rLNSM/FpudWWmLf7Hog6UC0xsjSbgwpHSVQvNDzK
 ahdYTySqXGisbUzzeze1e3f57xb3EiT2cBKo1teM+oVndvPLFbGXMrKvUA7chEMn
 lX2i7RTyZSSXB9khPFGiCbN01tJER7w1DGCWNYrSowqzvOOx1OoqWzAQg9jwmlok
 pleWiazF+WYxBagSpaFw7oicYu3ZbuoAtNpXCt+Orb+TVIH8qtU=
 =8JCW
 -----END PGP SIGNATURE-----

Merge tag 'pull-ppc-20220404' of https://github.com/legoater/qemu into staging

ppc-7.0 queue:

* Coverity fixes
* Fix for a memory leak issue

# gpg: Signature made Mon 04 Apr 2022 09:45:51 BST
# gpg:                using RSA key A0F66548F04895EBFE6B0B6051A343C7CFFBECA1
# gpg: Good signature from "Cédric Le Goater <clg@kaod.org>" [undefined]
# 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: A0F6 6548 F048 95EB FE6B  0B60 51A3 43C7 CFFB ECA1

* tag 'pull-ppc-20220404' of https://github.com/legoater/qemu:
  linux-user/ppc: Narrow type of ccr in save_user_regs
  ppc/pnv: Fix number of registers in the PCIe controller on POWER9
  hw/ppc: free env->tb_env in spapr_unrealize_vcpu()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-04 15:48:55 +01:00
Richard Henderson 0798da8df9 linux-user/ppc: Narrow type of ccr in save_user_regs
Coverity warns that we shift a 32-bit value by N, and then
accumulate it into a 64-bit type (target_ulong on ppc64).

The ccr is always 8 * 4-bit fields, and thus is always a
32-bit quantity; narrow the type to avoid the warning.

Fixes: Coverity CID 1487223
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220401191643.330393-1-richard.henderson@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2022-04-04 08:49:06 +02:00
Frederic Barrat 7e5157696b ppc/pnv: Fix number of registers in the PCIe controller on POWER9
The spec defines 3 registers, even though only index 0 and 2 are valid
on POWER9. The same model is used on POWER10. Register 1 is defined
there but we currently don't use it in skiboot. So we can keep
reporting an error on write.

Reported by Coverity (CID 1487176).

Fixes: 4f9924c4d4 ("ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge")
Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220401091925.770803-1-fbarrat@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2022-04-04 08:49:06 +02:00
Daniel Henrique Barboza ef95a24494 hw/ppc: free env->tb_env in spapr_unrealize_vcpu()
The timebase is allocated during spapr_realize_vcpu() and it's not
freed. This results in memory leaks when doing vcpu unplugs:

==636935==
==636935== 144 (96 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 6
,461 of 8,135
==636935==    at 0x4897468: calloc (vg_replace_malloc.c:760)
==636935==    by 0x5077213: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.6400.4)
==636935==    by 0x507757F: g_malloc0_n (in /usr/lib64/libglib-2.0.so.0.6400.4)
==636935==    by 0x93C3FB: cpu_ppc_tb_init (ppc.c:1066)
==636935==    by 0x97BC2B: spapr_realize_vcpu (spapr_cpu_core.c:268)
==636935==    by 0x97C01F: spapr_cpu_core_realize (spapr_cpu_core.c:337)
==636935==    by 0xD4626F: device_set_realized (qdev.c:531)
==636935==    by 0xD55273: property_set_bool (object.c:2273)
==636935==    by 0xD523DF: object_property_set (object.c:1408)
==636935==    by 0xD588B7: object_property_set_qobject (qom-qobject.c:28)
==636935==    by 0xD52897: object_property_set_bool (object.c:1477)
==636935==    by 0xD4579B: qdev_realize (qdev.c:333)
==636935==

This patch adds a cpu_ppc_tb_free() helper in hw/ppc/ppc.c to allow us
to free the timebase. This leak is then solved by calling
cpu_ppc_tb_free() in spapr_unrealize_vcpu().

Fixes: 6f4b5c3ec5 ("spapr: CPU hot unplug support")
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220329124545.529145-2-danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2022-04-04 08:49:06 +02:00