From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id LejANUjLaGr95jEAWB0awg (envelope-from ) for ; Tue, 28 Jul 2026 11:31:20 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=iFwSNZBp; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=iFwSNZBp; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id CB56F1E099; Tue, 28 Jul 2026 11:31:20 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 063F91E099 for ; Tue, 28 Jul 2026 11:31:19 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 868914BB3B95 for ; Tue, 28 Jul 2026 15:31:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 868914BB3B95 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=iFwSNZBp; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=iFwSNZBp Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazlp170110003.outbound.protection.outlook.com [IPv6:2a01:111:f403:c200::3]) by sourceware.org (Postfix) with ESMTPS id 95F6D4BA2E18 for ; Tue, 28 Jul 2026 15:30:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 95F6D4BA2E18 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 95F6D4BA2E18 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c200::3 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1785252649; cv=pass; b=N/1kNgWJy1fvLuh3ZUpy1qA9KZ1MPmVwNJmIz5ll7oAfg7kyedp95V3FbjJNsBylOuQshqjBkUTYiVVB4ZV7roR7/W/GCgGAwJ1Hcrp5zyq3xKGCuTnEQCCvennZycx/sD41P2KGJFUIHTruk/8RvzkEQHTtSYPPLXvj/AhjNo4= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1785252649; c=relaxed/simple; bh=ZRdKcf4ShNiaL9OktUcGGd8L9pKbFdwDf3UCrBGSDSk=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=NqzZ/dJXZKK4uyvRCs6hmHwvnKVT2WxvFWrjVd4uB/q7jI6+bUIK6pAW9m1w8TzWNMekB3E3o4LwrXYhCqol0Land3+31f5UUDvfM0v3DVyPQfOwD4v81Do7IYONBZ+xXcAm0VKvgeqMM0Iv+IYYj7pk/j6lQDIltj2cDacJPQk= ARC-Authentication-Results: i=3; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=iFwSNZBp; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=iFwSNZBp DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95F6D4BA2E18 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=pOAq4LT71yU4ByDGGRpVj/W9iyhTmibs3RtUCSe2eI+8MhGDRoUsAIi/quzS0G5xqSyVVOXCQQUGT6rcPMOIZUQrCfIzTRt7Oc+0tFrZdFmCHZe8D4LszO/KJsLVs0lW9Zsyo+bNZhmiCeehcPtvNGOfMHkDjHbHek0rT5POFMdN51VfZjUJATgym4W+h4IYvM7/Y5Xg3fcI5tz5JXceASdS7zI3zUpyR65bJIcbdPTNEcd8/l/rIj8asUkwQ3fy07EzATfMAzqCqa/whUpmIJlNO6KJWPFmwvbGAnIxuQZfrPgrgGM1XSFp+skB5twxItTn2Q+XTqycyBx5xv7YUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XONHRkC67sYqRV+TJkvanHa5b47sS3CFGhENmUJfF8s=; b=PuqaEiQk3Ey3uI1iVV9gboJqIUWv3NvxcEqVUo8aVr42kxOvKcndEAsW3GvKOqwVahpxAqT/ahZzAQX7roROBVck3ucEE64IBYelKMv7OsI04d+UWdGrW6Roiem64Wp3G444IhKw4AYmQHj9cGfcboO4hBc1fcFsvAr4TM0H6xVN/fKapGu6RlhA/vazHL80OfL3IBhsAaZ8l72mSuEmQCUnl8d7mUpbKdCX3zF35DbLMXoDhGNWs2Rc4MyzUW4SNVqgnq3ke94l+HUSzqCRFInzFpKd/splmEQqFrMMtrEK/hPM5/fpOH4zRgmfh9+++TLeq9yLTY0z7aloJJmyPw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XONHRkC67sYqRV+TJkvanHa5b47sS3CFGhENmUJfF8s=; b=iFwSNZBpBRWv1osX4PBDP860gJrfCHNnnxZqgTfgGVFiVRZYz+u3LiMNe1k0ycM0rHsI6k8+c5STE0tn007zRx3dcXR8hFvvMZv2uYva4OPhpPtViK/VlaGcAVJAhELeCW0+ArXYTCyM+YKk427W/d7yMsx/pCicrL9di9NjLQQ= Received: from AS4P191CA0046.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:657::6) by AS2PR08MB8263.eurprd08.prod.outlook.com (2603:10a6:20b:552::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.12; Tue, 28 Jul 2026 15:30:36 +0000 Received: from AM4PEPF00027A63.eurprd04.prod.outlook.com (2603:10a6:20b:657:cafe::2b) by AS4P191CA0046.outlook.office365.com (2603:10a6:20b:657::6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Tue, 28 Jul 2026 15:30:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by AM4PEPF00027A63.mail.protection.outlook.com (10.167.16.73) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.5 via Frontend Transport; Tue, 28 Jul 2026 15:30:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XhHSj6iXSrnoOHd8KTyMuAiIr/iCTvZlPWaX51Sfa9UVffe+9aCfJRgDA3GHIsBPcmNwYbJHcFJrOXhHEtFM96DB8siGvtczq1JbaFEXtE+G4p0nOXClX0a6hfJyVfUwEiOBw1NYpuk5jUR5meQpco7e4uWsDLnvbpYIK1x7ghPWpC6sD0rgZQR8T2/LiKFX5xMNrevYyYbJswz0cp5+ihqAAdNA24bkpaeJbFl82BUsXH9/EgVOAS25ndgnT99Pulmi0OT4VtgtxRYVlzn42eyrahGZa2Isj7hgqt9KfmFv3ZF0ce6i/1Iawn+kokgbH07HEay75/xZcn38KkFuEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XONHRkC67sYqRV+TJkvanHa5b47sS3CFGhENmUJfF8s=; b=dEuJJ1f/l325YtxpZRa0EfPS7EYBbgRW0ss/PrDl0eINva7x5k3eC37PdtKBVaunB9Z4U2zWGsKNk4es/7sldiM4KpisZ/kvdi5Frdbk0TDlySxSdX4NazzLe+jjpOJ96HQkWAsDe57KXKwZYtjb+GmYjcrFS6LX4pLU30Qh69NqXsZhfv3DFNd98N/cecEdB+NLgKIzxt0djQqxkB41FF1pnpWI5EvTYmk2iI1nLsD2bclXVi1DdJW5l4A3XAHF9tCJLakJSWZpJPs5pHqKS9a4Jg5hHyxmG/viJDMtRn20WcBj+9tr9vEXb3qMjHToKlHniIrMvfQKTZJ1YBeWMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 172.205.89.229) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XONHRkC67sYqRV+TJkvanHa5b47sS3CFGhENmUJfF8s=; b=iFwSNZBpBRWv1osX4PBDP860gJrfCHNnnxZqgTfgGVFiVRZYz+u3LiMNe1k0ycM0rHsI6k8+c5STE0tn007zRx3dcXR8hFvvMZv2uYva4OPhpPtViK/VlaGcAVJAhELeCW0+ArXYTCyM+YKk427W/d7yMsx/pCicrL9di9NjLQQ= Received: from AM0PR02CA0113.eurprd02.prod.outlook.com (2603:10a6:20b:28c::10) by DU0PR08MB7414.eurprd08.prod.outlook.com (2603:10a6:10:352::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul 2026 15:29:31 +0000 Received: from AM3PEPF0000A79B.eurprd04.prod.outlook.com (2603:10a6:20b:28c:cafe::18) by AM0PR02CA0113.outlook.office365.com (2603:10a6:20b:28c::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Tue, 28 Jul 2026 15:29:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 172.205.89.229) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 172.205.89.229 as permitted sender) receiver=protection.outlook.com; client-ip=172.205.89.229; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (172.205.89.229) by AM3PEPF0000A79B.mail.protection.outlook.com (10.167.16.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.5 via Frontend Transport; Tue, 28 Jul 2026 15:29:31 +0000 Received: from AZ-NEU-EX03.Arm.com (10.240.25.137) by AZ-NEU-EX04.Arm.com (10.240.25.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Tue, 28 Jul 2026 15:29:29 +0000 Received: from PF4S4363.arm.com (10.57.42.206) by mail.arm.com (10.240.25.137) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Tue, 28 Jul 2026 15:29:28 +0000 From: Matthieu Longo To: CC: Luis Machado , Luis Machado , Thiago Jung Bauermann , Srinath Parvathaneni , Matthieu Longo Subject: [PATCH v1] gdb/linux-tdep: display ProtectionKey in info proc mappings Date: Tue, 28 Jul 2026 16:29:21 +0100 Message-ID: <20260728152921.256276-1-matthieu.longo@arm.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM3PEPF0000A79B:EE_|DU0PR08MB7414:EE_|AM4PEPF00027A63:EE_|AS2PR08MB8263:EE_ X-MS-Office365-Filtering-Correlation-Id: 1cebde1d-e3c2-49c2-2f13-08deecbd2bcb x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|376014|82310400026|36860700016|23010399003|1800799024|6133799003|18002099003|13003099007|56012099006|11063799006|10067099003; X-Microsoft-Antispam-Message-Info-Original: tckJWmzauDhYGPEnveSqYqpgXvgUJl1asL8wUeIU8dQmPCJR+6WFhI39ijZA3SXjn4ulqdKhIO2EwunKr3PTRiUYj41j4QEgOEPVNJrQ3M1ZzR+8Cv2WvYsuq9muH9QmBqw0JKJLqKSLC/IXAKleK/lTCflD21vjzNlZXOKY8eu7ys9acWD+7oZRugrGBfxwvcIB0CvhRVCebY6ud+Nqkp63zCfwY9b7xph+PsuMJRP6VIS5INPQQHpjz5nvJm/JTk1S1JZmHGKHfHPZMqkYr9KeSpZeYvsJsbNj5cS76FT6ysjC/OztZ5M5RPGLdBK4lluXXiS9Sb+hspGzcUhoHqurkNsK6OPlS5ZmCAMtWMs90uDWuer4QXHTutJvEZsNXi3I5RWTPJYcVYtxw1O+whtqoXiEDIq1yQx+S1SneelN6n3vquKCkOcpH/2UBAS3E/xyKyz0ts9yofVxHGuRg/oWb5WpcudwqLjljoJ0Z49HjyAgSUVLDRQBl3HwmMcqTFp1DRUxJ8FsY/OCne+GkIHXZD4ES0tqpuMcpHeesetaGxSOf7XiPPaVGWezec3oEvCN5ehFuTCC8iSXfrONE4gncT0HpFXzF0g8/PRZp2xjR6ceMbqh9OemjzvmHOmkgwZLfBs8kZL9AcxAnRFQ1A== X-Forefront-Antispam-Report-Untrusted: CIP:172.205.89.229; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(82310400026)(36860700016)(23010399003)(1800799024)(6133799003)(18002099003)(13003099007)(56012099006)(11063799006)(10067099003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: Sc03zLQB1jj481ppGZrNuqbAQ4RRk2QjZANsVqMoUg8lXNq/1ylALFBNRsQ6q2DktgQ/kP6fDZamwYALRWsFX/u0UuuqG4AImPEGgfpiT/5Vq9asKPQmhgALxLGvWFvGxdu85Uoq+J6BeL/U1CUFifKzBM2Ej5MduY+NizTezpImZL8MhrM57sw2QPAY4cUei3qBd/IQZJfVhCp/FKXw42lfcZ+LXfOQUHb2QP19ZFuHZoIROFL0FsPAalUDcx99/AT0Raqmr3AEso3NyzRMBbU0i81m9lWiIYNROlfq4N4WVuT59L+xy+AP2Pu+lBu01UNO6dTs0e9fVyf3V18J+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7414 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A63.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: cf3d0f44-eb19-4b3b-0b9d-08deecbd0545 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|35042699022|376014|1800799024|36860700016|14060799003|23010399003|18002099003|6133799003|11063799006|56012099006|10067099003; X-Microsoft-Antispam-Message-Info: CvwapFGD1PCT7W6WaVE2vkijLogECI3kCnJhwiVfMgYuvKeNkJjFhjqEEJWHdXw0gRAGLshMJPmzNBeAt10bDXpdAW4NZonCovsiYoyzsV4CAo3Y/NAMg1OcFx2UxFjlVchZ+0KOoDdLmymssElVu5Tb2tZDshLYshMD31WflQnI5UIQINWkOwOGFfivjRjI4rY45I+r/7j+jVoKrc+Jt9+4OdOci/xDLj78X9hLoYgNQjIGsi6VaWuwPgBbMsRm9ow0Aj2KmdTzwLphmFWWOdejkWCtfj7gmybYFRh+tUaPEHRcuLQoXLh2427Ve0xiuagIbzORAuubhIHpcQOjaGe/kbxyMcBTrHdwEY9nx/zKhXKfCpiDkrbnEPvfVPJCKBuijwV6L2kyj4MEoFcXpn98T8lPgqW7iylNIK7Ulib/SGOV03UTv0ln8+i1YEoHYjDmTB/z/fezbhbwRjsPE5mmehHr10LpH377G5BAz5KfB/v88E6AAWkBlzYDvTegYpvK+Xa6YSG0Q9F69W/OlyHRRFa0OxM9nFoyXSDhcjmbDhSMXTDqRxy8wYQSQItFzb3Smq1rWzJUVyJ9dKsOrJWHw/sLtlspGY5gQUvoP7uTv+L3tKTKbAIBk2vgt806mi4STsO1ARorv9Iy9qlnT/4xqcJOErJy4AWhcWH/v+A= X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(35042699022)(376014)(1800799024)(36860700016)(14060799003)(23010399003)(18002099003)(6133799003)(11063799006)(56012099006)(10067099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4l89eZWveujs0oqLIqXwFns5fEMrnKfZr4sugSMsjdPWGf5zuXOruqwSmFaBiOt7LFlSzi6+tF9qvs3ULMiB8U2GJPrdfK3hlus24vo5f/ZoTKe3//QveCo3PF8dtlgIhxqN0OwcEfDrdA+fcWFt3KJe/r3di1V9PgjyNbU1L2G6SkpuJ5Aq4TFXtamtvn1zk6tT/KGqYeJ5H5G/HVzbh/7nZtmOFbALHG4rOsHsZI9Lo1+bohk7Qe0srqePDN9p+cCkgy3cISI831Z+t9P6UzhMQeB9kaAcQwAx0mZZaif7KuHtxngoo0cQU+0wGg3YE9K1HykKMGOIKHbUELUi+u+tjR8oVXzQnldn0f14UAyD6BiH5lTSbTSp29aXeUOQMQOgFXWgrZOY6XfK4MJ92ccwGgb8I+LUqOz70n6k5MFP9MHMiAYbjrpaiKnm5ty/ X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 15:30:35.9860 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1cebde1d-e3c2-49c2-2f13-08deecbd2bcb X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00027A63.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8263 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Memory Protection Keys provide a mechanism for enforcing page-based protections without requiring modification of the page tables when an application changes protection domains. [1] The "ProtectionKey" field may be present in /proc/PID/smaps on x86_64, PowerPC, and AArch64 systems since Linux 4.9, when the kernel is built with Memory Protection Keys support. Store the parsed PKey in smaps_data as an optional value on systems where the kernel reports memory protection keys. Parse /proc/PID/smaps alongside /proc/PID/maps when printing 'info proc mappings', and add a PKey column when at least one smaps entry contains a "ProtectionKey" field. This lets 'info proc mappings' show the protection key associated with each mapped address range. [1]: https://docs.kernel.org/core-api/protection-keys.html, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/ linux.git/commit/?id=c1192f842841 --- gdb/linux-tdep.c | 93 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 78 insertions(+), 15 deletions(-) diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 2e9cb14d5bf..2cdf93f3193 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -124,6 +124,7 @@ struct smaps_data ULONGEST rss; ULONGEST swap; + std::optional pkey; }; /* Whether to take the /proc/PID/coredump_filter into account when @@ -907,6 +908,11 @@ extract_string_view_from_buffer (gdb::array_view &buffer, return {gdb::array_view (start, it), next_start}; } +/* Forward declaration of parse_smaps_data used in linux_info_proc below. */ + +static std::vector +parse_smaps_data (const file_reader_t &freader); + /* Implement the "info proc" command. */ static void @@ -1010,33 +1016,69 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, } if (mappings_f) { + /* Parse the content of /proc/PID/smaps. */ + bool pkey_column = false; + std::vector smaps_data; + file_reader_t smaps_freader + (string_printf ("/proc/%ld/smaps", ptid.lwp ())); + if (smaps_freader.error ()) + warning (_("unable to open /proc file '%s'"), + smaps_freader.c_filepath ()); + else if (smaps_freader) + { + smaps_data = parse_smaps_data (smaps_freader); + + /* Check whether "ProtectionKey" field is present. */ + pkey_column + = std::any_of (smaps_data.cbegin (), smaps_data.cend (), + [] (const struct smaps_data &d) -> bool + { return d.pkey.has_value (); }); + } + + /* Parse the content of /proc/PID/maps. */ + std::vector maps_data; file_reader_t map_freader (string_printf ("/proc/%ld/maps", ptid.lwp ())); - if (map_freader) + if (map_freader.error ()) + warning (_("unable to open /proc file '%s'"), + map_freader.c_filepath ()); + else if (map_freader) + { + auto content = map_freader.view (); + for (auto it = content.begin (); it != content.end ();) + { + auto [line, next_line_begin] + = extract_string_view_from_buffer (content, it, '\n'); + it = next_line_begin; + + /* read_mapping() expects a null-terminated string. */ + *std::prev (it) = '\0'; + maps_data.emplace_back (read_mapping (line.data ())); + } + } + + gdb_assert (maps_data.size () == smaps_data.size ()); + + if (maps_data.size () > 0) { gdb_printf (_("Mapped address spaces:\n\n")); - ui_out_emit_table emitter (current_uiout, 6, -1, "ProcMappings"); + int n_cols = (pkey_column ? 7 : 6); + ui_out_emit_table emitter (current_uiout, n_cols, -1, "ProcMappings"); int width = gdbarch_addr_bit (gdbarch) == 32 ? 10 : 18; current_uiout->table_header (width, ui_left, "start", "Start Addr"); current_uiout->table_header (width, ui_left, "end", "End Addr"); current_uiout->table_header (width, ui_left, "size", "Size"); current_uiout->table_header (width, ui_left, "offset", "Offset"); + if (pkey_column) + current_uiout->table_header (4, ui_left, "pkey", "PKey"); current_uiout->table_header (5, ui_left, "perms", "Perms"); current_uiout->table_header (0, ui_left, "objfile", "File"); current_uiout->table_body (); - auto content = map_freader.view (); - for (auto it = content.begin (); it != content.end ();) + auto it_smaps = smaps_data.cbegin (); + for (const auto &m: maps_data) { - auto [line, next_line_begin] - = extract_string_view_from_buffer (content, it, '\n'); - it = next_line_begin; - - /* read_mapping() expects a null-terminated string. */ - *std::prev (it) = '\0'; - struct mapping m = read_mapping (line.data ()); - ui_out_emit_tuple tuple_emitter (current_uiout, nullptr); current_uiout->field_core_addr ("start", gdbarch, m.addr); current_uiout->field_core_addr ("end", gdbarch, m.endaddr); @@ -1047,15 +1089,21 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, m.endaddr - m.addr)); current_uiout->field_string ("offset", paddress (gdbarch, m.offset)); + if (pkey_column) + { + if (it_smaps->pkey.has_value ()) + current_uiout->field_signed ("pkey", + it_smaps->pkey.value ()); + else + current_uiout->field_skip ("pkey"); + } current_uiout->field_string ("perms", m.permissions); current_uiout->field_string ("objfile", m.filename, file_name_style.style ()); current_uiout->text ("\n"); + ++it_smaps; } } - else - warning (_("unable to open /proc file '%s'"), - map_freader.c_filepath ()); } if (status_f) { @@ -1605,6 +1653,7 @@ parse_smaps_data (const file_reader_t &freader) int mapping_file_p; ULONGEST rss = -1; ULONGEST swap = -1; + int pkey = -1; memset (&v, 0, sizeof (v)); struct mapping m = read_mapping (line); @@ -1705,6 +1754,18 @@ parse_smaps_data (const file_reader_t &freader) mapping_anon_p = 1; } } + + if (streq (keyword, "ProtectionKey:")) + { + if (sscanf (line, "%*s%d", &pkey) != 1) + { + /* Remove the trailing column when printing the warning. */ + keyword[sizeof ("ProtectionKey:") - 2] = '\0'; + warning (_("Error parsing %s's value in {s,}maps file '%s'"), + keyword, freader.c_filepath ()); + break; + } + } } /* Save the smaps entry to the vector. */ struct smaps_data map; @@ -1724,6 +1785,8 @@ parse_smaps_data (const file_reader_t &freader) map.inode = m.inode; map.rss = rss; map.swap = swap; + if (pkey != -1) + map.pkey.emplace (pkey); smaps.emplace_back (map); } -- 2.55.0