Coverity (CID 796599) points out that xen_pt_setup_vga() trusts
the rom->size field in the BIOS ROM from a PCI passthrough VGA
device, and uses it as an index into the memory which contains
the BIOS image. A corrupt BIOS ROM could therefore cause us to
index off the end of the buffer.
Check that the size is within bounds before we use it.
We are also trusting the pcioffset field, and assuming that
the whole rom_header is present; Coverity doesn't notice these,
but check them too.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
This patch set contains a handful of Michael's CSR-related cleanups,
which should allow us to proceed with more outstanding bug fixes that
depend on them.
Additionally, there is a patch that turns on USB. This works for me
when the kernel has the appropriate drivers (which will soon be in
defconfig) and I pass
-device usb-ehci
-drive id=my_usb_disk,file=usbdisk.img,if=none,format=raw
-device usb-storage,drive=my_usb_disk
to QEMU.
-----BEGIN PGP SIGNATURE-----
iQJHBAABCAAxFiEEAM520YNJYN/OiG3470yhUCzLq0EFAlw42s4THHBhbG1lckBk
YWJiZWx0LmNvbQAKCRDvTKFQLMurQS/2D/sFgvFwdh4UtLlNpaPMMTdfC6rh3TBJ
jGsTjKSt2PBi6v/5PcVSCYGqxKdNRmZCWO1QOuXBY0mtgs2it7Cy8gTj8587vx30
MZpwDdQyahUH2ekhUbWhoCcxB/VTaQuSiBn2z0BdYgUuYNDvBCDHVPzEOX4dCsfW
COKdgqKkGVHWS8jM6TQx18BlmWy7ZyBPYKE4vXLx7rGc06wuV6IHfJjJz9A9mT2D
C+olQe2xMxOOIKvViODN4q4p8XEcoZ4X8HZHS+XZqPUsdqq6XOj0NbcvzuWLe+r6
CSvj6wJeT2vndl7IxOc387esDYQT9gcpzHBr689VKZ8wsx8C6yGJbZ1ZdBMBMHzz
Vin/2wooXAVAEH5HR9vw/VKfcigGPIJ0nq6Ia3BJeYRMmhTvICwgabCJQ2keSYcD
xdv0OyplH6pZpvfsfDJFL377+qC8Rtr38SvLA4twvwkGwTNMjupombRV83HMC5F1
z9BkXgiiZiE4VZIWR6fhPDcg1zV4OJyuI3q/aKN8WM9yvOwYD8o7XGNo3M1zejvO
wTbWTt7xSvzFLUKik2etX6zgBz+myoJ6zpT7VbvjXh8q4pLBWZgAJJH7qkTc0A8k
L18Mo/wA9OPeVQ6mDxNS8IrJGYr4EehYG3bbtPgLhElO0IyP/z4YqGYBpJ6YRVXe
4EuQXMIaDcj1/w==
=JmSx
-----END PGP SIGNATURE-----
Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-3.2-part2' into staging
RISC-V Updates for 3.2, Part 2
This patch set contains a handful of Michael's CSR-related cleanups,
which should allow us to proceed with more outstanding bug fixes that
depend on them.
Additionally, there is a patch that turns on USB. This works for me
when the kernel has the appropriate drivers (which will soon be in
defconfig) and I pass
-device usb-ehci
-drive id=my_usb_disk,file=usbdisk.img,if=none,format=raw
-device usb-storage,drive=my_usb_disk
to QEMU.
# gpg: Signature made Fri 11 Jan 2019 18:05:02 GMT
# gpg: using RSA key EF4CA1502CCBAB41
# gpg: Good signature from "Palmer Dabbelt <palmer@dabbelt.com>"
# gpg: aka "Palmer Dabbelt <palmer@sifive.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg: There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 00CE 76D1 8349 60DF CE88 6DF8 EF4C A150 2CCB AB41
* remotes/palmer/tags/riscv-for-master-3.2-part2:
default-configs: Enable USB support for RISC-V machines
RISC-V: Implement existential predicates for CSRs
RISC-V: Implement atomic mip/sip CSR updates
RISC-V: Implement modular CSR helper interface
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Travis CI jobs are failing because of test-qht-par when gprof is
enabled. Temporarily disable test-qht-par if gprof is enabled,
until we fix the bug.
-----BEGIN PGP SIGNATURE-----
iQIcBAABCAAGBQJcON8hAAoJECgHk2+YTcWmYLkP/RqdM4fBXXBrXHXrwGsoN6qo
7TtvjJj+8eS8tVNGiP82b1qUeajRpbcspYvqH/Zwr1yMnAAqNhVYOX5pv7awKBkU
jCgvmAD88ZBthaPqjuI0E0pWu8ZgK8SY09eEgwtu9wZ5LOwY+pbSiGJTezMKEeOa
mBWvFAOhtkPp6r7kQgprYrMtV34BEt2LSiAd0Li7k5ejzaBdqh1Lbf4kY8Wgn5+5
RtMoZ0iaD7INLX+qI9WNh7xTHEF3oUnCDZNynwl5qsyg3JNWhvkIqZCBtRp7cJQH
C9WSSF+xpNsyiyeQcJNHZPGBq2M4jdknVNIZZsGES+1bugRAe44lEGqmLZnSaH1o
/WFFKQmztqNzB8P5cLFFzImez9GPRVoiRNU//wPBUr99TFIhbAFdhFko50R4uFLe
H5l4LsGZVeNuECX8g9H2E+Q1ve0jRxICxhgkyelSZ6CFtNs5a9EMuwGDxrs458E9
WPSUlEwv+FkSBjaBxp1ghWkk9tFDCta+4/QM+1CR/SOylqHFgYQf1szOVvMuJRuf
xmmJ68Al9GKTE5Xb9nqxFaV0jWkuZg00Ofpp1kFlHTn9Q6bhhnp0piEEgr0nsWwZ
mUyfVfDsNkbaLsVcjQqEP1HDGHEu77zAo5EAkF9JXgMK1Lm9j23Mk0K/jC6T2ME4
ZmS0GhXF7/4XIkYMvaTl
=RksQ
-----END PGP SIGNATURE-----
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging
Work around test-qht-par + gprof issues
Travis CI jobs are failing because of test-qht-par when gprof is
enabled. Temporarily disable test-qht-par if gprof is enabled,
until we fix the bug.
# gpg: Signature made Fri 11 Jan 2019 18:23:29 GMT
# gpg: using RSA key 2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6
* remotes/ehabkost/tags/machine-next-pull-request:
tests: Disable qht-bench parallel test when using gprof
configure: Let the TARGET_GPROF var use the regular 'y' for Yes
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This will allow reusing the function in a following patch.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
There is no clear benefit in calling an alias DEBUG_ARGS(). Replace
calls with DEBUG_ARG(), and fix the white-spacing while at it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Instead, rely on slirp_debug flags, or compile unconditionally (the
substraction in cksum is unlikely to affect any benchmark result).
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This fixes some compilation warnings on mingw64.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Learn to read SLIRP_DEBUG=call,misc,error (all or help also handled)
to set the slirp_debug flags.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Make debug statements condiitonal only on slirp_debug flags, instead
of the pre-processor DEBUG blocks, as it may introduce breakage
easily, since the debug code isn't always compiled.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
icmp_send_error() doesnt actually log messages when DEBUG is enabled.
Let's use a different define that describes better the tweaked
behaviour of the function, and avoid uncompiled code.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Remove some clutter, and avoids direct call to fprintf().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reduce dependency on QEMU. QEMU could use a custom glib log handler if
it wants to redirect/filter it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Make all packets expiration time based on virtual clock.
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This list is not only used to handle command to execute on guest
connection, it can also redirect to an arbitrary object, such as a
chardev. Let's rename the struct and the field to "guestfwd".
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Since commit 12f8def0e0 (v2.9), qemu
requires Vista. Let's remove some conditional code.
Note that this introduces a missing declaration warning with mingw.
warning: implicit declaration of function 'inet_ntop'
See also: https://sourceforge.net/p/mingw-w64/mailman/message/36473782/
We could workaround it by declaring it ourself depending on __MINGW64_VERSION_*:
WINSOCK_API_LINKAGE INT WSAAPI inet_pton(int Family, PCTSTR pszAddrString, PVOID pAddrBuf);
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
g_spawn_async_with_fds is portable on Windows, so we can now enable
fork_exec support there.
Thanks Daniel P. Berrangé for the notice!
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reduce dependency on QEMU. QEMU could use a custom log handler if it
wants to redirect/filter it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Use g_spawn_async_with_fds() to setup the child.
GSpawn handles reaping the child, and closing parent file descriptors.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Only slirp/libslirp.h should be included.
Instead of using some slirp declarations and utility functions directly,
let's copy them in net/util.h.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Do not require QEMU macro.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Untouched since original introduction in 2004.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Let them accept multiple arguments. Simplify the inner argument
handling of DEBUG_ARGS/DEBUG_MISC_DEBUG_ERROR.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reduce dependency on QEMU. QEMU could use a custom log handler if it
wants to redirect/filter it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Use a global variable instead (similar to slirp_debug)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
One more step towards making the project independent from QEMU.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
It's actually qemu configure CONFIG_IOVEC that is being used.
slirp/ does not use it anyway
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
The soread() function may be used on datagram sockets, and would
provide different behaviour if HAVE_READV was set, on empty datagrams.
This looks like a minor optimization, that never has been a strong
goal for slirp.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Looking at git history, this looks like something from the past, when
there was a tty layer. Let's remove it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Nobody cares for over 14y. Somebody can revert or rewrite if
interested by that.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This will bring slirp a bit forward to the state of an independent
project.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>