Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2228803/?format=api
{ "id": 2228803, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2228803/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260427122742.210074-5-mkchauras@gmail.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/1.1/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/" }, "msgid": "<20260427122742.210074-5-mkchauras@gmail.com>", "date": "2026-04-27T12:27:38", "name": "[v5,4/8] powerpc: Introduce syscall exit arch functions", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "c769d91ed95a77330f277c8b3c879114b662fd34", "submitter": { "id": 92575, "url": "http://patchwork.ozlabs.org/api/1.1/people/92575/?format=api", "name": "Mukesh Kumar Chaurasiya", "email": "mkchauras@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260427122742.210074-5-mkchauras@gmail.com/mbox/", "series": [ { "id": 501638, "url": "http://patchwork.ozlabs.org/api/1.1/series/501638/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=501638", "date": "2026-04-27T12:27:34", "name": "Generic IRQ entry/exit support for powerpc", "version": 5, "mbox": "http://patchwork.ozlabs.org/series/501638/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2228803/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2228803/checks/", "tags": {}, "headers": { "Return-Path": "\n <linuxppc-dev+bounces-20163-incoming=patchwork.ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=Y+VYFkhm;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-20163-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)", "lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2607:f8b0:4864:20::430\"", "lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=Y+VYFkhm;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com\n (client-ip=2607:f8b0:4864:20::430; helo=mail-pf1-x430.google.com;\n envelope-from=mkchauras@gmail.com; receiver=lists.ozlabs.org)" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g42tB6SXjz1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 22:28:50 +1000 (AEST)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4g42tB5VVgz2yGX;\n\tMon, 27 Apr 2026 22:28:50 +1000 (AEST)", "from mail-pf1-x430.google.com (mail-pf1-x430.google.com\n [IPv6:2607:f8b0:4864:20::430])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4g42t96p13z2y2B\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 27 Apr 2026 22:28:49 +1000 (AEST)", "by mail-pf1-x430.google.com with SMTP id\n d2e1a72fcca58-827270d50d4so9088439b3a.3\n for <linuxppc-dev@lists.ozlabs.org>;\n Mon, 27 Apr 2026 05:28:49 -0700 (PDT)", "from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.ibm.com ([129.41.58.4])\n by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82f8e9f7735sm32733466b3a.21.2026.04.27.05.28.35\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 27 Apr 2026 05:28:47 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1777292930;\n\tcv=none;\n b=A+oE7YSJxv1ZyKe/Zd+2i2kN+65BwBcgWdc0eYBTLRA5inovxDGuGzMh+D7hOjyiV6fPuVfXqEzuuYfenZ8riS9OBilpAYseulVHEC+iYkfa7WnsLgY2OUIvEGmNmRz3f6WAUTPtQIbbCqSscQJEmQVacsRiDPuhEdeR/gqPV65o2KwdVU/HgfWOZTZwN9DuOqm8dA87v2JJQRXaYbKNGh2XJtXJ23AZ9aUNKzxqyxg+E6Gj3u4GarLfSmCTbaAWP0xEpTksGiRWGDDjBnXib+MHkDY8txsuFwCuYCTZ/D3k2P6WzjRMN2mJBYKAapz00hmuS18UF4cKRWk4NdbGWQ==", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1777292930; c=relaxed/relaxed;\n\tbh=Prf45VRePEkbJ9bJmHgdAkS/+1uEQpgga1mrG9S2bCY=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=kus5FbDA7DRBlgYZfcn/ezqMts23U33XLBz0+cU5L2fsCvJm9jRg0QccjdBwGxzcf1YaBpI5hAQ9bO2hUe5FIcv/zFBOse40dHPld7SFCBO0SYmyaPdwAdj7JeptwUFV250ubHIXujHFFqn+Rt4w3CkBw42hZm1f/hBCBxGADCcBLWUyPM5zsDZC2JNso5yZjN67E1apBoemi4YUBQ0Fv/JDXTJEhMSQeRr+rUga893pKRVipziPSviGXAgSGLw9t98xzqVAUq6z7MRjw5niwwkoDXeeAZRcH7/BmzXO47k8mXPOiAIOTzVWCpRIrABPa8XKDMQS+HdPvgnKQiyzLw==", "ARC-Authentication-Results": "i=1; lists.ozlabs.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com; dkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=Y+VYFkhm; dkim-atps=neutral;\n spf=pass (client-ip=2607:f8b0:4864:20::430; helo=mail-pf1-x430.google.com;\n envelope-from=mkchauras@gmail.com;\n receiver=lists.ozlabs.org) smtp.mailfrom=gmail.com", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777292928; x=1777897728;\n darn=lists.ozlabs.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=Prf45VRePEkbJ9bJmHgdAkS/+1uEQpgga1mrG9S2bCY=;\n b=Y+VYFkhmjWyfnf1XDZ4V+l3hrq0n97G6JUbugGcYtT683gyvyFdknIT3oLTKY0h+Tp\n GzdJLwdHvWfXvew6MZoDkp+T/4zhxg5B1+ddZWphxmhhpBzBZqna7ZN0T57hrBxyO0A+\n xQo+5a8jrpfz0WlioBP8uZJVUd+gGf4yUaflQdBkRrMFhr5yw442R4Tjz2sj/acBUT9X\n flZY4xDLezewhSc1jvFG17fV2GfQQMbQSXGJTt3NYdLuJpBxKjRYv9AtYisR6lXmxLmx\n mHsd0Oy7ZwUi2giItoDQjzX97ZCOmxPGpgXRadY4PqemhnNnoGfsQ9tf5FGpZPzlGAPX\n 90rQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777292928; x=1777897728;\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=Prf45VRePEkbJ9bJmHgdAkS/+1uEQpgga1mrG9S2bCY=;\n b=WmUFCN/WMdz67Qe8/YJ2eg6BV3395RDbu5lJ9doM3RwoTn+WjlKj10It4dRY9Qendu\n GMPJKocD8NlBzzMjueFi1cjdfH3HhjtRMWDDbjtyb1a/uKocHvAB3VQqSUDyvEwBc6oO\n 5hqnb8hEuMK5rCXnTLttjAPf3HPlw737yDkMgpz2JoJIl8FG+aw7VnKEDPo3L7NuX7ws\n QoNy1bnHYcXs0IQ/uaYSkwUYz5qKlu9ZdM2Dr1GSqWh6mwHAu+0rCnpNDgaqk9bw9wC+\n rkf4srkl9Bb8vHUaj1on4puAaKxfRzowO17vwQOSLgnz3zeAX7NrmMiIxq+UUy582NtV\n vFtQ==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ9Cj2LdC0HLz2wLUnrKTrCeHHinTIOQFTexeKtSopVu5NDPZIGUqAp1c9c1owgooR/uLdoLyOEd4SD+5eA=@lists.ozlabs.org", "X-Gm-Message-State": "AOJu0Yxx/mXIZk/ajbA2TLpbGdNJWq292wgbJVvi9WVDAUvpSunPSdxE\n\t2TMXszkjr05tNRicfGpofCAdarnXOsnrGKVNmHtJFuYYcgn7/cGECH2w", "X-Gm-Gg": "AeBDiesWn3ePnd8w2YTB/QJow/0PUv8rFVEPsFs8OA2Vohq9n647pVzq2hr57mk1Bq3\n\tvWUMvsSUfykokYbDpNoLkteYWU3b6pXpIiLfo6nFOJ2vtJit/iOd6/bKNiSaIUGA2KIpXLOYvGf\n\tIoX0y6LSXStZgqFLAzG5fkJShERbygVi46wJ20KEd8trMBSez4qcSHVEQSxdeH0qSxUYn0fRbne\n\tpYaq9DgkWwNJLKETe4jcsxF9HFyGHReJEA3Qt16xAnM59SrJaEB7hNJX7yZ0V8ygtZ6UW60qfXq\n\tWuWhZqxxYPc8QjKmH98eX7WIwsMbG9j4m7iqtTEveMcCzEULmx1KvSp4JcvCg6GCBvzJO+ED5X+\n\tgdW1anM5YMOQlR8ukppiuMmMmRpPz2AYFxN4DEjkHZrM7iyULj+b4e5TdkJjDHWc7ZyvD+RZnb2\n\tWfYXaogEJ5k+Wi2K7oVGWq5ls58isWvYmlQ7VcxxHqEi9xinoJTNK+tu2cqJFQ2Rt2I1TU8A9z+\n\thDpGj0R7qq034dC", "X-Received": "by 2002:a05:6a00:8b0f:b0:82f:c1b4:8ba2 with SMTP id\n d2e1a72fcca58-82fc1b4931emr20643060b3a.47.1777292928001;\n Mon, 27 Apr 2026 05:28:48 -0700 (PDT)", "From": "\"Mukesh Kumar Chaurasiya (IBM)\" <mkchauras@gmail.com>", "To": "maddy@linux.ibm.com,\n\tmpe@ellerman.id.au,\n\tnpiggin@gmail.com,\n\tchleroy@kernel.org,\n\tryabinin.a.a@gmail.com,\n\tglider@google.com,\n\tandreyknvl@gmail.com,\n\tdvyukov@google.com,\n\tvincenzo.frascino@arm.com,\n\toleg@redhat.com,\n\tkees@kernel.org,\n\tluto@amacapital.net,\n\twad@chromium.org,\n\tmchauras@linux.ibm.com,\n\tsshegde@linux.ibm.com,\n\tthuth@redhat.com,\n\truanjinjie@huawei.com,\n\takpm@linux-foundation.org,\n\tmacro@orcam.me.uk,\n\tldv@strace.io,\n\tcharlie@rivosinc.com,\n\tdeller@gmx.de,\n\tkevin.brodsky@arm.com,\n\tritesh.list@gmail.com,\n\tyeoreum.yun@arm.com,\n\tagordeev@linux.ibm.com,\n\tsegher@kernel.crashing.org,\n\tmark.rutland@arm.com,\n\tryan.roberts@arm.com,\n\tpmladek@suse.com,\n\tfeng.tang@linux.alibaba.com,\n\tpeterz@infradead.org,\n\tkan.liang@linux.intel.com,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tlinux-kernel@vger.kernel.org,\n\tkasan-dev@googlegroups.com", "Cc": "Samir M <samir@linux.ibm.com>,\n\tDavid Gow <davidgow@google.com>,\n\tVenkat Rao Bagalkote <venkat88@linux.ibm.com>", "Subject": "[PATCH v5 4/8] powerpc: Introduce syscall exit arch functions", "Date": "Mon, 27 Apr 2026 17:57:38 +0530", "Message-ID": "<20260427122742.210074-5-mkchauras@gmail.com>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260427122742.210074-1-mkchauras@gmail.com>", "References": "<20260427122742.210074-1-mkchauras@gmail.com>", "X-Mailing-List": "linuxppc-dev@lists.ozlabs.org", "List-Id": "<linuxppc-dev.lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev+help@lists.ozlabs.org>", "List-Owner": "<mailto:linuxppc-dev+owner@lists.ozlabs.org>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Archive": "<https://lore.kernel.org/linuxppc-dev/>,\n <https://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Subscribe": "<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>", "List-Unsubscribe": "<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>", "Precedence": "list", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Spam-Status": "No, score=-0.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tDKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,\n\tSPF_HELO_NONE,SPF_PASS autolearn=disabled version=4.0.1 OzLabs 8", "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org" }, "content": "From: Mukesh Kumar Chaurasiya <mchauras@linux.ibm.com>\n\nAdd PowerPC-specific implementations of the generic syscall exit hooks\nused by the generic entry/exit framework:\n\n - arch_exit_to_user_mode_work_prepare()\n - arch_exit_to_user_mode_work()\n\nThese helpers handle user state restoration when returning from the\nkernel to userspace, including FPU/VMX/VSX state, transactional memory,\nKUAP restore, and per-CPU accounting.\n\nAdditionally, move check_return_regs_valid() from interrupt.c to\ninterrupt.h so it can be shared by the new entry/exit logic.\n\nNo functional change is intended with this patch.\n\nSigned-off-by: Mukesh Kumar Chaurasiya <mchauras@linux.ibm.com>\nTested-by: Samir M <samir@linux.ibm.com>\nTested-by: David Gow <davidgow@google.com>\nTested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>\nReviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>\n---\n arch/powerpc/include/asm/entry-common.h | 49 +++++++++++++++++++++++++\n 1 file changed, 49 insertions(+)", "diff": "diff --git a/arch/powerpc/include/asm/entry-common.h b/arch/powerpc/include/asm/entry-common.h\nindex 837a7e020e82..ff0625e04778 100644\n--- a/arch/powerpc/include/asm/entry-common.h\n+++ b/arch/powerpc/include/asm/entry-common.h\n@@ -6,6 +6,7 @@\n #include <asm/cputime.h>\n #include <asm/interrupt.h>\n #include <asm/stacktrace.h>\n+#include <asm/switch_to.h>\n #include <asm/tm.h>\n \n static __always_inline void booke_load_dbcr0(void)\n@@ -123,4 +124,52 @@ static __always_inline void arch_enter_from_user_mode(struct pt_regs *regs)\n \n #define arch_enter_from_user_mode arch_enter_from_user_mode\n \n+static inline void arch_exit_to_user_mode_prepare(struct pt_regs *regs,\n+\t\t\t\t\t\t unsigned long ti_work)\n+{\n+\tunsigned long mathflags;\n+\n+\tif (IS_ENABLED(CONFIG_PPC_BOOK3S_64) && IS_ENABLED(CONFIG_PPC_FPU)) {\n+\t\tif (IS_ENABLED(CONFIG_PPC_TRANSACTIONAL_MEM) &&\n+\t\t unlikely((ti_work & _TIF_RESTORE_TM))) {\n+\t\t\trestore_tm_state(regs);\n+\t\t} else {\n+\t\t\tmathflags = MSR_FP;\n+\n+\t\t\tif (cpu_has_feature(CPU_FTR_VSX))\n+\t\t\t\tmathflags |= MSR_VEC | MSR_VSX;\n+\t\t\telse if (cpu_has_feature(CPU_FTR_ALTIVEC))\n+\t\t\t\tmathflags |= MSR_VEC;\n+\n+\t\t\t/*\n+\t\t\t * If userspace MSR has all available FP bits set,\n+\t\t\t * then they are live and no need to restore. If not,\n+\t\t\t * it means the regs were given up and restore_math\n+\t\t\t * may decide to restore them (to avoid taking an FP\n+\t\t\t * fault).\n+\t\t\t */\n+\t\t\tif ((regs->msr & mathflags) != mathflags)\n+\t\t\t\trestore_math(regs);\n+\t\t}\n+\t}\n+\n+\tcheck_return_regs_valid(regs);\n+#ifdef CONFIG_PPC_TRANSACTIONAL_MEM\n+\tlocal_paca->tm_scratch = regs->msr;\n+#endif\n+\t/* Restore user access locks last */\n+\tkuap_user_restore(regs);\n+}\n+\n+#define arch_exit_to_user_mode_prepare arch_exit_to_user_mode_prepare\n+\n+static __always_inline void arch_exit_to_user_mode(void)\n+{\n+\tbooke_load_dbcr0();\n+\n+\taccount_cpu_user_exit();\n+}\n+\n+#define arch_exit_to_user_mode arch_exit_to_user_mode\n+\n #endif /* _ASM_PPC_ENTRY_COMMON_H */\n", "prefixes": [ "v5", "4/8" ] }