Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:13:28

0001 #ifndef __VKI_XEN_SYSCTL_H
0002 #define __VKI_XEN_SYSCTL_H
0003 
0004 /*
0005  * The sysctl interface is versioned via the interface_version
0006  * field. This structures in this header supports sysctl interfaces:
0007  *
0008  * - 0x00000008: Xen 4.1
0009  * - 0x00000009: Xen 4.2
0010  * - 0x0000000a: Xen 4.3 & 4.4
0011  * - 0x0000000b: Xen 4.5
0012  *
0013  * When adding a new subop be sure to include the variants used by all
0014  * of the above, both here and in syswrap-xen.c
0015  *
0016  * Structs which are identical in all supported versions have no
0017  * version suffix. Structs which do differ are defined multiple times
0018  * and use the suffix of the latest version to contain that particular
0019  * variant.
0020  */
0021 
0022 #define VKI_XEN_SYSCTL_readconsole                    1
0023 #define VKI_XEN_SYSCTL_tbuf_op                        2
0024 #define VKI_XEN_SYSCTL_physinfo                       3
0025 #define VKI_XEN_SYSCTL_sched_id                       4
0026 #define VKI_XEN_SYSCTL_perfc_op                       5
0027 #define VKI_XEN_SYSCTL_getdomaininfolist              6
0028 #define VKI_XEN_SYSCTL_debug_keys                     7
0029 #define VKI_XEN_SYSCTL_getcpuinfo                     8
0030 #define VKI_XEN_SYSCTL_availheap                      9
0031 #define VKI_XEN_SYSCTL_get_pmstat                    10
0032 #define VKI_XEN_SYSCTL_cpu_hotplug                   11
0033 #define VKI_XEN_SYSCTL_pm_op                         12
0034 #define VKI_XEN_SYSCTL_page_offline_op               14
0035 #define VKI_XEN_SYSCTL_lockprof_op                   15
0036 #define VKI_XEN_SYSCTL_topologyinfo                  16
0037 #define VKI_XEN_SYSCTL_numainfo                      17
0038 #define VKI_XEN_SYSCTL_cpupool_op                    18
0039 #define VKI_XEN_SYSCTL_scheduler_op                  19
0040 #define VKI_XEN_SYSCTL_coverage_op                   20
0041 
0042 struct vki_xen_sysctl_readconsole {
0043     /* IN */
0044     vki_uint8_t clear;
0045     vki_uint8_t incremental;
0046 
0047     vki_uint8_t pad0, pad1;
0048 
0049     /*
0050      * IN:  Start index for consumption if @incremental.
0051      * OUT: End index after consuming from the console.
0052      */
0053     vki_uint32_t index;
0054     VKI_XEN_GUEST_HANDLE_64(char) buffer; /* IN */
0055 
0056     /*
0057      * IN:  size of buffer.
0058      * OUT: bytes written into buffer.
0059      */
0060     vki_uint32_t count;
0061 };
0062 
0063 struct vki_xen_sysctl_getdomaininfolist_00000008 {
0064     /* IN variables. */
0065     vki_xen_domid_t           first_domain;
0066     vki_uint32_t              max_domains;
0067     VKI_XEN_GUEST_HANDLE_64(vki_xen_domctl_getdomaininfo_00000007_t) buffer;
0068     /* OUT variables. */
0069     vki_uint32_t              num_domains;
0070 };
0071 
0072 struct vki_xen_sysctl_getdomaininfolist_00000009 {
0073     /* IN variables. */
0074     vki_xen_domid_t           first_domain;
0075     vki_uint32_t              max_domains;
0076     VKI_XEN_GUEST_HANDLE_64(vki_xen_domctl_getdomaininfo_00000008_t) buffer;
0077     /* OUT variables. */
0078     vki_uint32_t              num_domains;
0079 };
0080 
0081 struct vki_xen_sysctl_getdomaininfolist_0000000a {
0082     /* IN variables. */
0083     vki_xen_domid_t           first_domain;
0084     vki_uint32_t              max_domains;
0085     VKI_XEN_GUEST_HANDLE_64(vki_xen_domctl_getdomaininfo_00000009_t) buffer;
0086     /* OUT variables. */
0087     vki_uint32_t              num_domains;
0088 };
0089 
0090 struct vki_xen_sysctl_getdomaininfolist_00000010 {
0091     /* IN variables. */
0092     vki_xen_domid_t           first_domain;
0093     vki_uint32_t              max_domains;
0094     VKI_XEN_GUEST_HANDLE_64(vki_xen_domctl_getdomaininfo_00000010_t) buffer;
0095     /* OUT variables. */
0096     vki_uint32_t              num_domains;
0097 };
0098 
0099 /* vki_xen_sysctl_getdomaininfolist_0000000b is the same as 0000000a */
0100 
0101 #define VKI_XEN_SYSCTL_CPUPOOL_OP_CREATE                1  /* C */
0102 #define VKI_XEN_SYSCTL_CPUPOOL_OP_DESTROY               2  /* D */
0103 #define VKI_XEN_SYSCTL_CPUPOOL_OP_INFO                  3  /* I */
0104 #define VKI_XEN_SYSCTL_CPUPOOL_OP_ADDCPU                4  /* A */
0105 #define VKI_XEN_SYSCTL_CPUPOOL_OP_RMCPU                 5  /* R */
0106 #define VKI_XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN            6  /* M */
0107 #define VKI_XEN_SYSCTL_CPUPOOL_OP_FREEINFO              7  /* F */
0108 #define VKI_XEN_SYSCTL_CPUPOOL_PAR_ANY     0xFFFFFFFF
0109 struct vki_xen_sysctl_cpupool_op {
0110     vki_uint32_t op;          /* IN */
0111     vki_uint32_t cpupool_id;  /* IN: CDIARM OUT: CI */
0112     vki_uint32_t sched_id;    /* IN: C      OUT: I  */
0113     vki_uint32_t domid;       /* IN: M              */
0114     vki_uint32_t cpu;         /* IN: AR             */
0115     vki_uint32_t n_dom;       /*            OUT: I  */
0116     struct vki_xenctl_bitmap cpumap; /*     OUT: IF */
0117 };
0118 
0119 struct vki_xen_sysctl_debug_keys {
0120     /* IN variables. */
0121     VKI_XEN_GUEST_HANDLE_64(char) keys;
0122     vki_uint32_t nr_keys;
0123 };
0124 
0125 struct vki_xen_sysctl_topologyinfo {
0126     vki_uint32_t max_cpu_index;
0127     VKI_XEN_GUEST_HANDLE_64(vki_uint32) cpu_to_core;
0128     VKI_XEN_GUEST_HANDLE_64(vki_uint32) cpu_to_socket;
0129     VKI_XEN_GUEST_HANDLE_64(vki_uint32) cpu_to_node;
0130 };
0131 
0132 struct vki_xen_sysctl_numainfo {
0133     vki_uint32_t max_node_index;
0134     VKI_XEN_GUEST_HANDLE_64(vki_uint64) node_to_memsize;
0135     VKI_XEN_GUEST_HANDLE_64(vki_uint64) node_to_memfree;
0136     VKI_XEN_GUEST_HANDLE_64(vki_uint32) node_to_node_distance;
0137 };
0138 struct vki_xen_sysctl_physinfo_00000008 {
0139     vki_uint32_t threads_per_core;
0140     vki_uint32_t cores_per_socket;
0141     vki_uint32_t nr_cpus;     /* # CPUs currently online */
0142     vki_uint32_t max_cpu_id;  /* Largest possible CPU ID on this host */
0143     vki_uint32_t nr_nodes;    /* # nodes currently online */
0144     vki_uint32_t max_node_id; /* Largest possible node ID on this host */
0145     vki_uint32_t cpu_khz;
0146     vki_xen_uint64_aligned_t total_pages;
0147     vki_xen_uint64_aligned_t free_pages;
0148     vki_xen_uint64_aligned_t scrub_pages;
0149     vki_uint32_t hw_cap[8];
0150 
0151     vki_uint32_t capabilities;
0152 };
0153 
0154 struct vki_xen_sysctl_physinfo_0000000a {
0155     vki_uint32_t threads_per_core;
0156     vki_uint32_t cores_per_socket;
0157     vki_uint32_t nr_cpus;     /* # CPUs currently online */
0158     vki_uint32_t max_cpu_id;  /* Largest possible CPU ID on this host */
0159     vki_uint32_t nr_nodes;    /* # nodes currently online */
0160     vki_uint32_t max_node_id; /* Largest possible node ID on this host */
0161     vki_uint32_t cpu_khz;
0162     vki_xen_uint64_aligned_t total_pages;
0163     vki_xen_uint64_aligned_t free_pages;
0164     vki_xen_uint64_aligned_t scrub_pages;
0165     vki_xen_uint64_aligned_t outstanding_pages;
0166     vki_uint32_t hw_cap[8];
0167 
0168     vki_uint32_t capabilities;
0169 };
0170 
0171 struct vki_xen_sysctl_physinfo_00000010 {
0172     vki_uint32_t threads_per_core;
0173     vki_uint32_t cores_per_socket;
0174     vki_uint32_t nr_cpus;     /* # CPUs currently online */
0175     vki_uint32_t max_cpu_id;  /* Largest possible CPU ID on this host */
0176     vki_uint32_t nr_nodes;    /* # nodes currently online */
0177     vki_uint32_t max_node_id; /* Largest possible node ID on this host */
0178     vki_uint32_t cpu_khz;
0179     vki_uint32_t capabilities;
0180     vki_xen_uint64_aligned_t total_pages;
0181     vki_xen_uint64_aligned_t free_pages;
0182     vki_xen_uint64_aligned_t scrub_pages;
0183     vki_xen_uint64_aligned_t outstanding_pages;
0184     vki_xen_uint64_aligned_t max_mfn;
0185     vki_uint32_t hw_cap[8];
0186 
0187 };
0188 
0189 struct vki_xen_sysctl_sched_id {
0190     /* OUT variable. */
0191     vki_uint32_t              sched_id;
0192 };
0193 
0194 struct vki_xen_sysctl {
0195     vki_uint32_t cmd;
0196     vki_uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
0197     union {
0198         struct vki_xen_sysctl_readconsole       readconsole;
0199         //struct vki_xen_sysctl_tbuf_op           tbuf_op;
0200         struct vki_xen_sysctl_physinfo_00000008 physinfo_00000008;
0201         struct vki_xen_sysctl_physinfo_0000000a physinfo_0000000a;
0202         struct vki_xen_sysctl_physinfo_00000010 physinfo_00000010;
0203         struct vki_xen_sysctl_topologyinfo      topologyinfo;
0204         struct vki_xen_sysctl_numainfo          numainfo;
0205         struct vki_xen_sysctl_sched_id          sched_id;
0206         //struct vki_xen_sysctl_perfc_op          perfc_op;
0207         struct vki_xen_sysctl_getdomaininfolist_00000008 getdomaininfolist_00000008;
0208         struct vki_xen_sysctl_getdomaininfolist_00000009 getdomaininfolist_00000009;
0209         struct vki_xen_sysctl_getdomaininfolist_0000000a getdomaininfolist_0000000a;
0210         struct vki_xen_sysctl_getdomaininfolist_00000010 getdomaininfolist_00000010;
0211         struct vki_xen_sysctl_debug_keys        debug_keys;
0212         //struct vki_xen_sysctl_getcpuinfo        getcpuinfo;
0213         //struct vki_xen_sysctl_availheap         availheap;
0214         //struct vki_xen_sysctl_get_pmstat        get_pmstat;
0215         //struct vki_xen_sysctl_cpu_hotplug       cpu_hotplug;
0216         //struct vki_xen_sysctl_pm_op             pm_op;
0217         //struct vki_xen_sysctl_page_offline_op   page_offline;
0218         //struct vki_xen_sysctl_lockprof_op       lockprof_op;
0219         struct vki_xen_sysctl_cpupool_op        cpupool_op;
0220         //struct vki_xen_sysctl_scheduler_op      scheduler_op;
0221         //struct vki_xen_sysctl_coverage_op       coverage_op;
0222 
0223         vki_uint8_t                             pad[128];
0224     } u;
0225 };
0226 
0227 #endif // __VKI_XEN_SYSCTL_H
0228 
0229 /*--------------------------------------------------------------------*/
0230 /*--- end                                                          ---*/
0231 /*--------------------------------------------------------------------*/