[libvirt][PATCH v9 0/5] Support query and use SGX
by Haibin Huang
This patch series provides support for enabling Intel's Software Guard
Extensions (SGX) feature in guest VM.
Giving the SGX support in QEMU be accepted and will be merged in two
days Intel SGX is a set of instructions that increases the security
of application code and data, giving them more protection from disclosure
or modification.
Developers can partition sensitive information into enclaves, which are
areas of execution in memory with more security protection.
The typical flow looks below at very high level:
1. Calls virConnectGetDomainCapabilities API to domain capabilities that
includes the following SGX information.
<feature>
...
<sgx supported='yes'>
<epc_size unit='KiB'>N</epc_size>
</sgx>
</feature>
2. User requests to start a guest calling virCreateXML() with SGX requirement.
It should contain
<devices>
...
<memory model='sgx-epc'>
<target>
<size unit='KiB'>N</size>
</target>
</memory>
...
</devices>
Haibin Huang (2):
Get SGX Capabilities from QEMU
Transfer Qemu SGX Capabilities to XML
Lin Yang (3):
conf: Introduce SGX EPC element into device memory xml
qemu: Add command-line to generate SGX EPC memory backend
Add unit tests for guest VM creation command with SGX EPC
docs/schemas/domaincaps.rng | 22 ++-
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_capabilities.c | 29 ++++
src/conf/domain_capabilities.h | 13 ++
src/conf/domain_conf.c | 6 +
src/conf/domain_conf.h | 1 +
src/conf/domain_validate.c | 1 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_alias.c | 6 +-
src/qemu/qemu_capabilities.c | 143 +++++++++++++++++-
src/qemu/qemu_capabilities.h | 4 +
src/qemu/qemu_command.c | 41 ++++-
src/qemu/qemu_domain.c | 12 +-
src/qemu/qemu_domain_address.c | 6 +
src/qemu/qemu_driver.c | 1 +
src/qemu/qemu_monitor.c | 10 ++
src/qemu/qemu_monitor.h | 3 +
src/qemu/qemu_monitor_json.c | 83 ++++++++++
src/qemu/qemu_monitor_json.h | 3 +
src/qemu/qemu_process.c | 2 +
src/qemu/qemu_validate.c | 8 +
src/security/security_apparmor.c | 1 +
src/security/security_dac.c | 2 +
src/security/security_selinux.c | 2 +
tests/domaincapsdata/bhyve_basic.x86_64.xml | 1 +
tests/domaincapsdata/bhyve_fbuf.x86_64.xml | 1 +
tests/domaincapsdata/bhyve_uefi.x86_64.xml | 1 +
tests/domaincapsdata/empty.xml | 1 +
tests/domaincapsdata/libxl-xenfv.xml | 1 +
tests/domaincapsdata/libxl-xenpv.xml | 1 +
.../domaincapsdata/qemu_2.11.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.11.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_2.11.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_2.11.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.12.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.12.0-tcg.x86_64.xml | 1 +
.../qemu_2.12.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_2.12.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_2.12.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_2.12.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_2.12.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.4.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.4.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_2.4.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.5.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.5.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_2.5.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.6.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.6.0-tcg.x86_64.xml | 1 +
.../qemu_2.6.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_2.6.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_2.6.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_2.6.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.7.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.7.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_2.7.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_2.7.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.8.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.8.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_2.8.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_2.8.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.9.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_2.9.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_2.9.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_2.9.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_2.9.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_3.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_3.0.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_3.0.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_3.0.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_3.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_3.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_3.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_3.1.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_3.1.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_4.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_4.0.0-tcg.x86_64.xml | 1 +
.../qemu_4.0.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_4.0.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_4.0.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_4.0.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_4.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_4.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_4.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_4.1.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_4.2.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_4.2.0-tcg.x86_64.xml | 1 +
.../qemu_4.2.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_4.2.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_4.2.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.0.0-tcg.x86_64.xml | 1 +
.../qemu_5.0.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_5.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_5.1.0.sparc.xml | 1 +
tests/domaincapsdata/qemu_5.1.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.2.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_5.2.0-tcg.x86_64.xml | 1 +
.../qemu_5.2.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_5.2.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_5.2.0.ppc64.xml | 1 +
tests/domaincapsdata/qemu_5.2.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_5.2.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_6.0.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_6.0.0-tcg.x86_64.xml | 1 +
.../qemu_6.0.0-virt.aarch64.xml | 1 +
tests/domaincapsdata/qemu_6.0.0.aarch64.xml | 1 +
tests/domaincapsdata/qemu_6.0.0.s390x.xml | 1 +
tests/domaincapsdata/qemu_6.0.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_6.1.0-q35.x86_64.xml | 1 +
.../domaincapsdata/qemu_6.1.0-tcg.x86_64.xml | 1 +
tests/domaincapsdata/qemu_6.1.0.x86_64.xml | 1 +
.../domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 4 +
.../domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 4 +
tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 4 +
.../caps_6.2.0.x86_64.replies | 22 ++-
.../caps_6.2.0.x86_64.xml | 5 +
.../sgx-epc.x86_64-6.2.0.args | 37 +++++
tests/qemuxml2argvdata/sgx-epc.xml | 36 +++++
tests/qemuxml2argvtest.c | 2 +
126 files changed, 597 insertions(+), 12 deletions(-)
create mode 100644 tests/qemuxml2argvdata/sgx-epc.x86_64-6.2.0.args
create mode 100644 tests/qemuxml2argvdata/sgx-epc.xml
--
2.17.1
2 years, 10 months
[RFC 0/1] qemu: update index for serial device using taget.port
by divya
Issue
-----
The port being provided in the xml file of the domain is not being used for the
creation of qemu command.
On adding the serial device :
<serial>
<target type='serial' port='3'/>
</serial>
Generated qemu command will look like :
/usr/libexec/qemu-kvm ...\
-device isa-serial,chardev=charserial0,id=serial0
Actually it should be :
/usr/libexec/qemu-kvm ...\
-device isa-serial,chardev=charserial0,id=serial0,index=3
Patch
-----
Out already for the correction :
https://listman.redhat.com/archives/libvir-list/2018-April/msg02302.html
This patch was not followed up. According to me there are multiple reasons
Reasons for not following up
----------------------------
Index : specifies the index number of a connector port. If not specified, the
index is automatically incremented. This logic exists both on qemu as well as
libvirt.
https://github.com/qemu/qemu/blob/master/hw/char/serial-isa.c#L62
Issue 1:
If we want two isa-serial devices and for the first one is we mention the port
to be 3, then for the next device it not automatically assign the port number
4 which will throw the following error :
error: internal error: process exited while connecting to monitor:
2021-11-12T11:05:31.169987Z qemu-kvm: -device
isa-serial,chardev=charserial2,id=serial2,index=5: Max. supported number of ISA
serial ports is 4.
But we are left with 3 ports (0,1,2) which are unused. So ideally we should
have used them.
Issue 2:
It is possible that two devices get the same port address which might lead to a
lot of ambiguity. Example: we want two devices and for the second one we
provide the index 0. Then from default logic the first device will be allotted
port 0 and the second device will overwrite it and get port 0.
Solution :
----------
Port allocation logic
1. Precedence should be given to serial devices as we only have the first 4
ports for them.
1.1. Check the command line/xml file, scan for all the devices mentioned
and then start with the isa-serial devices for port allocation.
2.Maintain a buffer(bitmap) for marking the allocated ports.
3.While assigning a port to the device
3.1. If no port is provided by the user : provide the next available port.
3.2. Else check:
3.2.1. If the port is already allocated : throw the error.
3.2.2. Else allocate the port.
3.3. If out of ports : throw error -> qemu throws the error.
Libvirt manages the port numbers with the similar logic(auto increment) along
with the above mentioned bug. Hence need to add the above patch along with the
Port allocation logic.
root (1):
update index for serial device using taget.port
src/conf/domain_conf.c | 70 +++++++++++++++++--
src/qemu/qemu_command.c | 20 ++++--
tests/qemuhotplugtest.c | 1 -
...g-console-compat-2-live+console-virtio.xml | 4 +-
.../qemuhotplug-console-compat-2-live.xml | 4 +-
tests/qemuxml2argvdata/bios.args | 2 +-
.../qemuxml2argvdata/console-compat-auto.args | 2 +-
.../console-compat-chardev.args | 2 +-
tests/qemuxml2argvdata/console-compat.args | 2 +-
.../qemuxml2argvdata/console-virtio-many.args | 2 +-
tests/qemuxml2argvdata/controller-order.args | 2 +-
.../name-escape.x86_64-2.11.0.args | 4 +-
tests/qemuxml2argvdata/name-escape.xml | 1 +
.../q35-virt-manager-basic.args | 2 +-
.../serial-dev-chardev-iobase.args | 2 +-
.../qemuxml2argvdata/serial-dev-chardev.args | 2 +-
.../qemuxml2argvdata/serial-file-chardev.args | 2 +-
tests/qemuxml2argvdata/serial-file-log.args | 2 +-
.../qemuxml2argvdata/serial-many-chardev.args | 4 +-
.../qemuxml2argvdata/serial-pty-chardev.args | 2 +-
tests/qemuxml2argvdata/serial-spiceport.args | 2 +-
.../qemuxml2argvdata/serial-tcp-chardev.args | 2 +-
.../serial-tcp-telnet-chardev.args | 2 +-
.../serial-tcp-tlsx509-chardev-notls.args | 8 ++-
.../serial-tcp-tlsx509-chardev-notls.xml | 18 ++++-
.../serial-tcp-tlsx509-chardev-verify.args | 4 +-
.../serial-tcp-tlsx509-chardev-verify.xml | 2 +-
.../serial-tcp-tlsx509-chardev.args | 4 +-
.../serial-tcp-tlsx509-chardev.xml | 2 +-
.../serial-tcp-tlsx509-secret-chardev.args | 4 +-
.../serial-tcp-tlsx509-secret-chardev.xml | 2 +-
.../qemuxml2argvdata/serial-udp-chardev.args | 4 +-
.../qemuxml2argvdata/serial-unix-chardev.args | 4 +-
.../serial-unix-chardev.x86_64-latest.args | 4 +-
tests/qemuxml2argvdata/serial-vc-chardev.args | 2 +-
tests/qemuxml2argvdata/user-aliases.args | 4 +-
.../virtio-9p-createmode.x86_64-latest.args | 2 +-
.../virtio-9p-multidevs.x86_64-latest.args | 2 +-
.../x86_64-pc-graphics.x86_64-latest.args | 2 +-
.../x86_64-pc-headless.x86_64-latest.args | 2 +-
.../x86_64-q35-graphics.x86_64-latest.args | 2 +-
.../x86_64-q35-headless.x86_64-latest.args | 2 +-
.../serial-tcp-tlsx509-chardev.xml | 2 +-
43 files changed, 149 insertions(+), 65 deletions(-)
--
2.27.0
2 years, 10 months
[PATCH v6 0/4] remove sysconfig files
by Olaf Hering
fix virtnetworkd
avoid duplicate %posttrans sections (berrange)
add comment to %libvirt_sc_pre (berrange)
rebased to adc0eaead0ebe11f38798e431d2748bfe9b54a30
Olaf Hering (4):
rpm: fix %preun of virtnetworkd
libvirt.spec: relocate pre script of daemon-driver-qemu
remove sysconfig files
NEWS: mention removal of sysconfig
NEWS.rst | 10 +++
docs/daemons.rst | 20 +++++
docs/remote.html.in | 6 +-
libvirt.spec.in | 103 ++++++++++++++++--------
src/ch/meson.build | 5 --
src/ch/virtchd.service.in | 1 +
src/ch/virtchd.sysconf | 3 -
src/interface/meson.build | 5 --
src/interface/virtinterfaced.service.in | 1 +
src/interface/virtinterfaced.sysconf | 3 -
src/libxl/meson.build | 5 --
src/libxl/virtxend.service.in | 1 +
src/libxl/virtxend.sysconf | 3 -
src/locking/meson.build | 5 --
src/locking/virtlockd.service.in | 1 +
src/locking/virtlockd.sysconf | 3 -
src/logging/meson.build | 5 --
src/logging/virtlogd.sysconf | 3 -
src/lxc/meson.build | 5 --
src/lxc/virtlxcd.service.in | 1 +
src/lxc/virtlxcd.sysconf | 3 -
src/meson.build | 16 ----
src/network/meson.build | 5 --
src/network/virtnetworkd.service.in | 1 +
src/network/virtnetworkd.sysconf | 3 -
src/node_device/meson.build | 5 --
src/node_device/virtnodedevd.service.in | 1 +
src/node_device/virtnodedevd.sysconf | 3 -
src/nwfilter/meson.build | 5 --
src/nwfilter/virtnwfilterd.service.in | 1 +
src/nwfilter/virtnwfilterd.sysconf | 3 -
src/qemu/meson.build | 5 --
src/qemu/virtqemud.service.in | 7 ++
src/qemu/virtqemud.sysconf | 12 ---
src/remote/libvirtd.service.in | 7 ++
src/remote/libvirtd.sysconf | 21 -----
src/remote/meson.build | 10 ---
src/remote/virtproxyd.service.in | 1 +
src/remote/virtproxyd.sysconf | 3 -
src/secret/meson.build | 5 --
src/secret/virtsecretd.service.in | 1 +
src/secret/virtsecretd.sysconf | 3 -
src/storage/meson.build | 5 --
src/storage/virtstoraged.service.in | 1 +
src/storage/virtstoraged.sysconf | 3 -
src/vbox/meson.build | 5 --
src/vbox/virtvboxd.service.in | 1 +
src/vbox/virtvboxd.sysconf | 3 -
src/vz/meson.build | 5 --
src/vz/virtvzd.service.in | 1 +
src/vz/virtvzd.sysconf | 3 -
tools/libvirt-guests.sh.in | 40 +++++++++
tools/libvirt-guests.sysconf | 50 ------------
tools/meson.build | 6 --
54 files changed, 170 insertions(+), 263 deletions(-)
delete mode 100644 src/ch/virtchd.sysconf
delete mode 100644 src/interface/virtinterfaced.sysconf
delete mode 100644 src/libxl/virtxend.sysconf
delete mode 100644 src/locking/virtlockd.sysconf
delete mode 100644 src/logging/virtlogd.sysconf
delete mode 100644 src/lxc/virtlxcd.sysconf
delete mode 100644 src/network/virtnetworkd.sysconf
delete mode 100644 src/node_device/virtnodedevd.sysconf
delete mode 100644 src/nwfilter/virtnwfilterd.sysconf
delete mode 100644 src/qemu/virtqemud.sysconf
delete mode 100644 src/remote/libvirtd.sysconf
delete mode 100644 src/remote/virtproxyd.sysconf
delete mode 100644 src/secret/virtsecretd.sysconf
delete mode 100644 src/storage/virtstoraged.sysconf
delete mode 100644 src/vbox/virtvboxd.sysconf
delete mode 100644 src/vz/virtvzd.sysconf
delete mode 100644 tools/libvirt-guests.sysconf
2 years, 10 months
[PATCH v1] virdnsmasq: fix runtime search for executable
by Olaf Hering
dnsmasq is an optional binary which does not neccessary exist during build.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
src/util/virdnsmasq.c | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c
index f2f606913f..06d192c99d 100644
--- a/src/util/virdnsmasq.c
+++ b/src/util/virdnsmasq.c
@@ -729,8 +729,26 @@ dnsmasqCapsRefreshInternal(dnsmasqCaps *caps, bool force)
return ret;
}
+static char *
+dnsmasqGetBinaryPath(void)
+{
+ static const char binary[] = DNSMASQ;
+ char *binary_path;
+
+ if (g_path_is_absolute(binary))
+ return g_strdup(binary);
+
+ binary_path = virFindFileInPath(binary);
+ if (!binary_path) {
+ virReportSystemError(ENOENT, _("Cannot find '%s' in path"), binary);
+ binary_path = g_strdup(binary);
+ }
+
+ return binary_path;
+}
+
static dnsmasqCaps *
-dnsmasqCapsNewEmpty(const char *binaryPath)
+dnsmasqCapsNewEmpty(void)
{
dnsmasqCaps *caps;
@@ -739,14 +757,14 @@ dnsmasqCapsNewEmpty(const char *binaryPath)
if (!(caps = virObjectNew(dnsmasqCapsClass)))
return NULL;
caps->flags = virBitmapNew(DNSMASQ_CAPS_LAST);
- caps->binaryPath = g_strdup(binaryPath ? binaryPath : DNSMASQ);
+ caps->binaryPath = dnsmasqGetBinaryPath();
return caps;
}
dnsmasqCaps *
dnsmasqCapsNewFromBuffer(const char *buf)
{
- dnsmasqCaps *caps = dnsmasqCapsNewEmpty(DNSMASQ);
+ dnsmasqCaps *caps = dnsmasqCapsNewEmpty();
if (!caps)
return NULL;
@@ -761,7 +779,7 @@ dnsmasqCapsNewFromBuffer(const char *buf)
dnsmasqCaps *
dnsmasqCapsNewFromBinary(void)
{
- dnsmasqCaps *caps = dnsmasqCapsNewEmpty(DNSMASQ);
+ dnsmasqCaps *caps = dnsmasqCapsNewEmpty();
if (!caps)
return NULL;
@@ -776,7 +794,7 @@ dnsmasqCapsNewFromBinary(void)
const char *
dnsmasqCapsGetBinaryPath(dnsmasqCaps *caps)
{
- return caps ? caps->binaryPath : DNSMASQ;
+ return caps ? caps->binaryPath : dnsmasqGetBinaryPath();
}
unsigned long
2 years, 10 months
[PATCH v3 00/12] Add riscv kvm accel support
by Yifei Jiang
This series adds both riscv32 and riscv64 kvm support, and implements
migration based on riscv.
Because of RISC-V KVM has been merged into the Linux master, so this
series are changed from RFC to patch.
Several steps to use this:
1. Build emulation
$ ./configure --target-list=riscv64-softmmu
$ make -j$(nproc)
2. Build kernel
3. Build QEMU VM
Cross built in riscv toolchain.
$ PKG_CONFIG_LIBDIR=<toolchain pkgconfig path>
$ export PKG_CONFIG_SYSROOT_DIR=<toolchain sysroot path>
$ ./configure --target-list=riscv64-softmmu --enable-kvm \
--cross-prefix=riscv64-linux-gnu- --disable-libiscsi --disable-glusterfs \
--disable-libusb --disable-usb-redir --audio-drv-list= --disable-opengl \
--disable-libxml2
$ make -j$(nproc)
4. Start emulation
$ ./qemu-system-riscv64 -M virt -m 4096M -cpu rv64,x-h=true -nographic \
-name guest=riscv-hyp,debug-threads=on \
-smp 4 \
-bios ./fw_jump.bin \
-kernel ./Image \
-drive file=./hyp.img,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-append "root=/dev/vda rw console=ttyS0 earlycon=sbi"
5. Start kvm-acceled QEMU VM in emulation
$ ./qemu-system-riscv64 -M virt,accel=kvm -m 1024M -cpu host -nographic \
-name guest=riscv-guset \
-smp 2 \
-bios none \
-kernel ./Image \
-drive file=./guest.img,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-append "root=/dev/vda rw console=ttyS0 earlycon=sbi"
Changes since patch v2
- Create a macro for get and put timer csr.
- Remove M-mode PLIC contexts when kvm is enabled.
- Add get timer frequency.
- Move cpu_host_load to vmstate_kvmtimer.
Changes since patch v1
- Rebase on recent commit a216e7cf119c91ffdf5931834a1a030ebea40d70
- Sync-up headers with Linux-5.16-rc4.
- Fixbug in kvm_arch_init_vcpu.
- Create a macro for get and put regs csr.
- Start kernel directly when kvm_enabled.
- Use riscv_cpu_set_irq to inject KVM interrupts.
- Use the Semihosting Console API for RISC-V kvm handle sbi.
- Update vmstate_riscv_cpu version id.
Placing kvm_timer into a subsection.
Changes since RFC v6
- Rebase on recent commit 8627edfb3f1fca24a96a0954148885c3241c10f8
- Sync-up headers with Linux-5.16-rc1
Changes since RFC v5
- Rebase on QEMU v6.1.0-rc1 and kvm-riscv linux v19.
- Move kvm interrupt setting to riscv_cpu_update_mip().
- Replace __u64 with uint64_t.
Changes since RFC v4
- Rebase on QEMU v6.0.0-rc2 and kvm-riscv linux v17.
- Remove time scaling support as software solution is incomplete.
Because it will cause unacceptable performance degradation. and
We will post a better solution.
- Revise according to Alistair's review comments.
- Remove compile time XLEN checks in kvm_riscv_reg_id
- Surround TYPE_RISCV_CPU_HOST definition by CONFIG_KVM and share
it between RV32 and RV64.
- Add kvm-stub.c for reduce unnecessary compilation checks.
- Add riscv_setup_direct_kernel() to direct boot kernel for KVM.
Changes since RFC v3
- Rebase on QEMU v5.2.0-rc2 and kvm-riscv linux v15.
- Add time scaling support(New patches 13, 14 and 15).
- Fix the bug that guest vm can't reboot.
Changes since RFC v2
- Fix checkpatch error at target/riscv/sbi_ecall_interface.h.
- Add riscv migration support.
Changes since RFC v1
- Add separate SBI ecall interface header.
- Add riscv32 kvm accel support.
Yifei Jiang (12):
update-linux-headers: Add asm-riscv/kvm.h
target/riscv: Add target/riscv/kvm.c to place the public kvm interface
target/riscv: Implement function kvm_arch_init_vcpu
target/riscv: Implement kvm_arch_get_registers
target/riscv: Implement kvm_arch_put_registers
target/riscv: Support start kernel directly by KVM
target/riscv: Support setting external interrupt by KVM
target/riscv: Handle KVM_EXIT_RISCV_SBI exit
target/riscv: Add host cpu type
target/riscv: Add kvm_riscv_get/put_regs_timer
target/riscv: Implement virtual time adjusting with vm state changing
target/riscv: Support virtual time context synchronization
hw/intc/sifive_plic.c | 8 +-
hw/riscv/boot.c | 16 +-
hw/riscv/virt.c | 87 +++--
include/hw/riscv/boot.h | 1 +
linux-headers/asm-riscv/kvm.h | 128 +++++++
meson.build | 2 +
target/riscv/cpu.c | 29 +-
target/riscv/cpu.h | 11 +
target/riscv/kvm-stub.c | 30 ++
target/riscv/kvm.c | 533 +++++++++++++++++++++++++++++
target/riscv/kvm_riscv.h | 25 ++
target/riscv/machine.c | 30 ++
target/riscv/meson.build | 1 +
target/riscv/sbi_ecall_interface.h | 72 ++++
14 files changed, 944 insertions(+), 29 deletions(-)
create mode 100644 linux-headers/asm-riscv/kvm.h
create mode 100644 target/riscv/kvm-stub.c
create mode 100644 target/riscv/kvm.c
create mode 100644 target/riscv/kvm_riscv.h
create mode 100644 target/riscv/sbi_ecall_interface.h
--
2.19.1
2 years, 10 months
[libvirt PATCH v3 00/13] cgroup and thread management in ch driver.
by Praveen K Paladugu
This patchset adds support for cgroup management of ch threads. This version
correctly manages cgroups for vcpu and emulator threads created by ch. cgroup
management for iothreads is not yet supported.
Along with cgroup management, this patchset also enables support for pinning
vcpu and emulator threads to selected host cpus.
v3:
* addrressed all the formatting comments in v2 patch set
* dropped indentation patches are they do not adhere to libvirt coding style
* fixed build issue in qemu driver that was introduced in v2
Praveen K Paladugu (5):
util: Helper functions to get process info
ch_driver,ch_domain: vcpu info getter callbacks
qemu,hypervisor: refactor some cgroup mgmt methods
ch_process: Setup emulator and iothread settings
ch_driver: emulator threadinfo & pinning callbacks
Vineeth Pillai (8):
ch_domain: add virCHDomainGetMonitor helper method
ch_domain: add methods to manage private vcpu data
ch_driver: domainGetVcpuPinInfo and nodeGetCPUMap
ch_monitor: Get nicindexes in prep for cgroup mgmt
ch: methods for cgroup mgmt in ch driver
ch_driver,ch_domain: vcpupin callback in ch driver
ch_driver: enable typed param string for numatune
ch_driver: add numatune callbacks for CH driver
src/ch/ch_conf.c | 2 +
src/ch/ch_conf.h | 6 +-
src/ch/ch_domain.c | 172 ++++++-
src/ch/ch_domain.h | 32 +-
src/ch/ch_driver.c | 789 +++++++++++++++++++++++++++++++++
src/ch/ch_monitor.c | 341 +++++++++++---
src/ch/ch_monitor.h | 60 ++-
src/ch/ch_process.c | 385 +++++++++++++++-
src/ch/ch_process.h | 3 +
src/ch/meson.build | 1 +
src/hypervisor/domain_cgroup.c | 426 +++++++++++++++++-
src/hypervisor/domain_cgroup.h | 52 +++
src/libvirt_private.syms | 15 +
src/qemu/qemu_cgroup.c | 410 +----------------
src/qemu/qemu_cgroup.h | 11 -
src/qemu/qemu_driver.c | 130 +-----
src/qemu/qemu_hotplug.c | 7 +-
src/qemu/qemu_process.c | 20 +-
src/util/virprocess.c | 108 +++++
src/util/virprocess.h | 5 +
20 files changed, 2357 insertions(+), 618 deletions(-)
--
2.27.0
2 years, 10 months
[PATCH 0/2] KVM features: two almost trivial cleanups
by Michal Privoznik
I've noticed these while reviewing a patch that touched this part of
code.
Michal Prívozník (2):
qemuxml2xmloutdata: Turn kvm-features.xml and kvm-features-off.xml
into symlinks
domain_conf: Use virXMLFormatElement*() more in
virDomainDefFormatFeatures()
src/conf/domain_conf.c | 21 +++++-----
tests/qemuxml2argvdata/kvm-features-off.xml | 7 +++-
tests/qemuxml2argvdata/kvm-features.xml | 7 +++-
tests/qemuxml2xmloutdata/kvm-features-off.xml | 38 +------------------
tests/qemuxml2xmloutdata/kvm-features.xml | 38 +------------------
5 files changed, 22 insertions(+), 89 deletions(-)
mode change 100644 => 120000 tests/qemuxml2xmloutdata/kvm-features-off.xml
mode change 100644 => 120000 tests/qemuxml2xmloutdata/kvm-features.xml
--
2.32.0
2 years, 10 months
[libvirt PATCH v2 0/6] docs: Unclutter top-level directory
by Andrea Bolognani
Note that the icons part is untested, because testing it properly
would require uploading the generated website to some
publicly-accessible location and browsing it using various devices.
I have, however, looked at a few popular websites and I've seen them
use icons that are not in the top-level directory, so I'm reasonably
confident that icons will keep working fine even after moving them.
Changes from [v1]:
* extend scope to include icons and CSS files.
[v1] https://listman.redhat.com/archives/libvir-list/2021-December/msg00818.html
Andrea Bolognani (6):
docs: Drop structures.svg
docs: Add <link> pointing to favicon.ico
docs: Move all images to a subdirectory
docs: Move all icons to a subdirectory
docs: Move all CSS files to a subdirectory
docs: Move font definitions with other CSS files
docs/api.rst | 6 +-
docs/browserconfig.xml | 2 +-
docs/{fonts/stylesheet.css => css/fonts.css} | 18 +-
docs/{ => css}/generic.css | 0
docs/{ => css}/libvirt.css | 4 +-
docs/{ => css}/main.css | 2 +-
docs/css/meson.build | 17 ++
docs/{ => css}/mobile.css | 2 +-
docs/fonts/meson.build | 1 -
docs/goals.html.in | 2 +-
docs/{ => icons}/android-chrome-192x192.png | Bin
docs/{ => icons}/android-chrome-256x256.png | Bin
docs/{ => icons}/apple-touch-icon.png | Bin
docs/{ => icons}/favicon-16x16.png | Bin
docs/{ => icons}/favicon-32x32.png | Bin
docs/{ => icons}/favicon.ico | Bin
docs/icons/meson.build | 19 ++
docs/{ => icons}/mstile-150x150.png | Bin
docs/{ => images}/event_loop_simple.png | Bin
docs/{ => images}/event_loop_simple.svg | 0
docs/{ => images}/event_loop_worker.png | Bin
docs/{ => images}/event_loop_worker.svg | 0
docs/{ => images}/libvirt-daemon-arch.png | Bin
docs/{ => images}/libvirt-daemon-arch.svg | 0
docs/{ => images}/libvirt-driver-arch.png | Bin
docs/{ => images}/libvirt-driver-arch.svg | 0
docs/{ => images}/libvirt-object-model.png | Bin
docs/{ => images}/libvirt-object-model.svg | 0
.../libvirt-virConnect-example.png | Bin
.../libvirt-virConnect-example.svg | 0
docs/images/meson.build | 24 +++
.../{ => images}/migration-managed-direct.png | Bin
.../{ => images}/migration-managed-direct.svg | 0
docs/{ => images}/migration-managed-p2p.png | Bin
docs/{ => images}/migration-managed-p2p.svg | 0
docs/{ => images}/migration-native.png | Bin
docs/{ => images}/migration-native.svg | 0
docs/{ => images}/migration-tunnel.png | Bin
docs/{ => images}/migration-tunnel.svg | 0
.../migration-unmanaged-direct.png | Bin
.../migration-unmanaged-direct.svg | 0
docs/{ => images}/node.gif | Bin
docs/{ => images}/node.svg | 0
docs/internals.html.in | 2 +-
docs/internals/eventloop.html.in | 4 +-
docs/manifest.json | 4 +-
docs/meson.build | 26 +--
docs/migration.rst | 10 +-
docs/page.xsl | 9 +-
docs/structures.svg | 187 ------------------
50 files changed, 96 insertions(+), 243 deletions(-)
rename docs/{fonts/stylesheet.css => css/fonts.css} (60%)
rename docs/{ => css}/generic.css (100%)
rename docs/{ => css}/libvirt.css (98%)
rename docs/{ => css}/main.css (68%)
create mode 100644 docs/css/meson.build
rename docs/{ => css}/mobile.css (95%)
rename docs/{ => icons}/android-chrome-192x192.png (100%)
rename docs/{ => icons}/android-chrome-256x256.png (100%)
rename docs/{ => icons}/apple-touch-icon.png (100%)
rename docs/{ => icons}/favicon-16x16.png (100%)
rename docs/{ => icons}/favicon-32x32.png (100%)
rename docs/{ => icons}/favicon.ico (100%)
create mode 100644 docs/icons/meson.build
rename docs/{ => icons}/mstile-150x150.png (100%)
rename docs/{ => images}/event_loop_simple.png (100%)
rename docs/{ => images}/event_loop_simple.svg (100%)
rename docs/{ => images}/event_loop_worker.png (100%)
rename docs/{ => images}/event_loop_worker.svg (100%)
rename docs/{ => images}/libvirt-daemon-arch.png (100%)
rename docs/{ => images}/libvirt-daemon-arch.svg (100%)
rename docs/{ => images}/libvirt-driver-arch.png (100%)
rename docs/{ => images}/libvirt-driver-arch.svg (100%)
rename docs/{ => images}/libvirt-object-model.png (100%)
rename docs/{ => images}/libvirt-object-model.svg (100%)
rename docs/{ => images}/libvirt-virConnect-example.png (100%)
rename docs/{ => images}/libvirt-virConnect-example.svg (100%)
create mode 100644 docs/images/meson.build
rename docs/{ => images}/migration-managed-direct.png (100%)
rename docs/{ => images}/migration-managed-direct.svg (100%)
rename docs/{ => images}/migration-managed-p2p.png (100%)
rename docs/{ => images}/migration-managed-p2p.svg (100%)
rename docs/{ => images}/migration-native.png (100%)
rename docs/{ => images}/migration-native.svg (100%)
rename docs/{ => images}/migration-tunnel.png (100%)
rename docs/{ => images}/migration-tunnel.svg (100%)
rename docs/{ => images}/migration-unmanaged-direct.png (100%)
rename docs/{ => images}/migration-unmanaged-direct.svg (100%)
rename docs/{ => images}/node.gif (100%)
rename docs/{ => images}/node.svg (100%)
delete mode 100644 docs/structures.svg
--
2.31.1
2 years, 10 months