From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by sourceware.org (Postfix) with ESMTPS id 02BDC3857015 for ; Wed, 15 Jul 2020 19:47:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 02BDC3857015 Received: by mail-qk1-x741.google.com with SMTP id r22so2999543qke.13 for ; Wed, 15 Jul 2020 12:47:32 -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=dow39ZrZJ2+cGp+CADBp1mBHATVxT47sq4YLBwJd1Pw=; b=YesubSb1Jon5a+43CjCRvJKtJvOBjzwGLOQW4AF9rTHCuGfKkDb+E7fpBQ9Zqp4dub /0EZt3MCc31BBHWbQ3f+VX+QBunQt1rTlZgBcxehSCenxn1XpBM0y9d+BweV9+SrPs9v KKFb68/s68QiXMML1hPQgNosH2STetHORyFZ/MwhYak+I1hYu9dnEQ2vfwW9NjPJADcj WQ5eNYAp+5Ww31IE2HlDY7OV/5EktOIWE1q+DxK774DyisDrE0gtTjNvPlXUPIRHnEPp oFXiva+Vhq/q1yy9xl9QyZiwR4KAKLuFeAv6uZ3bHK6fQRzNAO/bjnAPjiGER7t7psu1 ErvQ== X-Gm-Message-State: AOAM531ILOdoHqouqANL9ORHADU67Cs0Hiq6aKAjC7v/RbVn9n5aiMaq 4AVYTsYgP6vu+VXJwFWlggXbPN0702EfNQ== X-Google-Smtp-Source: ABdhPJwoyC4kovrd960BP8rbNULY/qp1kFYPrXcWZurYGDc+9qOAw8edBlotafjgih7o6fbvxA/Y6g== X-Received: by 2002:a37:a6c2:: with SMTP id p185mr671180qke.78.1594842452195; Wed, 15 Jul 2020 12:47:32 -0700 (PDT) Received: from localhost.localdomain ([2804:7f0:8283:82c3:9daa:7611:ebe6:931]) by smtp.gmail.com with ESMTPSA id z18sm4340537qta.51.2020.07.15.12.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 12:47:31 -0700 (PDT) From: Luis Machado To: gdb-patches@sourceware.org, Alan.Hayward@arm.com Cc: omair.javaid@linaro.org, catalin.marinas@arm.com, david.spickett@linaro.org, jose.marchesi@oracle.com Subject: [PATCH 08/23] AArch64: Add MTE CPU feature check support Date: Wed, 15 Jul 2020 16:44:58 -0300 Message-Id: <20200715194513.16641-9-luis.machado@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200715194513.16641-1-luis.machado@linaro.org> References: <20200715194513.16641-1-luis.machado@linaro.org> X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.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: , X-List-Received-Date: Wed, 15 Jul 2020 19:47:34 -0000 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 9d48445739..dcd444136a 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1446,6 +1446,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