Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>

authored by

Sean Christopherson and committed by
Wei Liu
9be7e1e3 6d0386ea

+19 -19
+1 -1
MAINTAINERS
··· 10200 10200 S: Maintained 10201 10201 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/entry 10202 10202 F: include/linux/entry-common.h 10203 - F: include/linux/entry-kvm.h 10203 + F: include/linux/entry-virt.h 10204 10204 F: include/linux/irq-entry-common.h 10205 10205 F: kernel/entry/ 10206 10206
+1 -1
arch/arm64/kvm/Kconfig
··· 25 25 select HAVE_KVM_CPU_RELAX_INTERCEPT 26 26 select KVM_MMIO 27 27 select KVM_GENERIC_DIRTYLOG_READ_PROTECT 28 - select KVM_XFER_TO_GUEST_WORK 28 + select VIRT_XFER_TO_GUEST_WORK 29 29 select KVM_VFIO 30 30 select HAVE_KVM_DIRTY_RING_ACQ_REL 31 31 select NEED_KVM_DIRTY_RING_WITH_BITMAP
+1 -1
arch/loongarch/kvm/Kconfig
··· 31 31 select KVM_GENERIC_HARDWARE_ENABLING 32 32 select KVM_GENERIC_MMU_NOTIFIER 33 33 select KVM_MMIO 34 - select KVM_XFER_TO_GUEST_WORK 34 + select VIRT_XFER_TO_GUEST_WORK 35 35 select SCHED_INFO 36 36 select GUEST_PERF_EVENTS if PERF_EVENTS 37 37 help
+1 -1
arch/riscv/kvm/Kconfig
··· 30 30 select KVM_GENERIC_DIRTYLOG_READ_PROTECT 31 31 select KVM_GENERIC_HARDWARE_ENABLING 32 32 select KVM_MMIO 33 - select KVM_XFER_TO_GUEST_WORK 33 + select VIRT_XFER_TO_GUEST_WORK 34 34 select KVM_GENERIC_MMU_NOTIFIER 35 35 select SCHED_INFO 36 36 select GUEST_PERF_EVENTS if PERF_EVENTS
+1 -1
arch/x86/kvm/Kconfig
··· 40 40 select HAVE_KVM_MSI 41 41 select HAVE_KVM_CPU_RELAX_INTERCEPT 42 42 select HAVE_KVM_NO_POLL 43 - select KVM_XFER_TO_GUEST_WORK 43 + select VIRT_XFER_TO_GUEST_WORK 44 44 select KVM_GENERIC_DIRTYLOG_READ_PROTECT 45 45 select KVM_VFIO 46 46 select HAVE_KVM_PM_NOTIFIER if PM
+4 -4
include/linux/entry-kvm.h include/linux/entry-virt.h
··· 1 1 /* 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 4 4 5 5 #include <linux/static_call_types.h> 6 6 #include <linux/resume_user_mode.h> ··· 10 10 #include <linux/tick.h> 11 11 12 12 /* Transfer to guest mode work */ 13 - #ifdef CONFIG_KVM_XFER_TO_GUEST_WORK 13 + #ifdef CONFIG_VIRT_XFER_TO_GUEST_WORK 14 14 15 15 #ifndef ARCH_XFER_TO_GUEST_MODE_WORK 16 16 # define ARCH_XFER_TO_GUEST_MODE_WORK (0) ··· 90 90 lockdep_assert_irqs_disabled(); 91 91 return __xfer_to_guest_mode_work_pending(); 92 92 } 93 - #endif /* CONFIG_KVM_XFER_TO_GUEST_WORK */ 93 + #endif /* CONFIG_VIRT_XFER_TO_GUEST_WORK */ 94 94 95 95 #endif
+3 -3
include/linux/kvm_host.h
··· 2 2 #ifndef __KVM_HOST_H 3 3 #define __KVM_HOST_H 4 4 5 - #include <linux/entry-kvm.h> 5 + #include <linux/entry-virt.h> 6 6 #include <linux/types.h> 7 7 #include <linux/hardirq.h> 8 8 #include <linux/list.h> ··· 2444 2444 } 2445 2445 #endif /* CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE */ 2446 2446 2447 - #ifdef CONFIG_KVM_XFER_TO_GUEST_WORK 2447 + #ifdef CONFIG_VIRT_XFER_TO_GUEST_WORK 2448 2448 static inline void kvm_handle_signal_exit(struct kvm_vcpu *vcpu) 2449 2449 { 2450 2450 vcpu->run->exit_reason = KVM_EXIT_INTR; ··· 2461 2461 } 2462 2462 return r; 2463 2463 } 2464 - #endif /* CONFIG_KVM_XFER_TO_GUEST_WORK */ 2464 + #endif /* CONFIG_VIRT_XFER_TO_GUEST_WORK */ 2465 2465 2466 2466 /* 2467 2467 * If more than one page is being (un)accounted, @virt must be the address of
+1 -1
include/linux/rcupdate.h
··· 129 129 static inline void rcu_sysrq_end(void) { } 130 130 #endif /* #else #ifdef CONFIG_RCU_STALL_COMMON */ 131 131 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)) 133 133 void rcu_irq_work_resched(void); 134 134 #else 135 135 static __always_inline void rcu_irq_work_resched(void) { }
+1 -1
kernel/entry/Makefile
··· 14 14 15 15 obj-$(CONFIG_GENERIC_IRQ_ENTRY) += common.o 16 16 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
+1 -1
kernel/entry/kvm.c kernel/entry/virt.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 3 - #include <linux/entry-kvm.h> 3 + #include <linux/entry-virt.h> 4 4 5 5 static int xfer_to_guest_mode_work(unsigned long ti_work) 6 6 {
+3 -3
kernel/rcu/tree.c
··· 573 573 } 574 574 EXPORT_SYMBOL_GPL(rcutorture_format_gp_seqs); 575 575 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)) 577 577 /* 578 578 * An empty function that will trigger a reschedule on 579 579 * IRQ tail once IRQs get re-enabled on userspace/guest resume. ··· 602 602 if (IS_ENABLED(CONFIG_GENERIC_ENTRY) && !(current->flags & PF_VCPU)) 603 603 return; 604 604 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)) 606 606 return; 607 607 608 608 instrumentation_begin(); ··· 611 611 } 612 612 instrumentation_end(); 613 613 } 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)) */ 615 615 616 616 #ifdef CONFIG_PROVE_RCU 617 617 /**
+1 -1
virt/kvm/Kconfig
··· 87 87 config HAVE_KVM_NO_POLL 88 88 bool 89 89 90 - config KVM_XFER_TO_GUEST_WORK 90 + config VIRT_XFER_TO_GUEST_WORK 91 91 bool 92 92 93 93 config HAVE_KVM_PM_NOTIFIER