mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
The Store_field(result, 16, arch_config) sits inside an #ifdef x86, meaning that on other architectures the pointer is not filled in. Ocaml code then falls over a NULL(ish) pointer (really the Val_unit used to initialise 'result') when the layout in the heap doesn't match the type system. Rearrange alloc_domaininfo() to avoid this. Similarly to physinfo_arch_caps(), raise an exception if the architecture code hasn't filled in an appropriate tag. Move the setup of arch_domainconfig to be common logic. In order to simplify the addition of other architectures, remove the arch_config variable (reusing tmp as it's touched exactly once), and rename x86_arch_config to be arch_config so each architecture can fill in a suitable one without needing more local variables. Fixes:9d683b5e37("tools/ocaml: Expose arch_config in domaininfo") Fixes:81838c9067("ocaml: fix arm build") Reported-by: Julian Vetter <julian.vetter@vates.tech> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Teddy Astie <teddy.astie@vates.tech> Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> (cherry picked from commit365d2a5be3)