From ad43b98491e03bde286bfec1671cd5fbe989efba Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Mon, 23 Sep 2013 20:14:15 +0000 Subject: [PATCH] Free both KVA and backing pages when freeing TSS memory. Reported and tested by: pho Sponsored by: The FreeBSD Foundation Approved by: re (marius) --- sys/amd64/amd64/vm_machdep.c | 2 +- sys/i386/i386/vm_machdep.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 7253fe23bb7..b7c2b67105f 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -341,7 +341,7 @@ cpu_thread_clean(struct thread *td) * Clean TSS/iomap */ if (pcb->pcb_tssp != NULL) { - kva_free((vm_offset_t)pcb->pcb_tssp, + kmem_free(kernel_arena, (vm_offset_t)pcb->pcb_tssp, ctob(IOPAGES + 1)); pcb->pcb_tssp = NULL; } diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 17c29fd8ced..a82f3f1e431 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -367,7 +367,7 @@ cpu_thread_clean(struct thread *td) * XXX do we need to move the TSS off the allocated pages * before freeing them? (not done here) */ - kva_free((vm_offset_t)pcb->pcb_ext, + kmem_free(kernel_arena, (vm_offset_t)pcb->pcb_ext, ctob(IOPAGES + 1)); pcb->pcb_ext = NULL; }