Skip to content

Commit 0bcd776

Browse files
author
Ingo Molnar
committed
x86/iopl: Make 'struct tss_struct' constant size again
After the following commit: 05b042a: ("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: 111e7b1: ("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: 05b042a: ("x86/pti/32: Calculate the various PTI cpu_entry_area sizes correctly, make the CPU_ENTRY_AREA_PAGES assert precise") Cc: Thomas Gleixner <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Andy Lutomirski <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent 2be7d34 commit 0bcd776

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

arch/x86/include/asm/processor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,7 @@ struct tss_struct {
411411
*/
412412
struct x86_hw_tss x86_tss;
413413

414-
#ifdef CONFIG_X86_IOPL_IOPERM
415414
struct x86_io_bitmap io_bitmap;
416-
#endif
417415
} __aligned(PAGE_SIZE);
418416

419417
DECLARE_PER_CPU_PAGE_ALIGNED(struct tss_struct, cpu_tss_rw);

0 commit comments

Comments
 (0)