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

Re: [XEN PATCH v3] x86/monitor: Add new monitor event to catch I/O instructions



Hi,

On 17/03/2023 12:01, Dmitry Isaykin wrote:
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 51be28c3de..7280e9f968 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1063,6 +1063,7 @@ struct xen_domctl_psr_cmt_op {
  /* Enabled by default */
  #define XEN_DOMCTL_MONITOR_EVENT_INGUEST_PAGEFAULT     11
  #define XEN_DOMCTL_MONITOR_EVENT_VMEXIT                12
+#define XEN_DOMCTL_MONITOR_EVENT_IO                    13
struct xen_domctl_monitor_op {
      uint32_t op; /* XEN_DOMCTL_MONITOR_OP_* */
diff --git a/xen/include/public/vm_event.h b/xen/include/public/vm_event.h
index 0035c26e12..1e4b6063f5 100644
--- a/xen/include/public/vm_event.h
+++ b/xen/include/public/vm_event.h
@@ -160,6 +160,8 @@
  #define VM_EVENT_REASON_EMUL_UNIMPLEMENTED      14
  /* VMEXIT */
  #define VM_EVENT_REASON_VMEXIT                  15
+/* IN/OUT Instruction executed */
+#define VM_EVENT_REASON_IO_INSTRUCTION          16
/* Supported values for the vm_event_write_ctrlreg index. */
  #define VM_EVENT_X86_CR0    0
@@ -388,6 +390,13 @@ struct vm_event_vmexit {
      } arch;
  };
+struct vm_event_io {
+    uint32_t data_size;
+    uint16_t port;
+    uint8_t  dir; /* IOREQ_READ or IOREQ_WRITE */
+    uint8_t  string_ins;
It would be good to comment what the value is meant to be? Is it 0 and 1 (extra meaning to be confirmed) with the other values reserved for future purpose?

Cheers,

--
Julien Grall



 


Rackspace

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