Page MenuHomeFreeBSD

[PowerPC] Kernel 64-bit atomics emulation for PPC32
ClosedPublic

Authored by bdragon on Dec 30 2019, 10:22 PM.
Referenced Files
Unknown Object (File)
Fri, Nov 28, 3:20 PM
Unknown Object (File)
Tue, Nov 25, 8:51 PM
Unknown Object (File)
Thu, Nov 20, 8:09 PM
Unknown Object (File)
Thu, Nov 20, 4:28 PM
Unknown Object (File)
Thu, Nov 20, 4:27 PM
Unknown Object (File)
Thu, Nov 20, 4:26 PM
Unknown Object (File)
Thu, Nov 20, 4:15 PM
Unknown Object (File)
Thu, Nov 13, 11:33 PM
Subscribers

Details

Summary

Here is the kernel side of the 64-bit atomics emulation needed for D22827 and other optimizations.

jhibbits did the main work, this is just a cleanup and split to kernel-side only.

Tested on an iBook G4 with D22827 applied.

Test Plan
  • Excercise all atomics from a test module?

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/kern/subr_atomic64.c
1

Since this is being done only for powerpc, should this not be moved to sys/powerpc/powerpc instead?

sys/sys/_atomic64e.h
1

Same as above for this. And then it could be moved into sys/powerpc/include/atomic.h even.

sys/sys/_atomic64e.h
1

I think it's not unlikely that some other 32bit platform may find it useful.

If it makes sense to move them to sys/powerpc later, we can do that.

sys/sys/_atomic64e.h
1

I agree. But if none others will make use of them (I've heard mips32 is UP only, so would probably take a much different route for atomic64), it doesn't make sense to keep it generic.

But, I won't block the review on that.

This revision is now accepted and ready to land.Jan 2 2020, 6:48 PM

I'd add Kyle Evans to this review.
Mips32 does have SMP, but the specific core has 64bit atomics if anybody wants to revive it.

sys/kern/subr_atomic64.c
1

Kyle is working on this for mips32 too...

sys/sys/_atomic64e.h
39

Maybe rename this to HAS_EMULATED_ATOMIC64 or something like that since we'll use it for mips, too.

jeff added inline comments.
sys/kern/subr_atomic64.c
57

There is alright a macro for this. CACHE_LINE_SIZE

sys/sys/_atomic64e.h
44

These declarations should also be included in the above _KERNEL check to hide them from userland

sys/kern/subr_atomic64.c
57

We need to make sure this can be option in kernel config file... unless CACHE LINE SIZE already does that...