mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/stefanha-gitlab/tags/block-pull-request' into staging
Pull request v4: * Add PCI_EXPRESS Kconfig dependency to fix s390x in "multi-process: setup PCI host bridge for remote device" [Philippe and Thomas] # gpg: Signature made Wed 10 Feb 2021 09:26:14 GMT # gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full] # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full] # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha-gitlab/tags/block-pull-request: (27 commits) docs: fix Parallels Image "dirty bitmap" section multi-process: perform device reset in the remote process multi-process: Retrieve PCI info from remote process multi-process: create IOHUB object to handle irq multi-process: Synchronize remote memory multi-process: PCI BAR read/write handling for proxy & remote endpoints multi-process: Forward PCI config space acceses to the remote process multi-process: add proxy communication functions multi-process: introduce proxy object multi-process: setup memory manager for remote device multi-process: Associate fd of a PCIDevice with its object multi-process: Initialize message handler in remote device multi-process: define MPQemuMsg format and transmission functions io: add qio_channel_readv_full_all_eof & qio_channel_readv_full_all helpers io: add qio_channel_writev_full_all helper multi-process: setup a machine object for remote device process multi-process: setup PCI host bridge for remote device multi-process: Add config option for multi-process QEMU memory: alloc RAM from file at offset multi-process: add configure and usage information ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -10,8 +10,8 @@ issues:
|
||||
comment: |
|
||||
Thank you for your interest in the QEMU project.
|
||||
|
||||
This repository is a read-only mirror of the project's master
|
||||
repostories hosted on https://git.qemu.org/git/qemu.git.
|
||||
This repository is a read-only mirror of the project's repostories hosted
|
||||
at https://gitlab.com/qemu-project/qemu.git.
|
||||
The project does not process issues filed on GitHub.
|
||||
|
||||
The project issues are tracked on Launchpad:
|
||||
@@ -24,8 +24,8 @@ pulls:
|
||||
comment: |
|
||||
Thank you for your interest in the QEMU project.
|
||||
|
||||
This repository is a read-only mirror of the project's master
|
||||
repostories hosted on https://git.qemu.org/git/qemu.git.
|
||||
This repository is a read-only mirror of the project's repostories hosted
|
||||
on https://gitlab.com/qemu-project/qemu.git.
|
||||
The project does not process merge requests filed on GitHub.
|
||||
|
||||
QEMU welcomes contributions of code (either fixing bugs or adding new
|
||||
|
||||
@@ -18,7 +18,6 @@ include:
|
||||
image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:latest
|
||||
before_script:
|
||||
- JOBS=$(expr $(nproc) + 1)
|
||||
- sed -i s,git.qemu.org/git,gitlab.com/qemu-project, .gitmodules
|
||||
script:
|
||||
- mkdir build
|
||||
- cd build
|
||||
|
||||
+22
-22
@@ -1,66 +1,66 @@
|
||||
[submodule "roms/seabios"]
|
||||
path = roms/seabios
|
||||
url = https://git.qemu.org/git/seabios.git/
|
||||
url = https://gitlab.com/qemu-project/seabios.git/
|
||||
[submodule "roms/SLOF"]
|
||||
path = roms/SLOF
|
||||
url = https://git.qemu.org/git/SLOF.git
|
||||
url = https://gitlab.com/qemu-project/SLOF.git
|
||||
[submodule "roms/ipxe"]
|
||||
path = roms/ipxe
|
||||
url = https://git.qemu.org/git/ipxe.git
|
||||
url = https://gitlab.com/qemu-project/ipxe.git
|
||||
[submodule "roms/openbios"]
|
||||
path = roms/openbios
|
||||
url = https://git.qemu.org/git/openbios.git
|
||||
url = https://gitlab.com/qemu-project/openbios.git
|
||||
[submodule "roms/qemu-palcode"]
|
||||
path = roms/qemu-palcode
|
||||
url = https://git.qemu.org/git/qemu-palcode.git
|
||||
url = https://gitlab.com/qemu-project/qemu-palcode.git
|
||||
[submodule "roms/sgabios"]
|
||||
path = roms/sgabios
|
||||
url = https://git.qemu.org/git/sgabios.git
|
||||
url = https://gitlab.com/qemu-project/sgabios.git
|
||||
[submodule "dtc"]
|
||||
path = dtc
|
||||
url = https://git.qemu.org/git/dtc.git
|
||||
url = https://gitlab.com/qemu-project/dtc.git
|
||||
[submodule "roms/u-boot"]
|
||||
path = roms/u-boot
|
||||
url = https://git.qemu.org/git/u-boot.git
|
||||
url = https://gitlab.com/qemu-project/u-boot.git
|
||||
[submodule "roms/skiboot"]
|
||||
path = roms/skiboot
|
||||
url = https://git.qemu.org/git/skiboot.git
|
||||
url = https://gitlab.com/qemu-project/skiboot.git
|
||||
[submodule "roms/QemuMacDrivers"]
|
||||
path = roms/QemuMacDrivers
|
||||
url = https://git.qemu.org/git/QemuMacDrivers.git
|
||||
url = https://gitlab.com/qemu-project/QemuMacDrivers.git
|
||||
[submodule "ui/keycodemapdb"]
|
||||
path = ui/keycodemapdb
|
||||
url = https://git.qemu.org/git/keycodemapdb.git
|
||||
url = https://gitlab.com/qemu-project/keycodemapdb.git
|
||||
[submodule "capstone"]
|
||||
path = capstone
|
||||
url = https://git.qemu.org/git/capstone.git
|
||||
url = https://gitlab.com/qemu-project/capstone.git
|
||||
[submodule "roms/seabios-hppa"]
|
||||
path = roms/seabios-hppa
|
||||
url = https://git.qemu.org/git/seabios-hppa.git
|
||||
url = https://gitlab.com/qemu-project/seabios-hppa.git
|
||||
[submodule "roms/u-boot-sam460ex"]
|
||||
path = roms/u-boot-sam460ex
|
||||
url = https://git.qemu.org/git/u-boot-sam460ex.git
|
||||
url = https://gitlab.com/qemu-project/u-boot-sam460ex.git
|
||||
[submodule "tests/fp/berkeley-testfloat-3"]
|
||||
path = tests/fp/berkeley-testfloat-3
|
||||
url = https://git.qemu.org/git/berkeley-testfloat-3.git
|
||||
url = https://gitlab.com/qemu-project/berkeley-testfloat-3.git
|
||||
[submodule "tests/fp/berkeley-softfloat-3"]
|
||||
path = tests/fp/berkeley-softfloat-3
|
||||
url = https://git.qemu.org/git/berkeley-softfloat-3.git
|
||||
url = https://gitlab.com/qemu-project/berkeley-softfloat-3.git
|
||||
[submodule "roms/edk2"]
|
||||
path = roms/edk2
|
||||
url = https://git.qemu.org/git/edk2.git
|
||||
url = https://gitlab.com/qemu-project/edk2.git
|
||||
[submodule "slirp"]
|
||||
path = slirp
|
||||
url = https://git.qemu.org/git/libslirp.git
|
||||
url = https://gitlab.com/qemu-project/libslirp.git
|
||||
[submodule "roms/opensbi"]
|
||||
path = roms/opensbi
|
||||
url = https://git.qemu.org/git/opensbi.git
|
||||
url = https://gitlab.com/qemu-project/opensbi.git
|
||||
[submodule "roms/qboot"]
|
||||
path = roms/qboot
|
||||
url = https://git.qemu.org/git/qboot.git
|
||||
url = https://gitlab.com/qemu-project/qboot.git
|
||||
[submodule "meson"]
|
||||
path = meson
|
||||
url = https://git.qemu.org/git/meson.git
|
||||
url = https://gitlab.com/qemu-project/meson.git
|
||||
[submodule "roms/vbootrom"]
|
||||
path = roms/vbootrom
|
||||
url = https://git.qemu.org/git/vbootrom.git
|
||||
url = https://gitlab.com/qemu-project/vbootrom.git
|
||||
|
||||
@@ -37,3 +37,7 @@ config VIRTFS
|
||||
|
||||
config PVRDMA
|
||||
bool
|
||||
|
||||
config MULTIPROCESS_ALLOWED
|
||||
bool
|
||||
imply MULTIPROCESS
|
||||
|
||||
+24
@@ -3200,6 +3200,30 @@ S: Maintained
|
||||
F: hw/semihosting/
|
||||
F: include/hw/semihosting/
|
||||
|
||||
Multi-process QEMU
|
||||
M: Elena Ufimtseva <elena.ufimtseva@oracle.com>
|
||||
M: Jagannathan Raman <jag.raman@oracle.com>
|
||||
M: John G Johnson <john.g.johnson@oracle.com>
|
||||
S: Maintained
|
||||
F: docs/devel/multi-process.rst
|
||||
F: docs/system/multi-process.rst
|
||||
F: hw/pci-host/remote.c
|
||||
F: include/hw/pci-host/remote.h
|
||||
F: hw/remote/machine.c
|
||||
F: include/hw/remote/machine.h
|
||||
F: hw/remote/mpqemu-link.c
|
||||
F: include/hw/remote/mpqemu-link.h
|
||||
F: hw/remote/message.c
|
||||
F: hw/remote/remote-obj.c
|
||||
F: include/hw/remote/memory.h
|
||||
F: hw/remote/memory.c
|
||||
F: hw/remote/proxy.c
|
||||
F: include/hw/remote/proxy.h
|
||||
F: hw/remote/proxy-memory-listener.c
|
||||
F: include/hw/remote/proxy-memory-listener.h
|
||||
F: hw/remote/iohub.c
|
||||
F: include/hw/remote/iohub.h
|
||||
|
||||
Build and test automation
|
||||
-------------------------
|
||||
Build and test automation
|
||||
|
||||
+2
-2
@@ -60,7 +60,7 @@ The QEMU source code is maintained under the GIT version control system.
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
git clone https://git.qemu.org/git/qemu.git
|
||||
git clone https://gitlab.com/qemu-project/qemu.git
|
||||
|
||||
When submitting patches, one common approach is to use 'git
|
||||
format-patch' and/or 'git send-email' to format & send the mail to the
|
||||
@@ -78,7 +78,7 @@ The QEMU website is also maintained under source control.
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
git clone https://git.qemu.org/git/qemu-web.git
|
||||
git clone https://gitlab.com/qemu-project/qemu-web.git
|
||||
|
||||
* `<https://www.qemu.org/2017/02/04/the-new-qemu-website-is-up/>`_
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ memfd_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
|
||||
name = host_memory_backend_get_name(backend);
|
||||
memory_region_init_ram_from_fd(&backend->mr, OBJECT(backend),
|
||||
name, backend->size,
|
||||
backend->share, fd, errp);
|
||||
backend->share, fd, 0, errp);
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
|
||||
@@ -463,6 +463,7 @@ skip_meson=no
|
||||
gettext="auto"
|
||||
fuse="auto"
|
||||
fuse_lseek="auto"
|
||||
multiprocess="no"
|
||||
|
||||
malloc_trim="auto"
|
||||
|
||||
@@ -797,6 +798,7 @@ Linux)
|
||||
linux="yes"
|
||||
linux_user="yes"
|
||||
vhost_user=${default_feature:-yes}
|
||||
multiprocess=${default_feature:-yes}
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1556,6 +1558,10 @@ for opt do
|
||||
;;
|
||||
--disable-fuse-lseek) fuse_lseek="disabled"
|
||||
;;
|
||||
--enable-multiprocess) multiprocess="yes"
|
||||
;;
|
||||
--disable-multiprocess) multiprocess="no"
|
||||
;;
|
||||
*)
|
||||
echo "ERROR: unknown option $opt"
|
||||
echo "Try '$0 --help' for more information"
|
||||
@@ -1908,6 +1914,7 @@ disabled with --disable-FEATURE, default is enabled if available
|
||||
libdaxctl libdaxctl support
|
||||
fuse FUSE block device export
|
||||
fuse-lseek SEEK_HOLE/SEEK_DATA support for FUSE exports
|
||||
multiprocess Multiprocess QEMU support
|
||||
|
||||
NOTE: The object files are built at the place where configure is launched
|
||||
EOF
|
||||
@@ -6082,6 +6089,9 @@ fi
|
||||
if test "$have_mlockall" = "yes" ; then
|
||||
echo "HAVE_MLOCKALL=y" >> $config_host_mak
|
||||
fi
|
||||
if test "$multiprocess" = "yes" ; then
|
||||
echo "CONFIG_MULTIPROCESS_ALLOWED=y" >> $config_host_mak
|
||||
fi
|
||||
if test "$fuzzing" = "yes" ; then
|
||||
# If LIB_FUZZING_ENGINE is set, assume we are running on OSS-Fuzz, and the
|
||||
# needed CFLAGS have already been provided
|
||||
|
||||
@@ -37,3 +37,4 @@ Contents:
|
||||
clocks
|
||||
qom
|
||||
block-coroutine-wrapper
|
||||
multi-process
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -208,7 +208,7 @@ of its data area are:
|
||||
28 - 31: l1_size
|
||||
The number of entries in the L1 table of the bitmap.
|
||||
|
||||
variable: l1 (64 * l1_size bytes)
|
||||
variable: l1_table (8 * l1_size bytes)
|
||||
L1 offset table (in bytes)
|
||||
|
||||
A dirty bitmap is stored using a one-level structure for the mapping to host
|
||||
|
||||
@@ -34,6 +34,7 @@ Contents:
|
||||
pr-manager
|
||||
targets
|
||||
security
|
||||
multi-process
|
||||
deprecated
|
||||
removed-features
|
||||
build-platforms
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
Multi-process QEMU
|
||||
==================
|
||||
|
||||
This document describes how to configure and use multi-process qemu.
|
||||
For the design document refer to docs/devel/qemu-multiprocess.
|
||||
|
||||
1) Configuration
|
||||
----------------
|
||||
|
||||
multi-process is enabled by default for targets that enable KVM
|
||||
|
||||
|
||||
2) Usage
|
||||
--------
|
||||
|
||||
Multi-process QEMU requires an orchestrator to launch.
|
||||
|
||||
Following is a description of command-line used to launch mpqemu.
|
||||
|
||||
* Orchestrator:
|
||||
|
||||
- The Orchestrator creates a unix socketpair
|
||||
|
||||
- It launches the remote process and passes one of the
|
||||
sockets to it via command-line.
|
||||
|
||||
- It then launches QEMU and specifies the other socket as an option
|
||||
to the Proxy device object
|
||||
|
||||
* Remote Process:
|
||||
|
||||
- QEMU can enter remote process mode by using the "remote" machine
|
||||
option.
|
||||
|
||||
- The orchestrator creates a "remote-object" with details about
|
||||
the device and the file descriptor for the device
|
||||
|
||||
- The remaining options are no different from how one launches QEMU with
|
||||
devices.
|
||||
|
||||
- Example command-line for the remote process is as follows:
|
||||
|
||||
/usr/bin/qemu-system-x86_64 \
|
||||
-machine x-remote \
|
||||
-device lsi53c895a,id=lsi0 \
|
||||
-drive id=drive_image2,file=/build/ol7-nvme-test-1.qcow2 \
|
||||
-device scsi-hd,id=drive2,drive=drive_image2,bus=lsi0.0,scsi-id=0 \
|
||||
-object x-remote-object,id=robj1,devid=lsi1,fd=4,
|
||||
|
||||
* QEMU:
|
||||
|
||||
- Since parts of the RAM are shared between QEMU & remote process, a
|
||||
memory-backend-memfd is required to facilitate this, as follows:
|
||||
|
||||
-object memory-backend-memfd,id=mem,size=2G
|
||||
|
||||
- A "x-pci-proxy-dev" device is created for each of the PCI devices emulated
|
||||
in the remote process. A "socket" sub-option specifies the other end of
|
||||
unix channel created by orchestrator. The "id" sub-option must be specified
|
||||
and should be the same as the "id" specified for the remote PCI device
|
||||
|
||||
- Example commandline for QEMU is as follows:
|
||||
|
||||
-device x-pci-proxy-dev,id=lsi0,socket=3
|
||||
@@ -27,6 +27,7 @@ source pci-host/Kconfig
|
||||
source pcmcia/Kconfig
|
||||
source pci/Kconfig
|
||||
source rdma/Kconfig
|
||||
source remote/Kconfig
|
||||
source rtc/Kconfig
|
||||
source scsi/Kconfig
|
||||
source sd/Kconfig
|
||||
|
||||
@@ -56,6 +56,7 @@ subdir('moxie')
|
||||
subdir('nios2')
|
||||
subdir('openrisc')
|
||||
subdir('ppc')
|
||||
subdir('remote')
|
||||
subdir('riscv')
|
||||
subdir('rx')
|
||||
subdir('s390x')
|
||||
|
||||
+2
-1
@@ -495,7 +495,8 @@ static void process_msg_shmem(IVShmemState *s, int fd, Error **errp)
|
||||
|
||||
/* mmap the region and map into the BAR2 */
|
||||
memory_region_init_ram_from_fd(&s->server_bar2, OBJECT(s),
|
||||
"ivshmem.bar2", size, true, fd, &local_err);
|
||||
"ivshmem.bar2", size, true, fd, 0,
|
||||
&local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
|
||||
@@ -65,3 +65,6 @@ config PCI_POWERNV
|
||||
select PCI_EXPRESS
|
||||
select MSI_NONBROKEN
|
||||
select PCIE_PORT
|
||||
|
||||
config REMOTE_PCIHOST
|
||||
bool
|
||||
|
||||
@@ -9,6 +9,7 @@ pci_ss.add(when: 'CONFIG_PCI_EXPRESS_XILINX', if_true: files('xilinx-pcie.c'))
|
||||
pci_ss.add(when: 'CONFIG_PCI_I440FX', if_true: files('i440fx.c'))
|
||||
pci_ss.add(when: 'CONFIG_PCI_SABRE', if_true: files('sabre.c'))
|
||||
pci_ss.add(when: 'CONFIG_XEN_IGD_PASSTHROUGH', if_true: files('xen_igd_pt.c'))
|
||||
pci_ss.add(when: 'CONFIG_REMOTE_PCIHOST', if_true: files('remote.c'))
|
||||
|
||||
# PPC devices
|
||||
pci_ss.add(when: 'CONFIG_PREP_PCI', if_true: files('prep.c'))
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Remote PCI host device
|
||||
*
|
||||
* Unlike PCI host devices that model physical hardware, the purpose
|
||||
* of this PCI host is to host multi-process QEMU devices.
|
||||
*
|
||||
* Multi-process QEMU extends the PCI host of a QEMU machine into a
|
||||
* remote process. Any PCI device attached to the remote process is
|
||||
* visible in the QEMU guest. This allows existing QEMU device models
|
||||
* to be reused in the remote process.
|
||||
*
|
||||
* This PCI host is purely a container for PCI devices. It's fake in the
|
||||
* sense that the guest never sees this PCI host and has no way of
|
||||
* accessing it. Its job is just to provide the environment that QEMU
|
||||
* PCI device models need when running in a remote process.
|
||||
*
|
||||
* Copyright © 2018, 2021 Oracle and/or its affiliates.
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu-common.h"
|
||||
|
||||
#include "hw/pci/pci.h"
|
||||
#include "hw/pci/pci_host.h"
|
||||
#include "hw/pci/pcie_host.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "hw/pci-host/remote.h"
|
||||
#include "exec/memory.h"
|
||||
|
||||
static const char *remote_pcihost_root_bus_path(PCIHostState *host_bridge,
|
||||
PCIBus *rootbus)
|
||||
{
|
||||
return "0000:00";
|
||||
}
|
||||
|
||||
static void remote_pcihost_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
PCIHostState *pci = PCI_HOST_BRIDGE(dev);
|
||||
RemotePCIHost *s = REMOTE_PCIHOST(dev);
|
||||
|
||||
pci->bus = pci_root_bus_new(DEVICE(s), "remote-pci",
|
||||
s->mr_pci_mem, s->mr_sys_io,
|
||||
0, TYPE_PCIE_BUS);
|
||||
}
|
||||
|
||||
static void remote_pcihost_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(klass);
|
||||
|
||||
hc->root_bus_path = remote_pcihost_root_bus_path;
|
||||
dc->realize = remote_pcihost_realize;
|
||||
|
||||
dc->user_creatable = false;
|
||||
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
|
||||
dc->fw_name = "pci";
|
||||
}
|
||||
|
||||
static const TypeInfo remote_pcihost_info = {
|
||||
.name = TYPE_REMOTE_PCIHOST,
|
||||
.parent = TYPE_PCIE_HOST_BRIDGE,
|
||||
.instance_size = sizeof(RemotePCIHost),
|
||||
.class_init = remote_pcihost_class_init,
|
||||
};
|
||||
|
||||
static void remote_pcihost_register(void)
|
||||
{
|
||||
type_register_static(&remote_pcihost_info);
|
||||
}
|
||||
|
||||
type_init(remote_pcihost_register)
|
||||
@@ -0,0 +1,4 @@
|
||||
config MULTIPROCESS
|
||||
bool
|
||||
depends on PCI && PCI_EXPRESS && KVM
|
||||
select REMOTE_PCIHOST
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user