From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 474CFFD0078 for ; Sun, 1 Mar 2026 21:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0PrzIxa4oavWub6Pr1kChKeg5EcpTz/Ehf0Dub9PsSY=; b=Wa82rrFhzCDgFt /ukSGpFrx7URWl6APyvhOtNj2UjifF06i9/Fzm7mpRuVwdRN21RArKnq0zP5urleqcROaTpWhn/bI /KhzVnSQsYpIK5wCfEdJPMTbEfJL1eei2H8cWVl1gyssv9Tpgd1+9Sk6uTUNt5Cs7+Ta9jZdpN4jK VWjxnkQ7yLfHo2w4hNpnSPn/I4c6DFSLtyav1shO+VL+iAvUg8XvOpruZuNTIQYvBYmxGnm55yj7/ gZ9TnA0SLjS+32uH90JI5VlEDJ80SpHVdxzCiT9sMaIv7IVFLFBaNDlPzpKvYw7qHzJwCL6jnv+Cg h9IX9et9U4BXICzBy7lg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vwoin-0000000Bv3u-2khk; Sun, 01 Mar 2026 21:53:05 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vwoij-0000000Bv2K-49PJ for linux-riscv@lists.infradead.org; Sun, 01 Mar 2026 21:53:03 +0000 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-439b73f4ab4so290723f8f.1 for ; Sun, 01 Mar 2026 13:53:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772401979; x=1773006779; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ylRWWUwK5o3MfEB7pGrnKLZH79m/zlgSbzMzkIBZ2EE=; b=Mf7GEGpl2sJ/aJ/tW/rsyiwz3fYxiYDl4oU/INxImjoMqoRSJAjfPMHvU5fPg7Y39g Rjedm7e4L64zUPINM5pzlxCjdu6hypUThV1d7sHMxj+i3w6wts0rRCUj7cij+x9UNO58 i5RQ1nfs3XnYxcrF0a8Ze2nVZUHkNchLQtzGfjm1sqS+uwuL/57rpzef/NO3SYdaOQEp hZRi4XqcypMBUKeSUm4/3qcgVSn7+2c5sIiR/TMGssPEosV18bEQCVvkvMl1upExh2UA Vjs4sU465bMrl4GK+O6OBAEeDrP24+6aDGOhzzrxDbiMXJ7RNZhryehPVNwVI3ewFQDs WzfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772401979; x=1773006779; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ylRWWUwK5o3MfEB7pGrnKLZH79m/zlgSbzMzkIBZ2EE=; b=mDlFJiS6Bb62wRQ054WVLDJbWT5xsQBZllxW/r7TgB0ITvO26+GpBn8U1QxX7/fumJ h3DZJWz9jiZ+R2/1XRoctTZPaBkz4o3agd/C5tfWttFRAI6recc3NqjdY2yvWZte5Iev C72CRmXzfdZUtB7Tk2K2WP+akmpoWLM2NBuEqsZopTu39u3QMP/ypIkcCtJpBERVEEim O5A+4l0du0EnhoMhPk2Dk4vNHfXvzUsAWQ39swZFdW7iAPakwjQb744WRlQhTCtG+ayw yi2TQJ/7G0Lh8dTqIjp9Fv6nken3H2UTPgt3zezvwBjdQqg3KS+5lnDhODfdHVjpZY7r pGdg== X-Forwarded-Encrypted: i=1; AJvYcCVozZvx/W+773tOoHdiLGYYfz1fOlQt45yVER+EbQmrvAP7BdQX2qth4DtMXI+gORAHvS7e/8YAoM4/LA==@lists.infradead.org X-Gm-Message-State: AOJu0Yx6rWru3AJh2eS8Zr884wLv0LmeYspmiVMEs+7h3M5d0ND6JgZu 8FVKbuMdyEQ9LQRcYkCki0RSXCQG14P3qFiumOg3U88FyGKSk/ZCG7/d X-Gm-Gg: ATEYQzwUukiuInYWAJomUuef4JPjsevBzwElok8DW3HamVb3vmlS3h7M4O5at663rHv bZDLTd6as9DmzekDeFQOyZXzbj5i/Y8OqV7fGdz9K2tl/TcF/JXLdnm9bsPD5m9IkN3TK9UeNaW Zft/0DcgwDkLR7hKD4yy9u0GYrbHEe+7oA6puyqOST8G++wYrSZwXGXrpbrSWxvE0FP9UbfWsHG 8fLEdY1x+NZBhAcLGaHM2wl/14PyT0Wzmp+zoaUBUgSCrfbsW3DQY8c6cBHFDRTqqsqpD1A8jhX v+2S8rzPFkCBFIVgrpq4+4GuhY34MetrDkrXtJWXu6YVTumO4gjD0G50I6X0fhTenTLE8g0eVm2 ZjsAhhSFLoeu3RbOvjb03Y2FBdENPv6x/C7ueWmbrIwoL41pym+hLTn7AXHPWiaPd26tdn7hZTY 2QfVYuLDs6AqwjkQS5MHYg5hWnmG1JaMXORZXKveuPftl7TR3sjml1cqnWPwuZ2m33oeAUm3VFu j0= X-Received: by 2002:a5d:588f:0:b0:439:afd8:6235 with SMTP id ffacd0b85a97d-439afd86565mr5809623f8f.18.1772401979049; Sun, 01 Mar 2026 13:52:59 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-439ba2a58dasm61132f8f.27.2026.03.01.13.52.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Mar 2026 13:52:58 -0800 (PST) Date: Sun, 1 Mar 2026 21:52:57 +0000 From: David Laight To: "Christophe Leroy (CS GROUP)" Cc: Thomas Gleixner , LKML , Christophe Leroy , Mathieu Desnoyers , Andrew Cooper , Linus Torvalds , kernel test robot , Russell King , linux-arm-kernel@lists.infradead.org, x86@kernel.org, Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , linuxppc-dev@lists.ozlabs.org, Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, Heiko Carstens , Christian Borntraeger , Sven Schnelle , linux-s390@vger.kernel.org, Julia Lawall , Nicolas Palix , Peter Zijlstra , Darren Hart , Davidlohr Bueso , Andre Almeida , Alexander Viro , Christian Brauner , Jan Kara , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH] uaccess: Fix build of scoped user access with const pointer Message-ID: <20260301215257.7bdad5f1@pumpkin> In-Reply-To: <4e994e13b48420ef36be686458ce3512657ddb41.1772393211.git.chleroy@kernel.org> References: <4e994e13b48420ef36be686458ce3512657ddb41.1772393211.git.chleroy@kernel.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260301_135302_066223_EEA16866 X-CRM114-Status: GOOD ( 21.58 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Sun, 1 Mar 2026 20:33:58 +0100 "Christophe Leroy (CS GROUP)" wrote: > After converting powerpc checksum wrappers to scoped user access, > following build failure happens: > > CC arch/powerpc/lib/checksum_wrappers.o > In file included from arch/powerpc/lib/checksum_wrappers.c:12: > arch/powerpc/lib/checksum_wrappers.c: In function 'csum_and_copy_from_user': > ./include/linux/uaccess.h:691:1: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] > 691 | ({ \ > | ^ > ./include/linux/uaccess.h:755:37: note: in expansion of macro '__scoped_user_access_begin' > 755 | for (void __user *_tmpptr = __scoped_user_access_begin(mode, uptr, size, elbl); \ > | ^~~~~~~~~~~~~~~~~~~~~~~~~~ > ./include/linux/uaccess.h:770:9: note: in expansion of macro '__scoped_user_access' > 770 | __scoped_user_access(read, usrc, size, elbl) > | ^~~~~~~~~~~~~~~~~~~~ > arch/powerpc/lib/checksum_wrappers.c:17:9: note: in expansion of macro 'scoped_user_read_access_size' > 17 | scoped_user_read_access_size(src, len, efault) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Cast __scoped_user_access_begin() to (void __user *) to fix it. I posted a patch to fix this in december, I'll find it and resend it. David > > Fixes: e497310b4ffb ("uaccess: Provide scoped user access regions") > Signed-off-by: Christophe Leroy (CS GROUP) > --- > Thomas, I encountered this problem while preparing some patches to start using > scope user access widely on powerpc in order to benefit more from masked user > access. Can you make this patch go into 7.0 as a fix in order avoid dependency > on this change when we start using scoped user access ? > > include/linux/uaccess.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h > index 1f3804245c06..5d9f6d45d301 100644 > --- a/include/linux/uaccess.h > +++ b/include/linux/uaccess.h > @@ -752,7 +752,8 @@ USER_ACCESS_GUARD(rw) > */ > #define __scoped_user_access(mode, uptr, size, elbl) \ > for (bool done = false; !done; done = true) \ > - for (void __user *_tmpptr = __scoped_user_access_begin(mode, uptr, size, elbl); \ > + for (void __user *_tmpptr = (void __user *) \ > + __scoped_user_access_begin(mode, uptr, size, elbl); \ > !done; done = true) \ > for (CLASS(user_##mode##_access, scope)(_tmpptr); !done; done = true) \ > /* Force modified pointer usage within the scope */ \ _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv