[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 6 Jun 2017 18:01:33 -0500
From: Janakarajan Natarajan <jnataraj@....com>
To: Borislav Petkov <bp@...en8.de>,
Peter Zijlstra <peterz@...radead.org>
Cc: Janakarajan Natarajan <Janakarajan.Natarajan@....com>,
linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Suravee Suthikulpanit <suravee.suthikulpanit@....com>
Subject: Re: [PATCH 2/2] amd: uncore: Get correct number of cores sharing last
level cache
On 06/06/2017 12:45 PM, Borislav Petkov wrote:
> On Tue, Jun 06, 2017 at 12:15:30PM +0200, Peter Zijlstra wrote:
>> Maybe something like:
>>
>> for (cache_level = 0; cache_level < 3; cache_level++) {
>> cpuid_count(0x8000001d, cache_level, &eax, &ebx, &ecx, &edx);
>>
>> if ((eax & 0x1f) == 0) /* EAX[0:4] gives cache type */
> if (!(eax & 0x1f))
>
>> break;
>>
>> prev_eax = eax;
>> }
>>
>> That way we'll not run off into the woods if CPUID goes funny (never
>> trust a BIOS/virt monkey).
> Yap, especially if there are CPUID functions with subleafs with holes in
> them.
Okay. I can send a v2 with the changes.
>
Powered by blists - more mailing lists