[Skiboot] [PATCH skiboot] npu2/tce: Fix page size checking

Alexey Kardashevskiy aik at ozlabs.ru
Mon Feb 5 17:46:26 AEDT 2018


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 at ozlabs.ru>
---
 hw/npu2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/npu2.c b/hw/npu2.c
index c88394b..806f848 100644
--- a/hw/npu2.c
+++ b/hw/npu2.c
@@ -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);
-- 
2.11.0



More information about the Skiboot mailing list