Re: [PATCH RESEND v4 2/3] x86/apic: Introduce a variable to track the number of EILVT registers

From: Borislav Petkov

Date: Tue Sep 22 2026 - 01:37:48 EST


On Thu, Sep 03, 2026 at 02:58:40PM +0530, Naveen N Rao (AMD) wrote:
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index 90025451ace2..c990f403ec7f 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -410,6 +410,15 @@ int setup_APIC_eilvt(u8 offset, u8 vector, u8 msg_type, u8 mask)
> }
> EXPORT_SYMBOL_GPL(setup_APIC_eilvt);
>
> +static __init void init_eilvt(void)
> +{
> + if (cpu_feature_enabled(X86_FEATURE_EXTAPIC))
> + apic->eilvt_regs_count = APIC_EFEAT_XLC(apic_read(APIC_EFEAT));
> +
> + if (!apic->eilvt_regs_count && boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
> + apic->eilvt_regs_count = APIC_EILVT_NR_AMD_10H;

Why not simply:

if (cpu_feature_enabled(X86_FEATURE_EXTAPIC))
apic->eilvt_regs_count = APIC_EFEAT_XLC(apic_read(APIC_EFEAT));
else if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
apic->eilvt_regs_count = APIC_EILVT_NR_AMD_10H;

?


And now I see the big picture - you have a single logical patch - add
eilvt_regs_count - and the rest of the code is reorg and cleanup.

So why are there three patches?

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette