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.
Unified · Split
| @@ -10200,7 +10200,7 @@ L: linux-kernel@vger.kernel.org · 10199 unmodified lines | |||
| 10200 | S: Maintained | 10200 | S: Maintained |
| 10201 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/entry | 10201 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/entry |
| 10202 | F: include/linux/entry-common.h | 10202 | F: include/linux/entry-common.h |
| 10203 | F: include/linux/entry-kvm.h | 10203 | F: include/linux/entry-virt.h |
| 10204 | F: include/linux/irq-entry-common.h | 10204 | F: include/linux/irq-entry-common.h |
| 10205 | F: kernel/entry/ | 10205 | F: kernel/entry/ |
| 10206 | 10206 | ||
| @@ -25,7 +25,7 @@ menuconfig KVM · 24 unmodified lines | |||
| 25 | select HAVE_KVM_CPU_RELAX_INTERCEPT | 25 | select HAVE_KVM_CPU_RELAX_INTERCEPT |
| 26 | select KVM_MMIO | 26 | select KVM_MMIO |
| 27 | select KVM_GENERIC_DIRTYLOG_READ_PROTECT | 27 | select KVM_GENERIC_DIRTYLOG_READ_PROTECT |
| 28 | select KVM_XFER_TO_GUEST_WORK | 28 | select VIRT_XFER_TO_GUEST_WORK |
| 29 | select KVM_VFIO | 29 | select KVM_VFIO |
| 30 | select HAVE_KVM_DIRTY_RING_ACQ_REL | 30 | select HAVE_KVM_DIRTY_RING_ACQ_REL |
| 31 | select NEED_KVM_DIRTY_RING_WITH_BITMAP | 31 | select NEED_KVM_DIRTY_RING_WITH_BITMAP |
| @@ -31,7 +31,7 @@ config KVM · 30 unmodified lines | |||
| 31 | select KVM_GENERIC_HARDWARE_ENABLING | 31 | select KVM_GENERIC_HARDWARE_ENABLING |
| 32 | select KVM_GENERIC_MMU_NOTIFIER | 32 | select KVM_GENERIC_MMU_NOTIFIER |
| 33 | select KVM_MMIO | 33 | select KVM_MMIO |
| 34 | select KVM_XFER_TO_GUEST_WORK | 34 | select VIRT_XFER_TO_GUEST_WORK |
| 35 | select SCHED_INFO | 35 | select SCHED_INFO |
| 36 | select GUEST_PERF_EVENTS if PERF_EVENTS | 36 | select GUEST_PERF_EVENTS if PERF_EVENTS |
| 37 | help | 37 | help |
| @@ -30,7 +30,7 @@ config KVM · 29 unmodified lines | |||
| 30 | select KVM_GENERIC_DIRTYLOG_READ_PROTECT | 30 | select KVM_GENERIC_DIRTYLOG_READ_PROTECT |
| 31 | select KVM_GENERIC_HARDWARE_ENABLING | 31 | select KVM_GENERIC_HARDWARE_ENABLING |
| 32 | select KVM_MMIO | 32 | select KVM_MMIO |
| 33 | select KVM_XFER_TO_GUEST_WORK | 33 | select VIRT_XFER_TO_GUEST_WORK |
| 34 | select KVM_GENERIC_MMU_NOTIFIER | 34 | select KVM_GENERIC_MMU_NOTIFIER |
| 35 | select SCHED_INFO | 35 | select SCHED_INFO |
| 36 | select GUEST_PERF_EVENTS if PERF_EVENTS | 36 | select GUEST_PERF_EVENTS if PERF_EVENTS |
| @@ -40,7 +40,7 @@ config KVM_X86 · 39 unmodified lines | |||
| 40 | select HAVE_KVM_MSI | 40 | select HAVE_KVM_MSI |
| 41 | select HAVE_KVM_CPU_RELAX_INTERCEPT | 41 | select HAVE_KVM_CPU_RELAX_INTERCEPT |
| 42 | select HAVE_KVM_NO_POLL | 42 | select HAVE_KVM_NO_POLL |
| 43 | select KVM_XFER_TO_GUEST_WORK | 43 | select VIRT_XFER_TO_GUEST_WORK |
| 44 | select KVM_GENERIC_DIRTYLOG_READ_PROTECT | 44 | select KVM_GENERIC_DIRTYLOG_READ_PROTECT |
| 45 | select KVM_VFIO | 45 | select KVM_VFIO |
| 46 | select HAVE_KVM_PM_NOTIFIER if PM | 46 | select HAVE_KVM_PM_NOTIFIER if PM |
| @@ -1,6 +1,6 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef __LINUX_ENTRYKVM_H | 2 | #ifndef __LINUX_ENTRYVIRT_H |
| 3 | #define __LINUX_ENTRYKVM_H | 3 | #define __LINUX_ENTRYVIRT_H |
| 4 | 4 | ||
| 5 | #include <linux/static_call_types.h> | 5 | #include <linux/static_call_types.h> |
| 6 | #include <linux/resume_user_mode.h> | 6 | #include <linux/resume_user_mode.h> |
| @@ -10,7 +10,7 @@ · 3 unmodified lines | |||
| 10 | #include <linux/tick.h> | 10 | #include <linux/tick.h> |
| 11 | 11 | ||
| 12 | /* Transfer to guest mode work */ | 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 | #ifndef ARCH_XFER_TO_GUEST_MODE_WORK | 15 | #ifndef ARCH_XFER_TO_GUEST_MODE_WORK |
| 16 | # define ARCH_XFER_TO_GUEST_MODE_WORK (0) | 16 | # 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 | |||
| 90 | lockdep_assert_irqs_disabled(); | 90 | lockdep_assert_irqs_disabled(); |
| 91 | return __xfer_to_guest_mode_work_pending(); | 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 | #endif | 95 | #endif |
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | #ifndef __KVM_HOST_H | 2 | #ifndef __KVM_HOST_H |
| 3 | #define __KVM_HOST_H | 3 | #define __KVM_HOST_H |
| 4 | 4 | ||
| 5 | #include <linux/entry-kvm.h> | 5 | #include <linux/entry-virt.h> |
| 6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
| 7 | #include <linux/hardirq.h> | 7 | #include <linux/hardirq.h> |
| 8 | #include <linux/list.h> | 8 | #include <linux/list.h> |
| @@ -2444,7 +2444,7 @@ static inline int kvm_arch_vcpu_run_pid_change(struct kvm_vcpu *vcpu) · 2435 unmodified lines | |||
| 2444 | } | 2444 | } |
| 2445 | #endif /* CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE */ | 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 | static inline void kvm_handle_signal_exit(struct kvm_vcpu *vcpu) | 2448 | static inline void kvm_handle_signal_exit(struct kvm_vcpu *vcpu) |
| 2449 | { | 2449 | { |
| 2450 | vcpu->run->exit_reason = KVM_EXIT_INTR; | 2450 | 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 | |||
| 2461 | } | 2461 | } |
| 2462 | return r; | 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 | * If more than one page is being (un)accounted, @virt must be the address of | 2467 | * If more than one page is being (un)accounted, @virt must be the address of |
| @@ -129,7 +129,7 @@ static inline void rcu_sysrq_start(void) { } · 128 unmodified lines | |||
| 129 | static inline void rcu_sysrq_end(void) { } | 129 | static inline void rcu_sysrq_end(void) { } |
| 130 | #endif /* #else #ifdef CONFIG_RCU_STALL_COMMON */ | 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 | void rcu_irq_work_resched(void); | 133 | void rcu_irq_work_resched(void); |
| 134 | #else | 134 | #else |
| 135 | static __always_inline void rcu_irq_work_resched(void) { } | 135 | static __always_inline void rcu_irq_work_resched(void) { } |
| @@ -14,4 +14,4 @@ CFLAGS_common.o += -fno-stack-protector · 13 unmodified lines | |||
| 14 | 14 | ||
| 15 | obj-$(CONFIG_GENERIC_IRQ_ENTRY) += common.o | 15 | obj-$(CONFIG_GENERIC_IRQ_ENTRY) += common.o |
| 16 | obj-$(CONFIG_GENERIC_SYSCALL) += syscall-common.o syscall_user_dispatch.o | 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,6 +1,6 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | ||
| 3 | #include <linux/entry-kvm.h> | 3 | #include <linux/entry-virt.h> |
| 4 | 4 | ||
| 5 | static int xfer_to_guest_mode_work(unsigned long ti_work) | 5 | static int xfer_to_guest_mode_work(unsigned long ti_work) |
| 6 | { | 6 | { |
| @@ -573,7 +573,7 @@ void rcutorture_format_gp_seqs(unsigned long long seqs, char *cp, size_t len) · 572 unmodified lines | |||
| 573 | } | 573 | } |
| 574 | EXPORT_SYMBOL_GPL(rcutorture_format_gp_seqs); | 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 | * An empty function that will trigger a reschedule on | 578 | * An empty function that will trigger a reschedule on |
| 579 | * IRQ tail once IRQs get re-enabled on userspace/guest resume. | 579 | * 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 | |||
| 602 | if (IS_ENABLED(CONFIG_GENERIC_ENTRY) && !(current->flags & PF_VCPU)) | 602 | if (IS_ENABLED(CONFIG_GENERIC_ENTRY) && !(current->flags & PF_VCPU)) |
| 603 | return; | 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 | return; | 606 | return; |
| 607 | 607 | ||
| 608 | instrumentation_begin(); | 608 | instrumentation_begin(); |
| @@ -611,7 +611,7 @@ noinstr void rcu_irq_work_resched(void) · 2 unmodified lines | |||
| 611 | } | 611 | } |
| 612 | instrumentation_end(); | 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 | #ifdef CONFIG_PROVE_RCU | 616 | #ifdef CONFIG_PROVE_RCU |
| 617 | /** | 617 | /** |
| @@ -87,7 +87,7 @@ config HAVE_KVM_VCPU_RUN_PID_CHANGE · 86 unmodified lines | |||
| 87 | config HAVE_KVM_NO_POLL | 87 | config HAVE_KVM_NO_POLL |
| 88 | bool | 88 | bool |
| 89 | 89 | ||
| 90 | config KVM_XFER_TO_GUEST_WORK | 90 | config VIRT_XFER_TO_GUEST_WORK |
| 91 | bool | 91 | bool |
| 92 | 92 | ||
| 93 | config HAVE_KVM_PM_NOTIFIER | 93 | config HAVE_KVM_PM_NOTIFIER |