diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-07 08:05:31 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-01-30 06:50:10 -0500 |
commit | a3863f68b0d7fe2073c0f4efe534ec87a685c4fa (patch) | |
tree | e9fa7b67b7687f3f882e44654bd758671f7accb5 /drivers | |
parent | 0c78441cf4dd66f66e23dc085f0cc1e3e8669b96 (diff) |
lguest: make emulate_insn receive a vcpu struct.
emulate_insn() needs to know about current eip, which will be,
in the future, a per-vcpu thing. So in this patch, the function
prototype is modified to receive a vcpu struct
Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/lguest/x86/core.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c index d35f6299c92f..ae46c6b1f2f9 100644 --- a/drivers/lguest/x86/core.c +++ b/drivers/lguest/x86/core.c | |||
@@ -218,8 +218,9 @@ void lguest_arch_run_guest(struct lg_cpu *cpu) | |||
218 | * When the Guest uses one of these instructions, we get a trap (General | 218 | * When the Guest uses one of these instructions, we get a trap (General |
219 | * Protection Fault) and come here. We see if it's one of those troublesome | 219 | * Protection Fault) and come here. We see if it's one of those troublesome |
220 | * instructions and skip over it. We return true if we did. */ | 220 | * instructions and skip over it. We return true if we did. */ |
221 | static int emulate_insn(struct lguest *lg) | 221 | static int emulate_insn(struct lg_cpu *cpu) |
222 | { | 222 | { |
223 | struct lguest *lg = cpu->lg; | ||
223 | u8 insn; | 224 | u8 insn; |
224 | unsigned int insnlen = 0, in = 0, shift = 0; | 225 | unsigned int insnlen = 0, in = 0, shift = 0; |
225 | /* The eip contains the *virtual* address of the Guest's instruction: | 226 | /* The eip contains the *virtual* address of the Guest's instruction: |
@@ -292,7 +293,7 @@ void lguest_arch_handle_trap(struct lg_cpu *cpu) | |||
292 | * instructions which we need to emulate. If so, we just go | 293 | * instructions which we need to emulate. If so, we just go |
293 | * back into the Guest after we've done it. */ | 294 | * back into the Guest after we've done it. */ |
294 | if (lg->regs->errcode == 0) { | 295 | if (lg->regs->errcode == 0) { |
295 | if (emulate_insn(lg)) | 296 | if (emulate_insn(cpu)) |
296 | return; | 297 | return; |
297 | } | 298 | } |
298 | break; | 299 | break; |