- Apr 25, 2013
-
-
Guy Zana authored
-
Guy Zana authored
1. port the linux socket compatibility layer form freebsd 2. in freebsd, the compatibility is done to support execution of 32bit ELFs, so I had to rewrite most of the code in linux_socket.c 3. special note for sendmsg/recvmsg - I put an assert that we don't handle ancillary data (msg->msg_control), so calls that are made to these functions with msg->msg_control != NULL will fail. if a need emerge we can handle this part later. also, the original compatibility layer handled only 2 types of messages: credentials and rights, which we ignore in OSv.
-
Guy Zana authored
-
Guy Zana authored
-
- Apr 24, 2013
-
-
Nadav Har'El authored
A pthread created with the attribute pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); Does not need to be pthread_join()ed - and its resources, most importantly its stack, should be deleted as soon as it is done. Previously, we ignored this mode, causing its users (Java uses it for all its threads!) which do not ever pthread_join() on these threads, to leak the threads' stacks. This patch adds support for this mode, and adds a test to tst_leak.cc which verifies that before the patch, we had a leak, and now we don't. Unfortunately, this patch is a bit ugly, and I was surprised how much time it took me to actually get it to work :( Because of the convoluted relationships between pthread_*, pthread_private::pthread, sched::thread and sched::detached_thread, I ended up, after many rewrites (!) duplicating the "reaper" code from sched::detached_thread to do something very similar for detached pthreads. I.e., when a detached pthread finishes, it can't pthread_join() itself (which would cause a mess as it destroys its own stack) so instead it tells a different thread, the "reaper" thread, to run this pthread_join(). In the future it would be nice to create one generic "reaper" which is used by both detached sched::threads and pthreads, or even find a way to allow a thread to pthread_join itself as its last action.
-
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
-