History

entry: Rename "kvm" entry code assets to "virt" to genericize APIs

Rename the "kvm" entry code files and Kconfigs to use generic "virt" nomenclature so that the code can be reused by other hypervisors (or rather, their root/dom0 partition drivers), without incorrectly suggesting the code somehow relies on and/or involves KVM. No functional change intended.

Sean Christopherson committed 1 year ago

Commit 9be7e1e1 parent 6d0386e12 files · +19 −19Browse files

Unified · Split

12 files
  1. MAINTAINERS +1 −1
  2. arch/arm64/kvm/Kconfig +1 −1
  3. arch/loongarch/kvm/Kconfig +1 −1
  4. arch/riscv/kvm/Kconfig +1 −1
  5. arch/x86/kvm/Kconfig +1 −1
  6. include/linux/entry-virt.h +4 −4
  7. include/linux/kvm_host.h +3 −3
  8. include/linux/rcupdate.h +1 −1
  9. kernel/entry/Makefile +1 −1
  10. kernel/entry/virt.c +1 −1
  11. kernel/rcu/tree.c +3 −3
  12. virt/kvm/Kconfig +1 −1
MAINTAINERS+1−1
@@ -10200,7 +10200,7 @@ L: linux-kernel@vger.kernel.org · 10199 unmodified lines
1020010200 S: Maintained
1020110201 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/entry
1020210202 F: include/linux/entry-common.h
10203−F: include/linux/entry-kvm.h
10203+F: include/linux/entry-virt.h
1020410204 F: include/linux/irq-entry-common.h
1020510205 F: kernel/entry/
1020610206
arch/arm64/kvm/Kconfig+1−1
@@ -25,7 +25,7 @@ menuconfig KVM · 24 unmodified lines
2525 select HAVE_KVM_CPU_RELAX_INTERCEPT
2626 select KVM_MMIO
2727 select KVM_GENERIC_DIRTYLOG_READ_PROTECT
28− select KVM_XFER_TO_GUEST_WORK
28+ select VIRT_XFER_TO_GUEST_WORK
2929 select KVM_VFIO
3030 select HAVE_KVM_DIRTY_RING_ACQ_REL
3131 select NEED_KVM_DIRTY_RING_WITH_BITMAP
arch/loongarch/kvm/Kconfig+1−1
@@ -31,7 +31,7 @@ config KVM · 30 unmodified lines
3131 select KVM_GENERIC_HARDWARE_ENABLING
3232 select KVM_GENERIC_MMU_NOTIFIER
3333 select KVM_MMIO
34− select KVM_XFER_TO_GUEST_WORK
34+ select VIRT_XFER_TO_GUEST_WORK
3535 select SCHED_INFO
3636 select GUEST_PERF_EVENTS if PERF_EVENTS
3737 help
arch/riscv/kvm/Kconfig+1−1
@@ -30,7 +30,7 @@ config KVM · 29 unmodified lines
3030 select KVM_GENERIC_DIRTYLOG_READ_PROTECT
3131 select KVM_GENERIC_HARDWARE_ENABLING
3232 select KVM_MMIO
33− select KVM_XFER_TO_GUEST_WORK
33+ select VIRT_XFER_TO_GUEST_WORK
3434 select KVM_GENERIC_MMU_NOTIFIER
3535 select SCHED_INFO
3636 select GUEST_PERF_EVENTS if PERF_EVENTS
arch/x86/kvm/Kconfig+1−1
@@ -40,7 +40,7 @@ config KVM_X86 · 39 unmodified lines
4040 select HAVE_KVM_MSI
4141 select HAVE_KVM_CPU_RELAX_INTERCEPT
4242 select HAVE_KVM_NO_POLL
43− select KVM_XFER_TO_GUEST_WORK
43+ select VIRT_XFER_TO_GUEST_WORK
4444 select KVM_GENERIC_DIRTYLOG_READ_PROTECT
4545 select KVM_VFIO
4646 select HAVE_KVM_PM_NOTIFIER if PM
include/linux/entry-virt.hrenamed from include/linux/entry-kvm.h+4−4
@@ -1,6 +1,6 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
2−#ifndef __LINUX_ENTRYKVM_H
3−#define __LINUX_ENTRYKVM_H
2+#ifndef __LINUX_ENTRYVIRT_H
3+#define __LINUX_ENTRYVIRT_H
44
55 #include <linux/static_call_types.h>
66 #include <linux/resume_user_mode.h>
@@ -10,7 +10,7 @@ · 3 unmodified lines
1010 #include <linux/tick.h>
1111
1212 /* Transfer to guest mode work */
13−#ifdef CONFIG_KVM_XFER_TO_GUEST_WORK
13+#ifdef CONFIG_VIRT_XFER_TO_GUEST_WORK
1414
1515 #ifndef ARCH_XFER_TO_GUEST_MODE_WORK
1616 # define ARCH_XFER_TO_GUEST_MODE_WORK (0)
@@ -90,6 +90,6 @@ static inline bool xfer_to_guest_mode_work_pending(void) · 73 unmodified lines
9090 lockdep_assert_irqs_disabled();
9191 return __xfer_to_guest_mode_work_pending();
9292 }
93−#endif /* CONFIG_KVM_XFER_TO_GUEST_WORK */
93+#endif /* CONFIG_VIRT_XFER_TO_GUEST_WORK */
9494
9595 #endif
include/linux/kvm_host.h+3−3
@@ -2,7 +2,7 @@ · 1 unmodified line
22 #ifndef __KVM_HOST_H
33 #define __KVM_HOST_H
44
5−#include <linux/entry-kvm.h>
5+#include <linux/entry-virt.h>
66 #include <linux/types.h>
77 #include <linux/hardirq.h>
88 #include <linux/list.h>
@@ -2444,7 +2444,7 @@ static inline int kvm_arch_vcpu_run_pid_change(struct kvm_vcpu *vcpu) · 2435 unmodified lines
24442444 }
24452445 #endif /* CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE */
24462446
2447−#ifdef CONFIG_KVM_XFER_TO_GUEST_WORK
2447+#ifdef CONFIG_VIRT_XFER_TO_GUEST_WORK
24482448 static inline void kvm_handle_signal_exit(struct kvm_vcpu *vcpu)
24492449 {
24502450 vcpu->run->exit_reason = KVM_EXIT_INTR;
@@ -2461,7 +2461,7 @@ static inline int kvm_xfer_to_guest_mode_handle_work(struct kvm_vcpu *vcpu) · 10 unmodified lines
24612461 }
24622462 return r;
24632463 }
2464−#endif /* CONFIG_KVM_XFER_TO_GUEST_WORK */
2464+#endif /* CONFIG_VIRT_XFER_TO_GUEST_WORK */
24652465
24662466 /*
24672467 * If more than one page is being (un)accounted, @virt must be the address of
include/linux/rcupdate.h+1−1
@@ -129,7 +129,7 @@ static inline void rcu_sysrq_start(void) { } · 128 unmodified lines
129129 static inline void rcu_sysrq_end(void) { }
130130 #endif /* #else #ifdef CONFIG_RCU_STALL_COMMON */
131131
132−#if defined(CONFIG_NO_HZ_FULL) && (!defined(CONFIG_GENERIC_ENTRY) || !defined(CONFIG_KVM_XFER_TO_GUEST_WORK))
132+#if defined(CONFIG_NO_HZ_FULL) && (!defined(CONFIG_GENERIC_ENTRY) || !defined(CONFIG_VIRT_XFER_TO_GUEST_WORK))
133133 void rcu_irq_work_resched(void);
134134 #else
135135 static __always_inline void rcu_irq_work_resched(void) { }
kernel/entry/Makefile+1−1
@@ -14,4 +14,4 @@ CFLAGS_common.o += -fno-stack-protector · 13 unmodified lines
1414
1515 obj-$(CONFIG_GENERIC_IRQ_ENTRY) += common.o
1616 obj-$(CONFIG_GENERIC_SYSCALL) += syscall-common.o syscall_user_dispatch.o
17−obj-$(CONFIG_KVM_XFER_TO_GUEST_WORK) += kvm.o
17+obj-$(CONFIG_VIRT_XFER_TO_GUEST_WORK) += virt.o
kernel/entry/virt.crenamed from kernel/entry/kvm.c+1−1
@@ -1,6 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0
22
3−#include <linux/entry-kvm.h>
3+#include <linux/entry-virt.h>
44
55 static int xfer_to_guest_mode_work(unsigned long ti_work)
66 {
kernel/rcu/tree.c+3−3
@@ -573,7 +573,7 @@ void rcutorture_format_gp_seqs(unsigned long long seqs, char *cp, size_t len) · 572 unmodified lines
573573 }
574574 EXPORT_SYMBOL_GPL(rcutorture_format_gp_seqs);
575575
576−#if defined(CONFIG_NO_HZ_FULL) && (!defined(CONFIG_GENERIC_ENTRY) || !defined(CONFIG_KVM_XFER_TO_GUEST_WORK))
576+#if defined(CONFIG_NO_HZ_FULL) && (!defined(CONFIG_GENERIC_ENTRY) || !defined(CONFIG_VIRT_XFER_TO_GUEST_WORK))
577577 /*
578578 * An empty function that will trigger a reschedule on
579579 * IRQ tail once IRQs get re-enabled on userspace/guest resume.
@@ -602,7 +602,7 @@ noinstr void rcu_irq_work_resched(void) · 22 unmodified lines
602602 if (IS_ENABLED(CONFIG_GENERIC_ENTRY) && !(current->flags & PF_VCPU))
603603 return;
604604
605− if (IS_ENABLED(CONFIG_KVM_XFER_TO_GUEST_WORK) && (current->flags & PF_VCPU))
605+ if (IS_ENABLED(CONFIG_VIRT_XFER_TO_GUEST_WORK) && (current->flags & PF_VCPU))
606606 return;
607607
608608 instrumentation_begin();
@@ -611,7 +611,7 @@ noinstr void rcu_irq_work_resched(void) · 2 unmodified lines
611611 }
612612 instrumentation_end();
613613 }
614−#endif /* #if defined(CONFIG_NO_HZ_FULL) && (!defined(CONFIG_GENERIC_ENTRY) || !defined(CONFIG_KVM_XFER_TO_GUEST_WORK)) */
614+#endif /* #if defined(CONFIG_NO_HZ_FULL) && (!defined(CONFIG_GENERIC_ENTRY) || !defined(CONFIG_VIRT_XFER_TO_GUEST_WORK)) */
615615
616616 #ifdef CONFIG_PROVE_RCU
617617 /**
virt/kvm/Kconfig+1−1
@@ -87,7 +87,7 @@ config HAVE_KVM_VCPU_RUN_PID_CHANGE · 86 unmodified lines
8787 config HAVE_KVM_NO_POLL
8888 bool
8989
90−config KVM_XFER_TO_GUEST_WORK
90+config VIRT_XFER_TO_GUEST_WORK
9191 bool
9292
9393 config HAVE_KVM_PM_NOTIFIER

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t