WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [Patch 1/2] Re-org dom0_ops.h to allow arch specific definit

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [Patch 1/2] Re-org dom0_ops.h to allow arch specific definition
From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
Date: Thu, 16 Jun 2005 18:15:15 +0800
Delivery-date: Thu, 16 Jun 2005 10:14:24 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcVyXEnsibufuu7JRVC9zWVOoEIwJw==
Thread-topic: [Patch 1/2] Re-org dom0_ops.h to allow arch specific definition
I'm not sure whether this is right way to go, but sometimes specific
architecture may have its own different dom0 operations. Attached patch
tries to arrange definition of operations to the way where each
architecture is allocated with exclusive 64 operation IDs. And common
operations occupy first segment.

Comments? :-P

Signed-off-by Kevin Tian <Kevin.tian@xxxxxxxxx>

Thanks,
Kevin

--- xeno-unstable.org/xen/include/public/dom0_ops.h     2005-06-16
17:41:07.000000000 +0800
+++ xeno-unstable/xen/include/public/dom0_ops.h 2005-06-16
17:37:27.000000000 +0800
@@ -19,7 +19,15 @@
  * This makes sure that old versions of dom0 tools will stop working in
a
  * well-defined way (rather than crashing the machine, for instance).
  */
-#define DOM0_INTERFACE_VERSION   0xAAAA1006
+#define DOM0_INTERFACE_VERSION   0xAAAA1007
+
+/*
+ * Current stepping for arch specific dom0 operations is 64, which
+ * can be easily tuned later.
+ */
+#define DOM0_OP_STEP           64
+#define DOM0_X86_OP_BASE       DOM0_OP_STEP
+#define DOM0_IA64_OP_BASE      2 * DOM0_OP_STEP
 
 
/***********************************************************************
*/
 
@@ -99,19 +107,6 @@ typedef struct {
     vcpu_guest_context_t *ctxt;
 } dom0_setdomaininfo_t;
 
-#define DOM0_MSR              15
-typedef struct {
-    /* IN variables. */
-    u32 write;
-    u32 cpu_mask;
-    u32 msr;
-    u32 in1;
-    u32 in2;
-    /* OUT variables. */
-    u32 out1;
-    u32 out2;
-} dom0_msr_t;
-
 #define DOM0_DEBUG            16
 typedef struct {
     /* IN variables. */
@@ -268,6 +263,49 @@ typedef struct {
     unsigned long *array;
 } dom0_getpageframeinfo2_t;
 
+/* Interface for controlling Xen software performance counters. */
+#define DOM0_PERFCCONTROL        34
+/* Sub-operations: */
+#define DOM0_PERFCCONTROL_OP_RESET 1   /* Reset all counters to zero.
*/
+#define DOM0_PERFCCONTROL_OP_QUERY 2   /* Get perfctr information. */
+typedef struct {
+    u8      name[80];               /*  name of perf counter */
+    u32     nr_vals;                /* number of values for this
counter */
+    u32     vals[64];               /* array of values */
+} dom0_perfc_desc_t;
+typedef struct {
+    /* IN variables. */
+    u32            op;                /*  DOM0_PERFCCONTROL_OP_??? */
+    /* OUT variables. */
+    u32            nr_counters;       /*  number of counters */
+    dom0_perfc_desc_t *desc;          /*  counter information (or NULL)
*/
+} dom0_perfccontrol_t;
+
+#define DOM0_GETVCPUCONTEXT      37
+typedef struct {
+    domid_t domain;                   /* domain to be affected */
+    u16     vcpu;                     /* vcpu # */
+    vcpu_guest_context_t *ctxt;       /* NB. IN/OUT variable. */
+    u64     cpu_time;                 
+} dom0_getvcpucontext_t;
+
+/**********************************************************
+ *                 x86 specific operations (START)
+ **********************************************************/
+
+#define DOM0_MSR              DOM0_X86_OP_BASE
+typedef struct {
+    /* IN variables. */
+    u32 write;
+    u32 cpu_mask;
+    u32 msr;
+    u32 in1;
+    u32 in2;
+    /* OUT variables. */
+    u32 out1;
+    u32 out2;
+} dom0_msr_t;
+
 /*
  * Request memory range (@pfn, @pfn+@nr_pfns-1) to have type @type.
  * On x86, @type is an architecture-defined MTRR memory type.
@@ -275,7 +313,7 @@ typedef struct {
  * be passed to DOM0_DEL_MEMTYPE to accurately tear down the new
setting.
  * (x86-specific).
  */
-#define DOM0_ADD_MEMTYPE         31
+#define DOM0_ADD_MEMTYPE         DOM0_X86_OP_BASE + 1
 typedef struct {
     /* IN variables. */
     memory_t pfn;
@@ -293,7 +331,7 @@ typedef struct {
  * then @handle should be set to zero. In all cases @reg must be set.
  * (x86-specific).
  */
-#define DOM0_DEL_MEMTYPE         32
+#define DOM0_DEL_MEMTYPE         DOM0_X86_OP_BASE + 2
 typedef struct {
     /* IN variables. */
     u32      handle;
@@ -301,7 +339,7 @@ typedef struct {
 } dom0_del_memtype_t;
 
 /* Read current type of an MTRR (x86-specific). */
-#define DOM0_READ_MEMTYPE        33
+#define DOM0_READ_MEMTYPE        DOM0_X86_OP_BASE + 3
 typedef struct {
     /* IN variables. */
     u32      reg;
@@ -311,46 +349,31 @@ typedef struct {
     u32      type;
 } dom0_read_memtype_t;
 
-/* Interface for controlling Xen software performance counters. */
-#define DOM0_PERFCCONTROL        34
-/* Sub-operations: */
-#define DOM0_PERFCCONTROL_OP_RESET 1   /* Reset all counters to zero.
*/
-#define DOM0_PERFCCONTROL_OP_QUERY 2   /* Get perfctr information. */
-typedef struct {
-    u8      name[80];               /*  name of perf counter */
-    u32     nr_vals;                /* number of values for this
counter */
-    u32     vals[64];               /* array of values */
-} dom0_perfc_desc_t;
-typedef struct {
-    /* IN variables. */
-    u32            op;                /*  DOM0_PERFCCONTROL_OP_??? */
-    /* OUT variables. */
-    u32            nr_counters;       /*  number of counters */
-    dom0_perfc_desc_t *desc;          /*  counter information (or NULL)
*/
-} dom0_perfccontrol_t;
-
-#define DOM0_MICROCODE           35
+#define DOM0_MICROCODE           DOM0_X86_OP_BASE + 4
 typedef struct {
     /* IN variables. */
     void   *data;                     /* Pointer to microcode data */
     u32     length;                   /* Length of microcode data. */
 } dom0_microcode_t;
 
-#define DOM0_IOPORT_PERMISSION   36
+#define DOM0_IOPORT_PERMISSION   DOM0_X86_OP_BASE + 5
 typedef struct {
     domid_t domain;                   /* domain to be affected */
     u16     first_port;               /* first port int range */
     u16     nr_ports;                 /* size of port range */
     u16     allow_access;             /* allow or deny access to range?
*/
 } dom0_ioport_permission_t;
-
-#define DOM0_GETVCPUCONTEXT      37
-typedef struct {
-    domid_t domain;                   /* domain to be affected */
-    u16     vcpu;                     /* vcpu # */
-    vcpu_guest_context_t *ctxt;       /* NB. IN/OUT variable. */
-    u64     cpu_time;                 
-} dom0_getvcpucontext_t;
+/**********************************************************
+ *                 x86 specific operations (END)
+ **********************************************************/
+
+/**********************************************************
+ *                 IA64 specific operations (START)
+ **********************************************************/
+
+/**********************************************************
+ *                 IA64 specific operations (END)
+ **********************************************************/
 
 typedef struct {
     u32 cmd;

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [Patch 1/2] Re-org dom0_ops.h to allow arch specific definition, Tian, Kevin <=