get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2228173,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2228173/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260425155140.50186-9-deller@kernel.org/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260425155140.50186-9-deller@kernel.org>",
    "date": "2026-04-25T15:51:34",
    "name": "[PULL,08/14] linux-user/mips: sync k0 TLS for EF_MIPS_MACH_OCTEON userlands",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "e9f330539deda739bfafde3b574d406b6084057d",
    "submitter": {
        "id": 87076,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/87076/?format=api",
        "name": "Helge Deller",
        "email": "deller@kernel.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260425155140.50186-9-deller@kernel.org/mbox/",
    "series": [
        {
            "id": 501448,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501448/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=501448",
            "date": "2026-04-25T15:51:29",
            "name": "[PULL,01/14] MAINTAINERS: Add myself as maintainer for linux-user",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501448/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2228173/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2228173/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=mRw2oF8u;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g2vVj4QgSz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 26 Apr 2026 01:53:01 +1000 (AEST)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wGfIs-0008Lk-Ex; Sat, 25 Apr 2026 11:52:22 -0400",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <deller@kernel.org>) id 1wGfIX-00081E-To\n for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:04 -0400",
            "from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <deller@kernel.org>) id 1wGfIW-00014i-8s\n for qemu-devel@nongnu.org; Sat, 25 Apr 2026 11:52:01 -0400",
            "from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n by tor.source.kernel.org (Postfix) with ESMTP id 5A3F5600AE;\n Sat, 25 Apr 2026 15:51:59 +0000 (UTC)",
            "by smtp.kernel.org (Postfix) with ESMTPSA id A3326C2BCB0;\n Sat, 25 Apr 2026 15:51:57 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n s=k20201202; t=1777132319;\n bh=ZCgbefl3znT//LnX5C+F02YXGLn7Vtw2haVvLrZdTz0=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=mRw2oF8uSH0zjRPXG4XK9EQXZHrPQSjX7RTnD1M3w5fwPKAMhEOpzIip/KZwOLgX4\n 4+8vV/sFJruvkp8JTUTBIgtmWY6q6E/QgSHkPBzJDYuH9w2kvMHiYK5bA9knmyTp+w\n LTdxO3FYmb4rDPiyUZSp8qx9B12GgohGXr0RKwAHAPug64Zt54DjQ7/R/atvpBsjO8\n Y096AHkKWlnSVscZPI+TlkBfyqrNyQXIBq+xIqW3e0JeciufYOEn3CGU3MQAnUO8zO\n KS4gX64pDiB3zfBdGCG07Bm5oybkfQlpLqx8nUJZgs54Ow5axUpaW5X6MgcKP4s1Se\n LigpZSBxZp33A==",
        "From": "Helge Deller <deller@kernel.org>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "Helge Deller <deller@gmx.de>, Jiaxun Yang <jiaxun.yang@flygoat.com>,\n Laurent Vivier <laurent@vivier.eu>,\n Pierrick Bouvier <pierrick.bouvier@linaro.org>, =?utf-8?q?Philippe_Mathieu-?=\n\t=?utf-8?q?Daud=C3=A9?= <philmd@linaro.org>",
        "Subject": "[PULL 08/14] linux-user/mips: sync k0 TLS for EF_MIPS_MACH_OCTEON\n userlands",
        "Date": "Sat, 25 Apr 2026 17:51:34 +0200",
        "Message-ID": "<20260425155140.50186-9-deller@kernel.org>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260425155140.50186-1-deller@kernel.org>",
        "References": "<20260425155140.50186-1-deller@kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2600:3c04:e001:324:0:1991:8:25;\n envelope-from=deller@kernel.org; helo=tor.source.kernel.org",
        "X-Spam_score_int": "-20",
        "X-Spam_score": "-2.1",
        "X-Spam_bar": "--",
        "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no",
        "X-Spam_action": "no action",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "qemu development <qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"
    },
    "content": "From: James Hilliard <james.hilliard1@gmail.com>\n\nCavium Octeon userspace is not following a generic MIPS Linux TLS\nABI rule here. Older Octeon glibc uses the k0 register as the fast\nthread pointer, while newer Octeon2 and Octeon3 glibc variants use\nthe normal rdhwr $29 path.\n\nlinux-user already updates CP0_UserLocal for cpu_set_tls() and\nTARGET_NR_set_thread_area, but it does not keep gpr[26]\nsynchronized. That leaves EF_MIPS_MACH_OCTEON userlands able to\ncomplete set_thread_area() and still reach pthread startup or\npthread_self() with a stale k0 value.\n\nUse the existing MIPS ELF machine flags from linux-user/elfload.c and\nmirror CP0_UserLocal into gpr[26] only for EF_MIPS_MACH_OCTEON.\n\nSigned-off-by: James Hilliard <james.hilliard1@gmail.com>\nReviewed-by: Richard Henderson <richard.henderson@linaro.org>\nSigned-off-by: Helge Deller <deller@gmx.de>\n---\n linux-user/elfload.c         | 3 +++\n linux-user/mips/target_cpu.h | 5 +++++\n linux-user/qemu.h            | 1 +\n linux-user/syscall.c         | 2 +-\n 4 files changed, 10 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/linux-user/elfload.c b/linux-user/elfload.c\nindex 59b543f740..0e757787d2 100644\n--- a/linux-user/elfload.c\n+++ b/linux-user/elfload.c\n@@ -1476,6 +1476,9 @@ static void load_elf_image(const char *image_name, const ImageSource *src,\n     /* Usual start for brk is after all sections of the main executable. */\n     info->brk = TARGET_PAGE_ALIGN(hiaddr + load_bias);\n     info->elf_flags = ehdr->e_flags;\n+#ifdef TARGET_MIPS\n+    info->use_k0_tls = (ehdr->e_flags & EF_MIPS_MACH) == EF_MIPS_MACH_OCTEON;\n+#endif\n \n     prot_exec = PROT_EXEC;\n #ifdef TARGET_AARCH64\ndiff --git a/linux-user/mips/target_cpu.h b/linux-user/mips/target_cpu.h\nindex c375616c55..2bbd0a81c5 100644\n--- a/linux-user/mips/target_cpu.h\n+++ b/linux-user/mips/target_cpu.h\n@@ -35,7 +35,12 @@ static inline void cpu_clone_regs_parent(CPUMIPSState *env, unsigned flags)\n \n static inline void cpu_set_tls(CPUMIPSState *env, target_ulong newtls)\n {\n+    TaskState *ts = get_task_state(env_cpu(env));\n+\n     env->active_tc.CP0_UserLocal = newtls;\n+    if (ts->info->use_k0_tls) {\n+        env->active_tc.gpr[26] = newtls;\n+    }\n }\n \n static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state)\ndiff --git a/linux-user/qemu.h b/linux-user/qemu.h\nindex cfe5f45fc4..7f98fb2607 100644\n--- a/linux-user/qemu.h\n+++ b/linux-user/qemu.h\n@@ -65,6 +65,7 @@ struct image_info {\n         uint32_t        note_flags;\n \n #ifdef TARGET_MIPS\n+        bool            use_k0_tls;\n         int             fp_abi;\n         int             interp_fp_abi;\n #endif\ndiff --git a/linux-user/syscall.c b/linux-user/syscall.c\nindex f4b74ad350..8e96cc26db 100644\n--- a/linux-user/syscall.c\n+++ b/linux-user/syscall.c\n@@ -13216,7 +13216,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,\n #ifdef TARGET_NR_set_thread_area\n     case TARGET_NR_set_thread_area:\n #if defined(TARGET_MIPS)\n-      cpu_env->active_tc.CP0_UserLocal = arg1;\n+      cpu_set_tls(cpu_env, arg1);\n       return 0;\n #elif defined(TARGET_I386) && defined(TARGET_ABI32)\n       return do_set_thread_area(cpu_env, arg1);\n",
    "prefixes": [
        "PULL",
        "08/14"
    ]
}