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>
This commit is contained in:
Thomas Gleixner
2019-11-11 23:03:23 +01:00
parent 060aa16fdb
commit 22fe5b0439
5 changed files with 54 additions and 45 deletions

View File

@@ -11,4 +11,6 @@ struct io_bitmap {
unsigned long bitmap[IO_BITMAP_LONGS];
};
void tss_update_io_bitmap(void);
#endif