diff options
author | 2024-03-20 03:39:08 -0500 | |
---|---|---|
committer | 2024-04-23 17:35:26 +0200 | |
commit | c15e5684071d93174e446be318f49d8d59b15d6d (patch) | |
tree | 3b5ab008bf4a4231b5aa45446963ef2c3744516b /plugins/api.c | |
parent | physmem: Introduce ram_block_discard_guest_memfd_range() (diff) | |
download | qemu-c15e5684071d93174e446be318f49d8d59b15d6d.tar.xz qemu-c15e5684071d93174e446be318f49d8d59b15d6d.zip |
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>
Diffstat (limited to 'plugins/api.c')
0 files changed, 0 insertions, 0 deletions