Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/stsquad/tags/pull-for-6.1-rc1-2…
Browse files Browse the repository at this point in the history
…30721-1' into staging

Doc, metadata, plugin and testing updates for 6.1-rc1:

  - git ignore some file editor detritus
  - add overview on device emulation terminology
  - remove needless if leg in configure custom devices logic
  - numerous gitdm/mailmap updates
  - fix plugin_exit race for linux-user
  - fix a few bugs in cache modelling plugin
  - fix plugin calculation of physical address
  - handle pure assembler/linker tcg tests outside of docker
  - add tricore build to gitlab
  - remove superfluous MacOSX task
  - generalise the OpenBSI gitlab rules

# gpg: Signature made Fri 23 Jul 2021 17:28:26 BST
# gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# 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

* remotes/stsquad/tags/pull-for-6.1-rc1-230721-1: (28 commits)
  gitlab-ci: Extract OpenSBI job rules to reusable section
  gitlab-ci: Remove the second superfluous macos task
  gitlab: enable a very minimal build with the tricore container
  tests/tcg/configure.sh: add handling for assembler only builds
  plugins: Fix physical address calculation for IO regions
  plugins/cache: Fixed "function decl. is not a prototype" warnings
  plugins/cache: limited the scope of a mutex lock
  plugins/cache: Fixed a bug with destroying FIFO metadata
  tcg/plugins: implement a qemu_plugin_user_exit helper
  contrib/gitdm: add more individual contributor entries.
  contrib/gitdm: add a new interns group-map for GSoC/Outreachy work
  contrib/gitdm: add an explicit academic entry for BU
  contrib/gitdm: add group-map for Netflix
  contrib/gitdm: add domain-map for NVIDIA
  contrib/gitdm: add domain-map for Crudebyte
  contrib/gitdm: un-ironically add a mapping for LWN
  contrib/gitdm: add domain-map/group-map for Wind River
  contrib/gitdm: add domain-map for Eldorado
  contrib/gitdm: add domain-map/group-map mappings for Samsung
  gitdm.config: sort the corporate GroupMap entries
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Jul 26, 2021
2 parents a237650 + 0a9487d commit 34fd92a
Show file tree
Hide file tree
Showing 32 changed files with 366 additions and 57 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -13,3 +13,5 @@ GTAGS
*~
*.ast_raw
*.depend_raw
*.swp
*.patch
11 changes: 11 additions & 0 deletions .gitlab-ci.d/buildtest.yml
Expand Up @@ -354,6 +354,17 @@ build-some-softmmu:
TARGETS: xtensa-softmmu arm-softmmu aarch64-softmmu alpha-softmmu
MAKE_CHECK_ARGS: check-tcg

# We build tricore in a very minimal tricore only container
build-tricore-softmmu:
extends: .native_build_job_template
needs:
job: tricore-debian-cross-container
variables:
IMAGE: debian-tricore-cross
CONFIGURE_ARGS: --disable-tools --disable-fdt --enable-debug
TARGETS: tricore-softmmu
MAKE_CHECK_ARGS: check-tcg

clang-system:
extends: .native_build_job_template
needs:
Expand Down
15 changes: 0 additions & 15 deletions .gitlab-ci.d/cirrus.yml
Expand Up @@ -85,18 +85,3 @@ x64-macos-11-base-build:
PATH_EXTRA: /usr/local/opt/ccache/libexec:/usr/local/opt/gettext/bin
PKG_CONFIG_PATH: /usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/ncurses/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig
TEST_TARGETS: check-unit check-block check-qapi-schema check-softfloat check-qtest-x86_64

x64-macos-11-xcode-build:
extends: .cirrus_build_job
variables:
NAME: macos-11
CIRRUS_VM_INSTANCE_TYPE: osx_instance
CIRRUS_VM_IMAGE_SELECTOR: image
CIRRUS_VM_IMAGE_NAME: big-sur-xcode
CIRRUS_VM_CPUS: 12
CIRRUS_VM_RAM: 24G
UPDATE_COMMAND: brew update
INSTALL_COMMAND: brew install
PATH_EXTRA: /usr/local/opt/ccache/libexec:/usr/local/opt/gettext/bin
PKG_CONFIG_PATH: /usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/ncurses/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig
TEST_TARGETS: check-unit check-block check-qapi-schema check-softfloat check-qtest-x86_64
28 changes: 17 additions & 11 deletions .gitlab-ci.d/opensbi.yml
@@ -1,10 +1,23 @@
docker-opensbi:
stage: containers
rules: # Only run this job when the Dockerfile is modified
# All jobs needing docker-opensbi must use the same rules it uses.
.opensbi_job_rules:
rules: # Only run this job when ...
- changes:
# this file is modified
- .gitlab-ci.d/opensbi.yml
# or the Dockerfile is modified
- .gitlab-ci.d/opensbi/Dockerfile
when: always
- changes: # or roms/opensbi/ is modified (submodule updated)
- roms/opensbi/*
when: always
- if: '$CI_COMMIT_REF_NAME =~ /^opensbi/' # or the branch/tag starts with 'opensbi'
when: always
- if: '$CI_COMMIT_MESSAGE =~ /opensbi/i' # or last commit description contains 'OpenSBI'
when: always

docker-opensbi:
extends: .opensbi_job_rules
stage: containers
image: docker:19.03.1
services:
- docker:19.03.1-dind
Expand All @@ -24,16 +37,9 @@ docker-opensbi:
- docker push $IMAGE_TAG

build-opensbi:
extends: .opensbi_job_rules
stage: build
needs: ['docker-opensbi']
rules: # Only run this job when ...
- changes: # ... roms/opensbi/ is modified (submodule updated)
- roms/opensbi/*
when: always
- if: '$CI_COMMIT_REF_NAME =~ /^opensbi/' # or the branch/tag starts with 'opensbi'
when: always
- if: '$CI_COMMIT_MESSAGE =~ /opensbi/i' # or last commit description contains 'OpenSBI'
when: always
artifacts:
paths: # 'artifacts.zip' will contains the following files:
- pc-bios/opensbi-riscv32-generic-fw_dynamic.bin
Expand Down
4 changes: 4 additions & 0 deletions .mailmap
Expand Up @@ -27,6 +27,10 @@ Paul Brook <paul@codesourcery.com> pbrook <pbrook@c046a42c-6fe2-441c-8c8c-714662
Thiemo Seufer <ths@networkno.de> ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>
malc <av1474@comtv.ru> malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162>

# Corrupted Author fields
Marek Dolata <mkdolata@us.ibm.com> mkdolata@us.ibm.com <mkdolata@us.ibm.com>
Nick Hudson <hnick@vmware.com> hnick@vmware.com <hnick@vmware.com>

# There is also a:
# (no author) <(no author)@c046a42c-6fe2-441c-8c8c-71466251a162>
# for the cvs2svn initialization commit e63c3dc74bf.
Expand Down
6 changes: 3 additions & 3 deletions bsd-user/syscall.c
Expand Up @@ -335,7 +335,7 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,
_mcleanup();
#endif
gdb_exit(arg1);
qemu_plugin_atexit_cb();
qemu_plugin_user_exit();
/* XXX: should free thread stack and CPU env */
_exit(arg1);
ret = 0; /* avoid warning */
Expand Down Expand Up @@ -437,7 +437,7 @@ abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1,
_mcleanup();
#endif
gdb_exit(arg1);
qemu_plugin_atexit_cb();
qemu_plugin_user_exit();
/* XXX: should free thread stack and CPU env */
_exit(arg1);
ret = 0; /* avoid warning */
Expand Down Expand Up @@ -516,7 +516,7 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1,
_mcleanup();
#endif
gdb_exit(arg1);
qemu_plugin_atexit_cb();
qemu_plugin_user_exit();
/* XXX: should free thread stack and CPU env */
_exit(arg1);
ret = 0; /* avoid warning */
Expand Down
10 changes: 4 additions & 6 deletions configure
Expand Up @@ -5103,12 +5103,10 @@ if test "$skip_meson" = no; then
echo "[properties]" >> $cross

# unroll any custom device configs
if test -n "$device_archs"; then
for a in $device_archs; do
eval "c=\$devices_${a}"
echo "${a}-softmmu = '$c'" >> $cross
done
fi
for a in $device_archs; do
eval "c=\$devices_${a}"
echo "${a}-softmmu = '$c'" >> $cross
done

test -z "$cxx" && echo "link_language = 'c'" >> $cross
echo "[built-in options]" >> $cross
Expand Down
6 changes: 6 additions & 0 deletions contrib/gitdm/aliases
Expand Up @@ -31,6 +31,12 @@ pbrook@c046a42c-6fe2-441c-8c8c-71466251a162 paul@codesourcery.com
ths@c046a42c-6fe2-441c-8c8c-71466251a162 ths@networkno.de
malc@c046a42c-6fe2-441c-8c8c-71466251a162 av1474@comtv.ru

# canonical emails
liq3ea@163.com liq3ea@gmail.com

# some broken tags
yuval.shaia.ml.gmail.com yuval.shaia.ml@gmail.com

# There is also a:
# (no author) <(no author)@c046a42c-6fe2-441c-8c8c-71466251a162>
# for the cvs2svn initialization commit e63c3dc74bf.
Expand Down
7 changes: 7 additions & 0 deletions contrib/gitdm/domain-map
Expand Up @@ -9,6 +9,8 @@ baidu.com Baidu
bytedance.com ByteDance
cmss.chinamobile.com China Mobile
citrix.com Citrix
crudebyte.com Crudebyte
eldorado.org.br Instituto de Pesquisas Eldorado
fujitsu.com Fujitsu
google.com Google
greensocs.com GreenSocs
Expand All @@ -17,20 +19,25 @@ ibm.com IBM
igalia.com Igalia
intel.com Intel
linaro.org Linaro
lwn.net LWN
microsoft.com Microsoft
mvista.com MontaVista
nokia.com Nokia
nuviainc.com NUVIA
nvidia.com NVIDIA
oracle.com Oracle
proxmox.com Proxmox
quicinc.com Qualcomm Innovation Center
redhat.com Red Hat
rt-rk.com RT-RK
samsung.com Samsung
siemens.com Siemens
sifive.com SiFive
suse.com SUSE
suse.de SUSE
virtuozzo.com Virtuozzo
wdc.com Western Digital
windriver.com Wind River
xilinx.com Xilinx
yadro.com YADRO
yandex-team.ru Yandex
3 changes: 3 additions & 0 deletions contrib/gitdm/group-map-academics
Expand Up @@ -16,3 +16,6 @@ cota@braap.org
uni-paderborn.de
edu
edu.cn

# Boston University
bu.edu
5 changes: 5 additions & 0 deletions contrib/gitdm/group-map-individuals
Expand Up @@ -29,3 +29,8 @@ mrolnik@gmail.com
huth@tuxfamily.org
jhogan@kernel.org
atar4qemu@gmail.com
minwoo.im.dev@gmail.com
bmeng.cn@gmail.com
liq3ea@gmail.com
chetan4windows@gmail.com
akihiko.odaki@gmail.com
13 changes: 13 additions & 0 deletions contrib/gitdm/group-map-interns
@@ -0,0 +1,13 @@
#
# Group together everyone working as an intern via one of the various
# outreach programs.
#

# GSoC 2020 Virtual FIDO/U2F security key
cesar.belley@lse.epita.fr

# GSoC 2020 TCG performance
ahmedkhaledkaraman@gmail.com

# GSoC 2021 TCG plugins
ma.mandourr@gmail.com
5 changes: 5 additions & 0 deletions contrib/gitdm/group-map-netflix
@@ -0,0 +1,5 @@
#
# Netflix contributors using their personal emails
#

imp@bsdimp.com
7 changes: 7 additions & 0 deletions contrib/gitdm/group-map-robots
@@ -0,0 +1,7 @@
#
# There are various automatic robots that occasionally scan and report
# bugs. Let's group them together here.
#

# Euler Robot
euler.robot@huawei.com
11 changes: 5 additions & 6 deletions contrib/plugins/cache.c
Expand Up @@ -200,7 +200,7 @@ static void fifo_destroy(Cache *cache)
{
int i;

for (i = 0; i < cache->assoc; i++) {
for (i = 0; i < cache->num_sets; i++) {
g_queue_free(cache->sets[i].fifo_queue);
}
}
Expand Down Expand Up @@ -355,15 +355,14 @@ static void vcpu_mem_access(unsigned int vcpu_index, qemu_plugin_meminfo_t info,
struct qemu_plugin_hwaddr *hwaddr;
InsnData *insn;

g_mutex_lock(&mtx);
hwaddr = qemu_plugin_get_hwaddr(info, vaddr);
if (hwaddr && qemu_plugin_hwaddr_is_io(hwaddr)) {
g_mutex_unlock(&mtx);
return;
}

effective_addr = hwaddr ? qemu_plugin_hwaddr_phys_addr(hwaddr) : vaddr;

g_mutex_lock(&mtx);
if (!access_cache(dcache, effective_addr)) {
insn = (InsnData *) userdata;
insn->dmisses++;
Expand Down Expand Up @@ -470,7 +469,7 @@ static int icmp(gconstpointer a, gconstpointer b)
return insn_a->imisses < insn_b->imisses ? 1 : -1;
}

static void log_stats()
static void log_stats(void)
{
g_autoptr(GString) rep = g_string_new("");
g_string_append_printf(rep,
Expand All @@ -488,7 +487,7 @@ static void log_stats()
qemu_plugin_outs(rep->str);
}

static void log_top_insns()
static void log_top_insns(void)
{
int i;
GList *curr, *miss_insns;
Expand Down Expand Up @@ -537,7 +536,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p)
g_hash_table_destroy(miss_ht);
}

static void policy_init()
static void policy_init(void)
{
switch (policy) {
case LRU:
Expand Down
2 changes: 2 additions & 0 deletions docs/interop/vhost-user.rst
@@ -1,3 +1,5 @@
.. _vhost_user_proto:

===================
Vhost-user Protocol
===================
Expand Down
90 changes: 90 additions & 0 deletions docs/system/device-emulation.rst
@@ -0,0 +1,90 @@
.. _device-emulation:

Device Emulation
----------------

QEMU supports the emulation of a large number of devices from
peripherals such network cards and USB devices to integrated systems
on a chip (SoCs). Configuration of these is often a source of
confusion so it helps to have an understanding of some of the terms
used to describes devices within QEMU.

Common Terms
~~~~~~~~~~~~

Device Front End
================

A device front end is how a device is presented to the guest. The type
of device presented should match the hardware that the guest operating
system is expecting to see. All devices can be specified with the
``--device`` command line option. Running QEMU with the command line
options ``--device help`` will list all devices it is aware of. Using
the command line ``--device foo,help`` will list the additional
configuration options available for that device.

A front end is often paired with a back end, which describes how the
host's resources are used in the emulation.

Device Buses
============

Most devices will exist on a BUS of some sort. Depending on the
machine model you choose (``-M foo``) a number of buses will have been
automatically created. In most cases the BUS a device is attached to
can be inferred, for example PCI devices are generally automatically
allocated to the next free address of first PCI bus found. However in
complicated configurations you can explicitly specify what bus
(``bus=ID``) a device is attached to along with its address
(``addr=N``).

Some devices, for example a PCI SCSI host controller, will add an
additional buses to the system that other devices can be attached to.
A hypothetical chain of devices might look like:

--device foo,bus=pci.0,addr=0,id=foo
--device bar,bus=foo.0,addr=1,id=baz

which would be a bar device (with the ID of baz) which is attached to
the first foo bus (foo.0) at address 1. The foo device which provides
that bus is itself is attached to the first PCI bus (pci.0).


Device Back End
===============

The back end describes how the data from the emulated device will be
processed by QEMU. The configuration of the back end is usually
specific to the class of device being emulated. For example serial
devices will be backed by a ``--chardev`` which can redirect the data
to a file or socket or some other system. Storage devices are handled
by ``--blockdev`` which will specify how blocks are handled, for
example being stored in a qcow2 file or accessing a raw host disk
partition. Back ends can sometimes be stacked to implement features
like snapshots.

While the choice of back end is generally transparent to the guest,
there are cases where features will not be reported to the guest if
the back end is unable to support it.

Device Pass Through
===================

Device pass through is where the device is actually given access to
the underlying hardware. This can be as simple as exposing a single
USB device on the host system to the guest or dedicating a video card
in a PCI slot to the exclusive use of the guest.


Emulated Devices
~~~~~~~~~~~~~~~~

.. toctree::
:maxdepth: 1

devices/ivshmem.rst
devices/net.rst
devices/nvme.rst
devices/usb.rst
devices/vhost-user.rst
devices/virtio-pmem.rst
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 34fd92a

Please sign in to comment.