lguest: per-vcpu lguest task management

lguest uses tasks to control its running behaviour (like sending
breaks, controlling halted state, etc). In a per-vcpu environment,
each vcpu will have its own underlying task. So this patch
makes the infrastructure for that possible

Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Glauber de Oliveira Costa
2008-01-07 11:05:34 -02:00
committed by Rusty Russell
parent fc708b3e40
commit 66686c2ab0
5 changed files with 42 additions and 39 deletions

View File

@@ -43,6 +43,8 @@ struct lguest;
struct lg_cpu {
unsigned int id;
struct lguest *lg;
struct task_struct *tsk;
struct mm_struct *mm; /* == tsk->mm, but that becomes NULL on exit */
/* At end of a page shared mapped over lguest_pages in guest. */
unsigned long regs_page;
@@ -55,6 +57,11 @@ struct lg_cpu {
/* Virtual clock device */
struct hrtimer hrt;
/* Do we need to stop what we're doing and return to userspace? */
int break_out;
wait_queue_head_t break_wq;
int halted;
/* Pending virtual interrupts */
DECLARE_BITMAP(irqs_pending, LGUEST_IRQS);
@@ -65,8 +72,6 @@ struct lg_cpu {
struct lguest
{
struct lguest_data __user *lguest_data;
struct task_struct *tsk;
struct mm_struct *mm; /* == tsk->mm, but that becomes NULL on exit */
struct lg_cpu cpus[NR_CPUS];
unsigned int nr_cpus;
@@ -76,15 +81,10 @@ struct lguest
void __user *mem_base;
unsigned long kernel_address;
u32 cr2;
int halted;
int ts;
u32 esp1;
u8 ss1;
/* Do we need to stop what we're doing and return to userspace? */
int break_out;
wait_queue_head_t break_wq;
/* Bitmap of what has changed: see CHANGED_* above. */
int changed;
struct lguest_pages *last_pages;