[PATCH v2 1/2] powerpc/ps3: Change updateboltedpp panic to info
Michael Ellerman
mpe at ellerman.id.au
Mon Jan 16 11:06:24 AEDT 2023
Geoff Levand <geoff at infradead.org> writes:
> On 1/9/23 09:41, Christophe Leroy wrote:
>>
>>
>> Le 03/01/2023 à 18:51, Geoff Levand a écrit :
>>> 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 ?
>
> 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.
> 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.
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? ;)
> 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.
Yep agreed.
> 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
More information about the Linuxppc-dev
mailing list