Commit d2845628 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

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.
parents f05efcfe 87d4fbf4
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -393,6 +393,33 @@ TRACE_EVENT(kvm_dirty_ring_exit,
	TP_printk("vcpu %d", __entry->vcpu_id)
);

#ifdef CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES
/*
 * @start:	Starting address of guest memory range
 * @end:	End address of guest memory range
 * @attr:	The value of the attribute being set.
 */
TRACE_EVENT(kvm_vm_set_mem_attributes,
	TP_PROTO(gfn_t start, gfn_t end, unsigned long attr),
	TP_ARGS(start, end, attr),

	TP_STRUCT__entry(
		__field(gfn_t,		start)
		__field(gfn_t,		end)
		__field(unsigned long,	attr)
	),

	TP_fast_assign(
		__entry->start		= start;
		__entry->end		= end;
		__entry->attr		= attr;
	),

	TP_printk("%#016llx -- %#016llx [0x%lx]",
		  __entry->start, __entry->end, __entry->attr)
);
#endif /* CONFIG_KVM_GENERIC_MEMORY_ATTRIBUTES */

TRACE_EVENT(kvm_unmap_hva_range,
	TP_PROTO(unsigned long start, unsigned long end),
	TP_ARGS(start, end),
+0 −11
Original line number Diff line number Diff line
@@ -382,23 +382,12 @@ static const struct address_space_operations kvm_gmem_aops = {
#endif
};

static int kvm_gmem_getattr(struct mnt_idmap *idmap, const struct path *path,
			    struct kstat *stat, u32 request_mask,
			    unsigned int query_flags)
{
	struct inode *inode = path->dentry->d_inode;

	generic_fillattr(idmap, request_mask, inode, stat);
	return 0;
}

static int kvm_gmem_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
			    struct iattr *attr)
{
	return -EINVAL;
}
static const struct inode_operations kvm_gmem_iops = {
	.getattr	= kvm_gmem_getattr,
	.setattr	= kvm_gmem_setattr,
};

+3 −1
Original line number Diff line number Diff line
@@ -2558,9 +2558,11 @@ static int kvm_vm_set_mem_attributes(struct kvm *kvm, gfn_t start, gfn_t end,

	entry = attributes ? xa_mk_value(attributes) : NULL;

	trace_kvm_vm_set_mem_attributes(start, end, attributes);

	mutex_lock(&kvm->slots_lock);

	/* Nothing to do if the entire range as the desired attributes. */
	/* Nothing to do if the entire range has the desired attributes. */
	if (kvm_range_has_memory_attributes(kvm, start, end, ~0, attributes))
		goto out_unlock;