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 AAD98CFD35C for ; Fri, 11 Oct 2024 12:01:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References: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=RFh+ifNvxIfeMOvqcH0bj2fqZ4Q/KL50BBcyRrIOPlM=; b=rnTq73YwOmywmmsFbrq06R5JIV +Wklmav16mW+IasNkhWbAmMqjD+5G2ZXsAeCxYT04Gc+x9bLJxy4F23Q5qN5ukrCeWT4E/rLICuEb 2y/6EV1F9SJyTc1/50mEisSwqbPz7LWFswiX+G2iJA/WwK7UKk+Yt/deWcOtTuDAB2xesfP4xmnsx wpU3MyJaQu7+jzsC00JJbZysjmbjJLbfuyFOjsY5765zPMZUCtMiMS9PQFOSndWHWMC7fvn+vxSdr FMjOwK7GQY6GqzucTVlUJ33VGdBjKm6Iz2exnwKOxv9s0y1boH42uDT8psow4r8Sr8oyAaedqcJc8 xlC8QF8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1szEKv-0000000GCjv-3xWi; Fri, 11 Oct 2024 12:01:37 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1szDFE-0000000G3aM-24DZ; Fri, 11 Oct 2024 10:51:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=RFh+ifNvxIfeMOvqcH0bj2fqZ4Q/KL50BBcyRrIOPlM=; b=GDJmAqtaN6oH11wTx1qLaskHBj zKYQwLVIA745qR3XAZTUCnNXBWgIs98fHs0b+YRlR50Lm0umA08Iq8JsIdLAj2T+Tkqbu7LxdkgLk 6O1X26CvtGsrd430wJE9VIEtPhffGg5N1z0vYjn+IrwRxG9XuQecXwHeokGtSSMaCM9JPQwEZJGh9 TMDnpYZvd5YbAwdhTuTnxIbpolCuKa2bUaYZUYTy8AjkbS7UXnmFbdVw/5HPvDwC/17RFNoyknmL5 pK3S4TsmZA7NSkcw4WgqUfjKPPYwa00xJ99bh9WK9dAUF9oGkN6i9RmoJjDsx/YznY0MH8BF7QDUC MHDIF74g==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1szDFA-00000005reF-3H66; Fri, 11 Oct 2024 10:51:37 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 5C0AE300642; Fri, 11 Oct 2024 12:51:36 +0200 (CEST) Date: Fri, 11 Oct 2024 12:51:36 +0200 From: Peter Zijlstra To: Miguel Ojeda Cc: Mark Rutland , Alice Ryhl , Matthew Maurer , Sami Tolvanen , Catalin Marinas , Will Deacon , Huacai Chen , WANG Xuerui , Paul Walmsley , Palmer Dabbelt , Albert Ou , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, linux-riscv@lists.infradead.org, rust-for-linux@vger.kernel.org Subject: Re: [PATCH] cfi: rust: pass -Zpatchable-function-entry on all architectures Message-ID: <20241011105136.GP17263@noisy.programming.kicks-ass.net> References: <20241008-cfi-patchable-all-v1-1-512481fd731d@google.com> <20241010110344.GL14587@noisy.programming.kicks-ass.net> <20241010113748.GL33184@noisy.programming.kicks-ass.net> <20241010130421.GG17263@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Oct 10, 2024 at 04:48:41PM +0200, Miguel Ojeda wrote: > On Thu, Oct 10, 2024 at 3:04 PM Peter Zijlstra wrote: > > > > Also not rust-src, because for some reason you're not actually > > freestanding :/ > > It is there, but it is a suggested package, so I think you would need > e.g. `--install-suggests`: > > https://packages.debian.org/trixie/rust-all > > Regarding freestanding, we use `no_std`, which one could argue is > similar to C's freestanding. That is, we use `core`, which is a subset > of the full (hosted) standard library, just like C requires some > headers even in freestanding. > > However, I think you mean not even using those > headers/sources/libraries, which is fair. Rust calls that `no_core`, > but it is currently impractical to use/maintain and there are a lot of > useful things in `core` we want to use anyway, such as the `Result` > type: > > https://doc.rust-lang.org/core/ > > There are some things that we could remove, though, which is why I > asked long ago for ways to remove unneeded things for the kernel > ("modularization of `core`"). We got `no_fp_fmt_parse`, implemented by > Gary back in 2021, and we could perhaps get more in the future if > really needed. So you could just copy the bits from core you need into the kernel tree and leave out those bits you do not, and ocassionally update them when needed, right? > > Yeah, but then you have to first know that we have this file to begin > > with. > > That is fair, but hard to fix. We try our best though: the "Rust" > entry is in the front page of the kernel docs already, and the first > paragraph of that page links to the "Quick Start" guide. I'm not really a browser centric kinda guy, the front page is bash in the source tree. Using the browser is below bitching about stuff on IRC :-)