From: Luigi Leonardi <leonardi@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>,
Stefano Garzarella <sgarzare@redhat.com>,
Ani Sinha <anisinha@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Zhao Liu <zhao1.liu@intel.com>,
qemu-stable@nongnu.org, Luigi Leonardi <leonardi@redhat.com>
Subject: [PATCH v3 0/2] igvm: fix byte_offset handling in parameter directives
Date: Mon, 07 Sep 2026 16:58:54 +0200 [thread overview]
Message-ID: <20260907-fix_offset-v3-0-bcffcefc0985@redhat.com> (raw)
Several IGVM directives (memory map, vp-count, environment info, MADT,
device tree) _can_ place their data at a byte_offset within a shared
parameter area, letting multiple parameters be packed into one area.
Patch 1 introduces qigvm_get_param_data(), which looks up a
parameter area and validates that byte_offset falls within it in one
step, and uses it in the vp-count and environment-info handlers, which
already relied on byte_offset.
Patch 2 fixes the memory map, MADT and device tree handlers, which
ignored byte_offset entirely and always wrote at the start of the
buffer, potentially corrupting earlier data when several parameters
share an area.
Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
---
Changes in v3:
- Renamed the function to `qigvm_get_param_data`. [Stefano]
- `qigvm_get_param_data` now returns the data pointer directly [Stefano]
- Added fixes tags. [Stefano]
- Renamed variables to param_data and param_size [Stefano]
- Link to v2: https://lore.kernel.org/qemu-devel/20260904-fix_offset-v2-0-f5bb4cf6d4b0@redhat.com
Changes in v2:
- Inverted commit order: first I introduce the helper and use it where
necessary, then in commit 2 I handle the `offset`. [Stefano]
- The helper now returns data and size, that already consider the byte
offset [Stefano]
- Link to v1: https://lore.kernel.org/qemu-devel/20260902-fix_offset-v1-0-04b18f7595b2@redhat.com
---
Luigi Leonardi (2):
igvm: validate byte_offset before using it in parameter directives
igvm: honor byte_offset when writing memory map, MADT and device tree
backends/igvm.c | 96 ++++++++++++++++++++++++++++++++----------
include/system/igvm-internal.h | 6 +++
target/i386/igvm.c | 13 +++---
3 files changed, 86 insertions(+), 29 deletions(-)
---
base-commit: d2e570cc0f97b936902a5b1b86b73c0f5998b475
change-id: 20260902-fix_offset-a268cb12aafc
Best regards,
--
Luigi Leonardi <leonardi@redhat.com>
next reply other threads:[~2026-09-07 14:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 14:58 Luigi Leonardi [this message]
2026-09-07 14:58 ` [PATCH v3 1/2] igvm: validate byte_offset before using it in parameter directives Luigi Leonardi
2026-09-10 9:35 ` Stefano Garzarella
2026-09-07 14:58 ` [PATCH v3 2/2] igvm: honor byte_offset when writing memory map, MADT and device tree Luigi Leonardi
2026-09-10 9:47 ` Stefano Garzarella
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=20260907-fix_offset-v3-0-bcffcefc0985@redhat.com \
--to=leonardi@redhat.com \
--cc=anisinha@redhat.com \
--cc=kraxel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.