Lines Matching +full:riscv +full:- +full:sbi

1 // SPDX-License-Identifier: GPL-2.0-only
4 * are supported by the hardware. See Documentation/arch/riscv/hwprobe.rst for
11 #include <asm/sbi.h>
22 u64 id = -1ULL; in hwprobe_arch_id()
29 switch (pair->key) { in hwprobe_arch_id()
47 * If there's a mismatch for the given set, return -1 in the in hwprobe_arch_id()
51 id = -1ULL; in hwprobe_arch_id()
56 pair->value = id; in hwprobe_arch_id()
65 pair->value = 0; in hwprobe_isa_ext0()
67 pair->value |= RISCV_HWPROBE_IMA_FD; in hwprobe_isa_ext0()
70 pair->value |= RISCV_HWPROBE_IMA_C; in hwprobe_isa_ext0()
73 pair->value |= RISCV_HWPROBE_IMA_V; in hwprobe_isa_ext0()
84 if (__riscv_isa_extension_available(isainfo->isa, RISCV_ISA_EXT_##ext)) \ in hwprobe_isa_ext0()
85 pair->value |= RISCV_HWPROBE_EXT_##ext; \ in hwprobe_isa_ext0()
139 pair->value &= ~missing; in hwprobe_isa_ext0()
153 u64 perf = -1ULL; in hwprobe_misaligned()
158 if (perf == -1ULL) in hwprobe_misaligned()
167 if (perf == -1ULL) in hwprobe_misaligned()
176 switch (pair->key) { in hwprobe_one_pair()
183 * The kernel already assumes that the base single-letter ISA in hwprobe_one_pair()
189 pair->value = RISCV_HWPROBE_BASE_BEHAVIOR_IMA; in hwprobe_one_pair()
197 pair->value = hwprobe_misaligned(cpus); in hwprobe_one_pair()
201 pair->value = 0; in hwprobe_one_pair()
203 pair->value = riscv_cboz_block_size; in hwprobe_one_pair()
208 * call, but get their element key set to -1 and value set to 0 in hwprobe_one_pair()
212 pair->key = -1; in hwprobe_one_pair()
213 pair->value = 0; in hwprobe_one_pair()
229 return -EINVAL; in hwprobe_get_values()
245 return -EFAULT; in hwprobe_get_values()
253 return -EINVAL; in hwprobe_get_values()
259 if (get_user(pair.key, &pairs->key)) in hwprobe_get_values()
260 return -EFAULT; in hwprobe_get_values()
264 ret = put_user(pair.key, &pairs->key); in hwprobe_get_values()
266 ret = put_user(pair.value, &pairs->value); in hwprobe_get_values()
269 return -EFAULT; in hwprobe_get_values()
286 return -EINVAL; in hwprobe_get_cpus()
289 return -EINVAL; in hwprobe_get_cpus()
296 return -EFAULT; in hwprobe_get_cpus()
311 return -EFAULT; in hwprobe_get_cpus()
315 pair = (struct riscv_hwprobe){ .key = -1, }; in hwprobe_get_cpus()
318 return -EFAULT; in hwprobe_get_cpus()
343 return -EFAULT; in hwprobe_get_cpus()
366 struct arch_vdso_data *avd = &vd->arch_data; in init_hwprobe_vdso_data()
381 avd->all_cpu_hwprobe_values[key] = pair.value; in init_hwprobe_vdso_data()
394 * populated) or any value returns -1 (varies across CPUs), then the in init_hwprobe_vdso_data()
397 avd->homogeneous_cpus = id_bitsmash != 0 && id_bitsmash != -1; in init_hwprobe_vdso_data()