From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id YChmJUGf7F8ACwAAWB0awg (envelope-from ) for ; Wed, 30 Dec 2020 10:39:45 -0500 Received: by simark.ca (Postfix, from userid 112) id 71F3A1F0AA; Wed, 30 Dec 2020 10:39:45 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [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 9E2F31F0B8 for ; Wed, 30 Dec 2020 10:39:42 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DEA6D388C03E; Wed, 30 Dec 2020 15:39:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEA6D388C03E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1609342781; bh=xEz8sPyt8an0QQfCWXo4JfzNiiUQaXVjXxkjeQuPMsw=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=jVFaDGi44AlZJN05fnP9PELBiI/6G3Ug+CMMYwUugVlmPUFvWb9dmhrd/pHMKXBJZ 323hSQbhfflWOgDuQHWDdiFrME4B5X0CT/eoedWfo0O81TJvqacDAvvXdfnhRWNx48 aTXHZA/tTY1W0V10FKKYAfUSw7NGO+/UF1FdkO3A= Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by sourceware.org (Postfix) with ESMTPS id 8144D388C02E for ; Wed, 30 Dec 2020 15:39:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8144D388C02E Received: by mail-qk1-x72f.google.com with SMTP id 19so14151445qkm.8 for ; Wed, 30 Dec 2020 07:39:39 -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:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xEz8sPyt8an0QQfCWXo4JfzNiiUQaXVjXxkjeQuPMsw=; b=OaVyH3ev+IE1JcVgp05jxJNyXK7R6DqVEDtD7ubjs8yFFpZ5/OqL8W3u9C/SEGl11a iM7kpMR94d/CptrBZ9NREwn6QVr47NgwUt7GzU16HVh8RlFgXwtX3aqwzj9ZZbxAdrmm lOzWlw7UQszbFV7RGbIJR+OWYQiSU+GgK8OqYBhU35sSEgI4KuS8EKMeMEWTFtWdXJov K32x/CSK4mTACQBPW8G+bALKQbh9XBx8rotkbKH8L0MLXq2SKtJtowb9M+gIauzTmlEd d4NJty7v7ESGL5qvQJDhVEM4nP37RtNabZ7vHxqPs/r7yA1tpEPNRsABPppKYpS+BNuo VrRg== X-Gm-Message-State: AOAM531lYxHv20EWJE4J5EWOiDNQIPtNuhGZo0Y7qJgiGXhJT7sy9c+d y/ID4r5FJfYNR+MFQbJkXy++PJnBVqq2nA== X-Google-Smtp-Source: ABdhPJzrwC2fZfYyzoZpMZoTF74EIx8/C0TAMZQ2Y6TdW2UfXEGcsFJYZHgot5reJ8mrTIj0OkMafQ== X-Received: by 2002:a05:620a:ec5:: with SMTP id x5mr53695413qkm.143.1609342778848; Wed, 30 Dec 2020 07:39:38 -0800 (PST) Received: from localhost.localdomain ([2804:7f0:8284:370e:c9ba:c4ec:737b:57da]) by smtp.gmail.com with ESMTPSA id f6sm28589336qkh.2.2020.12.30.07.39.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Dec 2020 07:39:38 -0800 (PST) To: gdb-patches@sourceware.org Subject: [PATCH v4 08/25] AArch64: Add MTE CPU feature check support Date: Wed, 30 Dec 2020 12:38:59 -0300 Message-Id: <20201230153916.1586725-9-luis.machado@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201230153916.1586725-1-luis.machado@linaro.org> References: <20201230153916.1586725-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 Cc: david.spickett@linaro.org 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 999b294061..0f2d2eb947 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1468,6 +1468,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 b3bbde4b92..eeff80654b 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 1e8d8e9d6b..8866298c2f 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 f39d7c2316..941acfb920 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