diff options
author | Stefan Kempf <stefan@cvs.openbsd.org> | 2016-04-04 16:47:35 +0000 |
---|---|---|
committer | Stefan Kempf <stefan@cvs.openbsd.org> | 2016-04-04 16:47:35 +0000 |
commit | b51a2a6cbbc07b5acc8cd8751b2d3d98f2ceeae3 (patch) | |
tree | e492db2fbf2b2e9e291aa08ae082a0b438b1ccd3 | |
parent | bca792b10e53f176620b38e6d7d472c093f70fdd (diff) |
Deallocate guest vm_map when the guest gets terminated.
That way we no longer leak uvm data structures after a
guest VM was shut down.
ok mlarkin@
-rw-r--r-- | sys/arch/amd64/amd64/vmm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c index 5a46b6fc1a7..c633c72d46d 100644 --- a/sys/arch/amd64/amd64/vmm.c +++ b/sys/arch/amd64/amd64/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.45 2016/03/13 13:11:47 stefan Exp $ */ +/* $OpenBSD: vmm.c,v 1.46 2016/04/04 16:47:34 stefan Exp $ */ /* * Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org> * @@ -2272,7 +2272,9 @@ vm_teardown(struct vm *vm) vm_impl_deinit(vm); - /* XXX teardown guest vmspace, free pages */ + /* teardown guest vmspace */ + if (vm->vm_map != NULL) + uvm_map_deallocate(vm->vm_map); vmm_softc->vm_ct--; if (vmm_softc->vm_ct < 1) |