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
10200S: Maintained10200S: Maintained
10201T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/entry10201T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/entry
10202F: include/linux/entry-common.h10202F: include/linux/entry-common.h
10203F: include/linux/entry-kvm.h10203F: include/linux/entry-virt.h
10204F: include/linux/irq-entry-common.h10204F: include/linux/irq-entry-common.h
10205F: kernel/entry/10205F: kernel/entry/
10206 10206
arch/arm64/kvm/Kconfig+1−1
@@ -25,7 +25,7 @@ menuconfig KVM · 24 unmodified lines
25 select HAVE_KVM_CPU_RELAX_INTERCEPT25 select HAVE_KVM_CPU_RELAX_INTERCEPT
26 select KVM_MMIO26 select KVM_MMIO
27 select KVM_GENERIC_DIRTYLOG_READ_PROTECT27 select KVM_GENERIC_DIRTYLOG_READ_PROTECT
28 select KVM_XFER_TO_GUEST_WORK28 select VIRT_XFER_TO_GUEST_WORK
29 select KVM_VFIO29 select KVM_VFIO
30 select HAVE_KVM_DIRTY_RING_ACQ_REL30 select HAVE_KVM_DIRTY_RING_ACQ_REL
31 select NEED_KVM_DIRTY_RING_WITH_BITMAP31 select NEED_KVM_DIRTY_RING_WITH_BITMAP
arch/loongarch/kvm/Kconfig+1−1
@@ -31,7 +31,7 @@ config KVM · 30 unmodified lines
31 select KVM_GENERIC_HARDWARE_ENABLING31 select KVM_GENERIC_HARDWARE_ENABLING
32 select KVM_GENERIC_MMU_NOTIFIER32 select KVM_GENERIC_MMU_NOTIFIER
33 select KVM_MMIO33 select KVM_MMIO
34 select KVM_XFER_TO_GUEST_WORK34 select VIRT_XFER_TO_GUEST_WORK
35 select SCHED_INFO35 select SCHED_INFO
36 select GUEST_PERF_EVENTS if PERF_EVENTS36 select GUEST_PERF_EVENTS if PERF_EVENTS
37 help37 help
arch/riscv/kvm/Kconfig+1−1
@@ -30,7 +30,7 @@ config KVM · 29 unmodified lines
30 select KVM_GENERIC_DIRTYLOG_READ_PROTECT30 select KVM_GENERIC_DIRTYLOG_READ_PROTECT
31 select KVM_GENERIC_HARDWARE_ENABLING31 select KVM_GENERIC_HARDWARE_ENABLING
32 select KVM_MMIO32 select KVM_MMIO
33 select KVM_XFER_TO_GUEST_WORK33 select VIRT_XFER_TO_GUEST_WORK
34 select KVM_GENERIC_MMU_NOTIFIER34 select KVM_GENERIC_MMU_NOTIFIER
35 select SCHED_INFO35 select SCHED_INFO
36 select GUEST_PERF_EVENTS if PERF_EVENTS36 select GUEST_PERF_EVENTS if PERF_EVENTS
arch/x86/kvm/Kconfig+1−1
@@ -40,7 +40,7 @@ config KVM_X86 · 39 unmodified lines
40 select HAVE_KVM_MSI40 select HAVE_KVM_MSI
41 select HAVE_KVM_CPU_RELAX_INTERCEPT41 select HAVE_KVM_CPU_RELAX_INTERCEPT
42 select HAVE_KVM_NO_POLL42 select HAVE_KVM_NO_POLL
43 select KVM_XFER_TO_GUEST_WORK43 select VIRT_XFER_TO_GUEST_WORK
44 select KVM_GENERIC_DIRTYLOG_READ_PROTECT44 select KVM_GENERIC_DIRTYLOG_READ_PROTECT
45 select KVM_VFIO45 select KVM_VFIO
46 select HAVE_KVM_PM_NOTIFIER if PM46 select HAVE_KVM_PM_NOTIFIER if PM
include/linux/entry-virt.hrenamed from include/linux/entry-kvm.h+4−4
@@ -1,6 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 */1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __LINUX_ENTRYKVM_H2#ifndef __LINUX_ENTRYVIRT_H
3#define __LINUX_ENTRYKVM_H3#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_WORK13#ifdef CONFIG_VIRT_XFER_TO_GUEST_WORK
14 14
15#ifndef ARCH_XFER_TO_GUEST_MODE_WORK15#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#endif95#endif
include/linux/kvm_host.h+3−3
@@ -2,7 +2,7 @@ · 1 unmodified line
2#ifndef __KVM_HOST_H2#ifndef __KVM_HOST_H
3#define __KVM_HOST_H3#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_WORK2447#ifdef CONFIG_VIRT_XFER_TO_GUEST_WORK
2448static inline void kvm_handle_signal_exit(struct kvm_vcpu *vcpu)2448static 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 of2467 * 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
129static inline void rcu_sysrq_end(void) { }129static 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))
133void rcu_irq_work_resched(void);133void rcu_irq_work_resched(void);
134#else134#else
135static __always_inline void rcu_irq_work_resched(void) { }135static __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
14 14
15obj-$(CONFIG_GENERIC_IRQ_ENTRY) += common.o15obj-$(CONFIG_GENERIC_IRQ_ENTRY) += common.o
16obj-$(CONFIG_GENERIC_SYSCALL) += syscall-common.o syscall_user_dispatch.o16obj-$(CONFIG_GENERIC_SYSCALL) += syscall-common.o syscall_user_dispatch.o
17obj-$(CONFIG_KVM_XFER_TO_GUEST_WORK) += kvm.o17obj-$(CONFIG_VIRT_XFER_TO_GUEST_WORK) += virt.o
kernel/entry/virt.crenamed from kernel/entry/kvm.c+1−1
@@ -1,6 +1,6 @@
1// SPDX-License-Identifier: GPL-2.01// SPDX-License-Identifier: GPL-2.0
2 2
3#include <linux/entry-kvm.h>3#include <linux/entry-virt.h>
4 4
5static int xfer_to_guest_mode_work(unsigned long ti_work)5static int xfer_to_guest_mode_work(unsigned long ti_work)
6{6{
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
573}573}
574EXPORT_SYMBOL_GPL(rcutorture_format_gp_seqs);574EXPORT_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 on578 * 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_RCU616#ifdef CONFIG_PROVE_RCU
617/**617/**
virt/kvm/Kconfig+1−1
@@ -87,7 +87,7 @@ config HAVE_KVM_VCPU_RUN_PID_CHANGE · 86 unmodified lines
87config HAVE_KVM_NO_POLL87config HAVE_KVM_NO_POLL
88 bool88 bool
89 89
90config KVM_XFER_TO_GUEST_WORK90config VIRT_XFER_TO_GUEST_WORK
91 bool91 bool
92 92
93config HAVE_KVM_PM_NOTIFIER93config 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