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

[Xen-changelog] [xen stable-4.6] x86/Viridian: don't depend on undefined register state



commit d60a4220e95458e42ff0be61bc79ac4a84aa8254
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Oct 25 17:18:41 2016 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Oct 25 17:18:41 2016 +0200

    x86/Viridian: don't depend on undefined register state
    
    The high halves of all GPRs are undefined in 32-bit and compat modes,
    and the dependency is being obfuscated by our structure field names not
    matching architectural register names (it was actually while putting
    together a patch to correct this when I noticed the issue here).
    
    For consistency also use the architecturally correct names on the
    output side.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
    master commit: a709a3a646302e95ba42beac89264f6cdacd0c64
    master date: 2016-10-14 14:09:42 +0200
---
 xen/arch/x86/hvm/viridian.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c
index 2f22783..481d623 100644
--- a/xen/arch/x86/hvm/viridian.c
+++ b/xen/arch/x86/hvm/viridian.c
@@ -550,9 +550,9 @@ int viridian_hypercall(struct cpu_user_regs *regs)
         output_params_gpa = regs->r8;
         break;
     case 4:
-        input.raw = ((uint64_t)regs->edx << 32) | regs->eax;
-        input_params_gpa = ((uint64_t)regs->ebx << 32) | regs->ecx;
-        output_params_gpa = ((uint64_t)regs->edi << 32) | regs->esi;
+        input.raw = (regs->rdx << 32) | regs->_eax;
+        input_params_gpa = (regs->rbx << 32) | regs->_ecx;
+        output_params_gpa = (regs->rdi << 32) | regs->_esi;
         break;
     default:
         goto out;
@@ -577,8 +577,8 @@ out:
         regs->rax = output.raw;
         break;
     default:
-        regs->edx = output.raw >> 32;
-        regs->eax = output.raw;
+        regs->rdx = output.raw >> 32;
+        regs->rax = (uint32_t)output.raw;
         break;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.