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
13 #include <asm/sbi.h>
24 u64 id = -1ULL; in hwprobe_arch_id()
31 switch (pair->key) { in hwprobe_arch_id()
49 * If there's a mismatch for the given set, return -1 in the in hwprobe_arch_id()
53 id = -1ULL; in hwprobe_arch_id()
58 pair->value = id; in hwprobe_arch_id()
67 pair->value = 0; in hwprobe_isa_ext0()
69 pair->value |= RISCV_HWPROBE_IMA_FD; in hwprobe_isa_ext0()
72 pair->value |= RISCV_HWPROBE_IMA_C; in hwprobe_isa_ext0()
75 pair->value |= RISCV_HWPROBE_IMA_V; in hwprobe_isa_ext0()
86 if (__riscv_isa_extension_available(isainfo->isa, RISCV_ISA_EXT_##ext)) \ in hwprobe_isa_ext0()
87 pair->value |= RISCV_HWPROBE_EXT_##ext; \ in hwprobe_isa_ext0()
157 pair->value &= ~missing; in hwprobe_isa_ext0()
172 u64 perf = -1ULL; in hwprobe_misaligned()
177 if (perf == -1ULL) in hwprobe_misaligned()
186 if (perf == -1ULL) in hwprobe_misaligned()
207 switch (pair->key) { in hwprobe_one_pair()
214 * The kernel already assumes that the base single-letter ISA in hwprobe_one_pair()
220 pair->value = RISCV_HWPROBE_BASE_BEHAVIOR_IMA; in hwprobe_one_pair()
229 pair->value = hwprobe_misaligned(cpus); in hwprobe_one_pair()
233 pair->value = 0; in hwprobe_one_pair()
235 pair->value = riscv_cboz_block_size; in hwprobe_one_pair()
238 pair->value = user_max_virt_addr(); in hwprobe_one_pair()
242 pair->value = riscv_timebase; in hwprobe_one_pair()
247 * call, but get their element key set to -1 and value set to 0 in hwprobe_one_pair()
251 pair->key = -1; in hwprobe_one_pair()
252 pair->value = 0; in hwprobe_one_pair()
268 return -EINVAL; in hwprobe_get_values()
284 return -EFAULT; in hwprobe_get_values()
292 return -EINVAL; in hwprobe_get_values()
298 if (get_user(pair.key, &pairs->key)) in hwprobe_get_values()
299 return -EFAULT; in hwprobe_get_values()
303 ret = put_user(pair.key, &pairs->key); in hwprobe_get_values()
305 ret = put_user(pair.value, &pairs->value); in hwprobe_get_values()
308 return -EFAULT; in hwprobe_get_values()
325 return -EINVAL; in hwprobe_get_cpus()
328 return -EINVAL; in hwprobe_get_cpus()
335 return -EFAULT; in hwprobe_get_cpus()
350 return -EFAULT; in hwprobe_get_cpus()
354 pair = (struct riscv_hwprobe){ .key = -1, }; in hwprobe_get_cpus()
357 return -EFAULT; in hwprobe_get_cpus()
382 return -EFAULT; in hwprobe_get_cpus()
405 struct arch_vdso_data *avd = &vd->arch_data; in init_hwprobe_vdso_data()
420 avd->all_cpu_hwprobe_values[key] = pair.value; in init_hwprobe_vdso_data()
433 * populated) or any value returns -1 (varies across CPUs), then the in init_hwprobe_vdso_data()
436 avd->homogeneous_cpus = id_bitsmash != 0 && id_bitsmash != -1; in init_hwprobe_vdso_data()