xpti: fix bug in double fault handling
PATCH v2 1/1 xpti: fix bug in double fault handling
When entering the hypervisor via the double fault handler resetting xen_cr3 was missing. This led to switching to pv_cr3 when returning from the next following interrupt. So repair this in order to allow interrupt handling to work even after a double fault.
--- xen/arch/x86/x86_64/entry.S | 1 + 1 file changed, 1 insertion(+)
xen/arch/x86/x86_64/entry.S +1 -0
@@ -773,6 +773,7 @@ ENTRY(double_fault) neg %rbx .Ldblf_cr3_load: mov %rbx, %cr3 + movq $0, STACK_CPUINFO_FIELD(xen_cr3)(%r14) .Ldblf_cr3_okay: movq %rsp,%rdi
Signature · 7 lines
2.13.6 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 23.04.18 at 14:38, <[email protected]> wrote:
When entering the hypervisor via the double fault handler resetting
xen_cr3was missing. This led to switching topv_cr3when returning from the next following interrupt. So repair this in order to allow interrupt handling to work even after a double fault.Signed-off-by Juergen Gross <[email protected]>
With s/interrupt/exception/ (or s/interrupt/interruption/) on the description (which is easy enough to do while committing)
I take it that your Rab can be implied here.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 6 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 23.04.18 at 14:38, <[email protected]> wrote:
When entering the hypervisor via the double fault handler resetting
xen_cr3was missing. This led to switching topv_cr3when returning from the next following interrupt. So repair this in order to allow interrupt handling to work even after a double fault.
Quoted 7 lines
Quoted 1 line
Signed-off-by Juergen Gross <[email protected]>With s/interrupt/exception/ (or s/interrupt/interruption/) on the description (which is easy enough to do while committing)
Reviewed-by Jan Beulich <[email protected]>I take it that your Rab can be implied here.
Correct. :-)
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 15 lines · Juergen Gross
When entering the hypervisor via the double fault handler resetting
xen_cr3was missing. This led to switching topv_cr3when returning from the next following interrupt. So repair this in order to allow interrupt handling to work even after a double fault.Signed-off-by Juergen Gross <[email protected]>--- xen/arch/x86/x86_64/entry.S | 1 + 1 file changed, 1 insertion(+)xen/arch/x86/x86_64/entry.S +0
-0
xen/arch/x86/x86_64/entry.S ENTRY(double_fault) · line 779
Quoted 7 lines
xen/arch/x86/x86_64/entry.S +1
-0@@ -773,6 +773,7 @@ ENTRY(double_fault) neg %rbx .Ldblf_cr3_load: mov %rbx, %cr3 + movq $0, STACK_CPUINFO_FIELD(xen_cr3)(%r14) .Ldblf_cr3_okay: movq %rsp,%rdi
What about the other write into xen_cr3 with a negated value? Won't this still explode if we get an NMI or MCE at the wrong moment?
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 22 lines · Andrew Cooper
Quoted 21 lines · Juergen Gross
When entering the hypervisor via the double fault handler resetting
xen_cr3was missing. This led to switching topv_cr3when returning from the next following interrupt. So repair this in order to allow interrupt handling to work even after a double fault.Signed-off-by Juergen Gross <[email protected]>--- xen/arch/x86/x86_64/entry.S | 1 + 1 file changed, 1 insertion(+)xen/arch/x86/x86_64/entry.S +1
-0@@ -773,6 +773,7 @@ ENTRY(double_fault) neg %rbx .Ldblf_cr3_load: mov %rbx, %cr3 + movq $0, STACK_CPUINFO_FIELD(xen_cr3)(%r14) .Ldblf_cr3_okay:
Quoted 4 lines
xen/arch/x86/x86_64/entry.S ENTRY(double_fault) · line 779
Quoted 1 line
xen/arch/x86/x86_64/entry.S +0
-0movq %rsp,%rdiWhat about the other write into
xen_cr3with a negated value? Won't this still explode if we get an NMI or MCE at the wrong moment?
Hmm, you mean a NMI between the mov to %cr3 and zeroing xen_cr3? Could be an issue, yes. Okay, V3 then...
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel