Page MenuHomeFreeBSD

powerpc64: change CAS to support Radix MMU
ClosedPublic

Authored by luporl on Mon, Sep 13, 6:53 PM.

Details

Summary

Use radix_mmu environment variable to select between Hash or Radix MMU, when performing the CAS method call.

This matches kernel's behavior, by selecting Hash MMU by default and Radix if radix_mmu is not zero, to make sure that both loader and kernel always select the same MMU.

If the detected CPU is not a POWER9, then Hash MMU is selected, regardless of radix_mmu value, as in kernel.

Test Plan

Tested on QEMU pseries with KVM, selecting both Hash and Radix MMUs.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

stand/powerpc/ofw/cas.c
239

Defaulting off for radix_mmu, even on power9?

stand/powerpc/ofw/cas.c
239

Yes, we are holding making radix default because of D31232. BTW, do you think it is ok to commit it already?

When it lands, there is already D30797 to make radix default. Then we can just get back here and make it default in loader too.

jhibbits added inline comments.
stand/powerpc/ofw/cas.c
239

That's all I wanted to know, thanks!

This revision is now accepted and ready to land.Tue, Sep 14, 2:00 PM

Query device tree for Radix/GTSE support, instead of using CPU version and HV bit checks, as this is a better approach, as discussed in IRC.

This revision now requires review to proceed.Wed, Sep 15, 2:43 PM
stand/powerpc/ofw/cas.c
31–32

Why not make this a #ifdef instead?

Address reviewer's comments

luporl added inline comments.
stand/powerpc/ofw/cas.c
31–32

Ok, I've used #if just because it's a bit less typing to enable/disable it.

luporl marked an inline comment as done.
This revision is now accepted and ready to land.Wed, Sep 15, 5:48 PM

Don't forget to update the commit message, with the latest changes you made.

This revision was automatically updated to reflect the committed changes.