Commit Graph

68533 Commits

Author SHA1 Message Date
Gerd Hoffmann
9032e3d71c virtio-gpu: delay virglrenderer reset when blocked.
If renderer_blocked is set do not call virtio_gpu_virgl_reset().
Instead set a flag indicating that virglrenderer needs a reset.
When renderer_blocked gets cleared do the actual reset call.

Without this we can trigger an assert in spice due to calling
spice_qxl_gl_scanout() while another operation is still running:

spice_qxl_gl_scanout: condition `qxl_state->gl_draw_cookie == GL_DRAW_COOKIE_INVALID' failed

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20190314115358.26678-2-kraxel@redhat.com
2019-03-18 13:10:57 +01:00
Gerd Hoffmann
a223b478cb ati-vga: fix tracing
HWADDR_PRIx can't be used in tracing, use PRIx64 instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20190312081143.24850-1-kraxel@redhat.com
2019-03-18 13:10:17 +01:00
Peter Maydell
185521102b ui: fixes for 4.0 (vnc, curses, keymaps).
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJcj37zAAoJEEy22O7T6HE4EEcQAM67fVNZQbTaweLfCmK+Bb60
 F+QoOINQZBZBcQB9I4cgn6gXheOcfiYA1ZBMUFW/UWL4OyeNhamAWX5LnpkI0rAR
 ChHvn/xBUQ+sfs5KFnTjLMuU6tIzFzvPWPHGMteQSG/zQ2h97ELVBYZE3l9xbDUC
 Px20ZRVgklzZVwm+KB6Mwq/zcel/lp/jawYVJBsOXRVqf42yH7Mj1IycD0vD1pfj
 wTSRMgRabNi37Jq6HP26T4aM+LxRmrUA8/Ip9Htq0C5NOeCR/rLqgvwSNxeU4JoW
 TlMtzs0hnn8ro0uYashid01FK4s0VKGstjDHVyr3z5FeB+HU3SZxRF2+gx6Efi/q
 AvsKmIs6OyBUbiUCpMC/OytJDKVaOYNEPPN6cpvz63/yzQD0ogifyBYGcQYbhwn/
 mdXNpEhd+14+4nVkvS5zAjec45O7WddTEmNk/TuzAdc6dEWdyW009PO1kVzM2Icx
 R4OyNFE02+wxSnEzLCW1Z31NkSh57ZBRNmGUFZLfIEuauv31nQkW+fUwlirWaFLc
 uziCS+l+I22jvi3kJX31jB4mojSVyldbi7JIuh4ymyEyEm0I0FqmikGvq9Yrz74d
 iLX5ps9t8pFAJKZusfR1JQpZG5MeQcnL89xfvzZ3M+tbPBEoqPxSAUzRmQ1APg5/
 C9pPifofv/LRkXV+vxQK
 =B/sm
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/ui-20190318-pull-request' into staging

ui: fixes for 4.0 (vnc, curses, keymaps).

# gpg: Signature made Mon 18 Mar 2019 11:20:19 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# 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

* remotes/kraxel/tags/ui-20190318-pull-request:
  keymaps: regenerate keymaps
  keymaps: use nodeadkeys variant for de and fr
  curses ui: add missing iconv_close calls
  curses ui: always initialize all curses_line fields
  vnc: fix unalignment access in tight_pack24

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-03-18 11:30:13 +00:00
Martin Schrodt
ade103011c audio/paaudio: fix microphone input being unusable
The current code does not specify the metrics of the buffers for the
input device. This makes PulseAudio choose very bad defaults, which
causes input to be unusable: Audio put in gets out 30 seconds later.
This patch fixes that and makes the latency configurable as well.

Signed-off-by: Martin Schrodt <martin@schrodt.org>
Message-id: 20190315084653.120020-4-martin@schrodt.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-03-18 12:21:15 +01:00
Martin Schrodt
f614277765 audio/paaudio: prolong and make latency configurable
The latency of a connection to the PulseAudio server is determined by
the tlength parameter. This was hardcoded to 10ms, which is a bit too
tight on my machine, causing audio on host and guest to malfunction.
A setting of 15ms works fine here. To allow tweaking, I also made the
setting configurable via the new -audiodev config. This allows to squeeze out better timings in scenarios where the emulation allows it.

I also removed setting of the minreq parameter to (seemingly arbitrary) half the latency, since it showed worse audio quality during my tests. Allowing PulseAudio to request smaller chunks helped.

Signed-off-by: Martin Schrodt <martin@schrodt.org>
Message-id: 20190315084653.120020-3-martin@schrodt.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-03-18 12:21:15 +01:00
Martin Schrodt
baea032ec7 audio/paaudio: fix ignored buffer_length setting
Audiodev configuration allows to set the length of the buffered data.
The setting was ignored and a constant value used instead.
This patch makes the code apply the setting properly, and uses the
previous default if nothing is supplied.

Signed-off-by: Martin Schrodt <martin@schrodt.org>
Message-id: 20190315084653.120020-2-martin@schrodt.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-03-18 12:21:15 +01:00
Gerd Hoffmann
0a87602268 keymaps: regenerate keymaps
Pick up the config updates.  Also add a few keys to the maps which
got a QKeyCode assigned since the last time we generated the maps
(Hiragana_Katakana, Muhenkan).  Sync with xkbcommon updates.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20190315110248.29208-3-kraxel@redhat.com
2019-03-18 12:06:04 +01:00
Gerd Hoffmann
50963118a1 keymaps: use nodeadkeys variant for de and fr
The reverse keymap code can't handle dead keys.  So use the nodeadkeys
variant of the keyboard layout for the german and french maps.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20190315110248.29208-2-kraxel@redhat.com
2019-03-18 12:06:04 +01:00
Samuel Thibault
a9fda24747 curses ui: add missing iconv_close calls
The iconv_t are opened but never closed.

Spotted by Coverity: CID 1399708
Spotted by Coverity: CID 1399709
Spotted by Coverity: CID 1399713

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-Id: <20190314172524.9290-1-samuel.thibault@ens-lyon.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-03-18 12:06:04 +01:00
Samuel Thibault
a5489ae5bb curses ui: always initialize all curses_line fields
cchar_t can contain not only attr and chars fields, but also ext_color.
Initialize the whole structure to zero instead of enumerating fields.

Spotted by Coverity: CID 1399711

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-Id: <20190315130932.26094-1-samuel.thibault@ens-lyon.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-03-18 10:54:05 +01:00
Peter Maydell
1d023a5296 A Single RISC-V Patch for 4.0-rc0
There was a regression introduced by the decodetree conversion that has
 a fairly straight-forward fix.  Since this fixes bugs that everyone has
 hit I'd like to target it for rc0.
 -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEAM520YNJYN/OiG3470yhUCzLq0EFAlyPK+8THHBhbG1lckBk
 YWJiZWx0LmNvbQAKCRDvTKFQLMurQYCED/4lfpNWcH6t+qfOKLn8NuOPXwlFfKZC
 GJccWfcCj87gDo5xhhV0+bUtdfw54y+PG8YENvpYSpF2c9S0SRUWzHZdDpOt0Fg+
 LH0nTMx5Mnx1+XYtExtAfJ9mN61ekpNobeBS9fr4idHUSH/pLa3kMuB9+bW+yw+U
 fNSm/OJyDyiAaG+aDlfJqgJ34G7Q7ZfAJYK2Db3reAt2jxXud/D/fjypv3MYU1R3
 XedYZqVsCvnrFdQIHo2hEuvNbLoMgyGVluHs49b5CYTE0qpY/BUtgPIkhOBFC1j0
 SEPuC9iHkNz/uWAnj841454I6xXCDybI9daycoMDV4rQYQo0IzSOokdDIWh5fTpC
 zT4sOktGUg5OKmgnvifb61cjVRe6G7BQjCN1nFfNQv+DFY5VYtcI3u1M7AUYzp3h
 PfiBBybffwn9Gl7K9go0RDpHqTrkT9N5DrXvPAP2a7nmgX7yyBp61/+3QsRMaE0/
 wozAHgUIKu9U4kHlB6ACi5KHfzYwH2GAoPbcEFdyZ1i6I3NKM7Y1yQgv2PZJ0O8S
 M0CBFckc05Sd3elhxT0ri4vqXua5AKAdWCe7+jrtdzxGEeWhmmHsYgcKUFVQE5Je
 ob9qERa9iQG8mMjPe5YajeAN3x+epOY7Vd2fr/sFgWNJyRT27B43qWoUDccgye/U
 7N/hVmCbILuAVA==
 =raRT
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-4.0-rc0' into staging

A Single RISC-V Patch for 4.0-rc0

There was a regression introduced by the decodetree conversion that has
a fairly straight-forward fix.  Since this fixes bugs that everyone has
hit I'd like to target it for rc0.

# gpg: Signature made Mon 18 Mar 2019 05:26:07 GMT
# 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-4.0-rc0:
  target/riscv: Fix manually parsed 16 bit insn

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-03-18 09:52:37 +00:00
Li Qiang
18e845f7df vnc: fix unalignment access in tight_pack24
When adding '-fsanitize=undefined' in compiling configuration
and connect VM with vnc, it reports following error:

ui/vnc-enc-tight.c:910:13: runtime error: load of
misaligned address 0x621000466513 for type 'uint32_t',
which requires 4 byte alignment

This patch fix this issue.

Signed-off-by: Li Qiang <liq3ea@163.com>
Message-id: 20190318010442.14897-1-liq3ea@163.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2019-03-18 10:49:18 +01:00
Thomas Huth
3e3fdad6e1 hw/char/parallel: Make it possible to compile also without CONFIG_PARALLEL
For the downstream distribution of QEMU, we want to compile without
CONFIG_PARALLEL. Commit 9157eee1b1 already moved the function
parallel_hds_isa_init() (which is still required for linking) into a file
that is included anyway, but commit bb3d5ea858 moved it
to a separate file which is only compiled again if CONFIG_PARALLEL is
set. To be able to link QEMU again without CONFIG_PARALLEL, the file
should be considered for linking for all targets that have CONFIG_ISA_BUS.
And while we're at it, add a proper comment in there with the rationale
for the separate file.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1552297854-25847-1-git-send-email-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-03-18 09:39:57 +01:00
Singh, Brijesh
cedc0ad539 target/i386: sev: Do not pin the ram device memory region
The RAM device presents a memory region that should be handled
as an IO region and should not be pinned.

In the case of the vfio-pci, RAM device represents a MMIO BAR
and the memory region is not backed by pages hence
KVM_MEMORY_ENCRYPT_REG_REGION fails to lock the memory range.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1667249
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Message-Id: <20190204222322.26766-3-brijesh.singh@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-03-18 09:39:57 +01:00
Singh, Brijesh
2ddb89b00f memory: Fix the memory region type assignment order
Currently, a callback registered through the RAMBlock notifier
is not able to get the memory region type (i.e callback is not
able to use memory_region_is_ram_device function). This is
because mr->ram assignment happens _after_ the memory is allocated
whereas the callback is executed during allocation.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1667249
Suggested-by: Alex Williamson <alex.williamson@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Message-Id: <20190204222322.26766-2-brijesh.singh@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-03-18 09:39:57 +01:00
Paolo Bonzini
d6c1bd4a22 kconfig: add dependencies on CONFIG_MSI_NONBROKEN
For devices that require msi_init/msix_init to succeed, add a
dependency on CONFIG_MSI_NONBROKEN.  This will prevent those devices
from appearing in a binary that cannot instantiate them.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-03-18 09:39:57 +01:00
Paolo Bonzini
ca9b7e29de kconfig: add CONFIG_MSI_NONBROKEN
Not all interrupt controllers have a working implementation of
message-signalled interrupts; in some cases, the guest may expect
MSI to work but it won't due to the buggy or lacking emulation.

In QEMU this is represented by the "msi_nonbroken" variable.  This
patch adds a new configuration symbol enabled whenever the binary
contains an interrupt controller that will set "msi_nonbroken".  We
can then use it to remove devices that cannot be possibly added
to the machine, because they require MSI.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-03-18 09:39:57 +01:00
Alistair Francis
4f5604c41d riscv: plic: Set msi_nonbroken as true
Set msi_nonbroken as true for the PLIC.

According to the comment located here:
https://git.qemu.org/?p=qemu.git;a=blob;f=hw/pci/msi.c;h=47d2b0f33c664533b8dbd5cb17faa8e6a01afe1f;hb=HEAD#l38
the msi_nonbroken variable should be set to true even if they don't
support MSI. In this case that is what we are doing as we don't support
MSI.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reported-by: Andrea Bolognani <abologna@redhat.com>
Reported-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
Message-Id: <256afbb2da005dc62c159b0f4a4fc0d95c050660.1552679970.git.alistair.francis@wdc.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-03-18 09:39:57 +01:00
Bastian Koppelmann
f330433b36
target/riscv: Fix manually parsed 16 bit insn
during the refactor to decodetree we removed the manual decoding that is
necessary for c.jal/c.addiw and removed the translation of c.flw/c.ld
and c.fsw/c.sd. This reintroduces the manual parsing and the
omited implementation.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Tested-by: Palmer Dabbelt <palmer@sifive.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2019-03-17 22:21:32 -07:00
Peter Maydell
d4e65539e5 Fix lost interrupts.
Update seabios-hppa.
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJcjSC2AAoJEGTfOOivfiFfF/4H/RO9JVFGn2uWGVvTzGLZNtBN
 hnPqE9t6PbZhacaDrHmqhJxqEn8ikDzxzhqT5b6Neh6MrYKHWX2bCB14ogTKcjNR
 oDw06yTAnPQfWQ0t+WcKuktyA2u4uO83zATu42CR+tCNhurGwLwQoaDhpID1bcKg
 xLpBFgnP5EGX9ua+8jP7UZTDPyB09QLhUGHehEDTLzuxTsNowCmkEBeORVt7zK0h
 5DUOGLFsM2CVuAtlzyr+9DovAvgFPlXFoWXifxjHfRr88pCChtuMxUiLvMdzUZ34
 EmA7UiMPL1QXnx4FuVfq//QgrwwlvIPO4+KtffIxyegRYmzsa77o6WHOKjgl/0A=
 =jOck
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/rth/tags/pull-hppa-20190316' into staging

Fix lost interrupts.
Update seabios-hppa.

# gpg: Signature made Sat 16 Mar 2019 16:13:42 GMT
# gpg:                using RSA key 64DF38E8AF7E215F
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-hppa-20190316:
  Update seabios-hppa to latest upstream
  target/hppa: Avoid squishing DISAS_IAQ_N_STALE_EXIT

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-03-17 14:10:52 +00:00
Peter Maydell
c4b21ed1cf RDMA queue
* Another Clang compilation fix
  * Collect pvrdma debugging statistics
  * Various fixes for the pvrdma device
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJcjQN+AAoJEDbUwPDPL+RtGzkIALjXgQlcb2YjNRkqwKLsfwFS
 OtZ/9nMj/d3HnLrXd9J5X+DTde0NsXhQb/jmrs5IvidxxNlyA9eq38XhfFBxsTFv
 djKWe87ImRoevFRRAoeHN1I/+w4++ThWtkfbGjY0ANincoJGSixDbWecGNLpiaJU
 PHlb3YmrEhmm4tQxFMmK2Ua5Ydh4grTCXE89eHOFvTtafhdtjLYkrVJrUZIIbtVc
 AmaqD/J3z+swZVl4V+6tAFLfcov1rs8GC0wo3QRAHCHGyGWXCMjabZ8ZPM/YDu39
 efhQpan//aWyWiX/XdRx+BTJtZlNUzt3TjjHWdMg4Jdr+J7Z8v3zs9vpY3JGdVY=
 =bcoj
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/marcel/tags/rdma-pull-request' into staging

RDMA queue

 * Another Clang compilation fix
 * Collect pvrdma debugging statistics
 * Various fixes for the pvrdma device

# gpg: Signature made Sat 16 Mar 2019 14:09:02 GMT
# gpg:                using RSA key 36D4C0F0CF2FE46D
# gpg: Good signature from "Marcel Apfelbaum <marcel.apfelbaum@zoho.com>" [marginal]
# gpg:                 aka "Marcel Apfelbaum <marcel@redhat.com>" [marginal]
# gpg:                 aka "Marcel Apfelbaum <marcel.apfelbaum@gmail.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: B1C6 3A57 F92E 08F2 640F  31F5 36D4 C0F0 CF2F E46D

* remotes/marcel/tags/rdma-pull-request:
  hw/rdma: Fix the error prints in create_qp_rings()
  hw/pvrdma: Fix zero-initialization of resp in {query/modify}_qp
  hw/rdma: Use {} instead of {0}
  hw/rdma: Remove unused parameter from rdma_poll_cq()
  hw/rdma: Fix broken paths to docs/devel/tracing.txt
  hw/rdma: another clang compilation fix
  hw/pvrdma: Provide correct value to object_get_typename
  hw/pvrdma: Unregister from shutdown notifier when device goes down
  hw/pvrdma: Delete pvrdma_exit function
  hw/pvrdma: Delete unneeded function argument
  hw/rdma: Free all receive buffers when QP is destroyed
  hw/rdma: Free all MAD receive buffers when device is closed
  {hmp, hw/pvrdma}: Expose device internals via monitor interface
  hw/pvrdma: Collect debugging statistics
  hw/rdma: Protect against concurrent execution of poll_cq
  hw/rdma: Introduce protected qlist
  hw/rdma: Switch to generic error reporting way
  contrib/rdmacm-mux: Fix out-of-bounds risk

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-03-16 20:18:48 +00:00
Kamal Heib
cb42a5867e hw/rdma: Fix the error prints in create_qp_rings()
The prints should indicate that we are talking about QP and not CQ.

Fixes: 98d176f8e5 ("hw/rdma: PVRDMA commands and data-path ops")
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Message-Id: <20190227085546.23690-1-kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Kamal Heib
d151f5debd hw/pvrdma: Fix zero-initialization of resp in {query/modify}_qp
Make sure to zero-initialize only the pvrdma_cmd_query_qp_resp and not
the whole pvrdma_cmd_resp for query_qp, in modify_qp the resp isn't used
so remove it.

Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Message-Id: <20190314153031.7197-5-kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Kamal Heib
a421c81148 hw/rdma: Use {} instead of {0}
Initialize structs with {} instead of {0} to make sure that all code is
using the same convention.

Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Message-Id: <20190314153031.7197-4-kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Kamal Heib
1373f4a872 hw/rdma: Remove unused parameter from rdma_poll_cq()
The 'rdma_dev_res' parameter is not used in rdma_poll_cq(), so remove it.

Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Message-Id: <20190314153031.7197-3-kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Kamal Heib
7b6f6e8138 hw/rdma: Fix broken paths to docs/devel/tracing.txt
The tracing.txt file is under "docs/devel" and not "docs".

Reviewed-by: Yuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Message-Id: <20190314153031.7197-2-kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Marcel Apfelbaum
59f911938f hw/rdma: another clang compilation fix
Configuring QEMU with:
   configure --target-list="x86_64-softmmu" --cc=clang --enable-pvrdma
Results in:
   qemu/hw/rdma/rdma_rm_defs.h:108:3: error: redefinition of typedef 'RdmaDeviceResources' is a C11 feature [-Werror,-Wtypedef-redefinition]
   } RdmaDeviceResources;
     ^
   qemu/hw/rdma/rdma_backend_defs.h:24:36: note: previous definition is here
   typedef struct RdmaDeviceResources RdmaDeviceResources;

Fix by removing one of the 'typedef' definitions.

Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Message-Id: <20190214154053.15050-1-marcel.apfelbaum@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Yuval Shaia
db8b88bf2c hw/pvrdma: Provide correct value to object_get_typename
Use base object of PCIDevice in call to object_get_typename().

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Message-Id: <1552300155-25216-12-git-send-email-yuval.shaia@oracle.com>
Reviewed-by: Kamal Heib <kamalheib1@gmail.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Yuval Shaia
b556c3cefc hw/pvrdma: Unregister from shutdown notifier when device goes down
This hook was installed to close the device when VM is going down.
After the device is closed there is no need to be informed on VM
shutdown.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Message-Id: <1552300155-25216-11-git-send-email-yuval.shaia@oracle.com>
Reviewed-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Yuval Shaia
a2f1dc6091 hw/pvrdma: Delete pvrdma_exit function
This hook is not called and was implemented by mistake.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Message-Id: <1552300155-25216-10-git-send-email-yuval.shaia@oracle.com>
Reviewed-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Yuval Shaia
3c890bcf30 hw/pvrdma: Delete unneeded function argument
The function's argument rdma_dev_res is not needed as it is stored in
the backend_dev object at init.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Message-Id: <1552300155-25216-9-git-send-email-yuval.shaia@oracle.com>
Reviewed-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Yuval Shaia
bf4414515b hw/rdma: Free all receive buffers when QP is destroyed
When QP is destroyed the backend QP is destroyed as well. This ensures
we clean all received buffer we posted to it.
However, a contexts of these buffers are still remain in the device.
Fix it by maintaining a list of buffer's context and free them when QP
is destroyed.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Message-Id: <1552300155-25216-8-git-send-email-yuval.shaia@oracle.com>
Reviewed-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Yuval Shaia
ff30a446b1 hw/rdma: Free all MAD receive buffers when device is closed
When device is going down free all saved MAD buffers.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Message-Id: <1552300155-25216-7-git-send-email-yuval.shaia@oracle.com>
Reviewed-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Yuval Shaia
f4b2c02a29 {hmp, hw/pvrdma}: Expose device internals via monitor interface
Allow interrogating device internals through HMP interface.
The exposed indicators can be used for troubleshooting by developers or
sysadmin.
There is no need to expose these attributes to a management system (e.x.
libvirt) because (1) most of them are not "device-management' related
info and (2) there is no guarantee the interface is stable.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1552300155-25216-6-git-send-email-yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Yuval Shaia
c2dd117b38 hw/pvrdma: Collect debugging statistics
Add counters to enable enhance debugging

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Message-Id: <1552300155-25216-5-git-send-email-yuval.shaia@oracle.com>
Reviewed-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Yuval Shaia
2cfa953009 hw/rdma: Protect against concurrent execution of poll_cq
The function rdma_poll_cq is called from two contexts - completion
handler thread which sense new completion on backend channel and
explicitly as result of guest issuing poll_cq command.

Add lock to protect against concurrent executions.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Message-Id: <1552300155-25216-4-git-send-email-yuval.shaia@oracle.com>
Reviewed-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Yuval Shaia
b20fc79510 hw/rdma: Introduce protected qlist
To make code more readable move handling of protected list to a
rdma_utils

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Message-Id: <1552300155-25216-3-git-send-email-yuval.shaia@oracle.com>
Reviewed-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Yuval Shaia
4d71b38ae8 hw/rdma: Switch to generic error reporting way
Utilize error_report for all pr_err calls and some pr_dbg that are
considered as errors.
For the remaining pr_dbg calls, the important ones were replaced by
trace points while other deleted.
Some of the functions got renamed to include prefix "rdma/pvrdma"
in the function name.

Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Message-Id: <1552300155-25216-2-git-send-email-yuval.shaia@oracle.com>
Reviewed-by: Kamal Heib <kamalheib1@gmail.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:52:44 +02:00
Yuval Shaia
ade0075523 contrib/rdmacm-mux: Fix out-of-bounds risk
The function get_fd extract context from the received MAD message and
uses it as a key to fetch the destination fd from the mapping table.
A context can be dgid in case of CM request message or comm_id in case
of CM SIDR response message.

When MAD message with a smaller size as expected for the message type
received we are hitting out-of-bounds where we are looking for the
context out of message boundaries.

Fix it by validating the message size.

Reported-by Sam Smith <sam.j.smith@oracle.com>
Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com>
Message-Id: <20190212112347.1605-1-yuval.shaia@oracle.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
2019-03-16 15:45:12 +02:00
Helge Deller
2b42f31eae Update seabios-hppa to latest upstream
This patch fixes two issues in the hppa/parisc emulation:

1. The CPU HPA was wrong in the sense that we had negative module
offsets in the firmware-internal module table (which we ignored up to
now). Get it correct by changing the CPU HPA to 0xfffb0000 which is
greater than the DINO_HPA of 0xfff80000.
This change requires the seabios-firmware update.

2. Sven noticed that the FPU register cr10 is only able to reference up
to 8 FPUs, so let's reduce the maximum amount of SMP CPUs too.

Signed-off-by: Helge Deller <deller@gmx.de>
Message-Id: <20190315164130.GA7800@ls3530>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2019-03-15 10:11:16 -07:00
Richard Henderson
c5d0aec25f target/hppa: Avoid squishing DISAS_IAQ_N_STALE_EXIT
Within a delay slot, we were squishing both DISAS_IAQ_N_STALE and
DISAS_IAQ_N_STALE_EXIT to DISAS_IAQ_N_UPDATED.  This lost the
required exit to the main loop, and could result in interrupts
never being delivered.

Tested-by: Sven Schnelle <svens@stackframe.org>
Reported-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2019-03-15 10:09:55 -07:00
Peter Maydell
8b088d3f8a target-arm queue:
* Add missing SVE-enabled check to ADDVL/ADDPL/RDVL
  * virt-acpi-build: use PCIE_MMCFG_BUS to retrieve end_bus_number
  * virt-acpi-build: Fix SMMUv3 GSIV values
  * Allow EL0 to write to arch timer registers, not just read them
  * bcm2836_control: Implement local timer
 -----BEGIN PGP SIGNATURE-----
 
 iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAlyLjnkZHHBldGVyLm1h
 eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3rSwD/9LvgTrwYiCRaH5gZfw8zZM
 NtW9mOeDeqIeyfOa1/KFo7Hf4EMTfcY0FYJ/wTNmTsGOKWIIWgprkDrMwZVxmB0g
 F5FsECpjTd6lIFyVQXxE4KsxKGjTBBxCROWIv9WL60AXbTJNzsHtTqlhy4k4lT5R
 nrUgHTkyPHzBzF6DG1DFvgm2CzoDmL6NAFm11mz85VM6C6qY4/BATAXnn+YamrNH
 LasnKDjGcVjngk41fzeEvaCfRTfRdSFhpglaq6XJwlIAlbuVMdVvC+4hY4z2KL+X
 5r/F6h8EeQFbjmld4HHw+MOWdNQd6eol1SOJ6dLHAHmR9AykLNFY8CXLtRdcoxfa
 0lWsU0M1/v4kIEJXQ+qZo1lQKcfkjn3f/dznex5OtLRqvdTNKsZuppTjRuiZ/Vr0
 CuIQvoHTUeHwkBM2RV+9mugDXgv0miUSBaHunYN9uMxHKuGdDuq35m7VrXfaYjdi
 DtIPmCf5IN1Uj/mH4rclt/mYaWl6JE6VtmKCgDCcwq9YHBWqUGdoWO39YNnlIdO/
 GRueyZwyvm+qD+CHkNY3YWjdCZg/sHXjS0z03UPx1+dGSGdQV+dolX0ZvpGUcuVI
 T9/VM3qb3o9KzSx95QVStXd84t4frQ1lq2ELKlCcKTquI9d4lnrQ2cuyuTmvquFf
 Bg3zT8JYhkFw6VebZ06uHg==
 =N3ia
 -----END PGP SIGNATURE-----

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

target-arm queue:
 * Add missing SVE-enabled check to ADDVL/ADDPL/RDVL
 * virt-acpi-build: use PCIE_MMCFG_BUS to retrieve end_bus_number
 * virt-acpi-build: Fix SMMUv3 GSIV values
 * Allow EL0 to write to arch timer registers, not just read them
 * bcm2836_control: Implement local timer

# gpg: Signature made Fri 15 Mar 2019 11:37:29 GMT
# 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-20190315:
  target/arm: Check access permission to ADDVL/ADDPL/RDVL
  hw/arm/virt-acpi-build: use PCIE_MMCFG_BUS to retrieve end_bus_number
  target/arm: change arch timer registers access permission
  hw/arm/virt-acpi-build: Fix SMMUv3 GSIV values
  hw/intc/bcm2836_control: Implement local timer

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-03-15 11:39:42 +00:00
Amir Charif
5de56742a3 target/arm: Check access permission to ADDVL/ADDPL/RDVL
These instructions do not trap when SVE is disabled in EL0,
causing them to be executed with wrong size information.

Signed-off-by: Amir Charif <amir.charif@cea.fr>
Message-id: 1552579248-31025-1-git-send-email-amir.charif@cea.fr
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: added 'target/arm' prefix to subject]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-03-15 11:12:29 +00:00
Wei Yang
deb224bc72 hw/arm/virt-acpi-build: use PCIE_MMCFG_BUS to retrieve end_bus_number
This is more proper to use PCIE_MMCFG_BUS to retrieve end_bus_number.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-id: 20190312074953.16671-1-richardw.yang@linux.intel.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-03-15 11:12:29 +00:00
Dongjiu Geng
daf1dc5f82 target/arm: change arch timer registers access permission
Some generic arch timer registers are Config-RW in the EL0,
which means the EL0 exception level can have write permission
if it is appropriately configured.

When VM access registers, QEMU firstly checks whether they have RW
permission, then check whether it is appropriately configured.
If they are defined to read only in EL0, even though they have been
appropriately configured, they still do not have write permission.
So need to add the write permission according to ARMV8 spec when
define it.

Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
Message-id: 1552395177-12608-1-git-send-email-gengdongjiu@huawei.com
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-03-15 11:12:29 +00:00
Eric Auger
41c4fb94aa hw/arm/virt-acpi-build: Fix SMMUv3 GSIV values
The GSIV numbers of the SPI based interrupts is not correct as
ARM_SPI_BASE was not added to the irqmap[VIRT_SMMU] value. So
this may collide with VIRTIO_MMIO irq window.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20190312091031.5185-1-eric.auger@redhat.com
Reviewed-by: Shannon Zhao <shannon.zhaosl@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-03-15 11:12:28 +00:00
Zoltán Baldaszti
67d80321f2 hw/intc/bcm2836_control: Implement local timer
The BCM2836 control logic module includes a simple
"local timer" which is a programmable down-counter that
can generates an interrupt. Implement this functionality.

Signed-off-by: Zoltán Baldaszti <bztemail@gmail.com>
[PMM: wrote commit message; wrapped long line; tweaked
 some comments to match the final version of the code]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-03-15 11:12:28 +00:00
Peter Maydell
7074ab12c8 .gitignore updates for v4.0
-----BEGIN PGP SIGNATURE-----
 
 iQIcBAABAgAGBQJcim19AAoJEPMMOL0/L748tKAQAKzy1lky7JgljIbnviOXiDef
 hsAE8glCw3dDuXhPS2uhS0g6Ik1p1zs5l1fkUYMiZVvGi7ZV4YvKbfhi8AP6fY9s
 ojDZ33It8Z5Nk7PjLXPKrZEudDgPeCDkDvLSrLswJoQozHyt9GLGsHon8zn1iKyL
 KNZaQO1q4E9b9GQqerxYw3mCx98nWtXria9V0IdjbfYDyWF6hHljmenS52bn2Ts1
 V5zAbhesb4Y9sGaOzAmz8TDxQ/naf0hGErs5pGQwjQqHy+S0IKORBt3E7w+PPI4u
 MkPBD1YLAzCcVlBEB0hDSKa5ZC/Zn8ZYgKieykQVG9Tfil/CxXPDU4xtYztqgm2Y
 sRvbUbfuuNLz60d0vTKj0p5CcZ9nbsLF/fs+Jz4b8mqkWoG+V7+feQjcTs6mPCiz
 TLtWI6PhXaKkGjobI0sYI6kZVUyRR3it6/0N0TfCjP0DPilI6FAOWpW5V+DlXh4W
 3X+HfpdF641p2hYunbg6Hp9DqWCct9tb0Enbvc7m0GoQP/6kdkUGHev+UPUjUvPN
 UinO5h89GnPOiUMnTnUSIorlSGvzArSisqXJTL9CQ9K2uK2CEWQOipIlYjqoGvEV
 egqJ17fyfMunKJyPAtCNAJyyGu1ICdCfYPY7PXF4YDkrDPMdpKu75UGBwtaILZLM
 uyJJqmWS0+umTywz5Kl4
 =yRFc
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-pull-request' into staging

.gitignore updates for v4.0

# gpg: Signature made Thu 14 Mar 2019 15:04:29 GMT
# gpg:                using RSA key F30C38BD3F2FBE3C
# 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/trivial-branch-pull-request:
  tests/.gitignore: ignore test-qapi-emit-events.[ch] for in-tree builds
  .gitignore: ignore docs/built created for in-tree builds
  maint: Ignore built elf2dmp

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-03-14 16:19:37 +00:00
Stefano Garzarella
a0af8cee3c tests/.gitignore: ignore test-qapi-emit-events.[ch] for in-tree builds
Commit 5d75648b56 generates 'tests/test-qapi-emit-events.[ch]' but
did not ignore them for in-tree builds.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190314104622.101715-3-sgarzare@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2019-03-14 16:02:13 +01:00
Stefano Garzarella
8009fcdaa8 .gitignore: ignore docs/built created for in-tree builds
Commit 1290e6711 creates 'docs/built' for in-tree builds of
Sphinx manuals but did not ignore it.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190314104622.101715-2-sgarzare@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2019-03-14 16:01:55 +01:00