VM - clear vminhibit iff it was set

This commit is contained in:
Tomas Hruby 2011-11-06 21:37:34 +00:00 committed by Tomas Hruby
parent 758d788bbe
commit 974452d4dd

View File

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