All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4.9] x86/speculation/l1tf: Unbreak !__HAVE_ARCH_PFN_MODIFY_ALLOWED architectures
@ 2018-08-15  2:14 Guenter Roeck
  2018-08-15  5:47 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Guenter Roeck @ 2018-08-15  2:14 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, Jiri Kosina, Thomas Gleixner, Guenter Roeck

From: Jiri Kosina <jkosina@suse.cz>

commit 6c26fcd2abfe0a56bbd95271fce02df2896cfd24 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: 42e4089c7890 ("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>
(cherry picked from commit 6c26fcd2abfe0a56bbd95271fce02df2896cfd24)
[groeck: Context changes]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 include/asm-generic/pgtable.h | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 0ffe4051ae2e..a88ea9e37a25 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -828,6 +828,19 @@ static inline int pmd_free_pte_page(pmd_t *pmd)
 struct file;
 int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
 			unsigned long size, pgprot_t *vma_prot);
+
+#ifndef __HAVE_ARCH_PFN_MODIFY_ALLOWED
+static inline bool pfn_modify_allowed(unsigned long pfn, pgprot_t prot)
+{
+	return true;
+}
+
+static inline bool arch_has_pfn_modify_check(void)
+{
+	return false;
+}
+#endif /* !_HAVE_ARCH_PFN_MODIFY_ALLOWED */
+
 #endif /* !__ASSEMBLY__ */
 
 #ifndef io_remap_pfn_range
@@ -842,16 +855,4 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn,
 #endif
 #endif
 
-#ifndef __HAVE_ARCH_PFN_MODIFY_ALLOWED
-static inline bool pfn_modify_allowed(unsigned long pfn, pgprot_t prot)
-{
-	return true;
-}
-
-static inline bool arch_has_pfn_modify_check(void)
-{
-	return false;
-}
-#endif
-
 #endif /* _ASM_GENERIC_PGTABLE_H */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v4.9] x86/speculation/l1tf: Unbreak !__HAVE_ARCH_PFN_MODIFY_ALLOWED architectures
  2018-08-15  2:14 [PATCH v4.9] x86/speculation/l1tf: Unbreak !__HAVE_ARCH_PFN_MODIFY_ALLOWED architectures Guenter Roeck
@ 2018-08-15  5:47 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2018-08-15  5:47 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: stable, Jiri Kosina, Thomas Gleixner

On Tue, Aug 14, 2018 at 07:14:46PM -0700, Guenter Roeck wrote:
> From: Jiri Kosina <jkosina@suse.cz>
> 
> commit 6c26fcd2abfe0a56bbd95271fce02df2896cfd24 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: 42e4089c7890 ("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>
> (cherry picked from commit 6c26fcd2abfe0a56bbd95271fce02df2896cfd24)
> [groeck: Context changes]
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
>  include/asm-generic/pgtable.h | 25 +++++++++++++------------
>  1 file changed, 13 insertions(+), 12 deletions(-)

Thanks for this and the other backport of this patch, now applied.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-15  8:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-15  2:14 [PATCH v4.9] x86/speculation/l1tf: Unbreak !__HAVE_ARCH_PFN_MODIFY_ALLOWED architectures Guenter Roeck
2018-08-15  5:47 ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.