projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
42a67e9
)
Add explanatory comments to vm tests.
author
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 8 Jan 2006 03:24:27 +0000
(
03:24
+0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Sun, 8 Jan 2006 03:24:27 +0000
(
03:24
+0000)
22 files changed:
src/tests/vm/child-inherit.c
patch
|
blob
|
history
src/tests/vm/child-linear.c
patch
|
blob
|
history
src/tests/vm/child-mm-wrt.c
patch
|
blob
|
history
src/tests/vm/child-sort.c
patch
|
blob
|
history
src/tests/vm/mmap-bad-fd.c
patch
|
blob
|
history
src/tests/vm/mmap-clean.c
patch
|
blob
|
history
src/tests/vm/mmap-close.c
patch
|
blob
|
history
src/tests/vm/mmap-exit.c
patch
|
blob
|
history
src/tests/vm/mmap-inherit.c
patch
|
blob
|
history
src/tests/vm/mmap-misalign.c
patch
|
blob
|
history
src/tests/vm/mmap-null.c
patch
|
blob
|
history
src/tests/vm/mmap-over-code.c
patch
|
blob
|
history
src/tests/vm/mmap-over-data.c
patch
|
blob
|
history
src/tests/vm/mmap-over-stk.c
patch
|
blob
|
history
src/tests/vm/mmap-overlap.c
patch
|
blob
|
history
src/tests/vm/mmap-read.c
patch
|
blob
|
history
src/tests/vm/mmap-remove.c
patch
|
blob
|
history
src/tests/vm/mmap-shuffle.c
patch
|
blob
|
history
src/tests/vm/mmap-twice.c
patch
|
blob
|
history
src/tests/vm/mmap-unmap.c
patch
|
blob
|
history
src/tests/vm/mmap-write.c
patch
|
blob
|
history
src/tests/vm/mmap-zero.c
patch
|
blob
|
history
diff --git
a/src/tests/vm/child-inherit.c
b/src/tests/vm/child-inherit.c
index 431052065de64548dd81f5e487d5c55db3ed72ad..d3186a1bfbf72ab8a677f5d306b447f8a2d79b08 100644
(file)
--- a/
src/tests/vm/child-inherit.c
+++ b/
src/tests/vm/child-inherit.c
@@
-1,3
+1,7
@@
+/* Child process for mmap-inherit test.
+ Tries to write to a mapping present in the parent.
+ The process must be terminated with -1 exit code. */
+
#include <string.h>
#include "tests/vm/sample.inc"
#include "tests/lib.h"
#include <string.h>
#include "tests/vm/sample.inc"
#include "tests/lib.h"
diff --git
a/src/tests/vm/child-linear.c
b/src/tests/vm/child-linear.c
index 4fde22c6d4274785935e6f959c538bde5c8fb5fc..7515e4ebf2bc9f6e15e10a48e4b1b69ea95cb8c8 100644
(file)
--- a/
src/tests/vm/child-linear.c
+++ b/
src/tests/vm/child-linear.c
@@
-1,3
+1,7
@@
+/* Child process of page-parallel.
+ Encrypts 128 kB of zeros, then decrypts it, and ensures that
+ the zeros are back. */
+
#include <string.h>
#include "tests/arc4.h"
#include "tests/lib.h"
#include <string.h>
#include "tests/arc4.h"
#include "tests/lib.h"
diff --git
a/src/tests/vm/child-mm-wrt.c
b/src/tests/vm/child-mm-wrt.c
index 937272903b045731d387cd38ffeceb9c2e64ac07..8419788f79866df3db1f2b396e8c2092ebfdf1f2 100644
(file)
--- a/
src/tests/vm/child-mm-wrt.c
+++ b/
src/tests/vm/child-mm-wrt.c
@@
-1,3
+1,8
@@
+/* Child process of mmap-exit.
+ Mmaps a file and writes to it via the mmap'ing, then exits
+ without calling munmap. The data in the mapped region must be
+ written out at program termination. */
+
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
diff --git
a/src/tests/vm/child-sort.c
b/src/tests/vm/child-sort.c
index 638a66de2a190192955364e2cbeba2675df9b1d7..d755432cbd6dde76a2a34754bce422c3dafcb3d9 100644
(file)
--- a/
src/tests/vm/child-sort.c
+++ b/
src/tests/vm/child-sort.c
@@
-1,3
+1,7
@@
+/* Reads a 128 kB file and "sorts" the bytes in it, using
+ counting sort. The sorted data is written back to the same
+ file in-place. */
+
#include <debug.h>
#include <syscall.h>
#include "tests/lib.h"
#include <debug.h>
#include <syscall.h>
#include "tests/lib.h"
diff --git
a/src/tests/vm/mmap-bad-fd.c
b/src/tests/vm/mmap-bad-fd.c
index 14619963e3ec7616963911c4c5f9d1eeb3b41022..76a7b50e1092bc95f29d067c353a470dd5fac368 100644
(file)
--- a/
src/tests/vm/mmap-bad-fd.c
+++ b/
src/tests/vm/mmap-bad-fd.c
@@
-1,3
+1,7
@@
+/* Tries to mmap an invalid fd,
+ which must either fail silently or terminate the process with
+ exit code -1. */
+
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
diff --git
a/src/tests/vm/mmap-clean.c
b/src/tests/vm/mmap-clean.c
index c01f69cf3cb75aca8bf1b56fba6d9d3b17d19273..ea1dc9cb09ba54c795ee298c03eca32cfce4928c 100644
(file)
--- a/
src/tests/vm/mmap-clean.c
+++ b/
src/tests/vm/mmap-clean.c
@@
-1,3
+1,6
@@
+/* Verifies that mmap'd regions are only written back on munmap
+ if the data was actually modified in memory. */
+
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
diff --git
a/src/tests/vm/mmap-close.c
b/src/tests/vm/mmap-close.c
index f3533041d484429c4b5f4c4dc2c59d38f6df2e4a..d016ee304cdd2ddc86ae399d744866dbe8caf9f7 100644
(file)
--- a/
src/tests/vm/mmap-close.c
+++ b/
src/tests/vm/mmap-close.c
@@
-1,3
+1,5
@@
+/* Verifies that memory mappings persist after file close. */
+
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
diff --git
a/src/tests/vm/mmap-exit.c
b/src/tests/vm/mmap-exit.c
index 202e3c45ce53114cf87306f04a805d976b752fa3..7a2278a516a88b6ffba0749e041069f50bef3a36 100644
(file)
--- a/
src/tests/vm/mmap-exit.c
+++ b/
src/tests/vm/mmap-exit.c
@@
-1,3
+1,6
@@
+/* Executes child-mm-wrt and verifies that the writes that should
+ have occurred really did. */
+
#include <syscall.h>
#include "tests/vm/sample.inc"
#include "tests/lib.h"
#include <syscall.h>
#include "tests/vm/sample.inc"
#include "tests/lib.h"
diff --git
a/src/tests/vm/mmap-inherit.c
b/src/tests/vm/mmap-inherit.c
index 1c02c2471693dafa27808c6098c3b0f9c28ce1ef..7fa9607c41f78c495e75d2a8be30be9647d7e7b5 100644
(file)
--- a/
src/tests/vm/mmap-inherit.c
+++ b/
src/tests/vm/mmap-inherit.c
@@
-1,3
+1,6
@@
+/* Maps a file into memory and runs child-inherit to verify that
+ mappings are not inherited. */
+
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
diff --git
a/src/tests/vm/mmap-misalign.c
b/src/tests/vm/mmap-misalign.c
index d273468fa40e6701786f5c02e19de75838f3d7a4..34141a9e027f1b9d85ae94d548a52bd6bcbb383c 100644
(file)
--- a/
src/tests/vm/mmap-misalign.c
+++ b/
src/tests/vm/mmap-misalign.c
@@
-1,3
+1,5
@@
+/* Verifies that misaligned memory mappings are disallowed. */
+
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
diff --git
a/src/tests/vm/mmap-null.c
b/src/tests/vm/mmap-null.c
index 98d726990ee89589870828fa58f7d440baa80c90..f8ef075a0e59273b13ad4a2cded6e834ac4d7857 100644
(file)
--- a/
src/tests/vm/mmap-null.c
+++ b/
src/tests/vm/mmap-null.c
@@
-1,3
+1,5
@@
+/* Verifies that memory mappings at address 0 are disallowed. */
+
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
diff --git
a/src/tests/vm/mmap-over-code.c
b/src/tests/vm/mmap-over-code.c
index e64e449f1b6a341981d5bc10350cb2ffc7f3afb8..d3619a3ecc6b2048369b4020eec303545f11a7ad 100644
(file)
--- a/
src/tests/vm/mmap-over-code.c
+++ b/
src/tests/vm/mmap-over-code.c
@@
-1,3
+1,5
@@
+/* Verifies that mapping over the code segment is disallowed. */
+
#include <stdint.h>
#include <round.h>
#include <syscall.h>
#include <stdint.h>
#include <round.h>
#include <syscall.h>
diff --git
a/src/tests/vm/mmap-over-data.c
b/src/tests/vm/mmap-over-data.c
index 0f18a2ffd8c5faaa2855edde0fe7876dd9081608..9ea5d492e631f0049959e9740a459896197a7bcc 100644
(file)
--- a/
src/tests/vm/mmap-over-data.c
+++ b/
src/tests/vm/mmap-over-data.c
@@
-1,3
+1,5
@@
+/* Verifies that mapping over the data segment is disallowed. */
+
#include <stdint.h>
#include <round.h>
#include <syscall.h>
#include <stdint.h>
#include <round.h>
#include <syscall.h>
diff --git
a/src/tests/vm/mmap-over-stk.c
b/src/tests/vm/mmap-over-stk.c
index 4dbf8f3b777db81dc0d97e2aa9bfcb2de8c37e8b..4e241e8b15ba9abf83faa2806275bb0e97e1a4ee 100644
(file)
--- a/
src/tests/vm/mmap-over-stk.c
+++ b/
src/tests/vm/mmap-over-stk.c
@@
-1,3
+1,5
@@
+/* Verifies that mapping over the stack segment is disallowed. */
+
#include <stdint.h>
#include <round.h>
#include <syscall.h>
#include <stdint.h>
#include <round.h>
#include <syscall.h>
diff --git
a/src/tests/vm/mmap-overlap.c
b/src/tests/vm/mmap-overlap.c
index 8a7a022320aa104b31d201844112299255cdde7b..668ae5f0f69fe163c6157c2c46d60f76749cd3bf 100644
(file)
--- a/
src/tests/vm/mmap-overlap.c
+++ b/
src/tests/vm/mmap-overlap.c
@@
-1,3
+1,5
@@
+/* Verifies that overlapping memory mappings are disallowed. */
+
#include <syscall.h>
#include "tests/vm/sample.inc"
#include "tests/lib.h"
#include <syscall.h>
#include "tests/vm/sample.inc"
#include "tests/lib.h"
diff --git
a/src/tests/vm/mmap-read.c
b/src/tests/vm/mmap-read.c
index e4ca9613bee2425a44f6de394569e7c9fab62dc9..c0f23a1a3111cdbb113c152789a052852238ecdb 100644
(file)
--- a/
src/tests/vm/mmap-read.c
+++ b/
src/tests/vm/mmap-read.c
@@
-1,3
+1,5
@@
+/* Uses a memory mapping to read a file. */
+
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
diff --git
a/src/tests/vm/mmap-remove.c
b/src/tests/vm/mmap-remove.c
index 0964e4700e929d2c5e2eaced0b1f61d2ce6d4098..5f7444d99b7a25ccc8260d0d9cd6e05a95c287d5 100644
(file)
--- a/
src/tests/vm/mmap-remove.c
+++ b/
src/tests/vm/mmap-remove.c
@@
-1,3
+1,6
@@
+/* Deletes and closes file that is mapped into memory
+ and verifies that it can still be read through the mapping. */
+
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
diff --git
a/src/tests/vm/mmap-shuffle.c
b/src/tests/vm/mmap-shuffle.c
index 8ba625f81a0d7d999a908deb076df251685835e8..29921ad2919e74257428efe628d344e954fdcde2 100644
(file)
--- a/
src/tests/vm/mmap-shuffle.c
+++ b/
src/tests/vm/mmap-shuffle.c
@@
-1,3
+1,6
@@
+/* Creates a 128 kB file and repeatedly shuffles data in it
+ through a memory mapping. */
+
#include <stdio.h>
#include <string.h>
#include <syscall.h>
#include <stdio.h>
#include <string.h>
#include <syscall.h>
diff --git
a/src/tests/vm/mmap-twice.c
b/src/tests/vm/mmap-twice.c
index 1eca7a47b4a98cb1b6ed5f0c7fe90861298c0d33..d277a37272fa61bfce5b60f72d50909612084be1 100644
(file)
--- a/
src/tests/vm/mmap-twice.c
+++ b/
src/tests/vm/mmap-twice.c
@@
-1,3
+1,6
@@
+/* Maps the same file into memory twice and verifies that the
+ same data is readable in both. */
+
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
diff --git
a/src/tests/vm/mmap-unmap.c
b/src/tests/vm/mmap-unmap.c
index 9a6a173f36dc5284aef6d62bae5f75392aec041e..d35a79efc128c1a5be38cc13f0def7f0f953669e 100644
(file)
--- a/
src/tests/vm/mmap-unmap.c
+++ b/
src/tests/vm/mmap-unmap.c
@@
-1,3
+1,6
@@
+/* Maps and unmaps a file and verifies that the mapped region is
+ inaccessible afterward. */
+
#include <syscall.h>
#include "tests/vm/sample.inc"
#include "tests/lib.h"
#include <syscall.h>
#include "tests/vm/sample.inc"
#include "tests/lib.h"
diff --git
a/src/tests/vm/mmap-write.c
b/src/tests/vm/mmap-write.c
index b231282f96e4b1dc3c485d14b5a4e0aa168bf9ac..46e804349367aab3c0259bdf1f5ff87dddc1d2be 100644
(file)
--- a/
src/tests/vm/mmap-write.c
+++ b/
src/tests/vm/mmap-write.c
@@
-1,3
+1,7
@@
+/* Writes to a file through a mapping, and unmaps the file,
+ then reads the data in the file back using the read system
+ call to verify. */
+
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
#include <string.h>
#include <syscall.h>
#include "tests/vm/sample.inc"
diff --git
a/src/tests/vm/mmap-zero.c
b/src/tests/vm/mmap-zero.c
index 8b399c4d7b34d0e3b4796905910955f956efa9ff..368b759d48e0d989253a145de2c55c3f7b6ad066 100644
(file)
--- a/
src/tests/vm/mmap-zero.c
+++ b/
src/tests/vm/mmap-zero.c
@@
-1,3
+1,8
@@
+/* Tries to map a zero-length file, which may or may not work but
+ should not terminate the process or crash.
+ Then dereferences the address that we tried to map,
+ and the process must be terminated with -1 exit code. */
+
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"
#include <syscall.h>
#include "tests/lib.h"
#include "tests/main.h"