From patchwork Mon Nov 6 14:04:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Corallo X-Patchwork-Id: 79200 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9BC37385559E for ; Mon, 6 Nov 2023 14:05:42 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2078.outbound.protection.outlook.com [40.107.8.78]) by sourceware.org (Postfix) with ESMTPS id D13E93858C2B for ; Mon, 6 Nov 2023 14:05:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D13E93858C2B 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 D13E93858C2B Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.8.78 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699279521; cv=pass; b=hhp+xwEM/3NCLmpCN39VDSb/VwXBlNKdeKiyCzMOSUlWB8l1FF60w4+02YVu5sUz/HAavIcAs07y4z2MLoLsWu8a+bGX12WX3XPEyWaruQf0A99yIiKhQBkaoDEECieFqja34T+P8Z4H+rVPvb3yGPKYDqfDnp0Wc96UC1Myf1k= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699279521; c=relaxed/simple; bh=oqTycGsd6viTdioe4MabG4aIYTtSPNgdKMZEGEOiAOQ=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=geYF/lIQV5991zcGjcGvkaSOcT3YUvMM3B9UcWqIsfM5Lj/ZFVa0r/FNjJ7QzOceeCeA8mYIxaUUC9pH3oHS9nnCymzElbh1BBkaovXbb0z7fFWKdtV4KO8AtTeY4HKA445gEVRW/rKZ4unFNP8s5FwSHMWtG68CTNuKYcpN0xA= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=AN0pwP8ZCs6BZ+0dDoqYHbj9NR7gchbTIoDgfFBplFjwwwT2H2BdPakwf2JBYFzSJVYVEEKV/8VAyd1XrOOe7gxcwN0qaprsF/WvYuWhTjqoQAG8Cc138aJUM9f29+3k4lji4QaLmvuyNiprsN0d+qrZxcUNnzsIyEI8nO6hmrJQLgGo8lIRgc+bCqRS7xI3y4H0c4ISUCfJDcJPdcNJSHlbqHehLB/WKFJcS4Bkqb66R9EntR99+B0ve74Y/w5bVTdKsFhyCBzTYMQgFmFfWuwi7dGgC6JYuEbAgBj+0aV/GC3bp+yIiwdJR7DT/+/X7Hz164eKP/96PR8nsdDl+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=S4RlMRgbDExLUAxG3T+D8UOFcIA2JR+dG67GgecCIrk=; b=JezOCkz9kqNtRxSsjcSwiYRm8aN2vbpp6E3TRj9PiQS/wujyy/MAwfS5KHymMaFJqpBUJFxSZolh7jOVhBXXlYb9o7/IhERhiodXCiptJMVjQQ7KlSdB4e6dHZBXL4diWvVAn4nB56RwTZp5VhtxLAyLt4sn7UcnTVfYpWxUnDcLMSHqG4qlBPebfxkbcgNf+T4UAi766UgsKx6fZFisE85Z/d8fGmnShRsgDkGXy0zb73hMbr1pyOZ47t261Oe6SG2aoORtnKC1iWxJL+k6kk223be79BvuScnX7riikWFcU9lDOMarDr07czWWG1XMmJIYBvTJA7/sjztD34fIKA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) 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=armh.onmicrosoft.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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S4RlMRgbDExLUAxG3T+D8UOFcIA2JR+dG67GgecCIrk=; b=EUjpDxie+TBNDsq7Whao6tgAmcA3Po81d6EYwj3NmsRUnqvpqLlNZTLDtJBpvZ/pKS6Yf0nOuQ9zgJ9YCzcERbBzJ3+0/EFJiUUZsMG6iDSXhTTT833UlMOU0101Th/vxXSlkxfEoC8IGXhgC6dNrb2994GV9owkyrwY/ut7Hdc= Received: from DB7PR05CA0065.eurprd05.prod.outlook.com (2603:10a6:10:2e::42) by PAWPR08MB9591.eurprd08.prod.outlook.com (2603:10a6:102:2ef::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Mon, 6 Nov 2023 14:05:13 +0000 Received: from DB1PEPF00039233.eurprd03.prod.outlook.com (2603:10a6:10:2e:cafe::e1) by DB7PR05CA0065.outlook.office365.com (2603:10a6:10:2e::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28 via Frontend Transport; Mon, 6 Nov 2023 14:05:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB1PEPF00039233.mail.protection.outlook.com (10.167.8.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.16 via Frontend Transport; Mon, 6 Nov 2023 14:05:13 +0000 Received: ("Tessian outbound 20615a7e7970:v228"); Mon, 06 Nov 2023 14:05:13 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 1ff27950e3735748 X-CR-MTA-TID: 64aa7808 Received: from d498ba76a4a7.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7C370740-ABD6-40E1-B165-AF9E9F7C3339.1; Mon, 06 Nov 2023 14:05:06 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d498ba76a4a7.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 06 Nov 2023 14:05:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fd7dY/jp48ut+91AYaICXZgWHnBDTiRv/YUEkPBSbidNNLrzVqXUxyY+v+aw/sFBbN1/WAaIh779M1yrzZp6YuY9EH6+kZzC/ngDyMUsaGFxhUSbVM/i+sTDS42dn4yEzhL/u6DeuisI1f5bz8wE+MpsXIoh5+glQYlfv1rnHb5vRdSm7ptBN4W2Pbaf4qn7Lpya6Qm4kJg83o4hD6if0yZl8HFga79Y1D1q1W1AID7slk+6QW23QXfJIxRuHs7bkrdU2EXGID+XwR52iigtSmwquCWuPPC1al+mfbMgMXlAq93nO+I5GVsJyCbFkkGsoqMWnRJ9HQIhybCNc5vtbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=S4RlMRgbDExLUAxG3T+D8UOFcIA2JR+dG67GgecCIrk=; b=LJqjW0KhKl4yt9V8MYXUfSh9d8qGgpcaB5LwsD7/a6KkDb2nNX/EgUE/UmA9IEgiZfIYewDKDx7BMackZlriV35sRzwAjkJRrs6MJb/gpJHor+hTEwv4m9sYde32ZtB3do0bIMsjaAbjijL8UlwqiYH8kc6RvIuAoUfU6/eKZE90mYy4QcKkazxgpOF6S7R9TPBhQB6SUZWjXu6fj9JdqVEKUeBvouMWcC6lfg8eNRm8i24zzxcWujh7AuVZkm//UzjIG8ul3p0HT2qnGaJjRaqXsWxFiDDxYMMPDquK6ypL69GGCIT00l41/l2o9eKzF/Vd5m2KnOTUsRoRQv/lLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) 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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S4RlMRgbDExLUAxG3T+D8UOFcIA2JR+dG67GgecCIrk=; b=EUjpDxie+TBNDsq7Whao6tgAmcA3Po81d6EYwj3NmsRUnqvpqLlNZTLDtJBpvZ/pKS6Yf0nOuQ9zgJ9YCzcERbBzJ3+0/EFJiUUZsMG6iDSXhTTT833UlMOU0101Th/vxXSlkxfEoC8IGXhgC6dNrb2994GV9owkyrwY/ut7Hdc= Received: from DU2PR04CA0306.eurprd04.prod.outlook.com (2603:10a6:10:2b5::11) by DU0PR08MB9774.eurprd08.prod.outlook.com (2603:10a6:10:445::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.27; Mon, 6 Nov 2023 14:05:01 +0000 Received: from DB5PEPF00014B88.eurprd02.prod.outlook.com (2603:10a6:10:2b5:cafe::73) by DU2PR04CA0306.outlook.office365.com (2603:10a6:10:2b5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.27 via Frontend Transport; Mon, 6 Nov 2023 14:05:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) 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 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DB5PEPF00014B88.mail.protection.outlook.com (10.167.8.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6977.16 via Frontend Transport; Mon, 6 Nov 2023 14:05:01 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Mon, 6 Nov 2023 14:05:00 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Mon, 6 Nov 2023 14:05:00 +0000 Received: from e124257.nice.arm.com (10.34.101.64) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Mon, 6 Nov 2023 14:04:59 +0000 From: Andrea Corallo To: CC: , , Andrea Corallo Subject: [PATCH 1/3] aarch64: Add FEAT_SPECRES2 support Date: Mon, 6 Nov 2023 15:04:53 +0100 Message-ID: <20231106140455.1694695-1-andrea.corallo@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DB5PEPF00014B88:EE_|DU0PR08MB9774:EE_|DB1PEPF00039233:EE_|PAWPR08MB9591:EE_ X-MS-Office365-Filtering-Correlation-Id: e3164c6e-9a91-41b7-f405-08dbded1656b X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: fhuvNhK6hYr6vN2aewuxrVjxa1m71D/Bti77lrTO50cCMoLrb3NoGMMfXVvGCxxw5Ieo+CrlIr+nnWXxkn65LxRqSShQRFWVg4JlUaklQfUD2Plfv9xyFCpXORZ9hq0Zy6f1aGU3VGLYJr6rUoy06XKgLAm5JQxmV6JsKVic6rXttVL6BWdOk8i8uCdwaXndwbwBJN3bj/LjPJpfLS5bPVJSrCLOVqf++jhmsSri/bKDVK/uHr2b61M8II7PoTmnA66m0z9BBjlMP8I07Wt7j2iJ7+Svu55oNyKi5YfaYhmPyHFbvfhgkSyhauJXdH/dMSIzTll76ZO46W6V3EkTe+nW/+Qe89uzgVcm0VDZEuCU8G8FeHYXwi0cYPbUzfcPU3eTUeQv/rs2H0xliLzwsNyyzPH7RtgixM2tl69qKLUMaCJ802Wi8HXhF9aSl5fAL3a+rEHS9U4xOM/WxAu6PfhZyX2uQ7ZylshS75RXbbKf9AOf0udWxfeT3cVMGRFnXAg+j/otWTT2hRuamoA0DGNOjiQ32MF0USnEnCch+EZDLcq76lVTJigndIGJdy4X4hLEV0b25udDofENqS9Q1kWurOybwMvQxRRfeZXx3LGNiBkWA7eropwSy4QWKLccE96CX8M78CjMQELdgbZ61BLEH9q7HX2xUrVo/prv+6k7Bz1HXWwwE/il+nQg2/Xd/3UwjAp58zvdx+lwewHO54fxv/m90lwKesol7WXikFr4l0pqJk/ExNv55FkRtMybAlfP6oj/wnFa7b5pQsU1mw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(376002)(396003)(136003)(346002)(39860400002)(230922051799003)(64100799003)(451199024)(186009)(82310400011)(1800799009)(40470700004)(46966006)(36840700001)(40460700003)(40480700001)(7696005)(2616005)(6666004)(478600001)(36860700001)(36756003)(82740400003)(356005)(81166007)(86362001)(41300700001)(70206006)(44832011)(5660300002)(316002)(70586007)(426003)(336012)(47076005)(83380400001)(2906002)(26005)(1076003)(8676002)(19627235002)(54906003)(8936002)(4326008)(6916009)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9774 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF00039233.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3d7d6c83-a244-4aed-74e2-08dbded15e68 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e2SMwXlC3DkggXaTjGRL5vO60bNKVN9dGxYrxmxX32f6fMSPOQqB+wsQIdGtwBOGO0eeQ+WS3fZ4V97yVJgJhKaAZPTHChCGE5Zij+QfA/2MnipUhLEkF3fENhWhuXjCHPpg1xNPnTwp1UM65jwgt0O/RLGfOIAYciy+f5LJkt8Bi3bc264PSAMOGr6zZMbwTismK2VWCWlUPL+IkZKj543InwDF1fXo+X0tgyCv/9tmzy9bZFHHzSRcyR7kb3ePnCprlWVC+58H/TH4rUCYdE9QwIDHIlRKTmKYrwo8GYGxLa6H6czJ8wnDHsWmbd/G4XIRbawqsqovHGyk01y6lmDa+wgbCUSgJp/lQ6n/VeSpclDOcnnqEcLHBmcnLT0B5tQ3b6IE43Fg+vHpuD/a+2UnnEe+yrw+Ot4i3QaH8i0tTaUvEWJ6mFhw7Wi/+3ROFEkYD41r5W2+F4sTikU3tKbIPBjbEz16wJKU9oZkQwPLMnLYtXUQ0qokDni+TFX4yFWu0fCGvDyYHRINCIKj2C3izUSvv0+Pbxd+ki04w/n9aFdIMDN5UalV4nkI4Mpid6t5V1qviubn+GtXpaIqNt0hPy1n8THcSOtdnZ2Z4jGR/nJ/6MiHZWSiN3b+N0U7qSTzfeeO4bkpdxCCqOyfhaj+18FpkqzTV7hd0EFLMjRaIh/EAJXXdr+mQfAsge3HXI4qsvgmviMcxbjEF/0ZwfTIcN4n9gcTCxefZkgeg8JUYDiVQEhoaAGrZK2UgQOH X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(376002)(136003)(346002)(396003)(230922051799003)(64100799003)(451199024)(186009)(82310400011)(1800799009)(40470700004)(46966006)(36840700001)(40480700001)(40460700003)(7696005)(2616005)(478600001)(6666004)(44832011)(36860700001)(36756003)(82740400003)(81166007)(86362001)(5660300002)(70206006)(41300700001)(316002)(70586007)(47076005)(426003)(336012)(2906002)(83380400001)(26005)(1076003)(8676002)(8936002)(4326008)(19627235002)(6916009)(54906003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2023 14:05:13.4161 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3164c6e-9a91-41b7-f405-08dbded1656b X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF00039233.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9591 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+patchwork=sourceware.org@sourceware.org This patch add supports for FEAT_SPECRES2 "Enhanced speculation restriction instructions" adding the "cosp" instruction. This is mandatory v8.9-a/v9.4-a and optional v8.0-a+/v9.0-a+. It is enabled by the +predres2 march flag. --- gas/config/tc-aarch64.c | 1 + gas/doc/c-aarch64.texi | 2 ++ gas/testsuite/gas/aarch64/illegal-predres2-1.d | 3 +++ gas/testsuite/gas/aarch64/illegal-predres2-1.l | 5 +++++ gas/testsuite/gas/aarch64/predres2.d | 10 ++++++++++ gas/testsuite/gas/aarch64/predres2.s | 4 ++++ include/opcode/aarch64.h | 5 ++++- opcodes/aarch64-tbl.h | 7 +++++++ 8 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 gas/testsuite/gas/aarch64/illegal-predres2-1.d create mode 100644 gas/testsuite/gas/aarch64/illegal-predres2-1.l create mode 100644 gas/testsuite/gas/aarch64/predres2.d create mode 100644 gas/testsuite/gas/aarch64/predres2.s diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 25271e0f12e..827e0436136 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -10268,6 +10268,7 @@ static const struct aarch64_option_cpu_value_table aarch64_features[] = { {"sha2", AARCH64_FEATURE (SHA2), AARCH64_FEATURE (FP)}, {"sb", AARCH64_FEATURE (SB), AARCH64_NO_FEATURES}, {"predres", AARCH64_FEATURE (PREDRES), AARCH64_NO_FEATURES}, + {"predres2", AARCH64_FEATURE (PREDRES2), AARCH64_FEATURE (PREDRES)}, {"aes", AARCH64_FEATURE (AES), AARCH64_FEATURE (SIMD)}, {"sm4", AARCH64_FEATURE (SM4), AARCH64_FEATURE (SIMD)}, {"sha3", AARCH64_FEATURE (SHA3), AARCH64_FEATURE (SHA2)}, diff --git a/gas/doc/c-aarch64.texi b/gas/doc/c-aarch64.texi index d19bc3b0030..0624c4f0bb8 100644 --- a/gas/doc/c-aarch64.texi +++ b/gas/doc/c-aarch64.texi @@ -265,6 +265,8 @@ automatically cause those extensions to be disabled. @tab Enable Guarded Control Stack Extension. @item @code{rasv2} @tab ARMv8.8-A @tab ARMv9.3-A or later @tab Enable the Reliability, Availability and Serviceability extension v2. +@item @code{predres2} @tab ARMv8-A/Armv9-A @tab ARMv8.9-A/Armv9.4-A or later + @tab Enable Prediction instructions. @end multitable @node AArch64 Syntax diff --git a/gas/testsuite/gas/aarch64/illegal-predres2-1.d b/gas/testsuite/gas/aarch64/illegal-predres2-1.d new file mode 100644 index 00000000000..f858afd34c9 --- /dev/null +++ b/gas/testsuite/gas/aarch64/illegal-predres2-1.d @@ -0,0 +1,3 @@ +#as: -march=armv8-a +#source: predres2.s +#error_output: illegal-predres2-1.l \ No newline at end of file diff --git a/gas/testsuite/gas/aarch64/illegal-predres2-1.l b/gas/testsuite/gas/aarch64/illegal-predres2-1.l new file mode 100644 index 00000000000..15f568030be --- /dev/null +++ b/gas/testsuite/gas/aarch64/illegal-predres2-1.l @@ -0,0 +1,5 @@ +[^:]*: Assembler messages: +[^:]*:[0-9]+: Error: selected processor does not support system register name 'rctx' +[^:]*:[0-9]+: Error: selected processor does not support `cosp rctx,x1' +[^:]*:[0-9]+: Error: selected processor does not support system register name 'rctx' +[^:]*:[0-9]+: Error: selected processor does not support `cfp rctx,x1' diff --git a/gas/testsuite/gas/aarch64/predres2.d b/gas/testsuite/gas/aarch64/predres2.d new file mode 100644 index 00000000000..cc5ea087f26 --- /dev/null +++ b/gas/testsuite/gas/aarch64/predres2.d @@ -0,0 +1,10 @@ +#as: -march=armv8-a+predres2 +#objdump: -dr + +.*: file format .* + +Disassembly of section \.text: + +0+ <.*>: +.*: d50b73c1 cosp rctx, x1 +.*: d50b7381 cfp rctx, x1 \ No newline at end of file diff --git a/gas/testsuite/gas/aarch64/predres2.s b/gas/testsuite/gas/aarch64/predres2.s new file mode 100644 index 00000000000..3f6f88cace3 --- /dev/null +++ b/gas/testsuite/gas/aarch64/predres2.s @@ -0,0 +1,4 @@ +/* File to test the +predres2 option. */ +func: + cosp rctx, x1 + cfp rctx, x1 diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h index bb180d30ef9..ae6457597e5 100644 --- a/include/opcode/aarch64.h +++ b/include/opcode/aarch64.h @@ -171,6 +171,8 @@ enum aarch64_feature_bit { AARCH64_FEATURE_SME2, /* ARMv8.9-A RAS Extensions. */ AARCH64_FEATURE_RASv2, + /* Speculation Prediction Restriction instructions. */ + AARCH64_FEATURE_PREDRES2, DUMMY1, DUMMY2, DUMMY3, @@ -241,7 +243,8 @@ enum aarch64_feature_bit { #define AARCH64_ARCH_V9_1A_FEATURES(X) AARCH64_ARCH_V8_6A_FEATURES (X) #define AARCH64_ARCH_V9_2A_FEATURES(X) AARCH64_ARCH_V8_7A_FEATURES (X) #define AARCH64_ARCH_V9_3A_FEATURES(X) AARCH64_ARCH_V8_8A_FEATURES (X) -#define AARCH64_ARCH_V9_4A_FEATURES(X) AARCH64_ARCH_V8_9A_FEATURES (X) +#define AARCH64_ARCH_V9_4A_FEATURES(X) (AARCH64_ARCH_V8_9A_FEATURES (X) \ + | AARCH64_FEATBIT (X, PREDRES2)) /* Architectures are the sum of the base and extensions. */ #define AARCH64_ARCH_V8A(X) (AARCH64_FEATBIT (X, V8) \ diff --git a/opcodes/aarch64-tbl.h b/opcodes/aarch64-tbl.h index 850f4c2d2af..e07836cd668 100644 --- a/opcodes/aarch64-tbl.h +++ b/opcodes/aarch64-tbl.h @@ -2516,6 +2516,8 @@ static const aarch64_feature_set aarch64_feature_sb = AARCH64_FEATURE (SB); static const aarch64_feature_set aarch64_feature_predres = AARCH64_FEATURE (PREDRES); +static const aarch64_feature_set aarch64_feature_predres2 = + AARCH64_FEATURES (2, PREDRES, PREDRES2); static const aarch64_feature_set aarch64_feature_memtag = AARCH64_FEATURE (MEMTAG); static const aarch64_feature_set aarch64_feature_bfloat16 = @@ -2609,6 +2611,7 @@ static const aarch64_feature_set aarch64_feature_rasv2 = #define FRINTTS &aarch64_feature_frintts #define SB &aarch64_feature_sb #define PREDRES &aarch64_feature_predres +#define PREDRES2 &aarch64_feature_predres2 #define MEMTAG &aarch64_feature_memtag #define TME &aarch64_feature_tme #define SVE2 &aarch64_feature_sve2 @@ -2842,6 +2845,9 @@ static const aarch64_feature_set aarch64_feature_rasv2 = MOPS_SET_OP1_OP2_INSN (NAME, "n", OPCODE | 0x2000, MASK, ISA), \ MOPS_SET_OP1_OP2_INSN (NAME, "tn", OPCODE | 0x3000, MASK, ISA) +#define PREDRES2_INSN(NAME,OPCODE,MASK,CLASS,OPS,QUALS,FLAGS) \ + { NAME, OPCODE, MASK, CLASS, 0, PREDRES2, OPS, QUALS, FLAGS, 0, 0, NULL } + const struct aarch64_opcode aarch64_opcode_table[] = { /* Add/subtract (with carry). */ @@ -4173,6 +4179,7 @@ const struct aarch64_opcode aarch64_opcode_table[] = PREDRES_INSN ("cfp", 0xd50b7380, 0xffffffe0, ic_system, OP2 (SYSREG_SR, Rt), QL_SRC_X, F_ALIAS), PREDRES_INSN ("dvp", 0xd50b73a0, 0xffffffe0, ic_system, OP2 (SYSREG_SR, Rt), QL_SRC_X, F_ALIAS), PREDRES_INSN ("cpp", 0xd50b73e0, 0xffffffe0, ic_system, OP2 (SYSREG_SR, Rt), QL_SRC_X, F_ALIAS), + PREDRES2_INSN ("cosp", 0xd50b73c0, 0xffffffe0, ic_system, OP2 (SYSREG_SR, Rt), QL_SRC_X, F_ALIAS), /* Armv8.4-a flag setting instruction, However this encoding has an encoding clash with the msr below it. Usually we can resolve this by setting an alias condition on the flags, however that depends on the disassembly masks to be able to quickly find the alias. The problem is the From patchwork Mon Nov 6 14:04:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Corallo X-Patchwork-Id: 79198 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 907153857030 for ; Mon, 6 Nov 2023 14:05:33 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2059.outbound.protection.outlook.com [40.107.21.59]) by sourceware.org (Postfix) with ESMTPS id 5D03B3858C20 for ; Mon, 6 Nov 2023 14:05:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5D03B3858C20 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 5D03B3858C20 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.21.59 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699279517; cv=pass; b=n2S/hFjzlX6KWGV/WvUoZstHu2Yg1o9pDtCuMV2UUF/6iQKj+Kk8ukmyMx/T9xV2c9bXPRfOSI36MulC2rq/sNGgFhquZy0sIGc4pI/SFhxAvAfqsKlcCm87WfWBOcyZLOGcyaHeAu+algaZWvjeFg/sJH//r7h4ZfiXqzOoVpY= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699279517; c=relaxed/simple; bh=pxlzIZVBXdyFII1DF5LMN3TzxUKIjYJcNsl794dFiPE=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=it4g90TImmTahKfquDDJtJhqquL2eyfzAVPuP2ZU+AH1V4gvrmXwnAYGZyNHIV6JexSk2IipS6TLb6pHWGjqeHr7UhGXEGLr96VmmD3qM2LLjUf/dExgFVcE5+JzPR8Fmu7/Zm/CAf1A8bAakxFFueGCr0ggrWNsi0BfQsyc6fA= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=R0E9wcqsejlbB3XqyoCWmuu2EXEXFCMBKcbRJTFuqjmtfRlibYKAngiG/0m00OarKUkKbJArzbIgmrcGwf0y4GYGKUQS5Rx5/prAIj/pp79aQgr5qZEMA8uT1hUYMq0tsFIx2RzM3ovK1bxVn7AZAmax/q62eCFREoZtTYZlXeGIdWWE9b3Z6fYmfK6ZFS+CSng47HYWuC2tNqjinCG0GAH0vGUIdFZpwONwvJwP71SRej1SFMVuYFfN1jkB8v5inZMdgTLXrXMdxGZge89l8pGMNbzIJcpIG2QSUjqBAeuVvcGsSuTrIpA7RmTQqnaMmZPfRMZZecq1zJGUhhAwFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=+By0wipjnK93IxOr1vbeZ7tX0UMSQiYuxFM4BhPQAFM=; b=mh3fLvhgevrvOXjkWzRV1GEjqxKOrC8T5cQ4WSVn2vgUTQSmJ5EFCLHbHVqCf6yOfI8qE6xTmSq7xvpns1gzjUEACu+zo9pZpRoejowxwA4o5W6eXenwrWN3u9+vmFe2fYkb0cMYfx++bzaS0gL0Qme+VbsCoTpHsDG43Jaoh2CJ99gKfGMsXG65bkj3Y6jq0d1AKdC7kWibQeZzH1ljt2JRHczVm+KAibmbaHtctAQvFIPIgI6UYYPce/ax1Vo/0iOUjq5CinYGOUFSNmu5lZm07O9AWuR67i0DTQZ/9phjK8D5Ydo71ZR2MB1UcFAWBNUJU0yG8Ndpk9DWtHN6yw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) 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=armh.onmicrosoft.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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+By0wipjnK93IxOr1vbeZ7tX0UMSQiYuxFM4BhPQAFM=; b=UJw1PHEy23/gK9i/fq/NmyHZP45iLnPoHWZh9F/wLzAZK+wyuruZzj3qK8ty6Usc8J5lIdnAgpZ9G00XjIDxG4Wv/5u690zCjCjPtjyO4CGBuF1tDVpst6AoPOiC57ILFvBsg+LZYmC6ywp0UnV53/Rz8wV+kfyf2PLG7YJqBW8= Received: from AM5PR0601CA0062.eurprd06.prod.outlook.com (2603:10a6:206::27) by AS2PR08MB8285.eurprd08.prod.outlook.com (2603:10a6:20b:554::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Mon, 6 Nov 2023 14:05:13 +0000 Received: from AM2PEPF0001C714.eurprd05.prod.outlook.com (2603:10a6:206:0:cafe::5b) by AM5PR0601CA0062.outlook.office365.com (2603:10a6:206::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28 via Frontend Transport; Mon, 6 Nov 2023 14:05:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM2PEPF0001C714.mail.protection.outlook.com (10.167.16.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.17 via Frontend Transport; Mon, 6 Nov 2023 14:05:11 +0000 Received: ("Tessian outbound 385ad2f98d71:v228"); Mon, 06 Nov 2023 14:05:11 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4d46dc29b7090025 X-CR-MTA-TID: 64aa7808 Received: from 452ecbb8c89f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BBE71FBA-C7FC-4A11-A132-0C58E0D993F4.1; Mon, 06 Nov 2023 14:05:04 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 452ecbb8c89f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 06 Nov 2023 14:05:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nplh+AXoyRWLzJ2EWHn1EraW+vKTgNzqsb0YxQxEUSEFfEdCK3ACwT89yIm1RnPtIF+BSp57guK1SO7C7knf9MElKU0nXCL5QdYZ9mDV3saJZL0hFnkM4FZgKTHN1QLln8I/0T2GvC8qXh0s9PhGEVa1l5rnIvHSF25UYtFVqexfGy3FVt3CNYuPRR131rPA4nOiOmoaCr1l4kVedc31AIlNorbV624tghQp63HTGEti0lIbqGCCXwkIXP+qt8FtMGneBbz1yOYFSyR3lvhCRUszZ3xnxqlFp1bNNsFFrfnKoQjz//jvtIvJxmUcULAlplmQNpJo9dSLbu0XmIMZQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=+By0wipjnK93IxOr1vbeZ7tX0UMSQiYuxFM4BhPQAFM=; b=PaLMUQTKWJ/OXJx+6PWbij9K8YLZe9+g8ShgK7EIQHhjXPmCRQ/drZcBHppgWN3+T6YxUPD5gT/IcZsc64/Pmr25x7xEOxD4HCPnyufrlT6HXFqdp6VQTT4GwKXg6gbfqWsNAhk20Kv+m/m0m3xmXJeCE0j1iNHoszJi8P3MyQLHvs/zuFE2hl2MVyqq5m7Y8fmAYvQwz5wzBIPfbzMZrs06DjzbEgs61HDcEKFPMRx7lKgEbHznI+U8EQGKgNIRgwZ25otm8/ku7moJ5POKrS99rJEkrKGXjXmsIr958jm4IKfhZ6mX90nG9ZsXsFQT55f23wDLC/lD4QqKQ5PiGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) 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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+By0wipjnK93IxOr1vbeZ7tX0UMSQiYuxFM4BhPQAFM=; b=UJw1PHEy23/gK9i/fq/NmyHZP45iLnPoHWZh9F/wLzAZK+wyuruZzj3qK8ty6Usc8J5lIdnAgpZ9G00XjIDxG4Wv/5u690zCjCjPtjyO4CGBuF1tDVpst6AoPOiC57ILFvBsg+LZYmC6ywp0UnV53/Rz8wV+kfyf2PLG7YJqBW8= Received: from AM5PR0101CA0015.eurprd01.prod.exchangelabs.com (2603:10a6:206:16::28) by AS2PR08MB9787.eurprd08.prod.outlook.com (2603:10a6:20b:604::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Mon, 6 Nov 2023 14:05:03 +0000 Received: from AMS0EPF0000019B.eurprd05.prod.outlook.com (2603:10a6:206:16:cafe::ac) by AM5PR0101CA0015.outlook.office365.com (2603:10a6:206:16::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28 via Frontend Transport; Mon, 6 Nov 2023 14:05:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) 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 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AMS0EPF0000019B.mail.protection.outlook.com (10.167.16.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6977.16 via Frontend Transport; Mon, 6 Nov 2023 14:05:02 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Mon, 6 Nov 2023 14:05:00 +0000 Received: from e124257.nice.arm.com (10.34.101.64) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Mon, 6 Nov 2023 14:05:00 +0000 From: Andrea Corallo To: CC: , , Andrea Corallo Subject: [PATCH 2/3] aarch64: Add FEAT_ECBHB support Date: Mon, 6 Nov 2023 15:04:54 +0100 Message-ID: <20231106140455.1694695-2-andrea.corallo@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231106140455.1694695-1-andrea.corallo@arm.com> References: <20231106140455.1694695-1-andrea.corallo@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF0000019B:EE_|AS2PR08MB9787:EE_|AM2PEPF0001C714:EE_|AS2PR08MB8285:EE_ X-MS-Office365-Filtering-Correlation-Id: 150740b8-254d-48c3-a1bf-08dbded16437 X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: wGa5FgVzSVKkFhaJSB2ecEoGYMRbPViMHMd2tURVujL1agJeZXjZ1Yljv7kYXiYKQiqL5JqOCPJVKdsWmKSDtO9ALoeCvMr1vXf1gun1LfxSSspvIndrpu4XIpAoRFDAdVtx0gZwDNfs9YD4EANdM3gBSjEWRGWOOdLRtGiv6V+7l7cZ1mNt7xB9c9r9i9S7i2zyM/A0osNxHmAB8B7bI1qwEARnqul3TXb8gqy7XF6zWDDeYu0Dyy+KFnbxOgsG0m8FUixUGikgzjFLGJXFTVy9o9YXoahWU5AR5XgWyFKT4wX28EDqYNyjNwozLk79bdbfLFLAY4vB4OFQjNwZOyTW2kYYev76tKfnhacsgtnIWp2KQJi/b8KjdJkOj7zQk87R7ytoT81kWoFJ3rkHfvo2Elz9HFdJ8VZjDhHYsqGTs7phvDRGxxyBrK6ozwNg7tufJ6oypksCHYfmU94Q8463I06fg5dnCVSR2sDP0wizixLKekMAI6wHIEtVBKE/vXZHTiKjGTGdkvt1wiHnlRiXCo6yTj2Qs6VPINwhymGwlx9ezJdPv/STqH1lwVsp9YelvgbCbZxrsWWIpckEpINGNV6b7eVR9jxVFKLr7Qdz+C0nr5Qm6wVkETVx+mtlI1gFSZwKRlzOdG3ivrQrntDQEp2H+qU0IlL+ahzwUPRvLZDXKdHF8G/cDvr8F2aYRrY4AG4qI5SmjqhmYm+7WfHWWp3zhsN3iGveYpdFBk9R5BpsgiwBmIw/MMGiBz2ZeUXsib/S2I51qQfOTFePeg== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(136003)(346002)(396003)(376002)(39860400002)(230922051799003)(64100799003)(186009)(451199024)(82310400011)(1800799009)(40470700004)(46966006)(36840700001)(2616005)(336012)(1076003)(83380400001)(426003)(26005)(478600001)(356005)(82740400003)(81166007)(86362001)(40480700001)(40460700003)(47076005)(36860700001)(6666004)(41300700001)(8936002)(8676002)(5660300002)(316002)(44832011)(36756003)(6916009)(54906003)(70586007)(70206006)(2906002)(4326008)(7696005)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9787 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM2PEPF0001C714.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: aa4dd65f-ad4c-41ac-0e35-08dbded15efa X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mJUam1tmrM4m07xmsiIBemAfypsgDoRQvXI+lwNxwA0IysPC5NojKGrF6sUkPQJrb7bZ/O9GqKJfsXr0ZvhYwdgfMURe60orPimx7u1aKS/EgSfGutOSQo+Mk1YvDX2uj/KyXIqrVPOpzmswUdSN7RQq/4l9yw8emPr4iWTqpN3W/dRpi/HPmcEr+7maLQwcMhtIDosWmNYOtZWvGpxIHjU9n4AjxjJfriqG4mO5qs10NdGDEan4ECakhQ4sz6zbekjCaVeL1wrLuuHVZVKai0USHqBFIWfz5EDU0xt+eJCMpaz50Yb7nFVa5vrKE6HbSMtx193/P8IQFgajagqot38/q8FqVUVoqYOYtQO6Q0Uwx6OYNcFLj9UaIhRQLMfRISxCwyL1R7K9NQwN/jCxVB/miia/b6q4wh1NfSzOUbfjz4Udt3a/5w8KRQPGOe1+axem4fyHqZOpKj1POj9xyE+Lg2dMrhu13ZeEuuWhPS2jbZ8qFL1u6SuCa0urR3HAYs49QelFYNi2WhrEP7OhKZ8TNIuGyNq9iKh+/A40jqRn4elzNMrITJPGmlRx7N8x8894wLmVyjqccGKpfTETFFYGHj4dtvPWnd52wFcSt3AUJR+35u46c4zbQ1c1532Lf7r2g1nRJnnR9uszpP5n4zm21nJOfdiI9rJbntOBoQjYWo0CtVx4MKCJwd0PDnu+2FtQx5iqAVcW54PrfC7VH2lCvNF18+DjIw7DaEyY028QOGGgtm9Y3WMLrPPOrd6M X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(136003)(376002)(39860400002)(346002)(396003)(230922051799003)(186009)(451199024)(82310400011)(64100799003)(1800799009)(36840700001)(46966006)(40470700004)(7696005)(44832011)(86362001)(8676002)(8936002)(478600001)(4326008)(6666004)(1076003)(5660300002)(36756003)(6916009)(54906003)(316002)(70206006)(70586007)(2616005)(40480700001)(2906002)(26005)(426003)(336012)(40460700003)(83380400001)(47076005)(36860700001)(41300700001)(82740400003)(81166007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2023 14:05:11.3487 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 150740b8-254d-48c3-a1bf-08dbded16437 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C714.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8285 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+patchwork=sourceware.org@sourceware.org This patch add support for FEAT_ECBHB "Exploitative control using branch history information" adding the "clrbhb" instruction. AFAIU the same alias was originally added as "clearbhb" before the architecture was finalized (Mandatory v8.9-a/v9.4-a; Optional v8.0-a+/v9.0-a+). --- gas/testsuite/gas/aarch64/clrbhb-1.d | 9 +++++++++ gas/testsuite/gas/aarch64/clrbhb-1.s | 2 ++ gas/testsuite/gas/aarch64/system.d | 4 ++-- opcodes/aarch64-tbl.h | 4 ++++ 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 gas/testsuite/gas/aarch64/clrbhb-1.d create mode 100644 gas/testsuite/gas/aarch64/clrbhb-1.s diff --git a/gas/testsuite/gas/aarch64/clrbhb-1.d b/gas/testsuite/gas/aarch64/clrbhb-1.d new file mode 100644 index 00000000000..272ee23dfda --- /dev/null +++ b/gas/testsuite/gas/aarch64/clrbhb-1.d @@ -0,0 +1,9 @@ +#objdump: -dr + +.*: file format .* + +Disassembly of section \.text: + +0+ <.*>: + 0: d50322df clrbhb + diff --git a/gas/testsuite/gas/aarch64/clrbhb-1.s b/gas/testsuite/gas/aarch64/clrbhb-1.s new file mode 100644 index 00000000000..edf88466e4c --- /dev/null +++ b/gas/testsuite/gas/aarch64/clrbhb-1.s @@ -0,0 +1,2 @@ + clrbhb + diff --git a/gas/testsuite/gas/aarch64/system.d b/gas/testsuite/gas/aarch64/system.d index bb1a94cb020..a1114169d55 100644 --- a/gas/testsuite/gas/aarch64/system.d +++ b/gas/testsuite/gas/aarch64/system.d @@ -14,7 +14,7 @@ Disassembly of section \.text: .*: d503207f wfi .*: d503209f sev .*: d50320bf sevl -.*: d50322df clearbhb +.*: d50322df clrbhb .*: d503201f nop .*: d503203f yield .*: d503205f wfe @@ -37,7 +37,7 @@ Disassembly of section \.text: .*: d503227f (hint #0x13|gcsb dsync) .*: d503229f (hint #0x14|csdb) .*: d50322bf hint #0x15 -.*: d50322df (hint #0x16|clearbhb) +.*: d50322df (hint #0x16|clrbhb) .*: d50322ff hint #0x17 .*: d503231f (hint #0x18|paciaz) .*: d503233f (hint #0x19|paciasp) diff --git a/opcodes/aarch64-tbl.h b/opcodes/aarch64-tbl.h index e07836cd668..b64d94ab70f 100644 --- a/opcodes/aarch64-tbl.h +++ b/opcodes/aarch64-tbl.h @@ -6101,6 +6101,10 @@ const struct aarch64_opcode aarch64_opcode_table[] = CSSC_INSN ("smin", 0x1ac06800, 0x7fe0fc00, OP3 (Rd, Rn, Rm), QL_I3SAMER, F_SF), CSSC_INSN ("umin", 0x1ac06c00, 0x7fe0fc00, OP3 (Rd, Rn, Rm), QL_I3SAMER, F_SF), + /* FEAT_CLRBHB part of the hint space and available without special + command-line flags. */ + CORE_INSN ("clrbhb", 0xd50322df, 0xffffffff, ic_system, 0, OP0 (), {}, F_ALIAS), + {0, 0, 0, 0, 0, 0, {}, {}, 0, 0, 0, NULL}, }; From patchwork Mon Nov 6 14:04:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Corallo X-Patchwork-Id: 79201 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 66A26385B513 for ; Mon, 6 Nov 2023 14:06:25 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2080.outbound.protection.outlook.com [40.107.15.80]) by sourceware.org (Postfix) with ESMTPS id 936853857341 for ; Mon, 6 Nov 2023 14:05:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 936853857341 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 936853857341 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.15.80 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699279533; cv=pass; b=Ib9fm6k36te1inw9FjgcyvppAhgM2FMXDLRUE3vsFVb6wDqTsx90BJZ1koaHlpHTO3ZpY6T80VGEODdqN09MS85CixtWb0B5v6qmNxV123svpHTGrb7ugXsEW8LS3jWPfbJjdJ/UE4IIbBEBNh23xsN5LbGfJ7T7ZIS/IBECDRc= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699279533; c=relaxed/simple; bh=Wz1unxDyi73xDEvcQRkBBy2zGdU8R0oZoXDDnH8mH4A=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=bn+JeTrWaduQKemC4UauAQfHtexeOTWgt/eGB64j6Dm48ZrH7WQrzxCqBa76MVa7O/SrrB8wo/YJL9Gc4nRwN58V1c7Gvr9X/4Axlh8QT1f3X7LovU/s/knc4sU8zx2lxizHiIqdQzmw5lN+XCMPFgFkee1P24vzWPCIx+w6IKU= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=K8dusQLI+RRTcprrc28JGJ3qOPY0DD0eTHkJn6k0QHhCtorRaxw5fiKcqHWoYRR4td1tYmCVo2iUbTuBVn5J/kOIky5zg8QYrxkx+QHwZioD+oVfBxDc3UYUnJCDziTFeyf4hXMEhUaqlZgqLcDLcGF3j5IhLpz/21I5+PoFx+REvVHjwNik/EcAzhkmD21zyvV81HHb55Z7pMPauruE0OKE9aT3iLpVCbAW62XNuVH18/F07jDtWmw5dApDFXOzwKS854ISC/htV/n8bRMzg3HDiBO9fns5jR9+ZlsLDB5DdeBV3u0Df3eEFKUi+iImkkQOROBRDhMBqn/WTzacmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=iLhJ9CB6VljX89kBYUjaOCaZwMkvhCUDAHow/qFxC7w=; b=I2S+M8l8P1yJWEenc8FDGkoMeDncEOfpJyTOBFsSu7UaffUSspyWmYCYh4UDw9M+g8vG7yMiqR2PicLyq5w55zn9s0t9S/nlojNxcfC4xCPNkOdVZ7dBaJ8M+kroCfnfjHlxxiZP/LLOv86TSUvgfx22AXrJOLGEGFn362+Ebl9LnECUeCuxj1Z1xF9RPsasmiZWwJ+xHEHOqc/nlMfYm3dUBjjwMYvKiux37DqPV5oTMVj/yrkWVAPRW+jrFchJi/AVXhXUGRbMEOzBGzdIspXA/fVYHwT3YyPPFdHBjEHWQgoUjE2G/00h7bVKRSmo/71qbGaUuPcRg20ngtSpkQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) 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=armh.onmicrosoft.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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iLhJ9CB6VljX89kBYUjaOCaZwMkvhCUDAHow/qFxC7w=; b=4Vuu82wkO3PSafAMPsNXah0+iW5tGr2jiZGdWXifPKhqcGN9vRuNiDKRCmj+m7a5DLGH1ai2wTb3sqV0ceda2ypSiIH15asClyyHmmqJodPh0Tg6AR+NYXczioNb0mDlzO12fiYT/YtaHt2Z1bt+5puYjdar0S46TMhwFXNPO88= Received: from AM4PR07CA0024.eurprd07.prod.outlook.com (2603:10a6:205:1::37) by VI0PR08MB10617.eurprd08.prod.outlook.com (2603:10a6:800:20e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.27; Mon, 6 Nov 2023 14:05:19 +0000 Received: from AM4PEPF00027A6B.eurprd04.prod.outlook.com (2603:10a6:205:1:cafe::d0) by AM4PR07CA0024.outlook.office365.com (2603:10a6:205:1::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.15 via Frontend Transport; Mon, 6 Nov 2023 14:05:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM4PEPF00027A6B.mail.protection.outlook.com (10.167.16.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.16 via Frontend Transport; Mon, 6 Nov 2023 14:05:19 +0000 Received: ("Tessian outbound 5d213238733f:v228"); Mon, 06 Nov 2023 14:05:19 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7c36859999b3626d X-CR-MTA-TID: 64aa7808 Received: from 6edcc7598dcb.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C321811B-E09E-4EE4-B0A1-9CCD9E6FB456.1; Mon, 06 Nov 2023 14:05:11 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 6edcc7598dcb.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 06 Nov 2023 14:05:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MU2cXMF7nUUOw4G9+u78AETSod9zMBVzqhtlzVPRDF+Koz0Ynw0cx0/uu+lRB8NXo+7jLHJ6DRVcC88W0TDy2jlDTiKNoiwVVwcuSXH2V/ruTbGkAXNzAcTEMQ6KpuFa48OCzcJ7iJOGT+WP1S3N/gTkOxMI/K01xN5j7/lCyOQaAMqyP2Dv1sAu/aRFQKjdCFWPtdbcYB5EfC3K1kIkzTiwb7LWksNwqvfK7N/+S4xK/IJQeodrosWFxIN93eT57pQUnTQy49hT0ZzJrOAimZ1vKW/QdZ9T4jmXEz2z9JUwy+qU9goIg5xSrN6XZI/Dicy0GGPGRo2h5LY4JLAj6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=iLhJ9CB6VljX89kBYUjaOCaZwMkvhCUDAHow/qFxC7w=; b=h8SiWTB0wJDE4+GUndVrJ6HfvZFt7cdYJFbOTav5HAz3CsLDxZjFEq31cxA/svcb41s/SYJabEdIGiX/Eezs3YbTTvKbIUtEqUGIBBqDVFDldHxsawIgggKnobaWAVZ7LIPuAO+gQEPlf2QO+Y8ElFsSDWuWddMimbmjxlTYLzQ8d6NiS1vBnK8se1YnM4/Mc9tIW8Nskyg8/hbgJkPfVgavDLsUlJRGGdWy3BtLgDPVIBQWB1v4j6SC8wMEEZuvxgstHOuVGFSBDsBoPJZjx4EI1GzuqSVqCihUi+A+ubMilke8XGa4aYr3vpqsjga/lMUfhRfJK/qM7rNyOMo7yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) 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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iLhJ9CB6VljX89kBYUjaOCaZwMkvhCUDAHow/qFxC7w=; b=4Vuu82wkO3PSafAMPsNXah0+iW5tGr2jiZGdWXifPKhqcGN9vRuNiDKRCmj+m7a5DLGH1ai2wTb3sqV0ceda2ypSiIH15asClyyHmmqJodPh0Tg6AR+NYXczioNb0mDlzO12fiYT/YtaHt2Z1bt+5puYjdar0S46TMhwFXNPO88= Received: from AM5PR0101CA0001.eurprd01.prod.exchangelabs.com (2603:10a6:206:16::14) by DU2PR08MB10107.eurprd08.prod.outlook.com (2603:10a6:10:46f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Mon, 6 Nov 2023 14:05:07 +0000 Received: from AMS0EPF0000019B.eurprd05.prod.outlook.com (2603:10a6:206:16:cafe::39) by AM5PR0101CA0001.outlook.office365.com (2603:10a6:206:16::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28 via Frontend Transport; Mon, 6 Nov 2023 14:05:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) 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 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AMS0EPF0000019B.mail.protection.outlook.com (10.167.16.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6977.16 via Frontend Transport; Mon, 6 Nov 2023 14:05:07 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Mon, 6 Nov 2023 14:05:01 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Mon, 6 Nov 2023 14:05:00 +0000 Received: from e124257.nice.arm.com (10.34.101.64) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Mon, 6 Nov 2023 14:05:00 +0000 From: Andrea Corallo To: CC: , , Andrea Corallo Subject: [PATCH 3/3] aarch64: Add FEAT_ITE support Date: Mon, 6 Nov 2023 15:04:55 +0100 Message-ID: <20231106140455.1694695-3-andrea.corallo@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231106140455.1694695-1-andrea.corallo@arm.com> References: <20231106140455.1694695-1-andrea.corallo@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF0000019B:EE_|DU2PR08MB10107:EE_|AM4PEPF00027A6B:EE_|VI0PR08MB10617:EE_ X-MS-Office365-Filtering-Correlation-Id: 8554d0e1-4740-47aa-2934-08dbded168ed X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: cDaD1kyq3+eqpM9KofkRi97vF+GE9JeBrX1zvhjp5KVqEhsERkgSMI6cl01fwGBDBI1lZrgmOAEzMdp/hKsU4ASaJUrNU4JS3ycr/C9iMTrS61pgVYLNlD3Dp9/Q/Nbneoe1RlQ4Se9tBwZ7xxCSn5jNcMDQvN8NaYnAM5OLsa+kBlnOUGOQQ2g1L8bLcqJBclfbdsqfzzxaF3OFTDxMho+/s5T6Uphn6PyTB3K6+Ngg9Z16bVo+dZaNW8R+iQNzPu3yMi7MXYsu9YgIDwhBJME4lTVBzMK4tLImGuzWpKxvk41GQJTa79VogRZdcgxyIkG1ThVYrEON1P7O2JTL8KncoR0m33RWo+iK0OmKEelsMevFhQJc0siVtCpiBoAxIIay0RXv7Nl2Xzm0gNp86rZ0vIe/osPnnkUh7jke97itv6kPmkh2d6XtB2TMrewele4mLPGi2ztInGBRCBfTz9ygiAwK5UbrGRpic6zrxvAaxVXZ/QI5w/ufsIO2PSs7WZHtKJMfPB0NbCUB8wA5nUZmHoTkh4kQ8Z7RdnCohFof8i+Kzkxievi43DNAN4GtGdKYmg00cOoeqgef7ij8hKxyMqXfQUr0Ilj5/n0uGYE7HCVKilst/a+X0MSIfsGy0TZdFWMhISa9TzhlOs92lSaZvRszAD17dh9nBcft3o7VNotT4Zah7BZLdV5OYSpNU9tz+WUBDVkYBXLQaLnr+3V5a3NtGeVIi604LsBdwgAzRSGKVjyi5qgU8Y0szntk X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(346002)(376002)(396003)(39850400004)(136003)(230922051799003)(82310400011)(1800799009)(64100799003)(186009)(451199024)(46966006)(36840700001)(83380400001)(1076003)(70206006)(70586007)(2616005)(26005)(19627235002)(426003)(478600001)(336012)(7696005)(40480700001)(8936002)(8676002)(4326008)(54906003)(316002)(6916009)(44832011)(47076005)(6666004)(5660300002)(36860700001)(41300700001)(86362001)(81166007)(82740400003)(356005)(2906002)(36756003)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB10107 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A6B.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f7ecbdce-6b1f-46e3-6195-08dbded161f7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BmJbvO1kYS0cCw23hMZx3Pof5StuREhqLgjZ7JGMLj+laZ1nN/stQ5On0TG7MRbsuawgQ6siUITZU9Bru84yw9CcC1KqSuao77AFBxPcLgaaiIC5SC94YAKtEnoVkqZnSvTGk3NED8ARo5fmLWQknNbepf+7mBr/DzOGbB1TNpGZMLTvaiVy9bQI3Kc2oL0OqFQWHx0LDl/8BhZ91rcT0ujkaEvE9BvAu6QZH0h6YObbnody8PbwVqzOAN8aASsSNuw3nK+OCTeRuZN9Olem4QYQsY1JAWt86H3Ri5M3vlXcHOTUiKRwHlAsWZaP/nVmu5dKkWUup4lqWY85N8yLyVzi1jWaBncGG9y1GuCTVEMmffwf0Iz0BXszoU+gsQ2fDzGyp1lpiixl0fJV6RAugf74j8d0884qAJeFy7RH8QcdDZnj33I0SRyYpMSVSiBvrI59ujmotp9CGKAC+S788ID3Pc4ZH5UI3z4gnb1OnCW5PFsKF+kWqTjvt/pLt5PIHRBeqwjTG+rR3xcvFUEBLjEWwuUzT3wV36w5YLbfPpMphqWlytateV5/p8oK0V5FC3hZLoP2r9h8S0jPBYOY3Zoaw2AmjVShc/oueicP1MW58miuCrc7zfg+hEz6lBHTf0xPbWnDw3RuadD+GhAEnBmbT2JDXx9Nzmz7HA9PbbdOY6PuE7tD4P0xNakTlVvmm8tNj46Y7o0JjFDYuHRTIqP3wClLVD9+GBhT7fPRI7wa+yyX9k9heEVbSZEReVoG X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(346002)(376002)(396003)(39860400002)(136003)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(82310400011)(40470700004)(46966006)(36840700001)(26005)(82740400003)(36756003)(6666004)(2616005)(83380400001)(86362001)(40480700001)(36860700001)(6916009)(70586007)(1076003)(8676002)(8936002)(4326008)(54906003)(316002)(7696005)(70206006)(336012)(44832011)(19627235002)(426003)(47076005)(5660300002)(2906002)(40460700003)(478600001)(41300700001)(81166007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2023 14:05:19.2492 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8554d0e1-4740-47aa-2934-08dbded168ed X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00027A6B.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR08MB10617 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+patchwork=sourceware.org@sourceware.org This patch add support for FEAT_ITE "Instrumentation Extension" adding the "trcit" instruction. This is enabled by the +ite march flag. --- gas/config/tc-aarch64.c | 1 + gas/doc/c-aarch64.texi | 2 ++ gas/testsuite/gas/aarch64/illegal-ite1-1.d | 3 +++ gas/testsuite/gas/aarch64/illegal-ite1-1.l | 2 ++ gas/testsuite/gas/aarch64/ite1.d | 9 +++++++++ gas/testsuite/gas/aarch64/ite1.s | 4 ++++ include/opcode/aarch64.h | 2 ++ opcodes/aarch64-tbl.h | 8 ++++++++ 8 files changed, 31 insertions(+) create mode 100644 gas/testsuite/gas/aarch64/illegal-ite1-1.d create mode 100644 gas/testsuite/gas/aarch64/illegal-ite1-1.l create mode 100644 gas/testsuite/gas/aarch64/ite1.d create mode 100644 gas/testsuite/gas/aarch64/ite1.s diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 827e0436136..84c69a8eedf 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -10305,6 +10305,7 @@ static const struct aarch64_option_cpu_value_table aarch64_features[] = { {"gcs", AARCH64_FEATURE (GCS), AARCH64_NO_FEATURES}, {"prfmslc", AARCH64_FEATURE (PRFMSLC), AARCH64_NO_FEATURES}, {"rasv2", AARCH64_FEATURE (RASv2), AARCH64_NO_FEATURES}, + {"ite", AARCH64_FEATURE (ITE), AARCH64_NO_FEATURES}, {NULL, AARCH64_NO_FEATURES, AARCH64_NO_FEATURES}, }; diff --git a/gas/doc/c-aarch64.texi b/gas/doc/c-aarch64.texi index 0624c4f0bb8..3c0aeeb6720 100644 --- a/gas/doc/c-aarch64.texi +++ b/gas/doc/c-aarch64.texi @@ -267,6 +267,8 @@ automatically cause those extensions to be disabled. @tab Enable the Reliability, Availability and Serviceability extension v2. @item @code{predres2} @tab ARMv8-A/Armv9-A @tab ARMv8.9-A/Armv9.4-A or later @tab Enable Prediction instructions. +@item @code{ite} @tab N/A @tab no + @tab Enable TRCIT instruction. @end multitable @node AArch64 Syntax diff --git a/gas/testsuite/gas/aarch64/illegal-ite1-1.d b/gas/testsuite/gas/aarch64/illegal-ite1-1.d new file mode 100644 index 00000000000..99ef4d47d7b --- /dev/null +++ b/gas/testsuite/gas/aarch64/illegal-ite1-1.d @@ -0,0 +1,3 @@ +#as: -march=armv8-a +#source: ite1.s +#error_output: illegal-ite1-1.l \ No newline at end of file diff --git a/gas/testsuite/gas/aarch64/illegal-ite1-1.l b/gas/testsuite/gas/aarch64/illegal-ite1-1.l new file mode 100644 index 00000000000..1e97c9147ee --- /dev/null +++ b/gas/testsuite/gas/aarch64/illegal-ite1-1.l @@ -0,0 +1,2 @@ +[^:]*: Assembler messages: +[^:]*:[0-9]+: Error: selected processor does not support `trcit x1' diff --git a/gas/testsuite/gas/aarch64/ite1.d b/gas/testsuite/gas/aarch64/ite1.d new file mode 100644 index 00000000000..7c4b486ced8 --- /dev/null +++ b/gas/testsuite/gas/aarch64/ite1.d @@ -0,0 +1,9 @@ +#as: -march=armv9.4-a+ite +#objdump: -dr + +.*: file format .* + +Disassembly of section \.text: + +0+ <.*>: +.*: d50b72e1 trcit x1 diff --git a/gas/testsuite/gas/aarch64/ite1.s b/gas/testsuite/gas/aarch64/ite1.s new file mode 100644 index 00000000000..595ecf897f2 --- /dev/null +++ b/gas/testsuite/gas/aarch64/ite1.s @@ -0,0 +1,4 @@ +/* File to test the +ite option. */ +func: + trcit x1 + diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h index ae6457597e5..fe046b9adfb 100644 --- a/include/opcode/aarch64.h +++ b/include/opcode/aarch64.h @@ -173,6 +173,8 @@ enum aarch64_feature_bit { AARCH64_FEATURE_RASv2, /* Speculation Prediction Restriction instructions. */ AARCH64_FEATURE_PREDRES2, + /* Instrumentation Extension. */ + AARCH64_FEATURE_ITE, DUMMY1, DUMMY2, DUMMY3, diff --git a/opcodes/aarch64-tbl.h b/opcodes/aarch64-tbl.h index b64d94ab70f..ac21a563b3b 100644 --- a/opcodes/aarch64-tbl.h +++ b/opcodes/aarch64-tbl.h @@ -2582,6 +2582,8 @@ static const aarch64_feature_set aarch64_feature_prfmslc = AARCH64_FEATURE (PRFMSLC); static const aarch64_feature_set aarch64_feature_rasv2 = AARCH64_FEATURE (RASv2); +static const aarch64_feature_set aarch64_feature_ite = + AARCH64_FEATURE (ITE); #define CORE &aarch64_feature_v8 #define FP &aarch64_feature_fp @@ -2645,6 +2647,7 @@ static const aarch64_feature_set aarch64_feature_rasv2 = #define GCS &aarch64_feature_gcs #define PRFMSLC &aarch64_feature_prfmslc #define RASv2 &aarch64_feature_rasv2 +#define ITE &aarch64_feature_ite #define CORE_INSN(NAME,OPCODE,MASK,CLASS,OP,OPS,QUALS,FLAGS) \ { NAME, OPCODE, MASK, CLASS, OP, CORE, OPS, QUALS, FLAGS, 0, 0, NULL } @@ -2848,6 +2851,9 @@ static const aarch64_feature_set aarch64_feature_rasv2 = #define PREDRES2_INSN(NAME,OPCODE,MASK,CLASS,OPS,QUALS,FLAGS) \ { NAME, OPCODE, MASK, CLASS, 0, PREDRES2, OPS, QUALS, FLAGS, 0, 0, NULL } +#define ITE_INSN(NAME,OPCODE,MASK,CLASS,OPS,QUALS,FLAGS) \ + { NAME, OPCODE, MASK, CLASS, 0, ITE, OPS, QUALS, FLAGS, 0, 0, NULL } + const struct aarch64_opcode aarch64_opcode_table[] = { /* Add/subtract (with carry). */ @@ -6105,6 +6111,8 @@ const struct aarch64_opcode aarch64_opcode_table[] = command-line flags. */ CORE_INSN ("clrbhb", 0xd50322df, 0xffffffff, ic_system, 0, OP0 (), {}, F_ALIAS), + ITE_INSN ("trcit", 0xd50b72e0, 0xffffffe0, ic_system, OP1 (Rt), QL_I1X, F_ALIAS), + {0, 0, 0, 0, 0, 0, {}, {}, 0, 0, 0, NULL}, };