lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160708184110.GD3938@pd.tnic>
Date:	Fri, 8 Jul 2016 20:41:10 +0200
From:	Borislav Petkov <bp@...e.de>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	"Luck, Tony" <tony.luck@...el.com>,
	"Yu, Fenghua" <fenghua.yu@...el.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	"Anvin, H Peter" <h.peter.anvin@...el.com>,
	Ingo Molnar <mingo@...e.hu>,
	Stephane Eranian <eranian@...gle.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Vikas Shivappa <vikas.shivappa@...ux.intel.com>,
	"Shankar, Ravi V" <ravi.v.shankar@...el.com>,
	linux-kernel <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>
Subject: Re: [PATCH v2 2/3] Documentation, ABI: Add a document entry for
 cache id

On Fri, Jul 08, 2016 at 08:07:46PM +0200, Ingo Molnar wrote:
> Who can we ... thank for that nonsensical naming? :-/
> 
> > E.g. on most Intel cpus you'll typically find "index0" is the L1-data cache, 
> > "index1" is the L1-instruction cache, "index3" is the L2-unified cache and 
> > "index4" is the L3-unified cache.
> 
> Crazy. What was wrong with using 'level' or 'depth'?

It is all there:

$ grep . /sys/devices/system/cpu/cpu0/cache/index?/level
/sys/devices/system/cpu/cpu0/cache/index0/level:1
/sys/devices/system/cpu/cpu0/cache/index1/level:1
/sys/devices/system/cpu/cpu0/cache/index2/level:2
/sys/devices/system/cpu/cpu0/cache/index3/level:3
$ grep . /sys/devices/system/cpu/cpu0/cache/index?/type
/sys/devices/system/cpu/cpu0/cache/index0/type:Data
/sys/devices/system/cpu/cpu0/cache/index1/type:Instruction
/sys/devices/system/cpu/cpu0/cache/index2/type:Unified
/sys/devices/system/cpu/cpu0/cache/index3/type:Unified



for i in /sys/devices/system/cpu/cpu0/cache/index?;
do
	l=$(cat $i/level)
	t=$(cat $i/type)

	printf "L%d-%s\n" $l $t
done

->

L1-Data
L1-Instruction
L2-Unified
L3-Unified

I believe the index naming is simply enumerating the caches...

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ