[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.7] x86/pv: Fix the handing of writes to %dr7



commit 63b140fe33422dbe36b394cd7985023098a43e7f
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Wed Apr 18 16:54:22 2018 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Apr 18 16:54:22 2018 +0200

    x86/pv: Fix the handing of writes to %dr7
    
    c/s 65e35549 "x86/PV: support data breakpoint extension registers"
    accidentally broke the handing of writes.  The call to activate_debugregs()
    doesn't write %dr7 as v->arch.debugreg[7] hasn't been updated yet, and the
    break skips the intended write to %dr7.
    
    Remove the break, causing execution to hit the write_debugreg(7, value); in
    context at the bottom of the hunk, which in turn causes hardware to be 
updated
    appropriately.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: adf8feba1afa040f3a84a82953e18af02060884a
    master date: 2018-03-29 15:12:21 +0100
---
 xen/arch/x86/traps.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index e96a5d3642..f37ff7ecd6 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -4298,14 +4298,11 @@ long set_debugreg(struct vcpu *v, unsigned int reg, 
unsigned long value)
             /*
              * If DR7 was previously clear then we need to load all other
              * debug registers at this point as they were not restored during
-             * context switch.
+             * context switch.  Updating DR7 itself happens later.
              */
             if ( (v == curr) &&
                  !(v->arch.debugreg[7] & DR7_ACTIVE_MASK) )
-            {
                 activate_debugregs(v);
-                break;
-            }
         }
         if ( v == curr )
             write_debugreg(7, value);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.7

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.