ref: e6684dbfda0507565f44967680b850b35a5b4f93
parent: c5d08a602c35ac24b7c7ccfe5b53c8dfa12ef94e
author: cinap_lenrek <[email protected]>
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);
}