[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-5.0 08/12] hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit acces
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-5.0 08/12] hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses |
Date: |
Tue, 14 Apr 2020 15:30:48 +0200 |
From: Philippe Mathieu-Daudé <address@hidden>
The Plug & Play region of the AHB/APB bridge can be accessed
by various word size, however the implementation is clearly
restricted to 32-bit:
static uint64_t grlib_ahb_pnp_read(void *opaque, hwaddr offset, unsigned size)
{
AHBPnp *ahb_pnp = GRLIB_AHB_PNP(opaque);
return ahb_pnp->regs[offset >> 2];
}
Similarly to commit 0fbe394a64 with the APB PnP registers,
set the MemoryRegionOps::impl min/max fields to 32-bit, so
memory.c::access_with_adjusted_size() can adjust when the
access is not 32-bit.
Reviewed-by: KONRAD Frederic <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/misc/grlib_ahb_apb_pnp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/misc/grlib_ahb_apb_pnp.c b/hw/misc/grlib_ahb_apb_pnp.c
index 72a8764776..d22ed00206 100644
--- a/hw/misc/grlib_ahb_apb_pnp.c
+++ b/hw/misc/grlib_ahb_apb_pnp.c
@@ -146,6 +146,10 @@ static const MemoryRegionOps grlib_ahb_pnp_ops = {
.read = grlib_ahb_pnp_read,
.write = grlib_ahb_pnp_write,
.endianness = DEVICE_BIG_ENDIAN,
+ .impl = {
+ .min_access_size = 4,
+ .max_access_size = 4,
+ },
};
static void grlib_ahb_pnp_realize(DeviceState *dev, Error **errp)
--
2.21.1
- [PATCH-for-5.0 07/12] hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to AHB PnP registers, (continued)
- [PATCH-for-5.0 07/12] hw/misc/grlib_ahb_apb_pnp: Avoid crash when writing to AHB PnP registers, Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 01/12] Revert "prevent crash when executing guest-file-read with large count", Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 06/12] hw/openrisc/pic_cpu: Use qdev gpio rather than qemu_allocate_irqs(), Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 02/12] qga: Extract guest_file_handle_find() to commands-common.h, Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 10/12] hw/block/pflash: Check return value of blk_pwrite(), Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 09/12] hw/display/sm501: Avoid heap overflow in sm501_2d_operation(), Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 05/12] vhost-user-gpu: Release memory returned by vu_queue_pop() with free(), Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 08/12] hw/misc/grlib_ahb_apb_pnp: Fix AHB PnP 8-bit accesses,
Philippe Mathieu-Daudé <=
- [PATCH-for-5.0 03/12] qga: Extract qmp_guest_file_read() to common commands.c, Philippe Mathieu-Daudé, 2020/04/14
- [PATCH-for-5.0 12/12] gdbstub: Introduce gdb_get_freg32() to get float32 registers, Philippe Mathieu-Daudé, 2020/04/14
- Re: [PATCH-for-5.0 00/12] various bugfixes, Michael S. Tsirkin, 2020/04/17