Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80916
b: refs/heads/master
c: 5e232f4
h: refs/heads/master
v: v3
  • Loading branch information
Glauber de Oliveira Costa authored and Rusty Russell committed Jan 30, 2008
1 parent 284914e commit 913af06
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4665ac8e28c30c2a015c617c55783c0bf3a49c05
refs/heads/master: 5e232f4f428c4266ba5cdae9f23ba19a0913dcf9
6 changes: 3 additions & 3 deletions trunk/drivers/lguest/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ int run_guest(struct lg_cpu *cpu, unsigned long __user *user)

/* It's possible the Guest did a NOTIFY hypercall to the
* Launcher, in which case we return from the read() now. */
if (lg->pending_notify) {
if (put_user(lg->pending_notify, user))
if (cpu->pending_notify) {
if (put_user(cpu->pending_notify, user))
return -EFAULT;
return sizeof(lg->pending_notify);
return sizeof(cpu->pending_notify);
}

/* Check for signals */
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/lguest/hypercalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static void do_hcall(struct lg_cpu *cpu, struct hcall_args *args)
cpu->halted = 1;
break;
case LHCALL_NOTIFY:
lg->pending_notify = args->arg1;
cpu->pending_notify = args->arg1;
break;
default:
/* It should be an architecture-specific hypercall. */
Expand Down Expand Up @@ -154,7 +154,7 @@ static void do_async_hcalls(struct lg_cpu *cpu)

/* Stop doing hypercalls if they want to notify the Launcher:
* it needs to service this first. */
if (lg->pending_notify)
if (cpu->pending_notify)
break;
}
}
Expand Down Expand Up @@ -219,7 +219,7 @@ void do_hypercalls(struct lg_cpu *cpu)
/* If we stopped reading the hypercall ring because the Guest did a
* NOTIFY to the Launcher, we want to return now. Otherwise we do
* the hypercall. */
if (!cpu->lg->pending_notify) {
if (!cpu->pending_notify) {
do_hcall(cpu, cpu->hcall);
/* Tricky point: we reset the hcall pointer to mark the
* hypercall as "done". We use the hcall pointer rather than
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/lguest/lg.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ struct lg_cpu {
u32 esp1;
u8 ss1;

unsigned long pending_notify; /* pfn from LHCALL_NOTIFY */

/* At end of a page shared mapped over lguest_pages in guest. */
unsigned long regs_page;
struct lguest_regs *regs;
Expand Down Expand Up @@ -95,7 +97,6 @@ struct lguest
struct pgdir pgdirs[4];

unsigned long noirq_start, noirq_end;
unsigned long pending_notify; /* pfn from LHCALL_NOTIFY */

unsigned int stack_pages;
u32 tsc_khz;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/lguest/lguest_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ static ssize_t read(struct file *file, char __user *user, size_t size,loff_t*o)

/* If we returned from read() last time because the Guest notified,
* clear the flag. */
if (lg->pending_notify)
lg->pending_notify = 0;
if (cpu->pending_notify)
cpu->pending_notify = 0;

/* Run the Guest until something interesting happens. */
return run_guest(cpu, (unsigned long __user *)user);
Expand Down

0 comments on commit 913af06

Please sign in to comment.