This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Adding cache shape info to powerpc
- From: Torvald Riegel <triegel at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: Benjamin Herrenschmidt <benh at kernel dot crashing dot org>, Steven Munroe <munroesj at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org, Paul Mackerras <pmac at au1 dot ibm dot com>
- Date: Wed, 17 Aug 2016 14:20:22 +0200
- Subject: Re: Adding cache shape info to powerpc
- Authentication-results: sourceware.org; auth=none
- References: <1471408952.19495.29.camel@kernel.crashing.org> <d350e721-0410-3c3a-86c2-a9f3d90b8f0d@redhat.com>
On Wed, 2016-08-17 at 10:36 +0200, Florian Weimer wrote:
> On 08/17/2016 06:42 AM, Benjamin Herrenschmidt wrote:
> > Hi !
> >
> > So there are pending requests to provide cache shape/geometry
> > information to user space via the aux vectors.
> >
> > This is done today by Alpha and SH using these:
> >
> > /* Shapes of the caches. Bits 0-3 contains associativity; bits 4-7 contains
> > log2 of line size; mask those to get cache size. */
> > #define AT_L1I_CACHESHAPE 34
> > #define AT_L1D_CACHESHAPE 35
> > #define AT_L2_CACHESHAPE 36
> > #define AT_L3_CACHESHAPE 37
> >
> > I have written some kernel code to do the same on powerpc, however I had
> > to change the format of the entries. 4 bits isn't sufficient to represent
> > modern cache associativities on some server chips.
> >
> > I've chosen this format. Is that ok with the community ? Can I still use
> > the same AT_* vector numbers or should I create new ones ?
>
> If the old format was in mainline at any point (or in a vendor kernel,
> but let's hope vendors don't do this anymore), you need to pick new numbers.
If we need new ones anyway, is there any reason for having to pack this
information? Why can't we have separate define's for the individual
properties describing the shape?