Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1658984

Re: [PATCH 2/2] amd: uncore: Get correct number of cores sharing last level cache

From Borislav Petkov <bp@alien8.de>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] amd: uncore: Get correct number of cores sharing last level cache
Date 2017-06-06 19:50 +0200
Message-ID <tPqM9-3tE-13@gated-at.bofh.it> (permalink)
References <tPjKF-7nW-13@gated-at.bofh.it> <tPjKF-7nW-15@gated-at.bofh.it> <tPjKF-7nW-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 2/2] amd: uncore: Get correct number of cores sharing  last level cache Peter Zijlstra <peterz@infradead.org> - 2017-06-06 12:20 +0200
  Re: [PATCH 2/2] amd: uncore: Get correct number of cores sharing  last level cache Borislav Petkov <bp@alien8.de> - 2017-06-06 19:50 +0200

csiph-web