diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2018-02-05 17:46:26 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2018-02-08 18:21:42 -0600 |
commit | 893660c3e4ee52f5c3cba6e9d72c00d5e3283808 (patch) | |
tree | b2f9bba8e54ba1d4537191d170f4075a5a19e865 | |
parent | fd5d3fea1e540e9275207d2a9d3bb20181ca904f (diff) | |
download | skiboot-893660c3e4ee52f5c3cba6e9d72c00d5e3283808.zip skiboot-893660c3e4ee52f5c3cba6e9d72c00d5e3283808.tar.gz skiboot-893660c3e4ee52f5c3cba6e9d72c00d5e3283808.tar.bz2 |
npu2/tce: Fix page size checking
The page size is encoded in the TVT data [59:63] as @shift+11 but
the tce_kill handler does not do the math right; this fixes it.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-By: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | hw/npu2.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1256,7 +1256,9 @@ static int64_t npu2_tce_kill(struct phb *phb, uint32_t kill_type, sync(); switch(kill_type) { case OPAL_PCI_TCE_KILL_PAGES: - tce_page_size = GETFIELD(npu->tve_cache[pe_number], NPU2_ATS_IODA_TBL_TVT_PSIZE); + tce_page_size = 1ULL << ( + 11 + GETFIELD(npu->tve_cache[pe_number], + NPU2_ATS_IODA_TBL_TVT_PSIZE)); if (tce_page_size != tce_size) { NPU2ERR(npu, "npu2_tce_kill: Unexpected TCE size (got 0x%x expected 0x%x)\n", tce_size, tce_page_size); |