Page MenuHomeFreeBSD

amd-vi: fix gcc build errors
ClosedPublic

Authored by rlibby on Jul 5 2017, 5:07 AM.

Details

Summary

amdvi_cmp_wait: gcc complained about a malformed string behind an ifdef.

struct amdvi_dte: widen the type of the first reserved bitfield so that the packed representation would not cross an alignment boundary for that type. Apparently that causes in-tree gcc (4.2) to insert padding (despite packed, resulting in a wrong structure definition), and causes more modern gcc to emit a warning.

ivrs_hdr_iterate_tbl: delete a misleading check about header length being less than 0 (the type is unsigned) and replace it with a check that the length doesn't exceed the table size.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Thanks for this work. Let me give it a quick test (later today) to verify.

Tested fine on a Ryzen 1700, passing through an em device to an 11.1 guest, and doing lots of network file transfers.

I think you'd want Anish to sign off on this as he's the author/maintainer of the AMD IOMMU code.

This revision is now accepted and ready to land.Jul 6 2017, 7:36 AM
This revision was automatically updated to reflect the committed changes.