Alex Bennée
c5008c76ee
gitlab: add acceptance testing to system builds
...
As part of migrating things from Travis to GitLab add the acceptance
tests. To do this:
- rename system1 to system-ubuntu-main
- rename system2 to system-fedora-misc
- split into build/check/acceptance
- remove -j from check stages
- use artifacts to save build stage
- add post acceptance template and use
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Message-Id: <20200701135652.1366-31-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Alex Bennée
3c1de3af46
tests/acceptance: skip LinuxInitrd 2gib with v4.16 on GitLab
...
This fails on GitLab but not when run locally on the same container
image. It's very confusing.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Acked-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Message-Id: <20200701135652.1366-30-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Alex Bennée
61bbce96fe
tests/acceptance: skip multicore mips_malta tests on GitLab
...
For some reason these tests fail all the time on GitLab. I can
re-create the hang around 3% of the time locally but it doesn't seem
to be MTTCG related. For now skipIf on GITLAB_CI.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Cc: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com >
Message-Id: <20200701135652.1366-29-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Alex Bennée
fcae60436f
tests/acceptance: fix dtb path for machine_rx_gdbsim
...
The old path doesn't exist but the rx-virt.dtb file has the same
checksum so lets use that.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Acked-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Message-Id: <20200701135652.1366-28-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Alex Bennée
0f26d94ec9
tests/acceptance: skip s390x_ccw_vrtio_tcg on GitLab
...
Currently the test takes more the 900 seconds on GitLab and then times
out. Running on Travis seems to be OK.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20200701135652.1366-27-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Alex Bennée
cdc61815c7
tests/docker: add packages needed for check-acceptance
...
We need additional python packages to run check-acceptance. Add them
to the docker images we will be using later.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Reviewed-by: Thomas Huth <thuth@redhat.com >
Message-Id: <20200701135652.1366-26-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Alex Bennée
e6f1306b10
tests/docker: add --registry support to tooling
...
This allows us to point the tools towards a registry from which they
can grab pre-built layers instead of doing everything from scratch
each time. To enable this we need to be using the DOCKER_BUILDKIT
engine.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20200701135652.1366-25-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Alex Bennée
8a8a50a957
gitlab: build containers with buildkit and metadata
...
According to the documentation to be able to use --cache-from for
remote registries you need to enable both buildkit and inline the
metadata. We want to do this to support pulling from gitlab when users
build their local docker images.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20200701135652.1366-24-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Daniel P. Berrangé
c962864f1d
gitlab: convert jobs to use custom built containers
...
Now that we're building standard container images from
dockerfiles in tests/docker/dockerfiles, we can convert
the build jobs to use them. The key benefit of this is
that a contributor can now more easily replicate the CI
environment on their local machine. The container images
are cached too, so we are not spending time waiting for
the apt-get/dnf package installs to complete.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com >
Message-Id: <20200622153318.751107-4-berrange@redhat.com >
[AJB: tweak naming convention]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Acked-by: Thomas Huth <thuth@redhat.com >
Message-Id: <20200701135652.1366-23-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Daniel P. Berrangé
fa821f23e1
gitlab: build all container images during CI
...
We have a number of container images in tests/docker/dockerfiles
that are intended to provide well defined environments for doing
test builds. We want our CI system to use these containers too.
This introduces builds of all of them as the first stage in the
CI, so that the built containers are available for later build
jobs. The containers are setup to use the GitLab container
registry as the cache, so we only pay the penalty of the full
build when the dockerfiles change. The main qemu-project/qemu
repo is used as a second cache, so that users forking QEMU will
see a fast turnaround time on their CI jobs.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com >
Message-Id: <20200622153318.751107-3-berrange@redhat.com >
[AJB: tweak the tag format]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Acked-by: Thomas Huth <thuth@redhat.com >
Message-Id: <20200701135652.1366-22-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Daniel P. Berrangé
d0caa0a881
gitlab: introduce explicit "container" and "build" stages
...
If no stage is listed, jobs get put in an implicit "test" stage.
Some jobs which create container images to be used by later stages
are currently listed as in a "build" stages.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com >
Acked-by: Laszlo Ersek <lersek@redhat.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Thomas Huth <thuth@redhat.com >
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Message-Id: <20200622153318.751107-2-berrange@redhat.com >
Message-Id: <20200701135652.1366-21-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Thomas Huth
5117ba25d2
gitlab-ci: Fix the change rules after moving the YML files
...
The edk2.yml and opensbi.yml files have recently been moved/renamed,
but the change has not been reflected in the rules in the YML files
yet.
Fixes: 922febe2af ("Move edk2 and opensbi YAML files to .gitlab-ci.d folder")
Signed-off-by: Thomas Huth <thuth@redhat.com >
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Laszlo Ersek <lersek@redhat.com >
Message-Id: <20200625151627.24986-1-thuth@redhat.com >
Message-Id: <20200701135652.1366-20-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Alex Bennée
91f6ff72b6
.gitignore: un-ignore .gitlab-ci.d
...
The sooner we deprecate in-tree builds the sooner this mess of regexes
can be thrown away.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Thomas Huth <thuth@redhat.com >
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Message-Id: <20200701135652.1366-19-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Alex Bennée
767b6bd22b
tests/docker: change tag naming scheme of our images
...
We've been misusing the tag naming scheme for some time by overloading
the post : section with the image type. Really it should be saved for
the revision of that particular build. Move the details to the other
side so we have:
qemu/image-name
with the implied :latest version added by the tooling.
Suggested-by: Daniel P. Berrangé <berrange@redhat.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Message-Id: <20200701135652.1366-18-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Alex Bennée
10c927dcc5
tests/docker: check for an parameters not empty string
...
Reported-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Suggested-by: Peter Maydell <peter.maydell@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Message-Id: <20200701135652.1366-17-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Alex Bennée
b09539444a
tests/vm: allow us to take advantage of MTTCG
...
We currently limit TCG guests to -smp 1 but now we have added some
aarch64 guests we can do better when running on x86_64 hardware.
Raise the limit for TCG guests when it is safe to do so.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Robert Foley <robert.foley@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Message-Id: <20200701135652.1366-16-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Alex Bennée
2fea3a125d
tests/vm: switch from optsparse to argparse
...
optparse has been deprecated since version 3.2 and argparse is the
blessed replacement. Take the opportunity to enhance our help output
showing defaults when called.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com >
Reviewed-by: Robert Foley <robert.foley@linaro.org >
Message-Id: <20200701135652.1366-15-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Robert Foley
ff14ab0c13
tests/vm: Add workaround to consume console
...
This adds support to basevm.py so that we always
drain the console chars. This makes use of
support added in an earlier commit that allows
QEMUMachine to use the ConsoleSocket.
This is a workaround we found was needed since
there is a known issue where QEMU will hang waiting
for console characters to be consumed.
We also added the option of logging the console to a file.
LOG_CONSOLE=1 will now log the output to a file.
Signed-off-by: Robert Foley <robert.foley@linaro.org >
Reviewed-by: Peter Puhov <peter.puhov@linaro.org >
Acked-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20200601211421.1277-10-robert.foley@linaro.org >
Message-Id: <20200701135652.1366-14-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Robert Foley
0fc8f660c5
python/qemu: Add ConsoleSocket for optional use in QEMUMachine
...
We add the ConsoleSocket object, which has a socket interface
and which will consume all arriving characters on the
socket, placing them into an in memory buffer.
This will also provide those chars via recv() as
would a regular socket.
ConsoleSocket also has the option of dumping
the console bytes to a log file.
We also give QEMUMachine the option of using ConsoleSocket
to drain and to use for logging console to a file.
By default QEMUMachine does not use ConsoleSocket.
This is added in preparation for use by basevm.py in a later commit.
This is a workaround we found was needed for basevm.py since
there is a known issue where QEMU will hang waiting
for console characters to be consumed.
Cc: Eduardo Habkost <ehabkost@redhat.com >
Cc: Cleber Rosa <crosa@redhat.com >
Signed-off-by: Robert Foley <robert.foley@linaro.org >
Reviewed-by: Peter Puhov <peter.puhov@linaro.org >
Acked-by: Alex Bennée <alex.bennee@linaro.org >
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20200601211421.1277-9-robert.foley@linaro.org >
Message-Id: <20200701135652.1366-13-alex.bennee@linaro.org >
2020-07-11 15:53:00 +01:00
Robert Foley
df00168039
tests/vm: change scripts to use self._config
...
This change converts existing scripts to using for example self.ROOT_PASS,
to self._config['root_pass'].
We made similar changes for GUEST_USER, and GUEST_PASS.
This allows us also to remove the change in basevm.py,
which adds __getattr__ for backwards compatibility.
Signed-off-by: Robert Foley <robert.foley@linaro.org >
Reviewed-by: Peter Puhov <peter.puhov@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Message-Id: <20200601211421.1277-8-robert.foley@linaro.org >
Message-Id: <20200701135652.1366-12-alex.bennee@linaro.org >
2020-07-11 15:52:59 +01:00
Robert Foley
d322fe2daf
tests/vm: Added a new script for centos.aarch64.
...
centos.aarch64 creates a CentOS 8 image.
Also added a new kickstart script used to build the centos.aarch64 image.
Signed-off-by: Robert Foley <robert.foley@linaro.org >
Reviewed-by: Peter Puhov <peter.puhov@linaro.org >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20200601211421.1277-7-robert.foley@linaro.org >
Message-Id: <20200701135652.1366-11-alex.bennee@linaro.org >
2020-07-11 15:52:59 +01:00
Robert Foley
13336606a5
tests/vm: Added a new script for ubuntu.aarch64.
...
ubuntu.aarch64 provides a script to create an Ubuntu 18.04 VM.
Another new file is also added aarch64vm.py, which is a module with
common methods used by aarch64 VMs, such as how to create the
flash images.
Signed-off-by: Robert Foley <robert.foley@linaro.org >
Reviewed-by: Peter Puhov <peter.puhov@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20200601211421.1277-6-robert.foley@linaro.org >
Message-Id: <20200701135652.1366-10-alex.bennee@linaro.org >
2020-07-11 15:52:59 +01:00
Robert Foley
e56833b48b
tests/vm: Add common Ubuntu python module
...
Add a common Ubuntu python module and make use of
it with the ubuntu.i386 script.
This is preparation for adding an Ubuntu script
ubuntu.aarch64. Splitting out the common
logic such as build_image() will reduce duplication.
Signed-off-by: Robert Foley <robert.foley@linaro.org >
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20200601211421.1277-5-robert.foley@linaro.org >
Message-Id: <20200701135652.1366-9-alex.bennee@linaro.org >
2020-07-11 15:52:59 +01:00
Robert Foley
3f1e8137f2
tests/vm: Added configuration file support
...
Changes to tests/vm/basevm.py to allow accepting a configuration file
as a parameter. Allows for specifying VM options such as
cpu, machine, memory, and arbitrary qemu arguments for specifying options
such as NUMA configuration.
Also added an example conf_example_aarch64.yml and conf_example_x86.yml.
Signed-off-by: Robert Foley <robert.foley@linaro.org >
Reviewed-by: Peter Puhov <peter.puhov@linaro.org >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20200601211421.1277-4-robert.foley@linaro.org >
Message-Id: <20200701135652.1366-8-alex.bennee@linaro.org >
2020-07-11 15:52:59 +01:00
Robert Foley
5d676197eb
tests/vm: Add configuration to basevm.py
...
Added use of a configuration to tests/vm/basevm.py.
The configuration provides parameters used to configure a VM.
This allows for providing alternate configurations to the VM being
created/launched. cpu, machine, memory, and NUMA configuration are all
examples of configuration which we might want to vary on the VM being created
or launched.
This will for example allow for creating an aarch64 vm.
Signed-off-by: Robert Foley <robert.foley@linaro.org >
Reviewed-by: Peter Puhov <peter.puhov@linaro.org >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20200601211421.1277-3-robert.foley@linaro.org >
Message-Id: <20200701135652.1366-7-alex.bennee@linaro.org >
2020-07-11 15:52:59 +01:00
Robert Foley
1f335d18e5
tests/vm: pass args through to BaseVM's __init__
...
Adding the args parameter to BaseVM's __init__.
We will shortly need to pass more parameters to the class
so let's just pass args rather than growing the parameter list.
Signed-off-by: Robert Foley <robert.foley@linaro.org >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
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 >
Message-Id: <20200601211421.1277-2-robert.foley@linaro.org >
Message-Id: <20200701135652.1366-6-alex.bennee@linaro.org >
2020-07-11 15:52:59 +01:00
Robert Foley
995f5c3c32
util/coroutine: Cleanup start_switch_fiber_ for TSAN.
...
This is a cleanup patch to follow-up the patch which introduced TSAN.
This patch makes separate start_switch_fiber_ functions for TSAN and ASAN.
This does two things:
1. Unrelated ASAN and TSAN code is separate and each function only
has arguments that are actually needed.
2. The co->tsan_caller_fiber and co->tsan_co_fiber fields are only
access from within #ifdef CONFIG_TSAN.
Signed-off-by: Robert Foley <robert.foley@linaro.org >
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20200626170001.27017-1-robert.foley@linaro.org >
Message-Id: <20200701135652.1366-5-alex.bennee@linaro.org >
2020-07-11 15:52:59 +01:00
David Edmondson
b418d26561
crypto/linux_keyring: fix 'secret_keyring' configure test
...
The configure test for 'secret_keyring' incorrectly checked the
'have_keyring' variable.
Fixes: 54e7aac056
Signed-off-by: David Edmondson <david.edmondson@oracle.com >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Thomas Huth <thuth@redhat.com >
Message-Id: <20200618092636.71832-1-david.edmondson@oracle.com >
Message-Id: <20200701135652.1366-4-alex.bennee@linaro.org >
2020-07-11 15:52:59 +01:00
Peter Maydell
d4a6bab1ec
Merge remote-tracking branch 'remotes/gkurz/tags/9p-fix-2020-07-10' into staging
...
Add missing NULL terminating element in fsdev option lists. Never
crashed QEMU by pure luck.
# gpg: Signature made Fri 10 Jul 2020 17:26:01 BST
# gpg: using RSA key B4828BAF943140CEF2A3491071D4D5E5822F73D6
# gpg: Good signature from "Greg Kurz <groug@kaod.org >" [full]
# gpg: aka "Gregory Kurz <gregory.kurz@free.fr >" [full]
# gpg: aka "[jpeg image of size 3330]" [full]
# Primary key fingerprint: B482 8BAF 9431 40CE F2A3 4910 71D4 D5E5 822F 73D6
* remotes/gkurz/tags/9p-fix-2020-07-10:
9p: null terminate fs driver options list
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
2020-07-11 15:11:30 +01:00
Peter Maydell
827937158b
Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20200710' into staging
...
xen patches
Fixes following harden checks in qdev.
# gpg: Signature made Fri 10 Jul 2020 14:05:46 BST
# gpg: using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
# gpg: issuer "anthony.perard@citrix.com "
# gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com >" [marginal]
# gpg: aka "Anthony PERARD <anthony.perard@citrix.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: 5379 2F71 024C 600F 778A 7161 D8D5 7199 DF83 42C8
# Subkey fingerprint: F80C 0063 08E2 2CFD 8A92 E798 0CF5 572F D7FB 55AF
* remotes/aperard/tags/pull-xen-20200710:
xen: cleanup unrealized flash devices
xen: Fix xen-legacy-backend qdev types
Signed-off-by: Peter Maydell <peter.maydell@linaro.org >
2020-07-11 13:56:03 +01:00
Philippe Mathieu-Daudé
19b293472f
target/avr/disas: Fix store instructions display order
...
While LOAD instructions use the target register as first
argument, STORE instructions use it as second argument:
LD Rd, X // Rd <- (X)
ST Y, Rd // (Y) <- Rr
Reported-by: Joaquin de Andres <me@xcancerberox.com.ar >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Message-Id: <20200707070021.10031-4-f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Philippe Mathieu-Daudé
2e34e622c2
target/avr/cpu: Fix $PC displayed address
...
$PC is 16-bit wide. Other registers display addresses on a byte
granularity.
To have a coherent ouput, display $PC using byte granularity too.
Reviewed-by: Thomas Huth <huth@tuxfamily.org >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Message-Id: <20200707070021.10031-3-f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Philippe Mathieu-Daudé
a291bc851d
target/avr/cpu: Drop tlb_flush() in avr_cpu_reset()
...
Since commit 1f5c00cfdb tlb_flush() is called from cpu_common_reset().
Reviewed-by: Thomas Huth <huth@tuxfamily.org >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Message-Id: <20200707070021.10031-2-f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Thomas Huth
c0a659f9de
target/avr: Add section into QEMU documentation
...
The new section explains basic ways of using AVR target in QEMU.
Signed-off-by: Michael Rolnik <mrolnik@gmail.com >
[thuth: Converted doc from texi to Sphinx syntax]
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-31-huth@tuxfamily.org >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Michael Rolnik
f5d31d6541
tests/acceptance: Test the Arduino MEGA2560 board
...
The test is based on
https://github.com/seharris/qemu-avr-tests/tree/master/free-rtos/Demo
demo which. If working correctly, prints 'ABCDEFGHIJKLMNOPQRSTUVWX' out.
it also demostrates that timer and IRQ are working
As the path name demonstrates, the FreeRTOS tests target a
board based on a ATMega2560 MCU. We have one, the Arduino
MEGA2560.
Complementary documentation:
https://feilipu.me/2012/01/15/ethermega-arduino-mega-2560-and-freertos/
https://feilipu.me/2015/11/24/arduino_freertos/ (see 'Compatibility')
Signed-off-by: Michael Rolnik <mrolnik@gmail.com >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
[rth: Squash multiple avocado fixups from f4bug]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Tested-by: Richard Henderson <richard.henderson@linaro.org >
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Acked-by: Thomas Huth <thuth@redhat.com >
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com >
2020-07-11 11:02:05 +02:00
Michael Rolnik
36838e5f78
tests/boot-serial: Test some Arduino boards (AVR based)
...
Print out 'T' through serial port.
The Arduino Duemilanove is based on a AVR5 CPU, while the
Arduino MEGA2560 on a AVR6 CPU.
Signed-off-by: Michael Rolnik <mrolnik@gmail.com >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
[rth: Squash Arduino adjustments from f4bug]
Tested-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Acked-by: Thomas Huth <thuth@redhat.com >
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-29-huth@tuxfamily.org >
2020-07-11 11:02:05 +02:00
Philippe Mathieu-Daudé
50486d63fb
hw/avr: Add limited support for some Arduino boards
...
Arduino boards are build with AVR chipsets. Add some of these
boards:
- Arduino Duemilanove
- Arduino Uno
- Arduino Mega
For more information:
https://www.arduino.cc/en/Main/Products
https://store.arduino.cc/arduino-genuino/most-popular
[AM: Remove word 'Atmel' from filenames and all elements of code]
Suggested-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Reviewed-by: Igor Mammedov <imammedo@redhat.com >
Reviewed-by: Joaquin de Andres <me@xcancerberox.com.ar >
[thuth: sysbus_init_child_obj() ==> object_initialize_child()]
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-26-huth@tuxfamily.org >
2020-07-11 11:02:05 +02:00
Philippe Mathieu-Daudé
af55b781aa
hw/avr: Add some ATmega microcontrollers
...
Add some AVR microcontrollers from the ATmega family:
- middle range: ATmega168 and ATmega328
- high range: ATmega1280 and ATmega2560
For product comparison:
https://www.microchip.com/wwwproducts/ProductCompare/ATmega168P/ATmega328P
https://www.microchip.com/wwwproducts/ProductCompare/ATmega1280/ATmega2560
Datasheets:
http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf
http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-2549-8-bit-AVR-Microcontroller-ATmega640-1280-1281-2560-2561_datasheet.pdf
[AM: Remove word 'Atmel' from filenames and all elements of code]
Suggested-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
[thuth: Rebased to master, fixed object_initialize_child() calls etc.]
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-25-huth@tuxfamily.org >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Philippe Mathieu-Daudé
7dd8f6fde4
hw/avr: Add support for loading ELF/raw binaries
...
Add avr_load_firmware() function to load firmware in ELF or
raw binary format.
[AM: Corrected the type of the variable containing e_flags]
[AM: Moved definition of e_flags conversion function to boot.c]
Suggested-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Reviewed-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-24-huth@tuxfamily.org >
[PMD: Replace load_image_targphys() by load_image_mr()]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Michael Rolnik
dc288de082
hw/misc: avr: Add limited support for power reduction device
...
This is a simple device of just one register, and whenever this
register is written to it calls qemu_set_irq function for each
of 8 bits/IRQs. It is used to implement AVR Power Reduction.
[AM: Remove word 'Atmel' from filenames and all elements of code]
Suggested-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Michael Rolnik <mrolnik@gmail.com >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
[rth: Squash include fix and file rename from f4bug]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-22-huth@tuxfamily.org >
2020-07-11 11:02:05 +02:00
Michael Rolnik
8ff47bc1a0
hw/timer: avr: Add limited support for 16-bit timer peripheral
...
These were designed to facilitate testing but should provide enough
function to be useful in other contexts. Only a subset of the functions
of each peripheral is implemented, mainly due to the lack of a standard
way to handle electrical connections (like GPIO pins).
[AM: Remove word 'Atmel' from filenames and all elements of code]
Suggested-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Sarah Harris <S.E.Harris@kent.ac.uk >
Signed-off-by: Ed Robbins <E.J.C.Robbins@kent.ac.uk >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
[rth: Squash info mtree fixes and a file rename from f4bug]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
[PMD: Use qemu_log_mask(LOG_UNIMP), replace goto by return]
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Reviewed-by: Alex Bennée <alex.bennee@linaro.org >
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-21-huth@tuxfamily.org >
[PMD: Check cpu-frequency-hz property in realize()]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Michael Rolnik
429ca9d665
hw/char: avr: Add limited support for USART peripheral
...
These were designed to facilitate testing but should provide enough
function to be useful in other contexts. Only a subset of the functions
of each peripheral is implemented, mainly due to the lack of a standard
way to handle electrical connections (like GPIO pins).
[AM: Remove word 'Atmel' from filenames and all elements of code]
Suggested-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Michael Rolnik <mrolnik@gmail.com >
Signed-off-by: Sarah Harris <S.E.Harris@kent.ac.uk >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
[rth: Squash I/O size fix and file rename from f4bug]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Reviewed-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-20-huth@tuxfamily.org >
2020-07-11 11:02:05 +02:00
Michael Rolnik
754cea8c4e
tests/machine-none: Add AVR support
...
Add a single code line that will automatically provide
'machine none' test.
Signed-off-by: Michael Rolnik <mrolnik@gmail.com >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com >
Reviewed-by: Thomas Huth <thuth@redhat.com >
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-28-huth@tuxfamily.org >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Michael Rolnik
42f3ff0013
target/avr: Register AVR support with the rest of QEMU
...
Add AVR related definitions into QEMU, make AVR support buildable.
[AM: Remove word 'Atmel' from filenames and all elements of code]
Suggested-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Michael Rolnik <mrolnik@gmail.com >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com >
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-23-huth@tuxfamily.org >
[PMD: Fixed @avr tag in qapi/machine.json]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Michael Rolnik
9d8caa67a2
target/avr: Add support for disassembling via option '-d in_asm'
...
Provide function disassembles executed instruction when '-d in_asm' is
provided.
Example:
$ qemu-system-avr -bios free-rtos/Demo/AVR_ATMega2560_GCC/demo.elf -d in_asm
...
IN:
0x0000014a: CALL 0x3808
IN: main
0x00003808: CALL 0x4b4
IN: vParTestInitialise
0x000004b4: LDI r24, 255
0x000004b6: STS r24, 0
0x000004b8: MULS r16, r20
0x000004ba: OUT $1, r24
0x000004bc: LDS r24, 0
0x000004be: MULS r16, r20
0x000004c0: OUT $2, r24
0x000004c2: RET
...
Suggested-by: Richard Henderson <richard.henderson@linaro.org >
Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Suggested-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Michael Rolnik <mrolnik@gmail.com >
[rth: Fix spacing and const mnemonic arrays]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-19-huth@tuxfamily.org >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Michael Rolnik
a107fdb072
target/avr: Initialize TCG register variables
...
Initialize TCG register variables.
Co-developed-by: Richard Henderson <richard.henderson@linaro.org >
Co-developed-by: Michael Rolnik <mrolnik@gmail.com >
Signed-off-by: Michael Rolnik <mrolnik@gmail.com >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Reviewed-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-18-huth@tuxfamily.org >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Michael Rolnik
9baade8d3b
target/avr: Add instruction translation - CPU main translation function
...
Add the core of translation mechanism.
Co-developed-by: Richard Henderson <richard.henderson@linaro.org >
Co-developed-by: Michael Rolnik <mrolnik@gmail.com >
Signed-off-by: Michael Rolnik <mrolnik@gmail.com >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Reviewed-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-17-huth@tuxfamily.org >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Michael Rolnik
46188cabae
target/avr: Add instruction translation - MCU Control Instructions
...
This includes:
- BREAK
- NOP
- SLEEP
- WDR
Signed-off-by: Michael Rolnik <mrolnik@gmail.com >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Reviewed-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-16-huth@tuxfamily.org >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Michael Rolnik
5718cef05a
target/avr: Add instruction translation - Bit and Bit-test Instructions
...
This includes:
- LSR, ROR
- ASR
- SWAP
- SBI, CBI
- BST, BLD
- BSET, BCLR
Signed-off-by: Michael Rolnik <mrolnik@gmail.com >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Reviewed-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-15-huth@tuxfamily.org >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
2020-07-11 11:02:05 +02:00
Michael Rolnik
9732b024f7
target/avr: Add instruction translation - Data Transfer Instructions
...
This includes:
- MOV, MOVW
- LDI, LDS LDX LDY LDZ
- LDDY, LDDZ
- STS, STX STY STZ
- STDY, STDZ
- LPM, LPMX
- ELPM, ELPMX
- SPM, SPMX
- IN, OUT
- PUSH, POP
- XCH
- LAS, LAC LAT
Signed-off-by: Michael Rolnik <mrolnik@gmail.com >
Signed-off-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com >
Reviewed-by: Aleksandar Markovic <aleksandar.m.mail@gmail.com >
Signed-off-by: Thomas Huth <huth@tuxfamily.org >
Message-Id: <20200705140315.260514-14-huth@tuxfamily.org >
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
2020-07-11 11:02:05 +02:00