From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 ACB1621ABAA for ; Fri, 6 Feb 2026 22:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770415311; cv=none; b=KuC8TARBwyCynlDy95FSY8h4kkFJVOqWSaZFt52k6E0WMqf+XYiPyVc9JEPoOk5OoXWG9tIL7GqB0dPySYz8c/Ihf0vdjnLP16fXTeGoV/4zTvtYEUwQOTNqtHYxamGxUloZaKn2/evTL3jFq0FkxVyrk1OhllZa6VErL9qTlPM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770415311; c=relaxed/simple; bh=M2Njw1JnpMfP7+jFmJgcg9/5rQt3OBR4wC2Zs4qdOFI=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Gb15ExxnRJPTvzhWfJkd8p86ANi0wVV6wgZNj8gPzLgR/Ju6UJVjnML9zasJwsebiNA+ACQqdIemhjuEHjTB9ufgs9tJfk8IgOXJ0glugp5u8/JsnQzSoD6aWSdcuZFLeUBX3jL27RUJevmVdkmX6jDFpI0qW+YZ74yi27vmbPQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ALDGacoh; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=HPzsfCFQ; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ALDGacoh"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="HPzsfCFQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770415309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5T5V4gT5bheYrPWddhGL53i3LiUJE9TPYRiptwUHacg=; b=ALDGacohPg1IqFpHK8IcikzKRJcOKN4n8rRINYnRyrbR+5fdk16clLHINGCbsSJA1cZ1gP YhdRgYCQy5vbF35O3HfoNp4Dg/dv/vUXHCrHuKx/y8TBIf/8P6EocD3C1p7bhEyZ5eRZgf dw+sagT09jnI7xx7xYqzf9jBXi4m5Zg= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-558-08SGYZEtMXuY8vDNDGYLow-1; Fri, 06 Feb 2026 17:01:48 -0500 X-MC-Unique: 08SGYZEtMXuY8vDNDGYLow-1 X-Mimecast-MFC-AGG-ID: 08SGYZEtMXuY8vDNDGYLow_1770415308 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-8c71655aa11so936279885a.3 for ; Fri, 06 Feb 2026 14:01:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770415308; x=1771020108; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=5T5V4gT5bheYrPWddhGL53i3LiUJE9TPYRiptwUHacg=; b=HPzsfCFQjn98FkumPM7c1aJQpmkrj84Avhtj7QyeF8g1hZcMYR36/Xquit6eIFrjOE ysQIEFUIrKnM2z0MXk4IybV/0MPQwBFEISH+4zHWbj2yrW87aPNwVbpDTFFipr9Nh3HW RJS+OMg14U1vyfJPFvS5WSg9znSNEwORxA1FFKF+ce/hND9NcKMD5UuxXj7WuHLgqii4 /qs3xnqQVchKSxTpoi5NK9pSVNvRVbjRnfuWmyLE0OfI94KRz5BUdsdd9ms8emFg3Eb+ lcU1aUCoWD95txu+JYj0T6CjTs3dnRW0AqIXNAceCikqJEMW8TnZxPufLz/H73zvU0pz DyyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770415308; x=1771020108; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5T5V4gT5bheYrPWddhGL53i3LiUJE9TPYRiptwUHacg=; b=BCsEUWEsEExKdhkwA17pJ0wlaW/l/zVFVzZPvKrazJH+S4Sf+u7mE6XSaQF3a2nfyg D+5ATMzfVDqlAFLJlz2x7rPO+FB5OH/ertYiBEawooXy+Jz2xsMmkRONNrE7dRr0PP0q L/wfHrpy4rg5kHjpWQu4DlkYUBFiJdhei+IONoz70wamSKdnxdjF/rqxxpYPKxvvfqlA 1TH6mDgW3FcxtSvhnoTOMw+ja6g16iBtNAVQEuV1EEIeMXeHEy1GDUQv9crdBRgc+/st p/FLkGXPw1hBgNrQm9ov472YHGoMYtjJSbxO5p8y/YB5Y9D+3awfzL1DPcWzldk9Ej8U +NbQ== X-Forwarded-Encrypted: i=1; AJvYcCUx3DHHset9YAZw1SfniR7vYz8apnx5YgZjsk4ZVUZFAKoObuxnvTePVEchHBkreyHKuyB4Q8GxXZOwP0U=@vger.kernel.org X-Gm-Message-State: AOJu0YxAJIN6MfQEJ06IJaLZgPjFEoVXmKH6ja+IBPdiAf3qzSBqgDSJ rZBRvXr4a+GdOu815/3SfkC/YHRZ8qnRQXVoh85O6cNXnu7tnjxCr2iJl4ATD0ZEJi7Hv5zA/2c Pld+AaWnQr4Pg8InJ4O+86speQkNSBEA8suU8CtGnuWjjEqo/Z3xpFYVNkdBkY/y1ug== X-Gm-Gg: AZuq6aKxbJw7HAwdHhoHxi02sjirCQmKjKMJ9AqzVvFtg5nfJ55CcXo+h9HoM8Sl7sN +8HIMLzCmhKgPdcf9TWYF95iurhs21KBzFzYlYHJGk3gg5ndRsnCOeI63/RELgYZqK9yYAhVEI+ hgk/6x/z74pNzEjaM5shY1UZAFo6bLGdt9OgeiltgfRFmELSgpEHj3fkQbjebe9YIpZzy7NppcR aFpC22lrMKYojUt5NCRrrbDMfQkw4/02N/DqK7HDYZP3nS5TJ2C4k1h13jrgQAR8EVVOpLpZXXp jBoy+IBajTqEX9JFGMfejmLL6VGf4G+5hEQVN7HjC7bOffPJoIqAS/LJR2u1az+9rkbREUGVE/k RcnQtcw== X-Received: by 2002:a05:620a:19a2:b0:8b2:f1cc:a14b with SMTP id af79cd13be357-8caf1bc9789mr525808785a.87.1770415308029; Fri, 06 Feb 2026 14:01:48 -0800 (PST) X-Received: by 2002:a05:620a:19a2:b0:8b2:f1cc:a14b with SMTP id af79cd13be357-8caf1bc9789mr525803185a.87.1770415307559; Fri, 06 Feb 2026 14:01:47 -0800 (PST) Received: from [192.168.8.4] ([100.0.180.93]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8caf9ee8662sm266205485a.37.2026.02.06.14.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 14:01:46 -0800 (PST) Message-ID: <6d37ba2ccbe02fbc093c8e9b1a765c7791e47628.camel@redhat.com> Subject: Re: [PATCH v6 7/8] rust: Introduce iosys_map bindings From: lyude@redhat.com To: Alice Ryhl , Danilo Krummrich Cc: dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org, Daniel Almeida , linux-kernel@vger.kernel.org, Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?ISO-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , Greg Kroah-Hartman , Viresh Kumar , FUJITA Tomonori , Krishna Ketan Rai , Tamir Duberstein , Xiangfei Ding , Zhi Wang , Matthew Maurer , Alexandre Courbot Date: Fri, 06 Feb 2026 17:01:45 -0500 In-Reply-To: References: <20251202220924.520644-1-lyude@redhat.com> <20251202220924.520644-8-lyude@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.2 (3.58.2-1.fc43) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, 2026-01-15 at 15:36 +0000, Alice Ryhl wrote: >=20 > The trait approach generally requires knowing the target type at > compile-time or paying dynamic function calls, but my understanding > is > that iosys exists because you might not know which variant you want > at > compile-time. >=20 > Perhaps we need an >=20 > enum Iosys { > =C2=A0=C2=A0=C2=A0 SystemMemory(...), > =C2=A0=C2=A0=C2=A0 DmaMemory(...), > } >=20 > and implement Io for Iosys in terms of the inner types. So - I didn't see this comment until now however: I personally think it can't hurt to have a wrapper around iosys_map simply because it makes it easier to pass back and forth from C APIs, and the other sideaffect of Io is that it's extremely trivial to implement it for the iosys map bindings. The one downside I could see is that I added C helper functions for all of the iosys map read/write operations which means they aren't currently inlined. But iirc there's work ongoing to allow for these to be inlined so I assume once that is finished there shouldn't be any additional overhead from this approach. Anyway - will send out the new version in a moment >=20 > Alice