Page MenuHomeFreeBSD

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

Authored by jhibbits on May 19 2018, 7:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 2:30 AM
Unknown Object (File)
Sun, Nov 17, 9:15 AM
Unknown Object (File)
Oct 18 2024, 7:53 AM
Unknown Object (File)
Oct 18 2024, 7:53 AM
Unknown Object (File)
Oct 18 2024, 7:53 AM
Unknown Object (File)
Oct 18 2024, 7:53 AM
Unknown Object (File)
Oct 18 2024, 7:52 AM
Unknown Object (File)
Oct 18 2024, 7:52 AM
Subscribers

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 - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16712
Build 16606: arc lint + arc unit

Event Timeline

sys/powerpc/aim/mp_cpudep.c
99

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

Ditto here with respect to POWER8.

sys/powerpc/include/spr.h
238

Note that this is only in ISA >= 3?

sys/powerpc/powernv/platform_powernv.c
156–159

See: POWER ISA 3 comments.

465

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

466

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

sys/powerpc/pseries/xics.c
561

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

sys/powerpc/aim/mp_cpudep.c
99

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

Can do, will do

sys/powerpc/pseries/xics.c
561

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

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

This double-sets LPCR_HVICE.

467

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.