get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2217149/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2217149,
    "url": "http://patchwork.ozlabs.org/api/patches/2217149/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20260327174434.2852296-1-adhemerval.zanella@linaro.org/",
    "project": {
        "id": 41,
        "url": "http://patchwork.ozlabs.org/api/projects/41/?format=api",
        "name": "GNU C Library",
        "link_name": "glibc",
        "list_id": "libc-alpha.sourceware.org",
        "list_email": "libc-alpha@sourceware.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260327174434.2852296-1-adhemerval.zanella@linaro.org>",
    "list_archive_url": null,
    "date": "2026-03-27T17:44:23",
    "name": "[1/2] aarch64: Convert GCS policy states to an enum",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a91b203f6eed7ee0b7d176353191f7d0bac9f29e",
    "submitter": {
        "id": 66065,
        "url": "http://patchwork.ozlabs.org/api/people/66065/?format=api",
        "name": "Adhemerval Zanella Netto",
        "email": "adhemerval.zanella@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20260327174434.2852296-1-adhemerval.zanella@linaro.org/mbox/",
    "series": [
        {
            "id": 497811,
            "url": "http://patchwork.ozlabs.org/api/series/497811/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=497811",
            "date": "2026-03-27T17:44:23",
            "name": "[1/2] aarch64: Convert GCS policy states to an enum",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/497811/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217149/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217149/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "libc-alpha@sourceware.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "libc-alpha@sourceware.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=FT5Qs+Rx;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org;\n receiver=patchwork.ozlabs.org)",
            "sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=FT5Qs+Rx",
            "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "sourceware.org; spf=pass smtp.mailfrom=linaro.org",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=2607:f8b0:4864:20::930"
        ],
        "Received": [
            "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fj7MP2NKxz1y1P\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Mar 2026 04:45:05 +1100 (AEDT)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id EBDFF4BA23DC\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 17:45:02 +0000 (GMT)",
            "from mail-ua1-x930.google.com (mail-ua1-x930.google.com\n [IPv6:2607:f8b0:4864:20::930])\n by sourceware.org (Postfix) with ESMTPS id 94D7C4BA9034\n for <libc-alpha@sourceware.org>; Fri, 27 Mar 2026 17:44:40 +0000 (GMT)",
            "by mail-ua1-x930.google.com with SMTP id\n a1e0cc1a2514c-950b77942deso753644241.1\n for <libc-alpha@sourceware.org>; Fri, 27 Mar 2026 10:44:40 -0700 (PDT)",
            "from mandiga.. ([2804:1b3:a7c1:90ea:62b5:ca73:a5e8:4825])\n by smtp.gmail.com with ESMTPSA id\n a1e0cc1a2514c-951be56f28esm7578251241.10.2026.03.27.10.44.37\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 27 Mar 2026 10:44:38 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org EBDFF4BA23DC",
            "OpenDKIM Filter v2.11.0 sourceware.org 94D7C4BA9034"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 94D7C4BA9034",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 94D7C4BA9034",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774633480; cv=none;\n b=msCoxu7mWN5euWwKlDriiOc2DA6crOaAySqt/dVAH+vyBF/2R5hlUX9RfRouTzhEM5UaqewUOew6KjqGVUHXRhOtRhm0kKig6w1GTUH9aHK8mISWMmUgEztki5k1eSDw0dSrmkGbjOVp9Nevt3Ympm8zsdY+uXN4t4EmRLw1Haw=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774633480; c=relaxed/simple;\n bh=13SveF37yptrmaumg0KvcZkRRBbv196+7WE1hEXD/Mw=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=fscvXuN+13wiEoSIw/35h4N5aje3/ywC04doIHZFKx1z+aF3PsmSyk5jZ5viP9U3hFlBoNDEFfRQtoGcJGrq76MAK0MRV00WK1QTVyvpj/ZWeV3ZqWtvF2mMlhvmu6YASCdUYUVFn+xIqhrbSRVZlBNPJ+Ul/su63Uy/EfdGbts=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1774633480; x=1775238280; darn=sourceware.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=v3Xf+e76qSjKDSVavrqFclRq0Uio7B9FvsbuNEsCC+Q=;\n b=FT5Qs+Rx0MjKjMI9cMmTiqmOrMuBNAC308vk67ruucCGrLA5gLpRSmMFQXxju4uHIY\n r4KFPsF5Mf9Ef1oosTxNrmVZ3IoRzigV9T94dGsku8bwaPQX0AkODydSG0UWT2IauJmC\n 2YFAlo8RVWNcvt36nbIvMHFqiigxBpCV/T4K/ktWjMDo+0ldRBnRW85N6aVPbjC1V6vA\n 59Yti67BZQOvA16nb3xbKpHMojTDAYxHNd4eLW+bFQXVuXRjM53ufDXWnsMVzAhkt5nu\n xH4m1afXmXRy4RS9sqkB7bcTLEOJb8UURkRQLnWmo5FdKtGS7wFdguoc1a2wNnja5AsM\n xzRw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774633480; x=1775238280;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=v3Xf+e76qSjKDSVavrqFclRq0Uio7B9FvsbuNEsCC+Q=;\n b=FxL+vK7lrXx314Or2I1XMGjC9pdFvK7FZWVxzDKRwJeRkt29pzANrci6klw/e8XUuI\n ZJE40RfybHvJBkZK5wGOwr3Ogb45Gqxyvvsf3pz+V1PvQZOo9UPl29P0EV8rgOBLRPJX\n A4ULjHkRyN638PyvldRYEzjt6D1VANH1TpqGsaIuStpV4iu0DDsyeTHsN+83xgEYkrfj\n qzmrux7sBskjGyzbl04mzoF7mpt1z48zvSV5fS/4ktjXTahf6ojyAMQRK/0LyakxSo5h\n AOeZngJ59h/CCXlsBcXLllsxeGuhqSvLYVOObJcOItgdO1U/pCM0zfsZSKXj3ZzOhFlF\n TY9g==",
        "X-Gm-Message-State": "AOJu0Ywab/rA4ez6bBCAOum433ek9ncvEQ7+HMbGs+0/vNmddjkUjllh\n eDE39JD+QMCS36kEgEn+DmZtNieNnGSgBOUebv0A2Bse1STQcP6yWHLw9HdGegB4eXZ+ROJVg6h\n 8a6wG",
        "X-Gm-Gg": "ATEYQzzSqADsQZyZHUfM5r0bA9SsbNRvGXDnV1Vw67i+RGT6LGlzsnDWLlPMJdvTor1\n 2yAA4tw+PrPab5YikY7/0yTuHYmpRX6lriDvyo6WpCllgmGCEi3Z7Rd0V5NEZcTUtrC1sdzxvqL\n HWYNBJR7UMyqSjnAD7ro71Mk7uoCZmZtVAmr6CgA3GmSYt2xJzYMeZNMzXK+Iv6fsqo6QbCcTtq\n sCM1dtHgw6K2A91ra08vZazb0nY7GKyvKoJZIdeACpTwF3otP4MzLbfbyxjVcbHeJ2ZcSJFcIIZ\n 6KB6VLI0L4H+5B6EQ7i/9PI4icSQXPjSAHy6sXHPAIZJGLgsi3kHZAr5L5+FsKtBblGHWJnWwLN\n fO7/MN4y12sF45I1d/b6+vWxFoTpFWUHPokEIJQxj/6RXJGzOaEMjENJGVOYL2Aze9IJbHbJj+f\n xBHJy8ulSqLFBoiTep6E+3wQjYrxYfLrnnSis=",
        "X-Received": "by 2002:a05:6102:14a9:b0:5ff:b403:a36a with SMTP id\n ada2fe7eead31-604f90e55a3mr1563555137.16.1774633479402;\n Fri, 27 Mar 2026 10:44:39 -0700 (PDT)",
        "From": "Adhemerval Zanella <adhemerval.zanella@linaro.org>",
        "To": "libc-alpha@sourceware.org",
        "Cc": "Yury Khrustalev <yury.khrustalev@arm.com>,\n Wilco Dijkstra <wilco.dijkstra@arm.com>",
        "Subject": "[PATCH 1/2] aarch64: Convert GCS policy states to an enum",
        "Date": "Fri, 27 Mar 2026 14:44:23 -0300",
        "Message-ID": "<20260327174434.2852296-1-adhemerval.zanella@linaro.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "libc-alpha@sourceware.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Libc-alpha mailing list <libc-alpha.sourceware.org>",
        "List-Unsubscribe": "<https://sourceware.org/mailman/options/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe>",
        "List-Archive": "<https://sourceware.org/pipermail/libc-alpha/>",
        "List-Post": "<mailto:libc-alpha@sourceware.org>",
        "List-Help": "<mailto:libc-alpha-request@sourceware.org?subject=help>",
        "List-Subscribe": "<https://sourceware.org/mailman/listinfo/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=subscribe>",
        "Errors-To": "libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org"
    },
    "content": "This patch replaces the raw preprocessor macros used for GCS policies\nwith a strictly typed 'aarch64_gcs_mode' enum.\n\nA new header, 'aarch64/dl-gcs.h', is introduced to centralize the GCS\nmode definitions and enforce internal mode typing.\n\nThe '_dl_aarch64_gcs' variable is updated to the new 32-bit enum type,\nand dl-start.S is adjusted to load and test 32-bit w registers 64-bit\nones.\n\nChecked on aarch64-linux-gnu.\n---\n sysdeps/aarch64/dl-gcs.c                      | 25 +++---------\n sysdeps/aarch64/dl-gcs.h                      | 38 +++++++++++++++++++\n sysdeps/aarch64/dl-start.S                    |  6 +--\n sysdeps/aarch64/ldsodefs.h                    |  1 +\n .../unix/sysv/linux/aarch64/dl-procruntime.c  |  2 +-\n sysdeps/unix/sysv/linux/aarch64/libc-start.h  |  2 +-\n 6 files changed, 50 insertions(+), 24 deletions(-)\n create mode 100644 sysdeps/aarch64/dl-gcs.h",
    "diff": "diff --git a/sysdeps/aarch64/dl-gcs.c b/sysdeps/aarch64/dl-gcs.c\nindex 4961ad75eb..213ed01382 100644\n--- a/sysdeps/aarch64/dl-gcs.c\n+++ b/sysdeps/aarch64/dl-gcs.c\n@@ -18,18 +18,6 @@\n #include <unistd.h>\n #include <ldsodefs.h>\n \n-/* GCS is disabled.  */\n-#define GCS_POLICY_DISABLED 0\n-\n-/* Enable GCS, abort if unmarked binary is found.  */\n-#define GCS_POLICY_ENFORCED 1\n-\n-/* Optionally enable GCS if all startup dependencies are marked.  */\n-#define GCS_POLICY_OPTIONAL 2\n-\n-/* Override binary marking and always enabled GCS.  */\n-#define GCS_POLICY_OVERRIDE 3\n-\n static void\n fail (struct link_map *l, const char *program)\n {\n@@ -96,7 +84,7 @@ check_gcs (struct link_map *l, const char *program, bool enforced,\n   /* Binary is not marked but GSC is optional: disable GCS.  */\n   else\n     {\n-      GL(dl_aarch64_gcs) = 0;\n+      GL(dl_aarch64_gcs) = AARCH64_GCS_POLICY_DISABLED;\n       return false;\n     }\n   __builtin_unreachable ();\n@@ -124,16 +112,15 @@ check_gcs_depends (struct link_map *l, const char *program, bool enforced,\n void\n _dl_gcs_check (struct link_map *l, const char *program, int dlopen_mode)\n {\n-  unsigned long policy = GL (dl_aarch64_gcs);\n-  switch (policy)\n+  switch (GL(dl_aarch64_gcs))\n     {\n-    case GCS_POLICY_DISABLED:\n-    case GCS_POLICY_OVERRIDE:\n+    case AARCH64_GCS_POLICY_DISABLED:\n+    case AARCH64_GCS_POLICY_OVERRIDE:\n       return;\n-    case GCS_POLICY_ENFORCED:\n+    case AARCH64_GCS_POLICY_ENFORCED:\n       check_gcs_depends (l, program, true, dlopen_mode);\n       return;\n-    case GCS_POLICY_OPTIONAL:\n+    case AARCH64_GCS_POLICY_OPTIONAL:\n       check_gcs_depends (l, program, false, dlopen_mode);\n       return;\n     default:\ndiff --git a/sysdeps/aarch64/dl-gcs.h b/sysdeps/aarch64/dl-gcs.h\nnew file mode 100644\nindex 0000000000..bee3c94432\n--- /dev/null\n+++ b/sysdeps/aarch64/dl-gcs.h\n@@ -0,0 +1,38 @@\n+/* Internal AArch64 GCS definitions.\n+   Copyright (C) 2026 Free Software Foundation, Inc.\n+\n+   The GNU C Library is free software; you can redistribute it and/or\n+   modify it under the terms of the GNU Lesser General Public\n+   License as published by the Free Software Foundation; either\n+   version 2.1 of the License, or (at your option) any later version.\n+\n+   The GNU C Library is distributed in the hope that it will be useful,\n+   but WITHOUT ANY WARRANTY; without even the implied warranty of\n+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+   Lesser General Public License for more details.\n+\n+   You should have received a copy of the GNU Lesser General Public\n+   License along with the GNU C Library; if not, see\n+   <https://www.gnu.org/licenses/>.  */\n+\n+#ifndef _DL_GCS_H\n+#define _DL_GCS_H\n+\n+#include <verify.h>\n+\n+typedef enum\n+{\n+  /* GCS is disabled.  */\n+  AARCH64_GCS_POLICY_DISABLED = 0,\n+  /* Enable GCS, abort if unmarked binary is found.  */\n+  AARCH64_GCS_POLICY_ENFORCED = 1,\n+  /* Optionally enable GCS if all startup dependencies are marked.  */\n+  AARCH64_GCS_POLICY_OPTIONAL = 2,\n+  /* Override binary marking and always enabled GCS.  */\n+  AARCH64_GCS_POLICY_OVERRIDE = 3\n+} aarch64_gcs_mode;\n+\n+/* dl-start.S assumes aarch64_gcs_mode is representable as uint32_t.  */\n+verify (sizeof (aarch64_gcs_mode) == 4);\n+\n+#endif\ndiff --git a/sysdeps/aarch64/dl-start.S b/sysdeps/aarch64/dl-start.S\nindex c278485cd3..78b30b709e 100644\n--- a/sysdeps/aarch64/dl-start.S\n+++ b/sysdeps/aarch64/dl-start.S\n@@ -35,8 +35,8 @@ ENTRY (_start)\n \t/* Use GL(dl_aarch64_gcs) to set the shadow stack status.  */\n \tadrp\tx16, _rtld_local\n \tadd\tx16, x16, :lo12:_rtld_local\n-\tldr\tx22, [x16, GL_DL_AARCH64_GCS_OFFSET]\n-\tcbz\tx22, L(skip_gcs_enable)\n+\tldr\tw22, [x16, GL_DL_AARCH64_GCS_OFFSET]\n+\tcbz\tw22, L(skip_gcs_enable)\n \n \t/* Enable GCS before user code runs.  Note that IFUNC resolvers and\n \t   LD_AUDIT hooks may run before, but should not create threads.  */\n@@ -53,7 +53,7 @@ ENTRY (_start)\n \tcbnz\tw0, L(failed_gcs_enable)\n \t/* Check if we need to lock GCS features.  */\n \t/* If the aarch64_gcs tunable is either 0 or 2 do not lock GCS.  */\n-\ttst\tx22, #-3\n+\ttst\tw22, #-3\n \tbeq\tL(skip_gcs_enable)\n \tmov\tx0, PR_LOCK_SHADOW_STACK_STATUS\n \t/* Lock everything including future operations.  */\ndiff --git a/sysdeps/aarch64/ldsodefs.h b/sysdeps/aarch64/ldsodefs.h\nindex 03b35ce20a..d29569593a 100644\n--- a/sysdeps/aarch64/ldsodefs.h\n+++ b/sysdeps/aarch64/ldsodefs.h\n@@ -21,6 +21,7 @@\n \n #include <elf.h>\n #include <cpu-features.h>\n+#include <dl-gcs.h>\n \n struct La_aarch64_regs;\n struct La_aarch64_retval;\ndiff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procruntime.c b/sysdeps/unix/sysv/linux/aarch64/dl-procruntime.c\nindex 1f3b58d0fc..d49bb6cf5d 100644\n--- a/sysdeps/unix/sysv/linux/aarch64/dl-procruntime.c\n+++ b/sysdeps/unix/sysv/linux/aarch64/dl-procruntime.c\n@@ -24,7 +24,7 @@\n # if !defined PROCINFO_DECL && defined SHARED\n   ._dl_aarch64_gcs\n # else\n-PROCINFO_CLASS unsigned long _dl_aarch64_gcs\n+PROCINFO_CLASS aarch64_gcs_mode _dl_aarch64_gcs\n # endif\n # ifndef PROCINFO_DECL\n = 0\ndiff --git a/sysdeps/unix/sysv/linux/aarch64/libc-start.h b/sysdeps/unix/sysv/linux/aarch64/libc-start.h\nindex 4ccd13741b..293c8a90b2 100644\n--- a/sysdeps/unix/sysv/linux/aarch64/libc-start.h\n+++ b/sysdeps/unix/sysv/linux/aarch64/libc-start.h\n@@ -54,7 +54,7 @@ aarch64_libc_setup_tls (void)\n \n   _rtld_main_check (main_map, _dl_argv[0]);\n \n-  uint64_t gcs = GL (dl_aarch64_gcs);\n+  aarch64_gcs_mode gcs = GL(dl_aarch64_gcs);\n   if (gcs != GCS_POLICY_DISABLED)\n     {\n       int ret;\n",
    "prefixes": [
        "1/2"
    ]
}