get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2222874,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2222874/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260413230251.22537-3-richard.henderson@linaro.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": "<20260413230251.22537-3-richard.henderson@linaro.org>",
    "date": "2026-04-13T23:02:50",
    "name": "[2/3] linux-user/arm/nwfpe: Replace user_registers with current_cpu",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a75eae7a5803565f1a92b391c5cd569a49053209",
    "submitter": {
        "id": 72104,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/72104/?format=api",
        "name": "Richard Henderson",
        "email": "richard.henderson@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260413230251.22537-3-richard.henderson@linaro.org/mbox/",
    "series": [
        {
            "id": 499759,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/499759/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=499759",
            "date": "2026-04-13T23:02:50",
            "name": "linux-user/arm: Deprecate nwfpe",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499759/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2222874/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2222874/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=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=ZoSwiDR9;\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 4fvjdS2xyrz1yD4\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 09:03:54 +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 1wCQJD-0005Kh-Bd; Mon, 13 Apr 2026 19:03:11 -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 <richard.henderson@linaro.org>)\n id 1wCQJ8-0005In-De\n for qemu-devel@nongnu.org; Mon, 13 Apr 2026 19:03:07 -0400",
            "from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>)\n id 1wCQJ6-0005Aq-OU\n for qemu-devel@nongnu.org; Mon, 13 Apr 2026 19:03:06 -0400",
            "by mail-pg1-x536.google.com with SMTP id\n 41be03b00d2f7-c76bde70ec9so1965991a12.2\n for <qemu-devel@nongnu.org>; Mon, 13 Apr 2026 16:03:04 -0700 (PDT)",
            "from stoup.. ([2401:d002:dc0f:2100:377f:61ec:6edd:e205])\n by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b2d4db008esm120507675ad.16.2026.04.13.16.03.00\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 13 Apr 2026 16:03:02 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1776121383; x=1776726183; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=41ldc32dTmcHvnuwGdzz+RHjc7zQRZZM6Bre2zZ/YBk=;\n b=ZoSwiDR92LSajdBMH1u+QS+zxE75S7/TVwUTnDU9xcM5c0LxnEba6bJI6tpB2MclQV\n m3m1MTWMkOfuX2EA9HsgRRAU6W2+tE5RclBg80E6yGWfKEdAQ4dLezuss/mD6M9lQZ+L\n fYd9/Lo2wV6dXuv5VVv/gzjWXRcdiDdBRbqlJl4oZPFw13qpHKZDungpJbj/+R7JkH46\n G9nEYIoPmHFiET9h5XQKUK60xRmK3ExRDJ+lTWmAcVQScuqWXOM3UrC9fSPVcRO3c+S4\n f4RNiFeYfn/lg5CHz2fKApp4lHYjGt28QkdVJbISFScOU4xIh5cOuiVrbgcFudu7V6TY\n 4oSA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776121383; x=1776726183;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=41ldc32dTmcHvnuwGdzz+RHjc7zQRZZM6Bre2zZ/YBk=;\n b=b1V2Qd8g/crEBqcMyZj1Mytev8o2jg4NoXaKtcvhIOaB8eYlkU7hH+OEPzdfragXhx\n llDFnbOXhHA/vDiDrsoBbSVWnhKTkOGujQTn/CbKpNZKVjXYmtg6CNWc2yBm38/FY5Nx\n SOCEgHZQ19AyFfuTAT/4IDl15vwDAgLeNjhvjfXl3YK4mCyjrHXGrDtgvJkm6pqDs9lW\n jm2kdOXxqM0hnImElBlTNO8iJPgXuOE4fRbQW5IBMy8Bu/cP7B9jEYXZguEK6+lUIaR0\n MlcSA+Q8XMQa7PZLMxBcZ7hVWx5hRLnueXwmOXbb9Bc3ECDN5Wzgq6PpN0GBgu5A37Dp\n sF4w==",
        "X-Gm-Message-State": "AOJu0YzAlCoS4E4nZvbXzNkdExVGXMYig334n3C1MLWw8g/cpshc7Caj\n HRdnyV71Kx39zoQ2/1YrhuhmZd34p1eya8hlJq0a65EXwShh4ABfvURyFbg8EtQ+QEKHkHqOyqv\n 52zyXYwM=",
        "X-Gm-Gg": "AeBDieuO+/Z9OnWsaa9oosUo0W7LcMumF+JZfdCwoEl01Grh76HpffgJXKZQuWgV+id\n PP6fSt46GiftEsfTzNHNZGQv5bk0oeNNxsgXo+5TjEF/ag4xRsaH8pzL9Nq2J6+mdlbjq1qjYre\n +Qscd+xg4qosXpaX9uFtPyow+MORETgk8S443HNFnCZMoHjM7b0ADDsJygfHR/u9hqhr1Qq8y8J\n evlio1BwnocCFeekEhWqFDHfmOWxHnUCcD/zGazmq2YItoLfJeLsbxTsddTDIoj8Ut0OfCeEIdM\n 3jthn/3gVxAiymebiLXhABgQdU6BNbCOJprylUdVUUck0pGgvf3RMs/FuIWuOC9Vbb0f86Cg9Ht\n 0ezL7jOsktOytwf07qw7sYlRzJIJljG1GTJg1aj+jcQJVRFMhao4f0RVCLISCm/CBhk6ZyrmVS8\n uXCBtUG0/jnVoE32VJzZDa4w6Xv6wnLhLFIQbU43FtXKfF",
        "X-Received": "by 2002:a17:902:ee94:b0:2ae:cb0e:fd59 with SMTP id\n d9443c01a7336-2b2d591d25amr107701775ad.8.1776121383093;\n Mon, 13 Apr 2026 16:03:03 -0700 (PDT)",
        "From": "Richard Henderson <richard.henderson@linaro.org>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "qemu-arm@nongnu.org",
        "Subject": "[PATCH 2/3] linux-user/arm/nwfpe: Replace user_registers with\n current_cpu",
        "Date": "Tue, 14 Apr 2026 09:02:50 +1000",
        "Message-ID": "<20260413230251.22537-3-richard.henderson@linaro.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260413230251.22537-1-richard.henderson@linaro.org>",
        "References": "<20260413230251.22537-1-richard.henderson@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2607:f8b0:4864:20::536;\n envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.google.com",
        "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, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=unavailable 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": "Use the thread-local variable current_cpu instead of\na global variable to access the general registers.\nThis also means we don't need to pass env to EmulateAll.\n\nSigned-off-by: Richard Henderson <richard.henderson@linaro.org>\n---\n linux-user/arm/nwfpe/fpa11.h | 23 +++++++----------------\n linux-user/arm/cpu_loop.c    |  2 +-\n linux-user/arm/nwfpe/fpa11.c |  9 +--------\n 3 files changed, 9 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/linux-user/arm/nwfpe/fpa11.h b/linux-user/arm/nwfpe/fpa11.h\nindex d459c5da02..20f9d2eb81 100644\n--- a/linux-user/arm/nwfpe/fpa11.h\n+++ b/linux-user/arm/nwfpe/fpa11.h\n@@ -25,15 +25,6 @@\n \n #define GET_FPA11() (qemufpa)\n \n-/*\n- * The processes registers are always at the very top of the 8K\n- * stack+task struct.  Use the same method as 'current' uses to\n- * reach them.\n- */\n-extern CPUARMState *user_registers;\n-\n-#define GET_USERREG() (user_registers)\n-\n /* Need task_struct */\n //#include <linux/sched.h>\n \n@@ -91,25 +82,25 @@ void SetRoundingPrecision(const unsigned int);\n \n static inline unsigned int readRegister(unsigned int reg)\n {\n-    return (user_registers->regs[(reg)]);\n+    CPUARMState *env = cpu_env(current_cpu);\n+    return env->regs[reg];\n }\n \n static inline void writeRegister(unsigned int x, unsigned int y)\n {\n-#if 0\n-\tprintf(\"writing %d to r%d\\n\",y,x);\n-#endif\n-        user_registers->regs[(x)]=(y);\n+    CPUARMState *env = cpu_env(current_cpu);\n+    env->regs[x] = y;\n }\n \n static inline void writeConditionCodes(unsigned int x)\n {\n-    cpsr_write(user_registers, x, CPSR_NZCV, CPSRWriteByInstr);\n+    CPUARMState *env = cpu_env(current_cpu);\n+    cpsr_write(env, x, CPSR_NZCV, CPSRWriteByInstr);\n }\n \n #define ARM_REG_PC 15\n \n-unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, CPUARMState* qregs);\n+unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa);\n \n unsigned int EmulateCPDO(const unsigned int);\n unsigned int EmulateCPDT(const unsigned int);\ndiff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c\nindex 19874f4c72..262ab5cc41 100644\n--- a/linux-user/arm/cpu_loop.c\n+++ b/linux-user/arm/cpu_loop.c\n@@ -215,7 +215,7 @@ static bool insn_is_linux_bkpt(uint32_t opcode, bool is_thumb)\n static bool emulate_arm_fpa11(CPUARMState *env, uint32_t opcode)\n {\n     TaskState *ts = get_task_state(env_cpu(env));\n-    int rc = EmulateAll(opcode, &ts->fpa, env);\n+    int rc = EmulateAll(opcode, &ts->fpa);\n     int raise, enabled;\n \n     if (rc == 0) {\ndiff --git a/linux-user/arm/nwfpe/fpa11.c b/linux-user/arm/nwfpe/fpa11.c\nindex 0f1afbd91d..44783934b2 100644\n--- a/linux-user/arm/nwfpe/fpa11.c\n+++ b/linux-user/arm/nwfpe/fpa11.c\n@@ -30,7 +30,6 @@\n \n \n FPA11* qemufpa = NULL;\n-CPUARMState* user_registers;\n \n /* Reset the FPA11 chip.  Called to initialize and reset the emulator. */\n void resetFPA11(void)\n@@ -156,7 +155,7 @@ void SetRoundingPrecision(const unsigned int opcode)\n \n /* Emulate the instruction in the opcode. */\n /* ??? This is not thread safe.  */\n-unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, CPUARMState* qregs)\n+unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa)\n {\n   unsigned int nRc = 0;\n //  unsigned long flags;\n@@ -173,12 +172,6 @@ unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, CPUARMState* qregs)\n   }\n \n   qemufpa=qfpa;\n-  user_registers=qregs;\n-\n-#if 0\n-  fprintf(stderr,\"emulating FP insn 0x%08x, PC=0x%08x\\n\",\n-          opcode, qregs[ARM_REG_PC]);\n-#endif\n   fpa11 = GET_FPA11();\n \n   if (fpa11->initflag == 0)\t\t/* good place for __builtin_expect */\n",
    "prefixes": [
        "2/3"
    ]
}