Commit 90df4bfb authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

powerpc/64s: Machine check handle ifetch from foreign real address for POWER9

The i-side 0111b machine check, which is "Instruction Fetch to foreign
address space", was missed by 7b9f71f9 ("powerpc/64s: POWER9 machine
check handler").

    The POWER9 processor core considers host real addresses with a
    nonzero value in RA(8:12) as foreign address space, accessible only
    by the copy and paste instructions. The copy and paste instruction
    pair can be used to invoke the Nest accelerators via the Virtual
    Accelerator Switchboard (VAS).

It is an error for any regular load/store or ifetch to go to a foreign
addresses. When relocation is on, this causes an MMU exception. When
relocation is off, a machine check exception. It is possible to trigger
this machine check by branching to a foreign address with MSR[IR]=0.

Fixes: 7b9f71f9 ("powerpc/64s: POWER9 machine check handler")
Reported-by: default avatarMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 58d876fa
...@@ -90,13 +90,14 @@ enum MCE_UserErrorType { ...@@ -90,13 +90,14 @@ enum MCE_UserErrorType {
enum MCE_RaErrorType { enum MCE_RaErrorType {
MCE_RA_ERROR_INDETERMINATE = 0, MCE_RA_ERROR_INDETERMINATE = 0,
MCE_RA_ERROR_IFETCH = 1, MCE_RA_ERROR_IFETCH = 1,
MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH = 2, MCE_RA_ERROR_IFETCH_FOREIGN = 2,
MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH_FOREIGN = 3, MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH = 3,
MCE_RA_ERROR_LOAD = 4, MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH_FOREIGN = 4,
MCE_RA_ERROR_STORE = 5, MCE_RA_ERROR_LOAD = 5,
MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE = 6, MCE_RA_ERROR_STORE = 6,
MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE_FOREIGN = 7, MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE = 7,
MCE_RA_ERROR_LOAD_STORE_FOREIGN = 8, MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE_FOREIGN = 8,
MCE_RA_ERROR_LOAD_STORE_FOREIGN = 9,
}; };
enum MCE_LinkErrorType { enum MCE_LinkErrorType {
......
...@@ -268,6 +268,7 @@ void machine_check_print_event_info(struct machine_check_event *evt, ...@@ -268,6 +268,7 @@ void machine_check_print_event_info(struct machine_check_event *evt,
static const char *mc_ra_types[] = { static const char *mc_ra_types[] = {
"Indeterminate", "Indeterminate",
"Instruction fetch (bad)", "Instruction fetch (bad)",
"Instruction fetch (foreign)",
"Page table walk ifetch (bad)", "Page table walk ifetch (bad)",
"Page table walk ifetch (foreign)", "Page table walk ifetch (foreign)",
"Load (bad)", "Load (bad)",
......
...@@ -236,6 +236,9 @@ static const struct mce_ierror_table mce_p9_ierror_table[] = { ...@@ -236,6 +236,9 @@ static const struct mce_ierror_table mce_p9_ierror_table[] = {
{ 0x00000000081c0000, 0x0000000000180000, true, { 0x00000000081c0000, 0x0000000000180000, true,
MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_IFETCH, MCE_ERROR_TYPE_UE, MCE_UE_ERROR_PAGE_TABLE_WALK_IFETCH,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, },
{ 0x00000000081c0000, 0x00000000001c0000, true,
MCE_ERROR_TYPE_RA, MCE_RA_ERROR_IFETCH_FOREIGN,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, },
{ 0x00000000081c0000, 0x0000000008000000, true, { 0x00000000081c0000, 0x0000000008000000, true,
MCE_ERROR_TYPE_LINK,MCE_LINK_ERROR_IFETCH_TIMEOUT, MCE_ERROR_TYPE_LINK,MCE_LINK_ERROR_IFETCH_TIMEOUT,
MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, }, MCE_INITIATOR_CPU, MCE_SEV_ERROR_SYNC, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment