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:
Tomas Hruby
2010-03-22 07:42:52 +00:00
parent a5094f7d7f
commit 12ef495cac
7 changed files with 55 additions and 23 deletions

View File

@@ -84,4 +84,15 @@ i386/vm.h
#define CPUID1_ECX_SSE4_1 (1L << 19)
#define CPUID1_ECX_SSE4_2 (1L << 20)
#ifndef __ASSEMBLY__
#include <minix/type.h>
/* structure used by VM to pass data to the kernel while enabling paging */
struct vm_ep_data {
struct mem_map * mem_map;
vir_bytes data_seg_limit;
};
#endif
#endif /* __SYS_VM_386_H__ */

View File

@@ -68,7 +68,7 @@ _PROTOTYPE( int sys_vmctl_get_cr3_i386, (endpoint_t who, u32_t *cr3) );
_PROTOTYPE( int sys_vmctl_get_memreq, (endpoint_t *who, vir_bytes *mem,
vir_bytes *len, int *wrflag, endpoint_t *who_s, vir_bytes *mem_s,
endpoint_t *) );
_PROTOTYPE( int sys_vmctl_enable_paging, (struct mem_map *));
_PROTOTYPE( int sys_vmctl_enable_paging, (void * data));
_PROTOTYPE( int sys_readbios, (phys_bytes address, void *buf, size_t size));
_PROTOTYPE( int sys_stime, (time_t boottime));