Coconut-SVSM development mailing list
 help / color / mirror / Atom feed
* [svsm-devel] virtio-mmio base address: fw_cfg vs IGVM
@ 2025-02-18 19:04 Oliver Steffen
  2025-02-18 21:01 ` [svsm-devel] [EXTERNAL] " Jon Lange
  2025-02-19 16:24 ` [svsm-devel] " Jörg Rödel
  0 siblings, 2 replies; 3+ messages in thread
From: Oliver Steffen @ 2025-02-18 19:04 UTC (permalink / raw)
  To: svsm-devel

Hi all,

In last week's meeting we talked about communicating the mmio base address
for the virtio driver to the SVSM via Qemu's fw_cfg interface.

This is easy to do, but now I am unsure how we want to
handle hardware information in general.

Currently, the serial ports for logging, gdb, etc. are configured via
the IGVM file.
The address for virtio-mmio is not really a different thing. Shouldn't we use
a common approach?

Using the IGVM file makes these things part of the launch measurement and
requires rebuilding the file if anything needs to change.
Do we want that? Or should it rather be a run-time configuration?

Thanks.

- Oliver


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

* Re: [svsm-devel] [EXTERNAL] virtio-mmio base address: fw_cfg vs IGVM
  2025-02-18 19:04 [svsm-devel] virtio-mmio base address: fw_cfg vs IGVM Oliver Steffen
@ 2025-02-18 21:01 ` Jon Lange
  2025-02-19 16:24 ` [svsm-devel] " Jörg Rödel
  1 sibling, 0 replies; 3+ messages in thread
From: Jon Lange @ 2025-02-18 21:01 UTC (permalink / raw)
  To: Oliver Steffen, svsm-devel@coconut-svsm.dev

The fixed parameters in the IGVM file are intended to communicate information that is generally hypervisor-specific, not information that might vary from one configuration to the next on the same architecture.  For example, Hyper-V always wants diagnostic information from the paravisor to come over COM3, so we select port 3 for the serial console.  The same is true for memory layout, use of vTOM, and other information that is specifically encoded in the IGVM parameter block because Hyper-V wants the same configuration every time.  This makes those parameters somewhat different from virtio configuration.

There is a set of unmeasured parameters that can be passed by an IGVM loader.  The only example today of such a parameter that is used by COCONUT-SVSM is the vCPU count.  The philosophy behind unmeasured IGVM parameters was to allow the loader to pass some set of information that is needed to get the guest far enough through the boot process that it can use a more common interface to query the rest of the hardware state.  In the case of running on QEMU, I would assert that fw_cfg is the primitive interface on top of which everything else is built, so exposing the virtio configuration via fw_cfg is very reasonable.

Note that the Hyper-V hypervisor doesn't use fw_cfg, but it's also unlikely to use virtio for many of its virtual devices (those would be enumerated over vmbus), so I don't foresee a compatibility problem exposing virtio via fw_cfg.  Until we can identify a hardware resource that we believe must be common across hypervisors that do and do not use fw_cfg, I don't think we need to define something else.  Let's wait until we have a concrete use case before we deviate from the interfaces that are already supported in the code.

-Jon

-----Original Message-----
From: Svsm-devel <svsm-devel-bounces@coconut-svsm.dev> On Behalf Of Oliver Steffen
Sent: Tuesday, February 18, 2025 11:05 AM
To: svsm-devel@coconut-svsm.dev
Subject: [EXTERNAL] [svsm-devel] virtio-mmio base address: fw_cfg vs IGVM

[Some people who received this message don't often get email from osteffen@redhat.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Hi all,

In last week's meeting we talked about communicating the mmio base address for the virtio driver to the SVSM via Qemu's fw_cfg interface.

This is easy to do, but now I am unsure how we want to handle hardware information in general.

Currently, the serial ports for logging, gdb, etc. are configured via the IGVM file.
The address for virtio-mmio is not really a different thing. Shouldn't we use a common approach?

Using the IGVM file makes these things part of the launch measurement and requires rebuilding the file if anything needs to change.
Do we want that? Or should it rather be a run-time configuration?

Thanks.

- Oliver

--
Svsm-devel mailing list
Svsm-devel@coconut-svsm.dev
https://mail.8bytes.org/cgi-bin/mailman/listinfo/svsm-devel

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

* Re: [svsm-devel] virtio-mmio base address: fw_cfg vs IGVM
  2025-02-18 19:04 [svsm-devel] virtio-mmio base address: fw_cfg vs IGVM Oliver Steffen
  2025-02-18 21:01 ` [svsm-devel] [EXTERNAL] " Jon Lange
@ 2025-02-19 16:24 ` Jörg Rödel
  1 sibling, 0 replies; 3+ messages in thread
From: Jörg Rödel @ 2025-02-19 16:24 UTC (permalink / raw)
  To: Oliver Steffen; +Cc: svsm-devel, Stefano Garzarella, Gerd Hoffmann

Hi Oliver,

On Tue, Feb 18, 2025 at 08:04:49PM +0100, Oliver Steffen wrote:
> In last week's meeting we talked about communicating the mmio base address
> for the virtio driver to the SVSM via Qemu's fw_cfg interface.
> 
> This is easy to do, but now I am unsure how we want to
> handle hardware information in general.
> 
> Currently, the serial ports for logging, gdb, etc. are configured via
> the IGVM file.

That is right, but I consider IGVM parameters more of a workaround than a real
interface for communicating hardware specifics from the hypervisor to
the SVSM.

For the console it is not really important because a) A serial port can
easily be shared between SVSM and guest OS, and b) Mid-term the SVSM
will not use the serial port in release builds anyway.

So, in addition to what Jon wrote, I don't want to extend the IGVM
parameters for this matter. A "cleanly layered" solution would be much more
complicated (I think we discussed that in the meeting as well):

	1. Let SVSM consume ACPI tables from Hypervisor (e.g. via FWCFG)
	2. SVSM takes the devices it wants
	3. SVSM removes these devices from ACPI tables and forwards the
	   resulting tables to OVMF.

That is much more effort so I think for now all is well and we are okay
with QEMU communicating SVSM specific devices via FWCFG, so that the OS
will not see them.

Regards,

	Joerg

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

end of thread, other threads:[~2025-02-19 16:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-18 19:04 [svsm-devel] virtio-mmio base address: fw_cfg vs IGVM Oliver Steffen
2025-02-18 21:01 ` [svsm-devel] [EXTERNAL] " Jon Lange
2025-02-19 16:24 ` [svsm-devel] " Jörg Rödel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox