[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 40/70] i386/tdx: Skip BIOS shadowing setup
From: |
Xiaoyao Li |
Subject: |
[PATCH v3 40/70] i386/tdx: Skip BIOS shadowing setup |
Date: |
Wed, 15 Nov 2023 02:14:49 -0500 |
TDX doesn't support map different GPAs to same private memory. Thus,
aliasing top 128KB of BIOS as isa-bios is not supported.
On the other hand, TDX guest cannot go to real mode, it can work fine
without isa-bios.
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
---
Changes in v1:
- update commit message and comment to clarify
---
hw/i386/x86.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index fde5467c4750..2f299355a5e3 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -1170,17 +1170,20 @@ void x86_bios_rom_init(MachineState *ms, const char
*default_firmware,
}
g_free(filename);
- /* map the last 128KB of the BIOS in ISA space */
- isa_bios_size = MIN(bios_size, 128 * KiB);
- isa_bios = g_malloc(sizeof(*isa_bios));
- memory_region_init_alias(isa_bios, NULL, "isa-bios", bios,
- bios_size - isa_bios_size, isa_bios_size);
- memory_region_add_subregion_overlap(rom_memory,
- 0x100000 - isa_bios_size,
- isa_bios,
- 1);
- if (!isapc_ram_fw) {
- memory_region_set_readonly(isa_bios, true);
+ /* For TDX, alias different GPAs to same private memory is not supported */
+ if (!is_tdx_vm()) {
+ /* map the last 128KB of the BIOS in ISA space */
+ isa_bios_size = MIN(bios_size, 128 * KiB);
+ isa_bios = g_malloc(sizeof(*isa_bios));
+ memory_region_init_alias(isa_bios, NULL, "isa-bios", bios,
+ bios_size - isa_bios_size, isa_bios_size);
+ memory_region_add_subregion_overlap(rom_memory,
+ 0x100000 - isa_bios_size,
+ isa_bios,
+ 1);
+ if (!isapc_ram_fw) {
+ memory_region_set_readonly(isa_bios, true);
+ }
}
/* map all the bios at the top of memory */
--
2.34.1
- [PATCH v3 30/70] i386/tdx: Validate TD attributes, (continued)
- [PATCH v3 30/70] i386/tdx: Validate TD attributes, Xiaoyao Li, 2023/11/15
- [PATCH v3 31/70] i386/tdx: Allows mrconfigid/mrowner/mrownerconfig for TDX_INIT_VM, Xiaoyao Li, 2023/11/15
- [PATCH v3 32/70] i386/tdx: Implement user specified tsc frequency, Xiaoyao Li, 2023/11/15
- [PATCH v3 33/70] i386/tdx: Set kvm_readonly_mem_enabled to false for TDX VM, Xiaoyao Li, 2023/11/15
- [PATCH v3 34/70] kvm/memory: Introduce the infrastructure to set the default shared/private value, Xiaoyao Li, 2023/11/15
- [PATCH v3 35/70] i386/tdx: Make memory type private by default, Xiaoyao Li, 2023/11/15
- [PATCH v3 36/70] kvm/tdx: Don't complain when converting vMMIO region to shared, Xiaoyao Li, 2023/11/15
- [PATCH v3 37/70] kvm/tdx: Ignore memory conversion to shared of unassigned region, Xiaoyao Li, 2023/11/15
- [PATCH v3 38/70] i386/tdvf: Introduce function to parse TDVF metadata, Xiaoyao Li, 2023/11/15
- [PATCH v3 39/70] i386/tdx: Parse TDVF metadata for TDX VM, Xiaoyao Li, 2023/11/15
- [PATCH v3 40/70] i386/tdx: Skip BIOS shadowing setup,
Xiaoyao Li <=
- [PATCH v3 41/70] i386/tdx: Don't initialize pc.rom for TDX VMs, Xiaoyao Li, 2023/11/15
- [PATCH v3 42/70] i386/tdx: Track mem_ptr for each firmware entry of TDVF, Xiaoyao Li, 2023/11/15
- [PATCH v3 43/70] i386/tdx: Track RAM entries for TDX VM, Xiaoyao Li, 2023/11/15
- [PATCH v3 44/70] headers: Add definitions from UEFI spec for volumes, resources, etc..., Xiaoyao Li, 2023/11/15
- [PATCH v3 45/70] i386/tdx: Setup the TD HOB list, Xiaoyao Li, 2023/11/15
- [PATCH v3 47/70] memory: Introduce memory_region_init_ram_guest_memfd(), Xiaoyao Li, 2023/11/15
- [PATCH v3 46/70] i386/tdx: Add TDVF memory via KVM_TDX_INIT_MEM_REGION, Xiaoyao Li, 2023/11/15
- [PATCH v3 48/70] i386/tdx: register TDVF as private memory, Xiaoyao Li, 2023/11/15
- [PATCH v3 49/70] i386/tdx: Call KVM_TDX_INIT_VCPU to initialize TDX vcpu, Xiaoyao Li, 2023/11/15
- [PATCH v3 50/70] i386/tdx: Finalize TDX VM, Xiaoyao Li, 2023/11/15