From: Joel Fernandes <joelagnelf@nvidia.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Marc Zyngier <maz@kernel.org>,
Oliver Upton <oliver.upton@linux.dev>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Tianrui Zhao <zhaotianrui@loongson.cn>,
Bibo Mao <maobibo@loongson.cn>,
Huacai Chen <chenhuacai@kernel.org>,
Anup Patel <anup@brainfault.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Paolo Bonzini <pbonzini@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
Peter Zijlstra <peterz@infradead.org>,
Andy Lutomirski <luto@kernel.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
Frederic Weisbecker <frederic@kernel.org>,
Neeraj Upadhyay <neeraj.upadhyay@kernel.org>,
Josh Triplett <josh@joshtriplett.org>,
Boqun Feng <boqun.feng@gmail.com>,
Uladzislau Rezki <urezki@gmail.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
kvm@vger.kernel.org, loongarch@lists.linux.dev,
kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org,
linux-hyperv@vger.kernel.org, rcu@vger.kernel.org,
Nuno Das Neves <nunodasneves@linux.microsoft.com>,
Mukesh R <mrathor@linux.microsoft.com>
Subject: Re: [PATCH v2 5/7] entry: Rename "kvm" entry code assets to "virt" to genericize APIs
Date: Wed, 10 Sep 2025 10:45:54 -0400 [thread overview]
Message-ID: <20250910144554.GA563958@joelbox2> (raw)
In-Reply-To: <20250828000156.23389-6-seanjc@google.com>
On Wed, Aug 27, 2025 at 05:01:54PM -0700, Sean Christopherson wrote:
> 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>
> ---
> MAINTAINERS | 2 +-
> arch/arm64/kvm/Kconfig | 2 +-
> arch/loongarch/kvm/Kconfig | 2 +-
> arch/riscv/kvm/Kconfig | 2 +-
> arch/x86/kvm/Kconfig | 2 +-
> include/linux/{entry-kvm.h => entry-virt.h} | 8 ++++----
> include/linux/kvm_host.h | 6 +++---
> include/linux/rcupdate.h | 2 +-
> kernel/entry/Makefile | 2 +-
> kernel/entry/{kvm.c => virt.c} | 2 +-
> kernel/rcu/tree.c | 6 +++---
For RCU part,
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
thanks,
- Joel
> virt/kvm/Kconfig | 2 +-
> 12 files changed, 19 insertions(+), 19 deletions(-)
> rename include/linux/{entry-kvm.h => entry-virt.h} (94%)
> rename kernel/entry/{kvm.c => virt.c} (97%)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index fe168477caa4..c255048333f0 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -10200,7 +10200,7 @@ L: linux-kernel@vger.kernel.org
> S: Maintained
> T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/entry
> F: include/linux/entry-common.h
> -F: include/linux/entry-kvm.h
> +F: include/linux/entry-virt.h
> F: include/linux/irq-entry-common.h
> F: kernel/entry/
>
> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
> index 713248f240e0..6f4fc3caa31a 100644
> --- a/arch/arm64/kvm/Kconfig
> +++ b/arch/arm64/kvm/Kconfig
> @@ -25,7 +25,7 @@ menuconfig KVM
> select HAVE_KVM_CPU_RELAX_INTERCEPT
> select KVM_MMIO
> select KVM_GENERIC_DIRTYLOG_READ_PROTECT
> - select KVM_XFER_TO_GUEST_WORK
> + select VIRT_XFER_TO_GUEST_WORK
> select KVM_VFIO
> select HAVE_KVM_DIRTY_RING_ACQ_REL
> select NEED_KVM_DIRTY_RING_WITH_BITMAP
> diff --git a/arch/loongarch/kvm/Kconfig b/arch/loongarch/kvm/Kconfig
> index 40eea6da7c25..ae64bbdf83a7 100644
> --- a/arch/loongarch/kvm/Kconfig
> +++ b/arch/loongarch/kvm/Kconfig
> @@ -31,7 +31,7 @@ config KVM
> select KVM_GENERIC_HARDWARE_ENABLING
> select KVM_GENERIC_MMU_NOTIFIER
> select KVM_MMIO
> - select KVM_XFER_TO_GUEST_WORK
> + select VIRT_XFER_TO_GUEST_WORK
> select SCHED_INFO
> select GUEST_PERF_EVENTS if PERF_EVENTS
> help
> diff --git a/arch/riscv/kvm/Kconfig b/arch/riscv/kvm/Kconfig
> index 5a62091b0809..c50328212917 100644
> --- a/arch/riscv/kvm/Kconfig
> +++ b/arch/riscv/kvm/Kconfig
> @@ -30,7 +30,7 @@ config KVM
> select KVM_GENERIC_DIRTYLOG_READ_PROTECT
> select KVM_GENERIC_HARDWARE_ENABLING
> select KVM_MMIO
> - select KVM_XFER_TO_GUEST_WORK
> + select VIRT_XFER_TO_GUEST_WORK
> select KVM_GENERIC_MMU_NOTIFIER
> select SCHED_INFO
> select GUEST_PERF_EVENTS if PERF_EVENTS
> diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
> index 2c86673155c9..f81074b0c0a8 100644
> --- a/arch/x86/kvm/Kconfig
> +++ b/arch/x86/kvm/Kconfig
> @@ -40,7 +40,7 @@ config KVM_X86
> select HAVE_KVM_MSI
> select HAVE_KVM_CPU_RELAX_INTERCEPT
> select HAVE_KVM_NO_POLL
> - select KVM_XFER_TO_GUEST_WORK
> + select VIRT_XFER_TO_GUEST_WORK
> select KVM_GENERIC_DIRTYLOG_READ_PROTECT
> select KVM_VFIO
> select HAVE_KVM_PM_NOTIFIER if PM
> diff --git a/include/linux/entry-kvm.h b/include/linux/entry-virt.h
> similarity index 94%
> rename from include/linux/entry-kvm.h
> rename to include/linux/entry-virt.h
> index 3644de7e6019..42c89e3e5ca7 100644
> --- a/include/linux/entry-kvm.h
> +++ b/include/linux/entry-virt.h
> @@ -1,6 +1,6 @@
> /* SPDX-License-Identifier: GPL-2.0 */
> -#ifndef __LINUX_ENTRYKVM_H
> -#define __LINUX_ENTRYKVM_H
> +#ifndef __LINUX_ENTRYVIRT_H
> +#define __LINUX_ENTRYVIRT_H
>
> #include <linux/static_call_types.h>
> #include <linux/resume_user_mode.h>
> @@ -10,7 +10,7 @@
> #include <linux/tick.h>
>
> /* Transfer to guest mode work */
> -#ifdef CONFIG_KVM_XFER_TO_GUEST_WORK
> +#ifdef CONFIG_VIRT_XFER_TO_GUEST_WORK
>
> #ifndef ARCH_XFER_TO_GUEST_MODE_WORK
> # define ARCH_XFER_TO_GUEST_MODE_WORK (0)
> @@ -90,6 +90,6 @@ static inline bool xfer_to_guest_mode_work_pending(void)
> lockdep_assert_irqs_disabled();
> return __xfer_to_guest_mode_work_pending();
> }
> -#endif /* CONFIG_KVM_XFER_TO_GUEST_WORK */
> +#endif /* CONFIG_VIRT_XFER_TO_GUEST_WORK */
>
> #endif
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index 598b9473e46d..70ac2267d5d0 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -2,7 +2,7 @@
> #ifndef __KVM_HOST_H
> #define __KVM_HOST_H
>
> -#include <linux/entry-kvm.h>
> +#include <linux/entry-virt.h>
> #include <linux/types.h>
> #include <linux/hardirq.h>
> #include <linux/list.h>
> @@ -2444,7 +2444,7 @@ static inline int kvm_arch_vcpu_run_pid_change(struct kvm_vcpu *vcpu)
> }
> #endif /* CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE */
>
> -#ifdef CONFIG_KVM_XFER_TO_GUEST_WORK
> +#ifdef CONFIG_VIRT_XFER_TO_GUEST_WORK
> static inline void kvm_handle_signal_exit(struct kvm_vcpu *vcpu)
> {
> 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)
> }
> return r;
> }
> -#endif /* CONFIG_KVM_XFER_TO_GUEST_WORK */
> +#endif /* CONFIG_VIRT_XFER_TO_GUEST_WORK */
>
> /*
> * If more than one page is being (un)accounted, @virt must be the address of
> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> index 120536f4c6eb..1e1f3aa375d9 100644
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -129,7 +129,7 @@ static inline void rcu_sysrq_start(void) { }
> static inline void rcu_sysrq_end(void) { }
> #endif /* #else #ifdef CONFIG_RCU_STALL_COMMON */
>
> -#if defined(CONFIG_NO_HZ_FULL) && (!defined(CONFIG_GENERIC_ENTRY) || !defined(CONFIG_KVM_XFER_TO_GUEST_WORK))
> +#if defined(CONFIG_NO_HZ_FULL) && (!defined(CONFIG_GENERIC_ENTRY) || !defined(CONFIG_VIRT_XFER_TO_GUEST_WORK))
> void rcu_irq_work_resched(void);
> #else
> static __always_inline void rcu_irq_work_resched(void) { }
> diff --git a/kernel/entry/Makefile b/kernel/entry/Makefile
> index 77fcd83dd663..2333d70802e4 100644
> --- a/kernel/entry/Makefile
> +++ b/kernel/entry/Makefile
> @@ -14,4 +14,4 @@ CFLAGS_common.o += -fno-stack-protector
>
> obj-$(CONFIG_GENERIC_IRQ_ENTRY) += common.o
> obj-$(CONFIG_GENERIC_SYSCALL) += syscall-common.o syscall_user_dispatch.o
> -obj-$(CONFIG_KVM_XFER_TO_GUEST_WORK) += kvm.o
> +obj-$(CONFIG_VIRT_XFER_TO_GUEST_WORK) += virt.o
> diff --git a/kernel/entry/kvm.c b/kernel/entry/virt.c
> similarity index 97%
> rename from kernel/entry/kvm.c
> rename to kernel/entry/virt.c
> index 6fc762eaacca..c52f99249763 100644
> --- a/kernel/entry/kvm.c
> +++ b/kernel/entry/virt.c
> @@ -1,6 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0
>
> -#include <linux/entry-kvm.h>
> +#include <linux/entry-virt.h>
>
> static int xfer_to_guest_mode_work(unsigned long ti_work)
> {
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 174ee243b349..995489b72535 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -573,7 +573,7 @@ void rcutorture_format_gp_seqs(unsigned long long seqs, char *cp, size_t len)
> }
> EXPORT_SYMBOL_GPL(rcutorture_format_gp_seqs);
>
> -#if defined(CONFIG_NO_HZ_FULL) && (!defined(CONFIG_GENERIC_ENTRY) || !defined(CONFIG_KVM_XFER_TO_GUEST_WORK))
> +#if defined(CONFIG_NO_HZ_FULL) && (!defined(CONFIG_GENERIC_ENTRY) || !defined(CONFIG_VIRT_XFER_TO_GUEST_WORK))
> /*
> * An empty function that will trigger a reschedule on
> * IRQ tail once IRQs get re-enabled on userspace/guest resume.
> @@ -602,7 +602,7 @@ noinstr void rcu_irq_work_resched(void)
> if (IS_ENABLED(CONFIG_GENERIC_ENTRY) && !(current->flags & PF_VCPU))
> return;
>
> - if (IS_ENABLED(CONFIG_KVM_XFER_TO_GUEST_WORK) && (current->flags & PF_VCPU))
> + if (IS_ENABLED(CONFIG_VIRT_XFER_TO_GUEST_WORK) && (current->flags & PF_VCPU))
> return;
>
> instrumentation_begin();
> @@ -611,7 +611,7 @@ noinstr void rcu_irq_work_resched(void)
> }
> instrumentation_end();
> }
> -#endif /* #if defined(CONFIG_NO_HZ_FULL) && (!defined(CONFIG_GENERIC_ENTRY) || !defined(CONFIG_KVM_XFER_TO_GUEST_WORK)) */
> +#endif /* #if defined(CONFIG_NO_HZ_FULL) && (!defined(CONFIG_GENERIC_ENTRY) || !defined(CONFIG_VIRT_XFER_TO_GUEST_WORK)) */
>
> #ifdef CONFIG_PROVE_RCU
> /**
> diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig
> index 727b542074e7..ce843db53831 100644
> --- a/virt/kvm/Kconfig
> +++ b/virt/kvm/Kconfig
> @@ -87,7 +87,7 @@ config HAVE_KVM_VCPU_RUN_PID_CHANGE
> config HAVE_KVM_NO_POLL
> bool
>
> -config KVM_XFER_TO_GUEST_WORK
> +config VIRT_XFER_TO_GUEST_WORK
> bool
>
> config HAVE_KVM_PM_NOTIFIER
> --
> 2.51.0.268.g9569e192d0-goog
>
next prev parent reply other threads:[~2025-09-10 14:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-28 0:01 [PATCH v2 0/7] Drivers: hv: Fix NEED_RESCHED_LAZY and use common APIs Sean Christopherson
2025-08-28 0:01 ` [PATCH v2 1/7] Drivers: hv: Handle NEED_RESCHED_LAZY before transferring to guest Sean Christopherson
2025-08-28 23:56 ` Nuno Das Neves
2025-08-28 0:01 ` [PATCH v2 2/7] Drivers: hv: Disentangle VTL return cancellation from SIGPENDING Sean Christopherson
2025-08-29 18:38 ` Wei Liu
2025-08-28 0:01 ` [PATCH v2 3/7] Drivers: hv: Disable IRQs only after handling pending work before VTL return Sean Christopherson
2025-08-28 0:01 ` [PATCH v2 4/7] entry/kvm: KVM: Move KVM details related to signal/-EINTR into KVM proper Sean Christopherson
2025-09-02 15:41 ` Thomas Gleixner
2025-08-28 0:01 ` [PATCH v2 5/7] entry: Rename "kvm" entry code assets to "virt" to genericize APIs Sean Christopherson
2025-09-02 15:41 ` Thomas Gleixner
2025-09-10 14:45 ` Joel Fernandes [this message]
2025-08-28 0:01 ` [PATCH v2 6/7] Drivers: hv: Use common "entry virt" APIs to do work in root before running guest Sean Christopherson
2025-08-29 0:03 ` Nuno Das Neves
2025-08-28 0:01 ` [PATCH v2 7/7] Drivers: hv: Use "entry virt" APIs to do work before returning to lower VTL Sean Christopherson
2025-09-04 23:41 ` [PATCH v2 0/7] Drivers: hv: Fix NEED_RESCHED_LAZY and use common APIs Wei Liu
2025-09-05 5:39 ` Sean Christopherson
2025-09-09 17:20 ` Wei Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250910144554.GA563958@joelbox2 \
--to=joelagnelf@nvidia.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=boqun.feng@gmail.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@kernel.org \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=frederic@kernel.org \
--cc=haiyangz@microsoft.com \
--cc=josh@joshtriplett.org \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=kys@microsoft.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=loongarch@lists.linux.dev \
--cc=luto@kernel.org \
--cc=maobibo@loongson.cn \
--cc=maz@kernel.org \
--cc=mingo@redhat.com \
--cc=mrathor@linux.microsoft.com \
--cc=neeraj.upadhyay@kernel.org \
--cc=nunodasneves@linux.microsoft.com \
--cc=oliver.upton@linux.dev \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=paulmck@kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rcu@vger.kernel.org \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=urezki@gmail.com \
--cc=wei.liu@kernel.org \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=zhaotianrui@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).