From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70543 invoked by alias); 24 May 2017 19:41:02 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 70528 invoked by uid 89); 24 May 2017 19:41:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=H*MI:lan X-HELO: mx0a-001b2d01.pphosted.com From: "Tulio Magno Quites Machado Filho" To: pc@us.ibm.com, libc-alpha@sourceware.org Cc: Joseph Myers Cc: Subject: Re: [PATCH v2] powerpc: add sysconf support for cache geometries In-Reply-To: References: User-Agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.4.51.1 (x86_64-unknown-linux-gnu) Date: Wed, 24 May 2017 19:41:00 -0000 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-MML: disable x-cbid: 17052419-0032-0000-0000-00000561F2C6 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17052419-0033-0000-0000-000011E75C87 Message-Id: <87zie22gdr.fsf@totoro.lan> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-24_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705240093 X-SW-Source: 2017-05/txt/msg00735.txt.bz2 Paul Clarke writes: > There is currently no "cross-platform" (x86 and POWER) support for > determining the cacheline size. > > This patch adds support to sysconf() to correctly report cacheline sizes > based on the information in the auxilliary vector. > > Thus, using sysconf() is a cross-platform (x86 and POWER) solution for > determining cacheline sizes. > > Support is added (on powerpc) for: > _SC_LEVEL1_ICACHE_SIZE _SC_LEVEL1_ICACHE_ASSOC _SC_LEVEL1_ICACHE_LINESIZE > _SC_LEVEL1_DCACHE_SIZE _SC_LEVEL1_DCACHE_ASSOC _SC_LEVEL1_DCACHE_LINESIZE > _SC_LEVEL2_CACHE_SIZE _SC_LEVEL2_CACHE_ASSOC _SC_LEVEL2_CACHE_LINESIZE > _SC_LEVEL3_CACHE_SIZE _SC_LEVEL3_CACHE_ASSOC _SC_LEVEL3_CACHE_LINESIZE > > 2017-04-28 Paul A. Clarke > > * sysdeps/unix/sysv/linux/powerpc/sysconf.c: New file. > Add powerpc-specific overrides for L1, L2, L3 CACHE_SIZEs, > CACHE_ASSOCs, and CACHE_LINESIZEs, retrieving from auxv. > * sysdeps/unix/sysv/linux/powerpc/test-powerpc-linux-sysconf.c: > New file. Invoke newly supported sysconf values for powerpc, > and report results. If none are supported, report so. > * sysdeps/unix/sysv/linux/powerpc/Makefile (tests): Add new test, > tst-sysconf. The patch looks good except for a small issue. > diff --git a/sysdeps/unix/sysv/linux/powerpc/sysconf.c b/sysdeps/unix/sysv/linux/powerpc/sysconf.c > new file mode 100644 > index 0000000..bb89933 > --- /dev/null > +++ b/sysdeps/unix/sysv/linux/powerpc/sysconf.c > @@ -0,0 +1,96 @@ > +/* Get system-specific information at run-time. Linux/powerpc version. > + Copyright (C) 2017 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#include > +#include > +#include > + > +static long linux_sysconf (int name); > + > +static long > +auxv2sysconf (unsigned long type) > +{ > + long rc; > + rc = getauxval (type); You need to bypass the PLT. The problem is that neither getauxval() nor __getauxval() provide this for you. I'm sending a patch to treat this. -- Tulio Magno