Page MenuHomeFreeBSD

Fix bug in xrefinfo_find() for 64-bit platforms
ClosedPublic

Authored by zbb on Mar 27 2015, 10:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jul 27 2025, 7:06 AM
Unknown Object (File)
Jun 17 2025, 12:32 AM
Unknown Object (File)
Jun 16 2025, 7:52 PM
Unknown Object (File)
May 28 2025, 3:10 AM
Unknown Object (File)
Apr 23 2025, 8:17 AM
Unknown Object (File)
Apr 23 2025, 7:14 AM
Unknown Object (File)
Apr 23 2025, 7:00 AM
Unknown Object (File)
Apr 23 2025, 6:28 AM

Details

Summary

uintptr_t may be 64-bit on some platforms, therefore when
finding xrefinfo by pointer to device the high word is being
cut off due to cast to phandle_t which is 32-bit long by definition.
Due to that we loose the high word of the address to compare with
xi->dev's address.
To fix that, first argument of xrefinfo_find() is extended to
uintptr_t and is being cast to appropriate type (phandle_t)
when compared.

Submitted by: Zbigniew Bodek <zbb@semihalf.com>
Obtained from: Semihalf

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

zbb retitled this revision from to Fix bug in xrefinfo_find() for 64-bit platforms.
zbb updated this object.
zbb edited the test plan for this revision. (Show Details)
zbb added reviewers: ian, nwhitehorn.
zbb added subscribers: Unknown Object (MLST), Unknown Object (MLST), PowerPC.
nwhitehorn edited edge metadata.

Looks OK to me. Would be nice if you changed the name of the "phandle" argument to "key" or something since, in the cases where this applies, it isn't a phandle.

This revision is now accepted and ready to land.Mar 27 2015, 6:25 PM