Skip to content
Snippets Groups Projects
Commit f136f328 authored by Avi Kivity's avatar Avi Kivity
Browse files

sched: copy the tls image to a new thread, instead of zeroing it

With the current memset(), every thread starts out with zero-initialized
tls variables.

Switch to memcpy(), so it gets the proper static initializer.

Fixes conf-preempt=0.
parent f704ae77
No related branches found
No related tags found
No related merge requests found
......@@ -80,7 +80,7 @@ void thread::setup_tcb()
assert(tls.size);
// FIXME: respect alignment
void* p = malloc(sched::tls.size + sizeof(*_tcb));
memset(p, 0, sched::tls.size);
memcpy(p, sched::tls.start, sched::tls.size);
_tcb = static_cast<thread_control_block*>(p + tls.size);
_tcb->self = _tcb;
_tcb->tls_base = p;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment