Page MenuHomeFreeBSD

Add support for the XIVE XICS emulation mode for POWER9 systems
ClosedPublic

Authored by jhibbits on May 19 2018, 7:58 PM.

Details

Summary

POWER9 systems use a new interrupt controller, XIVE, managed through OPAL
firmware calls. The OPAL firmware includes support for emulating the previous
generation XICS presentation layer in addition to a new "XIVE Exploitation"
mode. As a stopgap until we have XIVE exploitation mode, enable XICS emulation
mode so that we at least have an interrupt controller.

Since the CPPR is local to the current CPU, it cannot be updated for APs when
initializing on the BSP. This adds a new function, directly called by the
powernv platform code, to initialize the CPPR on AP bringup.

Diff Detail

Repository
rS 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

sys/powerpc/aim/mp_cpudep.c
99 ↗(On Diff #42743)

HVICE is a reserved bit on POWER8 (ISA 2.07) and should be set only on POWER9 (Power ISA 3+). This should probably be some switch on the ISA version from CPU features rather than the PVR, anyway.

406 ↗(On Diff #42743)

Ditto here with respect to POWER8.

sys/powerpc/include/spr.h
238 ↗(On Diff #42743)

Note that this is only in ISA >= 3?

sys/powerpc/powernv/platform_powernv.c
156 ↗(On Diff #42743)

See: POWER ISA 3 comments.

465 ↗(On Diff #42743)

This method is called only on APs, so no need for this if.

466 ↗(On Diff #42743)

Why not do this inline? I assume this whole mode will be removed once XIVE support lands.

sys/powerpc/pseries/xics.c
563 ↗(On Diff #42743)

This is guaranteed to the be the root PIC. Why not rely on that?

sys/powerpc/aim/mp_cpudep.c
99 ↗(On Diff #42743)

Easy enough to address. I'll set up a 'lpcr' variable at platform init time appropriate for the CPU (can use cpu_featuers at this point, since it's initialized much earlier than platform)

sys/powerpc/include/spr.h
238 ↗(On Diff #42743)

Can do, will do

sys/powerpc/pseries/xics.c
563 ↗(On Diff #42743)

True, I could do that. I went this route as a sort of seatbelt, but it's probably overkill.

Address Nathan's comments

  • Use root_pic instead of locally stored PIC reference.
  • Create a lpcr variable to hold the LPCR config, which is different from 2.0x and 3.0.

See the comment on line 467 about powernv_smp_ap_init(). Otherwise, looks good.

sys/powerpc/powernv/platform_powernv.c
157 ↗(On Diff #42751)

Shouldn't this be earlier/elsewhere? It's not exactly PowerNV specific (insofar as PowerNV means "opal + FDT"). This is not a blocking comment, though.

Check the BSP by first getting the BSP, rather than relying on special knowledge.

sys/powerpc/powernv/platform_powernv.c
157 ↗(On Diff #42752)

This double-sets LPCR_HVICE.

470 ↗(On Diff #42752)

This doesn't work. PCPU fields aren't set until after this function is called on the BSP.

This revision is now accepted and ready to land.May 20 2018, 3:21 AM
This revision was automatically updated to reflect the committed changes.