Skip to content

Commit 9be7e1e

Browse files
sean-jcliuw
authored andcommitted
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>
1 parent 6d0386e commit 9be7e1e

12 files changed

Lines changed: 19 additions & 19 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10200,7 +10200,7 @@ L: linux-kernel@vger.kernel.org
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ menuconfig KVM
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ config KVM
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ config KVM
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ config KVM_X86
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
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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 @@
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)
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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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)
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)
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static inline void rcu_sysrq_start(void) { }
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ CFLAGS_common.o += -fno-stack-protector
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
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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
{

0 commit comments

Comments
 (0)