Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'kvm-x86-generic-6.17' of https://github.com/kvm-x86/linux into HEAD

KVM generic changes for 6.17

- Add a tracepoint for KVM_SET_MEMORY_ATTRIBUTES to help debug issues related
to private <=> shared memory conversions.

- Drop guest_memfd's .getattr() implementation as the VFS layer will call
generic_fillattr() if inode_operations.getattr is NULL.

+30 -12
+27
include/trace/events/kvm.h
··· 393 393 TP_printk("vcpu %d", __entry->vcpu_id) 394 394 ); 395 395 396 + #ifdef CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES 397 + /* 398 + * @start: Starting address of guest memory range 399 + * @end: End address of guest memory range 400 + * @attr: The value of the attribute being set. 401 + */ 402 + TRACE_EVENT(kvm_vm_set_mem_attributes, 403 + TP_PROTO(gfn_t start, gfn_t end, unsigned long attr), 404 + TP_ARGS(start, end, attr), 405 + 406 + TP_STRUCT__entry( 407 + __field(gfn_t, start) 408 + __field(gfn_t, end) 409 + __field(unsigned long, attr) 410 + ), 411 + 412 + TP_fast_assign( 413 + __entry->start = start; 414 + __entry->end = end; 415 + __entry->attr = attr; 416 + ), 417 + 418 + TP_printk("%#016llx -- %#016llx [0x%lx]", 419 + __entry->start, __entry->end, __entry->attr) 420 + ); 421 + #endif /* CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES */ 422 + 396 423 TRACE_EVENT(kvm_unmap_hva_range, 397 424 TP_PROTO(unsigned long start, unsigned long end), 398 425 TP_ARGS(start, end),
-11
virt/kvm/guest_memfd.c
··· 382 382 #endif 383 383 }; 384 384 385 - static int kvm_gmem_getattr(struct mnt_idmap *idmap, const struct path *path, 386 - struct kstat *stat, u32 request_mask, 387 - unsigned int query_flags) 388 - { 389 - struct inode *inode = path->dentry->d_inode; 390 - 391 - generic_fillattr(idmap, request_mask, inode, stat); 392 - return 0; 393 - } 394 - 395 385 static int kvm_gmem_setattr(struct mnt_idmap *idmap, struct dentry *dentry, 396 386 struct iattr *attr) 397 387 { 398 388 return -EINVAL; 399 389 } 400 390 static const struct inode_operations kvm_gmem_iops = { 401 - .getattr = kvm_gmem_getattr, 402 391 .setattr = kvm_gmem_setattr, 403 392 }; 404 393
+3 -1
virt/kvm/kvm_main.c
··· 2558 2558 2559 2559 entry = attributes ? xa_mk_value(attributes) : NULL; 2560 2560 2561 + trace_kvm_vm_set_mem_attributes(start, end, attributes); 2562 + 2561 2563 mutex_lock(&kvm->slots_lock); 2562 2564 2563 - /* Nothing to do if the entire range as the desired attributes. */ 2565 + /* Nothing to do if the entire range has the desired attributes. */ 2564 2566 if (kvm_range_has_memory_attributes(kvm, start, end, ~0, attributes)) 2565 2567 goto out_unlock; 2566 2568