From patchwork Wed Oct 23 08:39:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Khrustalev X-Patchwork-Id: 99382 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 87D363858404 for ; Wed, 23 Oct 2024 08:47:39 +0000 (GMT) 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 E724F3858C5F for ; Wed, 23 Oct 2024 08:44:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E724F3858C5F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E724F3858C5F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729673101; cv=none; b=fLEg4DKW1iA0hxMjd7H8fFejsNPouLeAeDfX6Q0Kh8PVM3/TEVqGgfr/3NDtwGxts7tMXbeoHTO30n71hm2bNZzO9AH/V3qZlAbKNaiCCku6jqQhoQsyRsvpyCrZju1MPEcqe/lw9urKU0MCFgR4goFNTTloXUIH7KMN7m0lV20= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729673101; c=relaxed/simple; bh=0mjzYyBexG6r8PXXHlNRTZOmc4MiuC8/4jnwyMI1TNE=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=kP1pwYIuYvWtTIN5BRO9u62WaI//kQ9fU6kCX1skDwhTMKrOIhBqdeAvxt9gdjiik1rCj8KnMswslzNCAu3r5ZpYxqKAORGZKnPk3ghbqAzEoWzxIy2i+DVfTMqHRBbm6+WSrSNGtdSaj5NKhSRHV5NUJUtI88jw7454sitYuLA= ARC-Authentication-Results: i=1; server2.sourceware.org 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 666DE1576; Wed, 23 Oct 2024 01:45:20 -0700 (PDT) Received: from udebian.localdomain (unknown [10.1.39.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0ACC13F528; Wed, 23 Oct 2024 01:44:49 -0700 (PDT) From: Yury Khrustalev To: libc-alpha@sourceware.org Cc: fweimer@redhat.com, adhemerval.zanella@linaro.org, codonell@redhat.com, nsz@gcc.gnu.org Subject: [PATCH v3 23/23] doc: Add plain text readme for using GCS Date: Wed, 23 Oct 2024 09:39:20 +0100 Message-Id: <20241023083920.466015-24-yury.khrustalev@arm.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241023083920.466015-1-yury.khrustalev@arm.com> References: <20241023083920.466015-1-yury.khrustalev@arm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-14.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org From: Szabolcs Nagy TODO: this is just for the arm/gcs branch while it is being developed --- README | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/README b/README index 2e360eb70a..24a8ac4adf 100644 --- a/README +++ b/README @@ -1,3 +1,71 @@ +this branch contains experimental GCS support (not ABI stable) + +source and branches +------------------- + +binutils-gdb: upstream-git users/ARM/gcs-binutils-gdb-master +gcc (trunk): upstream-git vendors/ARM/gcs + note: gcc vendor branches need setup https://gcc.gnu.org/gitwrite.html#vendor +glibc: upstream-git arm/gcs +linux: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/gcs +fvp fast model can be used for testing + +toolchain build +--------------- + +two options: + +(1) branch-protect by default + configure gcc with --enable-standard-branch-protection + and build glibc normally + +(2) do not branch-protect by default, require explicit cflags + configure gcc with + CFLAGS_FOR_TARGET='-O2 -mbranch-protection=standard' + CXXFLAGS_FOR_TARGET='-O2 -mbranch-protection=standard' + and configure glibc with + CFLAGS='-g -O2 -mbranch-protection=standard' + build user code with + CFLAGS+=-mbranch-protection=standard + (equivalent to -mbranch-protection=bti+pac+gcs) + +linking +------- + +use ldflags: + +-z gcs={always,never,implicit} + always: force GCS marking on + never: force GCS marking off + implicit: mark output if all inputs are marked (default) + +-z gcs-report={none,warning,error} + none: silent (default) + warning: when output is marked, unmarked input is a warning + error: when output is marked, unmarked input is an error + +runtime +------- + +run with environment var + + GLIBC_TUNABLES=glibc.cpu.aarch64_gcs=1:glibc.cpu.aarch64_gcs_policy=2 + +by default both tunables are 0, the meaning is + +glibc.cpu.aarch64_gcs_policy=0: + GCS is enabled if glibc.cpu.aarch64_gcs is set +glibc.cpu.aarch64_gcs_policy=1: + GCS is enabled if glibc.cpu.aarch64_gcs is set and binary is marked + if GCS is enabled an incompatible dlopen is an error +glibc.cpu.aarch64_gcs_policy=2: + GCS is enabled if glibc.cpu.aarch64_gcs is set + if GCS is enabled any incompatible binary is an error + + +original readme +--------------- + This directory contains the sources of the GNU C Library. See the file "version.h" for what release version you have.