Skip to content

Commit

Permalink
Merge pull request #137 from hangpark/develop
Browse files Browse the repository at this point in the history
Release v3.1
  • Loading branch information
hangpark authored May 20, 2017
2 parents d685864 + ddc3436 commit c2d696c
Show file tree
Hide file tree
Showing 14 changed files with 328 additions and 167 deletions.
44 changes: 43 additions & 1 deletion src/tests/vm/Make.tests
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
tests/vm_TESTS = $(addprefix tests/vm/,pt-grow-stack pt-grow-pusha \
pt-grow-bad pt-big-stk-obj pt-bad-addr pt-bad-read pt-write-code \
pt-write-code2 pt-grow-stk-sc page-linear page-parallel page-merge-seq \
page-merge-par page-merge-stk page-shuffle)
page-merge-par page-merge-stk page-merge-mm page-shuffle mmap-read \
mmap-close mmap-unmap mmap-overlap mmap-twice mmap-write mmap-exit \
mmap-shuffle mmap-bad-fd mmap-clean mmap-inherit mmap-misalign \
mmap-null mmap-over-code mmap-over-data mmap-over-stk mmap-remove \
mmap-zero)

tests/vm_PROGS = $(tests/vm_TESTS) $(addprefix tests/vm/,child-linear \
child-sort child-qsort child-qsort-mm child-mm-wrt child-inherit)
Expand All @@ -29,10 +33,32 @@ tests/vm/page-merge-par_SRC = tests/vm/page-merge-par.c \
tests/vm/parallel-merge.c tests/arc4.c tests/lib.c tests/main.c
tests/vm/page-merge-stk_SRC = tests/vm/page-merge-stk.c \
tests/vm/parallel-merge.c tests/arc4.c tests/lib.c tests/main.c
tests/vm/page-merge-mm_SRC = tests/vm/page-merge-mm.c \
tests/vm/parallel-merge.c tests/arc4.c tests/lib.c tests/main.c
tests/vm/page-shuffle_SRC = tests/vm/page-shuffle.c tests/arc4.c \
tests/cksum.c tests/lib.c tests/main.c
tests/vm/mmap-read_SRC = tests/vm/mmap-read.c tests/lib.c tests/main.c
tests/vm/mmap-close_SRC = tests/vm/mmap-close.c tests/lib.c tests/main.c
tests/vm/mmap-unmap_SRC = tests/vm/mmap-unmap.c tests/lib.c tests/main.c
tests/vm/mmap-overlap_SRC = tests/vm/mmap-overlap.c tests/lib.c tests/main.c
tests/vm/mmap-twice_SRC = tests/vm/mmap-twice.c tests/lib.c tests/main.c
tests/vm/mmap-write_SRC = tests/vm/mmap-write.c tests/lib.c tests/main.c
tests/vm/mmap-exit_SRC = tests/vm/mmap-exit.c tests/lib.c tests/main.c
tests/vm/mmap-shuffle_SRC = tests/vm/mmap-shuffle.c tests/arc4.c \
tests/cksum.c tests/lib.c tests/main.c
tests/vm/mmap-bad-fd_SRC = tests/vm/mmap-bad-fd.c tests/lib.c tests/main.c
tests/vm/mmap-clean_SRC = tests/vm/mmap-clean.c tests/lib.c tests/main.c
tests/vm/mmap-inherit_SRC = tests/vm/mmap-inherit.c tests/lib.c tests/main.c
tests/vm/mmap-misalign_SRC = tests/vm/mmap-misalign.c tests/lib.c \
tests/main.c
tests/vm/mmap-null_SRC = tests/vm/mmap-null.c tests/lib.c tests/main.c
tests/vm/mmap-over-code_SRC = tests/vm/mmap-over-code.c tests/lib.c \
tests/main.c
tests/vm/mmap-over-data_SRC = tests/vm/mmap-over-data.c tests/lib.c \
tests/main.c
tests/vm/mmap-over-stk_SRC = tests/vm/mmap-over-stk.c tests/lib.c tests/main.c
tests/vm/mmap-remove_SRC = tests/vm/mmap-remove.c tests/lib.c tests/main.c
tests/vm/mmap-zero_SRC = tests/vm/mmap-zero.c tests/lib.c tests/main.c

tests/vm/child-linear_SRC = tests/vm/child-linear.c tests/arc4.c tests/lib.c
tests/vm/child-qsort_SRC = tests/vm/child-qsort.c tests/vm/qsort.c tests/lib.c
Expand All @@ -44,13 +70,29 @@ tests/vm/child-inherit_SRC = tests/vm/child-inherit.c tests/lib.c tests/main.c

tests/vm/pt-bad-read_PUTFILES = tests/vm/sample.txt
tests/vm/pt-write-code2_PUTFILES = tests/vm/sample.txt
tests/vm/mmap-close_PUTFILES = tests/vm/sample.txt
tests/vm/mmap-read_PUTFILES = tests/vm/sample.txt
tests/vm/mmap-unmap_PUTFILES = tests/vm/sample.txt
tests/vm/mmap-twice_PUTFILES = tests/vm/sample.txt
tests/vm/mmap-overlap_PUTFILES = tests/vm/zeros
tests/vm/mmap-exit_PUTFILES = tests/vm/child-mm-wrt
tests/vm/page-parallel_PUTFILES = tests/vm/child-linear
tests/vm/page-merge-seq_PUTFILES = tests/vm/child-sort
tests/vm/page-merge-par_PUTFILES = tests/vm/child-sort
tests/vm/page-merge-stk_PUTFILES = tests/vm/child-qsort
tests/vm/page-merge-mm_PUTFILES = tests/vm/child-qsort-mm
tests/vm/mmap-clean_PUTFILES = tests/vm/sample.txt
tests/vm/mmap-inherit_PUTFILES = tests/vm/sample.txt tests/vm/child-inherit
tests/vm/mmap-misalign_PUTFILES = tests/vm/sample.txt
tests/vm/mmap-null_PUTFILES = tests/vm/sample.txt
tests/vm/mmap-over-code_PUTFILES = tests/vm/sample.txt
tests/vm/mmap-over-data_PUTFILES = tests/vm/sample.txt
tests/vm/mmap-over-stk_PUTFILES = tests/vm/sample.txt
tests/vm/mmap-remove_PUTFILES = tests/vm/sample.txt

tests/vm/page-linear.output: TIMEOUT = 300
tests/vm/page-shuffle.output: TIMEOUT = 600
tests/vm/mmap-shuffle.output: TIMEOUT = 600
tests/vm/page-merge-seq.output: TIMEOUT = 600
tests/vm/page-merge-par.output: TIMEOUT = 600

Expand Down
103 changes: 0 additions & 103 deletions src/tests/vm/Make.tests.orig

This file was deleted.

16 changes: 16 additions & 0 deletions src/tests/vm/Rubric.functionality
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,20 @@ Functionality of virtual memory subsystem:
3 page-shuffle
4 page-merge-seq
4 page-merge-par
4 page-merge-mm
4 page-merge-stk

- Test "mmap" system call.
2 mmap-read
2 mmap-write
2 mmap-shuffle

2 mmap-twice

2 mmap-unmap
1 mmap-exit

3 mmap-clean

2 mmap-close
2 mmap-remove
30 changes: 0 additions & 30 deletions src/tests/vm/Rubric.functionality.orig

This file was deleted.

14 changes: 14 additions & 0 deletions src/tests/vm/Rubric.robustness
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,17 @@ Robustness of virtual memory subsystem:
2 pt-write-code
3 pt-write-code2
4 pt-grow-bad

- Test robustness of "mmap" system call.
1 mmap-bad-fd
1 mmap-inherit
1 mmap-null
1 mmap-zero

2 mmap-misalign

2 mmap-over-code
2 mmap-over-data
2 mmap-over-stk
2 mmap-overlap

21 changes: 0 additions & 21 deletions src/tests/vm/Rubric.robustness.orig

This file was deleted.

3 changes: 3 additions & 0 deletions src/threads/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,9 @@ init_thread (struct thread *t, const char *name, int priority)
#ifdef USERPROG
list_init (&(&t->process)->child_list);
list_init (&(&t->process)->file_list);
#ifdef VM
list_init (&(&t->process)->mmap_list);
#endif
#endif
}

Expand Down
6 changes: 3 additions & 3 deletions src/userprog/exception.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "userprog/gdt.h"
#include "userprog/syscall.h"

#define STACK_LIMIT 0x40000000
#define STACK_LIMIT ((void *) 0x40000000)

/* Number of page faults processed. */
static long long page_fault_cnt;
Expand Down Expand Up @@ -164,7 +164,7 @@ page_fault (struct intr_frame *f)
/* Stack growth. */
uint32_t *esp = user ? f->esp : thread_current ()->esp;
if (STACK_LIMIT <= fault_addr && fault_addr < PHYS_BASE
&& esp - 16 <= fault_addr && suppl_pt_get_page (upage) == NULL)
&& (void *) (esp - 16) <= fault_addr && suppl_pt_get_page (upage) == NULL)
{
if (!suppl_pt_set_zero (upage))
goto page_level_protection_violation;
Expand All @@ -173,9 +173,9 @@ page_fault (struct intr_frame *f)
/* Load page from appropriate source. */
if (suppl_pt_load_page (upage))
return;
#endif

page_level_protection_violation:
#endif
/* Change EIP to the next instruction address which is saved on
EAX, and set EAX by -1 to return the failure code. */
if (!user)
Expand Down
Loading

0 comments on commit c2d696c

Please sign in to comment.