Skip to contentSkip to conversation

PS3 patches

PATCH Applied Geoff Levand 4 participants 11 messages Jan 3, 2023 – Feb 15, 2023

Subsystems (2)
lore
Share & tools
lore

Geoff Levand

author maintainer
#0 lore raw

v2 cover PS3 patches

Hi Michael,

This v2 series is just the two PS3 specific patches of the v1 series.

-Geoff

The following changes since commit 88603b6dc419445847923fcb7fe5080067a30f98:

Linux 6.2-rc2 (2023-01-01 13:53:16 -0800)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/geoff/ps3-linux.git for-merge-powerpc-2

for you to fetch changes up to 99e87549b17feca3494e9df6f4def04a9ec7c042:

powerpc/ps3: Refresh ps3_defconfig (2023-01-03 09:42:16 -0800)

----------------------------------------------------------------
Geoff Levand (2):
powerpc/ps3: Change updateboltedpp panic to info powerpc/ps3: Refresh ps3_defconfig

 arch/powerpc/configs/ps3_defconfig | 39 +++++++++++++++++---------------------
 arch/powerpc/platforms/ps3/htab.c  |  2 +-
 2 files changed, 18 insertions(+), 23 deletions(-)
Signature · 1 line
2.34.1
author maintainer
#9 lore raw

PATCH v2 2/2 powerpc/ps3: Refresh ps3_defconfig

Refresh ps3_defconfig for v6.2.

---
 arch/powerpc/configs/ps3_defconfig | 39 +++++++++++++-----------------
 1 file changed, 17 insertions(+), 22 deletions(-)
arch/powerpc/configs/ps3_defconfig +17 -22
index 0a1b42c4f26a..52a8c5450ecb 100644
@@ -1,8 +1,3 @@
-CONFIG_PPC64=y
-CONFIG_CELL_CPU=y
-CONFIG_ALTIVEC=y
-CONFIG_SMP=y
-CONFIG_NR_CPUS=2
 CONFIG_SYSVIPC=y
 CONFIG_POSIX_MQUEUE=y
 CONFIG_HIGH_RES_TIMERS=y
@@ -10,11 +5,12 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_CC_OPTIMIZE_FOR_SIZE=y
 CONFIG_EMBEDDED=y
 # CONFIG_PERF_EVENTS is not set
-# CONFIG_COMPAT_BRK is not set
-CONFIG_SLAB=y
 CONFIG_PROFILING=y
-CONFIG_MODULES=y
-CONFIG_MODULE_UNLOAD=y
+CONFIG_PPC64=y
+CONFIG_CELL_CPU=y
+CONFIG_ALTIVEC=y
+CONFIG_SMP=y
+CONFIG_NR_CPUS=2
 # CONFIG_PPC_POWERNV is not set
 # CONFIG_PPC_PSERIES is not set
 # CONFIG_PPC_PMAC is not set
@@ -27,17 +23,20 @@ CONFIG_PS3_FLASH=y
 CONFIG_PS3_VRAM=m
 CONFIG_PS3_LPM=m
 # CONFIG_PPC_OF_BOOT_TRAMPOLINE is not set
-# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
-CONFIG_BINFMT_MISC=y
 CONFIG_KEXEC=y
 CONFIG_PPC_4K_PAGES=y
-# CONFIG_SPARSEMEM_VMEMMAP is not set
-# CONFIG_COMPACTION is not set
 CONFIG_SCHED_SMT=y
 CONFIG_PM=y
 CONFIG_PM_DEBUG=y
 # CONFIG_SECCOMP is not set
-# CONFIG_PCI is not set
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+CONFIG_BINFMT_MISC=y
+CONFIG_SLAB=y
+# CONFIG_COMPAT_BRK is not set
+# CONFIG_SPARSEMEM_VMEMMAP is not set
+# CONFIG_COMPACTION is not set
 CONFIG_NET=y
 CONFIG_PACKET=y
 CONFIG_UNIX=y
@@ -87,7 +86,6 @@ CONFIG_USB_USBNET=m
 # CONFIG_USB_NET_NET1080 is not set
 # CONFIG_USB_NET_CDC_SUBSET is not set
 # CONFIG_USB_NET_ZAURUS is not set
-CONFIG_INPUT_FF_MEMLESS=m
 CONFIG_INPUT_JOYDEV=m
 CONFIG_INPUT_EVDEV=m
 # CONFIG_INPUT_KEYBOARD is not set
@@ -110,13 +108,10 @@ CONFIG_SND=m
 # CONFIG_SND_DRIVERS is not set
 CONFIG_SND_USB_AUDIO=m
 CONFIG_HIDRAW=y
-CONFIG_HID_APPLE=m
 CONFIG_HID_BELKIN=m
 CONFIG_HID_CHERRY=m
 CONFIG_HID_EZKEY=m
 CONFIG_HID_TWINHAN=m
-CONFIG_HID_LOGITECH=m
-CONFIG_HID_LOGITECH_DJ=m
 CONFIG_HID_MICROSOFT=m
 CONFIG_HID_SUNPLUS=m
 CONFIG_HID_SMARTJOYPLUS=m
@@ -151,8 +146,12 @@ CONFIG_CIFS=m
 CONFIG_NLS=y
 CONFIG_NLS_CODEPAGE_437=y
 CONFIG_NLS_ISO8859_1=y
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_LZO=m
 CONFIG_CRC_CCITT=m
 CONFIG_CRC_T10DIF=y
+CONFIG_PRINTK_TIME=y
 CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 CONFIG_MAGIC_SYSRQ=y
 CONFIG_DEBUG_MEMORY_INIT=y
@@ -163,7 +162,3 @@ CONFIG_DEBUG_LOCKDEP=y
 CONFIG_DEBUG_LIST=y
 CONFIG_RCU_CPU_STALL_TIMEOUT=60
 # CONFIG_FTRACE is not set
-CONFIG_CRYPTO_PCBC=m
-CONFIG_CRYPTO_MICHAEL_MIC=m
-CONFIG_CRYPTO_LZO=m
-CONFIG_PRINTK_TIME=y
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH v2 1/2 powerpc/ps3: Change updateboltedpp panic to info

In reply to Geoff Levand

Commit fdacae8a84024474afff234bdd1dbe19ad597a10 (powerpc: Activate CONFIG_STRICT_KERNEL_RWX by default) causes ps3_hpte_updateboltedpp() to be called. Change the panic statment in ps3_hpte_updateboltedpp() to a pr_info statement so that bootup can continue.

---
 arch/powerpc/platforms/ps3/htab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/ps3/htab.c +1 -1
index c27e6cf85272..9de62bd52650 100644
@@ -146,7 +146,7 @@ static long ps3_hpte_updatepp(unsigned long slot, unsigned long newpp,
 static void ps3_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
 	int psize, int ssize)
 {
-	panic("ps3_hpte_updateboltedpp() not implemented");
+	pr_info("ps3_hpte_updateboltedpp() not implemented");
 }
 
 static void ps3_hpte_invalidate(unsigned long slot, unsigned long vpn,
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v2 1/2] powerpc/ps3: Change updateboltedpp panic to info

Le 03/01/2023 à 18:51, Geoff Levand a écrit :

Quoted 4 lines

Commit fdacae8a84024474afff234bdd1dbe19ad597a10 (powerpc: Activate CONFIG_STRICT_KERNEL_RWX by default) causes ps3_hpte_updateboltedpp() to be called. Change the panic statment in ps3_hpte_updateboltedpp() to a pr_info statement so that bootup can continue.

But if I understand correctly, it means that CONFIG_STRICT_KERNEL_RWX won't work then.

So, shouldn't we keep the panic and forbid CONFIG_STRICT_KERNEL_RWX on PS3 ?

Quoted 19 lines
---
  arch/powerpc/platforms/ps3/htab.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/ps3/htab.c +1 -1
index c27e6cf85272..9de62bd52650 100644
@@ -146,7 +146,7 @@ static long ps3_hpte_updatepp(unsigned long slot, unsigned long newpp,
  static void ps3_hpte_updateboltedpp(unsigned long newpp, unsigned long ea,
  	int psize, int ssize)
  {
-	panic("ps3_hpte_updateboltedpp() not implemented");
+	pr_info("ps3_hpte_updateboltedpp() not implemented");
  }
 
  static void ps3_hpte_invalidate(unsigned long slot, unsigned long vpn,
author maintainer
#3 lore raw

Re: [PATCH v2 1/2] powerpc/ps3: Change updateboltedpp panic to info

Hi Christophe,

Quoted 8 lines · Christophe Leroy
Quoted 4 lines · Geoff Levand

Commit fdacae8a84024474afff234bdd1dbe19ad597a10 (powerpc: Activate CONFIG_STRICT_KERNEL_RWX by default) causes ps3_hpte_updateboltedpp() to be called. Change the panic statment in ps3_hpte_updateboltedpp() to a pr_info statement so that bootup can continue.

Quoted 4 lines

But if I understand correctly, it means that CONFIG_STRICT_KERNEL_RWX won't work then.

So, shouldn't we keep the panic and forbid CONFIG_STRICT_KERNEL_RWX on PS3 ?

mmu_hash_ops.updateboltedpp returns void, so I can't return an error code to indicate the feature is not supported.

I could do something like this in arch/powerpc/Kconfig:

-       select ARCH_HAS_STRICT_KERNEL_RWX       if (PPC_BOOK3S || PPC_8xx || 40x) && !HIBERNATION
+       select ARCH_HAS_STRICT_KERNEL_RWX       if (PPC_BOOK3S || PPC_8xx || 40x) && !PPC_PS3 && !HIBERNATION

But then the ppc64_defconfig would be built without STRICT_KERNEL_RWX.

I could do this in ps3_defconfig:

+# CONFIG_STRICT_KERNEL_RWX is not set
+# CONFIG_STRICT_MODULE_RWX is not set

But I don't like that way because it seems too easy for users to not add those into a custom kernel config, and then they need to figure out what to do after their kernel panics on startup.

What other 'clean' way is there?

-Geoff

#4 lore raw

Re: [PATCH v2 1/2] powerpc/ps3: Change updateboltedpp panic to info

Quoted 9 lines · Geoff Levand
Quoted 8 lines · Christophe Leroy
Quoted 4 lines · Geoff Levand

Commit fdacae8a84024474afff234bdd1dbe19ad597a10 (powerpc: Activate CONFIG_STRICT_KERNEL_RWX by default) causes ps3_hpte_updateboltedpp() to be called. Change the panic statment in ps3_hpte_updateboltedpp() to a pr_info statement so that bootup can continue.

Quoted 7 lines
Quoted 4 lines

But if I understand correctly, it means that CONFIG_STRICT_KERNEL_RWX won't work then.

So, shouldn't we keep the panic and forbid CONFIG_STRICT_KERNEL_RWX on PS3 ?

mmu_hash_ops.updateboltedpp returns void, so I can't return an error code to indicate the feature is not supported.

We could change that in the medium term.

Quoted 6 lines

I could do something like this in arch/powerpc/Kconfig:

(quoted diff) +1 -1
-       select ARCH_HAS_STRICT_KERNEL_RWX       if (PPC_BOOK3S || PPC_8xx || 40x) && !HIBERNATION
+       select ARCH_HAS_STRICT_KERNEL_RWX       if (PPC_BOOK3S || PPC_8xx || 40x) && !PPC_PS3 && !HIBERNATION

But then the ppc64_defconfig would be built without STRICT_KERNEL_RWX.

Yeah that would be a pity.

We could do the above and disable PS3 in ppc64_defconfig, allowing ppc64_defconfig to still have STRICT_KERNEL_RWX.

I assume actual PS3 users would use a ps3_defconfig anyway right?

Relatedly are there any actual PS3 users left? ;)

Quoted 8 lines

I could do this in ps3_defconfig:

(quoted diff) +2 -0
+# CONFIG_STRICT_KERNEL_RWX is not set
+# CONFIG_STRICT_MODULE_RWX is not set

But I don't like that way because it seems too easy for users to not add those into a custom kernel config, and then they need to figure out what to do after their kernel panics on startup.

Yep agreed.

Quoted 1 line

What other 'clean' way is there?

If we want to have a multi-platform kernel image that can boot on PS3 and other platforms, and have strict kernel RWX, then we need some runtime logic to deal with that.

I'd rather not do that though, because it adds complexity to deal with a pretty obscure corner case, and I suspect no one really boots a ppc64_defconfig on actual PS3 hardware these days.

So my preference is we disable PS3 in ppc64_defconfig, and make PS3 incompatible with STRICT_KERNEL_RWX.

cheers

author maintainer
#5 lore raw

Re: [PATCH v2 1/2] powerpc/ps3: Change updateboltedpp panic to info

Hi,

Quoted 25 lines · Michael Ellerman
Quoted 9 lines · Geoff Levand
Quoted 8 lines · Christophe Leroy
Quoted 4 lines · Geoff Levand

Commit fdacae8a84024474afff234bdd1dbe19ad597a10 (powerpc: Activate CONFIG_STRICT_KERNEL_RWX by default) causes ps3_hpte_updateboltedpp() to be called. Change the panic statment in ps3_hpte_updateboltedpp() to a pr_info statement so that bootup can continue.

Quoted 7 lines
Quoted 4 lines

But if I understand correctly, it means that CONFIG_STRICT_KERNEL_RWX won't work then.

So, shouldn't we keep the panic and forbid CONFIG_STRICT_KERNEL_RWX on PS3 ?

mmu_hash_ops.updateboltedpp returns void, so I can't return an error code to indicate the feature is not supported.

We could change that in the medium term.

Quoted 5 lines

I could do something like this in arch/powerpc/Kconfig:

(quoted diff) +1 -1
-       select ARCH_HAS_STRICT_KERNEL_RWX       if (PPC_BOOK3S || PPC_8xx || 40x) && !HIBERNATION
+       select ARCH_HAS_STRICT_KERNEL_RWX       if (PPC_BOOK3S || PPC_8xx || 40x) && !PPC_PS3 && !HIBERNATION
Quoted 6 lines
Quoted 1 line

But then the ppc64_defconfig would be built without STRICT_KERNEL_RWX.

Yeah that would be a pity.

We could do the above and disable PS3 in ppc64_defconfig, allowing ppc64_defconfig to still have STRICT_KERNEL_RWX.

I really want to keep PS3 included in ppc64_defconfig. Not that I expect anyone to boot a ppc64_defconfig kernel on PS3, but that is one of the 'standard' configs that is built by some automated builders, and generally by anyone doing changes to the powerpc arch, and I want to keep getting those build tests for PS3.

Quoted 1 line

I assume actual PS3 users would use a ps3_defconfig anyway right?

Yeah, a derivative of it. They are most likely are using 'Jailbreak' firmware that allows them to run Linux in the gameos partition.

Quoted 1 line

Relatedly are there any actual PS3 users left? ;)

It seems there are more users now than a few years ago. I think they buy PS5s to play the latest games, and use their old console to mess around with Linux. I generally get a private inquiry every 3 or 4 weeks. Usually asking how to update their kernel, or how to install a modern distro.

Quoted 6 lines
Quoted 1 line

What other 'clean' way is there?

If we want to have a multi-platform kernel image that can boot on PS3 and other platforms, and have strict kernel RWX, then we need some runtime logic to deal with that.

Quoted 6 lines

I'd rather not do that though, because it adds complexity to deal with a pretty obscure corner case, and I suspect no one really boots a ppc64_defconfig on actual PS3 hardware these days.

So my preference is we disable PS3 in ppc64_defconfig, and make PS3 incompatible with STRICT_KERNEL_RWX.

As mentioned, I'd really like to keep PS3 included in ppc64_defconfig. My original patch that basically just ignores the call to mmu_hash_ops.updateboltedpp allows that, and I haven't experienced any problems with it yet.

My preference would be to keep PS3 in ppc64_defconfig, and either apply my original patch, or I keep that patch in my ps3-linux repo on kernel.org. Then, if we end up adding runtime support for RWX I then fixup PS3 to use that.

-Geoff

#6 lore raw

Re: [PATCH v2 1/2] powerpc/ps3: Change updateboltedpp panic to info

Le 16/01/2023 à 21:08, Geoff Levand a écrit :

Quoted 63 lines

Hi,

Quoted 25 lines · Michael Ellerman
Quoted 9 lines · Geoff Levand
Quoted 8 lines · Christophe Leroy
Quoted 4 lines · Geoff Levand

Commit fdacae8a84024474afff234bdd1dbe19ad597a10 (powerpc: Activate CONFIG_STRICT_KERNEL_RWX by default) causes ps3_hpte_updateboltedpp() to be called. Change the panic statment in ps3_hpte_updateboltedpp() to a pr_info statement so that bootup can continue.

Quoted 7 lines
Quoted 4 lines

But if I understand correctly, it means that CONFIG_STRICT_KERNEL_RWX won't work then.

So, shouldn't we keep the panic and forbid CONFIG_STRICT_KERNEL_RWX on PS3 ?

mmu_hash_ops.updateboltedpp returns void, so I can't return an error code to indicate the feature is not supported.

We could change that in the medium term.

Quoted 5 lines

I could do something like this in arch/powerpc/Kconfig:

(quoted diff) +1 -1
-       select ARCH_HAS_STRICT_KERNEL_RWX       if (PPC_BOOK3S || PPC_8xx || 40x) && !HIBERNATION
+       select ARCH_HAS_STRICT_KERNEL_RWX       if (PPC_BOOK3S || PPC_8xx || 40x) && !PPC_PS3 && !HIBERNATION
Quoted 6 lines
Quoted 1 line

But then the ppc64_defconfig would be built without STRICT_KERNEL_RWX.

Yeah that would be a pity.

We could do the above and disable PS3 in ppc64_defconfig, allowing ppc64_defconfig to still have STRICT_KERNEL_RWX.

I really want to keep PS3 included in ppc64_defconfig. Not that I expect anyone to boot a ppc64_defconfig kernel on PS3, but that is one of the 'standard' configs that is built by some automated builders, and generally by anyone doing changes to the powerpc arch, and I want to keep getting those build tests for PS3.

Quoted 1 line

I assume actual PS3 users would use a ps3_defconfig anyway right?

Yeah, a derivative of it. They are most likely are using 'Jailbreak' firmware that allows them to run Linux in the gameos partition.

Quoted 1 line

Relatedly are there any actual PS3 users left? ;)

It seems there are more users now than a few years ago. I think they buy PS5s to play the latest games, and use their old console to mess around with Linux. I generally get a private inquiry every 3 or 4 weeks. Usually asking how to update their kernel, or how to install a modern distro.

Quoted 10 lines
Quoted 1 line

What other 'clean' way is there?

If we want to have a multi-platform kernel image that can boot on PS3 and other platforms, and have strict kernel RWX, then we need some runtime logic to deal with that.

I'd rather not do that though, because it adds complexity to deal with a pretty obscure corner case, and I suspect no one really boots a ppc64_defconfig on actual PS3 hardware these days.

Quoted 7 lines
Quoted 2 lines

So my preference is we disable PS3 in ppc64_defconfig, and make PS3 incompatible with STRICT_KERNEL_RWX.

As mentioned, I'd really like to keep PS3 included in ppc64_defconfig. My original patch that basically just ignores the call to mmu_hash_ops.updateboltedpp allows that, and I haven't experienced any problems with it yet.

When you say you have not experienced any problems with it, do you mean that STRICT_RWX works for you ? When you select CONFIG_DEBUG_RODATA_TEST it tells you that it works ? Otherwise it looks incorrect to enable something that doesn't work.

Quoted 5 lines

My preference would be to keep PS3 in ppc64_defconfig, and either apply my original patch, or I keep that patch in my ps3-linux repo on kernel.org. Then, if we end up adding runtime support for RWX I then fixup PS3 to use that.

In that case I see two solutions:
1/ Implement updateboltedpp for PS3.
2/ Implement arch_parse_debug_rodata() to always set rodata_enabled = false on PS3, and update free_initmem() to only call mark_initmem_nx() when strict_kernel_rwx_enabled() returns true.

Christophe

author maintainer
#7 lore raw

Re: [PATCH v2 1/2] powerpc/ps3: Change updateboltedpp panic to info

Quoted 11 lines · Christophe Leroy

Le 16/01/2023 à 21:08, Geoff Levand a écrit :

Quoted 5 lines

As mentioned, I'd really like to keep PS3 included in ppc64_defconfig. My original patch that basically just ignores the call to mmu_hash_ops.updateboltedpp allows that, and I haven't experienced any problems with it yet.

When you say you have not experienced any problems with it, do you mean that STRICT_RWX works for you ? When you select CONFIG_DEBUG_RODATA_TEST it tells you that it works ? Otherwise it looks incorrect to enable something that doesn't work.

What I mean is that the system boots up, and works as expected. I have not tried with CONFIG_DEBUG_RODATA_TEST set.

Quoted 7 lines
Quoted 4 lines

My preference would be to keep PS3 in ppc64_defconfig, and either apply my original patch, or I keep that patch in my ps3-linux repo on kernel.org. Then, if we end up adding runtime support for RWX I then fixup PS3 to use that.

In that case I see two solutions:
1/ Implement updateboltedpp for PS3.

I'm now looking into if this is possible.

Quoted 3 lines

2/ Implement arch_parse_debug_rodata() to always set rodata_enabled = false on PS3, and update free_initmem() to only call mark_initmem_nx() when strict_kernel_rwx_enabled() returns true.

OK, I'll consider this if I cannot get updateboltedp working.

-Geoff

#8 lore raw

Re: [PATCH v2 1/2] powerpc/ps3: Change updateboltedpp panic to info

Quoted 24 lines · Geoff Levand
Quoted 11 lines · Christophe Leroy

Le 16/01/2023 à 21:08, Geoff Levand a écrit :

Quoted 5 lines

As mentioned, I'd really like to keep PS3 included in ppc64_defconfig. My original patch that basically just ignores the call to mmu_hash_ops.updateboltedpp allows that, and I haven't experienced any problems with it yet.

When you say you have not experienced any problems with it, do you mean that STRICT_RWX works for you ? When you select CONFIG_DEBUG_RODATA_TEST it tells you that it works ? Otherwise it looks incorrect to enable something that doesn't work.

What I mean is that the system boots up, and works as expected. I have not tried with CONFIG_DEBUG_RODATA_TEST set.

Quoted 7 lines
Quoted 4 lines

My preference would be to keep PS3 in ppc64_defconfig, and either apply my original patch, or I keep that patch in my ps3-linux repo on kernel.org. Then, if we end up adding runtime support for RWX I then fixup PS3 to use that.

In that case I see two solutions:
1/ Implement updateboltedpp for PS3.

Quoted 7 lines

I'm now looking into if this is possible.

Quoted 3 lines

2/ Implement arch_parse_debug_rodata() to always set rodata_enabled = false on PS3, and update free_initmem() to only call mark_initmem_nx() when strict_kernel_rwx_enabled() returns true.

OK, I'll consider this if I cannot get updateboltedp working.

I'll take this series as-is for 6.3, there's no point panicking.

Hopefully one of the above options can be implemented in future.

cheers

#10 lore raw
In reply to Geoff Levand
Quoted 9 lines · Geoff Levand

This v2 series is just the two PS3 specific patches of the v1 series.

-Geoff

The following changes since commit 88603b6dc419445847923fcb7fe5080067a30f98:

Linux 6.2-rc2 (2023-01-01 13:53:16 -0800)

[...]

Applied to powerpc/next.

[1/2] powerpc/ps3: Change updateboltedpp panic to info

      https://git.kernel.org/powerpc/c/5705c6d97efc4aa9478fe2887fd911f60ddf17e5
[2/2] powerpc/ps3: Refresh ps3_defconfig
      https://git.kernel.org/powerpc/c/544f823ec7a34332550f22735959d3e1ffcf4684

cheers