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

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

Common KVM changes for 6.3:

 - Account allocations in generic kvm_arch_alloc_vm()

 - Fix a typo and a stale comment

 - Fix a memory leak if coalesced MMIO unregistration fails
parents 7cb79f43 5bad5d55
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -324,7 +324,7 @@ struct kvm_vcpu {
#endif
	int cpu;
	int vcpu_id; /* id given by userspace at creation */
	int vcpu_idx; /* index in kvm->vcpus array */
	int vcpu_idx; /* index into kvm->vcpu_array */
	int ____srcu_idx; /* Don't use this directly.  You've been warned. */
#ifdef CONFIG_PROVE_RCU
	int srcu_depth;
@@ -1353,7 +1353,7 @@ void kvm_arch_vcpu_unblocking(struct kvm_vcpu *vcpu);
bool kvm_vcpu_wake_up(struct kvm_vcpu *vcpu);
void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
int kvm_vcpu_yield_to(struct kvm_vcpu *target);
void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu, bool usermode_vcpu_not_eligible);
void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu, bool yield_to_kernel_mode);

void kvm_flush_remote_tlbs(struct kvm *kvm);

@@ -1461,7 +1461,7 @@ int kvm_arch_create_vm_debugfs(struct kvm *kvm);
 */
static inline struct kvm *kvm_arch_alloc_vm(void)
{
	return kzalloc(sizeof(struct kvm), GFP_KERNEL);
	return kzalloc(sizeof(struct kvm), GFP_KERNEL_ACCOUNT);
}
#endif

+5 −3
Original line number Diff line number Diff line
@@ -187,15 +187,17 @@ int kvm_vm_ioctl_unregister_coalesced_mmio(struct kvm *kvm,
			r = kvm_io_bus_unregister_dev(kvm,
				zone->pio ? KVM_PIO_BUS : KVM_MMIO_BUS, &dev->dev);

			kvm_iodevice_destructor(&dev->dev);

			/*
			 * On failure, unregister destroys all devices on the
			 * bus _except_ the target device, i.e. coalesced_zones
			 * has been modified.  No need to restart the walk as
			 * there aren't any zones left.
			 * has been modified.  Bail after destroying the target
			 * device, there's no need to restart the walk as there
			 * aren't any zones left.
			 */
			if (r)
				break;
			kvm_iodevice_destructor(&dev->dev);
		}
	}