[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/41] ppc/xive: check return value of ldq_be_dma()
From: |
Cédric Le Goater |
Subject: |
[PULL 07/41] ppc/xive: check return value of ldq_be_dma() |
Date: |
Mon, 31 Jan 2022 12:07:37 +0100 |
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é <f4bug@amsat.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220124081635.3672439-1-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/intc/pnv_xive.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c
index bb207514f2dd..621b20a03f5f 100644
--- a/hw/intc/pnv_xive.c
+++ b/hw/intc/pnv_xive.c
@@ -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
--
2.34.1
- [PULL 01/41] spapr: Force 32bit when resetting a core, (continued)
- [PULL 01/41] spapr: Force 32bit when resetting a core, Cédric Le Goater, 2022/01/31
- [PULL 30/41] target/ppc: books: Machine Check exception cleanup, Cédric Le Goater, 2022/01/31
- [PULL 05/41] ppc/pnv: use a do-while() loop in pnv_phb3_translate_tve(), Cédric Le Goater, 2022/01/31
- [PULL 16/41] target/ppc: Introduce powerpc_excp_40x, Cédric Le Goater, 2022/01/31
- [PULL 12/41] hw/ppc/vof: Add missing includes, Cédric Le Goater, 2022/01/31
- [PULL 38/41] target/ppc: 74xx: System Call exception cleanup, Cédric Le Goater, 2022/01/31
- [PULL 29/41] target/ppc: Simplify powerpc_excp_books, Cédric Le Goater, 2022/01/31
- [PULL 41/41] target/ppc: Remove support for the PowerPC 602 CPU, Cédric Le Goater, 2022/01/31
- [PULL 24/41] target/ppc: 405: Data Storage exception cleanup, Cédric Le Goater, 2022/01/31
- [PULL 40/41] target/ppc: 74xx: Set SRRs directly in exception code, Cédric Le Goater, 2022/01/31
- [PULL 07/41] ppc/xive: check return value of ldq_be_dma(),
Cédric Le Goater <=
- [PULL 02/41] target/ppc: 603: fix restore of GPRs 0-3 on rfi, Cédric Le Goater, 2022/01/31
- Re: [PULL 02/41] target/ppc: 603: fix restore of GPRs 0-3 on rfi, Cédric Le Goater, 2022/01/31
- Re: [PULL 02/41] target/ppc: 603: fix restore of GPRs 0-3 on rfi, Mark Cave-Ayland, 2022/01/31
[PULL 36/41] target/ppc: 74xx: External interrupt cleanup, Cédric Le Goater, 2022/01/31
[PULL 31/41] target/ppc: books: External interrupt cleanup, Cédric Le Goater, 2022/01/31