- Dec 16, 2013
-
-
Tomasz Grabiec authored
Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Tomasz Grabiec authored
Dynamically loaded modules use __tls_get_addr() to locate thread local symbols. Symbol is identified by module index and offset in module's TLS area. Module index and offset are filled in by dynamic linker when DSO is loaded. TLS area for given DSO is allocated dynamically, on-demand. OSv keeps TLS areas in a vector indexed by module index, inside per-thread vector. TLS area of core module should be handled differently than that of dynamically loaded modules. The TLS offsets for thread local symbols defined in core module are known at link time and code inside core module can use these offsets directly. The offsets are relative to TCB pointer (fs register on x86). The problem was that __tls_get_addr() was treating core module as a dynamically loaded module and returned pointer inside dynamically allocated TLS area instead of a pointer inside core module's TLS. As a result code inside core module was reading value from different location than code inside DSO has written value to. The offending thread local varaible was __once_call. It was set by call_once() defined in DSO (inlined from a definition inside header) and read by __once_proxy() defined in core module. Fixes #125. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Tomasz Grabiec authored
In order to have unform naming, ulong is used in several places. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Tomasz Grabiec authored
Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Pekka Enberg authored
Clean up virtio-blk.cc by using 'auto' type specifier where possible. Reviewed-by:
Dor Laor <dor@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Move the x86-64 PTE definitions to a new arch specific arch-mmu.hh header file to make core/mmu.cc smaller and more portable. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Asias He authored
If iov->iov_len == 0, it will loop forever. uiomove() will take care of the zero iov len case. Signed-off-by:
Asias He <asias@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
The bsd specific ones are nenumbered to avoid clashes. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Since most SOL_* macros are equivalent to the IPPROTO_* defines, only one define needs to be changed. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Move them to a common include file. Since they're defined externally, there is no real conflict. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Avi Kivity authored
Unused. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Vlad authored
Switched the virtio-net driver to use if_transmit() instead of legacy if_start(). This saves us at least 2 additional lock/unlock sequences per-each mbuf since IF_ENQUEUE() and IF_DEQUEUE() take lock when pushing/removing the mbuf from the queue if ifnet in a legacy mode. Signed-off-by:
Vlad Zolotarov <vladz@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 15, 2013
-
-
Avi Kivity authored
Now that backtrace() doesn't use libunwind, we can remove it. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Nadav Har'El authored
This patch changes backtrace() to use the _Unwind_* facilities provided by the GCC runtime (libgcc_eh.a), instead of the separate libunwind.a. After this patch, we don't use libunwind.a in OSv any more, and it can be removed (see issue #83). Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Nadav Har'El authored
thread::destroy() had a "FIXME" comment: // FIXME: we have a problem in case of a race between join() and the // thread's completion. Here we can see _joiner==0 and not notify // anyone, but at the same time join() decided to go to sleep (because // status is not yet status::terminated) and we'll never wake it. This is indeed a bug, which Glauber discovered was hanging the tst-threadcomplete.so test once in a while - the test sometimes hangs with one thread in the "terminated" state (waiting for someone to join it), and a second thread waiting in join() but missed the other thread's termination event. The solution works like this: join() uses a CAS to set itself as the _joiner. If it succeeded, it waits like before for the status to become "terminated". But if the CAS failed, it means a concurrent destroy() call beat us at the race, and we can just return from join(). destroy() checks (with a CAS) if _joiner was already set - if so we need to wake this thread just like in the original code. But if _joiner was not yet set, either there is no-one doing join(), or there's a concurrent join() call that will soon return (this is what the joiner does when it loses the CAS race). In this case, all we need to do is to set the status to "terminated" - and we must do it through a _detached_state we saved earlier, because if join() already returned the thread may already be deleted). Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Nadav Har'El authored
wake_with(action) was implemented using thread_handle, as the following: thread_handle h(handle()); action(); h.wake(); This implementation is wrong: It only takes the RCU lock (which prevents the destruction of _detached_state) during h.wake(), meaning that if the thread is not sleeping, and action() causes it to exit, _detached_state may also be destructed, and h.wake() will crash. thread_handle is simply not needed for wake_with(), and was designed with a completely different use case in mind (long-term holding of a thread handler). We just need to use, in-line, the appropriate rcu lock which keeps _detached_state alive. The resulting code is even simpler, and nicely parallels the existing code of wake(). This patch fixes a real bug, but unfortunately we don't have a concrete test-case which it is known to fix. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Nadav Har'El authored
Add a new lock, "rcu_read_lock_in_preempt_disabled", which is exactly like rcu_read_lock but assuming that preemption is already disabled. Because all our rcu_read_lock does is to disable preemption, the new lock type currently does absolutely nothing - but in some future implementation of RCU it might need to do something. We'll use the new lock type in the following patch, as an optimization over the regular rcu_read_lock. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Glauber Costa authored
Context: going to wait with irqs_disabled is a call for disaster. While it is true that not every time we call wait we actually end up waiting, that should be an invalid call, due to the times we may wait. Because of that, it would be good to express that nonsense in an assertion. There is however, places we sleep with irqs disabled currently. Although they are technically safe, because we implicitly enable interrupts, they end up reaching wait() in a non-safe state. That happens in the page fault handler. Explicitly enabling interrupts will allow us to test for valid / invalid wait status. With this test applied, all tests in our whitelist still passes. Signed-off-by:
Glauber Costa <glommer@cloudius-systems.com> Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Dec 13, 2013
-
-
Raphael S. Carvalho authored
Signed-off-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Raphael S. Carvalho authored
Signed-off-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Raphael S. Carvalho authored
Signed-off-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 12, 2013
-
-
Avi Kivity authored
Fix a unicode character in the author's name. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Pekka Enberg authored
Make sure that the address range passed to munmap() is actually mapped. Reviewed-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Simplify mmap() by converting flags and permissions in one place. Reviewed-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Move mincore() to libc/mman.cc where all other memory mapping libc functions are. Reviewed-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Add a mmu::is_page_aligned() helper function and use it to get rid of open-coded checks. Reviewed-by:
Raphael S. Carvalho <raphaelsc@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Vlad Zolotarov authored
- It's compiled out when mode=release. - Uses an assert() for issuing the assert. - Has a printf-like semantics. Signed-off-by:
Vlad Zolotarov <vladz@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Vlad Zolotarov authored
- Add -DNDEBUG to the compiler flags when mode!=debug. - Prevent assert() from compiling out in kernel when mode=release Signed-off-by:
Vlad Zolotarov <vladz@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Vlad authored
Fix some compilation errors that would arrise when NDEBUG is defined: - tests/misc-tcp.cc: missing #include<iostream> that would come from include/boost/assert.hpp: line 81 when NDEBUG is not defined. - bsd/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c: when NDEBUG is not defined assert() is defined to __assert_fail, which has "noreturn" attribute, which satisfies the compiler. When NDEBUG is defined and assert() completly compiles out, the compiler start complaining about the missing "return" statment. Signed-off-by:
Vlad Zolotarov <vladz@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Vlad authored
Add the missing #infdef X #define X protection to include/api/assert.h Signed-off-by:
Vlad Zolotarov <vladz@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Tomasz Grabiec authored
This patch adds sorting as an option (-s). Examples: Not sorted: gdb$ osv trace duration Sorted, narrowed down to one function: gdb$ osv trace duration -s vfs_pwritev Not sorting allows us to start printing traces right away. There's also no need to keep them in memory, which makes the command a bit faster. Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Make blacklisted tests visible during test.py run to attract attention to them and hopefully get them fixed: TEST tst-strerror_r.so OK (1.083 s) TEST tst-threadcomplete.so SKIPPED TEST tst-tracepoint.so OK (1.120 s) Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
The test hangs at times and while there's a fix brewing, it's making 'make check' less useful. Lets add it back when it works all the time. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Juan Antonio Osorio authored
Previously, the variables image_file, cmd_args and opt_path were used globally along the run.py script, I did not consider this convenient and thus, opted to convert these global variables, into one variable that is passed as a parameter. This variables was renamed to options, with the mindset that, if desired, this variable could come from a configuration file, thus making the passing of command line arguments optional. So, if this functionality for a configuration file... Or perhaps default values, be added to the script, there would not be much need for refactoring (or renaming) as there would with these global variables. Reviewed-by:
Tomasz Grabiec <tgrabiec@gmail.com> Signed-off-by:
Juan Antonio Osorio Robles <jaosorior@gmail.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Tomasz Grabiec authored
The '-nographic' option is deprecated and no longer imposes the behavior which we want since this commit: qemu.git 02c4bdf1d2ca8c02a9bae16398f260b5c08d08bf We should use 'signal' option of the chardev instead, which works with current qemu master as well as on 1.4.0 This patch renames '-g' option to '-s' as the former no longer has adequate name. Reported-by:
Juan Antonio Osorio Robles <jaosorior@gmail.com> Signed-off-by:
Tomasz Grabiec <tgrabiec@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Nadav Har'El authored
After commit dc40b49e, the place of the _cpu and _status fields of a thread has moved (into a structure pointed by the _detached_thread field). So fix loader.py to use these new locations, so "osv info threads" will work again. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Dec 11, 2013
-
-
Pekka Enberg authored
There's no reason to run a locale test as part of OSv boot sequence... Avi writes: It used to be a major stumbling block but is of no interest now. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-