Page MenuHomeFreeBSD

bus: Document special ranges of IVARs
AcceptedPublic

Authored by jhb on Dec 9 2025, 8:35 PM.
Tags
None
Referenced Files
F142757752: D54159.id167920.diff
Fri, Jan 23, 5:29 AM
Unknown Object (File)
Thu, Jan 22, 8:47 PM
Unknown Object (File)
Sun, Jan 18, 9:26 AM
Unknown Object (File)
Wed, Jan 14, 12:19 PM
Unknown Object (File)
Mon, Jan 12, 12:58 PM
Unknown Object (File)
Sat, Jan 3, 4:31 AM
Unknown Object (File)
Thu, Jan 1, 11:02 AM
Unknown Object (File)
Sat, Dec 27, 7:55 PM

Details

Reviewers
imp
andrew
manu
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

Some IVAR indices are special in that they have global meaning across
multiple buses where as other IVARs are always private to the local bus.
Try to document this a bit and add constants for the various ranges to
avoid future conflicts.

This is mostly a no-op except for some buses that started their IVAR
indices at 1 instead of 0. Those buses now start at 0 after this
change. Also, IVAR indices are now generally defined as enum's as
that makes it easier to define them.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69201
Build 66084: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Dec 9 2025, 8:35 PM
jhb requested review of this revision.Dec 9 2025, 8:35 PM
sys/arm64/arm64/gic_v3_var.h
114

Are you planning on MFCing this change? If not then we could just drop them.

sys/sys/bus.h
312

I don't think this is needed, the GICv3 ivars can be in the private space.

sys/arm64/arm64/gic_v3_var.h
114

I might MFC this change but have a followup change that can't be merged that drops unused ivars.

sys/sys/bus.h
312

I was going to ask about these as followups. For now I just want to document what is there.

Can the regular GIC IVARs also be in the private space?

sys/arm64/arm64/gic_v3_var.h
114

It's unused from 13 so you could name it GICV3_IVAR_UNUSED to make it self documenting.

Wouldn't it be an issue for a MFC renumbering the 1-indexed ivars to be 0-indexed?

sys/sys/bus.h
312

The regular GIC IVARs are shared between the two GIC drivers so can't be in the private space.

If you keep it then the name should be BUS_IVARS_GICV3. I'll have a GICv5 driver in the next few weeks, but that can use the private space.

sys/arm64/arm64/gic_v3_var.h
114

Oh, yes, so perhaps I won't MFC after all. Still, I think removing the unused entries as a separate commit is easier to review, etc.

sys/sys/bus.h
312

Have you considered just having a single set of GIC IVARs shared by all the drivers btw?

Rename BUS_IVAR_GIC3 to BUS_IVAR_GICV3

This looks good to me. It also shows a bit of a disconnect on how we've put the 'ranges' in different ways. A limit of 256 is likely better than 100 or 500, but honestly all are fine.

This revision is now accepted and ready to land.Thu, Jan 22, 8:57 PM
ehem_freebsd_m5p.com added inline comments.
sys/xen/xenbus/xenbusvar.h
58

After a quick glance this seems reasonable. Since I'm unfamiliar with this portion of things, @royger could you take a look?