From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uPY6FvHkkV9pSAAAWB0awg (envelope-from ) for ; Thu, 22 Oct 2020 16:00:49 -0400 Received: by simark.ca (Postfix, from userid 112) id 52DA91E89B; Thu, 22 Oct 2020 16:00:49 -0400 (EDT) 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 BC5CA1E776 for ; Thu, 22 Oct 2020 16:00:47 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 222D63987503; Thu, 22 Oct 2020 20:00:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 222D63987503 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1603396847; bh=M45jvtR+71509IycvHEpdoJMQgtMuNhQL1S6e2BTps0=; 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=BTEaoiF57GVL0PI6E9wUa0QdM7I7goA8VeVB0VQ/N0ipi4mZjnn9pVwcR53/c6XqU FpJPXUwwZOq8LEEvr6RzS9V3LCOL0zkHgu3tnjWnNRju209K6TF4M/txYnK1U2NDS+ H95heFEHP9JbSAUjlqg2coCZTbha9sJD/r2MMeYU= Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by sourceware.org (Postfix) with ESMTPS id EC16B3987479 for ; Thu, 22 Oct 2020 20:00:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EC16B3987479 Received: by mail-qk1-x742.google.com with SMTP id f21so3087414qko.5 for ; Thu, 22 Oct 2020 13:00:44 -0700 (PDT) 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; bh=M45jvtR+71509IycvHEpdoJMQgtMuNhQL1S6e2BTps0=; b=X+kC5gdB1k1YOZPJDDtQuI/ha4m1YB4KhUN7w9VuODMwCOD5fyVzyVBxQbVh9Q/CiD YeFXMSwcKeSWvUNljUuRpMLwJvj/kQlL0QK8LwIvuFZ4KbJ91FIxUj9lk6NrzA32eh4W C/NOzVgcAPW/ciBlyzWqcAjYhqEWccXl7AHITCKiW3AVqusUtWHUAPC8kn1krfQKwz/t lm+7+VuaOBFGv4jxRqK1J9oznPoTvvaiTRIg2DzuROzkY54R9pX+FI1N4j6q5m6ZYAmY Z5YZXjMKRQGYyL2B9BVEoa5OafrS0Bjj4q/9F1rUIN+9E+WJtm2kcbwoXbwMN2wrpWvk fqaw== X-Gm-Message-State: AOAM532VXO/nDDSPJEaC5CzptkVMmwGpliYTgiz5lmcbNEHHVTurKw8m 8qzUxIl4DtR2NyqJ1lEPQbTGGwiTaK+Eww== X-Google-Smtp-Source: ABdhPJxItkExGXTiibCUnSH4COV0GvqS9inZTvdzuHUXSEBc9vkM6Hj/6COe5joi7wmAXw0CD0Zt7Q== X-Received: by 2002:a37:7242:: with SMTP id n63mr2750569qkc.470.1603396844281; Thu, 22 Oct 2020 13:00:44 -0700 (PDT) Received: from localhost.localdomain ([2804:7f0:8284:1487:b9b1:f72a:8f1:600]) by smtp.gmail.com with ESMTPSA id a21sm1711208qkk.98.2020.10.22.13.00.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 13:00:43 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCH v2 08/24] AArch64: Add MTE CPU feature check support Date: Thu, 22 Oct 2020 16:59:58 -0300 Message-Id: <20201022200014.5189-9-luis.machado@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201022200014.5189-1-luis.machado@linaro.org> References: <20201022200014.5189-1-luis.machado@linaro.org> 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 8a160896e2..6c3066a59e 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1458,6 +1458,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 77d5863a56..260f47558b 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 34ba0d87ba..bfb4fc51e1 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 08208ae4f4..7512aac54b 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.17.1