diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2019-01-11 15:03:35 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2019-02-18 22:12:37 -0600 |
commit | fd0950488f7f2c34e921888f69e76d75498078f2 (patch) | |
tree | 88ab224819b0c5bd1b20f02d5f07d6fc1f117a4a /core | |
parent | 639f67285c2cf2ca122638d2c7469da81236b365 (diff) | |
download | talos-skiboot-fd0950488f7f2c34e921888f69e76d75498078f2.tar.gz talos-skiboot-fd0950488f7f2c34e921888f69e76d75498078f2.zip |
opal: Deprecate reading the PHB status
The OPAL_PCI_EEH_FREEZE_STATUS call takes a bunch of parameters, one of
them is @phb_status. It is defined as __be64* and always NULL in
the current Linux upstream but if anyone ever decides to read that status,
then the PHB3's handler will assume it is struct OpalIoPhb3ErrorData*
(which is a lot bigger than 8 bytes) and zero it causing the stack
corruption; p7ioc-phb has the same issue.
This removes @phb_status from all eeh_freeze_status() hooks and moves
the error message from PHB4 to the affected OPAL handlers.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Reviewed-By: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/pci-opal.c | 14 | ||||
-rw-r--r-- | core/pci.c | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/core/pci-opal.c b/core/pci-opal.c index a4d6eeed..d7abb15b 100644 --- a/core/pci-opal.c +++ b/core/pci-opal.c @@ -111,8 +111,13 @@ static int64_t opal_pci_eeh_freeze_status(uint64_t phb_id, uint64_t pe_number, if (!phb->ops->eeh_freeze_status) return OPAL_UNSUPPORTED; phb_lock(phb); + + if (phb_status) + prlog(PR_ERR, "PHB#%04llx: %s: deprecated PHB status\n", + phb_id, __func__); + rc = phb->ops->eeh_freeze_status(phb, pe_number, freeze_state, - pci_error_type, NULL, phb_status); + pci_error_type, NULL); phb_unlock(phb); return rc; @@ -961,8 +966,13 @@ static int64_t opal_pci_eeh_freeze_status2(uint64_t phb_id, uint64_t pe_number, if (!phb->ops->eeh_freeze_status) return OPAL_UNSUPPORTED; phb_lock(phb); + + if (phb_status) + prlog(PR_ERR, "PHB#%04llx: %s: deprecated PHB status\n", + phb_id, __func__); + rc = phb->ops->eeh_freeze_status(phb, pe_number, freeze_state, - pci_error_type, severity, phb_status); + pci_error_type, severity); phb_unlock(phb); return rc; @@ -337,7 +337,7 @@ static void pci_check_clear_freeze(struct phb *phb) /* Retrieve the frozen state */ rc = phb->ops->eeh_freeze_status(phb, pe_number, &freeze_state, - &pci_error_type, &sev, NULL); + &pci_error_type, &sev); if (rc) return; if (freeze_state == OPAL_EEH_STOPPED_NOT_FROZEN) |