This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 3/3] Add cache info for powerpc64
- From: Richard Henderson <rth at twiddle dot net>
- To: Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>, libc-alpha at sourceware dot org
- Cc: Benjamin Herrenschmidt <benh at kernel dot crashing dot org>, Steven Munroe <sjmunroe at us dot ibm dot com>
- Date: Fri, 9 Jun 2017 13:07:15 -0700
- Subject: Re: [PATCH 3/3] Add cache info for powerpc64
- Authentication-results: sourceware.org; auth=none
- References: <20170608225728.26779-1-rth@twiddle.net> <20170608225728.26779-4-rth@twiddle.net> <8737b9cnkg.fsf@linux.vnet.ibm.com>
On 06/09/2017 06:12 AM, Tulio Magno Quites Machado Filho wrote:
Richard Henderson <rth@twiddle.net> writes:
The actual cache info was added for 4.11, but have a guess at the
L1 linesizes using info provided by older kernels.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysconf.c: New file.
There is already a patch reviewed and approved here:
https://patchwork.sourceware.org/patch/20202/
+static long
+auxv2sysconf (unsigned long type)
+{
+ long rc;
+ rc = getauxval (type);
+ if (rc == 0)
+ {
+ __set_errno (EINVAL);
+ rc = -1;
+ }
+ return rc;
Setting EINVAL is wrong. That would imply that the _SC_* name supplied by the
caller is invalid somehow.
The return value should be 0 when the cache parameter is unknown, and -1 only
when it is known that the cache level does not exist.
You should be using __getauxval to match the hidden_proto...
But this patch is blocked because it depends on another patch that's waiting
for review:
https://patchwork.sourceware.org/patch/20582/
... defined here. But this second patch does look right.
r~