hw/i386/pc_sysfw: stub out x86_firmware_configure
x86_firmware_configure requires ovmf support. Add a stub for this function call for cases where OVMF is not supported. Reported-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Ani Sinha <anisinha@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Tested-by: Michael Tokarev <mjt@tls.msk.ru> Message-ID: <20260319122137.142178-2-anisinha@redhat.com> Tested-by: Xudong Hao <xudong.hao@intel.com> [PMD: Remove "kvm/tdx.h" include line] Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Ani Sinha committed
Mar 19, 2026 at 17:51 UTC
c78bac1e6756ee7308e38d6458ab68797da50888
3 files changed
+38
-32
hw/i386/pc_sysfw.c
-32
@@ -37,7 +37,6 @@
37
#include "hw/block/flash.h"
38
#include "system/kvm.h"
39
#include "target/i386/sev.h"
40
-#include "kvm/tdx.h"
40
41
#define FLASH_SECTOR_SIZE 4096
42
@@ -283,34 +282,3 @@ void pc_system_firmware_init(PCMachineState *pcms,
282
}
283
}
284
}
286
-
287
-void x86_firmware_configure(hwaddr gpa, void *ptr, int size)
288
-{
289
- int ret;
290
-
291
- /*
292
- * OVMF places a GUIDed structures in the flash, so
293
- * search for them
294
- */
295
- pc_system_parse_ovmf_flash(ptr, size);
296
-
297
- if (sev_enabled()) {
298
-
299
- /* Copy the SEV metadata table (if it exists) */
300
- pc_system_parse_sev_metadata(ptr, size);
301
-
302
- ret = sev_es_save_reset_vector(ptr, size);
303
- if (ret) {
304
- error_report("failed to locate and/or save reset vector");
305
- exit(1);
306
- }
307
-
308
- sev_encrypt_flash(gpa, ptr, size, &error_fatal);
309
- } else if (is_tdx_vm()) {
310
- ret = tdx_parse_tdvf(ptr, size);
311
- if (ret) {
312
- error_report("failed to parse TDVF for TDX VM");
313
- exit(1);
314
- }
315
- }
316
-}
hw/i386/pc_sysfw_ovmf-stubs.c
+5
@@ -24,3 +24,8 @@ void pc_system_parse_ovmf_flash(uint8_t *flash_ptr, size_t flash_size)
24
{
25
g_assert_not_reached();
26
}
27
+
28
+void x86_firmware_configure(hwaddr gpa, void *ptr, int size)
29
+{
30
+ g_assert_not_reached();
31
+}
hw/i386/pc_sysfw_ovmf.c
+33
@@ -28,6 +28,8 @@
28
#include "hw/i386/pc.h"
29
#include "exec/target_page.h"
30
#include "cpu.h"
31
+#include "target/i386/sev.h"
32
+#include "kvm/tdx.h"
33
34
#define OVMF_TABLE_FOOTER_GUID "96b582de-1fb2-45f7-baea-a366c55a082d"
35
@@ -160,3 +162,34 @@ bool pc_system_ovmf_table_find(const char *entry, uint8_t **data,
162
}
163
return false;
164
}
165
+
166
+void x86_firmware_configure(hwaddr gpa, void *ptr, int size)
167
+{
168
+ int ret;
169
+
170
+ /*
171
+ * OVMF places a GUIDed structures in the flash, so
172
+ * search for them
173
+ */
174
+ pc_system_parse_ovmf_flash(ptr, size);
175
+
176
+ if (sev_enabled()) {
177
+
178
+ /* Copy the SEV metadata table (if it exists) */
179
+ pc_system_parse_sev_metadata(ptr, size);
180
+
181
+ ret = sev_es_save_reset_vector(ptr, size);
182
+ if (ret) {
183
+ error_report("failed to locate and/or save reset vector");
184
+ exit(1);
185
+ }
186
+
187
+ sev_encrypt_flash(gpa, ptr, size, &error_fatal);
188
+ } else if (is_tdx_vm()) {
189
+ ret = tdx_parse_tdvf(ptr, size);
190
+ if (ret) {
191
+ error_report("failed to parse TDVF for TDX VM");
192
+ exit(1);
193
+ }
194
+ }
195
+}