[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 34/66] kvm/tdx: Don't complain when converting vMMIO region to
|
From: |
Xiaoyao Li |
|
Subject: |
[PATCH v4 34/66] kvm/tdx: Don't complain when converting vMMIO region to shared |
|
Date: |
Wed, 24 Jan 2024 22:22:56 -0500 |
From: Isaku Yamahata <isaku.yamahata@intel.com>
Because vMMIO region needs to be shared region, guest TD may explicitly
convert such region from private to shared. Don't complain such
conversion.
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
---
accel/kvm/kvm-all.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 094ce7695e16..e26e9121b30d 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -2975,9 +2975,22 @@ static int kvm_convert_memory(hwaddr start, hwaddr size,
bool to_private)
ret = ram_block_discard_guest_memfd_range(rb, offset, size);
}
} else {
- error_report("Convert non guest_memfd backed memory region "
- "(0x%"HWADDR_PRIx" ,+ 0x%"HWADDR_PRIx") to %s",
- start, size, to_private ? "private" : "shared");
+ /*
+ * Because vMMIO region must be shared, guest TD may convert vMMIO
+ * region to shared explicitly. Don't complain such case. See
+ * memory_region_type() for checking if the region is MMIO region.
+ */
+ if (!to_private &&
+ !memory_region_is_ram(mr) &&
+ !memory_region_is_ram_device(mr) &&
+ !memory_region_is_rom(mr) &&
+ !memory_region_is_romd(mr)) {
+ ret = 0;
+ } else {
+ error_report("Convert non guest_memfd backed memory region "
+ "(0x%"HWADDR_PRIx" ,+ 0x%"HWADDR_PRIx") to %s",
+ start, size, to_private ? "private" : "shared");
+ }
}
memory_region_unref(section.mr);
--
2.34.1
- [PATCH v4 23/66] kvm: Introduce kvm_arch_pre_create_vcpu(), (continued)
- [PATCH v4 23/66] kvm: Introduce kvm_arch_pre_create_vcpu(), Xiaoyao Li, 2024/01/24
- [PATCH v4 24/66] i386/tdx: Initialize TDX before creating TD vcpus, Xiaoyao Li, 2024/01/24
- [PATCH v4 25/66] i386/tdx: Add property sept-ve-disable for tdx-guest object, Xiaoyao Li, 2024/01/24
- [PATCH v4 27/66] i386/tdx: Wire CPU features up with attributes of TD guest, Xiaoyao Li, 2024/01/24
- [PATCH v4 28/66] i386/tdx: Validate TD attributes, Xiaoyao Li, 2024/01/24
- [PATCH v4 26/66] i386/tdx: Make sept_ve_disable set by default, Xiaoyao Li, 2024/01/24
- [PATCH v4 29/66] i386/tdx: Support user configurable mrconfigid/mrowner/mrownerconfig, Xiaoyao Li, 2024/01/24
- [PATCH v4 30/66] i386/tdx: Implement user specified tsc frequency, Xiaoyao Li, 2024/01/24
- [PATCH v4 31/66] i386/tdx: Set kvm_readonly_mem_enabled to false for TDX VM, Xiaoyao Li, 2024/01/24
- [PATCH v4 32/66] kvm/memory: Introduce the infrastructure to set the default shared/private value, Xiaoyao Li, 2024/01/24
- [PATCH v4 34/66] kvm/tdx: Don't complain when converting vMMIO region to shared,
Xiaoyao Li <=
- [PATCH v4 33/66] i386/tdx: Make memory type private by default, Xiaoyao Li, 2024/01/24
- [PATCH v4 36/66] i386/tdvf: Introduce function to parse TDVF metadata, Xiaoyao Li, 2024/01/24
- [PATCH v4 35/66] kvm/tdx: Ignore memory conversion to shared of unassigned region, Xiaoyao Li, 2024/01/24
- [PATCH v4 37/66] i386/tdx: Parse TDVF metadata for TDX VM, Xiaoyao Li, 2024/01/24
- [PATCH v4 38/66] i386/tdx: Skip BIOS shadowing setup, Xiaoyao Li, 2024/01/24
- [PATCH v4 39/66] i386/tdx: Don't initialize pc.rom for TDX VMs, Xiaoyao Li, 2024/01/24
- [PATCH v4 40/66] i386/tdx: Track mem_ptr for each firmware entry of TDVF, Xiaoyao Li, 2024/01/24
- [PATCH v4 42/66] headers: Add definitions from UEFI spec for volumes, resources, etc..., Xiaoyao Li, 2024/01/24