Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad8ba2cd authored by Sheng Yang's avatar Sheng Yang Committed by Avi Kivity
Browse files

KVM: Add kvm_arch_sync_events to sync with asynchronize events



kvm_arch_sync_events is introduced to quiet down all other events may happen
contemporary with VM destroy process, like IRQ handler and work struct for
assigned device.

For kvm_arch_sync_events is called at the very beginning of kvm_destroy_vm(), so
the state of KVM here is legal and can provide a environment to quiet down other
events.

Signed-off-by: default avatarSheng Yang <sheng@linux.intel.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 85db06e5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1337,6 +1337,10 @@ static void kvm_release_vm_pages(struct kvm *kvm)
	}
}

void kvm_arch_sync_events(struct kvm *kvm)
{
}

void kvm_arch_destroy_vm(struct kvm *kvm)
{
	kvm_iommu_unmap_guest(kvm);
+4 −0
Original line number Diff line number Diff line
@@ -125,6 +125,10 @@ static void kvmppc_free_vcpus(struct kvm *kvm)
	}
}

void kvm_arch_sync_events(struct kvm *kvm)
{
}

void kvm_arch_destroy_vm(struct kvm *kvm)
{
	kvmppc_free_vcpus(kvm);
+4 −0
Original line number Diff line number Diff line
@@ -212,6 +212,10 @@ static void kvm_free_vcpus(struct kvm *kvm)
	}
}

void kvm_arch_sync_events(struct kvm *kvm)
{
}

void kvm_arch_destroy_vm(struct kvm *kvm)
{
	kvm_free_vcpus(kvm);
+4 −0
Original line number Diff line number Diff line
@@ -4127,6 +4127,10 @@ static void kvm_free_vcpus(struct kvm *kvm)

}

void kvm_arch_sync_events(struct kvm *kvm)
{
}

void kvm_arch_destroy_vm(struct kvm *kvm)
{
	kvm_free_all_assigned_devices(kvm);
+1 −0
Original line number Diff line number Diff line
@@ -285,6 +285,7 @@ void kvm_free_physmem(struct kvm *kvm);
struct  kvm *kvm_arch_create_vm(void);
void kvm_arch_destroy_vm(struct kvm *kvm);
void kvm_free_all_assigned_devices(struct kvm *kvm);
void kvm_arch_sync_events(struct kvm *kvm);

int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
int kvm_cpu_has_interrupt(struct kvm_vcpu *v);
Loading