* [PATCH][HVM][SVM] Fix machine check intercept correctly
@ 2007-10-01 15:33 Christoph Egger
2007-10-01 16:10 ` Keir Fraser
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Egger @ 2007-10-01 15:33 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 629 bytes --]
Hi!
Attached patch fixes machine check interception
for HVM guests.
Keir: Please apply this patch to xen-staging *and* to Xen 3.1.1
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
--
AMD Saxony, Dresden, Germany
Operating System Research Center
Legal Information:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift):
Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär:
AMD Saxony LLC (Sitz Wilmington, Delaware, USA)
Geschäftsführer der AMD Saxony LLC:
Dr. Hans-R. Deppe, Thomas McCoy
[-- Attachment #2: xen_svm_mc.diff --]
[-- Type: text/plain, Size: 791 bytes --]
diff -r 5c7afb32df99 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c Mon Oct 01 06:39:00 2007 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c Mon Oct 01 15:29:14 2007 +0200
@@ -2166,7 +2166,6 @@ asmlinkage void svm_vmexit_handler(struc
case VMEXIT_EXCEPTION_MC:
HVMTRACE_0D(MCE, v);
- do_machine_check(regs);
break;
case VMEXIT_VINTR:
diff -r 5c7afb32df99 xen/arch/x86/hvm/svm/vmcb.c
--- a/xen/arch/x86/hvm/svm/vmcb.c Mon Oct 01 06:39:00 2007 +0100
+++ b/xen/arch/x86/hvm/svm/vmcb.c Wed Sep 26 13:32:24 2007 +0200
@@ -252,6 +252,7 @@ static int construct_vmcb(struct vcpu *v
{
vmcb->exception_intercepts = HVM_TRAP_MASK | (1U << TRAP_page_fault);
}
+ vmcb->exception_intercepts |= 1U << TRAP_machine_check;
return 0;
}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH][HVM][SVM] Fix machine check intercept correctly
2007-10-01 15:33 [PATCH][HVM][SVM] Fix machine check intercept correctly Christoph Egger
@ 2007-10-01 16:10 ` Keir Fraser
2007-10-01 16:17 ` Woller, Thomas
0 siblings, 1 reply; 4+ messages in thread
From: Keir Fraser @ 2007-10-01 16:10 UTC (permalink / raw)
To: Christoph Egger, xen-devel
On 1/10/07 16:33, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
> Hi!
>
> Attached patch fixes machine check interception
> for HVM guests.
>
> Keir: Please apply this patch to xen-staging *and* to Xen 3.1.1
First chunk (adding TRAP_machine_check to exception intercepts) is not
needed as that bit is already in HVM_TRAP_MASK. Also why remove the
invocation of do_machine_check()? That is the function that actually handles
the #MC.
-- Keir
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH][HVM][SVM] Fix machine check intercept correctly
2007-10-01 16:10 ` Keir Fraser
@ 2007-10-01 16:17 ` Woller, Thomas
2007-10-02 5:37 ` Keir Fraser
0 siblings, 1 reply; 4+ messages in thread
From: Woller, Thomas @ 2007-10-01 16:17 UTC (permalink / raw)
To: Keir Fraser, Egger, Christoph, xen-devel
In theory the MCE that occurs in SVM partition, will be held pending
until the VMEXIT occurs, and then released when the STGI instruction is
executed, rendering any VMEXIT code non-useful. Same as the NMI
handling. I might be missing something here, but the do_machine_check()
will be executed in the context of the hv trap handlers immediately
after STGI instruction, so we don't want to call it twice in the vmexit
handler code. (?)
tom
> -----Original Message-----
> From: xen-devel-bounces@lists.xensource.com
> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of
> Keir Fraser
> Sent: Monday, October 01, 2007 11:11 AM
> To: Egger, Christoph; xen-devel@lists.xensource.com
> Subject: Re: [Xen-devel] [PATCH][HVM][SVM] Fix machine check
> intercept correctly
>
> On 1/10/07 16:33, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
>
> > Hi!
> >
> > Attached patch fixes machine check interception for HVM guests.
> >
> > Keir: Please apply this patch to xen-staging *and* to Xen 3.1.1
>
> First chunk (adding TRAP_machine_check to exception
> intercepts) is not needed as that bit is already in
> HVM_TRAP_MASK. Also why remove the invocation of
> do_machine_check()? That is the function that actually
> handles the #MC.
>
> -- Keir
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][HVM][SVM] Fix machine check intercept correctly
2007-10-01 16:17 ` Woller, Thomas
@ 2007-10-02 5:37 ` Keir Fraser
0 siblings, 0 replies; 4+ messages in thread
From: Keir Fraser @ 2007-10-02 5:37 UTC (permalink / raw)
To: Woller, Thomas, Egger, Christoph, xen-devel
The documentation is unclear on what happens to #MC. Certainly it is held
pending if GIF==0, but the manual does not explicitly say that #MC is held
pending on vmexit. Is it possible to inject a #MC, to test what happens?
That would be very handy, otherwise the code path basically gets no testing.
:-)
-- Keir
On 1/10/07 17:17, "Woller, Thomas" <thomas.woller@amd.com> wrote:
> In theory the MCE that occurs in SVM partition, will be held pending
> until the VMEXIT occurs, and then released when the STGI instruction is
> executed, rendering any VMEXIT code non-useful. Same as the NMI
> handling. I might be missing something here, but the do_machine_check()
> will be executed in the context of the hv trap handlers immediately
> after STGI instruction, so we don't want to call it twice in the vmexit
> handler code. (?)
> tom
>
>> -----Original Message-----
>> From: xen-devel-bounces@lists.xensource.com
>> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of
>> Keir Fraser
>> Sent: Monday, October 01, 2007 11:11 AM
>> To: Egger, Christoph; xen-devel@lists.xensource.com
>> Subject: Re: [Xen-devel] [PATCH][HVM][SVM] Fix machine check
>> intercept correctly
>>
>> On 1/10/07 16:33, "Christoph Egger" <Christoph.Egger@amd.com> wrote:
>>
>>> Hi!
>>>
>>> Attached patch fixes machine check interception for HVM guests.
>>>
>>> Keir: Please apply this patch to xen-staging *and* to Xen 3.1.1
>>
>> First chunk (adding TRAP_machine_check to exception
>> intercepts) is not needed as that bit is already in
>> HVM_TRAP_MASK. Also why remove the invocation of
>> do_machine_check()? That is the function that actually
>> handles the #MC.
>>
>> -- Keir
>>
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>>
>>
>>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-10-02 5:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-01 15:33 [PATCH][HVM][SVM] Fix machine check intercept correctly Christoph Egger
2007-10-01 16:10 ` Keir Fraser
2007-10-01 16:17 ` Woller, Thomas
2007-10-02 5:37 ` Keir Fraser
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.