Page MenuHomeFreeBSD

D45556.diff
No OneTemporary

D45556.diff

diff --git a/sys/arm64/include/vmm.h b/sys/arm64/include/vmm.h
--- a/sys/arm64/include/vmm.h
+++ b/sys/arm64/include/vmm.h
@@ -127,6 +127,7 @@
int vm_create(const char *name, struct vm **retvm);
struct vcpu *vm_alloc_vcpu(struct vm *vm, int vcpuid);
+void vm_disable_vcpu_creation(struct vm *vm);
void vm_slock_vcpus(struct vm *vm);
void vm_unlock_vcpus(struct vm *vm);
void vm_destroy(struct vm *vm);
diff --git a/sys/arm64/vmm/vmm.c b/sys/arm64/vmm/vmm.c
--- a/sys/arm64/vmm/vmm.c
+++ b/sys/arm64/vmm/vmm.c
@@ -141,6 +141,7 @@
volatile cpuset_t active_cpus; /* (i) active vcpus */
volatile cpuset_t debug_cpus; /* (i) vcpus stopped for debug */
int suspend; /* (i) stop VM execution */
+ bool dying; /* (o) is dying */
volatile cpuset_t suspended_cpus; /* (i) suspended vcpus */
volatile cpuset_t halted_cpus; /* (x) cpus in a hard halt */
struct mem_map mem_maps[VM_MAX_MEMMAPS]; /* (i) guest address space */
@@ -405,6 +406,14 @@
}
}
+void
+vm_disable_vcpu_creation(struct vm *vm)
+{
+ sx_xlock(&vm->vcpus_init_lock);
+ vm->dying = true;
+ sx_xunlock(&vm->vcpus_init_lock);
+}
+
struct vcpu *
vm_alloc_vcpu(struct vm *vm, int vcpuid)
{
@@ -423,7 +432,7 @@
sx_xlock(&vm->vcpus_init_lock);
vcpu = vm->vcpu[vcpuid];
- if (vcpu == NULL/* && !vm->dying*/) {
+ if (vcpu == NULL && !vm->dying) {
vcpu = vcpu_alloc(vm, vcpuid);
vcpu_init(vcpu);

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 1, 10:51 AM (21 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
13246358
Default Alt Text
D45556.diff (1 KB)

Event Timeline