/openbmc/qemu/tests/qtest/ |
H A D | test-x86-cpuid-compat.c | 105 * cpuid-input-eax and cpuid-input-ecx values to look for, 125 const char *rreg = qdict_get_str(w, "cpuid-register"); in get_feature_word() 126 uint32_t reax = qdict_get_int(w, "cpuid-input-eax"); in get_feature_word() 127 bool has_ecx = qdict_haskey(w, "cpuid-input-ecx"); in get_feature_word() 132 recx = qdict_get_int(w, "cpuid-input-ecx"); in get_feature_word() 240 g_test_trap_subprocess("/x86/cpuid/parsing-plus-minus/subprocess", 0, 0); in test_plus_minus() 253 g_test_add_func("/x86/cpuid/parsing-plus-minus/subprocess", in main() 255 g_test_add_func("/x86/cpuid/parsing-plus-minus", test_plus_minus); in main() 258 add_cpuid_test("x86/cpuid/phenom/level", in main() 260 add_cpuid_test("x86/cpuid/Conroe/level", in main() [all …]
|
/openbmc/linux/arch/riscv/kernel/ |
H A D | smpboot.c | 49 int cpuid; in smp_prepare_cpus() local 64 for_each_possible_cpu(cpuid) { in smp_prepare_cpus() 65 if (cpuid == curr_cpuid) in smp_prepare_cpus() 67 if (cpu_ops[cpuid]->cpu_prepare) { in smp_prepare_cpus() 68 ret = cpu_ops[cpuid]->cpu_prepare(cpuid); in smp_prepare_cpus() 72 set_cpu_present(cpuid, true); in smp_prepare_cpus() 73 numa_store_cpu_info(cpuid); in smp_prepare_cpus() 126 int cpuid; in acpi_parse_and_init_cpus() local 132 for (cpuid = 1; cpuid < nr_cpu_ids; cpuid++) { in acpi_parse_and_init_cpus() 133 if (cpuid_to_hartid_map(cpuid) != INVALID_HARTID) { in acpi_parse_and_init_cpus() [all …]
|
H A D | cpu_ops_sbi.c | 65 static int sbi_cpu_start(unsigned int cpuid, struct task_struct *tidle) in sbi_cpu_start() argument 68 unsigned long hartid = cpuid_to_hartid_map(cpuid); in sbi_cpu_start() 70 struct sbi_hart_boot_data *bdata = &per_cpu(boot_data, cpuid); in sbi_cpu_start() 82 static int sbi_cpu_prepare(unsigned int cpuid) in sbi_cpu_prepare() argument 85 pr_err("cpu start method not defined for CPU [%d]\n", cpuid); in sbi_cpu_prepare() 92 static int sbi_cpu_disable(unsigned int cpuid) in sbi_cpu_disable() argument 107 static int sbi_cpu_is_stopped(unsigned int cpuid) in sbi_cpu_is_stopped() argument 110 unsigned long hartid = cpuid_to_hartid_map(cpuid); in sbi_cpu_is_stopped()
|
/openbmc/linux/tools/testing/selftests/kvm/x86_64/ |
H A D | cpuid_test.c | 5 * Generic tests for KVM CPUID set/get ioctls 79 "CPUID nent mismatch: %d vs. %d", cpuid1->nent, cpuid2->nent); in compare_cpuids() 87 "CPUID entries[%d] mismtach: 0x%x.%d.%x vs. 0x%x.%d.%x\n", in compare_cpuids() 96 "CPUID 0x%x.%x differ: 0x%x:0x%x:0x%x:0x%x vs 0x%x:0x%x:0x%x:0x%x", in compare_cpuids() 126 struct kvm_cpuid2 *vcpu_alloc_cpuid(struct kvm_vm *vm, vm_vaddr_t *p_gva, struct kvm_cpuid2 *cpuid) in vcpu_alloc_cpuid() argument 128 int size = sizeof(*cpuid) + cpuid->nent * sizeof(cpuid->entries[0]); in vcpu_alloc_cpuid() 132 memcpy(guest_cpuids, cpuid, size); in vcpu_alloc_cpuid() 144 /* Setting unmodified CPUID is allowed */ in set_cpuid_after_run() 146 TEST_ASSERT(!rc, "Setting unmodified CPUID after KVM_RUN failed: %d", rc); in set_cpuid_after_run() 168 struct kvm_cpuid2 *cpuid = allocate_kvm_cpuid2(vcpu->cpuid->nent + 1); in test_get_cpuid2() local [all …]
|
/openbmc/u-boot/cmd/ |
H A D | mp.c | 11 unsigned long cpuid; in cpu_status_all() local 13 for (cpuid = 0; ; cpuid++) { in cpu_status_all() 14 if (!is_core_valid(cpuid)) { in cpu_status_all() 15 if (cpuid == 0) { in cpu_status_all() 16 printf("Core num: %lu is not valid\n", cpuid); in cpu_status_all() 21 cpu_status(cpuid); in cpu_status_all() 30 unsigned long cpuid; in cpu_cmd() local 38 cpuid = simple_strtoul(argv[1], NULL, 10); in cpu_cmd() 39 if (!is_core_valid(cpuid)) { in cpu_cmd() 40 printf ("Core num: %lu is not valid\n", cpuid); in cpu_cmd() [all …]
|
/openbmc/qemu/target/arm/ |
H A D | arm-powerctl.h | 24 * @cpuid: the id of the CPU we want to retrieve the state 26 * Retrieve a CPUState object from its CPU ID provided in @cpuid. 30 CPUState *arm_get_cpu_by_id(uint64_t cpuid); 34 * @cpuid: the id of the CPU we want to start/wake up. 40 * Start the cpu designated by @cpuid in @target_el exception level. The mode 49 int arm_set_cpu_on(uint64_t cpuid, uint64_t entry, uint64_t context_id, 54 * @cpuid: the id of the CPU we want to stop/shut down. 56 * Stop the cpu designated by @cpuid. 63 int arm_set_cpu_off(uint64_t cpuid); 67 * @cpuid: the id of the CPU we want to reset. [all …]
|
H A D | arm-powerctl.c | 96 int arm_set_cpu_on(uint64_t cpuid, uint64_t entry, uint64_t context_id, in arm_set_cpu_on() argument 106 "\n", cpuid, target_el, target_aa64 ? "aarch64" : "aarch32", entry, in arm_set_cpu_on() 121 target_cpu_state = arm_get_cpu_by_id(cpuid); in arm_set_cpu_on() 131 __func__, cpuid); in arm_set_cpu_on() 156 __func__, cpuid); in arm_set_cpu_on() 169 __func__, cpuid); in arm_set_cpu_on() 204 int arm_set_cpu_on_and_reset(uint64_t cpuid) in arm_set_cpu_on_and_reset() argument 212 target_cpu_state = arm_get_cpu_by_id(cpuid); in arm_set_cpu_on_and_reset() 222 __func__, cpuid); in arm_set_cpu_on_and_reset() 235 __func__, cpuid); in arm_set_cpu_on_and_reset() [all …]
|
/openbmc/linux/arch/sparc/kernel/ |
H A D | prom_64.c | 389 * 'portid', or 'cpuid' property. in arch_find_n_match_cpu_physical_id() 406 mid_prop = "cpuid"; in arch_find_n_match_cpu_physical_id() 441 int cpuid = of_getintprop_default(dp, mid_prop, -1); in of_iterate_over_cpus() local 445 if (cpuid < 0) { in of_iterate_over_cpus() 446 this_mid_prop = "cpuid"; in of_iterate_over_cpus() 447 cpuid = of_getintprop_default(dp, this_mid_prop, -1); in of_iterate_over_cpus() 449 if (cpuid < 0) { in of_iterate_over_cpus() 455 if (cpuid >= NR_CPUS) { in of_iterate_over_cpus() 458 cpuid, NR_CPUS); in of_iterate_over_cpus() 462 ret = func(dp, cpuid, arg); in of_iterate_over_cpus() [all …]
|
H A D | sun4d_smp.c | 45 static inline void show_leds(int cpuid) in show_leds() argument 47 cpuid &= 0x1e; in show_leds() 49 "r" ((cpu_leds[cpuid] << 4) | cpu_leds[cpuid+1]), in show_leds() 50 "r" (ECSR_BASE(cpuid) | BB_LEDS), in show_leds() 56 int cpuid = hard_smp_processor_id(); in sun4d_cpu_pre_starting() local 59 cpu_leds[cpuid] = 0x6; in sun4d_cpu_pre_starting() 60 show_leds(cpuid); in sun4d_cpu_pre_starting() 69 int cpuid; in sun4d_cpu_pre_online() local 71 cpuid = hard_smp_processor_id(); in sun4d_cpu_pre_online() 78 sun4d_swap((unsigned long *)&cpu_callin_map[cpuid], 1); in sun4d_cpu_pre_online() [all …]
|
/openbmc/linux/lib/zstd/common/ |
H A D | cpu.h | 15 * Implementation taken from folly/CpuId.h 16 * https://github.com/facebook/folly/blob/master/folly/CpuId.h 35 /* The following block like the normal cpuid branch below, but gcc in ZSTD_cpuid() 42 "cpuid\n\t" in ZSTD_cpuid() 51 "cpuid\n\t" in ZSTD_cpuid() 59 "cpuid\n\t" in ZSTD_cpuid() 68 __asm__("cpuid" : "=a"(n) : "a"(0) : "ebx", "ecx", "edx"); in ZSTD_cpuid() 71 __asm__("cpuid" : "=a"(f1a), "=c"(f1c), "=d"(f1d) : "a"(1) : "ebx"); in ZSTD_cpuid() 75 __asm__("cpuid" in ZSTD_cpuid() 82 ZSTD_cpuid_t cpuid; in ZSTD_cpuid() local [all …]
|
/openbmc/linux/arch/parisc/kernel/ |
H A D | topology.c | 28 void store_cpu_topology(unsigned int cpuid) in store_cpu_topology() argument 30 struct cpu_topology *cpuid_topo = &cpu_topology[cpuid]; in store_cpu_topology() 40 per_cpu(cpu_devices, cpuid).hotpluggable = 1; in store_cpu_topology() 42 if (register_cpu(&per_cpu(cpu_devices, cpuid), cpuid)) in store_cpu_topology() 43 pr_warn("Failed to register CPU%d device", cpuid); in store_cpu_topology() 49 p = &per_cpu(cpu_data, cpuid); in store_cpu_topology() 53 if (cpu == cpuid) /* ignore current cpu */ in store_cpu_topology() 72 update_siblings_masks(cpuid); in store_cpu_topology() 75 cpuid, in store_cpu_topology() 76 cpu_topology[cpuid].core_id, in store_cpu_topology() [all …]
|
H A D | processor.c | 84 unsigned long cpuid; in processor_probe() local 103 cpuid = boot_cpu_data.cpu_count; in processor_probe() 105 cpu_info.cpu_num = cpu_info.cpu_loc = cpuid; in processor_probe() 136 cpuid, cpu_info.cpu_num, cpu_info.cpu_loc, in processor_probe() 141 /* We need contiguous numbers for cpuid. Firmware's notion in processor_probe() 142 * of cpuid is for physical CPUs and we just don't care yet. in processor_probe() 155 cpuid = cpu_info.cpu_num; in processor_probe() 161 p = &per_cpu(cpu_data, cpuid); in processor_probe() 165 if (cpuid) in processor_probe() 170 p->cpuid = cpuid; /* save CPU id */ in processor_probe() [all …]
|
/openbmc/linux/include/soc/tegra/ |
H A D | flowctrl.h | 44 u32 flowctrl_read_cpu_csr(unsigned int cpuid); 45 void flowctrl_write_cpu_csr(unsigned int cpuid, u32 value); 46 void flowctrl_write_cpu_halt(unsigned int cpuid, u32 value); 48 void flowctrl_cpu_suspend_enter(unsigned int cpuid); 49 void flowctrl_cpu_suspend_exit(unsigned int cpuid); 51 static inline u32 flowctrl_read_cpu_csr(unsigned int cpuid) in flowctrl_read_cpu_csr() argument 56 static inline void flowctrl_write_cpu_csr(unsigned int cpuid, u32 value) in flowctrl_write_cpu_csr() argument 60 static inline void flowctrl_write_cpu_halt(unsigned int cpuid, u32 value) {} in flowctrl_write_cpu_halt() argument 62 static inline void flowctrl_cpu_suspend_enter(unsigned int cpuid) in flowctrl_cpu_suspend_enter() argument 66 static inline void flowctrl_cpu_suspend_exit(unsigned int cpuid) in flowctrl_cpu_suspend_exit() argument
|
/openbmc/qemu/target/i386/tcg/ |
H A D | decode-new.c.inc | 228 #define cpuid(feat) .cpuid = X86_FEAT_##feat, 327 X86_OP_ENTRY1(CMPXCHG8B, M,q, lock p_00 cpuid(CX8)); 329 X86_OP_ENTRY1(CMPXCHG16B, M,dq, lock p_00 cpuid(CX16)); 344 [0] = X86_OP_ENTRYw(RDxxBASE, R,y, cpuid(FSGSBASE) chk(o64) p_f3), 345 [1] = X86_OP_ENTRYw(RDxxBASE, R,y, cpuid(FSGSBASE) chk(o64) p_f3), 346 [2] = X86_OP_ENTRYr(WRxxBASE, R,y, cpuid(FSGSBASE) chk(o64) p_f3 zextT0), 347 [3] = X86_OP_ENTRYr(WRxxBASE, R,y, cpuid(FSGSBASE) chk(o64) p_f3 zextT0), 348 [5] = X86_OP_ENTRY0(LFENCE, cpuid(SSE) p_00), 349 [6] = X86_OP_ENTRY0(MFENCE, cpuid(SSE2) p_00), 350 [7] = X86_OP_ENTRY0(SFENCE, cpuid(SSE) p_00), [all …]
|
/openbmc/linux/drivers/soc/tegra/ |
H A D | flowctrl.c | 51 u32 flowctrl_read_cpu_csr(unsigned int cpuid) in flowctrl_read_cpu_csr() argument 53 u8 offset = flowctrl_offset_cpu_csr[cpuid]; in flowctrl_read_cpu_csr() 62 void flowctrl_write_cpu_csr(unsigned int cpuid, u32 value) in flowctrl_write_cpu_csr() argument 64 return flowctrl_update(flowctrl_offset_cpu_csr[cpuid], value); in flowctrl_write_cpu_csr() 67 void flowctrl_write_cpu_halt(unsigned int cpuid, u32 value) in flowctrl_write_cpu_halt() argument 69 return flowctrl_update(flowctrl_offset_halt_cpu[cpuid], value); in flowctrl_write_cpu_halt() 72 void flowctrl_cpu_suspend_enter(unsigned int cpuid) in flowctrl_cpu_suspend_enter() argument 77 reg = flowctrl_read_cpu_csr(cpuid); in flowctrl_cpu_suspend_enter() 85 reg |= TEGRA20_FLOW_CTRL_CSR_WFE_CPU0 << cpuid; in flowctrl_cpu_suspend_enter() 106 reg |= TEGRA20_FLOW_CTRL_CSR_WFE_CPU0 << cpuid; in flowctrl_cpu_suspend_enter() [all …]
|
/openbmc/linux/arch/x86/boot/compressed/ |
H A D | mem_encrypt.S | 23 movl $0x80000000, %eax /* CPUID to check the highest leaf */ 24 cpuid 30 * CPUID Fn8000_001F[EAX] - Bit 1 31 * CPUID Fn8000_001F[EBX] - Bits 5:0 35 cpuid 57 * sev_es_req_cpuid - Request a CPUID value from the Hypervisor using 61 * @%edx: CPUID Function 64 * %edx returns CPUID value on success 99 /* Keep CPUID function in %ebx */ 106 movl $0, %eax # Request CPUID[fn].EAX [all …]
|
/openbmc/linux/tools/perf/pmu-events/ |
H A D | empty-pmu-events.c | 198 * cpuid field, which is an arch-specific identifier for the CPU. 202 * The cpuid can contain any character other than the comma. 206 const char *cpuid; member 218 .cpuid = "testcpu", 224 .cpuid = 0, 330 char *cpuid = perf_pmu__getcpuid(pmu); in perf_pmu__find_events_table() local 333 /* on some platforms which uses cpus map, cpuid can be NULL for in perf_pmu__find_events_table() 336 if (!cpuid) in perf_pmu__find_events_table() 343 if (!map->cpuid) in perf_pmu__find_events_table() 346 if (!strcmp_cpuid_str(map->cpuid, cpuid)) { in perf_pmu__find_events_table() [all …]
|
/openbmc/linux/arch/x86/include/asm/ |
H A D | cpuid.h | 3 * CPUID-related helpers/definitions 34 asm volatile("cpuid" in native_cpuid() 54 * Native CPUID functions returning a single datum. 68 * Generic CPUID function in native_cpuid_reg() 72 static inline void cpuid(unsigned int op, in native_cpuid_reg() 81 /* Some CPUID calls want 'count' to be placed in ecx */ 92 * CPUID functions returning a single datum 98 cpuid(op, &eax, &ebx, &ecx, &edx); in cpuid_eax() 107 cpuid(op, &eax, &ebx, &ecx, &edx); in cpuid_ebx() 116 cpuid(op, &eax, &ebx, &ecx, &edx); in cpuid_ecx() [all …]
|
/openbmc/linux/arch/x86/kernel/ |
H A D | verify_cpu.S | 40 pushfl # standard way to check for cpuid 49 jz .Lverify_cpu_no_longmode # cpu has no cpuid 52 movl $0x0,%eax # See if cpuid 1 is implemented 53 cpuid 55 jb .Lverify_cpu_no_longmode # no cpuid 1 78 cpuid 101 cpuid 106 movl $0x80000000,%eax # See if extended cpuid is implemented 107 cpuid 109 jb .Lverify_cpu_no_longmode # no extended cpuid [all …]
|
H A D | cpuid.c | 9 * x86 CPUID access device 11 * This device is accessed by lseek() to the appropriate CPUID level 19 * This driver uses /dev/cpu/%d/cpuid where %d is the minor number, and on 111 return -EIO; /* CPUID not supported */ in cpuid_open() 128 return kasprintf(GFP_KERNEL, "cpu/%u/cpuid", MINOR(dev->devt)); in cpuid_devnode() 132 .name = "cpuid", 156 "cpu/cpuid", &cpuid_fops)) { in cpuid_init() 157 printk(KERN_ERR "cpuid: unable to get major %d for cpuid\n", in cpuid_init() 165 err = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "x86/cpuid:online", in cpuid_init() 176 __unregister_chrdev(CPUID_MAJOR, 0, NR_CPUS, "cpu/cpuid"); in cpuid_init() [all …]
|
/openbmc/linux/arch/alpha/kernel/ |
H A D | smp.c | 68 /* Set to a secondary's cpuid when it comes online. */ 80 smp_store_cpu_info(int cpuid) in smp_store_cpu_info() argument 82 cpu_data[cpuid].loops_per_jiffy = loops_per_jiffy; in smp_store_cpu_info() 83 cpu_data[cpuid].last_asn = ASN_FIRST_VERSION; in smp_store_cpu_info() 84 cpu_data[cpuid].need_new_asn = 0; in smp_store_cpu_info() 85 cpu_data[cpuid].asn_lock = 0; in smp_store_cpu_info() 92 smp_setup_percpu_timer(int cpuid) in smp_setup_percpu_timer() argument 94 cpu_data[cpuid].prof_counter = 1; in smp_setup_percpu_timer() 95 cpu_data[cpuid].prof_multiplier = 1; in smp_setup_percpu_timer() 99 wait_boot_cpu_to_stop(int cpuid) in wait_boot_cpu_to_stop() argument [all …]
|
/openbmc/linux/tools/perf/arch/riscv/util/ |
H A D | header.c | 42 char *cpuid = NULL; in _get_cpuid() local 49 return cpuid; in _get_cpuid() 72 if (asprintf(&cpuid, "%s-%s-%s", mvendorid, marchid, mimpid) < 0) in _get_cpuid() 73 cpuid = NULL; in _get_cpuid() 81 return cpuid; in _get_cpuid() 86 char *cpuid = _get_cpuid(); in get_cpuid() local 89 if (sz < strlen(cpuid)) { in get_cpuid() 94 scnprintf(buffer, sz, "%s", cpuid); in get_cpuid() 96 free(cpuid); in get_cpuid()
|
/openbmc/linux/arch/x86/kvm/ |
H A D | cpuid.c | 4 * cpuid support routines 24 #include <asm/cpuid.h> 25 #include "cpuid.h" 95 * Magic value used by KVM when querying userspace-provided CPUID entries and in cpuid_entry2_find() 99 * to avoid false positives when processing guest CPUID input. in cpuid_entry2_find() 110 * KVM has a semi-arbitrary rule that querying the guest's CPUID model in cpuid_entry2_find() 111 * with IRQs disabled is disallowed. The CPUID model can legitimately in cpuid_entry2_find() 117 * of the hotpath, e.g. by caching information during CPUID updates. in cpuid_entry2_find() 138 * lookup (as opposed to emulating CPUID) for a function that's in kvm_check_cpuid() 190 /* Check whether the supplied CPUID dat in kvm_cpuid_check_equal() 195 struct kvm_hypervisor_cpuid cpuid = {}; kvm_get_hypervisor_cpuid() local 460 kvm_vcpu_ioctl_set_cpuid(struct kvm_vcpu * vcpu,struct kvm_cpuid * cpuid,struct kvm_cpuid_entry __user * entries) kvm_vcpu_ioctl_set_cpuid() argument 505 kvm_vcpu_ioctl_set_cpuid2(struct kvm_vcpu * vcpu,struct kvm_cpuid2 * cpuid,struct kvm_cpuid_entry2 __user * entries) kvm_vcpu_ioctl_set_cpuid2() argument 528 kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu * vcpu,struct kvm_cpuid2 * cpuid,struct kvm_cpuid_entry2 __user * entries) kvm_vcpu_ioctl_get_cpuid2() argument 545 const struct cpuid_reg cpuid = x86_feature_cpuid(leaf * 32); __kvm_cpu_cap_mask() local 1393 kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 * cpuid,struct kvm_cpuid_entry2 __user * entries,unsigned int type) kvm_dev_ioctl_get_cpuid() argument [all...] |
/openbmc/linux/arch/x86/kernel/cpu/ |
H A D | tsx.c | 33 * Ensure TSX support is not enumerated in CPUID. in tsx_disable() 53 * Ensure TSX support is enumerated in CPUID. in tsx_enable() 73 * First of all, there's a CPUID bit: X86_FEATURE_RTM_ALWAYS_ABORT 81 * the MSR is present only when *two* CPUID bits are set: 89 * CPUID bit X86_FEATURE_RTM_ALWAYS_ABORT set and for those the same strategy 96 * which, when done, may cause for the X86_FEATURE_RTM_ALWAYS_ABORT CPUID 100 * cause for the supported CPUID feature bits to get re-detected and, if 103 * short: the kernel doesn't modify CPUID feature bits after booting. 113 * MSR_TFA_TSX_CPUID_CLEAR bit is only present when both CPUID in tsx_clear_cpuid() 166 * Hardware will always abort a TSX transaction when the CPUID bit in tsx_init() [all …]
|
/openbmc/linux/tools/perf/arch/x86/util/ |
H A D | header.c | 12 #include "cpuid.h" 18 cpuid(0, 0, lvl, &b, &c, &d); in get_cpuid_0() 36 cpuid(1, 0, &a, &b, &c, &d); in __get_cpuid() 78 /* Full CPUID format for x86 is vendor-family-model-stepping */ 104 * Full CPUID format is required to identify a platform. in strcmp_cpuid_str() 105 * Error out if the cpuid string is incomplete. in strcmp_cpuid_str() 108 pr_info("Invalid CPUID %s. Full CPUID is required, " in strcmp_cpuid_str() 125 /* If the full CPUID format isn't required, in strcmp_cpuid_str()
|