From patchwork Tue Feb 25 12:10:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Machado X-Patchwork-Id: 183824 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp1668597ile; Tue, 25 Feb 2020 04:10:43 -0800 (PST) X-Google-Smtp-Source: APXvYqw+oVXHOhDmiNu8+RzAKUcUjugG/Ha/FHpuKTYyoNLsaZysK4tu2Oi+CCCl6VtFku1n0v+F X-Received: by 2002:aca:1c01:: with SMTP id c1mr3232688oic.18.1582632643828; Tue, 25 Feb 2020 04:10:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582632643; cv=none; d=google.com; s=arc-20160816; b=Ju9HKKbJD5B6LcCm7eXZvee/pZ43LMA9UokNDCv7BmHt7tNpnxPiFEVeUbIDG9/Amm o3kOfb6J9ytlA9xhfVd3KWrlKG9fzRrNrvTiAEDxBtcMRnSqdSvWc1EPAsODJbnKEdKP N8k/FwVo+2THN4QPdlogYYwi0cvQhTVJGO+ckOYLuiu5Jz71PhZPOGqrLLuS70H6S3zC TXCJ8w2/NFFgtM9vfZib9YB+CJELkfhL1GEUI1yMheg7056tnhxoQlTbu8T5D305wHlz B5+t+iv02Yr/zTVOO0Tkx6ObWgtLS6VNJ/FGMDY1AkdldZ1OHEAE6U0CZgggOxWkBH2t tiQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-subscribe:list-unsubscribe :list-id:precedence:mailing-list:dkim-signature:domainkey-signature; bh=iwNq+AcTJL6ZAdWRQ3/+5OFQW/aC+sIxa9+4k7Q+eKo=; b=cDtWJHkeN2IGBrqPWApFsNVfZvxsHe14Bt5bxseDWfXU/xWdCmPrQEpuicScIRO1CS TjOkKW7lBLirJP52xppaB8yOEWHCbp/qlash+k7jUBbdbOGznB/qv67o7YDGgGcZenFj i50e1odeIrQBZy8BZhOcLQfCsm+43dHMkWpRf7TBFIFfsy+9Gk15MVkLhO4tWhcpPLHH aUjvL06prv+SpEFo3EVflb5OY9109E8TaoBQIq9F/3J962ytpUJFboKQ/ohvAgfxlr66 ZzfHWjB29CH9eszFW/1a49s81yxa4tUM7FIxqGqOdTo/FOJIHWWqO9mksBIaWZlgGyDL 3I/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=sQUgTrTV; dkim=pass header.i=@linaro.org header.s=google header.b=X0SzQ9Nh; spf=pass (google.com: domain of gdb-patches-return-164642-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gdb-patches-return-164642-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b8si7995372otf.32.2020.02.25.04.10.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Feb 2020 04:10:43 -0800 (PST) Received-SPF: pass (google.com: domain of gdb-patches-return-164642-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=sQUgTrTV; dkim=pass header.i=@linaro.org header.s=google header.b=X0SzQ9Nh; spf=pass (google.com: domain of gdb-patches-return-164642-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gdb-patches-return-164642-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=GgeI8pd8Ilr443ISFYnLsc62YXBQKEzY8dkmt6igKamnqRwXG6Ar3 m3u7jfXfrBGEQNanL+ovMOKKmPnRrBIoPkRQSFFx179Xlpa1UXdlBnPpBpMrnuNI EXq9NldEsPovY1uJnaYw4tLBjpoN9pA/ValvKNm2dQO03PG2yQPFXs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=fQVyi5V9tN7ZmoBGk8rNgTK/0nk=; b=sQUgTrTVR9M1+UNtmUkwO7l+qiRw VplPpvFRl1m7DU6vuTub0Jok2EsqwErZwkqSqQVju7dco8D+mjlerFVywXdtVqP0 Lmt0rSC8CKayt5SAivT2Nkrl+vFQ9/ZRSuE4rnjn5hDP8C5m86WWsqJLRMp2w5sZ KxxTIq+pZiRZXAo= Received: (qmail 89295 invoked by alias); 25 Feb 2020 12:10:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 89287 invoked by uid 89); 25 Feb 2020 12:10:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Received:1353 X-HELO: mail-qk1-f196.google.com Received: from mail-qk1-f196.google.com (HELO mail-qk1-f196.google.com) (209.85.222.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Feb 2020 12:10:34 +0000 Received: by mail-qk1-f196.google.com with SMTP id m9so6452569qke.4 for ; Tue, 25 Feb 2020 04:10:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=iwNq+AcTJL6ZAdWRQ3/+5OFQW/aC+sIxa9+4k7Q+eKo=; b=X0SzQ9Nh3meUi63E98aNlb7z9xS5B1JIGO0f6AVC52TDnFdUieg/2Zes7hEdieYUM3 qAPSicETS7TOLI8PaMDsWE7P21iL7cR/Q9oIYoW/+6HmPJy0RnwnoCSVLKmsT3y4wvE/ h75+IFBvBgNOF3cTJewgU/ZxESfgx8Yd8TLs9TTPBm3fIfg/NACruHNz9b3SFltoNDF9 kMWhcyifKvNQv4iQByJ0iKRpQesVHI6zyFwqWRb6K+PF5QcJe7sWzgKEOZVrshOFHUrF LOY5BMQwMsqLaMAAT8No4S7vk98HTgWbaGYbfTzDGulCBjGnS/fWqZTecI2otXovGHDB 8Cjw== Return-Path: Received: from localhost.localdomain ([191.34.86.53]) by smtp.gmail.com with ESMTPSA id x14sm3932127qkf.99.2020.02.25.04.10.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 04:10:31 -0800 (PST) From: Luis Machado To: gdb-patches@sourceware.org Subject: [PATCH] Update ELF auxv entry types and update GDB to use them. Date: Tue, 25 Feb 2020 09:10:21 -0300 Message-Id: <20200225121021.30075-1-luis.machado@linaro.org> X-IsSubscribed: yes I noticed GDB didn't know a particular AT tag (51) when doing some debugging. Turns out we're missing a few entries compared to glibc's headers. This patch adds them to the ELF include file and GDB. include/ChangeLog: * elf/common.h (AT_L1I_CACHESIZE, AT_L1I_CACHEGEOMETRY, AT_L1D_CACHESIZE, AT_L1D_CACHEGEOMETRY, AT_L2_CACHESIZE, AT_L2_CACHEGEOMETRY, AT_L3_CACHESIZE, AT_L3_CACHEGEOMETRY, AT_MINSIGSTKSZ): New defines, imported from glibc. gdb/ChangeLog: * auxv.c (default_print_auxv_entry): Add new auxv entries. --- gdb/auxv.c | 12 ++++++++++++ include/elf/common.h | 15 +++++++++++++++ 2 files changed, 27 insertions(+) -- 2.17.1 diff --git a/gdb/auxv.c b/gdb/auxv.c index eb1233527e..e7432e1852 100644 --- a/gdb/auxv.c +++ b/gdb/auxv.c @@ -497,6 +497,18 @@ default_print_auxv_entry (struct gdbarch *gdbarch, struct ui_file *file, AUXV_FORMAT_HEX); TAG (AT_SUN_CAP_HW2, _("Machine-dependent CPU capability hints 2"), AUXV_FORMAT_HEX); + TAG (AT_L1I_CACHESIZE , _("L1 Instruction cache size"), AUXV_FORMAT_HEX); + TAG (AT_L1I_CACHEGEOMETRY , _("L1 Instruction cache geometry"), + AUXV_FORMAT_HEX); + TAG (AT_L1D_CACHESIZE , _("L1 Data cache size"), AUXV_FORMAT_HEX); + TAG (AT_L1D_CACHEGEOMETRY , _("L1 Data cache geometry"), + AUXV_FORMAT_HEX); + TAG (AT_L2_CACHESIZE , _("L2 cache size"), AUXV_FORMAT_HEX); + TAG (AT_L2_CACHEGEOMETRY , _("L2 cache geometry"), AUXV_FORMAT_HEX); + TAG (AT_L3_CACHESIZE , _("L3 cache size"), AUXV_FORMAT_HEX); + TAG (AT_L3_CACHEGEOMETRY , _("L3 cache geometry"), AUXV_FORMAT_HEX); + TAG (AT_MINSIGSTKSZ , _("Minimum stack size for signal delivery"), + AUXV_FORMAT_HEX); } fprint_auxv_entry (file, name, description, format, type, val); diff --git a/include/elf/common.h b/include/elf/common.h index 53b72445ca..18c898cf6b 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -1222,6 +1222,21 @@ #define AT_L2_CACHESHAPE 36 #define AT_L3_CACHESHAPE 37 +/* Shapes of the caches, with more room to describe them. + *GEOMETRY are comprised of cache line size in bytes in the bottom 16 bits + and the cache associativity in the next 16 bits. */ +#define AT_L1I_CACHESIZE 40 +#define AT_L1I_CACHEGEOMETRY 41 +#define AT_L1D_CACHESIZE 42 +#define AT_L1D_CACHEGEOMETRY 43 +#define AT_L2_CACHESIZE 44 +#define AT_L2_CACHEGEOMETRY 45 +#define AT_L3_CACHESIZE 46 +#define AT_L3_CACHEGEOMETRY 47 + +#define AT_MINSIGSTKSZ 51 /* Stack needed for signal delivery + (AArch64). */ + #define AT_FREEBSD_EXECPATH 15 /* Path to the executable. */ #define AT_FREEBSD_CANARY 16 /* Canary for SSP. */ #define AT_FREEBSD_CANARYLEN 17 /* Length of the canary. */