Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1744643rdb; Thu, 25 Jan 2024 05:06:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGtmZBnZwTJL5izAuK5QwnCVK2pdLG7NuIQETZyvY8q1gQp2vWM1mCGN62HOKbGvSFeUQFE X-Received: by 2002:a05:6a00:1a88:b0:6dd:c870:3f82 with SMTP id e8-20020a056a001a8800b006ddc8703f82mr642433pfv.4.1706187989067; Thu, 25 Jan 2024 05:06:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706187989; cv=pass; d=google.com; s=arc-20160816; b=0krT75wSjBriooqZp6D/m9c3aLCKIexunj++Lv1K+qvC6zGHS32zxznPImAPIkUIn+ 5cNs5UUW7lJSmrb08YULxgZnFBaV1IfOxn9FBOQDnrMnkg2vs+9DtrN2GW5NqDNnVvIr 89twZ3yyujmhs5dCVc+D7bKP6ehCNe1In27G80zHHZ18h5g4Bj12XR4R10vt50IoBwS+ TmJyXDKu51QPP94bFLD3NCg7IxxOskuuzqUk416s3Y9Ds0/bwrdBnUV4q/63J1tFblwJ mHNaDVwOEnP76+KNEdbsH51ecEqaj1RxThxMWihk5hSxXYyRmW4W5musWiIHDoCNOxvY okQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=oOzAf62Q5EQWJNHfwm0u23zGJZG4Xz8s5DNGaCHvSkA=; fh=2TbzSKe6hPb17AOP+QzuDTuGBdPuDaT4HiGz0a0HYNs=; b=aXIKPqVyJA9ZUPHWM7Em+uco2TJO/Wub6LjHFEOsGXGr2azyN13ol3yE4BQowSY6hZ PLhdoGcVlmltbl1ydaS6N7daXgGYkcQt3f08U/SITAHfEno0SwSXhOMmKfxMFWhzXWpB 1aEetHSgJKwBnE9TE5mb1p4Q85JsDhfzNYiPds7OuKEhiMqITIcPhkc0vkCPEc2C0myD gwtlpRbUtK0EQRqFOr0aFVfSy5MeOw5zhyvua2Ah9TY1vODznfFsUK+OZA+MrsMAbYLC 7o1AYivMDKmpfmjgay49/9AOkj9JXc2iXU3p8gKx6wTVf9Mf7hTH+SXMCaz+g5+1ECnV mrSQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NUhPMYdp; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-38595-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38595-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a16-20020a62d410000000b006d99fca81d2si15561648pfh.382.2024.01.25.05.06.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 05:06:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38595-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NUhPMYdp; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-38595-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38595-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 457A2B25962 for ; Thu, 25 Jan 2024 12:50:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 038B04F612; Thu, 25 Jan 2024 12:50:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NUhPMYdp" Received: from mail-yw1-f181.google.com (mail-yw1-f181.google.com [209.85.128.181]) (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 AE0E04F212; Thu, 25 Jan 2024 12:50:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706187019; cv=none; b=eujLsx8HOTDwQ4IHhgcJlXm79I2wxwEuHuSc5q4q4KP9gvPPaFPYn3vsALl6isHPvY+Sh00pPCbZlERCN+s17dXNGPXmRbtonGm38m/JWLTXaJHOKN5Q1c8sLoAgtrp2Z0k3AXQ/0UuREyZuBmvPgydO90b+oJekrpMFAM49PeQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706187019; c=relaxed/simple; bh=oOzAf62Q5EQWJNHfwm0u23zGJZG4Xz8s5DNGaCHvSkA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=qrGaMpfa/mtVXbs0BY+oIKMpeCehnVhUm17mNvolkKqjAzBoY4ZN67fCjp8hpi/0eG1xo11b5hKkB6q9PBkTzyhnBIGB1lNa6uAv3AdOSCsuyh6TUnbR6TTiSwx3Fl1DnycLNVEX5P8JtxsGfog4JOZ9zPXJThe5CLanLxnxE8g= 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=NUhPMYdp; arc=none smtp.client-ip=209.85.128.181 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 Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-5f69383e653so65846737b3.1; Thu, 25 Jan 2024 04:50:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706187016; x=1706791816; darn=vger.kernel.org; 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=oOzAf62Q5EQWJNHfwm0u23zGJZG4Xz8s5DNGaCHvSkA=; b=NUhPMYdp37rzgq+oE3cEv2fnQzdAUGCXtRT2tpCOB4dYOQyqIEcAGg8o4xBYajH/rG uqb5JkAOpCIa2ZK8kR8viZsgSFlQ8d41EuLGZKcReC87M6Wi73AnMct78rJvGdeRvCOE AIx20u37z6w3Mq0g6kHCXtgr1G7DL9M2TJv+Wup0qbLTkdCszoA6K9tAsI/Y8ir/usnO 9XRGD9y6/VO87fL2OBE0d4IWPgVfe6C9h7iPt+dvOuzDuUB+dKQ/0XNDBRSPqX2Tt8AY ANAAh2vPyrHBGJXOqs59smmlHTOksaJOodxTiHRVL3EdrKdU9sKaNbCnDup9OWf6ENF3 mm3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706187016; x=1706791816; 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=oOzAf62Q5EQWJNHfwm0u23zGJZG4Xz8s5DNGaCHvSkA=; b=ALE2Eh8Cjwo1S+BiY08UVJ2HBTVSlaILV6tpWhT/ChCx2OsMKRaLfxgkz0HNOaECZT cqUmyPTrFZ8/9Si2INJnXBafyetexrgVyOQh3XAbxPDBEvT7+utSatB0PDrA9RApbUpQ 72MhapFyclkZqGu+Gz745O3WiKSY3riGb49W2mP5QPx8V/TKX51z6V8i6DOQFaDg8Gzv aR9sUVE6Mu4gp15BL7+fExV9vUv33H1VkAsmc9J1RwZHtSdKJaEZHxPxO3v9T6NSdlDz l9SimgJ4XXsWFjqTXQNltsULu9ja3yfWBndXGLcFjpkPnh15TKTkCMiLELdvUkUcA0ge mVoA== X-Gm-Message-State: AOJu0Yzist1iKNJbyGR/auI4Cpe2TcPhZfezw2T0GQFvyhP3uCLq7Vrt uNlfflm6myvuAqrf9sAcFOKX8mG+irhPFTtZfbLYlTldWk6MzEperOMGU8q06cx3M8YDeZz9o2y VWdqm7fk1tLL+0mj0TH4Si6gQM2k= X-Received: by 2002:a81:4983:0:b0:5ff:638f:441e with SMTP id w125-20020a814983000000b005ff638f441emr571223ywa.103.1706187016606; Thu, 25 Jan 2024 04:50:16 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20230307102441.94417-1-conor.dooley@microchip.com> <20230608-dispatch-sneer-aa09bd7b2eb8@wendy> <20230608-spiritism-gonad-5f5aff4c3a24@wendy> <20240117-swiftly-parasail-618d62972d6e@spud> <20240118-implode-delirium-eefdd86e170e@spud> <20240125-bucked-payroll-47f82077b262@wendy> In-Reply-To: <20240125-bucked-payroll-47f82077b262@wendy> From: Miguel Ojeda Date: Thu, 25 Jan 2024 13:50:05 +0100 Message-ID: Subject: Re: [PATCH v1 0/2] RISC-V: enable rust To: Conor Dooley Cc: Conor Dooley , linux-riscv@lists.infradead.org, Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Nathan Chancellor , Nick Desaulniers , Tom Rix , rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Matthew Maurer , Ramon de C Valle Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 25, 2024 at 1:31=E2=80=AFPM Conor Dooley wrote: > > I chatted with the clang built linux folks about this yesterday, Nathan > agreed that dealing with incompatibility issues iff they crop up is a > reasonable way to go. > > If by "the bindgen found one matches the C compiler" you mean that the > version of libclang used by bindgen matches the C compiler, then that > sounds great. Yeah, exactly. So, unless I am misunderstanding, the incompatibilities could only happen if someone ignores the warning. We could make it an error too. > > For `bindgen` under GCC builds, we will eventually want a "proper" way > > to use GCC instead (or possibly other approaches like querying the > > information): https://github.com/rust-lang/rust-bindgen/issues/1949. > > > Recently, there has been a thread in our Zulip and a couple people are > > experimenting: https://rust-for-linux.zulipchat.com/#narrow/stream/2880= 89-General/topic/Bindgen.20--.20GCC.20backend.20port > > That link for me goes to a message on 22/01, so later than the email you > sent. Zulip seems to scroll to the latest message in the topic -- you should be able to scroll a bit up, but if that doesn't work, this link should go to the first message: https://rust-for-linux.zulipchat.com/#narrow/stream/288089-General/topic/Bi= ndgen.20--.20GCC.20backend.20port/near/412609074 > That said, I gave things another spin today, in a different environment, > as a final check before sending and found an issue causing kernel > panics. RISC-V (and x86/arm64) supports kcfi (CFI_CLANG) but enabling > sanitisers seems to be a nightly only option for rustc. The kernel I > built today had CFI_CLANG enabled and that caused panics when the rust > samples were loaded. > > The CFI_CLANG Kconfig entry has a cc-option test for whether the option > is supported, but from a quick check I don't see a comparable test to > use for rust. Even if a test was added, the current flag is an unstable > one, so I am not sure if testing for it is the right call in the first > place, given the stabilised flag would be entirely different? Yeah, KCFI and other mitigations is WIP -- Cc'ing Ramon and Matthew who may be able to tell us the latest status. Testing for unstable flags is fine, i.e. we only support a single compiler, so we can change the name when we do the upgrade. Cheers, Miguel