x86/ioperm: Move TSS bitmap update to exit to user work
authorThomas Gleixner <tglx@linutronix.de>
Mon, 11 Nov 2019 22:03:23 +0000 (23:03 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 16 Nov 2019 10:24:03 +0000 (11:24 +0100)
commit22fe5b0439dd53643fd6f4c582c46c6dba0fde53
treee74ed4d8d8f6182811570d21185a7703e76e56d7
parent060aa16fdb7c5078a4159a76e5dc87d6a493af9b
x86/ioperm: Move TSS bitmap update to exit to user work

There is no point to update the TSS bitmap for tasks which use I/O bitmaps
on every context switch. It's enough to update it right before exiting to
user space.

That reduces the context switch bitmap handling to invalidating the io
bitmap base offset in the TSS when the outgoing task has TIF_IO_BITMAP
set. The invaldiation is done on purpose when a task with an IO bitmap
switches out to prevent any possible leakage of an activated IO bitmap.

It also removes the requirement to update the tasks bitmap atomically in
ioperm().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/entry/common.c
arch/x86/include/asm/io_bitmap.h
arch/x86/include/asm/thread_info.h
arch/x86/kernel/ioport.c
arch/x86/kernel/process.c