From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b8-smtp.messagingengine.com (fhigh-b8-smtp.messagingengine.com [202.12.124.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5ACE947DF9C; Thu, 6 Aug 2026 16:10:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.159 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786032610; cv=none; b=eBZ4FjaklQXdSIREbKsgvX7V4Nfk2yLGsgWnaThoDQPn3S5n2tw20Xq3qQwNDzwDZ6wkrmW1XMKGW1lMbe5MPjwaT2WJCiKlBNQEEONa00gAufi02qyZwT668v1kyzd3OavuKSuFQ6B006/qrnwxPvSobZ9rZNsZqBnA2iM9V0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786032610; c=relaxed/simple; bh=Mma0pkeBxt/K4Sb+TOs7o1mNjjNsqi/Vt8o3AhsBlTs=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=ja/ENiVYUfhxtbtvjLgXElhyBVLlabnG4zy5QukumlbIbk8ser0JVG/s/7u5bNlmlSwbpGxe/PljOucn4+G4SmhgiHrgEl05t2FRLWmn+RhpwiEKqPpb0NwSBQLrIoWPL0TwIw4r+7irFIzumgMW7PZYe4SoedMiAgidvQ9DbRA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=YQveg2tg; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=anreLZLl; arc=none smtp.client-ip=202.12.124.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="YQveg2tg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="anreLZLl" Received: from ams-compute-02.internal (ams-compute-02.internal [10.64.2.62]) by mailfhigh.stl.internal (Postfix) with ESMTP id CF5937A0101; Thu, 6 Aug 2026 12:10:05 -0400 (EDT) Received: from ams-imap-03 ([10.64.2.23]) by ams-compute-02.internal (MEProxy); Thu, 06 Aug 2026 12:10:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1786032604; x=1786119004; bh=femWfvOZsQ9kjRpouwPyrWwThkheUH0sdgrsZoynmN8=; b= YQveg2tgaCqvN2bawYnrwkuNbxeOtDM3km5AuvLmprijs/p4PNqzL2k1AIOW4E90 LfZkHxtj5V+Xo4rppvmUKmnuH/4R5U07GZheJiehvx27hbVG52c6R1lgehoMsIXQ JBP5Bvu77ipTtnfiNo3qTYyb42tqitREaTF+KMoqoBQfITdupm66qMbvRua2ejmn 1la2WuzTqhMDVFA5lB4fwKm0PLW/SmiLs4uGC7srxAipuJ3QcZ3TV21yndekSNTL VoYqA7mExU0OuNkDCBcMc2Joc4NK+xaWV769tAbGa6vqX8TWZ/dcWuKfvNoPrZAM jgitL50M0eUTd4FKypy2iQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1786032604; x= 1786119004; bh=femWfvOZsQ9kjRp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lr1405cIlabHNIG8XYmi6K1glQg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.ams.internal (Postfix, from userid 501) id BA80732A0065; Thu, 6 Aug 2026 12:09:56 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: A0yYJuUxkgs3 Date: Thu, 06 Aug 2026 18:09:35 +0200 From: "Arnd Bergmann" To: "Danilo Krummrich" Cc: "Greg Kroah-Hartman" , "Rafael J . Wysocki" , "Alice Ryhl" , "Daniel Almeida" , "Miguel Ojeda" , "Boqun Feng" , "Gary Guo" , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Trevor Gross" , "Tamir Duberstein" , acourbot@nvidia.com, =?UTF-8?Q?Onur_=C3=96zkan?= , driver-core@lists.linux.dev, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: In-Reply-To: References: <20260805212920.1996937-1-dakr@kernel.org> <9fbff830-d1b3-428b-b7b2-205eff41b6d5@app.fastmail.com> Subject: Re: [PATCH v2 1/2] rust: io: gate ioremap/iounmap on CONFIG_HAS_IOMEM Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, Aug 6, 2026, at 17:47, Danilo Krummrich wrote: > On Wed Aug 5, 2026 at 11:39 PM CEST, Arnd Bergmann wrote: >> Can you also hide the actual I/O accessors in this case? >> While s390 without CONFIG_PCI still provides the asm-generic >> version of those, that is technically a mistake, and it would >> be nice not to. >> >> I'm guessing that there is enough kernel code that still expects >> these to be present for C, but if all rust code has the correct >> HAS_IOMEM dependencies, it would be cleaner not to reference >> since there is no correct way to call them without ioremap(). > > As things are right now, I think something like in [1] should work, but we'd > also need to cfg-gate every single doc-test that uses I/O primitives, which is > slightly annoying. > > In any case, I'm not sure it would be a huge benefit anyway. Unlike in C, where > I/O accessors operate on raw void pointers, the Rust primitives are typed. So, > users have no way of actually calling them without being able to obtain a > mapping in the first place. Right, makes sense. Arnd