git: 9front

Download patch

ref: 2046cdf0e81d59ece383f234f018890aab777c82
parent: 1eb167ba1e2c2636640c765620b4a0e30d624a24
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Nov 21 11:17:20 EST 2020

pc, pc64: disable all pci devices for /dev/reboot

Make sure all pci busmaster activity is disabled,
including MSI/MSI-X interrupts, before switching
control to the new kernel.

--- a/sys/src/9/pc/main.c
+++ b/sys/src/9/pc/main.c
@@ -5,6 +5,7 @@
 #include	"dat.h"
 #include	"fns.h"
 #include	"io.h"
+#include	"../port/pci.h"
 #include	"ureg.h"
 #include	"pool.h"
 #include	"rebootcode.i"
@@ -688,6 +689,9 @@
 
 	/* shutdown devices */
 	chandevshutdown();
+
+	/* disable pci devices */
+	pcireset();
 
 	rebootjump((ulong)entry & ~0xF0000000UL, PADDR(code), size);
 }
--- a/sys/src/9/pc64/main.c
+++ b/sys/src/9/pc64/main.c
@@ -5,6 +5,7 @@
 #include	"dat.h"
 #include	"fns.h"
 #include	"io.h"
+#include	"../port/pci.h"
 #include	"ureg.h"
 #include	"pool.h"
 #include	"rebootcode.i"
@@ -285,6 +286,9 @@
 
 	/* shutdown devices */
 	chandevshutdown();
+
+	/* disable pci devices */
+	pcireset();
 
 	rebootjump((uintptr)entry & (ulong)~0xF0000000UL, PADDR(code), size);
 }
--