add xen port work document
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 28 Apr 2006 14:17:45 +0000 (14:17 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 28 Apr 2006 14:17:45 +0000 (14:17 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1770 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/doc/developer/xen-port.txt [new file with mode: 0644]

diff --git a/ltt/branches/poly/doc/developer/xen-port.txt b/ltt/branches/poly/doc/developer/xen-port.txt
new file mode 100644 (file)
index 0000000..e91babe
--- /dev/null
@@ -0,0 +1,108 @@
+
+
+Xen port notes
+
+Mathieu Desnoyers, April 2006
+
+Useful files :
+
+common/trace.c
+include/xen/trace.h and the dom0 op in include/public/dom0_ops.h
+
+alloc buffer (alloc_trace_bufs) :
+alloc_xenheap_pages
+
+Shared buffer between dom0 and hypervisor :
+share_xen_page_with_privileged_guests
+
+
+
+trace_create / trace_destroy :
+
+call xen hooks from dom0 to allocate a new buffer, get the newly allocated 
+struct trace pointer.
+Share struct traces with dom0 to have offset and consumed counts.
+Share the buffers with dom0 too.
+
+Create a new "xen" channel.
+
+
+Create 4 new xen facilities (see include/public/trace.h) :
+xen_sched  (grep TRC_SCHED)
+  sched_dom_add
+       sched_dom_rem
+       sched_sleep
+       sched_wake
+       sched_yield
+       sched_block
+       sched_shutdown
+       sched_ctl
+       sched_switch
+       sched_s_timer_fn
+       sched_t_timer_fn
+       sched_dom_timer_fn
+       sched_dom_timer_fn
+       sched_switch_infprev
+       sched_switch_infnext
+xen_dom0op (grep TRC_DOM0OP)
+  dom0op_enter_base
+  dom0op_leave_base
+xen_vmx (grep TRC_VMX)
+  vmx_vmexit
+  vmx_vmentry
+       vmx_timer_intr
+       vmx_int
+       vmx_io
+xen_mem (grep TRC_MEM)
+  mem_page_grant_map
+       mem_page_grant_unmap
+       mem_page_grant_transfer
+
+
+How to share xen pages efficiently ?
+Pages allocated in xen heap, the shared with dom0.
+
+How buffers are accessed in dom0 ?
+directly from pointers to buffers contained in get_info control information.
+
+do_dom0_op
+
+tbufcontrol -> control info
+  int tb_control(dom0_tbufcontrol_t *tbc)
+
+DOM0_TBUF_GET_INFO  buffer_mfn   __pa(t_bufs[0]) >> PAGE_SHIFT;
+
+
+create trace :
+
+in : 
+trace name
+buffer size
+return : 0 success, 1 failure
+do :
+alloc buffer xen
+share with dom0
+
+destroy trace :
+in :
+trace name
+do : unshare buffer / free.
+
+
+start/stop : 
+tb_control that will update the control structure.
+in : trace name
+start : put active to 1 + inc. nb_active traces
+stop : put active to 0 + dec nb_active traces.
+return : 0 success, 1 failure.
+
+consume :
+in : trace name
+tb_control that will update the consumed count.
+in : old count.
+return : 0 success, 1 failure (pushed).
+
+get_info :
+tb_control that returns a fresh copy of trace control info.
+
+
This page took 0.036741 seconds and 4 git commands to generate.