Page MenuHomeFreeBSD

D30310.diff
No OneTemporary

D30310.diff

diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c
--- a/sys/dev/hyperv/vmbus/vmbus.c
+++ b/sys/dev/hyperv/vmbus/vmbus.c
@@ -45,6 +45,10 @@
#include <sys/systm.h>
#include <sys/taskqueue.h>
+#include <vm/vm.h>
+#include <vm/vm_param.h>
+#include <vm/pmap.h>
+
#include <machine/bus.h>
#include <machine/intr_machdep.h>
#include <machine/metadata.h>
@@ -139,6 +143,7 @@
&vmbus_pin_evttask, 0, "Pin event tasks to their respective CPU");
extern inthand_t IDTVEC(vmbus_isr), IDTVEC(vmbus_isr_pti);
+#define VMBUS_ISR_ADDR trunc_page((uintptr_t)IDTVEC(vmbus_isr_pti))
uint32_t vmbus_current_version;
@@ -980,6 +985,10 @@
vmbus_msg_task, sc);
}
+#if defined(__amd64__) && defined(KLD_MODULE)
+ pmap_pti_add_kva(VMBUS_ISR_ADDR, VMBUS_ISR_ADDR + PAGE_SIZE, true);
+#endif
+
/*
* All Hyper-V ISR required resources are setup, now let's find a
* free IDT vector for Hyper-V ISR and set it up.
@@ -987,6 +996,9 @@
sc->vmbus_idtvec = lapic_ipi_alloc(pti ? IDTVEC(vmbus_isr_pti) :
IDTVEC(vmbus_isr));
if (sc->vmbus_idtvec < 0) {
+#if defined(__amd64__) && defined(KLD_MODULE)
+ pmap_pti_remove_kva(VMBUS_ISR_ADDR, VMBUS_ISR_ADDR + PAGE_SIZE);
+#endif
device_printf(sc->vmbus_dev, "cannot find free IDT vector\n");
return ENXIO;
}
@@ -1007,6 +1019,10 @@
sc->vmbus_idtvec = -1;
}
+#if defined(__amd64__) && defined(KLD_MODULE)
+ pmap_pti_remove_kva(VMBUS_ISR_ADDR, VMBUS_ISR_ADDR + PAGE_SIZE);
+#endif
+
CPU_FOREACH(cpu) {
if (VMBUS_PCPU_GET(sc, event_tq, cpu) != NULL) {
taskqueue_free(VMBUS_PCPU_GET(sc, event_tq, cpu));

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 27, 4:42 AM (11 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15611239
Default Alt Text
D30310.diff (1 KB)

Event Timeline