- May 06, 2013
-
-
Avi Kivity authored
Absolute symbolic links refer to the host directory structure, while we want them to refer to the external/ tree. Since we have several trees, we can't just rebase them, so walk down the tree trying to find a match. Fragile and ugly, but seems to work.
-
Nadav Har'El authored
As Avi suggested in his review, let's not have the read-size memory ordering code in the queue implementation - just in the caller if it is needed (and usually, it won't be needed).
-
Avi Kivity authored
Change to the standard .cc, so it picks up the correct flags (and builds silently).
-
Nadav Har'El authored
Fixed bug in the lock-free queue's push() implementation, which was reproduced in the already-committed test. The implementation was based on an incorrect understanding of the C++ compare_exchange operation. Normally, a CAS operation only tries to write to the variable we're trying to write too (in this case, the head of the pushlist). If the previous ("expected") value has already changed, nothing is done. But C++'s compare_exchange, to my complete surprise, when the write failed, copies the new (unexpected) value into the "expected" variable. So I had to fix the push() implementation to assume actual behavior of compare_exchange, not my make-believe one. This commit also includes various other code cleanups.
-
Nadav Har'El authored
Add a much better test for the lock-free multi-producer single-consumer queue implementation, where a 20 threads push numbers onto the queue, and a single consumer reads them and verifies that they all are received and in the right order. This test uncovered a bug which will be fixed by a later commit. The test added here patch was written using C++11's concurrency APIs (std::thread, std::condition_variable, etc.) instead of osv's own APIs, for two reasons: 1. It also helped uncover a bunch of bugs in our pthread and C++11 thread support, so this test can double as another pthread test. 2. It allows running the same test in Linux, to tell if a certain bug is a bug in lockfree:queue_mpsc, or in underlying osv scheduler mechanisms.
-
Nadav Har'El authored
the TLS), which led to preempt_counter not being intialized to zero and therefore preemption not being enabled for new threads. Such non-preemptable threads can monopolize their CPU and cause other threads with the misfortune of being assigned to this CPU to never run. This patch adds a simple test reproducing this bug. Because we don't have an implementation of __tls_get_addr(), we can't "extern" a TLS symbol (here sched::preempt_counter) from the test, and so I had to create a new sched::get_preempt_counter() function which I can "extern" from the test.
-
Avi Kivity authored
Somehow this worked by accident, but we need to zero the .tbss section or random data will be used to initialize it.
-
Avi Kivity authored
Since we're packing the entire file system into the boot image, it has overflowed the 128MB limit that was set for it. Adjust the boot loader during build time to account for the actual loaded size. Fixes wierd corruption during startup.
-
- May 02, 2013
-
-
Nadav Har'El authored
Convert our pthread implementation's condition variables to use the previously committed zero-initializable condition variables. Now PTHREAD_COND_INITIALIZER works as expected, and so do C++11's condition variables.
-
Nadav Har'El authored
Added some basic tests for condition variables. I'm sure more tests can be written but this is a good start. They didn't find any bug, however, so as Avi says, it may mean the test isn't good enough, not there isn't a bug ;-) By the way, I also checked the condition variables in more runs using pthread (not yet committed), and Java (which uses condition variables), and they seem to be working fine.
-
Avi Kivity authored
-
Avi Kivity authored
-
Avi Kivity authored
When a file incorrectly is used as a directory ("/bin/sh/foo"), namei() detects this and fails, but returns 0 as the error code. Later on open() uses an uninitialized vnode and segaults. Fix by returning ENOENT. Fixes fontconfig segfault when it randomly tries to open files as Mac fonts with resource/data forks.
-
Avi Kivity authored
Following Linux, and not following the manual page.
-
Avi Kivity authored
-
Avi Kivity authored
Needed by fontconfig.
-
Avi Kivity authored
Wanted by fontconfig.
-
Avi Kivity authored
-
Avi Kivity authored
-
Avi Kivity authored
Needed by fontconfig.
-
Avi Kivity authored
fontconfig.so is loaded without a fully qualified path; it expects the search path to be used.
-
Avi Kivity authored
Files without '/' need to be looked up via a search path.
-
Avi Kivity authored
-
Avi Kivity authored
-
Avi Kivity authored
-
Avi Kivity authored
We have a class file, and a wrapping struct file, and they conflict. Rename 'class file'. Long term it should disappear.
-
Avi Kivity authored
This allows inserting tracepoints.
-
Avi Kivity authored
Not sure we want it, but for now, it makes the resolver stuff work.
-
Avi Kivity authored
Our hostname is now "osv.local".
-
Avi Kivity authored
Used by the JVM, apparently in libawt.so startup.
-
- May 01, 2013
-
-
Guy Zana authored
-
Guy Zana authored
we unintentionally ran over the file structure by providing it as an argument to be written to.
-
Guy Zana authored
to describe their purpose better.
-
Guy Zana authored
-
Guy Zana authored
-
Nadav Har'El authored
Previously we had two different mutex types - "mutex_t" defined by <osv/mutex.h> for use in C code, and "mutex" defined by <mutex.hh> for use in C++ code. This is difference is unnecessary, and causes a mess for functions that need to accept either type, so they work for both C++ and C code (e.g., consider condvar_wait()). So after this commit, we have just one include file, <osv/mutex.h> which works both in C and C++ code. This results in the same type and same functions being defined, plus some additional conveniences when in C++, such as method variants of the functions (e.g., m.lock() in addition to mutex_lock(m)), and the "with_lock" function. The mutex type is now called either "mutex_t" or "struct mutex" in C code, or can also be called just "mutex" in C++ code (all three names refer to an identical type - there's no longer a different mutex_t and mutex type). This commit also modifies all the includers of <mutex.hh> to use <osv/mutex.h>, and fixes a few miscelleneous compilation issues that were discovered in the process.
-
Avi Kivity authored
Add C string support to tracepoints.
-
Avi Kivity authored
Command lines such as -e '--trace=tp*' will try to do shell wildcard expansion, which is unwanted here.
-
Avi Kivity authored
-
Avi Kivity authored
Encode a C string by copying its value to the buffer, instead of just storing the pointer as we do for pointers to other types. Only the first 49 characters are stored. The buffer size is static, but this limitation can be lifted later.
-