]> Zhao Yanbai Git Server - minix.git/commitdiff
VM - clear vminhibit iff it was set
authorTomas Hruby <thruby@few.vu.nl>
Sun, 6 Nov 2011 21:37:34 +0000 (21:37 +0000)
committerTomas Hruby <tom@minix3.org>
Fri, 13 Jan 2012 11:30:01 +0000 (11:30 +0000)
servers/vm/arch/i386/pagetable.c

index 4c0ee2008274052e7ba68b71309871eb7ebf94be..d516004a874c91349b4fa38fe094cd8dea853c4f 100644 (file)
@@ -672,14 +672,17 @@ PUBLIC int pt_writemap(struct vmproc * vmp,
        int ret = OK;
 
 #ifdef CONFIG_SMP
+       int vminhibit_clear = 0;
        /* FIXME
         * don't do it everytime, stop the process only on the first change and
         * resume the execution on the last change. Do in a wrapper of this
         * function
         */
        if (vmp && vmp->vm_endpoint != NONE && vmp->vm_endpoint != VM_PROC_NR &&
-                       !(vmp->vm_flags & VMF_EXITING))
+                       !(vmp->vm_flags & VMF_EXITING)) {
                sys_vmctl(vmp->vm_endpoint, VMCTL_VMINHIBIT_SET, 0);
+               vminhibit_clear = 1;
+       }
 #endif
 
        if(writemapflags & WMF_VERIFY)
@@ -780,9 +783,11 @@ PUBLIC int pt_writemap(struct vmproc * vmp,
 resume_exit:
 
 #ifdef CONFIG_SMP
-       if (vmp && vmp->vm_endpoint != NONE && vmp->vm_endpoint != VM_PROC_NR &&
-                       !(vmp->vm_flags & VMF_EXITING))
+       if (vminhibit_clear) {
+               assert(vmp && vmp->vm_endpoint != NONE && vmp->vm_endpoint != VM_PROC_NR &&
+                       !(vmp->vm_flags & VMF_EXITING));
                sys_vmctl(vmp->vm_endpoint, VMCTL_VMINHIBIT_CLEAR, 0);
+       }
 #endif
 
        return ret;