Page MenuHomeFreeBSD

linuxkpi: add uuid_t and helpers
Needs ReviewPublic

Authored by denis.borovikov_gmail.com on Thu, Oct 1, 4:16 PM.
Tags
None
Referenced Files
F174733119: D60199.diff
Mon, Oct 5, 2:19 PM
F174690493: D60199.diff
Mon, Oct 5, 5:44 AM
F174687236: D60199.diff
Mon, Oct 5, 5:02 AM
F174684786: D60199.diff
Mon, Oct 5, 4:31 AM
F174663908: D60199.id.diff
Mon, Oct 5, 1:21 AM
F174660840: D60199.id188322.diff
Mon, Oct 5, 1:01 AM
Unknown Object (File)
Sun, Oct 4, 12:57 AM
Unknown Object (File)
Sat, Oct 3, 9:10 PM

Details

Reviewers
wulf
manu
Summary

linux/uuid.h has only the guid_t family. Add uuid_t, next to guid_t, with uuid_equal(), uuid_copy(), import_uuid() and export_uuid(), mirroring the guid_ versions. As wulf suggested, the type is linux_uuid_t behind a uuid_t macro, to stay clear of the other uuid_t types in the tree. Used by drm/virtio for dma-buf UUID export.

Test Plan

Built on main with this applied: linuxkpi (linux_acpi.c and linux_compat.c include linux/uuid.h), linuxkpi_wlan, mlx5, iwlwifi and ath10k (both include linux/uuid.h) for aarch64 and amd64, and drm-kmod's virtio-gpu (freebsd/drm-kmod#517) without its interim copy.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

LGTM. Move uuid_t definition to guid_t definition.

This revision is now accepted and ready to land.Thu, Oct 1, 8:14 PM

Careful! We already have a native uuid_t! Someone should check if (a) we can use that and (b) possible conflict potential.

sys/sys/uuid.h:typedef struct uuid uuid_t;

FreeBSD uses native uuid_t only in ACPI and GEOM(EFI) subsystems.

We can rename uuid_t to linux_uuid_t and add #define uuid_t linux_uuid_t to aoid possible namespace collisions.

This revision now requires review to proceed.Mon, Oct 5, 5:26 AM
denis.borovikov_gmail.com edited the summary of this revision. (Show Details)
denis.borovikov_gmail.com edited the test plan for this revision. (Show Details)

Updated as wulf suggested: the definition sits next to guid_t, and uuid_t is linux_uuid_t behind a macro.

@bz: (a) The native type can't be reused. It is struct uuid, with time_low/time_mid/... fields, which ACPI and GEOM use, while Linux's uuid_t is a raw 16-byte array (.b[]) that drivers index and memcpy. (b) In the kernel, sys/uuid.h provides only struct uuid; its uuid_t typedef is userland-only. OpenZFS's SPL defines its own kernel uuid_t, but ZFS never includes LinuxKPI headers, so nothing clashes today.