Skip to content

Commit 6c26fcd

Browse files
Jiri KosinaKAGA-KOKO
authored andcommitted
x86/speculation/l1tf: Unbreak !__HAVE_ARCH_PFN_MODIFY_ALLOWED architectures
pfn_modify_allowed() and arch_has_pfn_modify_check() are outside of the !__ASSEMBLY__ section in include/asm-generic/pgtable.h, which confuses assembler on archs that don't have __HAVE_ARCH_PFN_MODIFY_ALLOWED (e.g. ia64) and breaks build: include/asm-generic/pgtable.h: Assembler messages: include/asm-generic/pgtable.h:538: Error: Unknown opcode `static inline bool pfn_modify_allowed(unsigned long pfn,pgprot_t prot)' include/asm-generic/pgtable.h:540: Error: Unknown opcode `return true' include/asm-generic/pgtable.h:543: Error: Unknown opcode `static inline bool arch_has_pfn_modify_check(void)' include/asm-generic/pgtable.h:545: Error: Unknown opcode `return false' arch/ia64/kernel/entry.S:69: Error: `mov' does not fit into bundle Move those two static inlines into the !__ASSEMBLY__ section so that they don't confuse the asm build pass. Fixes: 42e4089 ("x86/speculation/l1tf: Disallow non privileged high MMIO PROT_NONE mappings") Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 3ec8ce5 commit 6c26fcd

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

include/asm-generic/pgtable.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,18 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
10831083
static inline void init_espfix_bsp(void) { }
10841084
#endif
10851085

1086+
#ifndef __HAVE_ARCH_PFN_MODIFY_ALLOWED
1087+
static inline bool pfn_modify_allowed(unsigned long pfn, pgprot_t prot)
1088+
{
1089+
return true;
1090+
}
1091+
1092+
static inline bool arch_has_pfn_modify_check(void)
1093+
{
1094+
return false;
1095+
}
1096+
#endif /* !_HAVE_ARCH_PFN_MODIFY_ALLOWED */
1097+
10861098
#endif /* !__ASSEMBLY__ */
10871099

10881100
#ifndef io_remap_pfn_range
@@ -1097,16 +1109,4 @@ static inline void init_espfix_bsp(void) { }
10971109
#endif
10981110
#endif
10991111

1100-
#ifndef __HAVE_ARCH_PFN_MODIFY_ALLOWED
1101-
static inline bool pfn_modify_allowed(unsigned long pfn, pgprot_t prot)
1102-
{
1103-
return true;
1104-
}
1105-
1106-
static inline bool arch_has_pfn_modify_check(void)
1107-
{
1108-
return false;
1109-
}
1110-
#endif
1111-
11121112
#endif /* _ASM_GENERIC_PGTABLE_H */

0 commit comments

Comments
 (0)