Skip to contentSkip to conversation

New: Warning: Unable to mark rodata read only on this CPU. (PPC970MP)

Bug 215621 [email protected] 1 participant 5 messages Feb 19, 2022 – Feb 21, 2022

lore
Share & tools
lore
#0 lore raw

https://bugzilla.kernel.org/show_bug.cgi?id=215621

            Bug ID: 215621
           Summary: Warning: Unable to mark rodata read only on this CPU.
                    (PPC970MP)
           Product: Platform Specific/Hardware
           Version: 2.5
    Kernel Version: 5.17-rc4
          Hardware: PPC-64
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: PPC-64
          Assignee: [email protected]
          Reporter: [email protected]
        Regression: No

Created attachment 300482
--> https://bugzilla.kernel.org/attachment.cgi?id=300482&action=edit
dmesg (5.17-rc4, PowerMac G5 11,2)

STRICT_MODULE_RWX is enabled in kernel but it does not seem to work on my PowerMac G5 11,2.

Kernel dmesg says:
[...]
Freeing unused kernel image (initmem) memory: 3968K
Warning: Unable to mark rodata read only on this CPU.
rodata_test: test data was not read only [...]

 # lscpu 
Architecture:          ppc64
  CPU op-mode(s):      32-bit, 64-bit
  Byte Order:          Big Endian
CPU(s):                2
  On-line CPU(s) list: 0,1
Model name:            PPC970MP, altivec supported
  Model:               1.1 (pvr 0044 0101)
  Thread(s) per core:  1
  Core(s) per socket:  2
  Socket(s):           1
  CPU max MHz:         2300.0000
  CPU min MHz:         1150.0000
Caches (sum of all):   
  L1d:                 64 KiB (2 instances)
  L1i:                 128 KiB (2 instances)
  L2:                  2 MiB (2 instances)
NUMA:                  
  NUMA node(s):        1
  NUMA node0 CPU(s):   0,1
Vulnerabilities:       
  Itlb multihit:       Not affected
  L1tf:                Vulnerable
  Mds:                 Not affected
  Meltdown:            Vulnerable
  Spec store bypass:   Vulnerable
  Spectre v1:          Mitigation; __user pointer sanitization
  Spectre v2:          Vulnerable
  Srbds:               Not affected
  Tsx async abort:     Not affected
Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#1 lore raw

[Bug 215621] Warning: Unable to mark rodata read only on this CPU. (PPC970MP)

https://bugzilla.kernel.org/show_bug.cgi?id=215621

--- Comment #1 from Erhard F. ([email protected]) --- Created attachment 300483
--> https://bugzilla.kernel.org/attachment.cgi?id=300483&action=edit
kernel .config (5.17-rc4, PowerMac G5 11,2)

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#2 lore raw

[Bug 215621] Warning: Unable to mark rodata read only on this CPU. (PPC970MP)

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=215621

Christophe Leroy ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |[email protected]

--- Comment #2 from Christophe Leroy ([email protected]) --- Look at
https://elixir.bootlin.com/linux/v5.17-rc4/source/arch/powerpc/kernel/cputable.c#L196
at you'll see that your processor has .mmu_features = MMU_FTRS_PPC970

Then you see at
https://elixir.bootlin.com/linux/v5.17-rc4/source/arch/powerpc/include/asm/mmu.h#L135
that MMU_FTRS_PPC970 doesn't include MMU_FTR_KERNEL_RO.

MMU_FTR_KERNEL_RO is in POWER6.

In commit 984d7a1ec67c ("powerpc/mm: Fixup kernel read only mapping") you see that this feature appears in ISA 2.04.

Previous version of ISA only has PP bits which only provides RW for kernel pages.

So this bug is not a bug, it's a limitation of PPC970MP, and the warning in dmesg is there to warn you that allthough you have select CONFIG_STRICT_KERNEL_RWX, this CPU doesn't support it.

And for the same reason, CONFIG_STRICT_MODULE_RWX doesn't work either.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#3 lore raw

[Bug 215621] Warning: Unable to mark rodata read only on this CPU. (PPC970MP)

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=215621

Erhard F. ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Erhard F. ([email protected]) --- Erm ok, so it seems I did not check this thoroughly...

If MMU_FTRS_PPC970 doesn't provide MMU_FTR_KERNEL_RO then perhaps CONFIG_STRICT_KERNEL_RWX can be skipped in the .config so it can't be wrongly selected?

Anyhow you are correct that this is not a bug. Thanks for the background!

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.
#4 lore raw

[Bug 215621] Warning: Unable to mark rodata read only on this CPU. (PPC970MP)

In reply to [email protected]

https://bugzilla.kernel.org/show_bug.cgi?id=215621

--- Comment #4 from Christophe Leroy ([email protected]) --- It is up to you to unselect CONFIG_STRICT_KERNEL_RWX.

The kernel is usually built to boot on any PPC64 processors, so we can't forbid the selection of CONFIG_STRICT_KERNEL_RWX.

Signature · 4 lines
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.