From: Sean Christopherson <seanjc@google.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: 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, Arnd Bergmann <arnd@arndb.de>,
kernel test robot <lkp@intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Michael Roth <michael.roth@amd.com>,
Isaku Yamahata <isaku.yamahata@intel.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: kvm: add back X86_LOCAL_APIC dependency
Date: Wed, 13 Nov 2024 06:42:33 -0800 [thread overview]
Message-ID: <ZzS62W60NS_sM31K@google.com> (raw)
In-Reply-To: <20241112065415.3974321-1-arnd@kernel.org>
On Tue, Nov 12, 2024, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Enabling KVM now causes a build failure on x86-32 if X86_LOCAL_APIC
> is disabled:
>
> arch/x86/kvm/svm/svm.c: In function 'svm_emergency_disable_virtualization_cpu':
> arch/x86/kvm/svm/svm.c:597:9: error: 'kvm_rebooting' undeclared (first use in this function); did you mean 'kvm_irq_routing'?
> 597 | kvm_rebooting = true;
> | ^~~~~~~~~~~~~
> | kvm_irq_routing
> arch/x86/kvm/svm/svm.c:597:9: note: each undeclared identifier is reported only once for each function it appears in
> make[6]: *** [scripts/Makefile.build:221: arch/x86/kvm/svm/svm.o] Error 1
> In file included from include/linux/rculist.h:11,
> from include/linux/hashtable.h:14,
> from arch/x86/kvm/svm/avic.c:18:
> arch/x86/kvm/svm/avic.c: In function 'avic_pi_update_irte':
> arch/x86/kvm/svm/avic.c:909:38: error: 'struct kvm' has no member named 'irq_routing'
> 909 | irq_rt = srcu_dereference(kvm->irq_routing, &kvm->irq_srcu);
> | ^~
> include/linux/rcupdate.h:538:17: note: in definition of macro '__rcu_dereference_check'
> 538 | typeof(*p) *local = (typeof(*p) *__force)READ_ONCE(p); \
>
> Move the dependency to the same place as before.
>
> Fixes: ea4290d77bda ("KVM: x86: leave kvm.ko out of the build if no vendor module is requested")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202410060426.e9Xsnkvi-lkp@intel.com/
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> Question: is there actually any point in keeping KVM support for 32-bit host
> processors? From what I can tell, the only 32-bit CPUs that support this are
> the rare Atom E6xx and Z5xx models and the even older Yonah/Sossaman "Core
> Duo", everything else is presumably better off just running a 64-bit kernel
> even for 32-bit guests?
> ---
> arch/x86/kvm/Kconfig | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
> index 1ed1e4f5d51c..849a03f3ba95 100644
> --- a/arch/x86/kvm/Kconfig
> +++ b/arch/x86/kvm/Kconfig
> @@ -19,7 +19,6 @@ if VIRTUALIZATION
>
> config KVM_X86
> def_tristate KVM if KVM_INTEL || KVM_AMD
> - depends on X86_LOCAL_APIC
> select KVM_COMMON
> select KVM_GENERIC_MMU_NOTIFIER
> select KVM_ELIDE_TLB_FLUSH_IF_YOUNG
> @@ -93,6 +92,7 @@ config KVM_SW_PROTECTED_VM
> config KVM_INTEL
> tristate "KVM for Intel (and compatible) processors support"
> depends on KVM && IA32_FEAT_CTL
> + depends on X86_LOCAL_APIC
> help
> Provides support for KVM on processors equipped with Intel's VT
> extensions, a.k.a. Virtual Machine Extensions (VMX).
> @@ -130,6 +130,7 @@ config X86_SGX_KVM
> config KVM_AMD
> tristate "KVM for AMD processors support"
> depends on KVM && (CPU_SUP_AMD || CPU_SUP_HYGON)
> + depends on X86_LOCAL_APIC
The dependency can and should go on "config KVM", not on the vendor modules. The
net effect on the build is the same, but preventing the user from selecting KVM
will provide a slightly better experience.
next prev parent reply other threads:[~2024-11-13 14:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 6:53 [PATCH] x86: kvm: add back X86_LOCAL_APIC dependency Arnd Bergmann
2024-11-12 18:05 ` Sean Christopherson
2024-11-12 18:10 ` H. Peter Anvin
2024-11-12 18:22 ` Sean Christopherson
2024-11-13 14:42 ` Sean Christopherson [this message]
2024-11-13 15:54 ` Arnd Bergmann
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=ZzS62W60NS_sM31K@google.com \
--to=seanjc@google.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=isaku.yamahata@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=michael.roth@amd.com \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=x86@kernel.org \
/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