Skip to content

Commit cfcb4f9

Browse files
Jiri KosinaZhengShunQian
authored andcommitted
x86/speculation/l1tf: Unbreak !__HAVE_ARCH_PFN_MODIFY_ALLOWED architectures
commit 6c26fcd upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [groeck: Context changes] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent ac57958 commit cfcb4f9

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

include/asm-generic/pgtable.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -799,12 +799,6 @@ static inline int pmd_free_pte_page(pmd_t *pmd)
799799
}
800800
#endif /* CONFIG_HAVE_ARCH_HUGE_VMAP */
801801

802-
#endif /* !__ASSEMBLY__ */
803-
804-
#ifndef io_remap_pfn_range
805-
#define io_remap_pfn_range remap_pfn_range
806-
#endif
807-
808802
#ifndef __HAVE_ARCH_PFN_MODIFY_ALLOWED
809803
static inline bool pfn_modify_allowed(unsigned long pfn, pgprot_t prot)
810804
{
@@ -815,6 +809,12 @@ static inline bool arch_has_pfn_modify_check(void)
815809
{
816810
return false;
817811
}
812+
#endif /* !_HAVE_ARCH_PFN_MODIFY_ALLOWED */
813+
814+
#endif /* !__ASSEMBLY__ */
815+
816+
#ifndef io_remap_pfn_range
817+
#define io_remap_pfn_range remap_pfn_range
818818
#endif
819819

820820
#endif /* _ASM_GENERIC_PGTABLE_H */

0 commit comments

Comments
 (0)