From patchwork Fri Dec 18 19:29:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Earnshaw X-Patchwork-Id: 41474 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 B0414393BC04; Fri, 18 Dec 2020 19:30:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0414393BC04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1608319812; bh=vTpwAgQfbnLnvVnxJMzRaeAUv4yO9+Hmb6JJ9FPhp0k=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=PiGYe7yTNWLC+S0gh2VsleNOmZ41EE6IJzCKbNIIFHFe0tqsm2dI37DGNJJbJLeR5 ce36bVIVyLcGgCQwbsg1Z0mhfUGuJffMa9rR+p/78I7omswizsiKHIiF+fAhM4Dg+m c7IL0MEyliX2r5/BLeNUke6AehoXXL2jqi0drBCU= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 7D22A3857004 for ; Fri, 18 Dec 2020 19:30:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7D22A3857004 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1AF571FB; Fri, 18 Dec 2020 11:30:09 -0800 (PST) Received: from eagle.buzzard.freeserve.co.uk (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 482CE3F66E; Fri, 18 Dec 2020 11:30:08 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v4 0/6] Memory tagging support Date: Fri, 18 Dec 2020 19:29:51 +0000 Message-Id: <20201218192957.11035-1-rearnsha@arm.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Earnshaw via Libc-alpha From: Richard Earnshaw Reply-To: Richard Earnshaw Cc: Richard Earnshaw Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Main changes in this version: - collapse the changes to the malloc code to a single patch. - change _LIBC_MTAG to USE_MTAG. - comments around definition of PROT_MTE. - tunable renamed to glibc.mem.tagging. - cleanups to assembler files for aarch64 support. I'll push a copy of this patch set to rearnsha/mte-v4.0 shortly. Richard Earnshaw (6): config: Allow memory tagging to be enabled when configuring glibc elf: Add a tunable to control use of tagged memory malloc: Basic support for memory tagging in the malloc() family linux: Add compatibility definitions to sys/prctl.h for MTE aarch64: Add sysv specific enabling code for memory tagging aarch64: Add aarch64-specific files for memory tagging support INSTALL | 14 + config.h.in | 3 + config.make.in | 2 + configure | 22 ++ configure.ac | 15 + elf/dl-tunables.list | 9 + malloc/arena.c | 59 ++- malloc/hooks.c | 79 ++-- malloc/malloc.c | 336 ++++++++++++++---- malloc/malloc.h | 7 + manual/install.texi | 13 + manual/tunables.texi | 35 ++ sysdeps/aarch64/Makefile | 5 + sysdeps/aarch64/__mtag_address_get_tag.S | 32 ++ sysdeps/aarch64/__mtag_memset_tag.S | 53 +++ sysdeps/aarch64/__mtag_new_tag.S | 37 ++ sysdeps/aarch64/__mtag_tag_region.S | 51 +++ sysdeps/aarch64/libc-mtag.h | 57 +++ sysdeps/generic/libc-mtag.h | 52 +++ sysdeps/unix/sysv/linux/aarch64/bits/hwcap.h | 1 + sysdeps/unix/sysv/linux/aarch64/bits/mman.h | 1 + .../unix/sysv/linux/aarch64/cpu-features.c | 30 ++ .../unix/sysv/linux/aarch64/cpu-features.h | 2 + sysdeps/unix/sysv/linux/sys/prctl.h | 18 + 24 files changed, 836 insertions(+), 97 deletions(-) create mode 100644 sysdeps/aarch64/__mtag_address_get_tag.S create mode 100644 sysdeps/aarch64/__mtag_memset_tag.S create mode 100644 sysdeps/aarch64/__mtag_new_tag.S create mode 100644 sysdeps/aarch64/__mtag_tag_region.S create mode 100644 sysdeps/aarch64/libc-mtag.h create mode 100644 sysdeps/generic/libc-mtag.h