All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] igvm: fix byte_offset handling in parameter directives
@ 2026-09-04 11:42 Luigi Leonardi
  2026-09-04 11:42 ` [PATCH v2 1/2] igvm: validate byte_offset before using it " Luigi Leonardi
  2026-09-04 11:42 ` [PATCH v2 2/2] igvm: honor byte_offset when writing memory map, MADT and device tree Luigi Leonardi
  0 siblings, 2 replies; 5+ messages in thread
From: Luigi Leonardi @ 2026-09-04 11:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann, Stefano Garzarella, Ani Sinha, Luigi Leonardi

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_find_param_validate(), 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 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                | 92 +++++++++++++++++++++++++++++++-----------
 include/system/igvm-internal.h |  6 +++
 target/i386/igvm.c             | 12 +++---
 3 files changed, 81 insertions(+), 29 deletions(-)
---
base-commit: d2e570cc0f97b936902a5b1b86b73c0f5998b475
change-id: 20260902-fix_offset-a268cb12aafc

Best regards,
-- 
Luigi Leonardi <leonardi@redhat.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-04 13:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-04 11:42 [PATCH v2 0/2] igvm: fix byte_offset handling in parameter directives Luigi Leonardi
2026-09-04 11:42 ` [PATCH v2 1/2] igvm: validate byte_offset before using it " Luigi Leonardi
2026-09-04 12:55   ` Stefano Garzarella
2026-09-04 11:42 ` [PATCH v2 2/2] igvm: honor byte_offset when writing memory map, MADT and device tree Luigi Leonardi
2026-09-04 13:02   ` Stefano Garzarella

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.