[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 32/35] ppc/xive: Use address_space routines to access the machine
From: |
Cédric Le Goater |
Subject: |
[PULL 32/35] ppc/xive: Use address_space routines to access the machine RAM |
Date: |
Mon, 4 Sep 2023 11:06:27 +0200 |
to log an error in case of bad configuration of the XIVE tables by the FW.
Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/intc/pnv_xive.c | 27 +++++++++++++++++++++++----
hw/intc/pnv_xive2.c | 27 +++++++++++++++++++++++----
2 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c
index e536b3ec26e5..b2bafd61b157 100644
--- a/hw/intc/pnv_xive.c
+++ b/hw/intc/pnv_xive.c
@@ -242,12 +242,20 @@ static int pnv_xive_vst_read(PnvXive *xive, uint32_t
type, uint8_t blk,
{
const XiveVstInfo *info = &vst_infos[type];
uint64_t addr = pnv_xive_vst_addr(xive, type, blk, idx);
+ MemTxResult result;
if (!addr) {
return -1;
}
- cpu_physical_memory_read(addr, data, info->size);
+ result = address_space_read(&address_space_memory, addr,
+ MEMTXATTRS_UNSPECIFIED, data,
+ info->size);
+ if (result != MEMTX_OK) {
+ xive_error(xive, "VST: read failed at @0x%" HWADDR_PRIx
+ " for VST %s %x/%x\n", addr, info->name, blk, idx);
+ return -1;
+ }
return 0;
}
@@ -258,16 +266,27 @@ static int pnv_xive_vst_write(PnvXive *xive, uint32_t
type, uint8_t blk,
{
const XiveVstInfo *info = &vst_infos[type];
uint64_t addr = pnv_xive_vst_addr(xive, type, blk, idx);
+ MemTxResult result;
if (!addr) {
return -1;
}
if (word_number == XIVE_VST_WORD_ALL) {
- cpu_physical_memory_write(addr, data, info->size);
+ result = address_space_write(&address_space_memory, addr,
+ MEMTXATTRS_UNSPECIFIED, data,
+ info->size);
} else {
- cpu_physical_memory_write(addr + word_number * 4,
- data + word_number * 4, 4);
+ result = address_space_write(&address_space_memory,
+ addr + word_number * 4,
+ MEMTXATTRS_UNSPECIFIED,
+ data + word_number * 4, 4);
+ }
+
+ if (result != MEMTX_OK) {
+ xive_error(xive, "VST: write failed at @0x%" HWADDR_PRIx
+ "for VST %s %x/%x\n", addr, info->name, blk, idx);
+ return -1;
}
return 0;
}
diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c
index bbb44a533cff..4b8d0a5d8120 100644
--- a/hw/intc/pnv_xive2.c
+++ b/hw/intc/pnv_xive2.c
@@ -240,12 +240,20 @@ static int pnv_xive2_vst_read(PnvXive2 *xive, uint32_t
type, uint8_t blk,
{
const XiveVstInfo *info = &vst_infos[type];
uint64_t addr = pnv_xive2_vst_addr(xive, type, blk, idx);
+ MemTxResult result;
if (!addr) {
return -1;
}
- cpu_physical_memory_read(addr, data, info->size);
+ result = address_space_read(&address_space_memory, addr,
+ MEMTXATTRS_UNSPECIFIED, data,
+ info->size);
+ if (result != MEMTX_OK) {
+ xive2_error(xive, "VST: read failed at @0x%" HWADDR_PRIx
+ " for VST %s %x/%x\n", addr, info->name, blk, idx);
+ return -1;
+ }
return 0;
}
@@ -256,16 +264,27 @@ static int pnv_xive2_vst_write(PnvXive2 *xive, uint32_t
type, uint8_t blk,
{
const XiveVstInfo *info = &vst_infos[type];
uint64_t addr = pnv_xive2_vst_addr(xive, type, blk, idx);
+ MemTxResult result;
if (!addr) {
return -1;
}
if (word_number == XIVE_VST_WORD_ALL) {
- cpu_physical_memory_write(addr, data, info->size);
+ result = address_space_write(&address_space_memory, addr,
+ MEMTXATTRS_UNSPECIFIED, data,
+ info->size);
} else {
- cpu_physical_memory_write(addr + word_number * 4,
- data + word_number * 4, 4);
+ result = address_space_write(&address_space_memory,
+ addr + word_number * 4,
+ MEMTXATTRS_UNSPECIFIED,
+ data + word_number * 4, 4);
+ }
+
+ if (result != MEMTX_OK) {
+ xive2_error(xive, "VST: write failed at @0x%" HWADDR_PRIx
+ "for VST %s %x/%x\n", addr, info->name, blk, idx);
+ return -1;
}
return 0;
}
--
2.41.0
- [PULL 21/35] target/ppc: Fix CPU reservation migration for record-replay, (continued)
- [PULL 21/35] target/ppc: Fix CPU reservation migration for record-replay, Cédric Le Goater, 2023/09/04
- [PULL 23/35] spapr: Fix machine reset deadlock from replay-record, Cédric Le Goater, 2023/09/04
- [PULL 25/35] tests/avocado: boot ppc64 pseries replay-record test to Linux VFS mount, Cédric Le Goater, 2023/09/04
- [PULL 24/35] spapr: Fix record-replay machine reset consuming too many events, Cédric Le Goater, 2023/09/04
- [PULL 22/35] target/ppc: Fix timebase reset with record-replay, Cédric Le Goater, 2023/09/04
- [PULL 27/35] tests/avocado: ppc64 reverse debugging tests for pseries and powernv, Cédric Le Goater, 2023/09/04
- [PULL 26/35] tests/avocado: reverse-debugging cope with re-executing breakpoints, Cédric Le Goater, 2023/09/04
- [PULL 28/35] target/ppc: Fix LQ, STQ register-pair order for big-endian, Cédric Le Goater, 2023/09/04
- [PULL 29/35] target/ppc: Flush inputs to zero with NJ in ppc_store_vscr, Cédric Le Goater, 2023/09/04
- [PULL 30/35] hw/ppc/e500: fix broken snapshot replay, Cédric Le Goater, 2023/09/04
- [PULL 32/35] ppc/xive: Use address_space routines to access the machine RAM,
Cédric Le Goater <=
- [PULL 31/35] target/ppc: Fix the order of kvm_enable judgment about kvmppc_set_interrupt(), Cédric Le Goater, 2023/09/04
- [PULL 33/35] ppc/xive: Introduce a new XiveRouter end_notify() handler, Cédric Le Goater, 2023/09/04
- [PULL 35/35] ppc/xive: Add support for the PC MMIOs, Cédric Le Goater, 2023/09/04
- [PULL 34/35] ppc/xive: Handle END triggers between chips with MMIOs, Cédric Le Goater, 2023/09/04
- Re: [PULL 00/35] ppc queue, Cédric Le Goater, 2023/09/06