- Mar 21, 2013
-
-
Avi Kivity authored
Used the wrong bit.
-
- Mar 19, 2013
-
-
Avi Kivity authored
Due to the "red zone", stack operations may corrupt local variables. Use ordinary moves and jumps instead.
-
Avi Kivity authored
Normal scheduling does not need to save or restore the fpu when switching threads, since all fpu registers are caller-saved (so calling schedule()) may clobber the fpu). However this does not hold on preemption, so we need to save and restore the fpu state explicitly.
-
Avi Kivity authored
-
Avi Kivity authored
Parse cpuid flag bits relevant to osv.
-
Avi Kivity authored
-
Avi Kivity authored
-
Avi Kivity authored
-
- Mar 07, 2013
-
-
Avi Kivity authored
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.
-
- Mar 06, 2013
-
-
Avi Kivity authored
-
Avi Kivity authored
This only implements SIGSEGv delivery to the thread that triggered it (i.e., it must be unblocked).
-
- Mar 04, 2013
-
-
Avi Kivity authored
Found by eclipse.
-
- Mar 03, 2013
-
-
Avi Kivity authored
Split the core scheduler into a function for calling from interrupts, and a wrapper for calling it from normal paths. Call the preemptible path from interrupt handlers.
-
Avi Kivity authored
-
Avi Kivity authored
With preemption, we may switch threads in an interrupt. This means we can no longer use a per-cpu exception stack, since every thread in the system can potentially be preempted. Switch to a per-thread exception stack instead. This adds overhead to the context switch path, but it is negligible (a single memory write).
-
Avi Kivity authored
Currently it is uninitialized, which breaks things later on.
-
- Mar 01, 2013
-
-
Avi Kivity authored
We did not correctly skip memory regions above the PCI hole during the first phase of mapping memory below 1G.
-
Avi Kivity authored
Due to a cut-and-paste error, the area below 1GB was double freed if more than 1GB was present, leading to freelist corruption.
-
- Feb 28, 2013
-
-
Avi Kivity authored
boost::format allocates, and we're not quite ready to schedule at this state; drop the debug message (unneeded anyhow).
-
- Feb 27, 2013
-
-
Avi Kivity authored
We also make the deleter configurable so we can use munmap() or similar to destroy the stack of payload threads.
-
Avi Kivity authored
Previously, we performed idle processing in the scheduler, in the context of the thread that is being scheudled out. This makes preemption more complicated, since every thread can potentially be in the idle loop simultaneously, having been preempted there some time in the past. Obviously we can't disable interrupts in the idle loop. Move idle processing to its own thread to fix this problem. This is currently sub-optimal since we don't have priority classes yet (or even just priorities), so the idle thread can be scheduled before workload threads. If that happens it will examine the runqueue and yield if there's anything there.
-
- Feb 26, 2013
-
-
Avi Kivity authored
Otherwise, expect memory corruption.
-
Avi Kivity authored
See README for instructions.
-
- Feb 24, 2013
-
-
Avi Kivity authored
We need it from several places; use a function to find it.
-
- Feb 23, 2013
-
-
Avi Kivity authored
While easy to use, auto-starting threads generates problems when more complicated initialization takes place. Rather than making auto-start optional (as Guy suggested), remove it completely, to keep the API simple. Use thread::start() to start a thread. Unstarted threads ignore wakeups until started.
-
- Feb 21, 2013
-
-
Avi Kivity authored
We don't want to be preempted during a context switch, since thread state invariants will not be maintained.
-
Avi Kivity authored
We store it in a global rather than passing it on the stack since it's only useful in a few contexts. Our interrupts don't nest so it's pretty simple.
-
- Feb 19, 2013
-
-
Avi Kivity authored
Also add an arch independent name for it.
-
- Feb 11, 2013
-
-
Avi Kivity authored
This avoids spurious interrupts from the PIC (even though it has been disabled).
-
Avi Kivity authored
-
Avi Kivity authored
-
Avi Kivity authored
At present, a trivial algorithm is used: wake up once in a while, look for a less-loaded cpu, and push a waiting thread from this cpu to the other cpu. This is very simple wrt. locking, since the waiting thread is guaranteed not to be running, and to be on the runqueue of the load balancer thread.
-
Avi Kivity authored
This allows copying thread::attr objects around without leaking stacks.
-
Avi Kivity authored
-
Avi Kivity authored
-
- Feb 07, 2013
-
-
Avi Kivity authored
This makes it easy to configure a thread with various parameters. The first is the existing stack_info parameter.
-
Avi Kivity authored
The apic needs to be programmed on each cpu that is brought up.
-
Avi Kivity authored
We used cpu_arch::init_on_cpu() instead of the arch-indepdendent version.
-
- Feb 06, 2013
-
-
Avi Kivity authored
Each cpu has a queue (actually an array of queues, one for each "waking" cpu) of threads that are to be woken. A thread can be queued locklessly, so a runqueue lock is not needed. As we don't IPI yet, the queues are polled at strategic points.
-
Avi Kivity authored
While generally useful, it helps now to avoid wakeups to threads that are no longer there.
-