Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Luigi Leonardi <leonardi@redhat.com>
To: Oliver Steffen <osteffen@redhat.com>
Cc: qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	 Eduardo Habkost <eduardo@habkost.net>,
	Gerd Hoffmann <kraxel@redhat.com>,
	 Stefano Garzarella <sgarzare@redhat.com>,
	Zhao Liu <zhao1.liu@intel.com>,
	 Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Igor Mammedov <imammedo@redhat.com>,
	 Marcelo Tosatti <mtosatti@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	 Ani Sinha <anisinha@redhat.com>,
	kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
	 Joerg Roedel <joerg.roedel@amd.com>
Subject: Re: [PATCH v5 4/6] igvm: Refactor qigvm_parameter_insert
Date: Thu, 29 Jan 2026 12:10:08 +0100	[thread overview]
Message-ID: <aXtAAzNeJxr9usOo@leonardi-redhat> (raw)
In-Reply-To: <20260127100257.1074104-5-osteffen@redhat.com>

On Tue, Jan 27, 2026 at 11:02:55AM +0100, Oliver Steffen wrote:
>Use qigvm_find_param_entry() also in qigvm_parameter_insert().
>This changes behavior: Processing now stops after the first parameter
>entry found. That is OK, because we expect only one matching entry
>anyway.
>
>Signed-off-by: Oliver Steffen <osteffen@redhat.com>
>---
> backends/igvm.c | 50 ++++++++++++++++++++++++-------------------------
> 1 file changed, 25 insertions(+), 25 deletions(-)
>
>diff --git a/backends/igvm.c b/backends/igvm.c
>index 213c9d337e..0a0092fb55 100644
>--- a/backends/igvm.c
>+++ b/backends/igvm.c
>@@ -513,31 +513,31 @@ static int qigvm_directive_parameter_insert(QIgvm *ctx,
>         return 0;
>     }
>
>-    QTAILQ_FOREACH(param_entry, &ctx->parameter_data, next)
>-    {
>-        if (param_entry->index == param->parameter_area_index) {
>-            region = qigvm_prepare_memory(ctx, param->gpa, param_entry->size,
>-                                          ctx->current_header_index, errp);
>-            if (!region) {
>-                return -1;
>-            }
>-            memcpy(region, param_entry->data, param_entry->size);
>-            g_free(param_entry->data);
>-            param_entry->data = NULL;
>-
>-            /*
>-             * If a confidential guest support object is provided then use it to
>-             * set the guest state.
>-             */
>-            if (ctx->cgs) {
>-                result = ctx->cgsc->set_guest_state(param->gpa, region,
>-                                                    param_entry->size,
>-                                                    CGS_PAGE_TYPE_UNMEASURED, 0,
>-                                                    errp);
>-                if (result < 0) {
>-                    return -1;
>-                }
>-            }
>+    param_entry = qigvm_find_param_entry(ctx, param->parameter_area_index);
>+    if (param_entry == NULL) {
>+        return 0;
>+    }
>+
>+    region = qigvm_prepare_memory(ctx, param->gpa, param_entry->size,
>+                                    ctx->current_header_index, errp);
>+    if (!region) {
>+        return -1;
>+    }
>+    memcpy(region, param_entry->data, param_entry->size);
>+    g_free(param_entry->data);
>+    param_entry->data = NULL;
>+
>+    /*
>+     * If a confidential guest support object is provided then use it to
>+     * set the guest state.
>+     */
>+    if (ctx->cgs) {
>+        result = ctx->cgsc->set_guest_state(param->gpa, region,
>+                                            param_entry->size,
>+                                            CGS_PAGE_TYPE_UNMEASURED, 0,
>+                                            errp);
>+        if (result < 0) {
>+            return -1;
>         }
>     }
>     return 0;
>-- 
>2.52.0
>

LGTM

Reviewed-by: Luigi Leonardi <leonardi@redhat.com>


  reply	other threads:[~2026-01-29 11:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27 10:02 [PATCH v5 0/6] igvm: Supply MADT via IGVM parameter Oliver Steffen
2026-01-27 10:02 ` [PATCH v5 1/6] hw/acpi: Make BIOS linker optional Oliver Steffen
2026-01-29 10:51   ` Luigi Leonardi
2026-01-27 10:02 ` [PATCH v5 2/6] hw/acpi: Add standalone function to build MADT Oliver Steffen
2026-01-27 10:02 ` [PATCH v5 3/6] igvm: Add common function for finding parameter entries Oliver Steffen
2026-01-29 11:09   ` Luigi Leonardi
2026-01-27 10:02 ` [PATCH v5 4/6] igvm: Refactor qigvm_parameter_insert Oliver Steffen
2026-01-29 11:10   ` Luigi Leonardi [this message]
2026-01-27 10:02 ` [PATCH v5 5/6] igvm: Pass machine state to IGVM file processing Oliver Steffen
2026-01-27 10:02 ` [PATCH v5 6/6] igvm: Fill MADT IGVM parameter field Oliver Steffen
2026-01-27 15:54   ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aXtAAzNeJxr9usOo@leonardi-redhat \
    --to=leonardi@redhat.com \
    --cc=anisinha@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=imammedo@redhat.com \
    --cc=joerg.roedel@amd.com \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=osteffen@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sgarzare@redhat.com \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox