Page MenuHomeFreeBSD

DMAR2IODOM
ClosedPublic

Authored by br on Aug 3 2020, 1:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 13 2024, 6:49 AM
Unknown Object (File)
Jan 10 2024, 8:58 PM
Unknown Object (File)
Dec 23 2023, 12:23 AM
Unknown Object (File)
Nov 18 2023, 8:14 AM
Unknown Object (File)
Nov 16 2023, 8:10 AM
Unknown Object (File)
Oct 11 2023, 7:05 AM
Unknown Object (File)
Oct 9 2023, 7:06 AM
Unknown Object (File)
Sep 28 2023, 9:06 PM
Subscribers

Details

Summary

o Add DMAR2IODOM() macro;
o Add IODOM2DMAR() macro.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

br requested review of this revision.Aug 3 2020, 1:30 PM
br created this revision.

Basically I want to get rid of all conversion relying on the layout. And add macros for common conversions e.g. from domain to dmar unit etc.

sys/x86/iommu/intel_ctx.c
181 ↗(On Diff #75299)

Can you add CTX2DMARDOM ?

182 ↗(On Diff #75299)

This expression should be macro-ified as well (domain->dmar unit)

sys/x86/iommu/intel_dmar.h
94 ↗(On Diff #75299)

I want this to look like &((domain)->iodom), i.e. stop relying on the dmar_domain layout whre iodom is the first member.

95 ↗(On Diff #75299)

And this would be __container_of((iodom), struct dmar_domain, iodom). Unless I mixed arg order.

Add macroses:

DMAR2IOMMU()
IOMMU2DMAR()

DOM2IODOM()
IODOM2DOM()

CTX2IOCTX()
IOCTX2CTX()

kib added inline comments.
sys/dev/iommu/iommu_gas.c
177 ↗(On Diff #75348)

Commit these assert improvements for gas.c separately.

sys/x86/iommu/intel_ctx.c
339 ↗(On Diff #75348)

Do we want a constructor and destructor for iommu_domain ? I believe it makes sense.

This revision is now accepted and ready to land.Aug 4 2020, 8:24 PM