/kernel/linux/linux-5.10/arch/riscv/kernel/ |
H A D | cpu_ops_sbi.c | 17 static int sbi_hsm_hart_start(unsigned long hartid, unsigned long saddr, in sbi_hsm_hart_start() argument 23 hartid, saddr, priv, 0, 0, 0); in sbi_hsm_hart_start() 43 static int sbi_hsm_hart_get_status(unsigned long hartid) in sbi_hsm_hart_get_status() argument 48 hartid, 0, 0, 0, 0, 0); in sbi_hsm_hart_get_status() 60 int hartid = cpuid_to_hartid_map(cpuid); in sbi_cpu_start() local 63 rc = sbi_hsm_hart_start(hartid, boot_addr, 0); in sbi_cpu_start() 96 int hartid = cpuid_to_hartid_map(cpuid); in sbi_cpu_is_stopped() local 98 rc = sbi_hsm_hart_get_status(hartid); in sbi_cpu_is_stopped()
|
H A D | sbi.c | 216 unsigned long hartid, hmask_val, hbase; in __sbi_send_ipi_v02() local 228 for_each_set_bit(hartid, hart_mask, NR_CPUS) { in __sbi_send_ipi_v02() 229 if (hmask_val && ((hbase + BITS_PER_LONG) <= hartid)) { in __sbi_send_ipi_v02() 238 hbase = hartid; in __sbi_send_ipi_v02() 239 hmask_val |= 1UL << (hartid - hbase); in __sbi_send_ipi_v02() 315 unsigned long hmask_val, hartid, hbase; in __sbi_rfence_v02() local 326 for_each_set_bit(hartid, hart_mask, NR_CPUS) { in __sbi_rfence_v02() 327 if (hmask_val && ((hbase + BITS_PER_LONG) <= hartid)) { in __sbi_rfence_v02() 336 hbase = hartid; in __sbi_rfence_v02() 337 hmask_val |= 1UL << (hartid in __sbi_rfence_v02() [all...] |
H A D | cpu_ops.c | 27 int hartid = cpuid_to_hartid_map(cpuid); in cpu_update_secondary_bootdata() local 31 WRITE_ONCE(__cpu_up_stack_pointer[hartid], in cpu_update_secondary_bootdata() 33 WRITE_ONCE(__cpu_up_task_pointer[hartid], tidle); in cpu_update_secondary_bootdata()
|
H A D | smp.c | 48 int riscv_hartid_to_cpuid(int hartid) in riscv_hartid_to_cpuid() argument 53 if (cpuid_to_hartid_map(i) == hartid) in riscv_hartid_to_cpuid() 56 pr_err("Couldn't find cpu id for hartid [%d]\n", hartid); in riscv_hartid_to_cpuid()
|
/kernel/linux/linux-6.6/arch/riscv/kernel/ |
H A D | cpu_ops_sbi.c | 26 static int sbi_hsm_hart_start(unsigned long hartid, unsigned long saddr, in sbi_hsm_hart_start() argument 32 hartid, saddr, priv, 0, 0, 0); in sbi_hsm_hart_start() 52 static int sbi_hsm_hart_get_status(unsigned long hartid) in sbi_hsm_hart_get_status() argument 57 hartid, 0, 0, 0, 0, 0); in sbi_hsm_hart_get_status() 68 unsigned long hartid = cpuid_to_hartid_map(cpuid); in sbi_cpu_start() local 79 return sbi_hsm_hart_start(hartid, boot_addr, hsm_data); in sbi_cpu_start() 110 unsigned long hartid = cpuid_to_hartid_map(cpuid); in sbi_cpu_is_stopped() local 112 rc = sbi_hsm_hart_get_status(hartid); in sbi_cpu_is_stopped()
|
H A D | cpu_ops_spinwait.c | 23 unsigned long hartid = cpuid_to_hartid_map(cpuid); in cpu_update_secondary_bootdata() local 26 * The hartid must be less than NR_CPUS to avoid out-of-bound access in cpu_update_secondary_bootdata() 28 * for platforms with discontiguous hartid numbering scheme. That's why in cpu_update_secondary_bootdata() 32 if (hartid == INVALID_HARTID || hartid >= (unsigned long) NR_CPUS) in cpu_update_secondary_bootdata() 37 WRITE_ONCE(__cpu_spinwait_stack_pointer[hartid], in cpu_update_secondary_bootdata() 39 WRITE_ONCE(__cpu_spinwait_task_pointer[hartid], tidle); in cpu_update_secondary_bootdata()
|
H A D | sbi.c | 74 unsigned long cpuid, hartid; in __sbi_v01_cpumask_to_hartmask() local 78 * There is no maximum hartid concept in RISC-V and NR_CPUS must not be in __sbi_v01_cpumask_to_hartmask() 79 * associated with hartid. As SBI v0.1 is only kept for backward compatibility in __sbi_v01_cpumask_to_hartmask() 80 * and will be removed in the future, there is no point in supporting hartid in __sbi_v01_cpumask_to_hartmask() 82 * should be used for platforms with hartid greater than BITS_PER_LONG. in __sbi_v01_cpumask_to_hartmask() 85 hartid = cpuid_to_hartid_map(cpuid); in __sbi_v01_cpumask_to_hartmask() 86 if (hartid >= BITS_PER_LONG) { in __sbi_v01_cpumask_to_hartmask() 87 pr_warn("Unable to send any request to hartid > BITS_PER_LONG for SBI v0.1\n"); in __sbi_v01_cpumask_to_hartmask() 90 hmask |= BIT(hartid); in __sbi_v01_cpumask_to_hartmask() 305 unsigned long hartid, cpui in __sbi_rfence_v02() local [all...] |
H A D | cpu.c | 65 pr_info("CPU with hartid=%lu is not available\n", *hart); in riscv_early_of_processor_hartid() 73 pr_warn("CPU with hartid=%lu does not support rv32i", *hart); in riscv_early_of_processor_hartid() 78 pr_warn("CPU with hartid=%lu does not support rv64i", *hart); in riscv_early_of_processor_hartid() 88 pr_warn("CPU with hartid=%lu does not support ima", *hart); in riscv_early_of_processor_hartid() 96 pr_warn("CPU with hartid=%lu is invalid: this kernel does not parse \"riscv,isa\"", in riscv_early_of_processor_hartid() 102 pr_warn("CPU with hartid=%lu has no \"riscv,isa-base\" or \"riscv,isa\" property\n", in riscv_early_of_processor_hartid() 108 pr_warn("CPU with hartid=%lu does not support rv32ima", *hart); in riscv_early_of_processor_hartid() 113 pr_warn("CPU with hartid=%lu does not support rv64ima", *hart); in riscv_early_of_processor_hartid() 126 int riscv_of_parent_hartid(struct device_node *node, unsigned long *hartid) in riscv_of_parent_hartid() argument 130 *hartid in riscv_of_parent_hartid() [all...] |
H A D | hibernate.c | 53 * @hartid: to make sure same boot_cpu executes the hibernate/restore code. 59 unsigned long hartid; member 101 hdr->hartid = cpuid_to_hartid_map(sleep_cpu); in arch_hibernation_header_save() 125 sleep_cpu = riscv_hartid_to_cpuid(hdr->hartid); in arch_hibernation_header_restore()
|
H A D | smp.c | 53 int riscv_hartid_to_cpuid(unsigned long hartid) in riscv_hartid_to_cpuid() argument 58 if (cpuid_to_hartid_map(i) == hartid) in riscv_hartid_to_cpuid()
|
/kernel/linux/linux-5.10/drivers/clocksource/ |
H A D | timer-riscv.c | 95 int cpuid, hartid, error; in riscv_timer_init_dt() local 99 hartid = riscv_of_processor_hartid(n); in riscv_timer_init_dt() 100 if (hartid < 0) { in riscv_timer_init_dt() 101 pr_warn("Not valid hartid for node [%pOF] error = [%d]\n", in riscv_timer_init_dt() 102 n, hartid); in riscv_timer_init_dt() 103 return hartid; in riscv_timer_init_dt() 106 cpuid = riscv_hartid_to_cpuid(hartid); in riscv_timer_init_dt() 108 pr_warn("Invalid cpuid for hartid [%d]\n", hartid); in riscv_timer_init_dt() 134 pr_info("%s: Registering clocksource cpuid [%d] hartid [ in riscv_timer_init_dt() [all...] |
/kernel/linux/linux-6.6/drivers/firmware/efi/libstub/ |
H A D | riscv.c | 16 static unsigned long hartid; variable 32 prop = fdt_getprop((void *)fdt, chosen_node, "boot-hartid", &len); in get_boot_hartid_from_fdt() 37 hartid = (unsigned long) fdt32_to_cpu(*(fdt32_t *)prop); in get_boot_hartid_from_fdt() 39 hartid = (unsigned long) fdt64_to_cpu(__get_unaligned_t(fdt64_t, prop)); in get_boot_hartid_from_fdt() 56 return efi_call_proto(boot_protocol, get_boot_hartid, &hartid); in get_boot_hartid_from_efi() 68 efi_err("Failed to get boot hartid!\n"); in check_platform_features() 93 * 2. a0 should contain hartid in efi_enter_kernel() 97 jump_kernel(hartid, fdt); in efi_enter_kernel()
|
/kernel/linux/linux-6.6/arch/riscv/mm/ |
H A D | cacheflush.c | 104 unsigned long hartid; in cbo_get_block_size() local 107 if (riscv_of_processor_hartid(node, &hartid)) in cbo_get_block_size() 115 *first_hartid = hartid; in cbo_get_block_size() 118 name, *first_hartid, hartid); in cbo_get_block_size()
|
/kernel/linux/linux-5.10/drivers/irqchip/ |
H A D | irq-riscv-intc.c | 98 int rc, hartid; in riscv_intc_init() local 100 hartid = riscv_of_parent_hartid(node); in riscv_intc_init() 101 if (hartid < 0) { in riscv_intc_init() 112 if (riscv_hartid_to_cpuid(hartid) != smp_processor_id()) in riscv_intc_init()
|
H A D | irq-sifive-plic.c | 318 int cpu, hartid; in plic_init() local 332 hartid = riscv_of_parent_hartid(parent.np); in plic_init() 333 if (hartid < 0) { in plic_init() 338 cpu = riscv_hartid_to_cpuid(hartid); in plic_init()
|
/kernel/linux/linux-6.6/drivers/clocksource/ |
H A D | timer-riscv.c | 181 unsigned long hartid; in riscv_timer_init_dt() local 184 error = riscv_of_processor_hartid(n, &hartid); in riscv_timer_init_dt() 186 pr_warn("Invalid hartid for node [%pOF] error = [%lu]\n", in riscv_timer_init_dt() 187 n, hartid); in riscv_timer_init_dt() 191 cpuid = riscv_hartid_to_cpuid(hartid); in riscv_timer_init_dt() 193 pr_warn("Invalid cpuid for hartid [%lu]\n", hartid); in riscv_timer_init_dt()
|
/kernel/linux/linux-5.10/arch/riscv/include/asm/ |
H A D | smp.h | 25 * Mapping between linux logical cpu index and hartid. 45 int riscv_hartid_to_cpuid(int hartid); 76 static inline int riscv_hartid_to_cpuid(int hartid) in riscv_hartid_to_cpuid() argument 78 if (hartid == boot_cpu_hartid) in riscv_hartid_to_cpuid()
|
/kernel/linux/linux-5.10/drivers/firmware/efi/libstub/ |
H A D | riscv-stub.c | 26 static u32 hartid; variable 42 prop = fdt_getprop((void *)fdt, chosen_node, "boot-hartid", &len); in get_boot_hartid_from_fdt() 46 hartid = fdt32_to_cpu(*prop); in get_boot_hartid_from_fdt() 56 efi_err("/chosen/boot-hartid missing or invalid!\n"); in check_platform_features() 72 * 2. a0 should contain hartid in efi_enter_kernel() 76 jump_kernel(hartid, fdt); in efi_enter_kernel()
|
/kernel/linux/linux-6.6/arch/riscv/include/asm/ |
H A D | smp.h | 23 * Mapping between linux logical cpu index and hartid. 40 int riscv_hartid_to_cpuid(unsigned long hartid); 82 static inline int riscv_hartid_to_cpuid(unsigned long hartid) in riscv_hartid_to_cpuid() argument 84 if (hartid == boot_cpu_hartid) in riscv_hartid_to_cpuid()
|
H A D | processor.h | 120 int riscv_of_processor_hartid(struct device_node *node, unsigned long *hartid); 121 int riscv_early_of_processor_hartid(struct device_node *node, unsigned long *hartid); 122 int riscv_of_parent_hartid(struct device_node *node, unsigned long *hartid);
|
H A D | kexec.h | 52 unsigned long hartid,
|
H A D | suspend.h | 39 int __cpu_resume_enter(unsigned long hartid, unsigned long context);
|
/kernel/linux/linux-6.6/drivers/irqchip/ |
H A D | irq-riscv-intc.c | 144 unsigned long hartid; in riscv_intc_init() local 146 rc = riscv_of_parent_hartid(node, &hartid); in riscv_intc_init() 158 if (riscv_hartid_to_cpuid(hartid) != smp_processor_id()) { in riscv_intc_init()
|
H A D | irq-sifive-plic.c | 462 unsigned long hartid; in __plic_init() local 486 error = riscv_of_parent_hartid(parent.np, &hartid); in __plic_init() 492 cpu = riscv_hartid_to_cpuid(hartid); in __plic_init()
|
/kernel/linux/linux-6.6/drivers/acpi/ |
H A D | processor_core.c | 110 * Retrieve the RISC-V hartid for the processor 114 phys_cpuid_t *hartid) in map_rintc_hartid() 128 *hartid = rintc->hart_id; in map_rintc_hartid() 112 map_rintc_hartid(struct acpi_subtable_header *entry, int device_declaration, u32 acpi_id, phys_cpuid_t *hartid) map_rintc_hartid() argument
|