(late reply, sorry) François Diakhate wrote:
[Sorry, I realized I forgot to check style, here is the fixed patch]Make sure that kvm_free_physmem_slot also frees the VM memory if it was allocated by the kernel. /* * Free any memory in @free but not in @dont. */ -static void kvm_free_physmem_slot(struct kvm_memory_slot *free, +static void kvm_free_physmem_slot(struct kvm *kvm, + struct kvm_memory_slot *free, struct kvm_memory_slot *dont) { + if (!dont || free->userspace_addr != dont->userspace_addr) { + struct kvm_userspace_memory_region mem = { + .slot = memslot_id(kvm, free), + .guest_phys_addr = free->base_gfn << PAGE_SHIFT, + .memory_size = 0, + .flags = 0, + }; + kvm_arch_set_memory_region(kvm, &mem, *free, free->user_alloc); + } + if (!dont || free->rmap != dont->rmap)
What happens here if the both free and dont have nonzero, differnt ->userspace_addr values? Is is even possible?
Also, the call chain is fishy. set_memory_region calls free_physmem_slot which calls arch_set_memory_region. This is turning into pasta.
-- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
