]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC 325039: Rework pass through changes in r305485 to be safer.
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 16 Nov 2017 18:22:03 +0000 (18:22 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 16 Nov 2017 18:22:03 +0000 (18:22 +0000)
commita027a8157060703d9473e102c9c72faaaecd38e0
tree8ea6ef132d0f1e5e7fa1700768e054fe9fb0a8e9
parent7fdb14e17cb46878ca0fe3acda8c168c55728237
MFC 325039: Rework pass through changes in r305485 to be safer.

Specifically, devices that do not support PCI-e FLR and were not
gracefully shutdown by the guest OS could continue to issue DMA
requests after the VM was terminated.  The changes in r305485 meant
that those DMA requests were completed against the host's memory which
could result in random memory corruption.  Instead, leave ppt devices
that are not attached to a VM disabled in the IOMMU and only restore
the devices to the host domain if the ppt(4) driver is detached from a
device.

As an added safety belt, disable busmastering for a pass-through device
when before adding it to the host domain during ppt(4) detach.

PR: 222937

git-svn-id: svn://svn.freebsd.org/base/stable/10@325900 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/amd64/vmm/io/iommu.c
sys/amd64/vmm/io/ppt.c