From 34765bae7402189997b83b52b63e086dea3d8358 Mon Sep 17 00:00:00 2001 From: Tatsumi Hosokawa Date: Thu, 7 Jun 2001 15:18:33 +0000 Subject: Latest mutex fix was imcomplete and vmware2 port still hangs at vmmon kernel module. Added mutex code before and after calling vm operations in vmmon. Submitted by: John Baldwin Approved by: the Maintainer --- emulators/vmware3/files/patch-be | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 emulators/vmware3/files/patch-be (limited to 'emulators/vmware3') diff --git a/emulators/vmware3/files/patch-be b/emulators/vmware3/files/patch-be new file mode 100644 index 000000000000..0f1463f0bf84 --- /dev/null +++ b/emulators/vmware3/files/patch-be @@ -0,0 +1,63 @@ +--- vmmon-only/freebsd/hostif.c.orig Wed Jun 6 22:49:52 2001 ++++ vmmon-only/freebsd/hostif.c Thu Jun 7 13:13:02 2001 +@@ -107,7 +107,13 @@ + + paddr = (vm_offset_t)addr; + m = PHYS_TO_VM_PAGE(paddr); ++#if __FreeBSD_version >= 500013 ++ mtx_lock(&vm_mtx); ++#endif + vm_page_wire(m); ++#if __FreeBSD_version >= 500013 ++ mtx_unlock(&vm_mtx); ++#endif + return 0; + } + +@@ -120,7 +126,13 @@ + + paddr = (vm_offset_t)addr; + m = PHYS_TO_VM_PAGE(paddr); ++#if __FreeBSD_version >= 500013 ++ mtx_lock(&vm_mtx); ++#endif + vm_page_unwire(m, 1); ++#if __FreeBSD_version >= 500013 ++ mtx_unlock(&vm_mtx); ++#endif + return 0; + } + +@@ -1066,10 +1078,16 @@ + return NULL; + } + paddr = vtophys(addr); ++#if __FreeBSD_version >= 500013 ++ mtx_lock(&vm_mtx); ++#endif + ka->kaddr = kmem_alloc_pageable(kernel_map, PAGE_SIZE); + ka->map = PHYS_TO_VM_PAGE(paddr); + vm_page_wire(ka->map); + pmap_kenter(ka->kaddr, paddr); ++#if __FreeBSD_version >= 500013 ++ mtx_unlock(&vm_mtx); ++#endif + return ka->kaddr; + } + +@@ -1079,9 +1097,15 @@ + if (ka->map==NULL) + return 0; + ++#if __FreeBSD_version >= 500013 ++ mtx_lock(&vm_mtx); ++#endif + vm_page_unwire(ka->map, 1); + pmap_kremove(ka->kaddr); + kmem_free(kernel_map, ka->kaddr, PAGE_SIZE); ++#if __FreeBSD_version >= 500013 ++ mtx_unlock(&vm_mtx); ++#endif + ka->kaddr = 0; + ka->map = NULL; + return 0; -- cgit v1.2.3