Skip to contentSkip to conversation

W=1 fixes

PATCH Applied Cédric Le Goater 2 participants 4 messages Aug 23, 2021 – Aug 27, 2021 PowerPC

lore
Share & tools
lore
#0 lore raw

v2 cover W=1 fixes

Hello,

These are the remaining patches needed to compile the ppc kernel with W=1. Audit issues are now being addressed by Christophe in patch :

[v2] powerpc/audit: Convert powerpc to AUDIT_ARCH_COMPAT_GENERIC
http://patchwork.ozlabs.org/project/linuxppc-dev/patch/dc14509a28a993738b1325211f412be72a4f9b1e.1629701132.git.christophe.leroy@csgroup.eu/

Thanks,

C.

Changes in v2:
- reworked early_reserve_mem_dt()
- removed asmlinkage

Cédric Le Goater (2):
powerpc/prom: Fix unused variable ‘reserve_map’ when CONFIG_PPC32 is
not set
powerpc/compat_sys: Declare syscalls

 arch/powerpc/include/asm/syscalls.h | 30 +++++++++++++++++++++++++++++
 arch/powerpc/kernel/prom.c          |  5 +++--
 2 files changed, 33 insertions(+), 2 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH v2 1/2 powerpc/prom: Fix unused variable ‘reserve_map’ when CONFIG_PPC32 is not set

This fixes a compile error with W=1.

arch/powerpc/kernel/prom.c: In function ‘early_reserve_mem’:
arch/powerpc/kernel/prom.c:625:10: error: variable ‘reserve_map’ set but not used [-Werror=unused-but-set-variable]

  __be64 *reserve_map;
          ^~~~~~~~~~~

cc1: all warnings being treated as errors

---
 arch/powerpc/kernel/prom.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/powerpc/kernel/prom.c +3 -2
index f620e04dc9bf..44b2cdc0aae3 100644
@@ -640,7 +640,9 @@ static void __init early_reserve_mem(void)
 	}
 #endif /* CONFIG_BLK_DEV_INITRD */
 
-#ifdef CONFIG_PPC32
+	if (!IS_ENABLED(CONFIG_PPC32))
+		return;
+
 	/* 
 	 * Handle the case where we might be booting from an old kexec
 	 * image that setup the mem_rsvmap as pairs of 32-bit values
@@ -661,7 +663,6 @@ static void __init early_reserve_mem(void)
 		}
 		return;
 	}
-#endif
 }
 
 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
Signature · 1 line
2.31.1
#2 lore raw

PATCH v2 2/2 powerpc/compat_sys: Declare syscalls

In reply to Cédric Le Goater

This fixes a compile error with W=1.

---
 arch/powerpc/include/asm/syscalls.h | 30 +++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
arch/powerpc/include/asm/syscalls.h +30 -0
index 398171fdcd9f..7ee66ae5444d 100644
@@ -6,6 +6,7 @@
 #include <linux/compiler.h>
 #include <linux/linkage.h>
 #include <linux/types.h>
+#include <linux/compat.h>
 
 struct rtas_args;
 
@@ -18,5 +19,34 @@ asmlinkage long sys_mmap2(unsigned long addr, size_t len,
 asmlinkage long ppc64_personality(unsigned long personality);
 asmlinkage long sys_rtas(struct rtas_args __user *uargs);
 
+#ifdef CONFIG_COMPAT
+unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
+			       unsigned long prot, unsigned long flags,
+			       unsigned long fd, unsigned long pgoff);
+
+compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_size_t count,
+				  u32 reg6, u32 pos1, u32 pos2);
+
+compat_ssize_t compat_sys_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count,
+				   u32 reg6, u32 pos1, u32 pos2);
+
+compat_ssize_t compat_sys_readahead(int fd, u32 r4, u32 offset1, u32 offset2, u32 count);
+
+int compat_sys_truncate64(const char __user *path, u32 reg4,
+			  unsigned long len1, unsigned long len2);
+
+long compat_sys_fallocate(int fd, int mode, u32 offset1, u32 offset2, u32 len1, u32 len2);
+
+int compat_sys_ftruncate64(unsigned int fd, u32 reg4, unsigned long len1,
+			   unsigned long len2);
+
+long ppc32_fadvise64(int fd, u32 unused, u32 offset1, u32 offset2,
+		     size_t len, int advice);
+
+long compat_sys_sync_file_range2(int fd, unsigned int flags,
+				 unsigned int offset1, unsigned int offset2,
+				 unsigned int nbytes1, unsigned int nbytes2);
+#endif
+
 #endif /* __KERNEL__ */
 #endif /* __ASM_POWERPC_SYSCALLS_H */
Signature · 1 line
2.31.1
#3 lore raw
In reply to Cédric Le Goater
Quoted 9 lines · Cédric Le Goater

These are the remaining patches needed to compile the ppc kernel with W=1. Audit issues are now being addressed by Christophe in patch :

[v2] powerpc/audit: Convert powerpc to AUDIT_ARCH_COMPAT_GENERIC
http://patchwork.ozlabs.org/project/linuxppc-dev/patch/dc14509a28a993738b1325211f412be72a4f9b1e.1629701132.git.christophe.leroy@csgroup.eu/

Thanks,

[...]

Applied to powerpc/next.

[1/2] powerpc/prom: Fix unused variable ‘reserve_map’ when CONFIG_PPC32 is not set

      https://git.kernel.org/powerpc/c/3accc0faef081b6813967b34f7d05a3edb855cbd
[2/2] powerpc/compat_sys: Declare syscalls
      https://git.kernel.org/powerpc/c/cc47ad409ba9cc950e9c492c8ba653dabd392148

cheers