]> xenbits.xensource.com Git - xen.git/commitdiff
x86/vm_event: Carry the vmtrace buffer position in vm_event
authorTamas K Lengyel <tamas.lengyel@intel.com>
Mon, 18 Jan 2021 17:46:37 +0000 (12:46 -0500)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 5 Feb 2021 17:37:28 +0000 (17:37 +0000)
Add vmtrace_pos field to x86 regs in vm_event. Initialized to ~0 if
vmtrace is not in use.

Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
xen/arch/x86/vm_event.c
xen/include/public/vm_event.h

index 848d69c1b01023f0a21758d98610ae835fb62125..36272e9316976fd16b494a2396bae228b264dce4 100644 (file)
@@ -251,6 +251,9 @@ void vm_event_fill_regs(vm_event_request_t *req)
 
     req->data.regs.x86.shadow_gs = ctxt.shadow_gs;
     req->data.regs.x86.dr6 = ctxt.dr6;
+
+    if ( hvm_vmtrace_output_position(curr, &req->data.regs.x86.vmtrace_pos) != 1 )
+        req->data.regs.x86.vmtrace_pos = ~0;
 #endif
 }
 
index 141ea024a36c4bf2b7c1a6ef07242d91943aa7ee..147dc3ea73f194da67a1ec22beca128b01036b32 100644 (file)
@@ -223,6 +223,13 @@ struct vm_event_regs_x86 {
      */
     uint64_t npt_base;
 
+    /*
+     * Current position in the vmtrace buffer, or ~0 if vmtrace is not active.
+     *
+     * For Intel Processor Trace, it is the upper half of MSR_RTIT_OUTPUT_MASK.
+     */
+    uint64_t vmtrace_pos;
+
     uint32_t cs_base;
     uint32_t ss_base;
     uint32_t ds_base;