summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-11-21 16:17:20 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2020-11-21 16:17:20 +0100
commite6684dbfda0507565f44967680b850b35a5b4f93 (patch)
tree96af6242665496f5aefccf90cccff65cabd4e95d
parentc5d08a602c35ac24b7c7ccfe5b53c8dfa12ef94e (diff)
downloadplan9front-e6684dbfda0507565f44967680b850b35a5b4f93.tar.xz
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.
-rw-r--r--sys/src/9/pc/main.c4
-rw-r--r--sys/src/9/pc64/main.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/sys/src/9/pc/main.c b/sys/src/9/pc/main.c
index 39649d164..f5937b6be 100644
--- 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"
@@ -689,5 +690,8 @@ reboot(void *entry, void *code, ulong size)
/* shutdown devices */
chandevshutdown();
+ /* disable pci devices */
+ pcireset();
+
rebootjump((ulong)entry & ~0xF0000000UL, PADDR(code), size);
}
diff --git a/sys/src/9/pc64/main.c b/sys/src/9/pc64/main.c
index 53bcd8887..d440656fa 100644
--- 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"
@@ -286,6 +287,9 @@ reboot(void *entry, void *code, ulong size)
/* shutdown devices */
chandevshutdown();
+ /* disable pci devices */
+ pcireset();
+
rebootjump((uintptr)entry & (ulong)~0xF0000000UL, PADDR(code), size);
}