* [PATCH] retry instruction on svm emulation failure
@ 2011-05-18 9:05 Paolo Bonzini
2011-05-18 10:08 ` Keir Fraser
0 siblings, 1 reply; 3+ messages in thread
From: Paolo Bonzini @ 2011-05-18 9:05 UTC (permalink / raw)
To: xen-devel, pbonzini
From: pbonzini@redhat.com
# HG changeset patch
# User Paolo Bonzini <pbonzini@redhat.com>
# Date 1305708694 -7200
# Node ID 8605c877b972c82a385915e38c0171952621ac3c
# Parent e1452f8088dc667ca57cc1c5a63983a5131d1314
retry instruction on svm emulation failure
Upon emulation failure, Xen injects a #GP into the guest on AMD machines.
However, this kind of #GP does not happen in hardware. It is possible
(and was observed in practice) that the failure is transient. It will
go away naturally if the instruction is retried, because the guest will
be executing other code and will not exit.
Of course, this bears the possibility that the failure was the result
of a hypervisor bug, and that the guest will hang as a result. But even
in this case the outcome is not worse than getting a general-protection
fault (except for extra CPU consumption), and it will be much easier to
inspect the guest to see what's going on.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
diff --git a/xen/arch/x86/hvm/svm/emulate.c b/xen/arch/x86/hvm/svm/emulate.c
--- a/xen/arch/x86/hvm/svm/emulate.c
+++ b/xen/arch/x86/hvm/svm/emulate.c
@@ -200,7 +200,6 @@ int __get_instruction_length_from_list(s
gdprintk(XENLOG_WARNING,
"%s: Mismatch between expected and actual instruction bytes: "
"eip = %lx\n", __func__, (unsigned long)vmcb->rip);
- hvm_inject_exception(TRAP_gp_fault, 0, 0);
return 0;
done:
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] retry instruction on svm emulation failure
2011-05-18 9:05 [PATCH] retry instruction on svm emulation failure Paolo Bonzini
@ 2011-05-18 10:08 ` Keir Fraser
2011-05-18 21:08 ` Wei Huang
0 siblings, 1 reply; 3+ messages in thread
From: Keir Fraser @ 2011-05-18 10:08 UTC (permalink / raw)
To: Paolo Bonzini, xen-devel
On 18/05/2011 10:05, "Paolo Bonzini" <pbonzini@redhat.com> wrote:
> retry instruction on svm emulation failure
>
> Upon emulation failure, Xen injects a #GP into the guest on AMD machines.
> However, this kind of #GP does not happen in hardware. It is possible
> (and was observed in practice) that the failure is transient. It will
> go away naturally if the instruction is retried, because the guest will
> be executing other code and will not exit.
It begs the question why we were emulating the instruction in the first
place. I'd like to see further explanation, with a concrete example, before
applying this patch. Or get an Ack from an AMD maintainer.
-- Keir
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] retry instruction on svm emulation failure
2011-05-18 10:08 ` Keir Fraser
@ 2011-05-18 21:08 ` Wei Huang
0 siblings, 0 replies; 3+ messages in thread
From: Wei Huang @ 2011-05-18 21:08 UTC (permalink / raw)
To: Keir Fraser; +Cc: Paolo Bonzini, xen-devel@lists.xensource.com
I don't think we can take this patch before understanding what is going
on. As Keir said, could you share a sample code or failure case? so we
can debug it.
Thanks,
-Wei
On 05/18/2011 05:08 AM, Keir Fraser wrote:
> On 18/05/2011 10:05, "Paolo Bonzini"<pbonzini@redhat.com> wrote:
>
>> retry instruction on svm emulation failure
>>
>> Upon emulation failure, Xen injects a #GP into the guest on AMD machines.
>> However, this kind of #GP does not happen in hardware. It is possible
>> (and was observed in practice) that the failure is transient. It will
>> go away naturally if the instruction is retried, because the guest will
>> be executing other code and will not exit.
> It begs the question why we were emulating the instruction in the first
> place. I'd like to see further explanation, with a concrete example, before
> applying this patch. Or get an Ack from an AMD maintainer.
>
> -- Keir
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-05-18 21:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-18 9:05 [PATCH] retry instruction on svm emulation failure Paolo Bonzini
2011-05-18 10:08 ` Keir Fraser
2011-05-18 21:08 ` Wei Huang
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).