Home | History | Annotate | Line # | Download | only in public
      1  1.1  cherry /******************************************************************************
      2  1.1  cherry  * sysctl.h
      3  1.1  cherry  *
      4  1.1  cherry  * System management operations. For use by node control stack.
      5  1.1  cherry  *
      6  1.1  cherry  * Permission is hereby granted, free of charge, to any person obtaining a copy
      7  1.1  cherry  * of this software and associated documentation files (the "Software"), to
      8  1.1  cherry  * deal in the Software without restriction, including without limitation the
      9  1.1  cherry  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
     10  1.1  cherry  * sell copies of the Software, and to permit persons to whom the Software is
     11  1.1  cherry  * furnished to do so, subject to the following conditions:
     12  1.1  cherry  *
     13  1.1  cherry  * The above copyright notice and this permission notice shall be included in
     14  1.1  cherry  * all copies or substantial portions of the Software.
     15  1.1  cherry  *
     16  1.1  cherry  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     17  1.1  cherry  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     18  1.1  cherry  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     19  1.1  cherry  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     20  1.1  cherry  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
     21  1.1  cherry  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
     22  1.1  cherry  * DEALINGS IN THE SOFTWARE.
     23  1.1  cherry  *
     24  1.1  cherry  * Copyright (c) 2002-2006, K Fraser
     25  1.1  cherry  */
     26  1.1  cherry 
     27  1.1  cherry #ifndef __XEN_PUBLIC_SYSCTL_H__
     28  1.1  cherry #define __XEN_PUBLIC_SYSCTL_H__
     29  1.1  cherry 
     30  1.1  cherry #if !defined(__XEN__) && !defined(__XEN_TOOLS__)
     31  1.1  cherry #error "sysctl operations are intended for use by node control tools only"
     32  1.1  cherry #endif
     33  1.1  cherry 
     34  1.1  cherry #include "xen.h"
     35  1.1  cherry #include "domctl.h"
     36  1.1  cherry #include "physdev.h"
     37  1.1  cherry #include "tmem.h"
     38  1.1  cherry 
     39  1.1  cherry #define XEN_SYSCTL_INTERFACE_VERSION 0x00000011
     40  1.1  cherry 
     41  1.1  cherry /*
     42  1.1  cherry  * Read console content from Xen buffer ring.
     43  1.1  cherry  */
     44  1.1  cherry /* XEN_SYSCTL_readconsole */
     45  1.1  cherry struct xen_sysctl_readconsole {
     46  1.1  cherry     /* IN: Non-zero -> clear after reading. */
     47  1.1  cherry     uint8_t clear;
     48  1.1  cherry     /* IN: Non-zero -> start index specified by @index field. */
     49  1.1  cherry     uint8_t incremental;
     50  1.1  cherry     uint8_t pad0, pad1;
     51  1.1  cherry     /*
     52  1.1  cherry      * IN:  Start index for consuming from ring buffer (if @incremental);
     53  1.1  cherry      * OUT: End index after consuming from ring buffer.
     54  1.1  cherry      */
     55  1.1  cherry     uint32_t index;
     56  1.1  cherry     /* IN: Virtual address to write console data. */
     57  1.1  cherry     XEN_GUEST_HANDLE_64(char) buffer;
     58  1.1  cherry     /* IN: Size of buffer; OUT: Bytes written to buffer. */
     59  1.1  cherry     uint32_t count;
     60  1.1  cherry };
     61  1.1  cherry 
     62  1.1  cherry /* Get trace buffers machine base address */
     63  1.1  cherry /* XEN_SYSCTL_tbuf_op */
     64  1.1  cherry struct xen_sysctl_tbuf_op {
     65  1.1  cherry     /* IN variables */
     66  1.1  cherry #define XEN_SYSCTL_TBUFOP_get_info     0
     67  1.1  cherry #define XEN_SYSCTL_TBUFOP_set_cpu_mask 1
     68  1.1  cherry #define XEN_SYSCTL_TBUFOP_set_evt_mask 2
     69  1.1  cherry #define XEN_SYSCTL_TBUFOP_set_size     3
     70  1.1  cherry #define XEN_SYSCTL_TBUFOP_enable       4
     71  1.1  cherry #define XEN_SYSCTL_TBUFOP_disable      5
     72  1.1  cherry     uint32_t cmd;
     73  1.1  cherry     /* IN/OUT variables */
     74  1.1  cherry     struct xenctl_bitmap cpu_mask;
     75  1.1  cherry     uint32_t             evt_mask;
     76  1.1  cherry     /* OUT variables */
     77  1.1  cherry     uint64_aligned_t buffer_mfn;
     78  1.1  cherry     uint32_t size;  /* Also an IN variable! */
     79  1.1  cherry };
     80  1.1  cherry 
     81  1.1  cherry /*
     82  1.1  cherry  * Get physical information about the host machine
     83  1.1  cherry  */
     84  1.1  cherry /* XEN_SYSCTL_physinfo */
     85  1.1  cherry  /* (x86) The platform supports HVM guests. */
     86  1.1  cherry #define _XEN_SYSCTL_PHYSCAP_hvm          0
     87  1.1  cherry #define XEN_SYSCTL_PHYSCAP_hvm           (1u<<_XEN_SYSCTL_PHYSCAP_hvm)
     88  1.1  cherry  /* (x86) The platform supports HVM-guest direct access to I/O devices. */
     89  1.1  cherry #define _XEN_SYSCTL_PHYSCAP_hvm_directio 1
     90  1.1  cherry #define XEN_SYSCTL_PHYSCAP_hvm_directio  (1u<<_XEN_SYSCTL_PHYSCAP_hvm_directio)
     91  1.1  cherry struct xen_sysctl_physinfo {
     92  1.1  cherry     uint32_t threads_per_core;
     93  1.1  cherry     uint32_t cores_per_socket;
     94  1.1  cherry     uint32_t nr_cpus;     /* # CPUs currently online */
     95  1.1  cherry     uint32_t max_cpu_id;  /* Largest possible CPU ID on this host */
     96  1.1  cherry     uint32_t nr_nodes;    /* # nodes currently online */
     97  1.1  cherry     uint32_t max_node_id; /* Largest possible node ID on this host */
     98  1.1  cherry     uint32_t cpu_khz;
     99  1.1  cherry     uint32_t capabilities;/* XEN_SYSCTL_PHYSCAP_??? */
    100  1.1  cherry     uint64_aligned_t total_pages;
    101  1.1  cherry     uint64_aligned_t free_pages;
    102  1.1  cherry     uint64_aligned_t scrub_pages;
    103  1.1  cherry     uint64_aligned_t outstanding_pages;
    104  1.1  cherry     uint64_aligned_t max_mfn; /* Largest possible MFN on this host */
    105  1.1  cherry     uint32_t hw_cap[8];
    106  1.1  cherry };
    107  1.1  cherry 
    108  1.1  cherry /*
    109  1.1  cherry  * Get the ID of the current scheduler.
    110  1.1  cherry  */
    111  1.1  cherry /* XEN_SYSCTL_sched_id */
    112  1.1  cherry struct xen_sysctl_sched_id {
    113  1.1  cherry     /* OUT variable */
    114  1.1  cherry     uint32_t sched_id;
    115  1.1  cherry };
    116  1.1  cherry 
    117  1.1  cherry /* Interface for controlling Xen software performance counters. */
    118  1.1  cherry /* XEN_SYSCTL_perfc_op */
    119  1.1  cherry /* Sub-operations: */
    120  1.1  cherry #define XEN_SYSCTL_PERFCOP_reset 1   /* Reset all counters to zero. */
    121  1.1  cherry #define XEN_SYSCTL_PERFCOP_query 2   /* Get perfctr information. */
    122  1.1  cherry struct xen_sysctl_perfc_desc {
    123  1.1  cherry     char         name[80];             /* name of perf counter */
    124  1.1  cherry     uint32_t     nr_vals;              /* number of values for this counter */
    125  1.1  cherry };
    126  1.1  cherry typedef struct xen_sysctl_perfc_desc xen_sysctl_perfc_desc_t;
    127  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t);
    128  1.1  cherry typedef uint32_t xen_sysctl_perfc_val_t;
    129  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t);
    130  1.1  cherry 
    131  1.1  cherry struct xen_sysctl_perfc_op {
    132  1.1  cherry     /* IN variables. */
    133  1.1  cherry     uint32_t       cmd;                /*  XEN_SYSCTL_PERFCOP_??? */
    134  1.1  cherry     /* OUT variables. */
    135  1.1  cherry     uint32_t       nr_counters;       /*  number of counters description  */
    136  1.1  cherry     uint32_t       nr_vals;           /*  number of values  */
    137  1.1  cherry     /* counter information (or NULL) */
    138  1.1  cherry     XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc;
    139  1.1  cherry     /* counter values (or NULL) */
    140  1.1  cherry     XEN_GUEST_HANDLE_64(xen_sysctl_perfc_val_t) val;
    141  1.1  cherry };
    142  1.1  cherry 
    143  1.1  cherry /* XEN_SYSCTL_getdomaininfolist */
    144  1.1  cherry struct xen_sysctl_getdomaininfolist {
    145  1.1  cherry     /* IN variables. */
    146  1.1  cherry     domid_t               first_domain;
    147  1.1  cherry     uint32_t              max_domains;
    148  1.1  cherry     XEN_GUEST_HANDLE_64(xen_domctl_getdomaininfo_t) buffer;
    149  1.1  cherry     /* OUT variables. */
    150  1.1  cherry     uint32_t              num_domains;
    151  1.1  cherry };
    152  1.1  cherry 
    153  1.1  cherry /* Inject debug keys into Xen. */
    154  1.1  cherry /* XEN_SYSCTL_debug_keys */
    155  1.1  cherry struct xen_sysctl_debug_keys {
    156  1.1  cherry     /* IN variables. */
    157  1.1  cherry     XEN_GUEST_HANDLE_64(char) keys;
    158  1.1  cherry     uint32_t nr_keys;
    159  1.1  cherry };
    160  1.1  cherry 
    161  1.1  cherry /* Get physical CPU information. */
    162  1.1  cherry /* XEN_SYSCTL_getcpuinfo */
    163  1.1  cherry struct xen_sysctl_cpuinfo {
    164  1.1  cherry     uint64_aligned_t idletime;
    165  1.1  cherry };
    166  1.1  cherry typedef struct xen_sysctl_cpuinfo xen_sysctl_cpuinfo_t;
    167  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpuinfo_t);
    168  1.1  cherry struct xen_sysctl_getcpuinfo {
    169  1.1  cherry     /* IN variables. */
    170  1.1  cherry     uint32_t max_cpus;
    171  1.1  cherry     XEN_GUEST_HANDLE_64(xen_sysctl_cpuinfo_t) info;
    172  1.1  cherry     /* OUT variables. */
    173  1.1  cherry     uint32_t nr_cpus;
    174  1.1  cherry };
    175  1.1  cherry 
    176  1.1  cherry /* XEN_SYSCTL_availheap */
    177  1.1  cherry struct xen_sysctl_availheap {
    178  1.1  cherry     /* IN variables. */
    179  1.1  cherry     uint32_t min_bitwidth;  /* Smallest address width (zero if don't care). */
    180  1.1  cherry     uint32_t max_bitwidth;  /* Largest address width (zero if don't care). */
    181  1.1  cherry     int32_t  node;          /* NUMA node of interest (-1 for all nodes). */
    182  1.1  cherry     /* OUT variables. */
    183  1.1  cherry     uint64_aligned_t avail_bytes;/* Bytes available in the specified region. */
    184  1.1  cherry };
    185  1.1  cherry 
    186  1.1  cherry /* XEN_SYSCTL_get_pmstat */
    187  1.1  cherry struct pm_px_val {
    188  1.1  cherry     uint64_aligned_t freq;        /* Px core frequency */
    189  1.1  cherry     uint64_aligned_t residency;   /* Px residency time */
    190  1.1  cherry     uint64_aligned_t count;       /* Px transition count */
    191  1.1  cherry };
    192  1.1  cherry typedef struct pm_px_val pm_px_val_t;
    193  1.1  cherry DEFINE_XEN_GUEST_HANDLE(pm_px_val_t);
    194  1.1  cherry 
    195  1.1  cherry struct pm_px_stat {
    196  1.1  cherry     uint8_t total;        /* total Px states */
    197  1.1  cherry     uint8_t usable;       /* usable Px states */
    198  1.1  cherry     uint8_t last;         /* last Px state */
    199  1.1  cherry     uint8_t cur;          /* current Px state */
    200  1.1  cherry     XEN_GUEST_HANDLE_64(uint64) trans_pt;   /* Px transition table */
    201  1.1  cherry     XEN_GUEST_HANDLE_64(pm_px_val_t) pt;
    202  1.1  cherry };
    203  1.1  cherry 
    204  1.1  cherry struct pm_cx_stat {
    205  1.1  cherry     uint32_t nr;    /* entry nr in triggers & residencies, including C0 */
    206  1.1  cherry     uint32_t last;  /* last Cx state */
    207  1.1  cherry     uint64_aligned_t idle_time;                 /* idle time from boot */
    208  1.1  cherry     XEN_GUEST_HANDLE_64(uint64) triggers;    /* Cx trigger counts */
    209  1.1  cherry     XEN_GUEST_HANDLE_64(uint64) residencies; /* Cx residencies */
    210  1.1  cherry     uint32_t nr_pc;                          /* entry nr in pc[] */
    211  1.1  cherry     uint32_t nr_cc;                          /* entry nr in cc[] */
    212  1.1  cherry     /*
    213  1.1  cherry      * These two arrays may (and generally will) have unused slots; slots not
    214  1.1  cherry      * having a corresponding hardware register will not be written by the
    215  1.1  cherry      * hypervisor. It is therefore up to the caller to put a suitable sentinel
    216  1.1  cherry      * into all slots before invoking the function.
    217  1.1  cherry      * Indexing is 1-biased (PC1/CC1 being at index 0).
    218  1.1  cherry      */
    219  1.1  cherry     XEN_GUEST_HANDLE_64(uint64) pc;
    220  1.1  cherry     XEN_GUEST_HANDLE_64(uint64) cc;
    221  1.1  cherry };
    222  1.1  cherry 
    223  1.1  cherry struct xen_sysctl_get_pmstat {
    224  1.1  cherry #define PMSTAT_CATEGORY_MASK 0xf0
    225  1.1  cherry #define PMSTAT_PX            0x10
    226  1.1  cherry #define PMSTAT_CX            0x20
    227  1.1  cherry #define PMSTAT_get_max_px    (PMSTAT_PX | 0x1)
    228  1.1  cherry #define PMSTAT_get_pxstat    (PMSTAT_PX | 0x2)
    229  1.1  cherry #define PMSTAT_reset_pxstat  (PMSTAT_PX | 0x3)
    230  1.1  cherry #define PMSTAT_get_max_cx    (PMSTAT_CX | 0x1)
    231  1.1  cherry #define PMSTAT_get_cxstat    (PMSTAT_CX | 0x2)
    232  1.1  cherry #define PMSTAT_reset_cxstat  (PMSTAT_CX | 0x3)
    233  1.1  cherry     uint32_t type;
    234  1.1  cherry     uint32_t cpuid;
    235  1.1  cherry     union {
    236  1.1  cherry         struct pm_px_stat getpx;
    237  1.1  cherry         struct pm_cx_stat getcx;
    238  1.1  cherry         /* other struct for tx, etc */
    239  1.1  cherry     } u;
    240  1.1  cherry };
    241  1.1  cherry 
    242  1.1  cherry /* XEN_SYSCTL_cpu_hotplug */
    243  1.1  cherry struct xen_sysctl_cpu_hotplug {
    244  1.1  cherry     /* IN variables */
    245  1.1  cherry     uint32_t cpu;   /* Physical cpu. */
    246  1.1  cherry #define XEN_SYSCTL_CPU_HOTPLUG_ONLINE  0
    247  1.1  cherry #define XEN_SYSCTL_CPU_HOTPLUG_OFFLINE 1
    248  1.1  cherry     uint32_t op;    /* hotplug opcode */
    249  1.1  cherry };
    250  1.1  cherry 
    251  1.1  cherry /*
    252  1.1  cherry  * Get/set xen power management, include
    253  1.1  cherry  * 1. cpufreq governors and related parameters
    254  1.1  cherry  */
    255  1.1  cherry /* XEN_SYSCTL_pm_op */
    256  1.1  cherry struct xen_userspace {
    257  1.1  cherry     uint32_t scaling_setspeed;
    258  1.1  cherry };
    259  1.1  cherry 
    260  1.1  cherry struct xen_ondemand {
    261  1.1  cherry     uint32_t sampling_rate_max;
    262  1.1  cherry     uint32_t sampling_rate_min;
    263  1.1  cherry 
    264  1.1  cherry     uint32_t sampling_rate;
    265  1.1  cherry     uint32_t up_threshold;
    266  1.1  cherry };
    267  1.1  cherry 
    268  1.1  cherry /*
    269  1.1  cherry  * cpufreq para name of this structure named
    270  1.1  cherry  * same as sysfs file name of native linux
    271  1.1  cherry  */
    272  1.1  cherry #define CPUFREQ_NAME_LEN 16
    273  1.1  cherry struct xen_get_cpufreq_para {
    274  1.1  cherry     /* IN/OUT variable */
    275  1.1  cherry     uint32_t cpu_num;
    276  1.1  cherry     uint32_t freq_num;
    277  1.1  cherry     uint32_t gov_num;
    278  1.1  cherry 
    279  1.1  cherry     /* for all governors */
    280  1.1  cherry     /* OUT variable */
    281  1.1  cherry     XEN_GUEST_HANDLE_64(uint32) affected_cpus;
    282  1.1  cherry     XEN_GUEST_HANDLE_64(uint32) scaling_available_frequencies;
    283  1.1  cherry     XEN_GUEST_HANDLE_64(char)   scaling_available_governors;
    284  1.1  cherry     char scaling_driver[CPUFREQ_NAME_LEN];
    285  1.1  cherry 
    286  1.1  cherry     uint32_t cpuinfo_cur_freq;
    287  1.1  cherry     uint32_t cpuinfo_max_freq;
    288  1.1  cherry     uint32_t cpuinfo_min_freq;
    289  1.1  cherry     uint32_t scaling_cur_freq;
    290  1.1  cherry 
    291  1.1  cherry     char scaling_governor[CPUFREQ_NAME_LEN];
    292  1.1  cherry     uint32_t scaling_max_freq;
    293  1.1  cherry     uint32_t scaling_min_freq;
    294  1.1  cherry 
    295  1.1  cherry     /* for specific governor */
    296  1.1  cherry     union {
    297  1.1  cherry         struct  xen_userspace userspace;
    298  1.1  cherry         struct  xen_ondemand ondemand;
    299  1.1  cherry     } u;
    300  1.1  cherry 
    301  1.1  cherry     int32_t turbo_enabled;
    302  1.1  cherry };
    303  1.1  cherry 
    304  1.1  cherry struct xen_set_cpufreq_gov {
    305  1.1  cherry     char scaling_governor[CPUFREQ_NAME_LEN];
    306  1.1  cherry };
    307  1.1  cherry 
    308  1.1  cherry struct xen_set_cpufreq_para {
    309  1.1  cherry     #define SCALING_MAX_FREQ           1
    310  1.1  cherry     #define SCALING_MIN_FREQ           2
    311  1.1  cherry     #define SCALING_SETSPEED           3
    312  1.1  cherry     #define SAMPLING_RATE              4
    313  1.1  cherry     #define UP_THRESHOLD               5
    314  1.1  cherry 
    315  1.1  cherry     uint32_t ctrl_type;
    316  1.1  cherry     uint32_t ctrl_value;
    317  1.1  cherry };
    318  1.1  cherry 
    319  1.1  cherry struct xen_sysctl_pm_op {
    320  1.1  cherry     #define PM_PARA_CATEGORY_MASK      0xf0
    321  1.1  cherry     #define CPUFREQ_PARA               0x10
    322  1.1  cherry 
    323  1.1  cherry     /* cpufreq command type */
    324  1.1  cherry     #define GET_CPUFREQ_PARA           (CPUFREQ_PARA | 0x01)
    325  1.1  cherry     #define SET_CPUFREQ_GOV            (CPUFREQ_PARA | 0x02)
    326  1.1  cherry     #define SET_CPUFREQ_PARA           (CPUFREQ_PARA | 0x03)
    327  1.1  cherry     #define GET_CPUFREQ_AVGFREQ        (CPUFREQ_PARA | 0x04)
    328  1.1  cherry 
    329  1.1  cherry     /* set/reset scheduler power saving option */
    330  1.1  cherry     #define XEN_SYSCTL_pm_op_set_sched_opt_smt    0x21
    331  1.1  cherry 
    332  1.1  cherry     /* cpuidle max_cstate access command */
    333  1.1  cherry     #define XEN_SYSCTL_pm_op_get_max_cstate       0x22
    334  1.1  cherry     #define XEN_SYSCTL_pm_op_set_max_cstate       0x23
    335  1.1  cherry 
    336  1.1  cherry     /* set scheduler migration cost value */
    337  1.1  cherry     #define XEN_SYSCTL_pm_op_set_vcpu_migration_delay   0x24
    338  1.1  cherry     #define XEN_SYSCTL_pm_op_get_vcpu_migration_delay   0x25
    339  1.1  cherry 
    340  1.1  cherry     /* enable/disable turbo mode when in dbs governor */
    341  1.1  cherry     #define XEN_SYSCTL_pm_op_enable_turbo               0x26
    342  1.1  cherry     #define XEN_SYSCTL_pm_op_disable_turbo              0x27
    343  1.1  cherry 
    344  1.1  cherry     uint32_t cmd;
    345  1.1  cherry     uint32_t cpuid;
    346  1.1  cherry     union {
    347  1.1  cherry         struct xen_get_cpufreq_para get_para;
    348  1.1  cherry         struct xen_set_cpufreq_gov  set_gov;
    349  1.1  cherry         struct xen_set_cpufreq_para set_para;
    350  1.1  cherry         uint64_aligned_t get_avgfreq;
    351  1.1  cherry         uint32_t                    set_sched_opt_smt;
    352  1.1  cherry         uint32_t                    get_max_cstate;
    353  1.1  cherry         uint32_t                    set_max_cstate;
    354  1.1  cherry     } u;
    355  1.1  cherry };
    356  1.1  cherry 
    357  1.1  cherry /* XEN_SYSCTL_page_offline_op */
    358  1.1  cherry struct xen_sysctl_page_offline_op {
    359  1.1  cherry     /* IN: range of page to be offlined */
    360  1.1  cherry #define sysctl_page_offline     1
    361  1.1  cherry #define sysctl_page_online      2
    362  1.1  cherry #define sysctl_query_page_offline  3
    363  1.1  cherry     uint32_t cmd;
    364  1.1  cherry     uint32_t start;
    365  1.1  cherry     uint32_t end;
    366  1.1  cherry     /* OUT: result of page offline request */
    367  1.1  cherry     /*
    368  1.1  cherry      * bit 0~15: result flags
    369  1.1  cherry      * bit 16~31: owner
    370  1.1  cherry      */
    371  1.1  cherry     XEN_GUEST_HANDLE(uint32) status;
    372  1.1  cherry };
    373  1.1  cherry 
    374  1.1  cherry #define PG_OFFLINE_STATUS_MASK    (0xFFUL)
    375  1.1  cherry 
    376  1.1  cherry /* The result is invalid, i.e. HV does not handle it */
    377  1.1  cherry #define PG_OFFLINE_INVALID   (0x1UL << 0)
    378  1.1  cherry 
    379  1.1  cherry #define PG_OFFLINE_OFFLINED  (0x1UL << 1)
    380  1.1  cherry #define PG_OFFLINE_PENDING   (0x1UL << 2)
    381  1.1  cherry #define PG_OFFLINE_FAILED    (0x1UL << 3)
    382  1.1  cherry #define PG_OFFLINE_AGAIN     (0x1UL << 4)
    383  1.1  cherry 
    384  1.1  cherry #define PG_ONLINE_FAILED     PG_OFFLINE_FAILED
    385  1.1  cherry #define PG_ONLINE_ONLINED    PG_OFFLINE_OFFLINED
    386  1.1  cherry 
    387  1.1  cherry #define PG_OFFLINE_STATUS_OFFLINED              (0x1UL << 1)
    388  1.1  cherry #define PG_OFFLINE_STATUS_ONLINE                (0x1UL << 2)
    389  1.1  cherry #define PG_OFFLINE_STATUS_OFFLINE_PENDING       (0x1UL << 3)
    390  1.1  cherry #define PG_OFFLINE_STATUS_BROKEN                (0x1UL << 4)
    391  1.1  cherry 
    392  1.1  cherry #define PG_OFFLINE_MISC_MASK    (0xFFUL << 4)
    393  1.1  cherry 
    394  1.1  cherry /* valid when PG_OFFLINE_FAILED or PG_OFFLINE_PENDING */
    395  1.1  cherry #define PG_OFFLINE_XENPAGE   (0x1UL << 8)
    396  1.1  cherry #define PG_OFFLINE_DOM0PAGE  (0x1UL << 9)
    397  1.1  cherry #define PG_OFFLINE_ANONYMOUS (0x1UL << 10)
    398  1.1  cherry #define PG_OFFLINE_NOT_CONV_RAM   (0x1UL << 11)
    399  1.1  cherry #define PG_OFFLINE_OWNED     (0x1UL << 12)
    400  1.1  cherry 
    401  1.1  cherry #define PG_OFFLINE_BROKEN    (0x1UL << 13)
    402  1.1  cherry #define PG_ONLINE_BROKEN     PG_OFFLINE_BROKEN
    403  1.1  cherry 
    404  1.1  cherry #define PG_OFFLINE_OWNER_SHIFT 16
    405  1.1  cherry 
    406  1.1  cherry /* XEN_SYSCTL_lockprof_op */
    407  1.1  cherry /* Sub-operations: */
    408  1.1  cherry #define XEN_SYSCTL_LOCKPROF_reset 1   /* Reset all profile data to zero. */
    409  1.1  cherry #define XEN_SYSCTL_LOCKPROF_query 2   /* Get lock profile information. */
    410  1.1  cherry /* Record-type: */
    411  1.1  cherry #define LOCKPROF_TYPE_GLOBAL      0   /* global lock, idx meaningless */
    412  1.1  cherry #define LOCKPROF_TYPE_PERDOM      1   /* per-domain lock, idx is domid */
    413  1.1  cherry #define LOCKPROF_TYPE_N           2   /* number of types */
    414  1.1  cherry struct xen_sysctl_lockprof_data {
    415  1.1  cherry     char     name[40];     /* lock name (may include up to 2 %d specifiers) */
    416  1.1  cherry     int32_t  type;         /* LOCKPROF_TYPE_??? */
    417  1.1  cherry     int32_t  idx;          /* index (e.g. domain id) */
    418  1.1  cherry     uint64_aligned_t lock_cnt;     /* # of locking succeeded */
    419  1.1  cherry     uint64_aligned_t block_cnt;    /* # of wait for lock */
    420  1.1  cherry     uint64_aligned_t lock_time;    /* nsecs lock held */
    421  1.1  cherry     uint64_aligned_t block_time;   /* nsecs waited for lock */
    422  1.1  cherry };
    423  1.1  cherry typedef struct xen_sysctl_lockprof_data xen_sysctl_lockprof_data_t;
    424  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_sysctl_lockprof_data_t);
    425  1.1  cherry struct xen_sysctl_lockprof_op {
    426  1.1  cherry     /* IN variables. */
    427  1.1  cherry     uint32_t       cmd;               /* XEN_SYSCTL_LOCKPROF_??? */
    428  1.1  cherry     uint32_t       max_elem;          /* size of output buffer */
    429  1.1  cherry     /* OUT variables (query only). */
    430  1.1  cherry     uint32_t       nr_elem;           /* number of elements available */
    431  1.1  cherry     uint64_aligned_t time;            /* nsecs of profile measurement */
    432  1.1  cherry     /* profile information (or NULL) */
    433  1.1  cherry     XEN_GUEST_HANDLE_64(xen_sysctl_lockprof_data_t) data;
    434  1.1  cherry };
    435  1.1  cherry 
    436  1.1  cherry /* XEN_SYSCTL_cputopoinfo */
    437  1.1  cherry #define XEN_INVALID_CORE_ID     (~0U)
    438  1.1  cherry #define XEN_INVALID_SOCKET_ID   (~0U)
    439  1.1  cherry #define XEN_INVALID_NODE_ID     (~0U)
    440  1.1  cherry 
    441  1.1  cherry struct xen_sysctl_cputopo {
    442  1.1  cherry     uint32_t core;
    443  1.1  cherry     uint32_t socket;
    444  1.1  cherry     uint32_t node;
    445  1.1  cherry };
    446  1.1  cherry typedef struct xen_sysctl_cputopo xen_sysctl_cputopo_t;
    447  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cputopo_t);
    448  1.1  cherry 
    449  1.1  cherry /*
    450  1.1  cherry  * IN:
    451  1.1  cherry  *  - a NULL 'cputopo' handle is a request for maximun 'num_cpus'.
    452  1.1  cherry  *  - otherwise it's the number of entries in 'cputopo'
    453  1.1  cherry  *
    454  1.1  cherry  * OUT:
    455  1.1  cherry  *  - If 'num_cpus' is less than the number Xen wants to write but the handle
    456  1.1  cherry  *    handle is not a NULL one, partial data gets returned and 'num_cpus' gets
    457  1.1  cherry  *    updated to reflect the intended number.
    458  1.1  cherry  *  - Otherwise, 'num_cpus' shall indicate the number of entries written, which
    459  1.1  cherry  *    may be less than the input value.
    460  1.1  cherry  */
    461  1.1  cherry struct xen_sysctl_cputopoinfo {
    462  1.1  cherry     uint32_t num_cpus;
    463  1.1  cherry     XEN_GUEST_HANDLE_64(xen_sysctl_cputopo_t) cputopo;
    464  1.1  cherry };
    465  1.1  cherry 
    466  1.1  cherry /* XEN_SYSCTL_numainfo */
    467  1.1  cherry #define XEN_INVALID_MEM_SZ     (~0U)
    468  1.1  cherry #define XEN_INVALID_NODE_DIST  (~0U)
    469  1.1  cherry 
    470  1.1  cherry struct xen_sysctl_meminfo {
    471  1.1  cherry     uint64_t memsize;
    472  1.1  cherry     uint64_t memfree;
    473  1.1  cherry };
    474  1.1  cherry typedef struct xen_sysctl_meminfo xen_sysctl_meminfo_t;
    475  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_sysctl_meminfo_t);
    476  1.1  cherry 
    477  1.1  cherry /*
    478  1.1  cherry  * IN:
    479  1.1  cherry  *  - Both 'meminfo' and 'distance' handles being null is a request
    480  1.1  cherry  *    for maximum value of 'num_nodes'.
    481  1.1  cherry  *  - Otherwise it's the number of entries in 'meminfo' and square root
    482  1.1  cherry  *    of number of entries in 'distance' (when corresponding handle is
    483  1.1  cherry  *    non-null)
    484  1.1  cherry  *
    485  1.1  cherry  * OUT:
    486  1.1  cherry  *  - If 'num_nodes' is less than the number Xen wants to write but either
    487  1.1  cherry  *    handle is not a NULL one, partial data gets returned and 'num_nodes'
    488  1.1  cherry  *    gets updated to reflect the intended number.
    489  1.1  cherry  *  - Otherwise, 'num_nodes' shall indicate the number of entries written, which
    490  1.1  cherry  *    may be less than the input value.
    491  1.1  cherry  */
    492  1.1  cherry 
    493  1.1  cherry struct xen_sysctl_numainfo {
    494  1.1  cherry     uint32_t num_nodes;
    495  1.1  cherry 
    496  1.1  cherry     XEN_GUEST_HANDLE_64(xen_sysctl_meminfo_t) meminfo;
    497  1.1  cherry 
    498  1.1  cherry     /*
    499  1.1  cherry      * Distance between nodes 'i' and 'j' is stored in index 'i*N + j',
    500  1.1  cherry      * where N is the number of nodes that will be returned in 'num_nodes'
    501  1.1  cherry      * (i.e. not 'num_nodes' provided by the caller)
    502  1.1  cherry      */
    503  1.1  cherry     XEN_GUEST_HANDLE_64(uint32) distance;
    504  1.1  cherry };
    505  1.1  cherry 
    506  1.1  cherry /* XEN_SYSCTL_cpupool_op */
    507  1.1  cherry #define XEN_SYSCTL_CPUPOOL_OP_CREATE                1  /* C */
    508  1.1  cherry #define XEN_SYSCTL_CPUPOOL_OP_DESTROY               2  /* D */
    509  1.1  cherry #define XEN_SYSCTL_CPUPOOL_OP_INFO                  3  /* I */
    510  1.1  cherry #define XEN_SYSCTL_CPUPOOL_OP_ADDCPU                4  /* A */
    511  1.1  cherry #define XEN_SYSCTL_CPUPOOL_OP_RMCPU                 5  /* R */
    512  1.1  cherry #define XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN            6  /* M */
    513  1.1  cherry #define XEN_SYSCTL_CPUPOOL_OP_FREEINFO              7  /* F */
    514  1.1  cherry #define XEN_SYSCTL_CPUPOOL_PAR_ANY     0xFFFFFFFF
    515  1.1  cherry struct xen_sysctl_cpupool_op {
    516  1.1  cherry     uint32_t op;          /* IN */
    517  1.1  cherry     uint32_t cpupool_id;  /* IN: CDIARM OUT: CI */
    518  1.1  cherry     uint32_t sched_id;    /* IN: C      OUT: I  */
    519  1.1  cherry     uint32_t domid;       /* IN: M              */
    520  1.1  cherry     uint32_t cpu;         /* IN: AR             */
    521  1.1  cherry     uint32_t n_dom;       /*            OUT: I  */
    522  1.1  cherry     struct xenctl_bitmap cpumap; /*     OUT: IF */
    523  1.1  cherry };
    524  1.1  cherry 
    525  1.1  cherry /*
    526  1.1  cherry  * Error return values of cpupool operations:
    527  1.1  cherry  *
    528  1.1  cherry  * -EADDRINUSE:
    529  1.1  cherry  *  XEN_SYSCTL_CPUPOOL_OP_RMCPU: A vcpu is temporarily pinned to the cpu
    530  1.1  cherry  *    which is to be removed from a cpupool.
    531  1.1  cherry  * -EADDRNOTAVAIL:
    532  1.1  cherry  *  XEN_SYSCTL_CPUPOOL_OP_ADDCPU, XEN_SYSCTL_CPUPOOL_OP_RMCPU: A previous
    533  1.1  cherry  *    request to remove a cpu from a cpupool was terminated with -EAGAIN
    534  1.1  cherry  *    and has not been retried using the same parameters.
    535  1.1  cherry  * -EAGAIN:
    536  1.1  cherry  *  XEN_SYSCTL_CPUPOOL_OP_RMCPU: The cpu can't be removed from the cpupool
    537  1.1  cherry  *    as it is active in the hypervisor. A retry will succeed soon.
    538  1.1  cherry  * -EBUSY:
    539  1.1  cherry  *  XEN_SYSCTL_CPUPOOL_OP_DESTROY, XEN_SYSCTL_CPUPOOL_OP_RMCPU: A cpupool
    540  1.1  cherry  *    can't be destroyed or the last cpu can't be removed as there is still
    541  1.1  cherry  *    a running domain in that cpupool.
    542  1.1  cherry  * -EEXIST:
    543  1.1  cherry  *  XEN_SYSCTL_CPUPOOL_OP_CREATE: A cpupool_id was specified and is already
    544  1.1  cherry  *    existing.
    545  1.1  cherry  * -EINVAL:
    546  1.1  cherry  *  XEN_SYSCTL_CPUPOOL_OP_ADDCPU, XEN_SYSCTL_CPUPOOL_OP_RMCPU: An illegal
    547  1.1  cherry  *    cpu was specified (cpu does not exist).
    548  1.1  cherry  *  XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN: An illegal domain was specified
    549  1.1  cherry  *    (domain id illegal or not suitable for operation).
    550  1.1  cherry  * -ENODEV:
    551  1.1  cherry  *  XEN_SYSCTL_CPUPOOL_OP_ADDCPU, XEN_SYSCTL_CPUPOOL_OP_RMCPU: The specified
    552  1.1  cherry  *    cpu is either not free (add) or not member of the specified cpupool
    553  1.1  cherry  *    (remove).
    554  1.1  cherry  * -ENOENT:
    555  1.1  cherry  *  all: The cpupool with the specified cpupool_id doesn't exist.
    556  1.1  cherry  *
    557  1.1  cherry  * Some common error return values like -ENOMEM and -EFAULT are possible for
    558  1.1  cherry  * all the operations.
    559  1.1  cherry  */
    560  1.1  cherry 
    561  1.1  cherry #define ARINC653_MAX_DOMAINS_PER_SCHEDULE   64
    562  1.1  cherry /*
    563  1.1  cherry  * This structure is used to pass a new ARINC653 schedule from a
    564  1.1  cherry  * privileged domain (ie dom0) to Xen.
    565  1.1  cherry  */
    566  1.1  cherry struct xen_sysctl_arinc653_schedule {
    567  1.1  cherry     /* major_frame holds the time for the new schedule's major frame
    568  1.1  cherry      * in nanoseconds. */
    569  1.1  cherry     uint64_aligned_t     major_frame;
    570  1.1  cherry     /* num_sched_entries holds how many of the entries in the
    571  1.1  cherry      * sched_entries[] array are valid. */
    572  1.1  cherry     uint8_t     num_sched_entries;
    573  1.1  cherry     /* The sched_entries array holds the actual schedule entries. */
    574  1.1  cherry     struct {
    575  1.1  cherry         /* dom_handle must match a domain's UUID */
    576  1.1  cherry         xen_domain_handle_t dom_handle;
    577  1.1  cherry         /* If a domain has multiple VCPUs, vcpu_id specifies which one
    578  1.1  cherry          * this schedule entry applies to. It should be set to 0 if
    579  1.1  cherry          * there is only one VCPU for the domain. */
    580  1.1  cherry         unsigned int vcpu_id;
    581  1.1  cherry         /* runtime specifies the amount of time that should be allocated
    582  1.1  cherry          * to this VCPU per major frame. It is specified in nanoseconds */
    583  1.1  cherry         uint64_aligned_t runtime;
    584  1.1  cherry     } sched_entries[ARINC653_MAX_DOMAINS_PER_SCHEDULE];
    585  1.1  cherry };
    586  1.1  cherry typedef struct xen_sysctl_arinc653_schedule xen_sysctl_arinc653_schedule_t;
    587  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_sysctl_arinc653_schedule_t);
    588  1.1  cherry 
    589  1.1  cherry /*
    590  1.1  cherry  * Valid range for context switch rate limit (in microseconds).
    591  1.1  cherry  * Applicable to Credit and Credit2 schedulers.
    592  1.1  cherry  */
    593  1.1  cherry #define XEN_SYSCTL_SCHED_RATELIMIT_MAX 500000
    594  1.1  cherry #define XEN_SYSCTL_SCHED_RATELIMIT_MIN 100
    595  1.1  cherry 
    596  1.1  cherry struct xen_sysctl_credit_schedule {
    597  1.1  cherry     /* Length of timeslice in milliseconds */
    598  1.1  cherry #define XEN_SYSCTL_CSCHED_TSLICE_MAX 1000
    599  1.1  cherry #define XEN_SYSCTL_CSCHED_TSLICE_MIN 1
    600  1.1  cherry     unsigned tslice_ms;
    601  1.1  cherry     unsigned ratelimit_us;
    602  1.1  cherry     /*
    603  1.1  cherry      * How long we consider a vCPU to be cache-hot on the
    604  1.1  cherry      * CPU where it has run (max 100ms, in microseconds)
    605  1.1  cherry     */
    606  1.1  cherry #define XEN_SYSCTL_CSCHED_MGR_DLY_MAX_US (100 * 1000)
    607  1.1  cherry     unsigned vcpu_migr_delay_us;
    608  1.1  cherry };
    609  1.1  cherry 
    610  1.1  cherry struct xen_sysctl_credit2_schedule {
    611  1.1  cherry     unsigned ratelimit_us;
    612  1.1  cherry };
    613  1.1  cherry 
    614  1.1  cherry /* XEN_SYSCTL_scheduler_op */
    615  1.1  cherry /* Set or get info? */
    616  1.1  cherry #define XEN_SYSCTL_SCHEDOP_putinfo 0
    617  1.1  cherry #define XEN_SYSCTL_SCHEDOP_getinfo 1
    618  1.1  cherry struct xen_sysctl_scheduler_op {
    619  1.1  cherry     uint32_t cpupool_id; /* Cpupool whose scheduler is to be targetted. */
    620  1.1  cherry     uint32_t sched_id;   /* XEN_SCHEDULER_* (domctl.h) */
    621  1.1  cherry     uint32_t cmd;        /* XEN_SYSCTL_SCHEDOP_* */
    622  1.1  cherry     union {
    623  1.1  cherry         struct xen_sysctl_sched_arinc653 {
    624  1.1  cherry             XEN_GUEST_HANDLE_64(xen_sysctl_arinc653_schedule_t) schedule;
    625  1.1  cherry         } sched_arinc653;
    626  1.1  cherry         struct xen_sysctl_credit_schedule sched_credit;
    627  1.1  cherry         struct xen_sysctl_credit2_schedule sched_credit2;
    628  1.1  cherry     } u;
    629  1.1  cherry };
    630  1.1  cherry 
    631  1.1  cherry /*
    632  1.1  cherry  * Output format of gcov data:
    633  1.1  cherry  *
    634  1.1  cherry  * XEN_GCOV_FORMAT_MAGIC XEN_GCOV_RECORD ... XEN_GCOV_RECORD
    635  1.1  cherry  *
    636  1.1  cherry  * That is, one magic number followed by 0 or more record.
    637  1.1  cherry  *
    638  1.1  cherry  * The magic number is stored as an uint32_t field.
    639  1.1  cherry  *
    640  1.1  cherry  * The record is packed and variable in length. It has the form:
    641  1.1  cherry  *
    642  1.1  cherry  *  filename: a NULL terminated path name extracted from gcov, used to
    643  1.1  cherry  *            create the name of gcda file.
    644  1.1  cherry  *  size:     a uint32_t field indicating the size of the payload, the
    645  1.1  cherry  *            unit is byte.
    646  1.1  cherry  *  payload:  the actual payload, length is `size' bytes.
    647  1.1  cherry  *
    648  1.1  cherry  * Userspace tool will split the record to different files.
    649  1.1  cherry  */
    650  1.1  cherry 
    651  1.1  cherry #define XEN_GCOV_FORMAT_MAGIC    0x58434f56 /* XCOV */
    652  1.1  cherry 
    653  1.1  cherry /*
    654  1.1  cherry  * Ouput format of LLVM coverage data is just a raw stream, as would be
    655  1.1  cherry  * written by the compiler_rt run time library into a .profraw file. There
    656  1.1  cherry  * are no special Xen tags or delimiters because none are needed.
    657  1.1  cherry  */
    658  1.1  cherry 
    659  1.1  cherry #define XEN_SYSCTL_COVERAGE_get_size 0 /* Get total size of output data */
    660  1.1  cherry #define XEN_SYSCTL_COVERAGE_read     1 /* Read output data */
    661  1.1  cherry #define XEN_SYSCTL_COVERAGE_reset    2 /* Reset all counters */
    662  1.1  cherry 
    663  1.1  cherry struct xen_sysctl_coverage_op {
    664  1.1  cherry     uint32_t cmd;
    665  1.1  cherry     uint32_t size; /* IN/OUT: size of the buffer  */
    666  1.1  cherry     XEN_GUEST_HANDLE_64(char) buffer; /* OUT */
    667  1.1  cherry };
    668  1.1  cherry 
    669  1.1  cherry #define XEN_SYSCTL_PSR_CMT_get_total_rmid            0
    670  1.1  cherry #define XEN_SYSCTL_PSR_CMT_get_l3_upscaling_factor   1
    671  1.1  cherry /* The L3 cache size is returned in KB unit */
    672  1.1  cherry #define XEN_SYSCTL_PSR_CMT_get_l3_cache_size         2
    673  1.1  cherry #define XEN_SYSCTL_PSR_CMT_enabled                   3
    674  1.1  cherry #define XEN_SYSCTL_PSR_CMT_get_l3_event_mask         4
    675  1.1  cherry struct xen_sysctl_psr_cmt_op {
    676  1.1  cherry     uint32_t cmd;       /* IN: XEN_SYSCTL_PSR_CMT_* */
    677  1.1  cherry     uint32_t flags;     /* padding variable, may be extended for future use */
    678  1.1  cherry     union {
    679  1.1  cherry         uint64_t data;  /* OUT */
    680  1.1  cherry         struct {
    681  1.1  cherry             uint32_t cpu;   /* IN */
    682  1.1  cherry             uint32_t rsvd;
    683  1.1  cherry         } l3_cache;
    684  1.1  cherry     } u;
    685  1.1  cherry };
    686  1.1  cherry 
    687  1.1  cherry /* XEN_SYSCTL_pcitopoinfo */
    688  1.1  cherry #define XEN_INVALID_DEV (XEN_INVALID_NODE_ID - 1)
    689  1.1  cherry struct xen_sysctl_pcitopoinfo {
    690  1.1  cherry     /*
    691  1.1  cherry      * IN: Number of elements in 'devs' and 'nodes' arrays.
    692  1.1  cherry      * OUT: Number of processed elements of those arrays.
    693  1.1  cherry      */
    694  1.1  cherry     uint32_t num_devs;
    695  1.1  cherry 
    696  1.1  cherry     /* IN: list of devices for which node IDs are requested. */
    697  1.1  cherry     XEN_GUEST_HANDLE_64(physdev_pci_device_t) devs;
    698  1.1  cherry 
    699  1.1  cherry     /*
    700  1.1  cherry      * OUT: node identifier for each device.
    701  1.1  cherry      * If information for a particular device is not available then
    702  1.1  cherry      * corresponding entry will be set to XEN_INVALID_NODE_ID. If
    703  1.1  cherry      * device is not known to the hypervisor then XEN_INVALID_DEV
    704  1.1  cherry      * will be provided.
    705  1.1  cherry      */
    706  1.1  cherry     XEN_GUEST_HANDLE_64(uint32) nodes;
    707  1.1  cherry };
    708  1.1  cherry 
    709  1.1  cherry #define XEN_SYSCTL_PSR_get_l3_info               0
    710  1.1  cherry #define XEN_SYSCTL_PSR_get_l2_info               1
    711  1.1  cherry #define XEN_SYSCTL_PSR_get_mba_info              2
    712  1.1  cherry struct xen_sysctl_psr_alloc {
    713  1.1  cherry     uint32_t cmd;       /* IN: XEN_SYSCTL_PSR_* */
    714  1.1  cherry     uint32_t target;    /* IN */
    715  1.1  cherry     union {
    716  1.1  cherry         struct {
    717  1.1  cherry             uint32_t cbm_len;   /* OUT: CBM length */
    718  1.1  cherry             uint32_t cos_max;   /* OUT: Maximum COS */
    719  1.1  cherry #define XEN_SYSCTL_PSR_CAT_L3_CDP       (1u << 0)
    720  1.1  cherry             uint32_t flags;     /* OUT: CAT flags */
    721  1.1  cherry         } cat_info;
    722  1.1  cherry 
    723  1.1  cherry         struct {
    724  1.1  cherry             uint32_t thrtl_max; /* OUT: Maximum throttle */
    725  1.1  cherry             uint32_t cos_max;   /* OUT: Maximum COS */
    726  1.1  cherry #define XEN_SYSCTL_PSR_MBA_LINEAR      (1u << 0)
    727  1.1  cherry             uint32_t flags;     /* OUT: MBA flags */
    728  1.1  cherry         } mba_info;
    729  1.1  cherry     } u;
    730  1.1  cherry };
    731  1.1  cherry 
    732  1.1  cherry #define XEN_SYSCTL_TMEM_OP_ALL_CLIENTS 0xFFFFU
    733  1.1  cherry 
    734  1.1  cherry #define XEN_SYSCTL_TMEM_OP_THAW                   0
    735  1.1  cherry #define XEN_SYSCTL_TMEM_OP_FREEZE                 1
    736  1.1  cherry #define XEN_SYSCTL_TMEM_OP_FLUSH                  2
    737  1.1  cherry #define XEN_SYSCTL_TMEM_OP_DESTROY                3
    738  1.1  cherry #define XEN_SYSCTL_TMEM_OP_LIST                   4
    739  1.1  cherry #define XEN_SYSCTL_TMEM_OP_GET_CLIENT_INFO        5
    740  1.1  cherry #define XEN_SYSCTL_TMEM_OP_SET_CLIENT_INFO        6
    741  1.1  cherry #define XEN_SYSCTL_TMEM_OP_GET_POOLS              7
    742  1.1  cherry #define XEN_SYSCTL_TMEM_OP_QUERY_FREEABLE_MB      8
    743  1.1  cherry #define XEN_SYSCTL_TMEM_OP_SET_POOLS              9
    744  1.1  cherry #define XEN_SYSCTL_TMEM_OP_SAVE_BEGIN             10
    745  1.1  cherry #define XEN_SYSCTL_TMEM_OP_SET_AUTH               11
    746  1.1  cherry #define XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_PAGE     19
    747  1.1  cherry #define XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_INV      20
    748  1.1  cherry #define XEN_SYSCTL_TMEM_OP_SAVE_END               21
    749  1.1  cherry #define XEN_SYSCTL_TMEM_OP_RESTORE_BEGIN          30
    750  1.1  cherry #define XEN_SYSCTL_TMEM_OP_RESTORE_PUT_PAGE       32
    751  1.1  cherry #define XEN_SYSCTL_TMEM_OP_RESTORE_FLUSH_PAGE     33
    752  1.1  cherry 
    753  1.1  cherry /*
    754  1.1  cherry  * XEN_SYSCTL_TMEM_OP_SAVE_GET_NEXT_[PAGE|INV] override the 'buf' in
    755  1.1  cherry  * xen_sysctl_tmem_op with this structure - sometimes with an extra
    756  1.1  cherry  * page tackled on.
    757  1.1  cherry  */
    758  1.1  cherry struct tmem_handle {
    759  1.1  cherry     uint32_t pool_id;
    760  1.1  cherry     uint32_t index;
    761  1.1  cherry     xen_tmem_oid_t oid;
    762  1.1  cherry };
    763  1.1  cherry 
    764  1.1  cherry /*
    765  1.1  cherry  * XEN_SYSCTL_TMEM_OP_[GET,SAVE]_CLIENT uses the 'client' in
    766  1.1  cherry  * xen_tmem_op with this structure, which is mostly used during migration.
    767  1.1  cherry  */
    768  1.1  cherry struct xen_tmem_client {
    769  1.1  cherry     uint32_t version;   /* If mismatched we will get XEN_EOPNOTSUPP. */
    770  1.1  cherry     uint32_t maxpools;  /* If greater than what hypervisor supports, will get
    771  1.1  cherry                            XEN_ERANGE. */
    772  1.1  cherry     uint32_t nr_pools;  /* Current amount of pools. Ignored on SET*/
    773  1.1  cherry     union {             /* See TMEM_CLIENT_[COMPRESS,FROZEN] */
    774  1.1  cherry         uint32_t raw;
    775  1.1  cherry         struct {
    776  1.1  cherry             uint8_t frozen:1,
    777  1.1  cherry                     compress:1,
    778  1.1  cherry                     migrating:1;
    779  1.1  cherry         } u;
    780  1.1  cherry     } flags;
    781  1.1  cherry     uint32_t weight;
    782  1.1  cherry };
    783  1.1  cherry typedef struct xen_tmem_client xen_tmem_client_t;
    784  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_tmem_client_t);
    785  1.1  cherry 
    786  1.1  cherry /*
    787  1.1  cherry  * XEN_SYSCTL_TMEM_OP_[GET|SET]_POOLS or XEN_SYSCTL_TMEM_OP_SET_AUTH
    788  1.1  cherry  * uses the 'pool' array in * xen_sysctl_tmem_op with this structure.
    789  1.1  cherry  * The XEN_SYSCTL_TMEM_OP_GET_POOLS hypercall will
    790  1.1  cherry  * return the number of entries in 'pool' or a negative value
    791  1.1  cherry  * if an error was encountered.
    792  1.1  cherry  * The XEN_SYSCTL_TMEM_OP_SET_[AUTH|POOLS] will return the number of
    793  1.1  cherry  * entries in 'pool' processed or a negative value if an error
    794  1.1  cherry  * was encountered.
    795  1.1  cherry  */
    796  1.1  cherry struct xen_tmem_pool_info {
    797  1.1  cherry     union {
    798  1.1  cherry         uint32_t raw;
    799  1.1  cherry         struct {
    800  1.1  cherry             uint32_t persist:1,    /* See TMEM_POOL_PERSIST. */
    801  1.1  cherry                      shared:1,     /* See TMEM_POOL_SHARED. */
    802  1.1  cherry                      auth:1,       /* See TMEM_POOL_AUTH. */
    803  1.1  cherry                      rsv1:1,
    804  1.1  cherry                      pagebits:8,   /* TMEM_POOL_PAGESIZE_[SHIFT,MASK]. */
    805  1.1  cherry                      rsv2:12,
    806  1.1  cherry                      version:8;    /* TMEM_POOL_VERSION_[SHIFT,MASK]. */
    807  1.1  cherry         } u;
    808  1.1  cherry     } flags;
    809  1.1  cherry     uint32_t id;                  /* Less than tmem_client.maxpools. */
    810  1.1  cherry     uint64_t n_pages;             /* Zero on XEN_SYSCTL_TMEM_OP_SET_[AUTH|POOLS]. */
    811  1.1  cherry     uint64_aligned_t uuid[2];
    812  1.1  cherry };
    813  1.1  cherry typedef struct xen_tmem_pool_info xen_tmem_pool_info_t;
    814  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_tmem_pool_info_t);
    815  1.1  cherry 
    816  1.1  cherry struct xen_sysctl_tmem_op {
    817  1.1  cherry     uint32_t cmd;       /* IN: XEN_SYSCTL_TMEM_OP_* . */
    818  1.1  cherry     int32_t pool_id;    /* IN: 0 by default unless _SAVE_*, RESTORE_* .*/
    819  1.1  cherry     uint32_t cli_id;    /* IN: client id, 0 for XEN_SYSCTL_TMEM_QUERY_FREEABLE_MB
    820  1.1  cherry                            for all others can be the domain id or
    821  1.1  cherry                            XEN_SYSCTL_TMEM_OP_ALL_CLIENTS for all. */
    822  1.1  cherry     uint32_t len;       /* IN: length of 'buf'. If not applicable to use 0. */
    823  1.1  cherry     uint32_t arg;       /* IN: If not applicable to command use 0. */
    824  1.1  cherry     uint32_t pad;       /* Padding so structure is the same under 32 and 64. */
    825  1.1  cherry     xen_tmem_oid_t oid; /* IN: If not applicable to command use 0s. */
    826  1.1  cherry     union {
    827  1.1  cherry         XEN_GUEST_HANDLE_64(char) buf; /* IN/OUT: Buffer to save/restore */
    828  1.1  cherry         XEN_GUEST_HANDLE_64(xen_tmem_client_t) client; /* IN/OUT for */
    829  1.1  cherry                         /*  XEN_SYSCTL_TMEM_OP_[GET,SAVE]_CLIENT. */
    830  1.1  cherry         XEN_GUEST_HANDLE_64(xen_tmem_pool_info_t) pool; /* OUT for */
    831  1.1  cherry                         /* XEN_SYSCTL_TMEM_OP_GET_POOLS. Must have 'len' */
    832  1.1  cherry                         /* of them. */
    833  1.1  cherry     } u;
    834  1.1  cherry };
    835  1.1  cherry 
    836  1.1  cherry /*
    837  1.1  cherry  * XEN_SYSCTL_get_cpu_levelling_caps (x86 specific)
    838  1.1  cherry  *
    839  1.1  cherry  * Return hardware capabilities concerning masking or faulting of the cpuid
    840  1.1  cherry  * instruction for PV guests.
    841  1.1  cherry  */
    842  1.1  cherry struct xen_sysctl_cpu_levelling_caps {
    843  1.1  cherry #define XEN_SYSCTL_CPU_LEVELCAP_faulting    (1ul <<  0) /* CPUID faulting    */
    844  1.1  cherry #define XEN_SYSCTL_CPU_LEVELCAP_ecx         (1ul <<  1) /* 0x00000001.ecx    */
    845  1.1  cherry #define XEN_SYSCTL_CPU_LEVELCAP_edx         (1ul <<  2) /* 0x00000001.edx    */
    846  1.1  cherry #define XEN_SYSCTL_CPU_LEVELCAP_extd_ecx    (1ul <<  3) /* 0x80000001.ecx    */
    847  1.1  cherry #define XEN_SYSCTL_CPU_LEVELCAP_extd_edx    (1ul <<  4) /* 0x80000001.edx    */
    848  1.1  cherry #define XEN_SYSCTL_CPU_LEVELCAP_xsave_eax   (1ul <<  5) /* 0x0000000D:1.eax  */
    849  1.1  cherry #define XEN_SYSCTL_CPU_LEVELCAP_thermal_ecx (1ul <<  6) /* 0x00000006.ecx    */
    850  1.1  cherry #define XEN_SYSCTL_CPU_LEVELCAP_l7s0_eax    (1ul <<  7) /* 0x00000007:0.eax  */
    851  1.1  cherry #define XEN_SYSCTL_CPU_LEVELCAP_l7s0_ebx    (1ul <<  8) /* 0x00000007:0.ebx  */
    852  1.1  cherry     uint32_t caps;
    853  1.1  cherry };
    854  1.1  cherry 
    855  1.1  cherry /*
    856  1.1  cherry  * XEN_SYSCTL_get_cpu_featureset (x86 specific)
    857  1.1  cherry  *
    858  1.1  cherry  * Return information about featuresets available on this host.
    859  1.1  cherry  *  -  Raw: The real cpuid values.
    860  1.1  cherry  *  - Host: The values Xen is using, (after command line overrides, etc).
    861  1.1  cherry  *  -   PV: Maximum set of features which can be given to a PV guest.
    862  1.1  cherry  *  -  HVM: Maximum set of features which can be given to a HVM guest.
    863  1.1  cherry  */
    864  1.1  cherry struct xen_sysctl_cpu_featureset {
    865  1.1  cherry #define XEN_SYSCTL_cpu_featureset_raw      0
    866  1.1  cherry #define XEN_SYSCTL_cpu_featureset_host     1
    867  1.1  cherry #define XEN_SYSCTL_cpu_featureset_pv       2
    868  1.1  cherry #define XEN_SYSCTL_cpu_featureset_hvm      3
    869  1.1  cherry     uint32_t index;       /* IN: Which featureset to query? */
    870  1.1  cherry     uint32_t nr_features; /* IN/OUT: Number of entries in/written to
    871  1.1  cherry                            * 'features', or the maximum number of features if
    872  1.1  cherry                            * the guest handle is NULL.  NB. All featuresets
    873  1.1  cherry                            * come from the same numberspace, so have the same
    874  1.1  cherry                            * maximum length. */
    875  1.1  cherry     XEN_GUEST_HANDLE_64(uint32) features; /* OUT: */
    876  1.1  cherry };
    877  1.1  cherry 
    878  1.1  cherry /*
    879  1.1  cherry  * XEN_SYSCTL_LIVEPATCH_op
    880  1.1  cherry  *
    881  1.1  cherry  * Refer to the docs/unstable/misc/livepatch.markdown
    882  1.1  cherry  * for the design details of this hypercall.
    883  1.1  cherry  *
    884  1.1  cherry  * There are four sub-ops:
    885  1.1  cherry  *  XEN_SYSCTL_LIVEPATCH_UPLOAD (0)
    886  1.1  cherry  *  XEN_SYSCTL_LIVEPATCH_GET (1)
    887  1.1  cherry  *  XEN_SYSCTL_LIVEPATCH_LIST (2)
    888  1.1  cherry  *  XEN_SYSCTL_LIVEPATCH_ACTION (3)
    889  1.1  cherry  *
    890  1.1  cherry  * The normal sequence of sub-ops is to:
    891  1.1  cherry  *  1) XEN_SYSCTL_LIVEPATCH_UPLOAD to upload the payload. If errors STOP.
    892  1.1  cherry  *  2) XEN_SYSCTL_LIVEPATCH_GET to check the `->rc`. If -XEN_EAGAIN spin.
    893  1.1  cherry  *     If zero go to next step.
    894  1.1  cherry  *  3) XEN_SYSCTL_LIVEPATCH_ACTION with LIVEPATCH_ACTION_APPLY to apply the patch.
    895  1.1  cherry  *  4) XEN_SYSCTL_LIVEPATCH_GET to check the `->rc`. If in -XEN_EAGAIN spin.
    896  1.1  cherry  *     If zero exit with success.
    897  1.1  cherry  */
    898  1.1  cherry 
    899  1.1  cherry #define LIVEPATCH_PAYLOAD_VERSION 1
    900  1.1  cherry /*
    901  1.1  cherry  * .livepatch.funcs structure layout defined in the `Payload format`
    902  1.1  cherry  * section in the Live Patch design document.
    903  1.1  cherry  *
    904  1.1  cherry  * We guard this with __XEN__ as toolstacks SHOULD not use it.
    905  1.1  cherry  */
    906  1.1  cherry #ifdef __XEN__
    907  1.1  cherry struct livepatch_func {
    908  1.1  cherry     const char *name;       /* Name of function to be patched. */
    909  1.1  cherry     void *new_addr;
    910  1.1  cherry     void *old_addr;
    911  1.1  cherry     uint32_t new_size;
    912  1.1  cherry     uint32_t old_size;
    913  1.1  cherry     uint8_t version;        /* MUST be LIVEPATCH_PAYLOAD_VERSION. */
    914  1.1  cherry     uint8_t opaque[31];
    915  1.1  cherry };
    916  1.1  cherry typedef struct livepatch_func livepatch_func_t;
    917  1.1  cherry #endif
    918  1.1  cherry 
    919  1.1  cherry /*
    920  1.1  cherry  * Structure describing an ELF payload. Uniquely identifies the
    921  1.1  cherry  * payload. Should be human readable.
    922  1.1  cherry  * Recommended length is upto XEN_LIVEPATCH_NAME_SIZE.
    923  1.1  cherry  * Includes the NUL terminator.
    924  1.1  cherry  */
    925  1.1  cherry #define XEN_LIVEPATCH_NAME_SIZE 128
    926  1.1  cherry struct xen_livepatch_name {
    927  1.1  cherry     XEN_GUEST_HANDLE_64(char) name;         /* IN: pointer to name. */
    928  1.1  cherry     uint16_t size;                          /* IN: size of name. May be upto
    929  1.1  cherry                                                XEN_LIVEPATCH_NAME_SIZE. */
    930  1.1  cherry     uint16_t pad[3];                        /* IN: MUST be zero. */
    931  1.1  cherry };
    932  1.1  cherry 
    933  1.1  cherry /*
    934  1.1  cherry  * Upload a payload to the hypervisor. The payload is verified
    935  1.1  cherry  * against basic checks and if there are any issues the proper return code
    936  1.1  cherry  * will be returned. The payload is not applied at this time - that is
    937  1.1  cherry  * controlled by XEN_SYSCTL_LIVEPATCH_ACTION.
    938  1.1  cherry  *
    939  1.1  cherry  * The return value is zero if the payload was succesfully uploaded.
    940  1.1  cherry  * Otherwise an EXX return value is provided. Duplicate `name` are not
    941  1.1  cherry  * supported.
    942  1.1  cherry  *
    943  1.1  cherry  * The payload at this point is verified against basic checks.
    944  1.1  cherry  *
    945  1.1  cherry  * The `payload` is the ELF payload as mentioned in the `Payload format`
    946  1.1  cherry  * section in the Live Patch design document.
    947  1.1  cherry  */
    948  1.1  cherry #define XEN_SYSCTL_LIVEPATCH_UPLOAD 0
    949  1.1  cherry struct xen_sysctl_livepatch_upload {
    950  1.1  cherry     struct xen_livepatch_name name;         /* IN, name of the patch. */
    951  1.1  cherry     uint64_t size;                          /* IN, size of the ELF file. */
    952  1.1  cherry     XEN_GUEST_HANDLE_64(uint8) payload;     /* IN, the ELF file. */
    953  1.1  cherry };
    954  1.1  cherry 
    955  1.1  cherry /*
    956  1.1  cherry  * Retrieve an status of an specific payload.
    957  1.1  cherry  *
    958  1.1  cherry  * Upon completion the `struct xen_livepatch_status` is updated.
    959  1.1  cherry  *
    960  1.1  cherry  * The return value is zero on success and XEN_EXX on failure. This operation
    961  1.1  cherry  * is synchronous and does not require preemption.
    962  1.1  cherry  */
    963  1.1  cherry #define XEN_SYSCTL_LIVEPATCH_GET 1
    964  1.1  cherry 
    965  1.1  cherry struct xen_livepatch_status {
    966  1.1  cherry #define LIVEPATCH_STATE_CHECKED      1
    967  1.1  cherry #define LIVEPATCH_STATE_APPLIED      2
    968  1.1  cherry     uint32_t state;                /* OUT: LIVEPATCH_STATE_*. */
    969  1.1  cherry     int32_t rc;                    /* OUT: 0 if no error, otherwise -XEN_EXX. */
    970  1.1  cherry };
    971  1.1  cherry typedef struct xen_livepatch_status xen_livepatch_status_t;
    972  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_livepatch_status_t);
    973  1.1  cherry 
    974  1.1  cherry struct xen_sysctl_livepatch_get {
    975  1.1  cherry     struct xen_livepatch_name name;         /* IN, name of the payload. */
    976  1.1  cherry     struct xen_livepatch_status status;     /* IN/OUT, state of it. */
    977  1.1  cherry };
    978  1.1  cherry 
    979  1.1  cherry /*
    980  1.1  cherry  * Retrieve an array of abbreviated status and names of payloads that are
    981  1.1  cherry  * loaded in the hypervisor.
    982  1.1  cherry  *
    983  1.1  cherry  * If the hypercall returns an positive number, it is the number (up to `nr`)
    984  1.1  cherry  * of the payloads returned, along with `nr` updated with the number of remaining
    985  1.1  cherry  * payloads, `version` updated (it may be the same across hypercalls. If it
    986  1.1  cherry  * varies the data is stale and further calls could fail). The `status`,
    987  1.1  cherry  * `name`, and `len`' are updated at their designed index value (`idx`) with
    988  1.1  cherry  * the returned value of data.
    989  1.1  cherry  *
    990  1.1  cherry  * If the hypercall returns E2BIG the `nr` is too big and should be
    991  1.1  cherry  * lowered. The upper limit of `nr` is left to the implemention.
    992  1.1  cherry  *
    993  1.1  cherry  * Note that due to the asynchronous nature of hypercalls the domain might have
    994  1.1  cherry  * added or removed the number of payloads making this information stale. It is
    995  1.1  cherry  * the responsibility of the toolstack to use the `version` field to check
    996  1.1  cherry  * between each invocation. if the version differs it should discard the stale
    997  1.1  cherry  * data and start from scratch. It is OK for the toolstack to use the new
    998  1.1  cherry  * `version` field.
    999  1.1  cherry  */
   1000  1.1  cherry #define XEN_SYSCTL_LIVEPATCH_LIST 2
   1001  1.1  cherry struct xen_sysctl_livepatch_list {
   1002  1.1  cherry     uint32_t version;                       /* OUT: Hypervisor stamps value.
   1003  1.1  cherry                                                If varies between calls, we are
   1004  1.1  cherry                                              * getting stale data. */
   1005  1.1  cherry     uint32_t idx;                           /* IN: Index into hypervisor list. */
   1006  1.1  cherry     uint32_t nr;                            /* IN: How many status, name, and len
   1007  1.1  cherry                                                should fill out. Can be zero to get
   1008  1.1  cherry                                                amount of payloads and version.
   1009  1.1  cherry                                                OUT: How many payloads left. */
   1010  1.1  cherry     uint32_t pad;                           /* IN: Must be zero. */
   1011  1.1  cherry     XEN_GUEST_HANDLE_64(xen_livepatch_status_t) status;  /* OUT. Must have enough
   1012  1.1  cherry                                                space allocate for nr of them. */
   1013  1.1  cherry     XEN_GUEST_HANDLE_64(char) name;         /* OUT: Array of names. Each member
   1014  1.1  cherry                                                MUST XEN_LIVEPATCH_NAME_SIZE in size.
   1015  1.1  cherry                                                Must have nr of them. */
   1016  1.1  cherry     XEN_GUEST_HANDLE_64(uint32) len;        /* OUT: Array of lengths of name's.
   1017  1.1  cherry                                                Must have nr of them. */
   1018  1.1  cherry };
   1019  1.1  cherry 
   1020  1.1  cherry /*
   1021  1.1  cherry  * Perform an operation on the payload structure referenced by the `name` field.
   1022  1.1  cherry  * The operation request is asynchronous and the status should be retrieved
   1023  1.1  cherry  * by using either XEN_SYSCTL_LIVEPATCH_GET or XEN_SYSCTL_LIVEPATCH_LIST hypercall.
   1024  1.1  cherry  */
   1025  1.1  cherry #define XEN_SYSCTL_LIVEPATCH_ACTION 3
   1026  1.1  cherry struct xen_sysctl_livepatch_action {
   1027  1.1  cherry     struct xen_livepatch_name name;         /* IN, name of the patch. */
   1028  1.1  cherry #define LIVEPATCH_ACTION_UNLOAD       1
   1029  1.1  cherry #define LIVEPATCH_ACTION_REVERT       2
   1030  1.1  cherry #define LIVEPATCH_ACTION_APPLY        3
   1031  1.1  cherry #define LIVEPATCH_ACTION_REPLACE      4
   1032  1.1  cherry     uint32_t cmd;                           /* IN: LIVEPATCH_ACTION_*. */
   1033  1.1  cherry     uint32_t timeout;                       /* IN: If zero then uses */
   1034  1.1  cherry                                             /* hypervisor default. */
   1035  1.1  cherry                                             /* Or upper bound of time (ns) */
   1036  1.1  cherry                                             /* for operation to take. */
   1037  1.1  cherry };
   1038  1.1  cherry 
   1039  1.1  cherry struct xen_sysctl_livepatch_op {
   1040  1.1  cherry     uint32_t cmd;                           /* IN: XEN_SYSCTL_LIVEPATCH_*. */
   1041  1.1  cherry     uint32_t pad;                           /* IN: Always zero. */
   1042  1.1  cherry     union {
   1043  1.1  cherry         struct xen_sysctl_livepatch_upload upload;
   1044  1.1  cherry         struct xen_sysctl_livepatch_list list;
   1045  1.1  cherry         struct xen_sysctl_livepatch_get get;
   1046  1.1  cherry         struct xen_sysctl_livepatch_action action;
   1047  1.1  cherry     } u;
   1048  1.1  cherry };
   1049  1.1  cherry 
   1050  1.1  cherry /*
   1051  1.1  cherry  * XEN_SYSCTL_set_parameter
   1052  1.1  cherry  *
   1053  1.1  cherry  * Change hypervisor parameters at runtime.
   1054  1.1  cherry  * The input string is parsed similar to the boot parameters.
   1055  1.1  cherry  * Parameters are a single string terminated by a NUL byte of max. size
   1056  1.1  cherry  * characters. Multiple settings can be specified by separating them
   1057  1.1  cherry  * with blanks.
   1058  1.1  cherry  */
   1059  1.1  cherry 
   1060  1.1  cherry struct xen_sysctl_set_parameter {
   1061  1.1  cherry     XEN_GUEST_HANDLE_64(char) params;       /* IN: pointer to parameters. */
   1062  1.1  cherry     uint16_t size;                          /* IN: size of parameters. */
   1063  1.1  cherry     uint16_t pad[3];                        /* IN: MUST be zero. */
   1064  1.1  cherry };
   1065  1.1  cherry 
   1066  1.1  cherry struct xen_sysctl {
   1067  1.1  cherry     uint32_t cmd;
   1068  1.1  cherry #define XEN_SYSCTL_readconsole                    1
   1069  1.1  cherry #define XEN_SYSCTL_tbuf_op                        2
   1070  1.1  cherry #define XEN_SYSCTL_physinfo                       3
   1071  1.1  cherry #define XEN_SYSCTL_sched_id                       4
   1072  1.1  cherry #define XEN_SYSCTL_perfc_op                       5
   1073  1.1  cherry #define XEN_SYSCTL_getdomaininfolist              6
   1074  1.1  cherry #define XEN_SYSCTL_debug_keys                     7
   1075  1.1  cherry #define XEN_SYSCTL_getcpuinfo                     8
   1076  1.1  cherry #define XEN_SYSCTL_availheap                      9
   1077  1.1  cherry #define XEN_SYSCTL_get_pmstat                    10
   1078  1.1  cherry #define XEN_SYSCTL_cpu_hotplug                   11
   1079  1.1  cherry #define XEN_SYSCTL_pm_op                         12
   1080  1.1  cherry #define XEN_SYSCTL_page_offline_op               14
   1081  1.1  cherry #define XEN_SYSCTL_lockprof_op                   15
   1082  1.1  cherry #define XEN_SYSCTL_cputopoinfo                   16
   1083  1.1  cherry #define XEN_SYSCTL_numainfo                      17
   1084  1.1  cherry #define XEN_SYSCTL_cpupool_op                    18
   1085  1.1  cherry #define XEN_SYSCTL_scheduler_op                  19
   1086  1.1  cherry #define XEN_SYSCTL_coverage_op                   20
   1087  1.1  cherry #define XEN_SYSCTL_psr_cmt_op                    21
   1088  1.1  cherry #define XEN_SYSCTL_pcitopoinfo                   22
   1089  1.1  cherry #define XEN_SYSCTL_psr_alloc                     23
   1090  1.1  cherry #define XEN_SYSCTL_tmem_op                       24
   1091  1.1  cherry #define XEN_SYSCTL_get_cpu_levelling_caps        25
   1092  1.1  cherry #define XEN_SYSCTL_get_cpu_featureset            26
   1093  1.1  cherry #define XEN_SYSCTL_livepatch_op                  27
   1094  1.1  cherry #define XEN_SYSCTL_set_parameter                 28
   1095  1.1  cherry     uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
   1096  1.1  cherry     union {
   1097  1.1  cherry         struct xen_sysctl_readconsole       readconsole;
   1098  1.1  cherry         struct xen_sysctl_tbuf_op           tbuf_op;
   1099  1.1  cherry         struct xen_sysctl_physinfo          physinfo;
   1100  1.1  cherry         struct xen_sysctl_cputopoinfo       cputopoinfo;
   1101  1.1  cherry         struct xen_sysctl_pcitopoinfo       pcitopoinfo;
   1102  1.1  cherry         struct xen_sysctl_numainfo          numainfo;
   1103  1.1  cherry         struct xen_sysctl_sched_id          sched_id;
   1104  1.1  cherry         struct xen_sysctl_perfc_op          perfc_op;
   1105  1.1  cherry         struct xen_sysctl_getdomaininfolist getdomaininfolist;
   1106  1.1  cherry         struct xen_sysctl_debug_keys        debug_keys;
   1107  1.1  cherry         struct xen_sysctl_getcpuinfo        getcpuinfo;
   1108  1.1  cherry         struct xen_sysctl_availheap         availheap;
   1109  1.1  cherry         struct xen_sysctl_get_pmstat        get_pmstat;
   1110  1.1  cherry         struct xen_sysctl_cpu_hotplug       cpu_hotplug;
   1111  1.1  cherry         struct xen_sysctl_pm_op             pm_op;
   1112  1.1  cherry         struct xen_sysctl_page_offline_op   page_offline;
   1113  1.1  cherry         struct xen_sysctl_lockprof_op       lockprof_op;
   1114  1.1  cherry         struct xen_sysctl_cpupool_op        cpupool_op;
   1115  1.1  cherry         struct xen_sysctl_scheduler_op      scheduler_op;
   1116  1.1  cherry         struct xen_sysctl_coverage_op       coverage_op;
   1117  1.1  cherry         struct xen_sysctl_psr_cmt_op        psr_cmt_op;
   1118  1.1  cherry         struct xen_sysctl_psr_alloc         psr_alloc;
   1119  1.1  cherry         struct xen_sysctl_tmem_op           tmem_op;
   1120  1.1  cherry         struct xen_sysctl_cpu_levelling_caps cpu_levelling_caps;
   1121  1.1  cherry         struct xen_sysctl_cpu_featureset    cpu_featureset;
   1122  1.1  cherry         struct xen_sysctl_livepatch_op      livepatch;
   1123  1.1  cherry         struct xen_sysctl_set_parameter     set_parameter;
   1124  1.1  cherry         uint8_t                             pad[128];
   1125  1.1  cherry     } u;
   1126  1.1  cherry };
   1127  1.1  cherry typedef struct xen_sysctl xen_sysctl_t;
   1128  1.1  cherry DEFINE_XEN_GUEST_HANDLE(xen_sysctl_t);
   1129  1.1  cherry 
   1130  1.1  cherry #endif /* __XEN_PUBLIC_SYSCTL_H__ */
   1131  1.1  cherry 
   1132  1.1  cherry /*
   1133  1.1  cherry  * Local variables:
   1134  1.1  cherry  * mode: C
   1135  1.1  cherry  * c-file-style: "BSD"
   1136  1.1  cherry  * c-basic-offset: 4
   1137  1.1  cherry  * tab-width: 4
   1138  1.1  cherry  * indent-tabs-mode: nil
   1139  1.1  cherry  * End:
   1140  1.1  cherry  */
   1141