- Apr 24, 2013
-
-
Avi Kivity authored
This reverts commit efa61687. Its purpose was already done by commit 61679ede. Pointed out by Nadav.
-
Avi Kivity authored
-
Avi Kivity authored
-
Avi Kivity authored
Memory debugging facility. Compile with conf-memory_debug=1.
-
Avi Kivity authored
This allocator works by giving each allocation its own virtual address range which is not reused for later allocations. After a free(), the range is made inaccessible, forever, so use-after-free will result in a page fault. Sub-page overruns are also detected by filling unallocated space with a pattern, and checking whether the pattern has been altered during free().
-
Avi Kivity authored
(gdb) osv pagetable walk $addr
-
Avi Kivity authored
Early code may enable interrupts and get hit by a spurious interrupt.
-
Avi Kivity authored
If we are preempted in wait_until() while the thread state is waiting, the scheduler will put us to sleep; then a wake() will arrive, and we'll go back to sleep in me->wait(), for which no wakeup is guaranteed. Disable preemption to avoid this case.
-
Avi Kivity authored
yield() has a random preempt_enable in it, drop.
-
Avi Kivity authored
-
Avi Kivity authored
-
Avi Kivity authored
Will be used for the overrun detector.
-
Avi Kivity authored
Easier for most users.
-
Avi Kivity authored
Prepare for an alternate leak-detecting implementation.
-
Avi Kivity authored
0xffff800000000000 is used by Xen, so avoid it.
-
Guy Zana authored
-
Guy Zana authored
needed for the implementation of F_DUPFD in fcntl()
-
- Apr 23, 2013
-
-
Guy Zana authored
-
Guy Zana authored
the kern_xxx functions are needed by the linux compatibility layer.
-
Guy Zana authored
-
Guy Zana authored
-
Guy Zana authored
needed by linux_socket compatibility layer.
-
Guy Zana authored
-
Guy Zana authored
-
Guy Zana authored
-
Guy Zana authored
-
Avi Kivity authored
Eliminate duplication.
-
Nadav Har'El authored
When memory is badly corrupted, our attempt to print "Aborted" in abort() can cause an endless recursion of abort()s, filling the stack and eventually (since we don't have a stack guard) everything. Let's just avoid printing the "Aborted" message if inside an abort().
-
Nadav Har'El authored
In flush_tlb() avoid the ipi and synchronization protocol if there's just one cpu. We still a tiny amount of memory and a vector for this purpose even if there's just one cpu (if it really bothers anyone, I can fix this too...).
-
Avi Kivity authored
Happens in some corner cases.
-
Avi Kivity authored
-
Avi Kivity authored
The current implementation returns 1, leading the JRE to optimize for a uniprocessor host. Unfortunately those optimizations are unsafe on SMP, leading to hangs. Fix by returning the real number of processors.
-
Avi Kivity authored
-
Nadav Har'El authored
Sorry, also forgot to commit this earlier! Add a new function to send API to all processors accept this one.
-
Nadav Har'El authored
-
- Apr 22, 2013
-
-
Nadav Har'El authored
Previously, on mmap()/munmap()/mprotect() we only flushed the current processor's TLB. This was wrong, and this patch adds a test in tst-mmap.cc to check this case - one thread writes to memory successfully, a second thread on a second cpu mprotects() this memory, and the first thread then writes - and wrongfully succeeds because the TLB was not flushed on its CPU. Fixed the bug by having tlb_flush() send an IPI to all processors (but itself) telling them to flush their TLB. The call to tlb_flush() doesn't return until all processors flush their TLB. All of this is slow, but necessary for correctness... The new test in tst-mmap.cc now passes (i.e., the second write fails as expected). Unfortunately, this doesn't fix any of the systemic bugs we noticed earlier, but will surely have caused some bug in the future if we didn't fix it.
-
Nadav Har'El authored
The page fault handler used to abort() if the current thread wasn't a pthread thread - instead of calling the handler. I don't see any reason to do this - and it ruined my ability to catch desired write faults in the two-thread (and two cpu) mprotect() tests.
-
Nadav Har'El authored
Previously, we had the option to create a pinned thread, but it always runs on the same CPU as the current thread, which is kind of odd. Changed the boolean attribute "pinned" to a cpu* attribute specifying the cpu to pin to. Example code to run a start a new thread pinned on cpu 1: new sched::thread([&]{...}, sched::thread::attr(sched::cpus[1])); I need this feature to test the cross-CPU TLB flushing feature - I need to be able to run two threads on two different CPUs.
-
Nadav Har'El authored
Changed mmap tests from tst-hub include to a separate .so, making it easier to run separately. Also removed a bunch of redundant dependencies from build.mak.
-
Nadav Har'El authored
Added build ("make") framework for compiling Java code we want to run in OSv (in/with the Java payload), as well as JNI, i.e., OSv-specific C code we want to run from the above Java code. The Java source files in java/src/ are now all compiled during build (see java/build.xml for the Ant file doing this compilation) and the result is one JAR, build/$mode/java/cloudius.jar (/cloudius.jar in bootfs). We can easily change build.xml to create more than one if we want. As an example of JNI, I used the not-working-yet balloon feature. java/src/com/cloudius/balloon/Balloon.java is the class com.cloudius.balloon.Balloon which is supposed to have one "native" (implemented in C) function giveup(). This function's implementation is in java/jni/balloon.c. We get this file to compile to balloon.so (put in /usr/lib/jni in the bootfs) by adding java/jni/balloon.so to the "jni" list in build.mak. If you don't know how write the ugly function signature as seen in java/jni/balloon.c, you can run "javah com.cloudius.balloon.Balloon" to build the empty functions needed for implementing the native functions defined in the above class.
-