You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/accel/kvm
Xiaoyao Li 00c0911c68 accel/kvm: Set guest_memfd_offset to non-zero value only when guest_memfd is valid
Current QEMU unconditionally sets the guest_memfd_offset of KVMSlot in
kvm_set_phys_mem(), which leads to the trace of kvm_set_user_memory looks:

kvm_set_user_memory AddrSpace#0 Slot#4 flags=0x2 gpa=0xe0000 size=0x20000 ua=0x7f5840de0000 guest_memfd=-1 guest_memfd_offset=0x3e0000 ret=0

It's confusing that the guest_memfd_offset has a non-zero value while
the guest_memfd is invalid (-1).

Change to only set guest_memfd_offset when guest_memfd is valid and
leave it as 0 when no valid guest_memfd.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://lore.kernel.org/r/20250728115707.1374614-4-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 weeks ago
..
kvm-accel-ops.c accel: make all calls to qemu_process_cpu_events look the same 2 weeks ago
kvm-all.c accel/kvm: Set guest_memfd_offset to non-zero value only when guest_memfd is valid 2 weeks ago
kvm-cpus.h accel/kvm: Remove unused 'system/cpus.h' header in kvm-cpus.h 7 months ago
meson.build target/i386/kvm: Restrict SEV stubs to x86 architecture 4 years ago
trace-events KVM: Dynamic sized kvm memslots array 12 months ago
trace.h trace: switch position of headers to what Meson requires 5 years ago