On 10.06.2025 15:05, Oleksii Kurochko wrote:
> Instruct the remote harts to execute one or more HFENCE.GVMA instructions,
> covering the range of guest physical addresses between start_addr and
> start_addr + size for all the guests.
Here and in the code comment: Why "for all the guests"? Under what conditions
would you require such a broad (guest) TLB flush?
> --- a/xen/arch/riscv/sbi.c
> +++ b/xen/arch/riscv/sbi.c
> @@ -258,6 +258,15 @@ int sbi_remote_sfence_vma(const cpumask_t *cpu_mask,
> vaddr_t start,
> cpu_mask, start, size, 0, 0);
> }
>
> +int sbi_remote_hfence_gvma(const cpumask_t *cpu_mask, vaddr_t start,
> + size_t size)
> +{
> + ASSERT(sbi_rfence);
As previously indicated, I question the usefulness of such assertions. If the
pointer is still NULL, ...
> + return sbi_rfence(SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA,
> + cpu_mask, start, size, 0, 0);
... you'll crash here anyway (much like you will in a release build).
Jan