summaryrefslogtreecommitdiffstats
path: root/hw/npu.c
diff options
context:
space:
mode:
authorRussell Currey <ruscur@russell.cc>2016-06-20 16:40:48 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-06-21 15:03:34 +1000
commit6c901540aba739b6540f5b88f97e92025b00a989 (patch)
tree616188ac041c81b0e89bc35cb3d72cdfbef0d5f8 /hw/npu.c
parent5f3d23fe32068a678973902c3029087fd9f65823 (diff)
downloadtalos-skiboot-6c901540aba739b6540f5b88f97e92025b00a989.tar.gz
talos-skiboot-6c901540aba739b6540f5b88f97e92025b00a989.zip
nvlink: Enable NPU device BAR before triggering freeze
NPU freeze injection works by performing an invalid MMIO read on the NPU device BAR. If the BAR isn't enabled, which is the case when the appropriate driver isn't loaded, this checkstops the machine. Work around this by making sure the BAR is enabled before performing the read. The idea of an error inject doing anything other than an error inject isn't great, but it's better than unintentionally crashing your machine. Also, fix the comment incorrectly stating the operation was a write instead of a read. Signed-off-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/npu.c')
-rw-r--r--hw/npu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/npu.c b/hw/npu.c
index 67b86c0e..d838cc1c 100644
--- a/hw/npu.c
+++ b/hw/npu.c
@@ -1128,7 +1128,10 @@ static int64_t npu_err_inject(struct phb *phb, uint32_t pe_num,
/* Emulate fence mode. */
p->fenced = true;
} else {
- /* Cause a freeze with an invalid MMIO write. */
+ /* Cause a freeze with an invalid MMIO read. If the BAR is not
+ * enabled, this will checkstop the machine.
+ */
+ npu_dev_bar_update(p->chip_id, &dev->bar, true);
in_be64((void *)dev->bar.base);
}
OpenPOWER on IntegriCloud