[xen stable-4.8] x86/vmx: Don't clobber %dr6 while debugging state is lazy

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen stable-4.8] x86/vmx: Don't clobber %dr6 while debugging state is lazy

patchbot
commit 5566272d5ac148da962e14bc045ce23b22f38bbc
Author:     Andrew Cooper <[hidden email]>
AuthorDate: Mon Jul 30 12:08:43 2018 +0200
Commit:     Jan Beulich <[hidden email]>
CommitDate: Mon Jul 30 12:08:43 2018 +0200

    x86/vmx: Don't clobber %dr6 while debugging state is lazy
   
    c/s 4f36452b63 introduced a write to %dr6 in the #DB intercept case, but the
    guests debug registers may be lazy at this point, at which point the guests
    later attempt to read %dr6 will discard this value and use the older stale
    value.
   
    Signed-off-by: Andrew Cooper <[hidden email]>
    Reviewed-by: Roger Pau Monné <[hidden email]>
    Acked-by: Kevin Tian <[hidden email]>
    master commit: 3cdac2805692c7accde2f405d81cc0be799aee48
    master date: 2018-07-19 14:06:48 +0100
---
 xen/arch/x86/hvm/vmx/vmx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 1949ce3b73..7c89915748 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -3585,6 +3585,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
              */
             __vmread(EXIT_QUALIFICATION, &exit_qualification);
             HVMTRACE_1D(TRAP_DEBUG, exit_qualification);
+            __restore_debug_registers(v);
             write_debugreg(6, exit_qualification | DR_STATUS_RESERVED_ONE);
             if ( !v->domain->debugger_attached )
             {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.8


_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog