[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 6 Jun 2017 19:45:02 +0200
From: Borislav Petkov <bp@...en8.de>
To: 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 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.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
Powered by blists - more mailing lists