From nobody Fri Oct 3 07:40:42 2025 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7329936809D for ; Wed, 3 Sep 2025 18:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756925624; cv=none; b=eg8pnF4IseIJqwXbUV97yuH2z8UINfLHZcvRxaI80Iorg9tTKUZoc9iAXu/geeztfTPHYv3Ch2AX9ht+VT7EnPfuxdaULlorGhXJrsW/M7m7tcAbJL+I8FKxWgny3G7SSUP9kdr7v42vb+m2IycL/p0Gzb2HGZVi3HwkesqDv0o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756925624; c=relaxed/simple; bh=tb01GjZKeVYDMqeiQU+MbdxDJ+LoCTMzjQNhhcNJEgk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dQB5tUdPWUEG+lYwh/ccthUB9XhAyDZZ+jpEV1DhOksYmGdE1aVd2LIMBPDDehoa6C3pMI/94CvBqPdr0QBusolQzObqnnX7QynRvxLjYvYtJKB0c3u7yzIbXho7ssTqOrE+IvUl+ExnO93bMUl6PLDDO0yjmcemif03vGS51Ro= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc.com header.i=@rivosinc.com header.b=cCSDia/8; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc.com header.i=@rivosinc.com header.b="cCSDia/8" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-45b8b8d45b3so2448815e9.1 for ; Wed, 03 Sep 2025 11:53:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc.com; s=google; t=1756925620; x=1757530420; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AquE8JHU3wpKOnx9hZ4dVcOYBLYMLbey8qkeKp2ZqhQ=; b=cCSDia/862o+r4MP6gHZ1kvpUMik4dc++H5ox7ra2ujjjSyMZECoPUp6AXcxwz0Dy2 FuATVK7TL8b5OKcGuNrER1+PYUx+H6mFgtaBnDQ2OSdTudPvFBkQGGR9ddLz8hIl0QPa y1judUKKgTsJa28VQyVnHD+UBiA9giwQpCOQqKWaihNBO4fdJlnadWuDf0XSKMH8pWe/ cXL3fFonPEo6w+bAbGoCtTNl/neCA9COFp5/T4N/5CbdYoDrDGwiXGqSjqYXl6mRY3HB +PEPvAvH6ju8G3IqEqCsZ+0C16Gjo0QZk1902p7HF6nyKR4VBRDZlRg9AWbnT3B4B2GS I8og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756925620; x=1757530420; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AquE8JHU3wpKOnx9hZ4dVcOYBLYMLbey8qkeKp2ZqhQ=; b=CWDnp4vA+mxlioKeff4cG4hj4mq9t9Jzz1/vF1LQDUi6W5bROjvGlJIon4KZvFcFtb 0CidAwXdI5WE9mdZiWB6t/4f6DmA3UR0r6g3XawiPBQGhA1flXrtrePP2ZZj38/cvDw6 TjpaqeTpd7ls4ygqmuNRem3bj2pUfb9Q+XQ09gFTkKu64HqlSoLVRggZTbrS17ZflrbP 0psKlMKqKS/V+cbZnNjrC9WiQTvjSl6tZAdPPCRW6WrVflmqNu/GRzPJebt3OR1Sv/LP GBqygQ4qVBgAuEy/CazJvGXX+eACwAvKZLRRNeg7IaVrwEHH0ebJNzGu049NM8JaAxjg IZZQ== X-Forwarded-Encrypted: i=1; AJvYcCXjGPEwwCHnbv6zGWZ6FzExMAwREO3SacLkqCPKTBNUYaJ/dflovp0zQ8oLeW+xUjZOVW6jzJaLLnXPnUM=@vger.kernel.org X-Gm-Message-State: AOJu0YyLfdhATo1k8CerOwEJhmxnuimHIt6KUxPVSyoogTd6GAuo21Fd 3L6w/UPhhPdyfNyjUPFzocYaRTJW1JVpZEHcIbQLurieWk2RKvyzBSou7NYD/h34I5g= X-Gm-Gg: ASbGncuVemYPoZb1fOlUnoH9GC/aXMBVsIuY/hiUxO+GWbjy5STrZIA+Zjvv1QQ2YDq HlKnscGfQgCfBVKdf8IJ75MkYNa9KnGY3SDSe9EZtFcBTQ5XLVtZB/alliLLoNs+te+rKP3nP9e rTF3tvTFO0fh97G8rIM0WVkKrDVejZ4DOsIzwPhPjHckYlJmym+uVTPRf0MlaKw7eA+1ZhA+dBa Lr1R1iGP141yTr61hwQvmQU+QTVl8rhNl6Lc5+Nx42zWhlOvM8gTXAAqfLnotoNWWfw5SZ18W42 K6QCLK4FwLvewy5l5zuh95nRt/5mLhmzG8W2zDgY4U79KDZT5MMuWQO1rfxmYFgVsioyoGnFzaO 11jFTDsfyXcagcCJssb6dNAXT36Y152YPlJY8+rM5JamOaJkVu7t6cV8VxvoWQ6HL8iHosCWaJb a+v4S/ X-Google-Smtp-Source: AGHT+IERl6smvjSqMpuCaH/LYojC/JM0ih8kKGx0MImSuDXXr6hrLMvQiHu6Ro0U1pMEYuo7OfIbrQ== X-Received: by 2002:a05:600c:4f8f:b0:456:f1e:205c with SMTP id 5b1f17b1804b1-45b85550704mr136866395e9.4.1756925620576; Wed, 03 Sep 2025 11:53:40 -0700 (PDT) Received: from alexghiti.eu.rivosinc.com (alexghiti.eu.rivosinc.com. [141.95.202.232]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3d690f2edf1sm13920647f8f.16.2025.09.03.11.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Sep 2025 11:53:40 -0700 (PDT) From: Alexandre Ghiti Date: Wed, 03 Sep 2025 18:53:08 +0000 Subject: [PATCH 1/2] riscv: Fix sparse warning in __get_user_error() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250903-dev-alex-sparse_warnings_v1-v1-1-7e6350beb700@rivosinc.com> References: <20250903-dev-alex-sparse_warnings_v1-v1-0-7e6350beb700@rivosinc.com> In-Reply-To: <20250903-dev-alex-sparse_warnings_v1-v1-0-7e6350beb700@rivosinc.com> To: kernel test robot , Al Viro , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Cyril Bur , Jisheng Zhang Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Ghiti , stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1106; i=alexghiti@rivosinc.com; h=from:subject:message-id; bh=tb01GjZKeVYDMqeiQU+MbdxDJ+LoCTMzjQNhhcNJEgk=; b=owGbwMvMwCGWYr9pz6TW912Mp9WSGDJ29G3SnJAmn34r1vLZRsOeyyGHZpo9PH76uxIva6PxS 96P+1d7dJSyMIhxMMiKKbIomCd0tdifrZ/959J7mDmsTCBDGLg4BWAibocZ/kcbd8yp174kdHxF 6sf3i4o/3NqR2Hv9xkQ9ebk5od7bdN0Y/gd3lPq5tRpbKH/3+XHc/Xu55pram/3feFas3LDyk63 JcX4A X-Developer-Key: i=alexghiti@rivosinc.com; a=openpgp; fpr=DC049C97114ED82152FE79A783E4BA75438E93E3 We used to assign 0 to x without an appropriate cast which results in sparse complaining when x is a pointer: >> block/ioctl.c:72:39: sparse: sparse: Using plain integer as NULL pointer So fix this by casting 0 to the correct type of x. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202508062321.gHv4kvuY-lkp@int= el.com/ Fixes: f6bff7827a48 ("riscv: uaccess: use 'asm_goto_output' for get_user()") Cc: stable@vger.kernel.org Signed-off-by: Alexandre Ghiti Reviewed-by: Cl=C3=A9ment L=C3=A9ger Reviewed-by: Cyril Bur --- arch/riscv/include/asm/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/uaccess.h b/arch/riscv/include/asm/uacc= ess.h index 22e3f52a763d1c0350e8185225e4c99aac3fc549..551e7490737effb2c238e6a4db5= 0293ece7c9df9 100644 --- a/arch/riscv/include/asm/uaccess.h +++ b/arch/riscv/include/asm/uaccess.h @@ -209,7 +209,7 @@ do { \ err =3D 0; \ break; \ __gu_failed: \ - x =3D 0; \ + x =3D (__typeof__(x))0; \ err =3D -EFAULT; \ } while (0) =20 --=20 2.34.1 From nobody Fri Oct 3 07:40:42 2025 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B2053680A8 for ; Wed, 3 Sep 2025 18:53:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756925625; cv=none; b=DUzZCQLv9SlwCmMZ5DRCofJZYvPtXOKN7X69NY7d7mYqR5c0NQlo6+Vng1HJ+PhXf69X2hXyHBmpxzhkC2BIMeI7/11wWCXDOdn8HHWlm9zZgusIMkG6mlTo+A6rp4F393AtRxBSgqNUo6r8HwKBpWd+woFUwIBz8FpV7ynES4k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756925625; c=relaxed/simple; bh=WwDwWn8PUMqzNmPRX5AJQr10TNESZyHkO/C2KBJ6k40=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nAHC1lNDpQAWqMByF9okbZXgKHSHJEyyP2AlA2OeKS5V5nwm9eUrHHK6z0ndwnCy74eDQbhG5nlk1xsDnDcP1M5CskDIWz208u7R1eXh6EjUlwK5EFX28I+sk36Ep/tm5Zrp4IiIP0yspW4hwvv1owM/YKnANgNWsa0hI/OXaWQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc.com header.i=@rivosinc.com header.b=HFdRjX2m; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc.com header.i=@rivosinc.com header.b="HFdRjX2m" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-3df3be0e098so150380f8f.1 for ; Wed, 03 Sep 2025 11:53:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc.com; s=google; t=1756925621; x=1757530421; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=jw9BHN0FeRhOuxnLyFuwgicmhR7Ua+FygQwocs16V4c=; b=HFdRjX2m+hw1pG9m2pDERobYQRW3I0p1KwV4T/VWdoK++FP5/8fWHgCcnxpjV6qROd vk5bgaBw0PCDyubHlmypfN7tuAOsfseNg8FwHeVzUItsOBJRUvC1/j2eMGBOx93n96s4 dtJW8LA2ZuRa/9q2SxidIwifv/O0H3xCERQ02XWDsc+6UUOOplsNo3E8uD91wx3JDdqh UgQY/Fjz2K69d5cpaYzJWiplnXS+vlTIKNjW74LLNj1PkJkNvLZTHCbfv5qSqTc3Rah7 Db8wR6xLW7ZsquaGi21r0njmbuRflTkQxfCe8+HHvfNaxG23hBfAiVeC6OP6jWqPt1r5 F6gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756925621; x=1757530421; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jw9BHN0FeRhOuxnLyFuwgicmhR7Ua+FygQwocs16V4c=; b=CcDJ/5GtBuqps4tKu5tWht/AjMiGutCJWTkCT1o6flBGIGXR3cCPixM+Vm06buPn+P WuiyIYDCX0hlJWQhSfxhX1ezezcqiWpddO970AIS2GoEZYqjUvOPTv1z6bJtQYyhK+dg R0xwO4GH6JEaAoxGONR4hG2MxO7NwKVDGJv1e0MbJxo0JHOUGZPuz8SmeeCP+SCCM1V6 1hKkardQ9hU9mgFX9Tb2d9dofJZu/6X9ZNbzczs6ZFg/nwUTyr0pcCN2lKIzMGvn3HXx zqWMoiJe4mOW0H0at9Z81f9UGyonYkN/hQM2Z4bHHVKdtEp0lWtUpHYbhS4JJeiWKjDE Fi4Q== X-Forwarded-Encrypted: i=1; AJvYcCVbI+U9XSYrdQqtZILyucfVdEegGDK7kZARhnGXlekmckOCqbskwM5diPRGfwcyG3EuL9atCSBbuDCdoeE=@vger.kernel.org X-Gm-Message-State: AOJu0YxBLyDKFeJl7/dd6fZPmET/ZpiHVShXgGQ/S92N/RoxvlE7ScIS pYNqfPGlSSdCK/tq38Jnzky+LNILwrpvTLwC0Ay6XDic9xKeHLQIb3mFBR+htvo0PeM= X-Gm-Gg: ASbGnct3GM9Uh0aGlNJUTfZtgy5t4jgs+ZOF7D9HEV6HbpITWcn/pZ4zmEJMPurnZGw ytEhm9OBxgZk75+CtrS2wsoIzId1Vl5GOyImz9X0ZYrXFnHGCfrVvLsSrpMQb0c/L3bONkPU8s7 3M9aghrZDiLALcTBDG80qi+BShKBlPyGrexWrRZIScMfnDtyNlkTqmekJk/4nNjk2eZRk3Uujvr 81M2HhvgDJxHKCRkGkMO27JmeLhbvMrA0JXg2FDy9sTykY+m/+g6aFpxjUkHoiDnPm2a2NW5H8q xIpTkyULJ0XjPzJOp4ME+W0ZFkPXPI5XJyDz4Is7bPKGwLLnJYxIAu7DmTawvESObQLJ4jOv59g CYCBuFd+pAQKuk4ZA8iZ3BepVRuJK36YwsDDlVE+IQjucaSm463LJ3tO9VJUoU7woTxVlqZ0jy5 p7ID4MgD8i4YQbVmg= X-Google-Smtp-Source: AGHT+IHOk7OXAl6oV2267O8szo6YMPylYzzI4Dr46hL2gWcdyGl5LwYgLiSHECqfj11Wp5eTPIQCDQ== X-Received: by 2002:a05:6000:2381:b0:3d7:cd09:ae1e with SMTP id ffacd0b85a97d-3d7cd09b425mr7585878f8f.17.1756925621431; Wed, 03 Sep 2025 11:53:41 -0700 (PDT) Received: from alexghiti.eu.rivosinc.com (alexghiti.eu.rivosinc.com. [141.95.202.232]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3d690f2edf1sm13920647f8f.16.2025.09.03.11.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Sep 2025 11:53:40 -0700 (PDT) From: Alexandre Ghiti Date: Wed, 03 Sep 2025 18:53:09 +0000 Subject: [PATCH 2/2] riscv: Fix sparse warning about different address spaces Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250903-dev-alex-sparse_warnings_v1-v1-2-7e6350beb700@rivosinc.com> References: <20250903-dev-alex-sparse_warnings_v1-v1-0-7e6350beb700@rivosinc.com> In-Reply-To: <20250903-dev-alex-sparse_warnings_v1-v1-0-7e6350beb700@rivosinc.com> To: kernel test robot , Al Viro , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Cyril Bur , Jisheng Zhang Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Ghiti , stable@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1897; i=alexghiti@rivosinc.com; h=from:subject:message-id; bh=WwDwWn8PUMqzNmPRX5AJQr10TNESZyHkO/C2KBJ6k40=; b=owGbwMvMwCGWYr9pz6TW912Mp9WSGDJ29G2qCX+T9j37/c+fnfq7dTqqNA5eXy6TvlXmVMS7P PGnVtNsOkpZGMQ4GGTFFFkUzBO6WuzP1s/+c+k9zBxWJpAhDFycAjARwV0M/xQO+NxrPcCz4seK jYcYj+6IT7lUv6Ak6sOCQHb/cyx8fr8Y/hc0d90o7N7GUtb3nifIusPw69mPluJuU+yUKnK7Jl9 p5gUA X-Developer-Key: i=alexghiti@rivosinc.com; a=openpgp; fpr=DC049C97114ED82152FE79A783E4BA75438E93E3 We did not propagate the __user attribute of the pointers in __get_kernel_nofault() and __put_kernel_nofault(), which results in sparse complaining: >> mm/maccess.c:41:17: sparse: sparse: incorrect type in argument 2 (differ= ent address spaces) @@ expected void const [noderef] __user *from @@ = got unsigned long long [usertype] * @@ mm/maccess.c:41:17: sparse: expected void const [noderef] __user *fr= om mm/maccess.c:41:17: sparse: got unsigned long long [usertype] * So fix this by correctly casting those pointers. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202508161713.RWu30Lv1-lkp@int= el.com/ Suggested-by: Al Viro Fixes: f6bff7827a48 ("riscv: uaccess: use 'asm_goto_output' for get_user()") Cc: stable@vger.kernel.org Signed-off-by: Alexandre Ghiti Reviewed-by: Cl=C3=A9ment L=C3=A9ger Reviewed-by: Cyril Bur --- arch/riscv/include/asm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/include/asm/uaccess.h b/arch/riscv/include/asm/uacc= ess.h index 551e7490737effb2c238e6a4db50293ece7c9df9..f5f4f7f85543f2a635b18e4bd1c= 6202b20e3b239 100644 --- a/arch/riscv/include/asm/uaccess.h +++ b/arch/riscv/include/asm/uaccess.h @@ -438,10 +438,10 @@ unsigned long __must_check clear_user(void __user *to= , unsigned long n) } =20 #define __get_kernel_nofault(dst, src, type, err_label) \ - __get_user_nocheck(*((type *)(dst)), (type *)(src), err_label) + __get_user_nocheck(*((type *)(dst)), (__force __user type *)(src), err_la= bel) =20 #define __put_kernel_nofault(dst, src, type, err_label) \ - __put_user_nocheck(*((type *)(src)), (type *)(dst), err_label) + __put_user_nocheck(*((type *)(src)), (__force __user type *)(dst), err_la= bel) =20 static __must_check __always_inline bool user_access_begin(const void __us= er *ptr, size_t len) { --=20 2.34.1