Hi Oleksii,
On 22/12/2025 11:30, Oleksii Kurochko wrote:
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index ee75258fc3..a0ccda14bf 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -418,8 +418,18 @@ unsigned long gic_get_hwdom_madt_size(const
struct domain *d)
{
unsigned long madt_size;
+ struct acpi_subtable_header *header;
+ struct acpi_madt_generic_interrupt *host_gicc;
For both variables, you don't seem to modify the content. So I think
they should be const.
+
+ header =
acpi_table_get_entry_madt(ACPI_MADT_TYPE_GENERIC_INTERRUPT, 0);
+ if ( !header )
+ panic("Can't get GICC entry");
I would feel happier to use panic() in this function if
gic_get_hwdom_madt_size() is __init (its only caller is during boot)).
I am okay with making gic_get_hwdom_madt_size() as __init.
An alternative is to stash the GICC size in a global variable.
We also could to return 0 in the case of ( !header ) and then check if
the size is zero or not in estimate_acpi_efi_size(),
and if it is zero then just return -EINVAL. Does it make sense?
This would also work for me. I will let you chose between the two
approaches.
Cheers,
--
Julien Grall