]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
entry/kvm: KVM: Move KVM details related to signal/-EINTR into KVM proper
authorSean Christopherson <seanjc@google.com>
Thu, 28 Aug 2025 00:01:53 +0000 (17:01 -0700)
committerWei Liu <wei.liu@kernel.org>
Tue, 30 Sep 2025 22:50:18 +0000 (22:50 +0000)
commit6d0386ea99875313fdfd074eb74013b6e3b48a76
tree2ab67bd74f52f15aa71173d95bf4d89ba11e94d4
parent0ebac01a00be972020c002a7fe0bb6b6fca8410f
entry/kvm: KVM: Move KVM details related to signal/-EINTR into KVM proper

Move KVM's morphing of pending signals into userspace exits into KVM
proper, and drop the @vcpu param from xfer_to_guest_mode_handle_work().
How KVM responds to -EINTR is a detail that really belongs in KVM itself,
and invoking kvm_handle_signal_exit() from kernel code creates an inverted
module dependency.  E.g. attempting to move kvm_handle_signal_exit() into
kvm_main.c would generate an linker error when building kvm.ko as a module.

Dropping KVM details will also converting the KVM "entry" code into a more
generic virtualization framework so that it can be used when running as a
Hyper-V root partition.

Lastly, eliminating usage of "struct kvm_vcpu" outside of KVM is also nice
to have for KVM x86 developers, as keeping the details of kvm_vcpu purely
within KVM allows changing the layout of the structure without having to
boot into a new kernel, e.g. allows rebuilding and reloading kvm.ko with a
modified kvm_vcpu structure as part of debug/development.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
arch/arm64/kvm/arm.c
arch/loongarch/kvm/vcpu.c
arch/riscv/kvm/vcpu.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c
include/linux/entry-kvm.h
include/linux/kvm_host.h
kernel/entry/kvm.c