uint32_t pages = GV_HPAGES; /* Number of pages in the hash table */
vm_offset_t free = VMX_HPIDX_OFFSET; /* Offset into extension page of free area (128-byte aligned) */
uint32_t freeSize = PAGE_SIZE - free; /* Number of free bytes in the extension page */
uint32_t pages = GV_HPAGES; /* Number of pages in the hash table */
vm_offset_t free = VMX_HPIDX_OFFSET; /* Offset into extension page of free area (128-byte aligned) */
uint32_t freeSize = PAGE_SIZE - free; /* Number of free bytes in the extension page */
if ((pages * sizeof(addr64_t)) + (pages * sizeof(vm_offset_t)) > freeSize) {
panic("vmm_build_shadow_hash: too little pmap_vmm_ext free space\n");
if ((pages * sizeof(addr64_t)) + (pages * sizeof(vm_offset_t)) > freeSize) {
panic("vmm_build_shadow_hash: too little pmap_vmm_ext free space\n");
extPP = pmap_find_phys(kernel_pmap, (vm_offset_t)ext);
/* Get extension block's physical page number */
if (!extPP) { /* This should not fail, but then again... */
extPP = pmap_find_phys(kernel_pmap, (vm_offset_t)ext);
/* Get extension block's physical page number */
if (!extPP) { /* This should not fail, but then again... */
/* The hash table is typically larger than a single page, but we don't require it to be in a
contiguous virtual or physical chunk. So, we allocate it page by page, noting the effective and
physical address of each page in vmxHashPgList and vmxHashPgIdx, respectively. */
/* The hash table is typically larger than a single page, but we don't require it to be in a
contiguous virtual or physical chunk. So, we allocate it page by page, noting the effective and
physical address of each page in vmxHashPgList and vmxHashPgIdx, respectively. */
ret = kmem_alloc_wired(kernel_map, &ext->vmxHashPgList[idx], PAGE_SIZE);
/* Allocate a hash-table page */
if (ret != KERN_SUCCESS) goto fail; /* Allocation failed, exit through cleanup */
ret = kmem_alloc_wired(kernel_map, &ext->vmxHashPgList[idx], PAGE_SIZE);
/* Allocate a hash-table page */
if (ret != KERN_SUCCESS) goto fail; /* Allocation failed, exit through cleanup */
if (!ext->vmxHashPgIdx[idx]) { /* Hash-table page's LRA failed */
panic("vmm_build_shadow_hash: could not translate hash-table vaddr %08X\n", ext->vmxHashPgList[idx]);
}
if (!ext->vmxHashPgIdx[idx]) { /* Hash-table page's LRA failed */
panic("vmm_build_shadow_hash: could not translate hash-table vaddr %08X\n", ext->vmxHashPgList[idx]);
}
for (mapIdx = 0; mapIdx < GV_SLTS_PPG; mapIdx++) { /* Iterate over mappings in this page */
map->mpFlags = (mpGuest | mpgFree); /* Mark guest type and free */
map = (mapping_t *)((char *)map + GV_SLOT_SZ); /* Next slot-sized mapping */
for (mapIdx = 0; mapIdx < GV_SLTS_PPG; mapIdx++) { /* Iterate over mappings in this page */
map->mpFlags = (mpGuest | mpgFree); /* Mark guest type and free */
map = (mapping_t *)((char *)map + GV_SLOT_SZ); /* Next slot-sized mapping */
vmm_thread_index_t index)
{
vmmCntrlTable *CTable = act->machine.vmmControl; /* Get VMM control table */
vmm_thread_index_t index)
{
vmmCntrlTable *CTable = act->machine.vmmControl; /* Get VMM control table */
- pmap_t hpmap = act->map->pmap; /* Get host pmap */
- pmap_t gpmap = vmm_get_adsp(act, index); /* Get guest pmap */
+ hpmap = act->map->pmap; /* Get host pmap */
+ gpmap = vmm_get_adsp(act, index); /* Get guest pmap */
** Deactivate guest shadow assist
**
-----------------------------------------------------------------------*/
** Deactivate guest shadow assist
**
-----------------------------------------------------------------------*/
thread_t act,
vmm_thread_index_t index)
{
vmmCntrlEntry *CEntry = vmm_get_entry(act, index); /* Get context from index */
thread_t act,
vmm_thread_index_t index)
{
vmmCntrlEntry *CEntry = vmm_get_entry(act, index); /* Get context from index */
CEntry = vmm_get_entry(act, index); /* Convert index to entry */
if (!CEntry) { /* Caller guarantees that this will work */
CEntry = vmm_get_entry(act, index); /* Convert index to entry */
if (!CEntry) { /* Caller guarantees that this will work */
act, index);
return;
}
if(CEntry->vmmFacCtx.FPUsave) { /* Is there any floating point context? */
toss_live_fpu(&CEntry->vmmFacCtx); /* Get rid of any live context here */
act, index);
return;
}
if(CEntry->vmmFacCtx.FPUsave) { /* Is there any floating point context? */
toss_live_fpu(&CEntry->vmmFacCtx); /* Get rid of any live context here */
}
if(CEntry->vmmFacCtx.VMXsave) { /* Is there any vector context? */
toss_live_vec(&CEntry->vmmFacCtx); /* Get rid of any live context here */
}
if(CEntry->vmmFacCtx.VMXsave) { /* Is there any vector context? */
toss_live_vec(&CEntry->vmmFacCtx); /* Get rid of any live context here */
CTable->vmmGFlags = CTable->vmmGFlags & ~vmmLastAdSp; /* Make sure we don't try to automap into this */
CEntry->vmmFlags &= vmmInUse; /* Clear out all of the flags for this entry except in use */
CTable->vmmGFlags = CTable->vmmGFlags & ~vmmLastAdSp; /* Make sure we don't try to automap into this */
CEntry->vmmFlags &= vmmInUse; /* Clear out all of the flags for this entry except in use */
- CEntry->vmmFacCtx.FPUsave = 0; /* Clear facility context control */
- CEntry->vmmFacCtx.FPUlevel = 0; /* Clear facility context control */
+ CEntry->vmmFacCtx.FPUsave = NULL; /* Clear facility context control */
+ CEntry->vmmFacCtx.FPUlevel = NULL; /* Clear facility context control */
- CEntry->vmmFacCtx.VMXsave = 0; /* Clear facility context control */
- CEntry->vmmFacCtx.VMXlevel = 0; /* Clear facility context control */
+ CEntry->vmmFacCtx.VMXsave = NULL; /* Clear facility context control */
+ CEntry->vmmFacCtx.VMXlevel = NULL; /* Clear facility context control */
CEntry->vmmFacCtx.VMXcpu = 0; /* Clear facility context control */
vks = CEntry->vmmContextKern; /* Get address of the context page */
CEntry->vmmFacCtx.VMXcpu = 0; /* Clear facility context control */
vks = CEntry->vmmContextKern; /* Get address of the context page */
vks->interface_version = version; /* Set our version code */
vks->thread_index = index % vmmTInum; /* Tell the user the index for this virtual machine */
vks->interface_version = version; /* Set our version code */
vks->thread_index = index % vmmTInum; /* Tell the user the index for this virtual machine */
vmm_user_state = CAST_DOWN(vmm_state_page_t *, save->save_r4); /* Get the user address of the comm area */
if ((unsigned int)vmm_user_state & (PAGE_SIZE - 1)) { /* Make sure the comm area is page aligned */
vmm_user_state = CAST_DOWN(vmm_state_page_t *, save->save_r4); /* Get the user address of the comm area */
if ((unsigned int)vmm_user_state & (PAGE_SIZE - 1)) { /* Make sure the comm area is page aligned */
task_lock(task); /* Lock our task */
fact = (thread_t)task->threads.next; /* Get the first activation on task */
task_lock(task); /* Lock our task */
fact = (thread_t)task->threads.next; /* Get the first activation on task */
for(i = 0; i < task->thread_count; i++) { /* All of the activations */
if(fact->machine.vmmControl) { /* Is this a virtual machine monitor? */
for(i = 0; i < task->thread_count; i++) { /* All of the activations */
if(fact->machine.vmmControl) { /* Is this a virtual machine monitor? */
CTable = act->machine.vmmControl; /* Get the control table address */
if ((unsigned int)CTable == 1) { /* If we are marked, try to allocate a new table, otherwise we have one */
if(!(CTable = (vmmCntrlTable *)kalloc(sizeof(vmmCntrlTable)))) { /* Get a fresh emulation control table */
CTable = act->machine.vmmControl; /* Get the control table address */
if ((unsigned int)CTable == 1) { /* If we are marked, try to allocate a new table, otherwise we have one */
if(!(CTable = (vmmCntrlTable *)kalloc(sizeof(vmmCntrlTable)))) { /* Get a fresh emulation control table */
ml_set_interrupts_enabled(FALSE); /* Set back interruptions */
save->save_r3 = KERN_RESOURCE_SHORTAGE; /* No storage... */
return 1;
ml_set_interrupts_enabled(FALSE); /* Set back interruptions */
save->save_r3 = KERN_RESOURCE_SHORTAGE; /* No storage... */
return 1;
CTable->vmmc[cvi].vmmContextPhys = conphys; /* Remember the state page physical addr */
CTable->vmmc[cvi].vmmContextUser = vmm_user_state; /* Remember user address of comm area */
CTable->vmmc[cvi].vmmContextPhys = conphys; /* Remember the state page physical addr */
CTable->vmmc[cvi].vmmContextUser = vmm_user_state; /* Remember user address of comm area */
- CTable->vmmc[cvi].vmmFacCtx.FPUsave = 0; /* Clear facility context control */
- CTable->vmmc[cvi].vmmFacCtx.FPUlevel = 0; /* Clear facility context control */
+ CTable->vmmc[cvi].vmmFacCtx.FPUsave = NULL; /* Clear facility context control */
+ CTable->vmmc[cvi].vmmFacCtx.FPUlevel = NULL; /* Clear facility context control */
- CTable->vmmc[cvi].vmmFacCtx.VMXsave = 0; /* Clear facility context control */
- CTable->vmmc[cvi].vmmFacCtx.VMXlevel = 0; /* Clear facility context control */
+ CTable->vmmc[cvi].vmmFacCtx.VMXsave = NULL; /* Clear facility context control */
+ CTable->vmmc[cvi].vmmFacCtx.VMXlevel = NULL; /* Clear facility context control */
CTable->vmmc[cvi].vmmFacCtx.VMXcpu = 0; /* Clear facility context control */
CTable->vmmc[cvi].vmmFacCtx.facAct = act; /* Point back to the activation */
CTable->vmmc[cvi].vmmFacCtx.VMXcpu = 0; /* Clear facility context control */
CTable->vmmc[cvi].vmmFacCtx.facAct = act; /* Point back to the activation */
- pmap_t hpmap = act->map->pmap; /* Get host pmap */
- pmap_t gpmap = pmap_create(0, FALSE); /* Make a fresh guest pmap */
+ hpmap = act->map->pmap; /* Get host pmap */
+ gpmap = pmap_create(0, FALSE); /* Make a fresh guest pmap */
if (gpmap) { /* Did we succeed ? */
CTable->vmmAdsp[cvi] = gpmap; /* Remember guest pmap for new context */
if (lowGlo.lgVMMforcedFeats & vmmGSA) { /* Forcing on guest shadow assist ? */
if (gpmap) { /* Did we succeed ? */
CTable->vmmAdsp[cvi] = gpmap; /* Remember guest pmap for new context */
if (lowGlo.lgVMMforcedFeats & vmmGSA) { /* Forcing on guest shadow assist ? */
ml_set_interrupts_enabled(FALSE); /* Set back interruptions */
save->save_r3 = ret; /* Pass back return code... */
return 1;
ml_set_interrupts_enabled(FALSE); /* Set back interruptions */
save->save_r3 = ret; /* Pass back return code... */
return 1;
CEntry = vmm_get_entry(act, index); /* Convert index to entry */
if (CEntry == NULL) return KERN_FAILURE; /* Either this isn't vmm thread or the index is bogus */
ml_set_interrupts_enabled(TRUE); /* This can take a bit of time so pass interruptions */
CEntry = vmm_get_entry(act, index); /* Convert index to entry */
if (CEntry == NULL) return KERN_FAILURE; /* Either this isn't vmm thread or the index is bogus */
ml_set_interrupts_enabled(TRUE); /* This can take a bit of time so pass interruptions */
if(CEntry->vmmFacCtx.FPUsave) { /* Is there any floating point context? */
toss_live_fpu(&CEntry->vmmFacCtx); /* Get rid of any live context here */
if(CEntry->vmmFacCtx.FPUsave) { /* Is there any floating point context? */
toss_live_fpu(&CEntry->vmmFacCtx); /* Get rid of any live context here */
}
if(CEntry->vmmFacCtx.VMXsave) { /* Is there any vector context? */
toss_live_vec(&CEntry->vmmFacCtx); /* Get rid of any live context here */
}
if(CEntry->vmmFacCtx.VMXsave) { /* Is there any vector context? */
toss_live_vec(&CEntry->vmmFacCtx); /* Get rid of any live context here */
- CEntry->vmmPmap = 0; /* Remove this trace */
- pmap_t gpmap = act->machine.vmmControl->vmmAdsp[index - 1];
+ CEntry->vmmPmap = NULL; /* Remove this trace */
+ gpmap = act->machine.vmmControl->vmmAdsp[index - 1];
/* Get context's guest pmap (if any) */
if (gpmap) { /* Check if there is an address space assigned here */
if (gpmap->pmapFlags & pmapVMgsaa) { /* Handle guest shadow assist case specially */
/* Get context's guest pmap (if any) */
if (gpmap) { /* Check if there is an address space assigned here */
if (gpmap->pmapFlags & pmapVMgsaa) { /* Handle guest shadow assist case specially */
CTable->vmmGFlags = CTable->vmmGFlags & ~vmmLastAdSp; /* Make sure we don't try to automap into this */
CEntry->vmmFlags = 0; /* Clear out all of the flags for this entry including in use */
CTable->vmmGFlags = CTable->vmmGFlags & ~vmmLastAdSp; /* Make sure we don't try to automap into this */
CEntry->vmmFlags = 0; /* Clear out all of the flags for this entry including in use */
- CEntry->vmmContextKern = 0; /* Clear the kernel address of comm area */
- CEntry->vmmContextUser = 0; /* Clear the user address of comm area */
+ CEntry->vmmContextKern = NULL; /* Clear the kernel address of comm area */
+ CEntry->vmmContextUser = NULL; /* Clear the user address of comm area */
- CEntry->vmmFacCtx.FPUsave = 0; /* Clear facility context control */
- CEntry->vmmFacCtx.FPUlevel = 0; /* Clear facility context control */
+ CEntry->vmmFacCtx.FPUsave = NULL; /* Clear facility context control */
+ CEntry->vmmFacCtx.FPUlevel = NULL; /* Clear facility context control */
- CEntry->vmmFacCtx.VMXsave = 0; /* Clear facility context control */
- CEntry->vmmFacCtx.VMXlevel = 0; /* Clear facility context control */
+ CEntry->vmmFacCtx.VMXsave = NULL; /* Clear facility context control */
+ CEntry->vmmFacCtx.VMXlevel = NULL; /* Clear facility context control */
for(cvi = 0; cvi < kVmmMaxContexts; cvi++) { /* Search to find a free slot */
if(CTable->vmmc[cvi].vmmFlags & vmmInUse) { /* Return if there are still some in use */
for(cvi = 0; cvi < kVmmMaxContexts; cvi++) { /* Search to find a free slot */
if(CTable->vmmc[cvi].vmmFlags & vmmInUse) { /* Return if there are still some in use */
mapping_remove(act->machine.vmmControl->vmmAdsp[index - 1], 0xFFFFFFFFFFFFF000LL); /* Remove final page explicitly because we might have mapped it */
pmap_remove(act->machine.vmmControl->vmmAdsp[index - 1], 0, 0xFFFFFFFFFFFFF000LL); /* Remove all entries from this map */
pmap_destroy(act->machine.vmmControl->vmmAdsp[index - 1]); /* Toss the pmap for this context */
mapping_remove(act->machine.vmmControl->vmmAdsp[index - 1], 0xFFFFFFFFFFFFF000LL); /* Remove final page explicitly because we might have mapped it */
pmap_remove(act->machine.vmmControl->vmmAdsp[index - 1], 0, 0xFFFFFFFFFFFFF000LL); /* Remove all entries from this map */
pmap_destroy(act->machine.vmmControl->vmmAdsp[index - 1]); /* Toss the pmap for this context */
if (pmap->pmapVmmExt) { /* Release any VMM pmap extension block and shadow hash table */
vmm_release_shadow_hash(pmap->pmapVmmExt); /* Release extension block and shadow hash table */
if (pmap->pmapVmmExt) { /* Release any VMM pmap extension block and shadow hash table */
vmm_release_shadow_hash(pmap->pmapVmmExt); /* Release extension block and shadow hash table */
pmap->pmapVmmExtPhys = 0; /* Forget extension block's physical address, too */
}
pmap->pmapFlags &= ~pmapVMhost; /* We're no longer hosting */
kfree(CTable, sizeof(vmmCntrlTable)); /* Toss the table because to tossed the last context */
pmap->pmapVmmExtPhys = 0; /* Forget extension block's physical address, too */
}
pmap->pmapFlags &= ~pmapVMhost; /* We're no longer hosting */
kfree(CTable, sizeof(vmmCntrlTable)); /* Toss the table because to tossed the last context */
for(cvi = 1; cvi <= kVmmMaxContexts; cvi++) { /* Look at all slots */
if(CTable->vmmc[cvi - 1].vmmFlags & vmmInUse) { /* Is this one in use */
ret = vmm_tear_down_context(act, cvi); /* Take down the found context */
if(ret != KERN_SUCCESS) { /* Did it go away? */
for(cvi = 1; cvi <= kVmmMaxContexts; cvi++) { /* Look at all slots */
if(CTable->vmmc[cvi - 1].vmmFlags & vmmInUse) { /* Is this one in use */
ret = vmm_tear_down_context(act, cvi); /* Take down the found context */
if(ret != KERN_SUCCESS) { /* Did it go away? */
- panic("vmm_tear_down_all: vmm_tear_down_context failed; ret=%08X, act = %08X, cvi = %d\n",
+ panic("vmm_tear_down_all: vmm_tear_down_context failed; ret=%08X, act = %p, cvi = %d\n",
ret = hw_res_map_gv(map->pmap, pmap, cva, ava, getProtPPC(prot, TRUE));
/* Attempt to resume an existing gv->phys mapping */
if (mapRtOK != ret) { /* Nothing to resume, construct a new mapping */
ret = hw_res_map_gv(map->pmap, pmap, cva, ava, getProtPPC(prot, TRUE));
/* Attempt to resume an existing gv->phys mapping */
if (mapRtOK != ret) { /* Nothing to resume, construct a new mapping */
while (1) { /* Find host mapping or fail */
mp = mapping_find(map->pmap, cva, &nextva, 0);
while (1) { /* Find host mapping or fail */
mp = mapping_find(map->pmap, cva, &nextva, 0);
- unsigned int mflags = (pindex << 16) | mpGuest;
- addr64_t gva = ((ava & ~mpHWFlags) | (wimg << 3) | getProtPPC(prot, TRUE));
+ mflags = (pindex << 16) | mpGuest;
+ gva = ((ava & ~mpHWFlags) | (wimg << 3) | getProtPPC(prot, TRUE));
hw_add_map_gv(map->pmap, pmap, gva, mflags, mp->mpPAddr);
/* Construct new guest->phys mapping */
hw_add_map_gv(map->pmap, pmap, gva, mflags, mp->mpPAddr);
/* Construct new guest->phys mapping */
prot = ava & vmmlProt; /* Extract the protection bits */
adsp = (ava & vmmlAdID) >> 4; /* Extract an explicit address space request */
prot = ava & vmmlProt; /* Extract the protection bits */
adsp = (ava & vmmlAdID) >> 4; /* Extract an explicit address space request */
- if(!adsp) adsp = index - 1; /* If no explicit, use supplied default */
- ava = ava &= 0xFFFFFFFFFFFFF000ULL; /* Clean up the address */
+ if(!adsp) /* If no explicit, use supplied default */
+ adsp = index - 1;
+ ava &= 0xFFFFFFFFFFFFF000ULL; /* Clean up the address */
ret = vmm_map_page(act, index, cva, ava, prot); /* Go try to map the page on in */
ret = vmm_map_page(act, index, cva, ava, prot); /* Go try to map the page on in */
- if(cnt > kVmmMaxUnmapPages) return KERN_FAILURE; /* They tried to unmap too many */
- if(!cnt) return KERN_SUCCESS; /* If they said none, we're done... */
+ if(cnt > kVmmMaxUnmapPages) { /* They tried to unmap too many */
+ kern_result = KERN_FAILURE;
+ goto out;
+ }
+ if(!cnt) { /* If they said none, we're done... */
+ kern_result = KERN_SUCCESS;
+ goto out;
+ }
for(i = 0; i < cnt; i++) { /* Step and release all pages in list */
if(flavor) { /* Check if 32- or 64-bit addresses */
for(i = 0; i < cnt; i++) { /* Step and release all pages in list */
if(flavor) { /* Check if 32- or 64-bit addresses */
if (pmap->pmapFlags & pmapVMgsaa) { /* Handle guest shadow assist specially */
hw_susp_map_gv(act->map->pmap, pmap, gva);
/* Suspend the mapping */
if (pmap->pmapFlags & pmapVMgsaa) { /* Handle guest shadow assist specially */
hw_susp_map_gv(act->map->pmap, pmap, gva);
/* Suspend the mapping */
mapping_remove(pmap, 0xFFFFFFFFFFFFF000LL); /* Remove final page explicitly because we might have mapped it */
pmap_remove(pmap, 0, 0xFFFFFFFFFFFFF000LL); /* Remove all entries from this map */
}
mapping_remove(pmap, 0xFFFFFFFFFFFFF000LL); /* Remove final page explicitly because we might have mapped it */
pmap_remove(pmap, 0, 0xFFFFFFFFFFFFF000LL); /* Remove all entries from this map */
}
- panic("vmm_get_page_dirty_flag: hw_test_rc failed - rc = %d, pmap = %08X, va = %016llX\n", RC, pmap, va);
+ panic("vmm_get_page_dirty_flag: hw_test_rc failed - rc = %d, pmap = %p, va = %016llX\n", RC, pmap, va);
- panic("vmm_protect_page: hw_protect failed - rc = %d, pmap = %08X, va = %016llX\n", ret, pmap, (addr64_t)va);
+ panic("vmm_protect_page: hw_protect failed - rc = %d, pmap = %p, va = %016llX\n", ret, pmap, (addr64_t)va);
bcopy((char *)&sv->save_fp0, (char *)&(CEntry->vmmContextKern->vmm_proc_state.ppcFPRs), 32 * 8); /* 32 registers */
return KERN_SUCCESS;
}
bcopy((char *)&sv->save_fp0, (char *)&(CEntry->vmmContextKern->vmm_proc_state.ppcFPRs), 32 * 8); /* 32 registers */
return KERN_SUCCESS;
}
act->machine.specFlags &= ~vectorCng; /* Clear the special flag */
CEntry->vmmContextKern->vmmStat &= ~vmmVectCngd; /* Clear the change indication */
act->machine.specFlags &= ~vectorCng; /* Clear the special flag */
CEntry->vmmContextKern->vmmStat &= ~vmmVectCngd; /* Clear the change indication */
vrvalidwrk = sv->save_vrvalid; /* Get the valid flags */
for(i = 0; i < 32; i++) { /* Copy the saved registers and invalidate the others */
vrvalidwrk = sv->save_vrvalid; /* Get the valid flags */
for(i = 0; i < 32; i++) { /* Copy the saved registers and invalidate the others */
CEntry = vmm_get_entry(act, index); /* Convert index to entry */
if (CEntry == NULL) return KERN_FAILURE; /* Either this isn't vmm thread or the index is bogus */
CEntry = vmm_get_entry(act, index); /* Convert index to entry */
if (CEntry == NULL) return KERN_FAILURE; /* Either this isn't vmm thread or the index is bogus */
if((unsigned int)&CTable->vmmc[cvi] == (unsigned int)act->machine.vmmCEntry) { /* Is this the running VM? */
sv = find_user_regs(act); /* Get the user state registers */
if(!sv) { /* Did we find something? */
if((unsigned int)&CTable->vmmc[cvi] == (unsigned int)act->machine.vmmCEntry) { /* Is this the running VM? */
sv = find_user_regs(act); /* Get the user state registers */
if(!sv) { /* Did we find something? */
}
sv->save_exception = kVmmReturnNull*4; /* Indicate that this is a null exception */
vmm_force_exit(act, sv); /* Intercept a running VM */
}
sv->save_exception = kVmmReturnNull*4; /* Indicate that this is a null exception */
vmm_force_exit(act, sv); /* Intercept a running VM */
if (act->machine.qactTimer == 0 || soonest <= act->machine.qactTimer)
act->machine.qactTimer = soonest; /* Set lowest timer */
}
if (act->machine.qactTimer == 0 || soonest <= act->machine.qactTimer)
act->machine.qactTimer = soonest; /* Set lowest timer */
}
task_lock(task); /* Lock our task */
fact = (thread_t)task->threads.next; /* Get the first activation on task */
task_lock(task); /* Lock our task */
fact = (thread_t)task->threads.next; /* Get the first activation on task */
for(i = 0; i < task->thread_count; i++) { /* All of the activations */
if(fact->machine.vmmControl) { /* Is this a virtual machine monitor? */
for(i = 0; i < task->thread_count; i++) { /* All of the activations */
if(fact->machine.vmmControl) { /* Is this a virtual machine monitor? */
for(cvi = 0; cvi < kVmmMaxContexts; cvi++) { /* Search slots */
if((0x80000000 & vmmask) && (CTable->vmmc[cvi].vmmFlags & vmmInUse)) { /* See if we need to stop and if it is in use */
for(cvi = 0; cvi < kVmmMaxContexts; cvi++) { /* Search slots */
if((0x80000000 & vmmask) && (CTable->vmmc[cvi].vmmFlags & vmmInUse)) { /* See if we need to stop and if it is in use */
if(act->machine.vmmCEntry && (act->machine.vmmCEntry->vmmFlags & vmmXStop)) { /* Do we need to stop the running guy? */
sv = find_user_regs(act); /* Get the user state registers */
if(!sv) { /* Did we find something? */
if(act->machine.vmmCEntry && (act->machine.vmmCEntry->vmmFlags & vmmXStop)) { /* Do we need to stop the running guy? */
sv = find_user_regs(act); /* Get the user state registers */
if(!sv) { /* Did we find something? */
}
sv->save_exception = kVmmStopped*4; /* Set a "stopped" exception */
vmm_force_exit(act, sv); /* Intercept a running VM */
}
ml_set_interrupts_enabled(inter); /* Put interrupts back to what they were */
}
sv->save_exception = kVmmStopped*4; /* Set a "stopped" exception */
vmm_force_exit(act, sv); /* Intercept a running VM */
}
ml_set_interrupts_enabled(inter); /* Put interrupts back to what they were */