diff mbox series

[RFC,01/15] x86/apic: Fix 32-bit APIC initialization for extended Intel families

Message ID 20241220213711.1892696-2-sohil.mehta@intel.com (mailing list archive)
State Handled Elsewhere
Headers show
Series Prepare for new Intel family models | expand

Commit Message

Sohil Mehta Dec. 20, 2024, 9:36 p.m. UTC
detect_init_APIC() limits the APIC detection to families 6 and 15.
Extend the check to family numbers beyond 15. Also, convert it to a VFM
check to make it simpler.

Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
---
 arch/x86/kernel/apic/apic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dave Hansen Dec. 20, 2024, 11:13 p.m. UTC | #1
On 12/20/24 13:36, Sohil Mehta wrote:
> detect_init_APIC() limits the APIC detection to families 6 and 15.
> Extend the check to family numbers beyond 15. Also, convert it to a VFM
> check to make it simpler.

This changelog doesn't _quite_ fit the code. I'd rather it was a bit
more precise. It does not _just_ expand to "numbers beyond 15".

Also, It doesn't _really_ help to have the changelog tell us the
function name. That's why we have diff -p.  How about:

	APIC detection is currently limited to a few specific families
	and will not match the upcoming families >=18.

	Extend the check to include all families 6 or greater. Also
	convert it to a VFM check to make it simpler.

>  arch/x86/kernel/apic/apic.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
> index c5fb28e6451a..13dac8f78213 100644
> --- a/arch/x86/kernel/apic/apic.c
> +++ b/arch/x86/kernel/apic/apic.c
> @@ -2014,8 +2014,8 @@ static bool __init detect_init_APIC(void)
>  	case X86_VENDOR_HYGON:
>  		break;
>  	case X86_VENDOR_INTEL:
> -		if (boot_cpu_data.x86 == 6 || boot_cpu_data.x86 == 15 ||
> -		    (boot_cpu_data.x86 == 5 && boot_cpu_has(X86_FEATURE_APIC)))
> +		if ((boot_cpu_data.x86 == 5 && boot_cpu_has(X86_FEATURE_APIC)) ||
> +		    boot_cpu_data.x86_vfm >= INTEL_PENTIUM_PRO)
>  			break;
>  		goto no_apic;
>  	default:

With that changelog tweak:

Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
diff mbox series

Patch

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index c5fb28e6451a..13dac8f78213 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2014,8 +2014,8 @@  static bool __init detect_init_APIC(void)
 	case X86_VENDOR_HYGON:
 		break;
 	case X86_VENDOR_INTEL:
-		if (boot_cpu_data.x86 == 6 || boot_cpu_data.x86 == 15 ||
-		    (boot_cpu_data.x86 == 5 && boot_cpu_has(X86_FEATURE_APIC)))
+		if ((boot_cpu_data.x86 == 5 && boot_cpu_has(X86_FEATURE_APIC)) ||
+		    boot_cpu_data.x86_vfm >= INTEL_PENTIUM_PRO)
 			break;
 		goto no_apic;
 	default: