]> git.baikalelectronics.ru Git - kernel.git/commit
x86/iopl: Make 'struct tss_struct' constant size again
authorIngo Molnar <mingo@kernel.org>
Tue, 26 Nov 2019 20:49:04 +0000 (21:49 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 26 Nov 2019 20:49:04 +0000 (21:49 +0100)
commit3b64041cada1f562176309e231e39a409f3d569d
treeb15871c57a63c3557b1b12d8b72c67950c101a6f
parent69e135bd04d9d119d57ee21e1c2d67981ae2f191
x86/iopl: Make 'struct tss_struct' constant size again

After the following commit:

  c751fe45e7f2: ("x86/pti/32: Calculate the various PTI cpu_entry_area sizes correctly, make the CPU_ENTRY_AREA_PAGES assert precise")

'struct cpu_entry_area' has to be Kconfig invariant, so that we always
have a matching CPU_ENTRY_AREA_PAGES size.

This commit added a CONFIG_X86_IOPL_IOPERM dependency to tss_struct:

  b19ba9714815: ("x86/ioperm: Extend IOPL config to control ioperm() as well")

Which, if CONFIG_X86_IOPL_IOPERM is turned off, reduces the size of
cpu_entry_area by two pages, triggering the assert:

  ./include/linux/compiler.h:391:38: error: call to ‘__compiletime_assert_202’ declared with attribute error: BUILD_BUG_ON failed: (CPU_ENTRY_AREA_PAGES+1)*PAGE_SIZE != CPU_ENTRY_AREA_MAP_SIZE

Simplify the Kconfig dependencies and make cpu_entry_area constant
size on 32-bit kernels again.

Fixes: c751fe45e7f2: ("x86/pti/32: Calculate the various PTI cpu_entry_area sizes correctly, make the CPU_ENTRY_AREA_PAGES assert precise")
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/processor.h