Page MenuHomeFreeBSD

DMAR2IODOM
ClosedPublic

Authored by br on Aug 3 2020, 1:30 PM.
Tags
None
Referenced Files
F136951447: D25926.id75399.diff
Thu, Nov 20, 7:46 PM
F136951160: D25926.id75299.diff
Thu, Nov 20, 7:44 PM
F136951057: D25926.id75299.diff
Thu, Nov 20, 7:44 PM
F136950107: D25926.id.diff
Thu, Nov 20, 7:39 PM
F136950102: D25926.id75399.diff
Thu, Nov 20, 7:39 PM
F136949915: D25926.id.diff
Thu, Nov 20, 7:39 PM
F136949745: D25926.id75348.diff
Thu, Nov 20, 7:38 PM
F136949678: D25926.id75348.diff
Thu, Nov 20, 7:37 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