1 /****************************************************************************** 2 * platform.h 3 * 4 * Hardware platform operations. Intended for use by domain-0 kernel. 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to 8 * deal in the Software without restriction, including without limitation the 9 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 * sell copies of the Software, and to permit persons to whom the Software is 11 * furnished to do so, subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be included in 14 * all copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 * DEALINGS IN THE SOFTWARE. 23 * 24 * Copyright (c) 2002-2006, K Fraser 25 */ 26 27 #ifndef __XEN_PUBLIC_PLATFORM_H__ 28 #define __XEN_PUBLIC_PLATFORM_H__ 29 30 #include "xen.h" 31 32 #define XENPF_INTERFACE_VERSION 0x03000001 33 34 /* 35 * Set clock such that it would read <secs,nsecs> after 00:00:00 UTC, 36 * 1 January, 1970 if the current system time was <system_time>. 37 */ 38 #define XENPF_settime32 17 39 struct xenpf_settime32 { 40 /* IN variables. */ 41 uint32_t secs; 42 uint32_t nsecs; 43 uint64_t system_time; 44 }; 45 typedef struct xenpf_settime32 xenpf_settime32_t; 46 #define XENPF_settime64 62 47 struct xenpf_settime64 { 48 /* IN variables. */ 49 uint64_t secs; 50 uint32_t nsecs; 51 uint32_t mbz; 52 uint64_t system_time; 53 }; 54 typedef struct xenpf_settime64 xenpf_settime64_t; 55 #if __XEN_INTERFACE_VERSION__ < 0x00040600 56 #define XENPF_settime XENPF_settime32 57 #define xenpf_settime xenpf_settime32 58 #else 59 #define XENPF_settime XENPF_settime64 60 #define xenpf_settime xenpf_settime64 61 #endif 62 typedef struct xenpf_settime xenpf_settime_t; 63 DEFINE_XEN_GUEST_HANDLE(xenpf_settime_t); 64 65 /* 66 * Request memory range (@mfn, @mfn+@nr_mfns-1) to have type @type. 67 * On x86, @type is an architecture-defined MTRR memory type. 68 * On success, returns the MTRR that was used (@reg) and a handle that can 69 * be passed to XENPF_DEL_MEMTYPE to accurately tear down the new setting. 70 * (x86-specific). 71 */ 72 #define XENPF_add_memtype 31 73 struct xenpf_add_memtype { 74 /* IN variables. */ 75 xen_pfn_t mfn; 76 uint64_t nr_mfns; 77 uint32_t type; 78 /* OUT variables. */ 79 uint32_t handle; 80 uint32_t reg; 81 }; 82 typedef struct xenpf_add_memtype xenpf_add_memtype_t; 83 DEFINE_XEN_GUEST_HANDLE(xenpf_add_memtype_t); 84 85 /* 86 * Tear down an existing memory-range type. If @handle is remembered then it 87 * should be passed in to accurately tear down the correct setting (in case 88 * of overlapping memory regions with differing types). If it is not known 89 * then @handle should be set to zero. In all cases @reg must be set. 90 * (x86-specific). 91 */ 92 #define XENPF_del_memtype 32 93 struct xenpf_del_memtype { 94 /* IN variables. */ 95 uint32_t handle; 96 uint32_t reg; 97 }; 98 typedef struct xenpf_del_memtype xenpf_del_memtype_t; 99 DEFINE_XEN_GUEST_HANDLE(xenpf_del_memtype_t); 100 101 /* Read current type of an MTRR (x86-specific). */ 102 #define XENPF_read_memtype 33 103 struct xenpf_read_memtype { 104 /* IN variables. */ 105 uint32_t reg; 106 /* OUT variables. */ 107 xen_pfn_t mfn; 108 uint64_t nr_mfns; 109 uint32_t type; 110 }; 111 typedef struct xenpf_read_memtype xenpf_read_memtype_t; 112 DEFINE_XEN_GUEST_HANDLE(xenpf_read_memtype_t); 113 114 #define XENPF_microcode_update 35 115 struct xenpf_microcode_update { 116 /* IN variables. */ 117 XEN_GUEST_HANDLE(const_void) data;/* Pointer to microcode data */ 118 uint32_t length; /* Length of microcode data. */ 119 }; 120 typedef struct xenpf_microcode_update xenpf_microcode_update_t; 121 DEFINE_XEN_GUEST_HANDLE(xenpf_microcode_update_t); 122 123 #define XENPF_platform_quirk 39 124 #define QUIRK_NOIRQBALANCING 1 /* Do not restrict IO-APIC RTE targets */ 125 #define QUIRK_IOAPIC_BAD_REGSEL 2 /* IO-APIC REGSEL forgets its value */ 126 #define QUIRK_IOAPIC_GOOD_REGSEL 3 /* IO-APIC REGSEL behaves properly */ 127 struct xenpf_platform_quirk { 128 /* IN variables. */ 129 uint32_t quirk_id; 130 }; 131 typedef struct xenpf_platform_quirk xenpf_platform_quirk_t; 132 DEFINE_XEN_GUEST_HANDLE(xenpf_platform_quirk_t); 133 134 #define XENPF_efi_runtime_call 49 135 #define XEN_EFI_get_time 1 136 #define XEN_EFI_set_time 2 137 #define XEN_EFI_get_wakeup_time 3 138 #define XEN_EFI_set_wakeup_time 4 139 #define XEN_EFI_get_next_high_monotonic_count 5 140 #define XEN_EFI_get_variable 6 141 #define XEN_EFI_set_variable 7 142 #define XEN_EFI_get_next_variable_name 8 143 #define XEN_EFI_query_variable_info 9 144 #define XEN_EFI_query_capsule_capabilities 10 145 #define XEN_EFI_update_capsule 11 146 147 struct xenpf_efi_time { 148 uint16_t year; 149 uint8_t month; 150 uint8_t day; 151 uint8_t hour; 152 uint8_t min; 153 uint8_t sec; 154 uint32_t ns; 155 int16_t tz; 156 uint8_t daylight; 157 }; 158 159 struct xenpf_efi_guid { 160 uint32_t data1; 161 uint16_t data2; 162 uint16_t data3; 163 uint8_t data4[8]; 164 }; 165 166 struct xenpf_efi_runtime_call { 167 uint32_t function; 168 /* 169 * This field is generally used for per sub-function flags (defined 170 * below), except for the XEN_EFI_get_next_high_monotonic_count case, 171 * where it holds the single returned value. 172 */ 173 uint32_t misc; 174 xen_ulong_t status; 175 union { 176 #define XEN_EFI_GET_TIME_SET_CLEARS_NS 0x00000001 177 struct { 178 struct xenpf_efi_time time; 179 uint32_t resolution; 180 uint32_t accuracy; 181 } get_time; 182 183 struct xenpf_efi_time set_time; 184 185 #define XEN_EFI_GET_WAKEUP_TIME_ENABLED 0x00000001 186 #define XEN_EFI_GET_WAKEUP_TIME_PENDING 0x00000002 187 struct xenpf_efi_time get_wakeup_time; 188 189 #define XEN_EFI_SET_WAKEUP_TIME_ENABLE 0x00000001 190 #define XEN_EFI_SET_WAKEUP_TIME_ENABLE_ONLY 0x00000002 191 struct xenpf_efi_time set_wakeup_time; 192 193 #define XEN_EFI_VARIABLE_NON_VOLATILE 0x00000001 194 #define XEN_EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 195 #define XEN_EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 196 struct { 197 XEN_GUEST_HANDLE(void) name; /* UCS-2/UTF-16 string */ 198 xen_ulong_t size; 199 XEN_GUEST_HANDLE(void) data; 200 struct xenpf_efi_guid vendor_guid; 201 } get_variable, set_variable; 202 203 struct { 204 xen_ulong_t size; 205 XEN_GUEST_HANDLE(void) name; /* UCS-2/UTF-16 string */ 206 struct xenpf_efi_guid vendor_guid; 207 } get_next_variable_name; 208 209 #define XEN_EFI_VARINFO_BOOT_SNAPSHOT 0x00000001 210 struct { 211 uint32_t attr; 212 uint64_t max_store_size; 213 uint64_t remain_store_size; 214 uint64_t max_size; 215 } query_variable_info; 216 217 struct { 218 XEN_GUEST_HANDLE(void) capsule_header_array; 219 xen_ulong_t capsule_count; 220 uint64_t max_capsule_size; 221 uint32_t reset_type; 222 } query_capsule_capabilities; 223 224 struct { 225 XEN_GUEST_HANDLE(void) capsule_header_array; 226 xen_ulong_t capsule_count; 227 uint64_t sg_list; /* machine address */ 228 } update_capsule; 229 } u; 230 }; 231 typedef struct xenpf_efi_runtime_call xenpf_efi_runtime_call_t; 232 DEFINE_XEN_GUEST_HANDLE(xenpf_efi_runtime_call_t); 233 234 #define XENPF_firmware_info 50 235 #define XEN_FW_DISK_INFO 1 /* from int 13 AH=08/41/48 */ 236 #define XEN_FW_DISK_MBR_SIGNATURE 2 /* from MBR offset 0x1b8 */ 237 #define XEN_FW_VBEDDC_INFO 3 /* from int 10 AX=4f15 */ 238 #define XEN_FW_EFI_INFO 4 /* from EFI */ 239 #define XEN_FW_EFI_VERSION 0 240 #define XEN_FW_EFI_CONFIG_TABLE 1 241 #define XEN_FW_EFI_VENDOR 2 242 #define XEN_FW_EFI_MEM_INFO 3 243 #define XEN_FW_EFI_RT_VERSION 4 244 #define XEN_FW_EFI_PCI_ROM 5 245 #define XEN_FW_EFI_APPLE_PROPERTIES 6 246 #define XEN_FW_KBD_SHIFT_FLAGS 5 247 struct xenpf_firmware_info { 248 /* IN variables. */ 249 uint32_t type; 250 uint32_t index; 251 /* OUT variables. */ 252 union { 253 struct { 254 /* Int13, Fn48: Check Extensions Present. */ 255 uint8_t device; /* %dl: bios device number */ 256 uint8_t version; /* %ah: major version */ 257 uint16_t interface_support; /* %cx: support bitmap */ 258 /* Int13, Fn08: Legacy Get Device Parameters. */ 259 uint16_t legacy_max_cylinder; /* %cl[7:6]:%ch: max cyl # */ 260 uint8_t legacy_max_head; /* %dh: max head # */ 261 uint8_t legacy_sectors_per_track; /* %cl[5:0]: max sector # */ 262 /* Int13, Fn41: Get Device Parameters (as filled into %ds:%esi). */ 263 /* NB. First uint16_t of buffer must be set to buffer size. */ 264 XEN_GUEST_HANDLE(void) edd_params; 265 } disk_info; /* XEN_FW_DISK_INFO */ 266 struct { 267 uint8_t device; /* bios device number */ 268 uint32_t mbr_signature; /* offset 0x1b8 in mbr */ 269 } disk_mbr_signature; /* XEN_FW_DISK_MBR_SIGNATURE */ 270 struct { 271 /* Int10, AX=4F15: Get EDID info. */ 272 uint8_t capabilities; 273 uint8_t edid_transfer_time; 274 /* must refer to 128-byte buffer */ 275 XEN_GUEST_HANDLE(uint8) edid; 276 } vbeddc_info; /* XEN_FW_VBEDDC_INFO */ 277 union xenpf_efi_info { 278 uint32_t version; 279 struct { 280 uint64_t addr; /* EFI_CONFIGURATION_TABLE */ 281 uint32_t nent; 282 } cfg; 283 struct { 284 uint32_t revision; 285 uint32_t bufsz; /* input, in bytes */ 286 XEN_GUEST_HANDLE(void) name; /* UCS-2/UTF-16 string */ 287 } vendor; 288 struct { 289 uint64_t addr; 290 uint64_t size; 291 uint64_t attr; 292 uint32_t type; 293 } mem; 294 struct { 295 /* IN variables */ 296 uint16_t segment; 297 uint8_t bus; 298 uint8_t devfn; 299 uint16_t vendor; 300 uint16_t devid; 301 /* OUT variables */ 302 uint64_t address; 303 xen_ulong_t size; 304 } pci_rom; 305 struct { 306 /* OUT variables */ 307 uint64_t address; 308 xen_ulong_t size; 309 } apple_properties; 310 } efi_info; /* XEN_FW_EFI_INFO */ 311 312 /* Int16, Fn02: Get keyboard shift flags. */ 313 uint8_t kbd_shift_flags; /* XEN_FW_KBD_SHIFT_FLAGS */ 314 } u; 315 }; 316 typedef struct xenpf_firmware_info xenpf_firmware_info_t; 317 DEFINE_XEN_GUEST_HANDLE(xenpf_firmware_info_t); 318 319 #define XENPF_enter_acpi_sleep 51 320 struct xenpf_enter_acpi_sleep { 321 /* IN variables */ 322 #if __XEN_INTERFACE_VERSION__ < 0x00040300 323 uint16_t pm1a_cnt_val; /* PM1a control value. */ 324 uint16_t pm1b_cnt_val; /* PM1b control value. */ 325 #else 326 uint16_t val_a; /* PM1a control / sleep type A. */ 327 uint16_t val_b; /* PM1b control / sleep type B. */ 328 #endif 329 uint32_t sleep_state; /* Which state to enter (Sn). */ 330 #define XENPF_ACPI_SLEEP_EXTENDED 0x00000001 331 uint32_t flags; /* XENPF_ACPI_SLEEP_*. */ 332 }; 333 typedef struct xenpf_enter_acpi_sleep xenpf_enter_acpi_sleep_t; 334 DEFINE_XEN_GUEST_HANDLE(xenpf_enter_acpi_sleep_t); 335 336 #define XENPF_change_freq 52 337 struct xenpf_change_freq { 338 /* IN variables */ 339 uint32_t flags; /* Must be zero. */ 340 uint32_t cpu; /* Physical cpu. */ 341 uint64_t freq; /* New frequency (Hz). */ 342 }; 343 typedef struct xenpf_change_freq xenpf_change_freq_t; 344 DEFINE_XEN_GUEST_HANDLE(xenpf_change_freq_t); 345 346 /* 347 * Get idle times (nanoseconds since boot) for physical CPUs specified in the 348 * @cpumap_bitmap with range [0..@cpumap_nr_cpus-1]. The @idletime array is 349 * indexed by CPU number; only entries with the corresponding @cpumap_bitmap 350 * bit set are written to. On return, @cpumap_bitmap is modified so that any 351 * non-existent CPUs are cleared. Such CPUs have their @idletime array entry 352 * cleared. 353 */ 354 #define XENPF_getidletime 53 355 struct xenpf_getidletime { 356 /* IN/OUT variables */ 357 /* IN: CPUs to interrogate; OUT: subset of IN which are present */ 358 XEN_GUEST_HANDLE(uint8) cpumap_bitmap; 359 /* IN variables */ 360 /* Size of cpumap bitmap. */ 361 uint32_t cpumap_nr_cpus; 362 /* Must be indexable for every cpu in cpumap_bitmap. */ 363 XEN_GUEST_HANDLE(uint64) idletime; 364 /* OUT variables */ 365 /* System time when the idletime snapshots were taken. */ 366 uint64_t now; 367 }; 368 typedef struct xenpf_getidletime xenpf_getidletime_t; 369 DEFINE_XEN_GUEST_HANDLE(xenpf_getidletime_t); 370 371 #define XENPF_set_processor_pminfo 54 372 373 /* ability bits */ 374 #define XEN_PROCESSOR_PM_CX 1 375 #define XEN_PROCESSOR_PM_PX 2 376 #define XEN_PROCESSOR_PM_TX 4 377 378 /* cmd type */ 379 #define XEN_PM_CX 0 380 #define XEN_PM_PX 1 381 #define XEN_PM_TX 2 382 #define XEN_PM_PDC 3 383 384 /* Px sub info type */ 385 #define XEN_PX_PCT 1 386 #define XEN_PX_PSS 2 387 #define XEN_PX_PPC 4 388 #define XEN_PX_PSD 8 389 390 struct xen_power_register { 391 uint32_t space_id; 392 uint32_t bit_width; 393 uint32_t bit_offset; 394 uint32_t access_size; 395 uint64_t address; 396 }; 397 398 struct xen_processor_csd { 399 uint32_t domain; /* domain number of one dependent group */ 400 uint32_t coord_type; /* coordination type */ 401 uint32_t num; /* number of processors in same domain */ 402 }; 403 typedef struct xen_processor_csd xen_processor_csd_t; 404 DEFINE_XEN_GUEST_HANDLE(xen_processor_csd_t); 405 406 struct xen_processor_cx { 407 struct xen_power_register reg; /* GAS for Cx trigger register */ 408 uint8_t type; /* cstate value, c0: 0, c1: 1, ... */ 409 uint32_t latency; /* worst latency (ms) to enter/exit this cstate */ 410 uint32_t power; /* average power consumption(mW) */ 411 uint32_t dpcnt; /* number of dependency entries */ 412 XEN_GUEST_HANDLE(xen_processor_csd_t) dp; /* NULL if no dependency */ 413 }; 414 typedef struct xen_processor_cx xen_processor_cx_t; 415 DEFINE_XEN_GUEST_HANDLE(xen_processor_cx_t); 416 417 struct xen_processor_flags { 418 uint32_t bm_control:1; 419 uint32_t bm_check:1; 420 uint32_t has_cst:1; 421 uint32_t power_setup_done:1; 422 uint32_t bm_rld_set:1; 423 }; 424 425 struct xen_processor_power { 426 uint32_t count; /* number of C state entries in array below */ 427 struct xen_processor_flags flags; /* global flags of this processor */ 428 XEN_GUEST_HANDLE(xen_processor_cx_t) states; /* supported c states */ 429 }; 430 431 struct xen_pct_register { 432 uint8_t descriptor; 433 uint16_t length; 434 uint8_t space_id; 435 uint8_t bit_width; 436 uint8_t bit_offset; 437 uint8_t reserved; 438 uint64_t address; 439 }; 440 441 struct xen_processor_px { 442 uint64_t core_frequency; /* megahertz */ 443 uint64_t power; /* milliWatts */ 444 uint64_t transition_latency; /* microseconds */ 445 uint64_t bus_master_latency; /* microseconds */ 446 uint64_t control; /* control value */ 447 uint64_t status; /* success indicator */ 448 }; 449 typedef struct xen_processor_px xen_processor_px_t; 450 DEFINE_XEN_GUEST_HANDLE(xen_processor_px_t); 451 452 struct xen_psd_package { 453 uint64_t num_entries; 454 uint64_t revision; 455 uint64_t domain; 456 uint64_t coord_type; 457 uint64_t num_processors; 458 }; 459 460 struct xen_processor_performance { 461 uint32_t flags; /* flag for Px sub info type */ 462 uint32_t platform_limit; /* Platform limitation on freq usage */ 463 struct xen_pct_register control_register; 464 struct xen_pct_register status_register; 465 uint32_t state_count; /* total available performance states */ 466 XEN_GUEST_HANDLE(xen_processor_px_t) states; 467 struct xen_psd_package domain_info; 468 uint32_t shared_type; /* coordination type of this processor */ 469 }; 470 typedef struct xen_processor_performance xen_processor_performance_t; 471 DEFINE_XEN_GUEST_HANDLE(xen_processor_performance_t); 472 473 struct xenpf_set_processor_pminfo { 474 /* IN variables */ 475 uint32_t id; /* ACPI CPU ID */ 476 uint32_t type; /* {XEN_PM_CX, XEN_PM_PX} */ 477 union { 478 struct xen_processor_power power;/* Cx: _CST/_CSD */ 479 struct xen_processor_performance perf; /* Px: _PPC/_PCT/_PSS/_PSD */ 480 XEN_GUEST_HANDLE(uint32) pdc; /* _PDC */ 481 } u; 482 }; 483 typedef struct xenpf_set_processor_pminfo xenpf_set_processor_pminfo_t; 484 DEFINE_XEN_GUEST_HANDLE(xenpf_set_processor_pminfo_t); 485 486 #define XENPF_get_cpuinfo 55 487 struct xenpf_pcpuinfo { 488 /* IN */ 489 uint32_t xen_cpuid; 490 /* OUT */ 491 /* The maxium cpu_id that is present */ 492 uint32_t max_present; 493 #define XEN_PCPU_FLAGS_ONLINE 1 494 /* Correponding xen_cpuid is not present*/ 495 #define XEN_PCPU_FLAGS_INVALID 2 496 uint32_t flags; 497 uint32_t apic_id; 498 uint32_t acpi_id; 499 }; 500 typedef struct xenpf_pcpuinfo xenpf_pcpuinfo_t; 501 DEFINE_XEN_GUEST_HANDLE(xenpf_pcpuinfo_t); 502 503 #define XENPF_get_cpu_version 48 504 struct xenpf_pcpu_version { 505 /* IN */ 506 uint32_t xen_cpuid; 507 /* OUT */ 508 /* The maxium cpu_id that is present */ 509 uint32_t max_present; 510 char vendor_id[12]; 511 uint32_t family; 512 uint32_t model; 513 uint32_t stepping; 514 }; 515 typedef struct xenpf_pcpu_version xenpf_pcpu_version_t; 516 DEFINE_XEN_GUEST_HANDLE(xenpf_pcpu_version_t); 517 518 #define XENPF_cpu_online 56 519 #define XENPF_cpu_offline 57 520 struct xenpf_cpu_ol 521 { 522 uint32_t cpuid; 523 }; 524 typedef struct xenpf_cpu_ol xenpf_cpu_ol_t; 525 DEFINE_XEN_GUEST_HANDLE(xenpf_cpu_ol_t); 526 527 #define XENPF_cpu_hotadd 58 528 struct xenpf_cpu_hotadd 529 { 530 uint32_t apic_id; 531 uint32_t acpi_id; 532 uint32_t pxm; 533 }; 534 typedef struct xenpf_cpu_hotadd xenpf_cpu_hotadd_t; 535 536 #define XENPF_mem_hotadd 59 537 struct xenpf_mem_hotadd 538 { 539 uint64_t spfn; 540 uint64_t epfn; 541 uint32_t pxm; 542 uint32_t flags; 543 }; 544 typedef struct xenpf_mem_hotadd xenpf_mem_hotadd_t; 545 546 #define XENPF_core_parking 60 547 548 #define XEN_CORE_PARKING_SET 1 549 #define XEN_CORE_PARKING_GET 2 550 struct xenpf_core_parking { 551 /* IN variables */ 552 uint32_t type; 553 /* IN variables: set cpu nums expected to be idled */ 554 /* OUT variables: get cpu nums actually be idled */ 555 uint32_t idle_nums; 556 }; 557 typedef struct xenpf_core_parking xenpf_core_parking_t; 558 DEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t); 559 560 /* 561 * Access generic platform resources(e.g., accessing MSR, port I/O, etc) 562 * in unified way. Batch resource operations in one call are supported and 563 * they are always non-preemptible and executed in their original order. 564 * The batch itself returns a negative integer for general errors, or a 565 * non-negative integer for the number of successful operations. For the latter 566 * case, the @ret in the failed entry (if any) indicates the exact error. 567 */ 568 #define XENPF_resource_op 61 569 570 #define XEN_RESOURCE_OP_MSR_READ 0 571 #define XEN_RESOURCE_OP_MSR_WRITE 1 572 573 /* 574 * Specially handled MSRs: 575 * - MSR_IA32_TSC 576 * READ: Returns the scaled system time(ns) instead of raw timestamp. In 577 * multiple entry case, if other MSR read is followed by a MSR_IA32_TSC 578 * read, then both reads are guaranteed to be performed atomically (with 579 * IRQ disabled). The return time indicates the point of reading that MSR. 580 * WRITE: Not supported. 581 */ 582 583 struct xenpf_resource_entry { 584 union { 585 uint32_t cmd; /* IN: XEN_RESOURCE_OP_* */ 586 int32_t ret; /* OUT: return value for failed entry */ 587 } u; 588 uint32_t rsvd; /* IN: padding and must be zero */ 589 uint64_t idx; /* IN: resource address to access */ 590 uint64_t val; /* IN/OUT: resource value to set/get */ 591 }; 592 typedef struct xenpf_resource_entry xenpf_resource_entry_t; 593 DEFINE_XEN_GUEST_HANDLE(xenpf_resource_entry_t); 594 595 struct xenpf_resource_op { 596 uint32_t nr_entries; /* number of resource entry */ 597 uint32_t cpu; /* which cpu to run */ 598 XEN_GUEST_HANDLE(xenpf_resource_entry_t) entries; 599 }; 600 typedef struct xenpf_resource_op xenpf_resource_op_t; 601 DEFINE_XEN_GUEST_HANDLE(xenpf_resource_op_t); 602 603 #define XENPF_get_symbol 63 604 struct xenpf_symdata { 605 /* IN/OUT variables */ 606 uint32_t namelen; /* IN: size of name buffer */ 607 /* OUT: strlen(name) of hypervisor symbol (may be */ 608 /* larger than what's been copied to guest) */ 609 uint32_t symnum; /* IN: Symbol to read */ 610 /* OUT: Next available symbol. If same as IN then */ 611 /* we reached the end */ 612 613 /* OUT variables */ 614 XEN_GUEST_HANDLE(char) name; 615 uint64_t address; 616 char type; 617 }; 618 typedef struct xenpf_symdata xenpf_symdata_t; 619 DEFINE_XEN_GUEST_HANDLE(xenpf_symdata_t); 620 621 /* 622 * ` enum neg_errnoval 623 * ` HYPERVISOR_platform_op(const struct xen_platform_op*); 624 */ 625 struct xen_platform_op { 626 uint32_t cmd; 627 uint32_t interface_version; /* XENPF_INTERFACE_VERSION */ 628 union { 629 xenpf_settime_t settime; 630 xenpf_settime32_t settime32; 631 xenpf_settime64_t settime64; 632 xenpf_add_memtype_t add_memtype; 633 xenpf_del_memtype_t del_memtype; 634 xenpf_read_memtype_t read_memtype; 635 xenpf_microcode_update_t microcode; 636 xenpf_platform_quirk_t platform_quirk; 637 xenpf_efi_runtime_call_t efi_runtime_call; 638 xenpf_firmware_info_t firmware_info; 639 xenpf_enter_acpi_sleep_t enter_acpi_sleep; 640 xenpf_change_freq_t change_freq; 641 xenpf_getidletime_t getidletime; 642 xenpf_set_processor_pminfo_t set_pminfo; 643 xenpf_pcpuinfo_t pcpu_info; 644 xenpf_pcpu_version_t pcpu_version; 645 xenpf_cpu_ol_t cpu_ol; 646 xenpf_cpu_hotadd_t cpu_add; 647 xenpf_mem_hotadd_t mem_add; 648 xenpf_core_parking_t core_parking; 649 xenpf_resource_op_t resource_op; 650 xenpf_symdata_t symdata; 651 uint8_t pad[128]; 652 } u; 653 }; 654 typedef struct xen_platform_op xen_platform_op_t; 655 DEFINE_XEN_GUEST_HANDLE(xen_platform_op_t); 656 657 #endif /* __XEN_PUBLIC_PLATFORM_H__ */ 658 659 /* 660 * Local variables: 661 * mode: C 662 * c-file-style: "BSD" 663 * c-basic-offset: 4 664 * tab-width: 4 665 * indent-tabs-mode: nil 666 * End: 667 */ 668