mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
i386/tdx: Don't initialize pc.rom for TDX VMs
For TDX, the address below 1MB are entirely general RAM. No need to initialize pc.rom memory region for TDs. Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Link: https://lore.kernel.org/r/20250508150002.689633-20-xiaoyao.li@intel.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
cb5d65a854
commit
49b1f0f812
1 changed files with 16 additions and 13 deletions
|
@ -44,6 +44,7 @@
|
||||||
#include "system/xen.h"
|
#include "system/xen.h"
|
||||||
#include "system/reset.h"
|
#include "system/reset.h"
|
||||||
#include "kvm/kvm_i386.h"
|
#include "kvm/kvm_i386.h"
|
||||||
|
#include "kvm/tdx.h"
|
||||||
#include "hw/xen/xen.h"
|
#include "hw/xen/xen.h"
|
||||||
#include "qobject/qlist.h"
|
#include "qobject/qlist.h"
|
||||||
#include "qemu/error-report.h"
|
#include "qemu/error-report.h"
|
||||||
|
@ -976,6 +977,7 @@ void pc_memory_init(PCMachineState *pcms,
|
||||||
/* Initialize PC system firmware */
|
/* Initialize PC system firmware */
|
||||||
pc_system_firmware_init(pcms, rom_memory);
|
pc_system_firmware_init(pcms, rom_memory);
|
||||||
|
|
||||||
|
if (!is_tdx_vm()) {
|
||||||
option_rom_mr = g_malloc(sizeof(*option_rom_mr));
|
option_rom_mr = g_malloc(sizeof(*option_rom_mr));
|
||||||
if (machine_require_guest_memfd(machine)) {
|
if (machine_require_guest_memfd(machine)) {
|
||||||
memory_region_init_ram_guest_memfd(option_rom_mr, NULL, "pc.rom",
|
memory_region_init_ram_guest_memfd(option_rom_mr, NULL, "pc.rom",
|
||||||
|
@ -991,6 +993,7 @@ void pc_memory_init(PCMachineState *pcms,
|
||||||
PC_ROM_MIN_VGA,
|
PC_ROM_MIN_VGA,
|
||||||
option_rom_mr,
|
option_rom_mr,
|
||||||
1);
|
1);
|
||||||
|
}
|
||||||
|
|
||||||
fw_cfg = fw_cfg_arch_create(machine,
|
fw_cfg = fw_cfg_arch_create(machine,
|
||||||
x86ms->boot_cpus, x86ms->apic_id_limit);
|
x86ms->boot_cpus, x86ms->apic_id_limit);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue