From: Ani Sinha <anisinha@redhat.com>
To: Ani Sinha <anisinha@redhat.com>, Gerd Hoffman <kraxel@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Cornelia Huck <cohuck@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: ani@anisinha.ca, agraf@csgraf.de, graf@amazon.com, qemu-devel@nongnu.org
Subject: [PATCH v6 06/11] hw/misc/vmlaunchupdate: add api header
Date: Mon, 17 Aug 2026 19:50:01 +0530 [thread overview]
Message-ID: <20260817142010.80693-7-anisinha@redhat.com> (raw)
In-Reply-To: <20260817142010.80693-1-anisinha@redhat.com>
Add a separate header file for guest usable api definitions.
CC: Alex Graf <graf@amazon.com>
CC: Gerd Hoffman <kraxel@redhat.com>
Reviewed-by: Alexander Graf <graf@amazon.com>
Signed-off-by: Ani Sinha <anisinha@redhat.com>
---
.../standard-headers/misc/vmlaunchupdate.h | 102 ++++++++++++++++++
1 file changed, 102 insertions(+)
create mode 100644 include/standard-headers/misc/vmlaunchupdate.h
diff --git a/include/standard-headers/misc/vmlaunchupdate.h b/include/standard-headers/misc/vmlaunchupdate.h
new file mode 100644
index 0000000000..66daed701e
--- /dev/null
+++ b/include/standard-headers/misc/vmlaunchupdate.h
@@ -0,0 +1,102 @@
+/*
+ * Guest driven VM launch state update device via IGVM.
+ * The definitions in this header defines the API for the hypervisor interface.
+ * For details and specification, please look at docs/specs/vmlaunchupdate.rst.
+ *
+ * Copyright (C) 2026 Red Hat, Inc.
+ *
+ * Authors: Ani Sinha <anisinha@redhat.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ */
+#ifndef VMLAUNCHUPDATE_API_H
+#define VMLAUNCHUPDATE_API_H
+
+/* fw-cfg file definition */
+#define FILE_VMLAUNCHUPDATE "etc/vmlaunchupdate"
+
+/* version */
+#define VM_LAUNCHUPDATE_VERSION 0x01
+
+/* format bits, used by both 'capabilities' and 'control' */
+
+/* igvm */
+#define VM_LAUNCHUPDATE_FORMAT_IGVM (1ULL << 32)
+
+/* 'control' field bits */
+
+/* disable vmlaunchupdate interface */
+#define VM_LAUNCHUPDATE_CTL_DISABLE (1 << 0)
+/* revert to the original host provided igvm */
+#define VM_LAUNCHUPDATE_CTL_HOST_IGVM (1 << 1)
+
+/* The combination of the above two ctl interfaces work as
+ * follows:
+ *
+ * A) CTL_HOST_IGVM=off CTL_DISABLE=off
+ *
+ * Supplied IGVM file replaces the firmware permanently. Updating the
+ * firmware again is possible.
+ *
+ * B) CTL_HOST_IGVM=off CTL_DISABLE=on
+ *
+ * Supplied IGVM file replaces the firmware permanently. Updating the
+ * firmware again is not possible.
+ *
+ * C) CTL_HOST_IGVM=on CTL_DISABLE=off
+ *
+ * Supplied IGVM file replaces the firmware for one reset. Resetting
+ * again will switch back to the original firmware. Updating the
+ * firmware again is possible.
+ *
+ * D) CTL_HOST_IGVM=on CTL_DISABLE=on
+ *
+ * Supplied IGVM file replaces the firmware for one reset. Resetting
+ * again will switch back to the original firmware. Updating the
+ * firmware again is NOT possible.
+ *
+ */
+
+/* status code */
+enum VMLaunchUpdateStatus {
+ VM_LAUNCHUPDATE_SUCCESS,
+ VM_LAUNCHUPDATE_LOAD_FAIL,
+ VM_LAUNCHUPDATE_NOT_IGVM_INIT,
+};
+
+typedef struct QEMU_PACKED {
+ /* api version */
+ uint16_t version;
+
+ /*
+ * The guest can read this in order to determine if loading new IGVM
+ * succeeded.
+ */
+ uint16_t status;
+
+ uint32_t _padding;
+
+ /* VMM capabilities, read-only. */
+ uint64_t capabilities;
+ /* control bits, see VMFWUPDATE_CTL_* */
+ uint64_t control;
+
+ /*
+ * address and size of the IGVM image. Will be cleared when
+ * the write completes successfully and IGVM file is correctly parsed.
+ */
+ uint64_t fw_image_addr;
+ uint64_t fw_image_size;
+
+ /*
+ * address + size of opaque blob. The guest can use this to pass on
+ * information, for example which memory region the linux kernel has been
+ * loaded to. writable, will be kept intact on firmware update.
+ */
+ uint64_t opaque_addr;
+ uint64_t opaque_size;
+
+} VMLaunchUpdate;
+
+#endif
--
2.42.0
next prev parent reply other threads:[~2026-08-17 14:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 14:19 [PATCH v6 00/11] Introducing guest driven VM launch update mechanism (BYOF interface) Ani Sinha
2026-08-17 14:19 ` [PATCH v6 01/11] igvm: store IgvmCfg pointer in QIgvm Ani Sinha
2026-08-17 14:19 ` [PATCH v6 02/11] igvm: track memory regions Ani Sinha
2026-08-17 14:19 ` [PATCH v6 03/11] igvm: cleanup " Ani Sinha
2026-08-17 14:19 ` [PATCH v6 04/11] system/memory: add a tracepoint for memory_region_finalize Ani Sinha
2026-08-17 14:20 ` [PATCH v6 05/11] backends/igvm: add a tracepoint for qigvm_cleanup_memory Ani Sinha
2026-08-17 14:20 ` Ani Sinha [this message]
2026-08-18 9:22 ` [PATCH v6 06/11] hw/misc/vmlaunchupdate: add api header Gerd Hoffman
2026-08-19 4:31 ` Ani Sinha
2026-08-17 14:20 ` [PATCH v6 07/11] hw/misc/vmlaunchupdate: Introduce hypervisor fw-cfg interface support Ani Sinha
2026-08-17 14:20 ` [PATCH v6 08/11] docs/spec: Add a specification document for vm-launch-update device Ani Sinha
2026-08-17 14:20 ` [PATCH v6 09/11] tests/qtest: Add small igvm files for testing purpose Ani Sinha
2026-08-17 14:20 ` [PATCH v6 10/11] Add functional and unit tests for the vm-launch-update device Ani Sinha
2026-08-17 14:20 ` [PATCH v6 11/11] Update MAINTAINERS Ani Sinha
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=20260817142010.80693-7-anisinha@redhat.com \
--to=anisinha@redhat.com \
--cc=agraf@csgraf.de \
--cc=ani@anisinha.ca \
--cc=cohuck@redhat.com \
--cc=graf@amazon.com \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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.