Re: [patch 7/9] x86/iopl: Restrict iopl() permission scope

From: Peter Zijlstra
Date: Thu Nov 07 2019 - 04:10:05 EST


On Wed, Nov 06, 2019 at 08:35:06PM +0100, Thomas Gleixner wrote:

Something like:

> @@ -379,7 +383,8 @@ struct tss_struct {
> * byte beyond the end of the I/O permission bitmap. The extra byte
> * must have all bits set and must be within the TSS limit.
> */
> - unsigned long io_bitmap[IO_BITMAP_LONGS + 1];

#ifndef X86_IOPL_NONE
> + unsigned long io_bitmap_map[IO_BITMAP_LONGS + 1];
#ifdef X86_IOPL_EMLATION
> + unsigned long io_bitmap_all[IO_BITMAP_LONGS + 1];
#endif /* X86_IOPL_EMLATION */
#endif /* !X86_IOPL_NONE */

> } __aligned(PAGE_SIZE);

Would allow us to reclaim those 8/16K bitmaps for LEGACY/NONE kernels.