qemu/target/i386
Tom Lendacky 4cdc489eb9 i386/kvm: Prefault memory on page state change
A page state change is typically followed by an access of the page(s) and
results in another VMEXIT in order to map the page into the nested page
table. Depending on the size of page state change request, this can
generate a number of additional VMEXITs. For example, under SNP, when
Linux is utilizing lazy memory acceptance, memory is typically accepted in
4M chunks. A page state change request is submitted to mark the pages as
private, followed by validation of the memory. Since the guest_memfd
currently only supports 4K pages, each page validation will result in
VMEXIT to map the page, resulting in 1024 additional exits.

When performing a page state change, invoke KVM_PRE_FAULT_MEMORY for the
size of the page state change in order to pre-map the pages and avoid the
additional VMEXITs. This helps speed up boot times.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/f5411c42340bd2f5c14972551edb4e959995e42b.1743193824.git.thomas.lendacky@amd.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-06-06 14:32:54 +02:00
..
emulate target/i386/emulate: more lflags cleanups 2025-05-27 19:21:19 +02:00
hvf i386/hvf: Make CPUID_HT supported 2025-05-20 08:04:18 +02:00
kvm i386/kvm: Prefault memory on page state change 2025-06-06 14:32:54 +02:00
nvmm qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
tcg * target/i386/kvm: Intel TDX support 2025-05-30 11:41:07 -04:00
whpx qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
arch_dump.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
arch_memory_mapping.c exec/cpu-all: remove system/memory include 2025-04-23 15:04:57 -07:00
confidential-guest.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
confidential-guest.h i386/cgs: Introduce x86_confidential_guest_check_features() 2025-05-28 19:35:55 +02:00
cpu-apic.c include/system: Move exec/address-spaces.h to system/address-spaces.h 2025-04-23 14:08:21 -07:00
cpu-dump.c target/i386: remove CC_OP_CLR 2024-10-31 18:28:33 +01:00
cpu-internal.h include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
cpu-param.h tcg: Remove the TCG_GUEST_DEFAULT_MO definition globally 2025-04-23 15:07:32 -07:00
cpu-qom.h target: Move ArchCPUClass definition to 'cpu.h' 2023-11-07 13:08:48 +01:00
cpu-system.c qapi: make most CPU commands unconditionally available 2025-05-28 18:55:50 +02:00
cpu.c target/i386: Add the immediate form MSR access instruction support 2025-06-03 22:42:46 +02:00
cpu.h target/i386: Add the immediate form MSR access instruction support 2025-06-03 22:42:46 +02:00
gdbstub.c target/i386/gdbstub: Expose orig_ax 2024-10-13 10:05:51 -07:00
helper.c tcg: Define INSN_START_WORDS as constant 3 2025-05-01 07:37:13 -07:00
helper.h target/i386: optimize computation of ZF from CC_OP_DYNAMIC 2024-10-31 18:28:33 +01:00
host-cpu.c i386/tdx: Validate phys_bits against host value 2025-05-28 19:35:55 +02:00
host-cpu.h i386/tdx: Validate phys_bits against host value 2025-05-28 19:35:55 +02:00
Kconfig i386: select correct components for no-board build 2024-05-10 15:45:15 +02:00
machine.c hw/i386/x86: Remove X86MachineClass::save_tsc_khz field 2025-05-30 09:52:08 +02:00
meson.build target/i386: add a directory for x86 instruction emulator 2025-04-17 18:23:26 +02:00
monitor.c qapi: remove the misc-target.json file 2025-05-28 18:54:18 +02:00
ops_sse.h target/i386: set CC_OP in helpers if they want CC_OP_EFLAGS 2024-05-25 13:28:01 +02:00
sev-system-stub.c qapi: make SEV commands unconditionally available 2025-05-28 18:54:16 +02:00
sev.c * target/i386/kvm: Intel TDX support 2025-05-30 11:41:07 -04:00
sev.h target/i386/sev: Reduce system specific declarations 2024-12-20 17:44:56 +01:00
svm.h target/i386: check intercept for XSETBV 2023-10-17 15:20:53 +02:00
trace-events target/i386/sev: Use size_t for object sizes 2024-06-28 19:26:54 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
xsave_helper.c exec/cpu-all: remove tswap include 2025-04-23 15:04:57 -07:00