From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CSlADlbLEWCGTwAAWB0awg (envelope-from ) for ; Wed, 27 Jan 2021 15:21:42 -0500 Received: by simark.ca (Postfix, from userid 112) id 26AF61EF80; Wed, 27 Jan 2021 15:21:42 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B6D7F1EF84 for ; Wed, 27 Jan 2021 15:21:38 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DF0F4398B832; Wed, 27 Jan 2021 20:21:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF0F4398B832 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1611778896; bh=+YOblwRByZuySioSs/UOWNu5fpAUnu14NnXKejbFdIM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=R9AH//Bhl1QIL1Uqp03hpBc0rjT2Jz1nTGyLdWe90J0pk5rIDaMv8WCV8A8biGNWj IHeFtxTrolHPhh4HcrkL3KSj9cpMBh+Nov+MkAh/i6z4WwcURb8scU5rB2fbgPbPM4 EvFRb403EnDBSzrzdTzCBtnJmNMM3gOHcDoLLbVc= Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by sourceware.org (Postfix) with ESMTPS id EA3813896C03 for ; Wed, 27 Jan 2021 20:21:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EA3813896C03 Received: by mail-qt1-x836.google.com with SMTP id e17so2439869qto.3 for ; Wed, 27 Jan 2021 12:21:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+YOblwRByZuySioSs/UOWNu5fpAUnu14NnXKejbFdIM=; b=DBwyYdRNnqfhenEQ5dNZH34yK1L3ZJ/wXCSN0d0bXeFj5VOmjROFflpqJqXipUE4A6 2sjBZF1Deg3tuZxaBcgus50BWAOZy8VyCI5Uv6MdEelIze068L3MySl9Mu4q+RqSN3o8 OGlaCIITsLt3EYDopknXMTBwHf4nPcEDAL1o+fkiQurTpHGmicJ4G9V5s3mAvxws88U7 +tDTdZGoBOQc5nDLc0aEbgtkTbjVR7rFNAQI3Y3MkRkb43OC1yu+cnsSZqEwt+DtDt2E y+ZMf6Z0lmTvLxJ6r6KuXGcY6cJWEU8y4e/9fzvtJ+OIfpINwDKM8f80jZpGQ2oCmg6l KBjg== X-Gm-Message-State: AOAM532ivnPuxFIN0ajnCxflO3n+Y6srSxif2H7WjY0b9l86l2rOqMAt 7qPAm5g66O9lAsv52VO2MHcBWjr3zn1cuA== X-Google-Smtp-Source: ABdhPJzmBylJoboMN2BeocGP/az+0yaYuMNI9IYBy4nq9iGQfXupdlik+LtQJrkI/WkuU5tcWnj5MQ== X-Received: by 2002:a05:622a:20c:: with SMTP id b12mr11361878qtx.208.1611778892436; Wed, 27 Jan 2021 12:21:32 -0800 (PST) Received: from localhost.localdomain ([2804:7f0:8284:874d:b82c:87fc:4324:adab]) by smtp.gmail.com with ESMTPSA id b194sm1854531qkc.102.2021.01.27.12.21.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 12:21:32 -0800 (PST) To: gdb-patches@sourceware.org Subject: [PATCH v5 08/25] AArch64: Add MTE CPU feature check support Date: Wed, 27 Jan 2021 17:20:55 -0300 Message-Id: <20210127202112.2485702-9-luis.machado@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210127202112.2485702-1-luis.machado@linaro.org> References: <20210127202112.2485702-1-luis.machado@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Luis Machado via Gdb-patches Reply-To: Luis Machado Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" This patch is a preparation for the next patches implementing MTE. It just adds a HWCAP2 constant for MTE, creates a new generic arch/aarch64-mte-linux.h file and includes that file in the source files that will use it. gdb/ChangeLog: YYYY-MM-DD Luis Machado * Makefile.in (HFILES_NO_SRCDIR): Add arch/aarch64-mte-linux.h. * aarch64-linux-nat.c: Include arch/aarch64-mte-linux.h. * aarch64-linux-tdep.c: Likewise * arch/aarch64-mte-linux.h: New file. gdbserver/ChangeLog: YYYY-MM-DD Luis Machado * linux-aarch64-low.cc: Include arch/aarch64-mte-linux.h. --- gdb/Makefile.in | 1 + gdb/aarch64-linux-nat.c | 2 ++ gdb/aarch64-linux-tdep.c | 2 ++ gdb/arch/aarch64-mte-linux.h | 28 ++++++++++++++++++++++++++++ gdbserver/linux-aarch64-low.cc | 1 + 5 files changed, 34 insertions(+) create mode 100644 gdb/arch/aarch64-mte-linux.h diff --git a/gdb/Makefile.in b/gdb/Makefile.in index c8979fe276..4e1e6da88d 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1469,6 +1469,7 @@ HFILES_NO_SRCDIR = \ arch/aarch32.h \ arch/aarch64.h \ arch/aarch64-insn.h \ + arch/aarch64-mte-linux.h \ arch/arc.h \ arch/arm.h \ arch/i386.h \ diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index 0cae91b569..424e616b04 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -50,6 +50,8 @@ #include "gdb_proc_service.h" #include "arch-utils.h" +#include "arch/aarch64-mte-linux.h" + #ifndef TRAP_HWBKPT #define TRAP_HWBKPT 0x0004 #endif diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index b1bbd55e5c..260d1c59c1 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -44,6 +44,8 @@ #include "record-full.h" #include "linux-record.h" +#include "arch/aarch64-mte-linux.h" + /* Signal frame handling. +------------+ ^ diff --git a/gdb/arch/aarch64-mte-linux.h b/gdb/arch/aarch64-mte-linux.h new file mode 100644 index 0000000000..c6a91c2db4 --- /dev/null +++ b/gdb/arch/aarch64-mte-linux.h @@ -0,0 +1,28 @@ +/* Common Linux target-dependent definitions for AArch64 MTE + + Copyright (C) 2020 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef ARCH_AARCH64_LINUX_H +#define ARCH_AARCH64_LINUX_H + +/* Feature check for Memory Tagging Extension. */ +#ifndef HWCAP2_MTE +#define HWCAP2_MTE (1 << 18) +#endif + +#endif /* ARCH_AARCH64_LINUX_H */ diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc index 86c5f069fa..7d7da87fdc 100644 --- a/gdbserver/linux-aarch64-low.cc +++ b/gdbserver/linux-aarch64-low.cc @@ -40,6 +40,7 @@ #include "gdb_proc_service.h" #include "arch/aarch64.h" +#include "arch/aarch64-mte-linux.h" #include "linux-aarch32-tdesc.h" #include "linux-aarch64-tdesc.h" #include "nat/aarch64-sve-linux-ptrace.h" -- 2.25.1