Page MenuHomeFreeBSD

Avoid some out-of-range DMA accesses with PCI intel ethernet adapters.
ClosedPublic

Authored by kib on Oct 19 2016, 12:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 9 2024, 4:46 AM
Unknown Object (File)
Feb 8 2024, 3:17 AM
Unknown Object (File)
Jan 8 2024, 9:21 AM
Unknown Object (File)
Dec 27 2023, 5:37 PM
Unknown Object (File)
Dec 27 2023, 5:10 PM
Unknown Object (File)
Dec 22 2023, 11:16 PM
Unknown Object (File)
Dec 22 2023, 11:16 PM
Unknown Object (File)
Dec 22 2023, 11:16 PM
Subscribers

Details

Summary

This change sit in my local tree for very long time. It caused a conflict with recent netmap update, so I think it could be useful for me to get rid of it, either commit or revert locally.

The issue is that pre-PCIe, i.e. plain parallel PCI adapters from Intel, managed by the lem(4) drivers, apparently have very serious hardware bugs in the DMA engines. Both descriptor ring accesses, and packet buffer accesses, read past the end of the regions. I have a haswell machine with PCIe/PCI bridge, and 82541PI two-port card. If VT-d is enabled, card generates a fault for almost any access.

The patch in the review extends the descriptor rings by one element each, which fixes overruns there and rather cleanly demonstrates the bug. Unfortunately, I was not able to develop any form of sane fix for the packet memory accesses. So the patch is only partial.

Test Plan

Intel did not responded to the inquiries about the problem. This issue prevented me from having a working environment to integrate ACPI_DMAR and vmm.ko.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 5656
Build 5937: CI src buildJenkins

Event Timeline

kib retitled this revision from to Avoid some out-of-range DMA accesses with PCI intel ethernet adapters..
kib updated this object.
kib edited the test plan for this revision. (Show Details)
kib added reviewers: sbruno, jhb.
kib set the repository for this revision to rS FreeBSD src repository - subversion.
kib added a subscriber: emaste.
sbruno edited edge metadata.

Please commit this at your convenience.

This revision is now accepted and ready to land.Oct 19 2016, 5:28 PM
sys/dev/e1000/if_lem.c
546–556

There should be a comment explaining the + 1 I think, it does not have to be overly detailed but should at least provide a "bread crumb" to suggest this is intentional.

erj requested changes to this revision.Oct 19 2016, 5:37 PM
erj added a reviewer: erj.
erj added a subscriber: erj.

I agree with @emaste's request for a comment.

This revision now requires changes to proceed.Oct 19 2016, 5:37 PM
kib edited edge metadata.

Add comment.

emaste added a reviewer: emaste.
erj edited edge metadata.
This revision is now accepted and ready to land.Oct 19 2016, 6:05 PM
This revision was automatically updated to reflect the committed changes.