This Intel Speed Select Technology - Performance Profile (SST-PP) feature introduces a mechanism that allows multiple optimized performance profiles per system. Each profile defines a set of CPUs that need to be online and rest offline to sustain a guaranteed base frequency. Five new IOCTLs are added: ISST_IF_PERF_LEVELS : Get number of performance levels ISST_IF_PERF_SET_LEVEL : Set to a new performance level ISST_IF_PERF_SET_FEATURE : Activate SST-BF/SST-TF for a performance level ISST_IF_GET_PERF_LEVEL_INFO : Get parameters for a performance level ISST_IF_GET_PERF_LEVEL_CPU_MASK : Get CPU mask for a performance level Once an instance is identified, read or write from correct MMIO offset for a given field as defined in the specification. For details on SST PP operations using intel-speed-selet utility, refer to: Documentation/admin-guide/pm/intel-speed-select.rst under the kernel documentation
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -254,6 +254,178 @@ struct isst_tpmi_instance_count { · 253 unmodified lines | ||
| 254 | 254 | __u16 valid_mask; |
| 255 | 255 | }; |
| 256 | 256 | |
| 257 | +/** | |
| 258 | + * struct isst_perf_level_info - Structure to get information on SST-PP levels | |
| 259 | + * @socket_id: Socket/package id | |
| 260 | + * @power_domain: Power Domain id | |
| 261 | + * @logical_cpu: CPU number | |
| 262 | + * @clos: Clos ID to assign to the logical CPU | |
| 263 | + * @max_level: Maximum performance level supported by the platform | |
| 264 | + * @feature_rev: The feature revision for SST-PP supported by the platform | |
| 265 | + * @level_mask: Mask of supported performance levels | |
| 266 | + * @current_level: Current performance level | |
| 267 | + * @feature_state: SST-BF and SST-TF (enabled/disabled) status at current level | |
| 268 | + * @locked: SST-PP performance level change is locked/unlocked | |
| 269 | + * @enabled: SST-PP feature is enabled or not | |
| 270 | + * @sst-tf_support: SST-TF support status at this level | |
| 271 | + * @sst-bf_support: SST-BF support status at this level | |
| 272 | + * | |
| 273 | + * Structure to get SST-PP details using IOCTL ISST_IF_PERF_LEVELS. | |
| 274 | + */ | |
| 275 | +struct isst_perf_level_info { | |
| 276 | + __u8 socket_id; | |
| 277 | + __u8 power_domain_id; | |
| 278 | + __u8 max_level; | |
| 279 | + __u8 feature_rev; | |
| 280 | + __u8 level_mask; | |
| 281 | + __u8 current_level; | |
| 282 | + __u8 feature_state; | |
| 283 | + __u8 locked; | |
| 284 | + __u8 enabled; | |
| 285 | + __u8 sst_tf_support; | |
| 286 | + __u8 sst_bf_support; | |
| 287 | +}; | |
| 288 | + | |
| 289 | +/** | |
| 290 | + * struct isst_perf_level_control - Structure to set SST-PP level | |
| 291 | + * @socket_id: Socket/package id | |
| 292 | + * @power_domain: Power Domain id | |
| 293 | + * @level: level to set | |
| 294 | + * | |
| 295 | + * Structure used change SST-PP level using IOCTL ISST_IF_PERF_SET_LEVEL. | |
| 296 | + */ | |
| 297 | +struct isst_perf_level_control { | |
| 298 | + __u8 socket_id; | |
| 299 | + __u8 power_domain_id; | |
| 300 | + __u8 level; | |
| 301 | +}; | |
| 302 | + | |
| 303 | +/** | |
| 304 | + * struct isst_perf_feature_control - Structure to activate SST-BF/SST-TF | |
| 305 | + * @socket_id: Socket/package id | |
| 306 | + * @power_domain: Power Domain id | |
| 307 | + * @feature: bit 0 = SST-BF state, bit 1 = SST-TF state | |
| 308 | + * | |
| 309 | + * Structure used to enable SST-BF/SST-TF using IOCTL ISST_IF_PERF_SET_FEATURE. | |
| 310 | + */ | |
| 311 | +struct isst_perf_feature_control { | |
| 312 | + __u8 socket_id; | |
| 313 | + __u8 power_domain_id; | |
| 314 | + __u8 feature; | |
| 315 | +}; | |
| 316 | + | |
| 317 | +#define TRL_MAX_BUCKETS 8 | |
| 318 | +#define TRL_MAX_LEVELS 6 | |
| 319 | + | |
| 320 | +/** | |
| 321 | + * struct isst_perf_level_data_info - Structure to get SST-PP level details | |
| 322 | + * @socket_id: Socket/package id | |
| 323 | + * @power_domain: Power Domain id | |
| 324 | + * @level: SST-PP level for which caller wants to get information | |
| 325 | + * @tdp_ratio: TDP Ratio | |
| 326 | + * @base_freq_mhz: Base frequency in MHz | |
| 327 | + * @base_freq_avx2_mhz: AVX2 Base frequency in MHz | |
| 328 | + * @base_freq_avx512_mhz: AVX512 base frequency in MHz | |
| 329 | + * @base_freq_amx_mhz: AMX base frequency in MHz | |
| 330 | + * @thermal_design_power_w: Thermal design (TDP) power | |
| 331 | + * @tjunction_max_c: Max junction temperature | |
| 332 | + * @max_memory_freq_mhz: Max memory frequency in MHz | |
| 333 | + * @cooling_type: Type of cooling is used | |
| 334 | + * @p0_freq_mhz: core maximum frequency | |
| 335 | + * @p1_freq_mhz: Core TDP frequency | |
| 336 | + * @pn_freq_mhz: Core maximum efficiency frequency | |
| 337 | + * @pm_freq_mhz: Core minimum frequency | |
| 338 | + * @p0_fabric_freq_mhz: Fabric (Uncore) maximum frequency | |
| 339 | + * @p1_fabric_freq_mhz: Fabric (Uncore) TDP frequency | |
| 340 | + * @pn_fabric_freq_mhz: Fabric (Uncore) minimum efficiency frequency | |
| 341 | + * @pm_fabric_freq_mhz: Fabric (Uncore) minimum frequency | |
| 342 | + * @max_buckets: Maximum trl buckets | |
| 343 | + * @max_trl_levels: Maximum trl levels | |
| 344 | + * @bucket_core_counts[TRL_MAX_BUCKETS]: Number of cores per bucket | |
| 345 | + * @trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS]: maximum frequency | |
| 346 | + * for a bucket and trl level | |
| 347 | + * | |
| 348 | + * Structure used to get information on frequencies and TDP for a SST-PP | |
| 349 | + * level using ISST_IF_GET_PERF_LEVEL_INFO. | |
| 350 | + */ | |
| 351 | +struct isst_perf_level_data_info { | |
| 352 | + __u8 socket_id; | |
| 353 | + __u8 power_domain_id; | |
| 354 | + __u16 level; | |
| 355 | + __u16 tdp_ratio; | |
| 356 | + __u16 base_freq_mhz; | |
| 357 | + __u16 base_freq_avx2_mhz; | |
| 358 | + __u16 base_freq_avx512_mhz; | |
| 359 | + __u16 base_freq_amx_mhz; | |
| 360 | + __u16 thermal_design_power_w; | |
| 361 | + __u16 tjunction_max_c; | |
| 362 | + __u16 max_memory_freq_mhz; | |
| 363 | + __u16 cooling_type; | |
| 364 | + __u16 p0_freq_mhz; | |
| 365 | + __u16 p1_freq_mhz; | |
| 366 | + __u16 pn_freq_mhz; | |
| 367 | + __u16 pm_freq_mhz; | |
| 368 | + __u16 p0_fabric_freq_mhz; | |
| 369 | + __u16 p1_fabric_freq_mhz; | |
| 370 | + __u16 pn_fabric_freq_mhz; | |
| 371 | + __u16 pm_fabric_freq_mhz; | |
| 372 | + __u16 max_buckets; | |
| 373 | + __u16 max_trl_levels; | |
| 374 | + __u16 bucket_core_counts[TRL_MAX_BUCKETS]; | |
| 375 | + __u16 trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS]; | |
| 376 | +}; | |
| 377 | + | |
| 378 | +/** | |
| 379 | + * struct isst_perf_level_cpu_mask - Structure to get SST-PP level CPU mask | |
| 380 | + * @socket_id: Socket/package id | |
| 381 | + * @power_domain: Power Domain id | |
| 382 | + * @level: SST-PP level for which caller wants to get information | |
| 383 | + * @punit_cpu_map: Set to 1 if the CPU number is punit numbering not | |
| 384 | + * Linux CPU number. If 0 CPU buffer is copied to user space | |
| 385 | + * supplied cpu_buffer of size cpu_buffer_size. Punit | |
| 386 | + * cpu mask is copied to "mask" field. | |
| 387 | + * @mask: cpu mask for this PP level (punit CPU numbering) | |
| 388 | + * @cpu_buffer_size: size of cpu_buffer also used to return the copied CPU | |
| 389 | + * buffer size. | |
| 390 | + * @cpu_buffer: Buffer to copy CPU mask when punit_cpu_map is 0 | |
| 391 | + * | |
| 392 | + * Structure used to get cpumask for a SST-PP level using | |
| 393 | + * IOCTL ISST_IF_GET_PERF_LEVEL_CPU_MASK. Also used to get CPU mask for | |
| 394 | + * IOCTL ISST_IF_GET_BASE_FREQ_CPU_MASK for SST-BF. | |
| 395 | + */ | |
| 396 | +struct isst_perf_level_cpu_mask { | |
| 397 | + __u8 socket_id; | |
| 398 | + __u8 power_domain_id; | |
| 399 | + __u8 level; | |
| 400 | + __u8 punit_cpu_map; | |
| 401 | + __u64 mask; | |
| 402 | + __u16 cpu_buffer_size; | |
| 403 | + __s8 cpu_buffer[1]; | |
| 404 | +}; | |
| 405 | + | |
| 406 | +/** | |
| 407 | + * struct isst_base_freq_info - Structure to get SST-BF frequencies | |
| 408 | + * @socket_id: Socket/package id | |
| 409 | + * @power_domain: Power Domain id | |
| 410 | + * @level: SST-PP level for which caller wants to get information | |
| 411 | + * @high_base_freq_mhz: High priority CPU base frequency | |
| 412 | + * @low_base_freq_mhz: Low priority CPU base frequency | |
| 413 | + * @tjunction_max_c: Max junction temperature | |
| 414 | + * @thermal_design_power_w: Thermal design power in watts | |
| 415 | + * | |
| 416 | + * Structure used to get SST-BF information using | |
| 417 | + * IOCTL ISST_IF_GET_BASE_FREQ_INFO. | |
| 418 | + */ | |
| 419 | +struct isst_base_freq_info { | |
| 420 | + __u8 socket_id; | |
| 421 | + __u8 power_domain_id; | |
| 422 | + __u16 level; | |
| 423 | + __u16 high_base_freq_mhz; | |
| 424 | + __u16 low_base_freq_mhz; | |
| 425 | + __u16 tjunction_max_c; | |
| 426 | + __u16 thermal_design_power_w; | |
| 427 | +}; | |
| 428 | + | |
| 257 | 429 | #define ISST_IF_MAGIC 0xFE |
| 258 | 430 | #define ISST_IF_GET_PLATFORM_INFO _IOR(ISST_IF_MAGIC, 0, struct isst_if_platform_info *) |
| 259 | 431 | #define ISST_IF_GET_PHY_ID _IOWR(ISST_IF_MAGIC, 1, struct isst_if_cpu_map *) |
| @@ -266,4 +438,12 @@ struct isst_tpmi_instance_count { · 6 unmodified lines | ||
| 266 | 438 | #define ISST_IF_CLOS_PARAM _IOWR(ISST_IF_MAGIC, 7, struct isst_clos_param *) |
| 267 | 439 | #define ISST_IF_CLOS_ASSOC _IOWR(ISST_IF_MAGIC, 8, struct isst_if_clos_assoc_cmds *) |
| 268 | 440 | |
| 441 | +#define ISST_IF_PERF_LEVELS _IOWR(ISST_IF_MAGIC, 9, struct isst_perf_level_info *) | |
| 442 | +#define ISST_IF_PERF_SET_LEVEL _IOW(ISST_IF_MAGIC, 10, struct isst_perf_level_control *) | |
| 443 | +#define ISST_IF_PERF_SET_FEATURE _IOW(ISST_IF_MAGIC, 11, struct isst_perf_feature_control *) | |
| 444 | +#define ISST_IF_GET_PERF_LEVEL_INFO _IOR(ISST_IF_MAGIC, 12, struct isst_perf_level_data_info *) | |
| 445 | +#define ISST_IF_GET_PERF_LEVEL_CPU_MASK _IOR(ISST_IF_MAGIC, 13, struct isst_perf_level_cpu_mask *) | |
| 446 | +#define ISST_IF_GET_BASE_FREQ_INFO _IOR(ISST_IF_MAGIC, 14, struct isst_base_freq_info *) | |
| 447 | +#define ISST_IF_GET_BASE_FREQ_CPU_MASK _IOR(ISST_IF_MAGIC, 15, struct isst_perf_level_cpu_mask *) | |
| 448 | + | |
| 269 | 449 | #endif |