Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5995099rdb; Thu, 14 Dec 2023 05:49:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFuMq2R+f+zLMD/m6/auW6+SUA1P+kZhQbjge5VMCfTmdH/T2PMphBghg6WSkWbrVsTwc9Z X-Received: by 2002:a05:6358:921:b0:16b:c403:1689 with SMTP id r33-20020a056358092100b0016bc4031689mr13555860rwi.9.1702561780765; Thu, 14 Dec 2023 05:49:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702561780; cv=none; d=google.com; s=arc-20160816; b=NTG8HDD9G0hr4tL/nUkpLGtwWzkIr0xF01zZIyEVqfviakr9guo0IRGRErYSR5Y05j M+6wN6BjPPDYYgETxYRFrCdnAcfywkNOn6iHdSSnW/Q6VDBSynEyiN1yt0KdX7+lEKVP hte24lBNIKpdTK4zdt497bdjAZQfC4QYMAeZjfd/2Fzyh5mIEa5kuxQa0PZKjh2qfDuS M/0VWeM7oY8/ekZrySjbbBQz76rOKAm1PeoT8BcJhuwjfYk+P4EfQFE2UJakxs2fwMCF /ik6JEWYrMiUVuDYkHLlz5ThGTiPWW9hkAhglNLTvp6hY0z8hNCRG70aovR1qs/hfCti fH0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=UTgQg5ey7t1gN8vRT5vRqf8veCr45WdokAmFaMYA3+E=; fh=XrRzB/2dTtaSjEj46xXWnCPJZjPyUr9BXB5M55EJG2Q=; b=zEGlwB6r/0bDG2Ni6ugKY+EvGd8xjYxrZbHwQMKjNd54Soy8CFSh7SirEhpp87ewPd v2jMoRFmdQd0gGZlorLBwUk/cmKgjUyQtba8tJCQ33/W2zN7luVLRzTYhwW500dfQ6Bi 3mRREHTsV+56NkTPKZteLwXOyyfGJdvDt2yNL2NCtgVQ+/9/+PikJZSMEtS2yGASOXsV CfYeoTsV7upafGjahivxqMkumSxL0tGUGR0wSElaIxnFsXG3lMAelYds9r9iob2jVUQO 8oEyE5Daj+W4amcZIQKnR8pqwLAyEy1/4qUamwuw2u55wsKJlSVNVedOu/qqMaCAIPuR BKzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HpsGmDfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id x9-20020a63f709000000b005ca5616facesi1974364pgh.38.2023.12.14.05.49.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 05:49:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HpsGmDfr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 68237816EBDE; Thu, 14 Dec 2023 05:49:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573200AbjLNNtK (ORCPT + 99 others); Thu, 14 Dec 2023 08:49:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573102AbjLNNtJ (ORCPT ); Thu, 14 Dec 2023 08:49:09 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79F1911B; Thu, 14 Dec 2023 05:49:11 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-28aeacb2dfdso1094707a91.0; Thu, 14 Dec 2023 05:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702561751; x=1703166551; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=UTgQg5ey7t1gN8vRT5vRqf8veCr45WdokAmFaMYA3+E=; b=HpsGmDfrQAXXmLmF9+MyM7P4KI+VmntHmtvpA30TrA9z0xVFctdQBL4guem5MSi3Sr DXKuDBrozlZ4sqrbgh0qnjA607aWRymYy6cf9/g17D03IKoFDfX8O+AEejnXHToMtTI1 DZTUm/uJFy78YrFx+U1FJ+mICE7iDEICCtM/4NKnmlc93TRfbdEx5XrsgKgV20Nwjuw5 OznfTF7lFNZIgQjmPm2UhzS5Q+Xw5MKqGmka7X9N9l6OOXUndBJxasnINDvzZACbEjyO NTneZz6ByIE0uQLTJXs5l9wiFN8KVTKNs1LgDUfWxAR0xduYtXye0W0/NzXeOJhUiXMt cOMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702561751; x=1703166551; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UTgQg5ey7t1gN8vRT5vRqf8veCr45WdokAmFaMYA3+E=; b=YhtBMC4MgFf45VwK46w5pA35H0GebnqJxGtnt9vfPOzPzZAd3RqJHp4iefqMt6PUJo fiY9qMG/IOZUNkCSTUS+dtSNYAfD0nxNlW1l4U9ytZsrSy4x0OfSUTcOPmHD47i7JApb KzHc+2LWm9OFE4HlBPe05Xf2WoBUfO7HaeT+HfbZIjibA7bYB+N2qFeS+NmIi1mi5xOh jFRHOgcTYscB4vlqYNPg1jCQQYRyQVnXfxqMjsuisyMiwA9mRRMi76dsnQkZIYs+aa18 rkSOJ7IfUVZcAV5QmBnhKhtgrngar2ClrxkcFH8n9JQGPHPyMyLcLUenfPX967DJ4S/Z Ur1Q== X-Gm-Message-State: AOJu0YzXE34HyXZBpRm8I0+Q9075xo71InZdyKkErjQFe10YXXpP3BlE 3cCwFaTXhXatJj6A0SII+FE= X-Received: by 2002:a17:90a:a10f:b0:28b:201f:c2be with SMTP id s15-20020a17090aa10f00b0028b201fc2bemr63542pjp.62.1702561750754; Thu, 14 Dec 2023 05:49:10 -0800 (PST) Received: from [192.168.54.90] (static.220.238.itcsa.net. [190.15.220.238]) by smtp.gmail.com with ESMTPSA id q2-20020a17090a430200b0028a4c85a55csm10995876pjg.27.2023.12.14.05.49.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Dec 2023 05:49:10 -0800 (PST) Message-ID: <29100969-106a-47c1-bfe3-6e2ca38c8c54@gmail.com> Date: Thu, 14 Dec 2023 10:49:05 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] rust: upgrade to Rust 1.74.1 To: Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor Cc: Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev References: <20231214092958.377061-1-ojeda@kernel.org> Content-Language: en-US From: Martin Rodriguez Reboredo In-Reply-To: <20231214092958.377061-1-ojeda@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 14 Dec 2023 05:49:36 -0800 (PST) On 12/14/23 06:29, Miguel Ojeda wrote: > This is the next upgrade to the Rust toolchain, from 1.73.0 to 1.74.1 > (i.e. the latest) [1]. > > See the upgrade policy [2] and the comments on the first upgrade in > commit 3ed03f4da06e ("rust: upgrade to Rust 1.68.2"). > > # Unstable features > > No unstable features (that we use) were stabilized. > > Therefore, the only unstable features allowed to be used outside the > `kernel` crate are still `new_uninit,offset_of`, though other code to > be upstreamed may increase the list (e.g. `offset_of` was added recently). > > Please see [3] for details. > > # Other improvements > > Rust 1.74.0 allows to use `#[repr(Rust)]` explicitly [4], which can be > useful to be explicit about particular cases that would normally use > e.g. the C representation, such as silencing lints like the upcoming > additions we requested [5] to the `no_mangle_with_rust_abi` Clippy lint > (which in turn triggered the `#[repr(Rust)]` addition). > > Rust 1.74.0 includes a fix for one of the false negative cases we reported > in Clippy's `disallowed_macros` lint [6] that we would like to use in > the future. > > Rust 1.74.1 fixes an ICE that the Apple AGX GPU driver was hitting [7]. > > # Required changes > > For this upgrade, no changes were required (i.e. on our side). > > # `alloc` upgrade and reviewing > > The vast majority of changes are due to our `alloc` fork being upgraded > at once. > > There are two kinds of changes to be aware of: the ones coming from > upstream, which we should follow as closely as possible, and the updates > needed in our added fallible APIs to keep them matching the newer > infallible APIs coming from upstream. > > Instead of taking a look at the diff of this patch, an alternative > approach is reviewing a diff of the changes between upstream `alloc` and > the kernel's. This allows to easily inspect the kernel additions only, > especially to check if the fallible methods we already have still match > the infallible ones in the new version coming from upstream. > > Another approach is reviewing the changes introduced in the additions in > the kernel fork between the two versions. This is useful to spot > potentially unintended changes to our additions. > > To apply these approaches, one may follow steps similar to the following > to generate a pair of patches that show the differences between upstream > Rust and the kernel (for the subset of `alloc` we use) before and after > applying this patch: > > # Get the difference with respect to the old version. > git -C rust checkout $(linux/scripts/min-tool-version.sh rustc) > git -C linux ls-tree -r --name-only HEAD -- rust/alloc | > cut -d/ -f3- | > grep -Fv README.md | > xargs -IPATH cp rust/library/alloc/src/PATH linux/rust/alloc/PATH > git -C linux diff --patch-with-stat --summary -R > old.patch > git -C linux restore rust/alloc > > # Apply this patch. > git -C linux am rust-upgrade.patch > > # Get the difference with respect to the new version. > git -C rust checkout $(linux/scripts/min-tool-version.sh rustc) > git -C linux ls-tree -r --name-only HEAD -- rust/alloc | > cut -d/ -f3- | > grep -Fv README.md | > xargs -IPATH cp rust/library/alloc/src/PATH linux/rust/alloc/PATH > git -C linux diff --patch-with-stat --summary -R > new.patch > git -C linux restore rust/alloc > > Now one may check the `new.patch` to take a look at the additions (first > approach) or at the difference between those two patches (second > approach). For the latter, a side-by-side tool is recommended. > > Link: https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1741-2023-12-07 [1] > Link: https://rust-for-linux.com/rust-version-policy [2] > Link: https://github.com/Rust-for-Linux/linux/issues/2 [3] > Link: https://github.com/rust-lang/rust/pull/114201 [4] > Link: https://github.com/rust-lang/rust-clippy/issues/11219 [5] > Link: https://github.com/rust-lang/rust-clippy/issues/11431 [6] > Link: https://github.com/rust-lang/rust/issues/117976#issuecomment-1822225691 [7] > Signed-off-by: Miguel Ojeda > --- > [...] Reviewed-by: Martin Rodriguez Reboredo