qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Refactor x86_load_linux and pass RNG seed via setup_data entry
@ 2022-07-21 12:29 Paolo Bonzini
  2022-07-21 12:29 ` [PATCH 1/4] hw/i386: extract PVH load to a separate function Paolo Bonzini
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Paolo Bonzini @ 2022-07-21 12:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Jason A . Donenfeld, Michael S . Tsirkin, Eduardo Habkost,
	Philippe Mathieu-Daudé, Laurent Vivier

As mentioned in the reviews of Jason's patches, the fw_cfg data, or at
least its structure including the size, is part of the guest ABI and
must match across two sides of migration.

It would be possible to handle this with some duplicated code between
the rng seed and DTB handling, but the conditionals to handle the linked
list would be ugly.  Unfortunately the code of x86_load_linux has no
data structures available, it's all of a jumble of local variables.
Hence the first two and largest patches in this series, which remove all
non-Linux code from the function and move the local variables to a struct
as necessary.  The function was long overdue for some cleanup anyway.

With this in place, adding the seed setup_data entry is just a
couple lines of code, plus the scaffolding for a new machine property
"linuxboot-seed".  The property supports on/off/auto values, where "auto"
disables/enables depending on the kernel support for setup data (which was
added in 2.6.26); "on" currently fails when starting with an old kernel,
and probably it should also fail when starting a PVH or multiboot kernel.

Paolo

Jason A. Donenfeld (1):
  hw/i386: pass RNG seed via setup_data entry

Paolo Bonzini (3):
  hw/i386: extract PVH load to a separate function
  hw/i386: define a struct for Linux boot protocol data
  hw/i386: extract handling of setup data linked list

 hw/i386/pc.c                                 |   1 +
 hw/i386/x86.c                                | 303 +++++++++++--------
 include/hw/i386/x86.h                        |   2 +
 include/standard-headers/asm-x86/bootparam.h |   1 +
 4 files changed, 185 insertions(+), 122 deletions(-)

-- 
2.36.1



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

end of thread, other threads:[~2022-07-21 15:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-21 12:29 [PATCH 0/4] Refactor x86_load_linux and pass RNG seed via setup_data entry Paolo Bonzini
2022-07-21 12:29 ` [PATCH 1/4] hw/i386: extract PVH load to a separate function Paolo Bonzini
2022-07-21 12:29 ` [PATCH 2/4] hw/i386: define a struct for Linux boot protocol data Paolo Bonzini
2022-07-21 12:29 ` [PATCH 3/4] hw/i386: extract handling of setup data linked list Paolo Bonzini
2022-07-21 12:29 ` [PATCH 4/4] hw/i386: pass RNG seed via setup_data entry Paolo Bonzini
2022-07-21 13:02   ` Jason A. Donenfeld
2022-07-21 14:47   ` Michael S. Tsirkin
2022-07-21 15:15     ` Jason A. Donenfeld
2022-07-21 14:52 ` [PATCH 0/4] Refactor x86_load_linux and " Michael S. Tsirkin
2022-07-21 15:11   ` Jason A. Donenfeld
2022-07-21 15:29     ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).