lguest: make hypercalls use the vcpu struct

this patch changes do_hcall() and do_async_hcall() interfaces (and obviously their
callers) to get a vcpu struct. Again, a vcpu services the hypercall, not the whole
guest

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:27 -02:00
committed by Rusty Russell
parent 7ea07a1500
commit 73044f05a4
4 changed files with 44 additions and 36 deletions

View File

@@ -43,6 +43,10 @@ struct lguest;
struct lg_cpu {
unsigned int id;
struct lguest *lg;
/* If a hypercall was asked for, this points to the arguments. */
struct hcall_args *hcall;
u32 next_hcall;
};
/* The private info the thread maintains about the guest. */
@@ -65,13 +69,9 @@ struct lguest
u32 cr2;
int halted;
int ts;
u32 next_hcall;
u32 esp1;
u8 ss1;
/* If a hypercall was asked for, this points to the arguments. */
struct hcall_args *hcall;
/* Do we need to stop what we're doing and return to userspace? */
int break_out;
wait_queue_head_t break_wq;
@@ -178,9 +178,9 @@ void page_table_guest_data_init(struct lguest *lg);
void lguest_arch_host_init(void);
void lguest_arch_host_fini(void);
void lguest_arch_run_guest(struct lg_cpu *cpu);
void lguest_arch_handle_trap(struct lguest *lg);
int lguest_arch_init_hypercalls(struct lguest *lg);
int lguest_arch_do_hcall(struct lguest *lg, struct hcall_args *args);
void lguest_arch_handle_trap(struct lg_cpu *cpu);
int lguest_arch_init_hypercalls(struct lg_cpu *cpu);
int lguest_arch_do_hcall(struct lg_cpu *cpu, struct hcall_args *args);
void lguest_arch_setup_regs(struct lguest *lg, unsigned long start);
/* <arch>/switcher.S: */
@@ -191,7 +191,7 @@ int lguest_device_init(void);
void lguest_device_remove(void);
/* hypercalls.c: */
void do_hypercalls(struct lguest *lg);
void do_hypercalls(struct lg_cpu *cpu);
void write_timestamp(struct lguest *lg);
/*L:035