Page MenuHomeFreeBSD

powerpc: Add Hypervisor Maintenance Interrupt handler
ClosedPublic

Authored by jhibbits on Mar 19 2019, 3:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 9:51 PM
Unknown Object (File)
Jan 13 2024, 3:27 AM
Unknown Object (File)
Dec 20 2023, 5:44 AM
Unknown Object (File)
Nov 6 2023, 2:30 AM
Unknown Object (File)
Nov 4 2023, 4:54 AM
Unknown Object (File)
Oct 19 2023, 3:21 AM
Unknown Object (File)
Oct 5 2023, 1:26 AM
Unknown Object (File)
Oct 3 2023, 4:52 AM
Subscribers

Details

Summary

Attempting to build www/firefox on POWER9 resulted in a HMI exception
being thrown, a fatal trap currently. This is typically caused by timer
facility errors, but examination of the Hypervisor Maintenance Exception
Register (HMER) yielded only that an exception had recovered, with no
information of the actual exception cause.

When an HMI occurs, OPAL_HANDLE_HMI or OPAL_HANDLE_HMI2 must be called
to handle the exception at the firmware level. If the exception is
handled, we can continue.

This adds only the preliminary handler, enough to prevent package
building from panicking. An enhancement in the future is to use the
flags returned by OPAL_HANDLE_HMI2 to print more useful error messages.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

The code looks good to me.
But I'm not sure if it is better to handle this in interrupt.c or trap.c. Why do you think it fits better in interrupt.c?

Also, let me first see how this patch behaves on POWER8 systems.

I'm on the fence between interrupt.c and trap.c. I put it in interrupt.c for the following reasons:

a) Avoid duplicating code between the user and kernel checks
b) Avoid enabling the EE bit when handling the HMI

Neither are critical, I think, so if there are strong feelings one way or another I can yield to it.

I'm on the fence between interrupt.c and trap.c. I put it in interrupt.c for the following reasons:

a) Avoid duplicating code between the user and kernel checks
b) Avoid enabling the EE bit when handling the HMI

Neither are critical, I think, so if there are strong feelings one way or another I can yield to it.

Ok, I don't have a strong opinion in favor or against it being on interrupt.c or trap.c. Given the 2 reasons above, for me it's fine to leave the handling on interrupt.c.

I've also checked that the issue happens on POWER8 and that this change fixes it.
Good job!

This revision is now accepted and ready to land.Mar 20 2019, 7:16 PM
This revision was automatically updated to reflect the committed changes.