From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (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 005DA224AFE for ; Wed, 26 Feb 2025 17:12:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740589928; cv=none; b=Is7FmRpqgvD3sMjbR4ok7kAtzvJCyhfMs141iPhPJ8sY5qnfH/WZpjvm2rpRKTyyNj2ehwp/Rq6CzNPBZqXJC+ztXevlA7znLwTEgSiWUWNslMOlK5i4HrYRyEewNSBmU2qsgc1HLxmO1UMR3Lj/UUBlA4108JS6ppLRa1E1sUM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740589928; c=relaxed/simple; bh=CKmL45MF3D/cWpj4NBs+BRN2U4392XMuvZPpdtIhJCQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=BpqlzplO99ePbc3NJWlRoJ/249PbSnSyLHQ9xI5pY4yM5wAfO4rXBV3JxhaYfwEEDW7at4dNU6wIgfY0RTh81WdrETacI+9drQ63gU/9bG1oYHiy03tDoighDIJzzc4POnhfIG8Dvc1mJQQoeX863wkBikaXKb1MLkFlIlOifc4= 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=PURuY/CD; arc=none smtp.client-ip=209.85.216.49 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="PURuY/CD" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2fc29ac55b5so20322a91.2 for ; Wed, 26 Feb 2025 09:12:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740589926; x=1741194726; darn=lists.linux.dev; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=l0++ssa3KklqvkS2+TUnBgIYo9/l/jr1/yCcC6gaJdo=; b=PURuY/CDSZFemW2Y5nb+jh0/PcpQfRzQ+eb1q2lZ5kdUMkDyNDmjdziEpwsrtA7mIy GTs+JdYmxVOQ5D/RjMkcKFRn0q9shqxRn66x0O5ZAx+7BbDKQSscYq0Ssn7k5H+m0aWR +5a5JU6odZb4SCyLUuGDWtTh6OialqViW9c6cCAvVcAl62nuzn5vwuwLpEdsq7o4ioUP ssYo5Z6OyY1Seg0awc49ya1/cqyYsNfjbgzy7EaUXZEVpWI8qP0bfbFV5lhZqEx9eaD+ h4odqxYEF+Zot8xPLOsppZ9Uh0VLpmtPdjiovGEKuDBX9Mut/49aJ2FMa+P4HIgSMEhS ClrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740589926; x=1741194726; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l0++ssa3KklqvkS2+TUnBgIYo9/l/jr1/yCcC6gaJdo=; b=nFB1WysuFZb6tjF0GDg0PViQ1tNwMZp4aUu8efz1fN53VLoWsvAmBVN6JOOiBCUGfG 6PtpDB+VdKpQe7tnJvLI/pqyraJ1SpmstDDsV3oBEKJUSFhwgq+9xuOBl70Yu8ISNGpM daxLtrck3QnIKfmp8OXJk7qBYzxwJMgIh+6fItKC0os7DKaIBw/TLNjZq1054cEhiNU/ nNf0yoP5cpy4UcAfDYLt+5aZPg2xY9UdzQiSiitEgaXLHovj1bD8HJolifn6olsKvrOK kDFn1jsmxqSF9lLyaaDCf/Gm89RKjXic/3KcnHJJC0ZscVeufdYvETBV7ermmuN1VfNX Z2Zg== X-Forwarded-Encrypted: i=1; AJvYcCXNiSd8R2T9abVeugEwfcrlq+yP5iYacDXviY3dl7z3PckJuXc1V9zUWgAU51qrh3egn8Mh5ETj@lists.linux.dev X-Gm-Message-State: AOJu0YwLV8Ij/r4MgST2jphtKkWF/VjMUj0iDSysPBa+w924TciJ5fcg 4YcPOYdEPz1w1laIzLrpKExP81LEyGsOMEVimWf1HF0d+qMjONYDV/Mm9bZv+CMSmSoq8wHzIx/ hKUv/MOWpR2x3ZHIbMvTLz+Ml6To= X-Gm-Gg: ASbGncsHsAWWhgZfUqumMyEkRd2x/13fdyvTQL+QpEdJB5A40mZL7WJcAm6rzdSrRBM OT3WpjMa3GiCcn/rQcJqeiaCnhUwfHBBnVdu3lRMqakPboA91uTH+OctqksoHkOooxBkf/l15Ri wDWSAPybk= X-Google-Smtp-Source: AGHT+IEviEOnl0xfL1S6XtApmG3cyllnaIXmrMVdQ23v2GjWKaie4K7gOcLYfIO7VYOXTJQe89W5rpmlXx8fxPCy2w0= X-Received: by 2002:a17:90b:4d0d:b0:2ee:6563:20b5 with SMTP id 98e67ed59e1d1-2fce75d75a7mr14266904a91.0.1740589926114; Wed, 26 Feb 2025 09:12:06 -0800 (PST) Precedence: bulk X-Mailing-List: ksummit@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20250222141521.1fe24871@eugeo> <6pwjvkejyw2wjxobu6ffeyolkk2fppuuvyrzqpigchqzhclnhm@v5zhfpmirk2c> <5E3FEDC4-DBE3-45C7-A331-DAADD3E7EB42@zytor.com> <2rrp3fmznibxyg3ocvsfasfnpwfp2skhf4x7ihrnvm72lemykf@lwp2jkdbwqgm> In-Reply-To: From: Miguel Ojeda Date: Wed, 26 Feb 2025 18:11:53 +0100 X-Gm-Features: AQ5f1JomtzOpefkwmwH6LSFqWj2xlKQ1O2v116mBDbHDQFWRjp5xrC2xazyfcR0 Message-ID: Subject: Re: C aggregate passing (Rust kernel policy) To: James Bottomley Cc: Ventura Jack , Kent Overstreet , "H. Peter Anvin" , Alice Ryhl , Linus Torvalds , Gary Guo , airlied@gmail.com, boqun.feng@gmail.com, david.laight.linux@gmail.com, ej@inai.de, gregkh@linuxfoundation.org, hch@infradead.org, ksummit@lists.linux.dev, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, Ralf Jung Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 26, 2025 at 3:26=E2=80=AFPM James Bottomley wrote: > > On Wed, 2025-02-26 at 14:53 +0100, Miguel Ojeda wrote: > > On Wed, Feb 26, 2025 at 2:03=E2=80=AFPM Ventura Jack > > wrote: > [...] > > > Exception/unwind safety may be another subject that increases > > > the difficulty of writing unsafe Rust. > > > > Note that Rust panics in the kernel do not unwind. > > I presume someone is working on this, right? While rust isn't > pervasive enough yet for this to cause a problem, dumping a backtrace > is one of the key things we need to diagnose how something went wrong, > particularly for user bug reports where they can't seem to bisect. Ventura Jack was talking about "exception safety", referring to the complexity of having to take into account additional execution exit paths that run destructors in the middle of doing something else and the possibility of those exceptions getting caught. This does affect Rust when built with the unwinding "panic mode", similar to C++. In the kernel, we build Rust in its aborting "panic mode", which simplifies reasoning about it, because destructors do not run and you cannot catch exceptions (you could still cause mischief, though, because it does not necessarily kill the kernel entirely, since it maps to `BUG()` currently). In other words, Ventura Jack and my message were not referring to walking the frames for backtraces. I hope that clarifies. Cheers, Miguel