From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f47.google.com (mail-qv1-f47.google.com [209.85.219.47]) (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 22382BA3D for ; Tue, 18 Nov 2025 19:51:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763495516; cv=none; b=Cnxwgy7mExiL1oWTwkuiF5b43tRoODqBOANQ84Q8q/fWQ7LCblfTEffsEBSXyiHwfiuu6i5yEvva40OUjCLnyjU8GH79nUotLvIiN+WiicfYu18Nx1PnLn1j0zjUizL4ag+yxaNbFPllrFaQ9Yh3ZFAd5UJt/6nLCrEhCPQgBlY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763495516; c=relaxed/simple; bh=FjgN4iTbczMjaHV4KfmghHqOQIrOAVkG9Xiyk3MTk6c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qlxoTcSon+AqpuNu81MW2XKnvilybzo9mLShzyuD3G7f1oUKFU4ILofaNB0QdOiv82288dSX2NeD8T/r/rxn6aEkOatndD11bQ9bY9OOuoeD+PPI3v8h2fg6HsI6QD3iQxIRzPAhlx8m3ANZd+MxYtkecEm7JpEw73yI1QbaeCI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Da7eEe1r; arc=none smtp.client-ip=209.85.219.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Da7eEe1r" Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-880439c5704so52688566d6.1 for ; Tue, 18 Nov 2025 11:51:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763495514; x=1764100314; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3U6a0C6zAq+P8XmzOE6KvU5TPlaO7U/ZGGupk7jN8To=; b=Da7eEe1rDUzd/RkrGeFGwtmGHH2cBRlbytMrCi+kMzkrE0KJi24VCtWKik+g0Dro8f QrbPWZ8aDGmGVht1ua3TIKobe3Zhggpk8EP4N/221MARpMWp5jeHwMiWW4HCFcs0wsHJ P+akfPfYmnAUgT8iDom6C1MVwNqKyLwajrh31W+rrnlNGvvCRSMeQ1ogEeLVXzw6pV5W ohlJCYCQstaUD3MHPOSYa88sVuImkNGRRoP8heQHuZKz5Sywe+2go+Vtx2n+F95A6DFG NWDBMJGO/tjK6Kxrce1DicK8cR5e5f/n5IfiqAXcZJXAGg7FZSUJm3rpkrziAiO/jaP4 Fa8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763495514; x=1764100314; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3U6a0C6zAq+P8XmzOE6KvU5TPlaO7U/ZGGupk7jN8To=; b=okq4tCeJs+RQfR/tvg1PzNmhm7o0L+4A/j527LOgjBaSP78WRhVv/XwItOc+4U6fS4 +azUyQS/6m1cJuY4jzrA8VceS7iG+5OzvEG0azz9HqYT6jLbKENzOS/JTdhIymW9e7gl hz//fCVOW5DBlVcK+YKec0NqeI6k8H6tArdL8MhbMzLfNmK2keMMthwaLSFwgHBdctqm N7sS+aXmSUWSLsYA8KTgqnLyEc5EdVb0IdDv6DAluza63wKDvQ6zq9LyUS7kaaNuY8ge 5d7cTBbj3jKJsd+JqwSMTup7RMyGDJBNCAiqnxQYPe6Rmd4Te0+efaFzA1CARQ6/hE9Y qWYw== X-Forwarded-Encrypted: i=1; AJvYcCU/qTl80AVrtTNXUMz7fo278NMIwlTbjCgHAta6I474muwho+6JfhjxY6tsImMHYYZ8fb+7NPrSzwPXukE=@vger.kernel.org X-Gm-Message-State: AOJu0YzDO/trzwIG21i96OzqCjRFCAEsv1RohKz9WkeA5y94kcPQeUQw ZIt216X7h6mCUHKCAYvfYVoNaBi46sCUh8CE8tc9qw3LKxUPSxBFBu8V X-Gm-Gg: ASbGncv6wDGOIWNaRArBQHRIr0Ne0do75HTDbKICv5IclS498CJL33dNgBV1HcPCO8M DO35disrbUrUNTIjYHQD+K6gscAu/IlwkDqE/pPrcNUMa3iMLYH4H2E+rYDCFXKPVIvn7nMsKvD 4LreypbmsLdAvpVvYMI7itLk2ah6hcLMMPyw7nYYIQ94MYao2+BA7vBxZ69IPFrrYeMdJdlhyR/ 26bWtPcQllfnOGu8rLVadeue5PbbLB1VN3LpGn51gSJcIwrVkwIc5lO0ROdKEApDNqxYOVQRvhP mIe5HszXTFnM/P/6qCr66O08eTEPle/4q715mRF0OwbwLMvgnhYvIk1M2poYMrk4XT/Ei2Qz/oi ivUKAYPaUYgsA1GR8jl6bEkUZSQqi00bGbAYzTH9EMmbIzE4QmjaVLyEUwkTRip2iYZ426duDmL qFKghIG/8cwTuQDX6Yev8hbQyHThqF X-Google-Smtp-Source: AGHT+IHcZHHq5Ew86cqIrw2y+MSAwIuX4sBlOk6o1QiqEXu+Vm21QBTbY93cK0qP8ikX/8261fI8Xw== X-Received: by 2002:a05:6214:21e2:b0:880:415d:a9ee with SMTP id 6a1803df08f44-882925e0267mr257882856d6.26.1763495513989; Tue, 18 Nov 2025 11:51:53 -0800 (PST) Received: from localhost ([12.22.141.131]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-882863923fcsm118778136d6.25.2025.11.18.11.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 11:51:53 -0800 (PST) Date: Tue, 18 Nov 2025 14:51:52 -0500 From: Yury Norov To: Andrew Morton Cc: Alice Ryhl , Miguel Ojeda , Boqun Feng , Danilo Krummrich , Arnd Bergmann , Alex Gaynor , Gary Guo , John Hubbard , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , Philip Li , Yujie Liu , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org Subject: Re: [PATCH v2] uaccess: decouple INLINE_COPY_FROM_USER and CONFIG_RUST Message-ID: References: <20251024154754.99768-1-yury.norov@gmail.com> <20251118091818.152ba4fc0c8a6f3092a36fbc@linux-foundation.org> 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=us-ascii Content-Disposition: inline In-Reply-To: <20251118091818.152ba4fc0c8a6f3092a36fbc@linux-foundation.org> + Philip, Yujie On Tue, Nov 18, 2025 at 09:18:18AM -0800, Andrew Morton wrote: > On Tue, 18 Nov 2025 10:39:56 +0000 Alice Ryhl wrote: > > > On Fri, Oct 24, 2025 at 11:47:53AM -0400, Yury Norov (NVIDIA) wrote: > > > Commit 1f9a8286bc0c ("uaccess: always export _copy_[from|to]_user with > > > CONFIG_RUST") exports _copy_{from,to}_user() unconditionally, if RUST > > > is enabled. This pollutes exported symbols namespace, and spreads RUST > > > ifdefery in core files. > > > > > > It's better to declare a corresponding helper under the rust/helpers, > > > similarly to how non-underscored copy_{from,to}_user() is handled. > > > > > > Reviewed-by: Alice Ryhl > > > Tested-by: Alice Ryhl > > > Signed-off-by: Yury Norov (NVIDIA) > > > > It looks like this is not quite correct. The header file still has this > > declaration unconditionally: > > > > extern __must_check unsigned long > > _copy_from_user(void *, const void __user *, unsigned long); > > > > extern __must_check unsigned long > > _copy_to_user(void __user *, const void *, unsigned long); > > > > this causes: > > > > ERROR: modpost: "_copy_from_user" [samples/rust/rust_misc_device.ko] undefined! > > ERROR: modpost: "_copy_to_user" [samples/rust/rust_misc_device.ko] undefined! > > I wonder why this wasn't caught in linux-next testing. > > Please check the rust Kconfig defaults, see if there's something we can > do to get more compilation test coverage? I'm second to that. Philip added my git repo under his testing a while ago, and also enabled Rust config. I received a 'build success' email from his robot before submitting this. Alice, can you please share your config? Philip, can you add Alice's config in the testing grid so that we don't slip through such things in future? Thanks, Yury