diff options
author | Alistair Popple <alistair@popple.id.au> | 2017-06-05 12:03:24 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-06-06 17:59:45 +1000 |
commit | 682da462cdcd79b668c2f1999bb9cf955cbef63d (patch) | |
tree | aaef40dd981ad53f87d31a1d49097a39dbe9f43c /hw/npu2.c | |
parent | d35084ef2b94d6ad293bc02fcdf1a30b78b02930 (diff) | |
download | skiboot-682da462cdcd79b668c2f1999bb9cf955cbef63d.zip skiboot-682da462cdcd79b668c2f1999bb9cf955cbef63d.tar.gz skiboot-682da462cdcd79b668c2f1999bb9cf955cbef63d.tar.bz2 |
hw/npu2.c: Fix opal_npu_map_lpar to search for existing BDF
opal_npu_map_lpar is used to setup mappings for a given GPU BDF to handle XTS
address translation requests. This call was incorrectly searching for existing
mappings based on lparid instead of bdf resulting in table entries being
incorrectly overwritten. This call should instead search for existing mappings
to update using the GPU BDF.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/npu2.c')
-rw-r--r-- | hw/npu2.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1799,11 +1799,11 @@ static int opal_npu_map_lpar(uint64_t phb_id, uint64_t bdf, uint64_t lparid, /* Find any existing entries and update them */ xts_bdf_lpar = SETFIELD(NPU2_XTS_BDF_MAP_VALID, 0UL, 1); - xts_bdf_lpar = SETFIELD(NPU2_XTS_BDF_MAP_LPARID, xts_bdf_lpar, lparid); + xts_bdf_lpar = SETFIELD(NPU2_XTS_BDF_MAP_BDF, xts_bdf_lpar, bdf); id = npu_table_search(p, NPU2_XTS_BDF_MAP, 8, NPU2_XTS_BDF_MAP_SIZE, &xts_bdf_lpar, NPU2_XTS_BDF_MAP_VALID | - NPU2_XTS_BDF_MAP_LPARID); + NPU2_XTS_BDF_MAP_BDF); if (id < 0) { /* No existing mapping found, find space for a new one */ xts_bdf_lpar = 0; |