Page MenuHomeFreeBSD

Add MIPS_ALLOW_PAGE_ALIASING option.
AbandonedPublic

Authored by brooks on May 13 2017, 12:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 2 2024, 4:36 PM
Unknown Object (File)
Feb 19 2024, 10:05 PM
Unknown Object (File)
Dec 20 2023, 7:58 AM
Unknown Object (File)
Nov 15 2023, 11:18 PM
Unknown Object (File)
Nov 10 2023, 3:04 PM
Unknown Object (File)
Nov 5 2023, 11:25 AM
Unknown Object (File)
Nov 1 2023, 2:24 AM
Unknown Object (File)
Oct 14 2023, 10:17 PM
Subscribers
None

Details

Summary

Use this option to enable buffer cache improvements on hardware the supports it and to enable shared page support on that hardware.

Share page support currently has the sole effect of moving the signal trampoline to
the shared page. If MIPS had execute permissions on pages this would
allow the default stack to be R/W rather than R/W/X.

Obtained from: CheriBSD
Sponsored by: DARPA, AFRL

Test Plan

Needs testing on mips (32) and testing of COMPAT32. Testing for mips64
on CheriBSD

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 15552
Build 15590: arc lint + arc unit

Event Timeline

The patch as-is is fine for MIPSes which are not 74K.

Issue is that shared page double-mapped, or even N-way mapped. One mapping is in for kernel, and another mappings are at ABI-determined addresses, at the top of the user AS. Apparently, MIPS pmap has very serious bug, manifesting on 24K/74K cores where cache is VIVT and can be aliased. Pmap does not handle this and indeed allows aliasing to corrupt the data.

Please see the heated discussion of r307626 and papering-over in r308662. In other words, SV_TIMEKEEP would have severe troubles on MIPS, and SV_SHP might require at least data cache invalidation and global instruction cache invalidation after trampoline is copied to the shared page.

  • Make MIPS shared page support optional.
  • Shared page support works fine on QEMU MALTA so enable there.
sys/mips/conf/std.MALTA
31

Might be, rename the option to something more generic and also utilize it for kern/vfs_bio.c:4706 (it is the same phenomenon/bug, after all) ?

sys/mips/include/vmparam.h
100–101

I just noted the comment above, not sure if it should be somehow comply with.

  • Rebase
  • Rename option and use to enable buffer cache improvments.
brooks retitled this revision from Enable shared page support on mips. to Add MIPS_ALLOW_PAGE_ALIASING option..Mar 3 2018, 2:07 AM
brooks edited the summary of this revision. (Show Details)
brooks marked an inline comment as done.

Note that MIPS MD in no way disables creating aliases, it just silently corrupts aliased memory.

Might be, MIPS_USE_PAGE_ALIASING would be better name.

This revision is now accepted and ready to land.Mar 3 2018, 10:51 AM
  • s/MIPS_ALLOW_PAGE_ALIASING/MIPS_USE_PAGE_ALIASING/
This revision now requires review to proceed.Mar 13 2018, 8:02 PM