Lines Matching full:cpuid
5 #include <asm/cpuid/types.h>
14 * Raw CPUID accessors:
30 asm volatile("cpuid"
50 * Native CPUID functions returning a single datum:
64 * Generic CPUID function
69 static inline void cpuid(u32 op,
78 /* Some CPUID calls want 'count' to be placed in ECX */
89 * CPUID functions returning a single datum:
96 cpuid(op, &eax, &ebx, &ecx, &edx);
105 cpuid(op, &eax, &ebx, &ecx, &edx);
114 cpuid(op, &eax, &ebx, &ecx, &edx);
123 cpuid(op, &eax, &ebx, &ecx, &edx);
201 cpuid(base, &eax, &signature[0], &signature[1], &signature[2]);
217 * CPUID(0x2) parsing:
221 * cpuid_leaf_0x2() - Return sanitized CPUID(0x2) register output
224 * Query CPUID(0x2) and store its output in @regs. Force set any
256 * for_each_cpuid_0x2_desc() - Iterator for parsed CPUID(0x2) descriptors
257 * @_regs: CPUID(0x2) register output, as returned by cpuid_leaf_0x2()
259 * @_desc: Pointer to the parsed CPUID(0x2) descriptor at each iteration
261 * Loop over the 1-byte descriptors in the passed CPUID(0x2) output registers
286 * CPUID(0x80000006) parsing:
297 * For internal use by the CPUID parser.
316 * For internal use by the CPUID parser.
339 * Return NULL if the CPUID parser did not fill this leaf, or if the given
347 /* CPUID parser might not have filled the entire subleaf range */ \
357 static_assert(__cpuid_table_subleaf_range_size(&(_cpuinfo)->cpuid, _leaf) > 1)
361 __cpuid_table_invalid_subleaf(&(_cpuinfo)->cpuid, _leaf, _subleaf))
364 * CPUID Parser Call-site APIs
366 * Call sites should use below APIs instead of invoking direct CPUID queries.
370 * - Return CPUID output as typed C structures that are auto-generated from a
371 * centralized database (see <asm/cpuid/leaf_types.h). Such data types have a
372 * full C99 bitfield layout per CPUID leaf/subleaf combination. Call sites
373 * can thus avoid doing ugly and cryptic bitwise operations on raw CPUID data.
375 * - Return cached, per-CPU, CPUID output. Below APIs do not invoke any CPUID
377 * Call-site-specific hard coded constants and macros for caching CPUID query
380 * - Return sanitized CPUID data. Below APIs return NULL if the given CPUID
381 * leaf/subleaf input is not supported by hardware, or if the hardware CPUID
382 * output was deemed invalid by the CPUID parser. This centralizes all CPUID
383 * data sanitization in one place (the kernel's CPUID parser.)
385 * - A centralized global view of system CPUID data. Below APIs will reflect
387 * raw CPUID output by drivers and individual call sites.
391 * Call-site APIs for CPUID leaves with a single subleaf:
395 * cpuid_subleaf() - Access parsed CPUID
397 * @_leaf: CPUID leaf, in compile-time 0xN format; e.g. 0x7, 0xf
398 * @_subleaf: CPUID subleaf, in compile-time decimal format; e.g. 0, 1, 3
400 * Returns a pointer to parsed CPUID output, from the CPUID table inside
401 * @_cpuinfo, as a <cpuid/leaf_types.h> data type: 'struct leaf_0xM_N', where
405 * Returns NULL if the requested CPUID @_leaf/@_subleaf query output is not
406 * present at the parsed CPUID table inside @_cpuinfo. This can happen if:
408 * - The CPUID table inside @_cpuinfo has not yet been populated.
409 * - The CPUID table inside @_cpuinfo was populated, but the CPU does not
410 * implement the requested CPUID @_leaf/@_subleaf combination.
411 * - The CPUID table inside @_cpuinfo was populated, but the kernel's CPUID
412 * parser has predetermined that the requested CPUID @_leaf/@_subleaf
428 __cpuid_table_subleaf(&(_cpuinfo)->cpuid, _leaf, _subleaf) \
431 * cpuid_leaf() - Access parsed CPUID data
433 * @_leaf: CPUID leaf, in compile-time 0xN format; e.g. 0x0, 0x2, 0x80000000
435 * Similar to cpuid_subleaf(), but with a CPUID subleaf = 0.
453 * cpuid_leaf_raw() - Access parsed CPUID data in raw format
455 * @_leaf: CPUID leaf, in compile-time 0xN format
458 * the parsed CPUID data instead of a "typed" <asm/cpuid/leaf_types.h> pointer.
464 * Call-site APIs for CPUID leaves with a subleaf range:
468 * cpuid_subleaf_n() - Access parsed CPUID data for leaf with a subleaf range
470 * @_leaf: CPUID leaf, in compile-time 0xN format; e.g. 0x4, 0x8000001d
477 * suffix and are listed at <asm/cpuid/types.h> using the CPUID_LEAF_N() macro.
500 __cpuid_table_subleaf_n(&(_cpuinfo)->cpuid, _leaf, _subleaf); \
504 * cpuid_subleaf_n_raw() - Access parsed CPUID data for leaf with subleaf range
506 * @_leaf: CPUID leaf, in compile-time 0xN format; e.g. 0x4, 0x8000001d
511 * the parsed CPUID data instead of a "typed" <asm/cpuid/leaf_types.h> pointer.
519 * @_leaf: CPUID leaf, in compile-time 0xN format; e.g. 0x4, 0x8000001d
521 * Return the number of subleaves filled by the CPUID parser for @_leaf.
524 * suffix and are listed at <asm/cpuid/types.h> using the CPUID_LEAF_N() macro.
529 __cpuid_table_nr_filled_subleaves(&(_cpuinfo)->cpuid, _leaf, n); \
533 * CPUID parser exported APIs: