From: Cédric Le Goater <clg@kaod.org> Date: 2021-08-19 12:59:44
Hello,
With this small series, I could compile the ppc kernel with W=1. There
are certainly other configs which will need more fixes but it's a good
start.
The last 2 patches look hacky. Christophe, could you help with these
to find a better place to include the declarations ?
Thanks,
C.
Cédric Le Goater (6):
powerpc/prom: Introduce early_reserve_mem_old()
powerpc/pseries/vas: Declare pseries_vas_fault_thread_fn() as static
KVM: PPC: Book3S PR: Declare kvmppc_handle_exit_pr()
KVM: PPC: Book3S PR: Remove unused variable
audit: Declare ppc32_classify_syscall()
powerpc/compat_sys: Declare syscalls
arch/powerpc/include/asm/syscalls.h | 31 +++++++++++++++++++++++
arch/powerpc/include/asm/unistd.h | 3 +++
arch/powerpc/kvm/book3s.h | 1 +
arch/powerpc/kernel/audit.c | 1 -
arch/powerpc/kernel/prom.c | 37 +++++++++++++++-------------
arch/powerpc/kvm/book3s_64_mmu.c | 3 +--
arch/powerpc/platforms/pseries/vas.c | 2 +-
7 files changed, 57 insertions(+), 21 deletions(-)
--
2.31.1
From: Cédric Le Goater <clg@kaod.org> Date: 2021-08-19 12:57:48
and condition its call with IS_ENABLED(CONFIG_PPC32). 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
Cc: Christophe Leroy <redacted>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
Christophe, I think you had comments on this one ? Yes, I am being a bit lazy.
arch/powerpc/kernel/prom.c | 37 ++++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 17 deletions(-)
@@ -621,27 +621,14 @@ static void __init early_reserve_mem_dt(void)}}-staticvoid__initearly_reserve_mem(void)+staticvoid__initearly_reserve_mem_old(void){__be64*reserve_map;reserve_map=(__be64*)(((unsignedlong)initial_boot_params)+fdt_off_mem_rsvmap(initial_boot_params));-/* Look for the new "reserved-regions" property in the DT */-early_reserve_mem_dt();--#ifdef CONFIG_BLK_DEV_INITRD-/* Then reserve the initrd, if any */-if(initrd_start&&(initrd_end>initrd_start)){-memblock_reserve(ALIGN_DOWN(__pa(initrd_start),PAGE_SIZE),-ALIGN(initrd_end,PAGE_SIZE)--ALIGN_DOWN(initrd_start,PAGE_SIZE));-}-#endif /* CONFIG_BLK_DEV_INITRD */--#ifdef CONFIG_PPC32-/* +/**Handlethecasewherewemightbebootingfromanoldkexec*imagethatsetupthemem_rsvmapaspairsof32-bitvalues*/
@@ -659,9 +646,25 @@ static void __init early_reserve_mem(void)DBG("reserving: %x -> %x\n",base_32,size_32);memblock_reserve(base_32,size_32);}-return;}-#endif+}++staticvoid__initearly_reserve_mem(void)+{+/* Look for the new "reserved-regions" property in the DT */+early_reserve_mem_dt();++#ifdef CONFIG_BLK_DEV_INITRD+/* Then reserve the initrd, if any */+if(initrd_start&&(initrd_end>initrd_start)){+memblock_reserve(ALIGN_DOWN(__pa(initrd_start),PAGE_SIZE),+ALIGN(initrd_end,PAGE_SIZE)-+ALIGN_DOWN(initrd_start,PAGE_SIZE));+}+#endif /* CONFIG_BLK_DEV_INITRD */++if(IS_ENABLED(CONFIG_PPC32))+early_reserve_mem_old();}#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
From: Cédric Le Goater <clg@kaod.org> Date: 2021-08-19 12:58:58
This fixes a compile error with W=1.
Cc: Christophe Leroy <redacted>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
I don't think this is correct. Which file could we use ?
arch/powerpc/include/asm/unistd.h | 3 +++
arch/powerpc/kernel/audit.c | 1 -
2 files changed, 3 insertions(+), 1 deletion(-)
From: Cédric Le Goater <clg@kaod.org> Date: 2021-08-19 13:00:07
This fixes a compile error with W=1.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
May be, this was sent already ?
arch/powerpc/kvm/book3s_64_mmu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
and condition its call with IS_ENABLED(CONFIG_PPC32). 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
Cc: Christophe Leroy <redacted>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
Christophe, I think you had comments on this one ? Yes, I am being a bit lazy.
Yeah, my comment was to leave thing almost as is, just drop the #ifdef CONFIG_PPC32 and instead put
something like:
if (!IS_ENABLED(CONFIG_PPC32))
return;
Why old ? Because ppc32 ?
I think that's more changes than needed.
quoted hunk
{
__be64 *reserve_map;
reserve_map = (__be64 *)(((unsigned long)initial_boot_params) +
fdt_off_mem_rsvmap(initial_boot_params));
- /* Look for the new "reserved-regions" property in the DT */
- early_reserve_mem_dt();
-
-#ifdef CONFIG_BLK_DEV_INITRD
- /* Then reserve the initrd, if any */
- if (initrd_start && (initrd_end > initrd_start)) {
- memblock_reserve(ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),
- ALIGN(initrd_end, PAGE_SIZE) -
- ALIGN_DOWN(initrd_start, PAGE_SIZE));
- }
-#endif /* CONFIG_BLK_DEV_INITRD */
-
-#ifdef CONFIG_PPC32
- /*
+ /*
* Handle the case where we might be booting from an old kexec
* image that setup the mem_rsvmap as pairs of 32-bit values
*/
@@ -659,9 +646,25 @@ static void __init early_reserve_mem(void) DBG("reserving: %x -> %x\n", base_32, size_32); memblock_reserve(base_32, size_32); }- return; }-#endif+}++static void __init early_reserve_mem(void)+{+ /* Look for the new "reserved-regions" property in the DT */+ early_reserve_mem_dt();++#ifdef CONFIG_BLK_DEV_INITRD+ /* Then reserve the initrd, if any */+ if (initrd_start && (initrd_end > initrd_start)) {+ memblock_reserve(ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),+ ALIGN(initrd_end, PAGE_SIZE) -+ ALIGN_DOWN(initrd_start, PAGE_SIZE));+ }+#endif /* CONFIG_BLK_DEV_INITRD */++ if (IS_ENABLED(CONFIG_PPC32))+ early_reserve_mem_old(); } #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
This fixes a compile error with W=1.
Cc: Christophe Leroy <redacted>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
I don't think this is correct. Which file could we use ?
I think you can completely remove ppc32_classify_syscall(), and instead add the following in the
default case in audit_classify_syscall():
default:
+ if (IS_ENABLED(CONFIG_PPC64) && abi == AUDIT_ARCH_PPC)
+ return 1;
return 0;
This fixes a compile error with W=1.
Cc: Christophe Leroy <redacted>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
I don't think this is correct. Which file could we use ?
I think you can completely remove ppc32_classify_syscall(), and instead add the following in the
default case in audit_classify_syscall():
default:
+ if (IS_ENABLED(CONFIG_PPC64) && abi == AUDIT_ARCH_PPC)
+ return 1;
return 0;
After looking more in details, in fact I think we should convert powerpc to
CONFIG_AUDIT_ARCH_COMPAT_GENERIC
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2021-08-20 12:23:08
Christophe Leroy [off-list ref] writes:
Le 19/08/2021 à 14:56, Cédric Le Goater a écrit :
quoted
and condition its call with IS_ENABLED(CONFIG_PPC32). 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
Cc: Christophe Leroy <redacted>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
Christophe, I think you had comments on this one ? Yes, I am being a bit lazy.
Yeah, my comment was to leave thing almost as is, just drop the #ifdef CONFIG_PPC32 and instead put
something like:
if (!IS_ENABLED(CONFIG_PPC32))
return;
This fixes a compile error with W=1.
Cc: Christophe Leroy <redacted>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
I don't think this is correct. Which file could we use ?
I think you can completely remove ppc32_classify_syscall(), and instead add the following in the
default case in audit_classify_syscall():
default:
+ if (IS_ENABLED(CONFIG_PPC64) && abi == AUDIT_ARCH_PPC)
+ return 1;
return 0;
From: Cédric Le Goater <clg@kaod.org> Date: 2021-08-23 08:31:05
On 8/19/21 4:42 PM, Christophe Leroy wrote:
Le 19/08/2021 à 14:56, Cédric Le Goater a écrit :
quoted
and condition its call with IS_ENABLED(CONFIG_PPC32). 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
Cc: Christophe Leroy <redacted>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
Christophe, I think you had comments on this one ? Yes, I am being a bit lazy.
Yeah, my comment was to leave thing almost as is, just drop the #ifdef CONFIG_PPC32 and instead put something like:
if (!IS_ENABLED(CONFIG_PPC32))
return;
No. because there is message a bit below saying :
DBG("Found old 32-bit reserve map\n");
I think that's more changes than needed.
OK. np. I will use your suggestion.
Thanks,
C.
quoted
{
__be64 *reserve_map;
reserve_map = (__be64 *)(((unsigned long)initial_boot_params) +
fdt_off_mem_rsvmap(initial_boot_params));
- /* Look for the new "reserved-regions" property in the DT */
- early_reserve_mem_dt();
-
-#ifdef CONFIG_BLK_DEV_INITRD
- /* Then reserve the initrd, if any */
- if (initrd_start && (initrd_end > initrd_start)) {
- memblock_reserve(ALIGN_DOWN(__pa(initrd_start), PAGE_SIZE),
- ALIGN(initrd_end, PAGE_SIZE) -
- ALIGN_DOWN(initrd_start, PAGE_SIZE));
- }
-#endif /* CONFIG_BLK_DEV_INITRD */
-
-#ifdef CONFIG_PPC32
- /*
+ /*
* Handle the case where we might be booting from an old kexec
* image that setup the mem_rsvmap as pairs of 32-bit values
*/
From: Cédric Le Goater <clg@kaod.org> Date: 2021-08-23 08:35:39
On 8/23/21 10:28 AM, Christophe Leroy wrote:
Le 19/08/2021 à 16:56, Christophe Leroy a écrit :
quoted
Le 19/08/2021 à 14:56, Cédric Le Goater a écrit :
quoted
This fixes a compile error with W=1.
Cc: Christophe Leroy <redacted>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
I don't think this is correct. Which file could we use ?
I think you can completely remove ppc32_classify_syscall(), and instead add the following in the default case in audit_classify_syscall():
default:
+ if (IS_ENABLED(CONFIG_PPC64) && abi == AUDIT_ARCH_PPC)
+ return 1;
return 0;
From: Michael Ellerman <hidden> Date: 2021-08-27 13:27:19
On Thu, 19 Aug 2021 14:56:50 +0200, Cédric Le Goater wrote:
With this small series, I could compile the ppc kernel with W=1. There
are certainly other configs which will need more fixes but it's a good
start.
The last 2 patches look hacky. Christophe, could you help with these
to find a better place to include the declarations ?
[...]