{"id":2228356,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2228356/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260426085725.2090827-6-mkchauras@gmail.com/","project":{"id":2,"url":"http://patchwork.ozlabs.org/api/1.1/projects/2/?format=json","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":"<20260426085725.2090827-6-mkchauras@gmail.com>","date":"2026-04-26T08:57:23","name":"[V14,5/7] rust: Make __udivdi3() and __umoddi3() panic","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"bac85ffb606b7053a0f48d73d160b9aa62b8a6f7","submitter":{"id":92575,"url":"http://patchwork.ozlabs.org/api/1.1/people/92575/?format=json","name":"Mukesh Kumar Chaurasiya","email":"mkchauras@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260426085725.2090827-6-mkchauras@gmail.com/mbox/","series":[{"id":501515,"url":"http://patchwork.ozlabs.org/api/1.1/series/501515/?format=json","web_url":"http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=501515","date":"2026-04-26T08:57:18","name":"Rust support for powerpc","version":14,"mbox":"http://patchwork.ozlabs.org/series/501515/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2228356/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2228356/checks/","tags":{},"headers":{"Return-Path":"\n <linuxppc-dev+bounces-20110-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=d0ylMLxf;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:21b9:f100::1; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-20110-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::1036\"","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=d0ylMLxf;\n\tdkim-atps=neutral","lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com\n (client-ip=2607:f8b0:4864:20::1036; helo=mail-pj1-x1036.google.com;\n envelope-from=mkchauras@gmail.com; receiver=lists.ozlabs.org)"],"Received":["from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:21b9:f100::1])\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 4g3LGH1c6wz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 26 Apr 2026 18:58:47 +1000 (AEST)","from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4g3LGH0Xhxz2yqc;\n\tSun, 26 Apr 2026 18:58:47 +1000 (AEST)","from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com\n [IPv6:2607:f8b0:4864:20::1036])\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 4g3LGG2V31z2yqT\n\tfor <linuxppc-dev@lists.ozlabs.org>; Sun, 26 Apr 2026 18:58:46 +1000 (AEST)","by mail-pj1-x1036.google.com with SMTP id\n 98e67ed59e1d1-35fb166b0c6so4960150a91.0\n        for <linuxppc-dev@lists.ozlabs.org>;\n Sun, 26 Apr 2026 01:58:46 -0700 (PDT)","from li-1a3e774c-28e4-11b2-a85c-acc9f2883e29.ibm.com.com\n ([106.51.164.157])\n        by smtp.gmail.com with ESMTPSA id\n 98e67ed59e1d1-36141868906sm27718937a91.3.2026.04.26.01.58.32\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Sun, 26 Apr 2026 01:58:43 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1777193926;\n\tcv=none;\n b=KHFDx9SRDGOKKFlmZyvRS27A4KAd1HY2eMYGnK/blEiHtOj/CEOqGjf+6ThC983m5qKSJlrBXB/UBR8X0DCOdfNeYOuZnGyq1EW1DRq8NqAN2+H54e2UPLTPLHXd3DPSAQDaLuViQlF8xvaFT/wenwkIihGMLeUCdUrRxepY4dcSCCl2uUTfELrcVuKuAaoV+9fecRkAf90dnTC1SnkuNlvXg3Qz4UT4vN5wfaT6R4jphJFhwxnqHAsqWr+ihlpDoZqbg5oN1beYkpi2b8+UQkSCZdRx91kqc4ZdBlK6EFFca7w6XnyBlKRG6y8ay5gQuuIwJzJHgvyUD6DQL/M/xQ==","ARC-Message-Signature":"i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1777193926; c=relaxed/relaxed;\n\tbh=9SYhnvPVAJd1oaQ7E3w3ymi0iyxJM6QAUXA089o3vB8=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=oPVmulQrRnRP/s0TFuuCGE95UqllZHzcFQimmgJI2XssRukFLkW5tJ33iu/b20FnWj+DvyQTVeWBl9DVBOsTF9Xeu6JnHdC/QKjPhA25d/u57ztGfkV5XNXbN6F4vuSEy91XoB2NZ5pZemTUpQGO1PK741eXRM9xRvj1Xh9Htk+L5SilsjcVaBOUDJxypWtDLyrbqT5Jm8PQDDWoUuhJjCWXOqgiZqGX6jMODqu7dv0lhVsOA36UypQAlVdqkOS7tNFqkrkfUoBuBO+dsixn9/UP+JoOVpCsUgZcgZ+7zpOFc9hPzq3hibDtwYyCARGUKDenwdLFfWi9ZbsUmLKylw==","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=d0ylMLxf; dkim-atps=neutral;\n spf=pass (client-ip=2607:f8b0:4864:20::1036; helo=mail-pj1-x1036.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=1777193924; x=1777798724;\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=9SYhnvPVAJd1oaQ7E3w3ymi0iyxJM6QAUXA089o3vB8=;\n        b=d0ylMLxfHQYUAgjriyalmh+aXwbmBF78SFyH5lyBitte9J5JkzcUfpyqPwVGQ6SGrE\n         ldEdqFbzOqXkNPIVilQV2QdWPMgnZ8DR0Cy3/QuNSaO6LK1LK8rUxD8m6LAVYVE7sy7q\n         UNzU6nHogo2tUrg2/aG3nyCQYwDtwNSHa4lAs7Ugvgxh6+1RtSK9hkT2Ddj67eYaxwjO\n         6/7G953xyqx53lI6SwHDV++FhEEGxPUiPFDaxDpxKhsnZOcTBiSlg5inqrXtsMTyjP2A\n         i/FbGgqCvYnEeQMwPKM+SCJDRcEYWqbQwf6Q8cyfEdCDfIKZihIEkL0Vucs0f+3eE/24\n         4inA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1777193924; x=1777798724;\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=9SYhnvPVAJd1oaQ7E3w3ymi0iyxJM6QAUXA089o3vB8=;\n        b=WKAMvVp0XkJertPEyY/lln6f/YRMawPr3Mufi100c1XhPBNotHlbJzadjK8Rhwqibj\n         kaVd9jmyoVaWsZtAXOJv7F3i1ZjFfwhkQjvd12HVJNxGL3zGbW9niQYEq7mF6k4B92Xp\n         GLqe2C0OhN5KSS5SidZeRe/CTC4bCGmrXZB/Jbx6ytj8wR/mLD6KYy4ES6JdT+Np4niQ\n         PlueJyx98wGFqTE5BwkvXxf7cinx4g1GBfFcI0nsuz8fC6lqMmwcfSf/DuG7Bx7WS6h4\n         SZ8M4CFDNHR4qbdyhgYmqgdZyNhqdaSDWK1hgV05o0gS566Xzr+JB4MuW4PbzNma5X1G\n         nSiw==","X-Forwarded-Encrypted":"i=1;\n AFNElJ8/ODASqUXpEHxg9a8T6/B0Al5WsiJaXUFoGVqJ3jEWKnRNXS97O6h+wGBhXO3hIEPxI+Ti/N1li4wGMZI=@lists.ozlabs.org","X-Gm-Message-State":"AOJu0YyKgHHC/G1BZ0asFyTvuxhJnszvUhKMK/iycdUARkHzqrxUrKUV\n\tjC3Wavx9xcki/Eo5gvG7oizeaZcVPyoKyum36xXVd/y1A8B5XXqagQa3","X-Gm-Gg":"AeBDieutcrMjcVMN6VFTpL3CQKds5+nmwRsEiWBdCKU29qMQc5ZDsjnFEUgUE5nRofs\n\tJFeL57i5G1eVJurwwsBrEpyYYTCdW0DHGrG/QqxDn+1cNTB4xX4QmuRBO+f8iorqxSxcvx2nhqp\n\t06o29qqY9zWfE4Se24jTOKqdheUo2EtozCkn27dN8OTcVCThL/uNWy1w6re34unHEiTwpt9fn4j\n\tvLVJEGnuYAwR2LBTC6jXfo9IL2WVSnNmFDwW+cPj9fKTv07jxlF1HnV2fAAYPrl/rmtd2talELH\n\tyNq5GGc+EBIc7t1hLH8gEebxesA6mfSuqzXLaznj1AdPP98rCr4C0AWDjtr2rY1ZARoe6+GV9g7\n\tdKyxXHWfIYhI0ZUrdrf2Q7FWacBqfhmT3NDNaikknMGLjbgBUXZWVpvkqzPuhjsIeApkujciwYZ\n\tVl3wvH+Jhwf4qX/CMDQPiS1V825ZfuFdAy9GnTbZMgoONvKYxmhn5x0n+5+i+LsAlaUMSlX/tL3\n\te3FF4iQOlaFpPM=","X-Received":"by 2002:a17:90b:52cf:b0:35f:b9f1:fded with SMTP id\n 98e67ed59e1d1-361402edcc2mr27986180a91.12.1777193924145;\n        Sun, 26 Apr 2026 01:58:44 -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\tpeterz@infradead.org,\n\tjpoimboe@kernel.org,\n\tjbaron@akamai.com,\n\taliceryhl@google.com,\n\trostedt@goodmis.org,\n\tardb@kernel.org,\n\tojeda@kernel.org,\n\tboqun@kernel.org,\n\tgary@garyguo.net,\n\tbjorn3_gh@protonmail.com,\n\tlossin@kernel.org,\n\ta.hindborg@kernel.org,\n\ttmgross@umich.edu,\n\tdakr@kernel.org,\n\tnathan@kernel.org,\n\tnick.desaulniers+lkml@gmail.com,\n\tmorbo@google.com,\n\tjustinstitt@google.com,\n\tdaniel.almeida@collabora.com,\n\tfujita.tomonori@gmail.com,\n\tviresh.kumar@linaro.org,\n\tprafulrai522@gmail.com,\n\tgregkh@linuxfoundation.org,\n\tarnd@arndb.de,\n\ttamird@kernel.org,\n\tmkchauras@gmail.com,\n\tlyude@redhat.com,\n\tairlied@gmail.com,\n\tj@jannau.net,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tlinux-kernel@vger.kernel.org,\n\trust-for-linux@vger.kernel.org,\n\tllvm@lists.linux.dev","Cc":"Link Mauve <linkmauve@linkmauve.fr>","Subject":"[PATCH V14 5/7] rust: Make __udivdi3() and __umoddi3() panic","Date":"Sun, 26 Apr 2026 14:27:23 +0530","Message-ID":"<20260426085725.2090827-6-mkchauras@gmail.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260426085725.2090827-1-mkchauras@gmail.com>","References":"<20260426085725.2090827-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-Type":"text/plain; charset=UTF-8","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: Link Mauve <linkmauve@linkmauve.fr>\n\nThe core crate currently depends on these two functions for i64/u64/\ni128/u128/core::time::Duration formatting, but we shouldn’t use that in\nthe kernel so let’s panic if they are ever called.\n\nThis doesn’t yet fix drm_panic_qr.rs, which also uses __udivdi3 when\nCONFIG_CC_OPTIMIZE_FOR_SIZE=y, but at least makes the rest of the kernel\nbuild on PPC32.\n\nSigned-off-by: Link Mauve <linkmauve@linkmauve.fr>\nSigned-off-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>\n---\n rust/Makefile             | 4 ++++\n rust/compiler_builtins.rs | 6 ++++++\n 2 files changed, 10 insertions(+)","diff":"diff --git a/rust/Makefile b/rust/Makefile\nindex f6369d121c50..9aa18cff2fae 100644\n--- a/rust/Makefile\n+++ b/rust/Makefile\n@@ -615,6 +615,10 @@ ifneq ($(or $(CONFIG_ARM64),$(and $(CONFIG_RISCV),$(CONFIG_64BIT))),)\n \t\t__ashrti3 \\\n \t\t__ashlti3 __lshrti3\n endif\n+ifdef CONFIG_PPC32\n+\tredirect-intrinsics += \\\n+\t\t__udivdi3 __umoddi3\n+endif\n \n ifdef CONFIG_MODVERSIONS\n cmd_gendwarfksyms = $(if $(skip_gendwarfksyms),, \\\ndiff --git a/rust/compiler_builtins.rs b/rust/compiler_builtins.rs\nindex dd16c1dc899c..fc6b54636dd5 100644\n--- a/rust/compiler_builtins.rs\n+++ b/rust/compiler_builtins.rs\n@@ -97,5 +97,11 @@ pub extern \"C\" fn $ident() {\n     __aeabi_uldivmod,\n });\n \n+#[cfg(target_arch = \"powerpc\")]\n+define_panicking_intrinsics!(\"`u64` division/modulo should not be used\", {\n+    __udivdi3,\n+    __umoddi3,\n+});\n+\n // NOTE: if you are adding a new intrinsic here, you should also add it to\n // `redirect-intrinsics` in `rust/Makefile`.\n","prefixes":["V14","5/7"]}