Re: [PATCH 04/12] x86/mm: get INVLPGB count max from CPUID
From: Tom Lendacky
Date: Fri Jan 10 2025 - 15:31:55 EST
On 1/10/25 14:27, Rik van Riel wrote:
> On Fri, 2025-01-10 at 12:44 -0600, Tom Lendacky wrote:
>> On 12/30/24 11:53, Rik van Riel wrote:
>>>
>>> +++ b/arch/x86/kernel/cpu/amd.c
>>> @@ -1135,6 +1135,14 @@ static void cpu_detect_tlb_amd(struct
>>> cpuinfo_x86 *c)
>>> tlb_lli_2m[ENTRIES] = eax & mask;
>>>
>>> tlb_lli_4m[ENTRIES] = tlb_lli_2m[ENTRIES] >> 1;
>>> +
>>> + if (c->extended_cpuid_level < 0x80000008)
>>> + return;
>>
>> Can this just be based on cpu_feature_enabled(X86_FEATURE_TLBI), e.g:
>>
>> if (cpu_feature_enabled(X86_FEATURE_TLBI))
>> invlpgb_count_max = (cpuid_edx(0x80000008) & 0xffff)
>> + 1
>>
> I don't see X86_FEATURE_TLBI defined in the tip
> tree. Which CPUID bit does that need to be?
Sorry, I meant X86_FEATURE_INVLPGB.
Thanks,
Tom
>
>> Then you can squash this and the previous patch.
>
> Heh, I already squashed the previous commit into
> what is patch 6 in this series, as requested by
> Borislav :)
>