Skip to content

qemu-kvm: Cleanup and switch to upstream - The Season Final

Jan Kiszka kvm 1 version Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest20 patches 10 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/20qemu-kvm: Move thread-related code to cpus.ccpus.c cpus.h kvm-all.c +2 more+430 -4930 replies
2/20qemu-kvm: Enable CONFIG_IOTHREADarch_init.c configure cpus.c +1 more+30 -160 replies
3/20qemu-kvm: Switch to iothread version of qemu_notify_eventcpus.c+2 -20 replies
4/20qemu-kvm: Use upstream mutex and condscpus.c+31 -260 replies
5/20qemu-kvm: Restrict validity of cpu_single_envcpus.c+5 -130 replies
6/20qemu-kvm: Use upstream qemu_mutex_lock/unlock_iothreadcpus.c+1 -250 replies
7/20qemu-kvm: Clean up kvm_update_interrupt_requestcpus.c+3 -203 replies
8/20qemu-kvm: Replace kvm_update_interrupt_request with qemu_cpu_kickcpus.c kvm-all.c qemu-kvm.h+4 -135 replies
9/20qemu-kvm: Use upstream run_on_cpu and flush_queued_workcpu-defs.h cpus.c kvm-all.c +3 more+4 -660 replies
10/20qemu-kvm: Drop kvm_cond_waitcpus.c+3 -110 replies
11/20qemu-kvm: Replace kvm_cpu_is_stopped with cpu_is_stoppedcpus.c+1 -60 replies
12/20qemu-kvm: Remove obsolete current_envcpus.c+1 -40 replies
13/20qemu-kvm: Use upstream vcpu pause/resumecpus.c sysemu.h vl.c+13 -780 replies
14/20qemu-kvm: Move main loop setup codecpus.c+21 -200 replies
15/20qemu-kvm: Use upstream's way of signaling debug stopscpus.c sysemu.h vl.c+4 -80 replies
16/20qemu-kvm: Use upstream main loopcpus.c qemu-kvm.h sysemu.h +1 more+5 -650 replies
17/20qemu-kvm: Use upstream main loop initializationcpus.c kvm-all.c qemu-kvm.h+1 -640 replies
18/20qemu-kvm: Replace kvm_get_thread_id with qemu_get_thread_idcpus.c qemu-kvm.h+1 -100 replies
19/20qemu-kvm: Use upstream kvm vcpu initializationcpus.c kvm-all.c qemu-kvm.h+13 -790 replies
20/20qemu-kvm: Use upstream vcpu looparch_init.c cpus.c vl.c+2 -950 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/20] qemu-kvm: Cleanup and switch to upstream - The Season Final

With this series applied, we are finally at a level of almost zero redundancy between QEMU upstream and the qemu-kvm tree. The last major duplication to be removed is the original io-thread implementation and everything related to it:
- locking
- vcpu wakeup/kicking as well as suspend/resume
- on-vcpu execution
- io-thread loop
- vcpu thread loop

The approach taken here is similar to what was done to morph KVM core functions into upstream code: First all to be converted code is moved over into cpus.c, then qemu-kvm's functions are gradually changed and replaced with the upstream versions.

This means that we have to enable CONFIG_IOTHREAD which is so far incompatible with qemu-kvm. This incompatibility causes a temporary breakage of the TCG mode early in the series, but it is healed again with the last patch applied.

To make it clear: Even with all this applied, there is still a lot to do to turn upstream QEMU into the primary KVM platform. We need to
- rework in-kernel IOAPIC/PIC/APIC/PIT support, namely
- proper qdev modeling
- new MSI hooking architecture (half-done)
- VAPIC support (haven't looked at details yet, maybe just cleanups)
- prepare device assignment for upstream (VFIO and/or KVM-based)
- clean up remaining small deltas (including posix-aio-compat...)
- get rid of legacy command line interfaces (e.g. via deprecation warning in release X and removal in X+n, n >= 1)

But then we are really done and can all retire. ;)

In the meantime, please review/merge these bits.

Jan Kiszka (20):
qemu-kvm: Move thread-related code to cpus.c
qemu-kvm: Enable CONFIG_IOTHREAD
qemu-kvm: Switch to iothread version of qemu_notify_event
qemu-kvm: Use upstream mutex and conds
qemu-kvm: Restrict validity of cpu_single_env
qemu-kvm: Use upstream qemu_mutex_lock/unlock_iothread
qemu-kvm: Clean up kvm_update_interrupt_request
qemu-kvm: Replace kvm_update_interrupt_request with qemu_cpu_kick
qemu-kvm: Use upstream run_on_cpu and flush_queued_work
qemu-kvm: Drop kvm_cond_wait
qemu-kvm: Replace kvm_cpu_is_stopped with cpu_is_stopped
qemu-kvm: Remove obsolete current_env
qemu-kvm: Use upstream vcpu pause/resume
qemu-kvm: Move main loop setup code
qemu-kvm: Use upstream's way of signaling debug stops
qemu-kvm: Use upstream main loop
qemu-kvm: Use upstream main loop initialization
qemu-kvm: Replace kvm_get_thread_id with qemu_get_thread_id
qemu-kvm: Use upstream kvm vcpu initialization
qemu-kvm: Use upstream vcpu loop

 configure            |    1 +
 cpu-defs.h           |   11 +-
 cpus.c               |   17 +--
 cpus.h               |    1 +
 kvm-all.c            |    9 +-
 qemu-kvm.c           |  498 +-------------------------------------------------
 qemu-kvm.h           |    7 -
 target-i386/helper.c |    4 -
 vl.c                 |   17 --
 9 files changed, 13 insertions(+), 552 deletions(-)