platform.h revision 256281
11541Srgrimes/******************************************************************************
21541Srgrimes * platform.h
31541Srgrimes *
41541Srgrimes * Hardware platform operations. Intended for use by domain-0 kernel.
51541Srgrimes *
61541Srgrimes * Permission is hereby granted, free of charge, to any person obtaining a copy
71541Srgrimes * of this software and associated documentation files (the "Software"), to
81541Srgrimes * deal in the Software without restriction, including without limitation the
91541Srgrimes * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
101541Srgrimes * sell copies of the Software, and to permit persons to whom the Software is
111541Srgrimes * furnished to do so, subject to the following conditions:
121541Srgrimes *
131541Srgrimes * The above copyright notice and this permission notice shall be included in
141541Srgrimes * all copies or substantial portions of the Software.
151541Srgrimes *
161541Srgrimes * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
171541Srgrimes * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
181541Srgrimes * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
191541Srgrimes * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
201541Srgrimes * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
211541Srgrimes * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
221541Srgrimes * DEALINGS IN THE SOFTWARE.
231541Srgrimes *
241541Srgrimes * Copyright (c) 2002-2006, K Fraser
251541Srgrimes */
261541Srgrimes
271541Srgrimes#ifndef __XEN_PUBLIC_PLATFORM_H__
281541Srgrimes#define __XEN_PUBLIC_PLATFORM_H__
291541Srgrimes
301541Srgrimes#include "xen.h"
311541Srgrimes
321541Srgrimes#define XENPF_INTERFACE_VERSION 0x03000001
3314511Shsu
3450477Speter/*
351541Srgrimes * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC,
361541Srgrimes * 1 January, 1970 if the current system time was <system_time>.
371541Srgrimes */
381541Srgrimes#define XENPF_settime             17
391541Srgrimesstruct xenpf_settime {
401541Srgrimes    /* IN variables. */
4131778Seivind    uint32_t secs;
421541Srgrimes    uint32_t nsecs;
431541Srgrimes    uint64_t system_time;
4491140Stanimura};
4591140Stanimuratypedef struct xenpf_settime xenpf_settime_t;
4691140StanimuraDEFINE_XEN_GUEST_HANDLE(xenpf_settime_t);
4724207Sbde
4824207Sbde/*
4924207Sbde * Request memory range (@mfn, @mfn+@nr_mfns-1) to have type @type.
501541Srgrimes * On x86, @type is an architecture-defined MTRR memory type.
511541Srgrimes * On success, returns the MTRR that was used (@reg) and a handle that can
521541Srgrimes * be passed to XENPF_DEL_MEMTYPE to accurately tear down the new setting.
5324131Sbde * (x86-specific).
5429354Speter */
551541Srgrimes#define XENPF_add_memtype         31
561541Srgrimesstruct xenpf_add_memtype {
573308Sphk    /* IN variables. */
5849536Sphk    xen_pfn_t mfn;
591541Srgrimes    uint64_t nr_mfns;
6069774Sphk    uint32_t type;
6112517Sjulian    /* OUT variables. */
6292723Salfred    uint32_t handle;
6392723Salfred    uint32_t reg;
6492723Salfred};
6592723Salfredtypedef struct xenpf_add_memtype xenpf_add_memtype_t;
6611789SbdeDEFINE_XEN_GUEST_HANDLE(xenpf_add_memtype_t);
6712675Sjulian
6812675Sjulian/*
6912675Sjulian * Tear down an existing memory-range type. If @handle is remembered then it
7012675Sjulian * should be passed in to accurately tear down the correct setting (in case
7112675Sjulian * of overlapping memory regions with differing types). If it is not known
7212675Sjulian * then @handle should be set to zero. In all cases @reg must be set.
7312675Sjulian * (x86-specific).
7412675Sjulian */
7512675Sjulian#define XENPF_del_memtype         32
7629354Speterstruct xenpf_del_memtype {
7712675Sjulian    /* IN variables. */
7838485Sbde    uint32_t handle;
7947625Sphk    uint32_t reg;
8047625Sphk};
8147625Sphktypedef struct xenpf_del_memtype xenpf_del_memtype_t;
8247625SphkDEFINE_XEN_GUEST_HANDLE(xenpf_del_memtype_t);
8347625Sphk
8447625Sphk/* Read current type of an MTRR (x86-specific). */
8551654Sphk#define XENPF_read_memtype        33
8647625Sphkstruct xenpf_read_memtype {
8747625Sphk    /* IN variables. */
8847625Sphk    uint32_t reg;
8947625Sphk    /* OUT variables. */
9047625Sphk    xen_pfn_t mfn;
9147625Sphk    uint64_t nr_mfns;
9272521Sjlemon    uint32_t type;
9372521Sjlemon};
9438485Sbdetypedef struct xenpf_read_memtype xenpf_read_memtype_t;
9512675SjulianDEFINE_XEN_GUEST_HANDLE(xenpf_read_memtype_t);
9638485Sbde
9747625Sphk#define XENPF_microcode_update    35
9847625Sphkstruct xenpf_microcode_update {
9947625Sphk    /* IN variables. */
10047625Sphk    XEN_GUEST_HANDLE(const_void) data;/* Pointer to microcode data */
10147625Sphk    uint32_t length;                  /* Length of microcode data. */
10247625Sphk};
10347625Sphktypedef struct xenpf_microcode_update xenpf_microcode_update_t;
10447625SphkDEFINE_XEN_GUEST_HANDLE(xenpf_microcode_update_t);
10547625Sphk
10647625Sphk#define XENPF_platform_quirk      39
10747625Sphk#define QUIRK_NOIRQBALANCING      1 /* Do not restrict IO-APIC RTE targets */
10847625Sphk#define QUIRK_IOAPIC_BAD_REGSEL   2 /* IO-APIC REGSEL forgets its value    */
10947625Sphk#define QUIRK_IOAPIC_GOOD_REGSEL  3 /* IO-APIC REGSEL behaves properly     */
11072521Sjlemonstruct xenpf_platform_quirk {
11172521Sjlemon    /* IN variables. */
11238485Sbde    uint32_t quirk_id;
11312675Sjulian};
1141541Srgrimestypedef struct xenpf_platform_quirk xenpf_platform_quirk_t;
1151541SrgrimesDEFINE_XEN_GUEST_HANDLE(xenpf_platform_quirk_t);
11649536Sphk
1171541Srgrimes#define XENPF_efi_runtime_call    49
1181541Srgrimes#define XEN_EFI_get_time                      1
1191541Srgrimes#define XEN_EFI_set_time                      2
1201541Srgrimes#define XEN_EFI_get_wakeup_time               3
12149536Sphk#define XEN_EFI_set_wakeup_time               4
12250092Sjulian#define XEN_EFI_get_next_high_monotonic_count 5
12357070Srwatson#define XEN_EFI_get_variable                  6
12449536Sphk#define XEN_EFI_set_variable                  7
1251541Srgrimes#define XEN_EFI_get_next_variable_name        8
1261541Srgrimes#define XEN_EFI_query_variable_info           9
1271541Srgrimes#define XEN_EFI_query_capsule_capabilities   10
1281541Srgrimes#define XEN_EFI_update_capsule               11
1291541Srgrimesstruct xenpf_efi_runtime_call {
1301541Srgrimes    uint32_t function;
1311541Srgrimes    /*
13277176Sphk     * This field is generally used for per sub-function flags (defined
1331541Srgrimes     * below), except for the XEN_EFI_get_next_high_monotonic_count case,
13449536Sphk     * where it holds the single returned value.
1351541Srgrimes     */
13649536Sphk    uint32_t misc;
13749536Sphk    unsigned long status;
13849536Sphk    union {
13949536Sphk#define XEN_EFI_GET_TIME_SET_CLEARS_NS 0x00000001
14049536Sphk        struct {
1411541Srgrimes            struct xenpf_efi_time {
14264880Sphk                uint16_t year;
14377176Sphk                uint8_t month;
1441541Srgrimes                uint8_t day;
14577176Sphk                uint8_t hour;
14649536Sphk                uint8_t min;
14777176Sphk                uint8_t sec;
1481541Srgrimes                uint32_t ns;
14977176Sphk                int16_t tz;
15049536Sphk                uint8_t daylight;
15149536Sphk            } time;
15264880Sphk            uint32_t resolution;
15349536Sphk            uint32_t accuracy;
15478405Sbrian        } get_time;
15578405Sbrian
156111119Simp        struct xenpf_efi_time set_time;
15750092Sjulian
15866067Sphk#define XEN_EFI_GET_WAKEUP_TIME_ENABLED 0x00000001
15977176Sphk#define XEN_EFI_GET_WAKEUP_TIME_PENDING 0x00000002
16049536Sphk        struct xenpf_efi_time get_wakeup_time;
16149536Sphk
16250652Sphk#define XEN_EFI_SET_WAKEUP_TIME_ENABLE      0x00000001
16377360Sphk#define XEN_EFI_SET_WAKEUP_TIME_ENABLE_ONLY 0x00000002
16449540Sphk        struct xenpf_efi_time set_wakeup_time;
16564880Sphk
16616322Sgpalmer#define XEN_EFI_VARIABLE_NON_VOLATILE       0x00000001
1671541Srgrimes#define XEN_EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
1681541Srgrimes#define XEN_EFI_VARIABLE_RUNTIME_ACCESS     0x00000004
16912675Sjulian        struct {
17083366Sjulian            XEN_GUEST_HANDLE(void) name;  /* UCS-2/UTF-16 string */
1711541Srgrimes            unsigned long size;
1721541Srgrimes            XEN_GUEST_HANDLE(void) data;
17383366Sjulian            struct xenpf_efi_guid {
1741541Srgrimes                uint32_t data1;
1751541Srgrimes                uint16_t data2;
1761541Srgrimes                uint16_t data3;
17757070Srwatson                uint8_t data4[8];
1781541Srgrimes            } vendor_guid;
17949536Sphk        } get_variable, set_variable;
18049536Sphk
18157070Srwatson        struct {
18250652Sphk            unsigned long size;
1831541Srgrimes            XEN_GUEST_HANDLE(void) name;  /* UCS-2/UTF-16 string */
1841541Srgrimes            struct xenpf_efi_guid vendor_guid;
1851541Srgrimes        } get_next_variable_name;
1861541Srgrimes
1871541Srgrimes        struct {
1881541Srgrimes            uint32_t attr;
1891541Srgrimes            uint64_t max_store_size;
19093593Sjhb            uint64_t remain_store_size;
1911541Srgrimes            uint64_t max_size;
19291406Sjhb        } query_variable_info;
19357070Srwatson
19457070Srwatson        struct {
1951541Srgrimes            XEN_GUEST_HANDLE(void) capsule_header_array;
1969824Sbde            unsigned long capsule_count;
1971541Srgrimes            uint64_t max_capsule_size;
1981541Srgrimes            unsigned int reset_type;
1991541Srgrimes        } query_capsule_capabilities;
2009639Sbde
2019624Sbde        struct {
2023308Sphk            XEN_GUEST_HANDLE(void) capsule_header_array;
2031541Srgrimes            unsigned long capsule_count;
2041541Srgrimes            uint64_t sg_list; /* machine address */
2051541Srgrimes        } update_capsule;
2067724Sache    } u;
2077724Sache};
2081541Srgrimestypedef struct xenpf_efi_runtime_call xenpf_efi_runtime_call_t;
2091541SrgrimesDEFINE_XEN_GUEST_HANDLE(xenpf_efi_runtime_call_t);
2101541Srgrimes
21112675Sjulian#define XENPF_firmware_info       50
21283366Sjulian#define XEN_FW_DISK_INFO          1 /* from int 13 AH=08/41/48 */
2131541Srgrimes#define XEN_FW_DISK_MBR_SIGNATURE 2 /* from MBR offset 0x1b8 */
2141541Srgrimes#define XEN_FW_VBEDDC_INFO        3 /* from int 10 AX=4f15 */
21583366Sjulian#define XEN_FW_EFI_INFO           4 /* from EFI */
2161541Srgrimes#define  XEN_FW_EFI_VERSION        0
2171541Srgrimes#define  XEN_FW_EFI_CONFIG_TABLE   1
2181541Srgrimes#define  XEN_FW_EFI_VENDOR         2
2191541Srgrimes#define  XEN_FW_EFI_MEM_INFO       3
22050652Sphk#define  XEN_FW_EFI_RT_VERSION     4
2211541Srgrimesstruct xenpf_firmware_info {
2227730Sache    /* IN variables. */
2237724Sache    uint32_t type;
2241541Srgrimes    uint32_t index;
2251541Srgrimes    /* OUT variables. */
2261541Srgrimes    union {
22712675Sjulian        struct {
2281541Srgrimes            /* Int13, Fn48: Check Extensions Present. */
2291541Srgrimes            uint8_t device;                   /* %dl: bios device number */
2301541Srgrimes            uint8_t version;                  /* %ah: major version      */
2311541Srgrimes            uint16_t interface_support;       /* %cx: support bitmap     */
2321541Srgrimes            /* Int13, Fn08: Legacy Get Device Parameters. */
23383366Sjulian            uint16_t legacy_max_cylinder;     /* %cl[7:6]:%ch: max cyl # */
23483366Sjulian            uint8_t legacy_max_head;          /* %dh: max head #         */
23550652Sphk            uint8_t legacy_sectors_per_track; /* %cl[5:0]: max sector #  */
23649536Sphk            /* Int13, Fn41: Get Device Parameters (as filled into %ds:%esi). */
23794860Sjhb            /* NB. First uint16_t of buffer must be set to buffer size.      */
2381541Srgrimes            XEN_GUEST_HANDLE(void) edd_params;
2391541Srgrimes        } disk_info; /* XEN_FW_DISK_INFO */
2401541Srgrimes        struct {
2411541Srgrimes            uint8_t device;                   /* bios device number  */
2421541Srgrimes            uint32_t mbr_signature;           /* offset 0x1b8 in mbr */
24394860Sjhb        } disk_mbr_signature; /* XEN_FW_DISK_MBR_SIGNATURE */
24491140Stanimura        struct {
24551791Smarcel            /* Int10, AX=4F15: Get EDID info. */
24651791Smarcel            uint8_t capabilities;
24791140Stanimura            uint8_t edid_transfer_time;
24891140Stanimura            /* must refer to 128-byte buffer */
24994860Sjhb            XEN_GUEST_HANDLE(uint8) edid;
2501541Srgrimes        } vbeddc_info; /* XEN_FW_VBEDDC_INFO */
25191140Stanimura        union xenpf_efi_info {
25294860Sjhb            uint32_t version;
25391140Stanimura            struct {
25494860Sjhb                uint64_t addr;                /* EFI_CONFIGURATION_TABLE */
25594860Sjhb                uint32_t nent;
25694860Sjhb            } cfg;
25794860Sjhb            struct {
2589624Sbde                uint32_t revision;
2599624Sbde                uint32_t bufsz;               /* input, in bytes */
2603308Sphk                XEN_GUEST_HANDLE(void) name;  /* UCS-2/UTF-16 string */
2611541Srgrimes            } vendor;
2621541Srgrimes            struct {
2631541Srgrimes                uint64_t addr;
2641541Srgrimes                uint64_t size;
2651541Srgrimes                uint64_t attr;
2669639Sbde                uint32_t type;
2679624Sbde            } mem;
2683308Sphk        } efi_info; /* XEN_FW_EFI_INFO */
2691541Srgrimes    } u;
2701541Srgrimes};
2711541Srgrimestypedef struct xenpf_firmware_info xenpf_firmware_info_t;
2721541SrgrimesDEFINE_XEN_GUEST_HANDLE(xenpf_firmware_info_t);
2731541Srgrimes
2741541Srgrimes#define XENPF_enter_acpi_sleep    51
2751541Srgrimesstruct xenpf_enter_acpi_sleep {
2761541Srgrimes    /* IN variables */
2771541Srgrimes    uint16_t pm1a_cnt_val;      /* PM1a control value. */
2781541Srgrimes    uint16_t pm1b_cnt_val;      /* PM1b control value. */
2791541Srgrimes    uint32_t sleep_state;       /* Which state to enter (Sn). */
2801541Srgrimes    uint32_t flags;             /* Must be zero. */
2811541Srgrimes};
2821541Srgrimestypedef struct xenpf_enter_acpi_sleep xenpf_enter_acpi_sleep_t;
2831541SrgrimesDEFINE_XEN_GUEST_HANDLE(xenpf_enter_acpi_sleep_t);
2841541Srgrimes
2851541Srgrimes#define XENPF_change_freq         52
2861541Srgrimesstruct xenpf_change_freq {
2871541Srgrimes    /* IN variables */
2881541Srgrimes    uint32_t flags; /* Must be zero. */
2891541Srgrimes    uint32_t cpu;   /* Physical cpu. */
2901541Srgrimes    uint64_t freq;  /* New frequency (Hz). */
2911541Srgrimes};
2921541Srgrimestypedef struct xenpf_change_freq xenpf_change_freq_t;
29312675SjulianDEFINE_XEN_GUEST_HANDLE(xenpf_change_freq_t);
2941541Srgrimes
2951541Srgrimes/*
2961541Srgrimes * Get idle times (nanoseconds since boot) for physical CPUs specified in the
2971541Srgrimes * @cpumap_bitmap with range [0..@cpumap_nr_cpus-1]. The @idletime array is
2981541Srgrimes * indexed by CPU number; only entries with the corresponding @cpumap_bitmap
2991541Srgrimes * bit set are written to. On return, @cpumap_bitmap is modified so that any
3001541Srgrimes * non-existent CPUs are cleared. Such CPUs have their @idletime array entry
30150652Sphk * cleared.
3021541Srgrimes */
3031541Srgrimes#define XENPF_getidletime         53
3041541Srgrimesstruct xenpf_getidletime {
3051541Srgrimes    /* IN/OUT variables */
3061541Srgrimes    /* IN: CPUs to interrogate; OUT: subset of IN which are present */
3071541Srgrimes    XEN_GUEST_HANDLE(uint8) cpumap_bitmap;
3081541Srgrimes    /* IN variables */
3091541Srgrimes    /* Size of cpumap bitmap. */
3101541Srgrimes    uint32_t cpumap_nr_cpus;
31112819Sphk    /* Must be indexable for every cpu in cpumap_bitmap. */
3121541Srgrimes    XEN_GUEST_HANDLE(uint64) idletime;
3131541Srgrimes    /* OUT variables */
3141541Srgrimes    /* System time when the idletime snapshots were taken. */
31549536Sphk    uint64_t now;
3161541Srgrimes};
3171541Srgrimestypedef struct xenpf_getidletime xenpf_getidletime_t;
3181541SrgrimesDEFINE_XEN_GUEST_HANDLE(xenpf_getidletime_t);
3191541Srgrimes
3201541Srgrimes#define XENPF_set_processor_pminfo      54
3211541Srgrimes
3221541Srgrimes/* ability bits */
3231541Srgrimes#define XEN_PROCESSOR_PM_CX	1
3241541Srgrimes#define XEN_PROCESSOR_PM_PX	2
3251541Srgrimes#define XEN_PROCESSOR_PM_TX	4
32612819Sphk
3271541Srgrimes/* cmd type */
3281541Srgrimes#define XEN_PM_CX   0
3291541Srgrimes#define XEN_PM_PX   1
3301541Srgrimes#define XEN_PM_TX   2
33149536Sphk#define XEN_PM_PDC  3
3321541Srgrimes
3331541Srgrimes/* Px sub info type */
3341541Srgrimes#define XEN_PX_PCT   1
3359639Sbde#define XEN_PX_PSS   2
3361541Srgrimes#define XEN_PX_PPC   4
3371541Srgrimes#define XEN_PX_PSD   8
3381541Srgrimes
3399639Sbdestruct xen_power_register {
3401541Srgrimes    uint32_t     space_id;
3411541Srgrimes    uint32_t     bit_width;
3421541Srgrimes    uint32_t     bit_offset;
34312675Sjulian    uint32_t     access_size;
34483366Sjulian    uint64_t     address;
3451541Srgrimes};
3461541Srgrimes
34783366Sjulianstruct xen_processor_csd {
3481541Srgrimes    uint32_t    domain;      /* domain number of one dependent group */
3491541Srgrimes    uint32_t    coord_type;  /* coordination type */
3501541Srgrimes    uint32_t    num;         /* number of processors in same domain */
3511541Srgrimes};
35249536Sphktypedef struct xen_processor_csd xen_processor_csd_t;
35377176SphkDEFINE_XEN_GUEST_HANDLE(xen_processor_csd_t);
35449536Sphk
35549536Sphkstruct xen_processor_cx {
35650652Sphk    struct xen_power_register  reg; /* GAS for Cx trigger register */
3571541Srgrimes    uint8_t     type;     /* cstate value, c0: 0, c1: 1, ... */
3581541Srgrimes    uint32_t    latency;  /* worst latency (ms) to enter/exit this cstate */
35959818Sache    uint32_t    power;    /* average power consumption(mW) */
3601541Srgrimes    uint32_t    dpcnt;    /* number of dependency entries */
36151654Sphk    XEN_GUEST_HANDLE(xen_processor_csd_t) dp; /* NULL if no dependency */
3621541Srgrimes};
3631541Srgrimestypedef struct xen_processor_cx xen_processor_cx_t;
36449536SphkDEFINE_XEN_GUEST_HANDLE(xen_processor_cx_t);
36591406Sjhb
3661541Srgrimesstruct xen_processor_flags {
3671541Srgrimes    uint32_t bm_control:1;
3681541Srgrimes    uint32_t bm_check:1;
3691541Srgrimes    uint32_t has_cst:1;
3701541Srgrimes    uint32_t power_setup_done:1;
3711541Srgrimes    uint32_t bm_rld_set:1;
37212675Sjulian};
37383366Sjulian
3741541Srgrimesstruct xen_processor_power {
37510624Sbde    uint32_t count;  /* number of C state entries in array below */
37610624Sbde    struct xen_processor_flags flags;  /* global flags of this processor */
37783366Sjulian    XEN_GUEST_HANDLE(xen_processor_cx_t) states; /* supported c states */
3781541Srgrimes};
3791541Srgrimes
3801541Srgrimesstruct xen_pct_register {
38150652Sphk    uint8_t  descriptor;
3821541Srgrimes    uint16_t length;
3839824Sbde    uint8_t  space_id;
3849824Sbde    uint8_t  bit_width;
3859824Sbde    uint8_t  bit_offset;
3869824Sbde    uint8_t  reserved;
3879824Sbde    uint64_t address;
3889824Sbde};
3899824Sbde
3909824Sbdestruct xen_processor_px {
3919824Sbde    uint64_t core_frequency; /* megahertz */
3929850Sbde    uint64_t power;      /* milliWatts */
3939850Sbde    uint64_t transition_latency; /* microseconds */
3949850Sbde    uint64_t bus_master_latency; /* microseconds */
3959850Sbde    uint64_t control;        /* control value */
3969850Sbde    uint64_t status;     /* success indicator */
3979824Sbde};
3981541Srgrimestypedef struct xen_processor_px xen_processor_px_t;
3991541SrgrimesDEFINE_XEN_GUEST_HANDLE(xen_processor_px_t);
4001541Srgrimes
4011541Srgrimesstruct xen_psd_package {
40212675Sjulian    uint64_t num_entries;
4031541Srgrimes    uint64_t revision;
4041541Srgrimes    uint64_t domain;
4051541Srgrimes    uint64_t coord_type;
4061541Srgrimes    uint64_t num_processors;
4071541Srgrimes};
40850652Sphk
40949536Sphkstruct xen_processor_performance {
4101541Srgrimes    uint32_t flags;     /* flag for Px sub info type */
4111541Srgrimes    uint32_t platform_limit;  /* Platform limitation on freq usage */
4121541Srgrimes    struct xen_pct_register control_register;
4131541Srgrimes    struct xen_pct_register status_register;
4141541Srgrimes    uint32_t state_count;     /* total available performance states */
4151541Srgrimes    XEN_GUEST_HANDLE(xen_processor_px_t) states;
4161541Srgrimes    struct xen_psd_package domain_info;
4171541Srgrimes    uint32_t shared_type;     /* coordination type of this processor */
4181541Srgrimes};
4191541Srgrimestypedef struct xen_processor_performance xen_processor_performance_t;
4201541SrgrimesDEFINE_XEN_GUEST_HANDLE(xen_processor_performance_t);
4211541Srgrimes
4221541Srgrimesstruct xenpf_set_processor_pminfo {
4231541Srgrimes    /* IN variables */
4241541Srgrimes    uint32_t id;    /* ACPI CPU ID */
4251541Srgrimes    uint32_t type;  /* {XEN_PM_CX, XEN_PM_PX} */
4261541Srgrimes    union {
4271541Srgrimes        struct xen_processor_power          power;/* Cx: _CST/_CSD */
428111741Sdes        struct xen_processor_performance    perf; /* Px: _PPC/_PCT/_PSS/_PSD */
4291541Srgrimes        XEN_GUEST_HANDLE(uint32)            pdc;  /* _PDC */
4301541Srgrimes    } u;
4311541Srgrimes};
4321541Srgrimestypedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t;
4331541SrgrimesDEFINE_XEN_GUEST_HANDLE(xenpf_set_processor_pminfo_t);
4341541Srgrimes
4351541Srgrimes#define XENPF_get_cpuinfo 55
4361541Srgrimesstruct xenpf_pcpuinfo {
4371541Srgrimes    /* IN */
4381541Srgrimes    uint32_t xen_cpuid;
4391541Srgrimes    /* OUT */
4401541Srgrimes    /* The maxium cpu_id that is present */
4411541Srgrimes    uint32_t max_present;
4421541Srgrimes#define XEN_PCPU_FLAGS_ONLINE   1
4439824Sbde    /* Correponding xen_cpuid is not present*/
4441541Srgrimes#define XEN_PCPU_FLAGS_INVALID  2
4451541Srgrimes    uint32_t flags;
4461541Srgrimes    uint32_t apic_id;
4479639Sbde    uint32_t acpi_id;
4483308Sphk};
4491541Srgrimestypedef struct xenpf_pcpuinfo xenpf_pcpuinfo_t;
4501541SrgrimesDEFINE_XEN_GUEST_HANDLE(xenpf_pcpuinfo_t);
4511541Srgrimes
4521541Srgrimes#define XENPF_get_cpu_version 48
4531541Srgrimesstruct xenpf_pcpu_version {
4541541Srgrimes    /* IN */
4551541Srgrimes    uint32_t xen_cpuid;
4561541Srgrimes    /* OUT */
4571541Srgrimes    /* The maxium cpu_id that is present */
4581541Srgrimes    uint32_t max_present;
4599626Sbde    char vendor_id[12];
4601541Srgrimes    uint32_t family;
4611541Srgrimes    uint32_t model;
4621541Srgrimes    uint32_t stepping;
46312675Sjulian};
4641541Srgrimestypedef struct xenpf_pcpu_version xenpf_pcpu_version_t;
4651541SrgrimesDEFINE_XEN_GUEST_HANDLE(xenpf_pcpu_version_t);
4661541Srgrimes
4671541Srgrimes#define XENPF_cpu_online    56
46849536Sphk#define XENPF_cpu_offline   57
4691541Srgrimesstruct xenpf_cpu_ol
4701541Srgrimes{
4711541Srgrimes    uint32_t cpuid;
4721541Srgrimes};
4731541Srgrimestypedef struct xenpf_cpu_ol xenpf_cpu_ol_t;
4741541SrgrimesDEFINE_XEN_GUEST_HANDLE(xenpf_cpu_ol_t);
4751541Srgrimes
4761541Srgrimes#define XENPF_cpu_hotadd    58
4771541Srgrimesstruct xenpf_cpu_hotadd
4781541Srgrimes{
4791541Srgrimes	uint32_t apic_id;
4801541Srgrimes	uint32_t acpi_id;
4811541Srgrimes	uint32_t pxm;
4821541Srgrimes};
4831541Srgrimes
4841541Srgrimes#define XENPF_mem_hotadd    59
4851541Srgrimesstruct xenpf_mem_hotadd
4861541Srgrimes{
48712675Sjulian    uint64_t spfn;
48883366Sjulian    uint64_t epfn;
4891541Srgrimes    uint32_t pxm;
49029354Speter    uint32_t flags;
49183366Sjulian};
4921541Srgrimes
49350652Sphk#define XENPF_core_parking  60
49449536Sphk
49529354Speter#define XEN_CORE_PARKING_SET 1
4961541Srgrimes#define XEN_CORE_PARKING_GET 2
4971541Srgrimesstruct xenpf_core_parking {
4989824Sbde    /* IN variables */
49983366Sjulian    uint32_t type;
5001541Srgrimes    /* IN variables:  set cpu nums expected to be idled */
50129354Speter    /* OUT variables: get cpu nums actually be idled */
50229354Speter    uint32_t idle_nums;
50329354Speter};
50429354Spetertypedef struct xenpf_core_parking xenpf_core_parking_t;
5051541SrgrimesDEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t);
50629354Speter
50729354Speter/*
50829354Speter * ` enum neg_errnoval
50929354Speter * ` HYPERVISOR_platform_op(const struct xen_platform_op*);
51029354Speter */
51129354Speterstruct xen_platform_op {
5121541Srgrimes    uint32_t cmd;
51329354Speter    uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
51429354Speter    union {
51529354Speter        struct xenpf_settime           settime;
51629354Speter        struct xenpf_add_memtype       add_memtype;
51729354Speter        struct xenpf_del_memtype       del_memtype;
51890831Sdillon        struct xenpf_read_memtype      read_memtype;
51929354Speter        struct xenpf_microcode_update  microcode;
5201541Srgrimes        struct xenpf_platform_quirk    platform_quirk;
52129354Speter        struct xenpf_efi_runtime_call  efi_runtime_call;
52229354Speter        struct xenpf_firmware_info     firmware_info;
52329354Speter        struct xenpf_enter_acpi_sleep  enter_acpi_sleep;
5241541Srgrimes        struct xenpf_change_freq       change_freq;
52529354Speter        struct xenpf_getidletime       getidletime;
52629354Speter        struct xenpf_set_processor_pminfo set_pminfo;
52783803Sjhb        struct xenpf_pcpuinfo          pcpu_info;
52829354Speter        struct xenpf_pcpu_version      pcpu_version;
52929354Speter        struct xenpf_cpu_ol            cpu_ol;
53083803Sjhb        struct xenpf_cpu_hotadd        cpu_add;
5311541Srgrimes        struct xenpf_mem_hotadd        mem_add;
53229354Speter        struct xenpf_core_parking      core_parking;
53329354Speter        uint8_t                        pad[128];
53429354Speter    } u;
5351541Srgrimes};
5361541Srgrimestypedef struct xen_platform_op xen_platform_op_t;
53712675SjulianDEFINE_XEN_GUEST_HANDLE(xen_platform_op_t);
5381541Srgrimes
5391541Srgrimes#endif /* __XEN_PUBLIC_PLATFORM_H__ */
5401541Srgrimes
5411541Srgrimes/*
5421541Srgrimes * Local variables:
54350652Sphk * mode: C
5441549Srgrimes * c-set-style: "BSD"
5451541Srgrimes * c-basic-offset: 4
5461541Srgrimes * tab-width: 4
5471541Srgrimes * indent-tabs-mode: nil
54849536Sphk * End:
5491541Srgrimes */
5501541Srgrimes