diff mbox series

[1/2,stable-4.9] x86: fix build without CONFIG_X86_VSYSCALL_EMULATION

Message ID 20180215151710.1473117-1-arnd@arndb.de
State New
Headers show
Series [1/2,stable-4.9] x86: fix build without CONFIG_X86_VSYSCALL_EMULATION | expand

Commit Message

Arnd Bergmann Feb. 15, 2018, 3:16 p.m. UTC
I ran into a 4.9 build regression in randconfig testing, starting with the
KAISER patches:

arch/x86/mm/kaiser.c: In function 'kaiser_init':
arch/x86/mm/kaiser.c:347:8: error: 'vsyscall_pgprot' undeclared (first use in this function); did you mean 'massage_pgprot'?

This is easy enough to fix, we just need to make the declaration visible
outside of the #ifdef. This works because the code using it is optimized
away when vsyscall_enabled() returns false at compile time.

Fixes: 9a0be5afbfbb ("vsyscall: Fix permissions for emulate mode with KAISER/PTI")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

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

-- 
2.9.0

Comments

Hugh Dickins Feb. 15, 2018, 7:18 p.m. UTC | #1
On Thu, 15 Feb 2018, Greg Kroah-Hartman wrote:
> On Thu, Feb 15, 2018 at 04:16:56PM +0100, Arnd Bergmann wrote:

> > I ran into a 4.9 build regression in randconfig testing, starting with the

> > KAISER patches:

> > 

> > arch/x86/mm/kaiser.c: In function 'kaiser_init':

> > arch/x86/mm/kaiser.c:347:8: error: 'vsyscall_pgprot' undeclared (first use in this function); did you mean 'massage_pgprot'?

> > 

> > This is easy enough to fix, we just need to make the declaration visible

> > outside of the #ifdef. This works because the code using it is optimized

> > away when vsyscall_enabled() returns false at compile time.

> > 

> > Fixes: 9a0be5afbfbb ("vsyscall: Fix permissions for emulate mode with KAISER/PTI")

> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> > ---

> >  arch/x86/include/asm/vsyscall.h | 3 ++-

> >  1 file changed, 2 insertions(+), 1 deletion(-)

> 

> Thanks for these, I'll queue them up in the next round after these

> kernels get released in a few days.


Thanks to Arnd, but please drop this vsyscall one Greg: it duplicates
my/Tobias's "kaiser: fix compile error without vsyscall" that you just
sent out for 4.4 and 4.9 review.

Arnd's PAE one looks good for 4.4 and 4.9 (well, in another context I'd
object to using a different prototype in the stub, but I'm pretty sure
Arnd feels the same way, but has made the appropriate choice for our
Kaiser backports context): so please do take his 2/2 "x86: fix build
warnign with 32-bit PAE" for both 4.4 and 4.9.

Thanks,
Hugh
Greg Kroah-Hartman Feb. 21, 2018, 9:36 a.m. UTC | #2
On Thu, Feb 15, 2018 at 11:18:21AM -0800, Hugh Dickins wrote:
> On Thu, 15 Feb 2018, Greg Kroah-Hartman wrote:

> > On Thu, Feb 15, 2018 at 04:16:56PM +0100, Arnd Bergmann wrote:

> > > I ran into a 4.9 build regression in randconfig testing, starting with the

> > > KAISER patches:

> > > 

> > > arch/x86/mm/kaiser.c: In function 'kaiser_init':

> > > arch/x86/mm/kaiser.c:347:8: error: 'vsyscall_pgprot' undeclared (first use in this function); did you mean 'massage_pgprot'?

> > > 

> > > This is easy enough to fix, we just need to make the declaration visible

> > > outside of the #ifdef. This works because the code using it is optimized

> > > away when vsyscall_enabled() returns false at compile time.

> > > 

> > > Fixes: 9a0be5afbfbb ("vsyscall: Fix permissions for emulate mode with KAISER/PTI")

> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> > > ---

> > >  arch/x86/include/asm/vsyscall.h | 3 ++-

> > >  1 file changed, 2 insertions(+), 1 deletion(-)

> > 

> > Thanks for these, I'll queue them up in the next round after these

> > kernels get released in a few days.

> 

> Thanks to Arnd, but please drop this vsyscall one Greg: it duplicates

> my/Tobias's "kaiser: fix compile error without vsyscall" that you just

> sent out for 4.4 and 4.9 review.

> 

> Arnd's PAE one looks good for 4.4 and 4.9 (well, in another context I'd

> object to using a different prototype in the stub, but I'm pretty sure

> Arnd feels the same way, but has made the appropriate choice for our

> Kaiser backports context): so please do take his 2/2 "x86: fix build

> warnign with 32-bit PAE" for both 4.4 and 4.9.


I've now taken the 2/2 patch here, thanks for the review.  Arnd, thanks
for the patch.

greg k-h
diff mbox series

Patch

diff --git a/arch/x86/include/asm/vsyscall.h b/arch/x86/include/asm/vsyscall.h
index 9ee85066f407..c98c21b7f4cd 100644
--- 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)
@@ -23,4 +22,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 */