On Wed, Jun 10, 2026 at 11:44:21AM +0200, Luigi Leonardi wrote:
> Parameter areas are how an IGVM file tells QEMU to allocate buffers
> for runtime information the guest needs — VP count, memory map,
> MADT and so on. Usage directives reference a parameter area by index
> to tell QEMU where to write each piece of data. If the index doesn't
> match any declared parameter area, the data has nowhere to go and it
> should be treated as an error.
> 
> The directive handlers that look up a parameter area all return 0
> (success) when `qigvm_find_param_entry()` can't find it. Therefore,
> the load succeeds but the guest never gets the expected parameters.
> 
> Note that the IGVM library already validates parameter area indices
> when the file is loaded, so this path should only be reachable with
> a malformed file that bypassed library validation. See it as a form
> of defensive programming.
> 
> Report the error with error_setg() and return -1 instead.
> Also remove the warn_report() from `qigvm_find_param_entry()`
> to avoid double error reporting.
> 
> Signed-off-by: Luigi Leonardi <[email protected]>
> ---
>  backends/igvm.c    | 17 ++++++++++++-----
>  target/i386/igvm.c |  4 +++-
>  2 files changed, 15 insertions(+), 6 deletions(-)
> 
> diff --git a/backends/igvm.c b/backends/igvm.c
> index c347d0c17e..2569c4a9f2 100644
> --- a/backends/igvm.c
> +++ b/backends/igvm.c
> @@ -71,7 +71,6 @@ qigvm_find_param_entry(QIgvm *igvm, uint32_t 
> parameter_area_index)
>              return param_entry;
>          }
>      }
> -    warn_report("IGVM: No parameter area for index %u", 
> parameter_area_index);
>      return NULL;
>  }

When passing down errp to qigvm_find_param_entry() we can call
error_setg here instead duplicating it for each qigvm_find_param_entry
call.

take care,
  Gerd


Reply via email to