gen methods should access state from DisasContext. Add misa
field to the DisasContext struct and remove CPURISCVState
argument from all gen methods.
Signed-off-by: Michael Clark <mjc@sifive.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
The gen methods should access state from DisasContext. Add priv_ver
field to the DisasContext struct.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
* Add riscv prefix to raise_exception function
* Add riscv prefix to CSR read/write functions
* Add riscv prefix to signal handler function
* Add riscv prefix to get fflags function
* Remove redundant declaration of riscv_cpu_init
and rename cpu_riscv_init to riscv_cpu_init
* rename riscv_set_mode to riscv_cpu_set_mode
Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
This adds the necessary minimum to support S-mode
virtualization for priv ISA >= v1.10
Signed-off-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Co-authored-by: Matthew Suozzo <msuozzo@google.com>
Co-authored-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Modifed from Richard Henderson's patch [1] to integrate
with the new control and status register implementation.
[1] https://lists.nongnu.org/archive/html/qemu-devel/2018-03/msg07034.html
Note: the f* CSRs already mark mstatus.FS dirty using
env->mstatus |= mstatus.FS so the bug in the first
spin of this patch has been fixed in a prior commit.
Signed-off-by: Michael Clark <mjc@sifive.com>
Reviewed-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Co-authored-by: Richard Henderson <richard.henderson@linaro.org>
Co-authored-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Michael Clark <mjc@sifive.com>
Reviewed-by: Michael Clark <mjc@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
We are failing to take into account that tlb_fill() can cause a
TLB resize, which renders prior TLB entry pointers/indices stale.
Fix it by re-doing the TLB entry lookups immediately after tlb_fill.
Fixes: 86e1eff8bc ("tcg: introduce dynamic TLB sizing", 2019-01-28)
Reported-by: Max Filippov <jcmvbkbc@gmail.com>
Tested-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <20190209162745.12668-3-cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Due to a cut/paste error in the original implementation, the unsigned
vector saturating arithmetic was erroneously being calculated as signed
vector saturating arithmetic.
Fixes: 8ffafbcec2 ("tcg/i386: Implement vector saturating arithmetic")
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20190207224258.426-1-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Currently, a jump to a label that is not defined anywhere will
be emitted not be relocated. This results in a jump to a random
jump target. With tcg debugging, print a diagnostic to the -d op
file and abort.
This could help debug or detect errors like
c2d9644e6d ("target/arm: Fix crash on conditional instruction in an IT block")
Reported-by: Roman Kapl <code@rkapl.cz>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
- .travis.yml tweaks and optimisations
- .cirrus.yml enabled for FreeBSD CI
- docker.py clean-ups for binfmt_misc
- more control of vm-test builds
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE9xX3zUb5RDX09YhljlINYSiVGa4FAlxhcpIACgkQjlINYSiV
Ga5jdw//VaYhiHaLtVy+fFpgT+CLprALynRtkTTV0b+Y43G7fFbbFHqO5ivjjtEX
+j2cfZvGl0zCK/Zi46oD1M5FpQvJ5qcNcFc4UecNv/xRQK1BCXb1TGVtJJZGvr3g
rhDYOdsqIxfKi9220StSIscM4Wn1OtXhV2aSE4uM0zxvHWSdA5cmf7WlCQg3kp8F
M3e1i1Tqb/xZuUI3flaQOsp/OKVMP0RG1YY4t5iJGJ4ehk5r4GjklP7FQb3pRvUN
buYzhEw21LgEoruHMJLIN3jepaHMhXZGJE+LcgJ3J3VQBOKQ3/p3SLyKy6xNamuu
9cq8JTXaGhY9PYpVuCdCpsutqUdM0h8DwfyXjTT5rznNWnnnPpWX0PoJKKrX479v
wEsoyiIDyNM5e1asq/+JB/0silFHdFu/TE9RebQR6WDc6aoFcA/M5p9mDiRC8YOy
WxuuFqDrMstBMGm/1jRb1M/cwaxVJQutgdLabCgD1CEchmbnj3QYWiFgBayi1kNd
rEwPNdWa3v0aXJT9kOM78R1UjMw2JFDZyS3OBzUHKR21IQiwkWMnVMIYUfIOTzv0
gkE8+UOmQFCN+tITbpAwuiuClEwbFrKDj+u/VU/w25ZGo8tuorLu23Syarwc037T
lNzpGVSpxwWKnjuUQ16qnebGGtasRTttmwZij96ya4cohxi1r2Q=
=1GUs
-----END PGP SIGNATURE-----
Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-next-110219-1' into staging
Testing updates:
- .travis.yml tweaks and optimisations
- .cirrus.yml enabled for FreeBSD CI
- docker.py clean-ups for binfmt_misc
- more control of vm-test builds
# gpg: Signature made Mon 11 Feb 2019 13:03:14 GMT
# gpg: using RSA key F715F7CD46F94435F4F588658E520D61289519AE
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44
# Subkey fingerprint: F715 F7CD 46F9 4435 F4F5 8865 8E52 0D61 2895 19AE
* remotes/stsquad/tags/pull-testing-next-110219-1:
tests/vm: Be verbose while extracting compressed images
docs/devel/testing: Add -a option to usermod command on docker setup
scripts/qemu.py: allow arches use KVM for their 32bit cousins
tests/vm: expose BUILD_TARGET, TARGET_LIST and EXTRA_CONFIGURE_OPTS
tests/vm: add --build-target option
tests/vm: call make check directly for netbsd/freebsd/ubuntu.i386
tests/vm: move images to $HOME/.cache/qemu-vm/images
tests: PEP8 cleanup of docker.py, mostly white space
tests: docker.py be even smarter with persistent binfmt_misc
tests: make docker.py check for persistent configs
tests: make docker.py update use configured binfmt path
docker: add debian-buster-arm64-cross
archive-source.sh: Clone the submodules locally
MAINTAINERS: Add an entry for scripts/archive-source.sh
.travis.yml: fold --disable-tcg into alternate coroutine builds
.travis.yml: separate tools and docs into another entry
.travis.yml: stop requesting libffi & gettext from homebrew
.cirrus.yml: basic compile and test for FreeBSD
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Depending of the host hardware, copying and extracting VM images can
take up to few minutes. Add verbosity to avoid the user to worry about
VMs hanging.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190129175403.18017-2-philmd@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
The option -G of usermod command will remove user from other groups
not listed, i.e.: $USER will belong only to group 'docker' after
following the documentation as is.
From usermod(8) manual page:
If the user is currently a member of a group which is not listed,
the user will be removed from the group. This behaviour can be
changed via the -a option, which appends the user to the current
supplementary group list.
This patch improves the situation by adding the -a option to the
usermod command, which will just append user to the supplementary
group list.
Cc: qemu-trivial@nongnu.org
Signed-off-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Message-Id: <20190207184346.6840-1-muriloo@linux.ibm.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
A lot of architectures can run their 32 bit cousins on KVM so the
kvm_available function needs to be a little less restricting when
deciding if KVM is available.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Now the underlying basevm support passes these along we can expose
some additional variables to our Makefile to allow more customised
tweaking of the build. For example:
make vm-build-freebsd TARGET_LIST=aarch64-softmmu \
EXTRA_CONFIGURE_OPTS="--disable-tools --disable-docs" \
BUILD_TARGET=check-softfloat
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This allows us to invoke the build with a custom target (for the VMs
that use the {target} format string specifier). Currently OpenBSD is
still hardwired due to problems running check.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
The "make check" target calls check-qtest which has the appropriate
system binaries as dependencies so we shouldn't need to do two steps
of make invocation. Doing it in two steps was a hangover from when our
make check couldn't run tests in parallel.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
It's easier to move around the images then, by replacing the
subdirectory with a symlink. Allows to share the images between
multiple qemu checkouts for example.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
My editor keeps putting squiggly lines under a bunch of the python
lines to remind me how non-PEP8 compliant it is. Clean that up so it's
easier to spot new errors.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
If we have a persistent mapping we don't need the QEMU binary copied
into the container as the kernel has already opened the file and will
pass the fd in. However the support libraries will still need to be
there.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
binfmt_misc configured with the "F" flag opens the interpreter at
config time. This means it can use an already open file-descriptor to
run QEMU so there is no point trying to copy the binary into a
container.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
When copying a QEMU binary into a linux-user docker image we should
check what the current configured binfmt_misc path is rather than
just assuming "/usr/bin/qemu-bin". Obviously if the user changes the
configuration afterwards they will break their images again.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
We can't build QEMU with this but we can use this image to build newer
arm64 testcases which need more up to date tools.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
We cloned the QEMU repository from the local storage. Since the
submodules are also available there, clone them too. This is
quicker and reduce network use.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[AJB: incorporated review suggestions from danpb]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
The scripts/archive-source.sh is used by the VM tests, it makes
sense to add it in the "Build and test automation" section.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
The alternate coroutine builds are really only of interest to people
running KVM (although I think you could use them for TCG if you really
tried). As they tend to run long lets kill two birds with one stone
and fold the --disable-tcg build into them.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Re-building the tools and documents by default is a little wasteful as
they are not really affected by the main build options. Split tools
and documents into their own task with a minimal softmmu and
linux-user target list just to check they don't interact badly.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
The default package set installed on macOS builders from Travis already
includes libffi and gettext as shown by log messages:
Skipping install of libffi formula. It is already up-to-date.
Using libffi
Skipping install of gettext formula. It is already up-to-date.
Using gettext
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Marc-André Lureau (27):
slirp: generalize guestfwd with a callback based approach
net/slirp: simplify checking for cmd: prefix
net/slirp: free forwarding rules on cleanup
net/slirp: fix leaks on forwarding rule registration error
slirp: add callbacks for timer
slirp: replace trace functions with DEBUG calls
slirp: replace QEMU_PACKED with SLIRP_PACKED
slirp: replace most qemu socket utilities with slirp own version
slirp: replace qemu_set_nonblock()
slirp: add unregister_poll_fd() callback
slirp: replace qemu_notify_event() with a callback
slirp: move QEMU state saving to a separate unit
slirp: do not include qemu headers in libslirp.h public API header
slirp: improve windows headers inclusion
slirp: add slirp own version of pstrcpy
slirp: remove qemu timer.h dependency
slirp: remove now useless QEMU headers inclusions
slirp: replace net/eth.h inclusion with own defines
slirp: replace qemu qtailq with slirp own copy
slirp: replace remaining qemu headers dependency
slirp: prefer c99 types over BSD kind
slirp: improve send_packet() callback
slirp: replace global polling with per-instance & notifier
slirp: remove slirp_instances list
slirp: use polling callbacks, drop glib requirement
slirp: pass opaque to all callbacks
slirp: API is extern C
Peter Maydell (2):
slirp: Avoid marking naturally packed structs as QEMU_PACKED
slirp: Don't mark struct ipq or struct ipasfrag as packed
Samuel Thibault (3):
slirp: Avoid unaligned 16bit memory access
slirp: replace QEMU_BUILD_BUG_ON with G_STATIC_ASSERT
slirp: Move g_spawn_async_with_fds_qemu compatibility to slirp/
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE5h27FdQXK97JfpLZ21UOifD6VPMFAlxcOoEACgkQ21UOifD6
VPMXKRAAh30w8FcQVSTdnc1LXTbHaaWX0onlvqNpDNsoG8bUx9wacHYuLmuQ6v/w
7VcrFeCyB0iEs4FZqLfB7eiyhTBzUgtDkjfqPzOq887xYv2Feml3ULLlFEtHRzPd
ht+lYiOzF3XK0PUuqquYw+NhXOb5iYGOi8YfwAvuixQR72aq/yM/1QsNAq1a/xa8
5TlymCYIDG1n7YCZlpWtCHcbo088WbAfFFeO+n/G0haunqYXdu9aha0d0QWClWJv
LaufmdtECKeNTdm5o2HKIzluwWVujARJ0RjhkzvdUhDMvhYdw8G3S1UvG+dDIY3Z
EqvVTqaeK7JiTrvx7tSOQ3bA/b1YXyMcWUCvVoBwGvTtiZenjXEH2eWrS8JI4OFn
fDADP5UFBMQ4CLf5f6584fcjN9OP2Ux3e4n6tmTUO8QuuC3NS3NmuVR0Og3TcKdo
ewdCuhQDIFo7Ez2ChzfAvIfu2j5B/PvE0MR/0y+0WSpBnSXcukYdOSe4657m+Fco
4Ah9v7Nu/mrYAPqbGlaExQkAJJWUmR6oY1QP32/PTLZCFEsjMD7ZNOfKS0UVtZYT
TV+thnj2nRARLJ7OwVTbiB+BliMmJLexc92tSAmUu65VgP3BEvUU1yR/lxodwX31
9TNS3BzRNoen+oSAJAgEfpPo3HxQanhHRi8o5o+fk8kdOkwCxzA=
=nIy1
-----END PGP SIGNATURE-----
Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging
More work towards libslirp
Marc-André Lureau (27):
slirp: generalize guestfwd with a callback based approach
net/slirp: simplify checking for cmd: prefix
net/slirp: free forwarding rules on cleanup
net/slirp: fix leaks on forwarding rule registration error
slirp: add callbacks for timer
slirp: replace trace functions with DEBUG calls
slirp: replace QEMU_PACKED with SLIRP_PACKED
slirp: replace most qemu socket utilities with slirp own version
slirp: replace qemu_set_nonblock()
slirp: add unregister_poll_fd() callback
slirp: replace qemu_notify_event() with a callback
slirp: move QEMU state saving to a separate unit
slirp: do not include qemu headers in libslirp.h public API header
slirp: improve windows headers inclusion
slirp: add slirp own version of pstrcpy
slirp: remove qemu timer.h dependency
slirp: remove now useless QEMU headers inclusions
slirp: replace net/eth.h inclusion with own defines
slirp: replace qemu qtailq with slirp own copy
slirp: replace remaining qemu headers dependency
slirp: prefer c99 types over BSD kind
slirp: improve send_packet() callback
slirp: replace global polling with per-instance & notifier
slirp: remove slirp_instances list
slirp: use polling callbacks, drop glib requirement
slirp: pass opaque to all callbacks
slirp: API is extern C
Peter Maydell (2):
slirp: Avoid marking naturally packed structs as QEMU_PACKED
slirp: Don't mark struct ipq or struct ipasfrag as packed
Samuel Thibault (3):
slirp: Avoid unaligned 16bit memory access
slirp: replace QEMU_BUILD_BUG_ON with G_STATIC_ASSERT
slirp: Move g_spawn_async_with_fds_qemu compatibility to slirp/
# gpg: Signature made Thu 07 Feb 2019 14:02:41 GMT
# 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: (32 commits)
slirp: API is extern C
slirp: pass opaque to all callbacks
slirp: use polling callbacks, drop glib requirement
slirp: remove slirp_instances list
slirp: replace global polling with per-instance & notifier
slirp: improve send_packet() callback
slirp: prefer c99 types over BSD kind
slirp: replace remaining qemu headers dependency
slirp: Move g_spawn_async_with_fds_qemu compatibility to slirp/
slirp: replace QEMU_BUILD_BUG_ON with G_STATIC_ASSERT
slirp: replace qemu qtailq with slirp own copy
slirp: replace net/eth.h inclusion with own defines
slirp: remove now useless QEMU headers inclusions
slirp: remove qemu timer.h dependency
slirp: add slirp own version of pstrcpy
slirp: improve windows headers inclusion
slirp: do not include qemu headers in libslirp.h public API header
slirp: move QEMU state saving to a separate unit
slirp: replace qemu_notify_event() with a callback
slirp: add unregister_poll_fd() callback
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Make it possible to use headers easily with C++ projects.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This is friendlier for FFI bindings.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
It would be legitimate to use libslirp without glib. Let's
add_poll/get_revents pair of callbacks to provide the same
functionality.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Now that polling is done per-instance, we don't need a global list of
slirp instances.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Remove hard-coded dependency on slirp in main-loop, and use a "poll"
notifier instead. The notifier is registered per slirp instance.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Use a more descriptive name for the callback.
Reuse the SlirpWriteCb type. Wrap it to check that all data has been written.
Return a ssize_t for potential error handling and data-loss reporting.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Except for the migration code which is gated by WITH_QEMU, only
include our own headers, so libslirp can be built standalone.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Only slirp actually needs it, and will need it along in libslirp.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
to remove another dependency on qemu.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Some of those could have been squashed earlier, but it is easier to do
it all here.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: samuel Thibault <samuel.thibault@ens-lyon.org>
Remove a dependency on qemu util.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>