ret = sbi_ecall(SBI_EXT_STA, SBI_EXT_STA_STEAL_TIME_SET_SHMEM,
lo, hi, flags, 0, 0, 0); if (ret.error) { if (lo == SBI_SHMEM_DISABLE && hi == SBI_SHMEM_DISABLE)
pr_warn("Failed to disable steal-time shmem"); else
pr_warn("Failed to set steal-time shmem"); return sbi_err_map_linux_errno(ret.error);
}
return 0;
}
staticint pv_time_cpu_online(unsignedint cpu)
{ struct sbi_sta_struct *st = this_cpu_ptr(&steal_time);
phys_addr_t pa = __pa(st); unsignedlong lo = (unsignedlong)pa; unsignedlong hi = IS_ENABLED(CONFIG_32BIT) ? upper_32_bits((u64)pa) : 0;
/* * Check the sequence field before and after reading the steal * field. Repeat the read if it is different or odd.
*/ do {
sequence = READ_ONCE(st->sequence);
virt_rmb();
steal = READ_ONCE(st->steal);
virt_rmb();
} while ((le32_to_cpu(sequence) & 1) ||
sequence != READ_ONCE(st->sequence));
return le64_to_cpu(steal);
}
int __init pv_time_init(void)
{ int ret;
if (!has_pv_steal_clock()) return 0;
ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "riscv/pv_time:online",
pv_time_cpu_online,
pv_time_cpu_down_prepare); if (ret < 0) return ret;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.