Skip to content

Commit 682da46

Browse files
apopplestewartsmith
authored andcommitted
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>
1 parent d35084e commit 682da46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hw/npu2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,11 +1799,11 @@ static int opal_npu_map_lpar(uint64_t phb_id, uint64_t bdf, uint64_t lparid,
17991799

18001800
/* Find any existing entries and update them */
18011801
xts_bdf_lpar = SETFIELD(NPU2_XTS_BDF_MAP_VALID, 0UL, 1);
1802-
xts_bdf_lpar = SETFIELD(NPU2_XTS_BDF_MAP_LPARID, xts_bdf_lpar, lparid);
1802+
xts_bdf_lpar = SETFIELD(NPU2_XTS_BDF_MAP_BDF, xts_bdf_lpar, bdf);
18031803
id = npu_table_search(p, NPU2_XTS_BDF_MAP, 8, NPU2_XTS_BDF_MAP_SIZE,
18041804
&xts_bdf_lpar,
18051805
NPU2_XTS_BDF_MAP_VALID |
1806-
NPU2_XTS_BDF_MAP_LPARID);
1806+
NPU2_XTS_BDF_MAP_BDF);
18071807
if (id < 0) {
18081808
/* No existing mapping found, find space for a new one */
18091809
xts_bdf_lpar = 0;

0 commit comments

Comments
 (0)