* [Qemu-devel] [PATCH] VMRUN should store the RIP after the instruction
@ 2008-06-04 14:56 Alexander Graf
2008-06-04 16:13 ` Anthony Liguori
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2008-06-04 14:56 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 216 bytes --]
VMRUN stores the IP which is used to return to the instruction after the
VMRUN in case of a VMEXIT. Due to recent changes, this does not happen
anymore and a VMEXIT simply returns to the VMRUN instruction.
Alex
[-- Attachment #2: qemu-svn-rip.patch --]
[-- Type: text/x-patch, Size: 596 bytes --]
Index: target-i386/op_helper.c
===================================================================
--- target-i386/op_helper.c (revision 4661)
+++ target-i386/op_helper.c (working copy)
@@ -4836,7 +4836,7 @@
svm_save_seg(env->vm_hsave + offsetof(struct vmcb, save.ds),
&env->segs[R_DS]);
- stq_phys(env->vm_hsave + offsetof(struct vmcb, save.rip), EIP);
+ stq_phys(env->vm_hsave + offsetof(struct vmcb, save.rip), EIP + 3);
stq_phys(env->vm_hsave + offsetof(struct vmcb, save.rsp), ESP);
stq_phys(env->vm_hsave + offsetof(struct vmcb, save.rax), EAX);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] VMRUN should store the RIP after the instruction
2008-06-04 14:56 [Qemu-devel] [PATCH] VMRUN should store the RIP after the instruction Alexander Graf
@ 2008-06-04 16:13 ` Anthony Liguori
2008-06-04 16:19 ` Alexander Graf
0 siblings, 1 reply; 4+ messages in thread
From: Anthony Liguori @ 2008-06-04 16:13 UTC (permalink / raw)
To: qemu-devel
Alexander Graf wrote:
> VMRUN stores the IP which is used to return to the instruction after
> the VMRUN in case of a VMEXIT. Due to recent changes, this does not
> happen anymore and a VMEXIT simply returns to the VMRUN instruction.
>
> Alex
The open-coded + 3 bothers me. Are there any circumstances that a
prefix could be used with vmrun that would change the instruction
length? vmrun doesn't appear to be affected by prefixes but I don't see
anything in the AMD manual specifically forbidding it.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] VMRUN should store the RIP after the instruction
2008-06-04 16:13 ` Anthony Liguori
@ 2008-06-04 16:19 ` Alexander Graf
2008-06-04 17:56 ` Anthony Liguori
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Graf @ 2008-06-04 16:19 UTC (permalink / raw)
To: qemu-devel
On Jun 4, 2008, at 6:13 PM, Anthony Liguori wrote:
> Alexander Graf wrote:
>> VMRUN stores the IP which is used to return to the instruction
>> after the VMRUN in case of a VMEXIT. Due to recent changes, this
>> does not happen anymore and a VMEXIT simply returns to the VMRUN
>> instruction.
>>
>> Alex
>
> The open-coded + 3 bothers me. Are there any circumstances that a
> prefix could be used with vmrun that would change the instruction
> length? vmrun doesn't appear to be affected by prefixes but I don't
> see anything in the AMD manual specifically forbidding it.
This is true and it bothers me as well. I am open to suggestions how
to receive the IP after the instruction that is about to be executed.
Probably this could be done in translate.c?
Alex
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] VMRUN should store the RIP after the instruction
2008-06-04 16:19 ` Alexander Graf
@ 2008-06-04 17:56 ` Anthony Liguori
0 siblings, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2008-06-04 17:56 UTC (permalink / raw)
To: Alexander Graf; +Cc: qemu-devel
Alexander Graf wrote:
>
> On Jun 4, 2008, at 6:13 PM, Anthony Liguori wrote:
>
>> Alexander Graf wrote:
>>> VMRUN stores the IP which is used to return to the instruction after
>>> the VMRUN in case of a VMEXIT. Due to recent changes, this does not
>>> happen anymore and a VMEXIT simply returns to the VMRUN instruction.
>>>
>>> Alex
>>
>> The open-coded + 3 bothers me. Are there any circumstances that a
>> prefix could be used with vmrun that would change the instruction
>> length? vmrun doesn't appear to be affected by prefixes but I don't
>> see anything in the AMD manual specifically forbidding it.
>
> This is true and it bothers me as well. I am open to suggestions how
> to receive the IP after the instruction that is about to be executed.
> Probably this could be done in translate.c?
Looks like Fabrice's commit handles it nicely.
Regards,
Anthony Liguori
> Alex
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-06-04 17:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-04 14:56 [Qemu-devel] [PATCH] VMRUN should store the RIP after the instruction Alexander Graf
2008-06-04 16:13 ` Anthony Liguori
2008-06-04 16:19 ` Alexander Graf
2008-06-04 17:56 ` Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).