Re: [PATCH v1 0/2] firewire: Simplify storing pointers in device id struct

Uwe Kleine-König (The Capable Hub) <[email protected]> Wed, 22 Apr 2026 10:30:22 +0200
Newsgroups gmane.linux.sound,gmane.linux.kernel.firewire.devel
Message-ID <aeiElvAzJRPLKUeI@monoceros>
--5naj64jzyrf6k2ns
Content-Type: text/plain; protected-headers=v1; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Subject: Re: [PATCH v1 0/2] firewire: Simplify storing pointers in device id
 struct
MIME-Version: 1.0

Hello Andy,

On Wed, Apr 22, 2026 at 10:19:21AM +0300, Andy Shevchenko wrote:
> On Tue, Apr 21, 2026 at 04:07:42PM +0200, Uwe Kleine-K=F6nig (The Capable=
 Hub) wrote:
> > On Tue, Apr 21, 2026 at 09:53:57PM +0900, Takashi Sakamoto wrote:
> > > On Mon, Apr 20, 2026 at 07:39:32PM +0200, Christian A. Ehrhardt wrote:
> > > > On Mon, Apr 20, 2026 at 06:08:16PM +0900, Takashi Sakamoto wrote:
>=20
> ...
>=20
> > > Thanks for the references. It looks like there is not much to consider
> > > outside of mm subsystem. But I have some concerns if supporting
> > > ARM/RISC-V adoptation of CHERI extension in Linux FireWire subsystem.
> > >=20
> > > Any structures in UAPI header of this subsystem are defined with
> > > an assumption that the size of pointer in the existing System V
> > > architectures is up to 64 bits at most. We can see many usage of
> > > '__u64' type member for pointers (e.g. 'rom' in fw_cdev_get_info
> > > structure). I imagine to need defining specific structures for this k=
ind
> > > of 'fat' pointer. (The same assumption lays on compat ioctl.)
> >=20
> > The Standard C answer to that is: The assumption that you can fit a
> > pointer in an unsigned long or u64 is not generally justified. This is
> > "only" given for all current Linux archtectures. And if you want an
> > integer type to store a pointer, use uintptr_t.
>=20
> No, please don't. Linus was clear about this. Use `unsigned long` in that=
 case.

On CHERI we have sizeof(unsigned long) =3D 4 and sizeof(void *) =3D 8, so
what Linus wants doesn't work.

But let me note that we don't have to resolve that question for this
patch set. We're still far away from working on mainlining the core
changes for CHERI that most probaly will require some casting between
pointers and integer types. My plan for now is to work on changes (like
the one here) where we have both, a benefit for mainline and as a side
effect a simplification for CHERI enablement. So I wouldn't mind to
delay the discussion.

Best regards
Uwe

--5naj64jzyrf6k2ns
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmnohxsACgkQj4D7WH0S
/k7sGgf/YgFmalTz5ICb1xOQxayxrGepGEdt1Qs7qEHKYa+MNNXQwoi1R+2JR71X
HMTDVLvbSa+l1Igsbu+R+hZDn/KYAU4UPoS50EEzYJ3pQmGT2AzRvWBquYWLy1O8
K7/86rAH+W2ktJG8pp98HraTCoviItmi+goREvpITTIcwoX2h7o6U/NBu+0DgiXI
Y6TW6OOs7ATbileJMIYrjF8OHOC1T/bTCKUwNFjnKnlBT9EXWtXD+jbXZKNgudyA
tv6PiQlhVkBG+Vcr8SnsFmwmxqQZ6vpoZ7arlveZMZAG6KppjGUCx+dXC+GRLzH4
9+TxZ6YZBR0q6XtifZeEG9M6ZeIQSg==
=yCOE
-----END PGP SIGNATURE-----

--5naj64jzyrf6k2ns--