[xen master] x86/HVM: meet xentrace's expectations on emulation event data

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

[xen master] x86/HVM: meet xentrace's expectations on emulation event data

patchbot
commit 63f9a08a3eadf9b1969fcb5cbd7590168cea6316
Author:     Jan Beulich <[hidden email]>
AuthorDate: Tue Sep 11 11:00:01 2018 +0200
Commit:     Jan Beulich <[hidden email]>
CommitDate: Tue Sep 11 11:00:01 2018 +0200

    x86/HVM: meet xentrace's expectations on emulation event data
   
    According to the logic in hvm_mmio_assist_process(), 64 bits of data are
    expected with 64-bit addresses, and 32 bits of data with 32-bit ones. I
    don't think this is very reasonable, but I'm also not going to touch the
    consumer side, the more that it is anyway not very helpful for the code
    here to only ever supply 32 bits of data (despite the field being 64
    bits wide, and having been even in the 32-bit days of Xen).
   
    Signed-off-by: Jan Beulich <[hidden email]>
    Reviewed-by: Paul Durrant <[hidden email]>
---
 xen/arch/x86/hvm/emulate.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index dbf8b81a34..dec5951b99 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -30,7 +30,7 @@
 static void hvmtrace_io_assist(const ioreq_t *p)
 {
     unsigned int size, event;
-    unsigned char buffer[12];
+    unsigned char buffer[16];
 
     if ( likely(!tb_init_done) )
         return;
@@ -47,8 +47,11 @@ static void hvmtrace_io_assist(const ioreq_t *p)
 
     if ( !p->data_is_ptr )
     {
-        *(uint32_t *)&buffer[size] = p->data;
-        size += 4;
+        if ( size == 4 )
+            *(uint32_t *)&buffer[size] = p->data;
+        else
+            *(uint64_t *)&buffer[size] = p->data;
+        size *= 2;
     }
 
     trace_var(event, 0/*!cycles*/, size, buffer);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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