public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [stable-4.4.y] compile error with KAISER and no vsyscall emulation
       [not found] <3d9557f8-5752-4993-f32a-64335348069f@math.uni-bielefeld.de>
@ 2018-02-11  0:24 ` Hugh Dickins
  2018-02-13 15:46   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Hugh Dickins @ 2018-02-11  0:24 UTC (permalink / raw)
  To: Tobias Jakobi; +Cc: ben.hutchings, bp, hughd, Greg Kroah-Hartman, stable

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2634 bytes --]

On Sat, 10 Feb 2018, Tobias Jakobi wrote:
> Hello,
> 
> I noticed a compile error with a recent version (4.4.115) of the 4.4.y branch:
> arch/x86/mm/kaiser.c: In function ‘kaiser_init’:
> arch/x86/mm/kaiser.c:348:8: error: ‘vsyscall_pgprot’ undeclared (first use in
> this function)
> 
> It seems like my combination of kernel options doesn't work for KAISER.
> X86_VSYSCALL_EMULATION is not set on my system, while LEGACY_VSYSCALL is set to
> NONE (LEGACY_VSYSCALL_NONE=y). I have managed to get things compiling again, by
> moving the 'extern unsigned long vsyscall_pgprot' outside of the preprocessor
> statement. This works for me, I guess because the code in question is never
> called during runtime anyway (vsyscall_enabled() always returns false).
> 
> With best wishes,
> Tobias

Yes, sorry about that, thanks Tobias. Same error on 4.9 too.
Here's the patch that you correctly suggest, and it's good for both:


[PATCH 4.4 and 4.9] kaiser: fix compile error without vsyscall

Tobias noticed a compile error on 4.4.115, and it's the same on 4.9.80:
arch/x86/mm/kaiser.c: In function ‘kaiser_init’:
arch/x86/mm/kaiser.c:348:8: error: ‘vsyscall_pgprot’ undeclared
                                   (first use in this function)

It seems like his combination of kernel options doesn't work for KAISER.
X86_VSYSCALL_EMULATION is not set on his system, while LEGACY_VSYSCALL
is set to NONE (LEGACY_VSYSCALL_NONE=y). He managed to get things
compiling again, by moving the 'extern unsigned long vsyscall_pgprot'
outside of the preprocessor statement. This works because the optimizer
removes that code (vsyscall_enabled() is always false) - and that's how
it was done in some older backports.

Reported-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Hugh Dickins <hughd@google.com>
---

 arch/x86/include/asm/vsyscall.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/x86/include/asm/vsyscall.h
+++ b/arch/x86/include/asm/vsyscall.h
@@ -13,7 +13,6 @@ extern void map_vsyscall(void);
  */
 extern bool emulate_vsyscall(struct pt_regs *regs, unsigned long address);
 extern bool vsyscall_enabled(void);
-extern unsigned long vsyscall_pgprot;
 #else
 static inline void map_vsyscall(void) {}
 static inline bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
@@ -22,5 +21,6 @@ static inline bool emulate_vsyscall(struct pt_regs *regs, unsigned long address)
 }
 static inline bool vsyscall_enabled(void) { return false; }
 #endif
+extern unsigned long vsyscall_pgprot;
 
 #endif /* _ASM_X86_VSYSCALL_H */

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

* Re: [stable-4.4.y] compile error with KAISER and no vsyscall emulation
  2018-02-11  0:24 ` [stable-4.4.y] compile error with KAISER and no vsyscall emulation Hugh Dickins
@ 2018-02-13 15:46   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2018-02-13 15:46 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: Tobias Jakobi, ben.hutchings, bp, stable

On Sat, Feb 10, 2018 at 04:24:10PM -0800, Hugh Dickins wrote:
> On Sat, 10 Feb 2018, Tobias Jakobi wrote:
> > Hello,
> > 
> > I noticed a compile error with a recent version (4.4.115) of the 4.4.y branch:
> > arch/x86/mm/kaiser.c: In function ‘kaiser_init’:
> > arch/x86/mm/kaiser.c:348:8: error: ‘vsyscall_pgprot’ undeclared (first use in
> > this function)
> > 
> > It seems like my combination of kernel options doesn't work for KAISER.
> > X86_VSYSCALL_EMULATION is not set on my system, while LEGACY_VSYSCALL is set to
> > NONE (LEGACY_VSYSCALL_NONE=y). I have managed to get things compiling again, by
> > moving the 'extern unsigned long vsyscall_pgprot' outside of the preprocessor
> > statement. This works for me, I guess because the code in question is never
> > called during runtime anyway (vsyscall_enabled() always returns false).
> > 
> > With best wishes,
> > Tobias
> 
> Yes, sorry about that, thanks Tobias. Same error on 4.9 too.
> Here's the patch that you correctly suggest, and it's good for both:
> 
> 
> [PATCH 4.4 and 4.9] kaiser: fix compile error without vsyscall

Thanks, now queued up.

greg k-h

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

end of thread, other threads:[~2018-02-13 15:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <3d9557f8-5752-4993-f32a-64335348069f@math.uni-bielefeld.de>
2018-02-11  0:24 ` [stable-4.4.y] compile error with KAISER and no vsyscall emulation Hugh Dickins
2018-02-13 15:46   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox