Re: [patch 5/9] x86/ioport: Reduce ioperm impact for sane usage further

From: Thomas Gleixner
Date: Thu Nov 07 2019 - 02:45:38 EST


On Thu, 7 Nov 2019, Ingo Molnar wrote:
> * Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> > /*
> > - * The extra 1 is there because the CPU will access an
> > - * additional byte beyond the end of the IO permission
> > - * bitmap. The extra byte must be all 1 bits, and must
> > - * be within the limit.
> > + * The extra 1 is there because the CPU will access an additional
> > + * 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];
> > } __aligned(PAGE_SIZE);
>
> Note that on 32-bit kernels this blows up our CPU area calculations:
>
> ./include/linux/compiler.h:350:38: error: call to â__compiletime_assert_181â declared with attribute error: BUILD_BUG_ON failed: CPU_ENTRY_AREA_PAGES * PAGE_SIZE < CPU_ENTRY_AREA_MAP_SIZE
> ./include/linux/compiler.h:331:4: note: in definition of macro â__compiletime_assertâ
> ./include/linux/compiler.h:350:2: note: in expansion of macro â_compiletime_assertâ
> ./include/linux/build_bug.h:39:37: note: in expansion of macro âcompiletime_assertâ
> ./include/linux/build_bug.h:50:2: note: in expansion of macro âBUILD_BUG_ON_MSGâ
> arch/x86/mm/cpu_entry_area.c:181:2: note: in expansion of macro âBUILD_BUG_ONâ
> make[2]: *** [scripts/Makefile.build:265: arch/x86/mm/cpu_entry_area.o] Error 1

Duh. /me goes investigate.