ppc/xive: check return value of ldq_be_dma()
PATCH 1/1 ppc/xive: check return value of ldq_be_dma()
The ldq_be_dma() routine was recently changed to return a result of the transaction. Use it when loading the virtual structure descriptors in the XIVE PowerNV model.
Cc Philippe Mathieu-Daudé <[email protected]>
Signed-off-by Cédric Le Goater <[email protected]>
--- hw/intc/pnv_xive.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
hw/intc/pnv_xive.c +18 -4
@@ -172,7 +172,12 @@ static uint64_t pnv_xive_vst_addr_indirect(PnvXive *xive, uint32_t type,/* Get the page size of the indirect table. */ vsd_addr = vsd &VSD_ADDRESS_MASK ; -ldq_be_dma (&address_space_memory, vsd_addr, &vsd,MEMTXATTRS_UNSPECIFIED ); +if (ldq_be_dma (&address_space_memory, vsd_addr, &vsd, +MEMTXATTRS_UNSPECIFIED )) { +xive_error (xive,"VST: failed to access %s entry %x @0x%" PRIx64, + info->name, idx, vsd_addr); +return 0 ; + }if (!(vsd &VSD_ADDRESS_MASK )) {#ifdef XIVE_DEBUG
@@ -195,8 +200,12 @@ static uint64_t pnv_xive_vst_addr_indirect(PnvXive *xive, uint32_t type,/* Load the VSD we are looking for, if not already done */ if (vsd_idx) { vsd_addr = vsd_addr + vsd_idx *XIVE_VSD_SIZE ; -ldq_be_dma (&address_space_memory, vsd_addr, &vsd, -MEMTXATTRS_UNSPECIFIED ); +if (ldq_be_dma (&address_space_memory, vsd_addr, &vsd, +MEMTXATTRS_UNSPECIFIED )) { +xive_error (xive,"VST: failed to access %s entry %x @0x%" + PRIx64, info->name, vsd_idx, vsd_addr); +return 0 ; + }if (!(vsd &VSD_ADDRESS_MASK )) {#ifdef XIVE_DEBUG
@@ -543,7 +552,12 @@ static uint64_t pnv_xive_vst_per_subpage(PnvXive *xive, uint32_t type)/* Get the page size of the indirect table. */ vsd_addr = vsd &VSD_ADDRESS_MASK ; -ldq_be_dma (&address_space_memory, vsd_addr, &vsd,MEMTXATTRS_UNSPECIFIED ); +if (ldq_be_dma (&address_space_memory, vsd_addr, &vsd, +MEMTXATTRS_UNSPECIFIED )) { +xive_error (xive,"VST: failed to access %s entry @0x%" PRIx64, + info->name, vsd_addr); +return 0 ; + }if (!(vsd &VSD_ADDRESS_MASK )) {#ifdef XIVE_DEBUG
Signature · 1 line
2.31.1