Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Oct 2017 19:27:07 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 222937] [byhve] Severe RAM corruption after PciPassThrough-guest shutdown
Message-ID:  <bug-222937-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D222937

            Bug ID: 222937
           Summary: [byhve] Severe RAM corruption after
                    PciPassThrough-guest shutdown
           Product: Base System
           Version: 11.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: bugzilla.freebsd@omnilan.de

Created attachment 187086
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D187086&action=
=3Dedit
/etc/rc.d/pciptdetach: Work around RAM corruption at guest shutdown

Various different panics will happen after shutting down a bhyve guest with
PCIe passthrough NICs if some conditions are met.

This can lead to completely destroyed zpools, like I found out after some
dozend not so impacting crashes...

Quoting jhb@:
I suspect what is happening is that the PCI devices are still issuing DMAs
after the guest has been shutdown which end up trashing other parts of host
memory.  This may somewhat be my fault as I made a change which moves the
device back into the host domain after FLR during guest shutdown.  I should
perhaps leave the device disabled in the DMAR table instead if the FLR
doesn't succeed.  (We could also add some other forms of reset for devices
not supporting FLR.)
</quote>

Since I don't have the skills to help fixing the root cause, I wrote a litt=
le
workaround in form of a rc(8) script (to be copied to /etc/rc.d) which shou=
ld
protect against accidental crashes and data losses, by bringing the
PciPassThrough devices down before shutting down, which prevents DMA writes
from the card after moving it back into host domain.

-harry

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-222937-8>