[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ab7f5935-fd5e-4ba5-a97d-5433f241a089@intel.com>
Date: Thu, 5 Feb 2026 16:10:37 -0800
From: Sohil Mehta <sohil.mehta@...el.com>
To: Shashank Balaji <shashank.mahadasyam@...y.com>, Thomas Gleixner
<tglx@...nel.org>, Ingo Molnar <mingo@...hat.com>, Borislav Petkov
<bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>, "K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>, Wei Liu <wei.liu@...nel.org>, "Dexuan
Cui" <decui@...rosoft.com>, Long Li <longli@...rosoft.com>, Ajay Kaher
<ajay.kaher@...adcom.com>, Alexey Makhalov <alexey.makhalov@...adcom.com>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
Jan Kiszka <jan.kiszka@...mens.com>, Paolo Bonzini <pbonzini@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>, Juergen Gross <jgross@...e.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>
CC: <linux-kernel@...r.kernel.org>, <linux-hyperv@...r.kernel.org>,
<virtualization@...ts.linux.dev>, <jailhouse-dev@...glegroups.com>,
<kvm@...r.kernel.org>, <xen-devel@...ts.xenproject.org>, Rahul Bukte
<rahul.bukte@...y.com>, Daniel Palmer <daniel.palmer@...y.com>, Tim Bird
<tim.bird@...y.com>
Subject: Re: [PATCH 3/3] x86/virt: rename x2apic_available to
x2apic_without_ir_available
On 2/2/2026 1:51 AM, Shashank Balaji wrote:
> No functional change.
>
> x86_init.hyper.x2apic_available is used only in try_to_enable_x2apic to check if
> x2apic needs to be disabled if interrupt remapping support isn't present. But
> the name x2apic_available doesn't reflect that usage.
>
I don't understand the premise of this patch. Shouldn't the variable
name reflect what is stored rather than how it is used?
> This is what x2apic_available is set to for various hypervisors:
>
> acrn boot_cpu_has(X86_FEATURE_X2APIC)
> mshyperv boot_cpu_has(X86_FEATURE_X2APIC)
> xen boot_cpu_has(X86_FEATURE_X2APIC) or false
> vmware vmware_legacy_x2apic_available
> kvm kvm_cpuid_base() != 0
> jailhouse x2apic_enabled()
> bhyve true
> default false
>
If both interrupt remapping and x2apic are enabled, what would the name
x2apic_without_ir_available signify?
A value of "true" would mean x2apic is available without IR. But that
would be inaccurate for most hypervisors. A value of "false" could be
interpreted as x2apic is not available, which is also inaccurate.
To me, x2apic_available makes more sense than
x2apic_without_ir_available based on the values being set by the
hypervisors.
> Bare metal and vmware correctly check if x2apic is available without interrupt
> remapping. The rest of them check if x2apic is enabled/supported, and kvm just
> checks if the kernel is running on kvm. The other hypervisors may have to have
> their checks audited.
>
AFAIU, the value on bare metal is set to false because this is a
hypervisor specific variable. Perhaps I have misunderstood something?
Powered by blists - more mailing lists