atomicity fix when enabling paging
- before enabling paging VM asks kernel to resize its segments. This may cause kernel to segfault if APIC is used and an interrupt happens between this and paging enabled. As these are 2 separate vmctl calls it is not atomic. This patch fixes this problem. VM does not ask kernel to resize the segments in a separate call anymore. The new segments limit is part of the "enable paging" call. It generalizes this call in such a way that more information can be passed as need be or the information may be completely different if another architecture requires this.
This commit is contained in:
@@ -127,15 +127,7 @@ PUBLIC int do_vmctl(struct proc * caller, message * m_ptr)
|
||||
vm_init(p);
|
||||
if(!vm_running)
|
||||
panic("do_vmctl: paging enabling failed");
|
||||
if ((err = arch_enable_paging()) != OK) {
|
||||
return err;
|
||||
}
|
||||
if(newmap(caller, p, (struct mem_map *) m_ptr->SVMCTL_VALUE) != OK)
|
||||
panic("do_vmctl: newmap failed");
|
||||
FIXLINMSG(p);
|
||||
assert(p->p_delivermsg_lin ==
|
||||
umap_local(p, D, p->p_delivermsg_vir, sizeof(message)));
|
||||
return OK;
|
||||
return arch_enable_paging(caller, m_ptr);
|
||||
case VMCTL_KERN_PHYSMAP:
|
||||
{
|
||||
int i = m_ptr->SVMCTL_VALUE;
|
||||
|
||||
Reference in New Issue
Block a user