qemu/accel
Chao Peng c15e568407 kvm: handle KVM_EXIT_MEMORY_FAULT
Upon an KVM_EXIT_MEMORY_FAULT exit, userspace needs to do the memory
conversion on the RAMBlock to turn the memory into desired attribute,
switching between private and shared.

Currently only KVM_MEMORY_EXIT_FLAG_PRIVATE in flags is valid when
KVM_EXIT_MEMORY_FAULT happens.

Note, KVM_EXIT_MEMORY_FAULT makes sense only when the RAMBlock has
guest_memfd memory backend.

Note, KVM_EXIT_MEMORY_FAULT returns with -EFAULT, so special handling is
added.

When page is converted from shared to private, the original shared
memory can be discarded via ram_block_discard_range(). Note, shared
memory can be discarded only when it's not back'ed by hugetlb because
hugetlb is supposed to be pre-allocated and no need for discarding.

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Co-developed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>

Message-ID: <20240320083945.991426-13-michael.roth@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-04-23 17:35:26 +02:00
..
hvf accel: Do not set CPUState::can_do_io in non-TCG accels 2024-01-19 12:28:59 +01:00
kvm kvm: handle KVM_EXIT_MEMORY_FAULT 2024-04-23 17:35:26 +02:00
qtest meson: Replace CONFIG_SOFTMMU -> CONFIG_SYSTEM_ONLY 2023-06-20 10:01:30 +02:00
stubs RAMBlock: Add support of KVM private guest memfd 2024-04-23 17:35:25 +02:00
tcg accel/tcg: Improve can_do_io management 2024-04-09 07:45:10 -10:00
xen hw/xen: Extract 'xen_igd.h' from 'xen_pt.h' 2024-03-09 18:51:45 +01:00
accel-blocker.c system/cpus: rename qemu_mutex_lock_iothread() to bql_lock() 2024-01-08 10:45:43 -05:00
accel-system.c accel: Rename accel_init_ops_interfaces() to include 'system' 2024-01-19 12:28:59 +01:00
accel-system.h accel: Rename accel_init_ops_interfaces() to include 'system' 2024-01-19 12:28:59 +01:00
accel-target.c accel: Rename accel_init_ops_interfaces() to include 'system' 2024-01-19 12:28:59 +01:00
accel-user.c accel: extend AccelState and AccelClass to user-mode 2021-02-05 10:24:15 -10:00
dummy-cpus.c accel: Do not set CPUState::can_do_io in non-TCG accels 2024-01-19 12:28:59 +01:00
Kconfig i386: xen: fix compilation --without-default-devices 2024-02-16 13:56:09 +01:00
meson.build accel: Rename accel_softmmu* -> accel_system* 2023-10-07 19:02:57 +02:00