[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] tools/ocaml: Fill arch_config for ARM in domain_getinfo{,list}()




On 7/28/26 17:48, Andrew Cooper wrote:
> From: Julian Vetter <julian.vetter@xxxxxxxxxx>
> 
> Add the missing ARM logic, populating xen_arm_arch_domainconfig
> from the raw xc_domaininfo_t the same way the x86 branch does for
> xen_x86_arch_domainconfig.
> 
> Signed-off-by: Julian Vetter <julian.vetter@xxxxxxxxxx>
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> ---
> CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> CC: Andrii Sultanov <andriy.sultanov@xxxxxxxxxx>
> CC: Guillaume Thouvenin <guillaume.thouvenin@xxxxxxxxxx>
> CC: Julian Vetter <julian.vetter@xxxxxxxxxx>
> CC: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
> ---
>   tools/ocaml/libs/xc/xenctrl_stubs.c | 16 ++++++++++++++--
>   1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c 
> b/tools/ocaml/libs/xc/xenctrl_stubs.c
> index 441e1d83cfec..fb983709066f 100644
> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
> @@ -444,9 +444,21 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
>   
>       Store_field(result, 15, tmp);
>   
> -#if defined(__i386__) || defined(__x86_64__)
> +#if defined(__arm__) || defined(__aarch64__)
>   
> -     tag = 1; /* tag x86 */
> +     tag = 0; /* tag ARM */
> +
> +        /* xen_arm_arch_domainconfig */
> +        arch_config = caml_alloc_tuple(3);
> +        Field(arch_config, 0) = Val_int(info->arch_config.gic_version);
> +        Field(arch_config, 1) = Val_int(info->arch_config.nr_spis);
> +
> +     tmp = caml_copy_int32(info->arch_config.clock_frequency);
> +        Field(arch_config, 2) = tmp;

Shouldn't the Field() be a `Store_field(arch_config, 2, tmp);`, because 
the `caml_copy_int32` makes an allocation on the minor heap to allow 
OCAML's GC to keep track of this pointer if ever the arch_config is 
promoted?

> +
> +#elif defined(__i386__) || defined(__x86_64__)
> +
> +        tag = 1; /* tag x86 */
>   
>       /*
>        * emulation_flags: x86_arch_emulation_flags list;



--
Julian Vetter | Vates Hypervisor & Kernel Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.