Re: [PATCH v7 04/20] xen/riscv: introduce guest riscv,isa string

Jan Beulich <[email protected]>
Newsgroups gmane.comp.emulators.xen.devel
Message-ID <[email protected]>
On 04.08.2026 17:47, Oleksii Kurochko wrote:
> @@ -34,9 +36,35 @@ struct riscv_isa_ext_data {
>      .name = #ext_name,                          \
>  }
>  
> +struct riscv_isa_ext_entry {
> +    unsigned int id;
> +    const char *name;
> +    bool guest_supported;
> +};
> +
> +#define RISCV_ISA_EXT_ENTRY(ext_name, guest_supp)       \
> +{                                                       \
> +    .id              = RISCV_ISA_EXT_ ## ext_name,      \
> +    .name            = #ext_name,                       \
> +    .guest_supported = guest_supp,                      \
> +}
> +
>  /* Host ISA bitmap */
>  static __ro_after_init DECLARE_BITMAP(riscv_isa, RISCV_ISA_EXT_MAX);
>  
> +/*
> + * ISA bitmap handed out to every guest.
> + *
> + * All guests are given the same extensions for the time being, so this is
> + * computed once out of riscv_isa_ext[] and riscv_isa, rather than redoing
> + * the walk for every domain created.  Should per-domain ISA policy ever be
> + * introduced, this will need to become per-domain again.
> + */
> +static __ro_after_init DECLARE_BITMAP(guest_isa, RISCV_ISA_EXT_MAX);
> +
> +/* "riscv,isa" string corresponding to guest_isa, shared by all domains. */
> +static char *__ro_after_init guest_isa_str;

This would better be pointer-to-const, as nothing should alter the string
anymore once it was built. Then:
Acked-by: Jan Beulich <[email protected]>

Jan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.