exec: allows 8-byte accesses in subpage_ops

Otherwise fw_cfg accesses are split into 4-byte ones before they reach the
fw_cfg ops / handlers.

Backports commit ff6cff7554be06e95f8d712f66cd16bd6681c746 from qemu
This commit is contained in:
Paolo Bonzini 2018-02-18 18:06:04 -05:00 committed by Lioncash
parent a06611e45b
commit 0696e7fe19
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1422,7 +1422,7 @@ static MemTxResult subpage_read(struct uc_struct* uc, void *opaque, hwaddr addr,
uint64_t *data, unsigned len, MemTxAttrs attrs) uint64_t *data, unsigned len, MemTxAttrs attrs)
{ {
subpage_t *subpage = opaque; subpage_t *subpage = opaque;
uint8_t buf[4]; uint8_t buf[8];
MemTxResult res; MemTxResult res;
#if defined(DEBUG_SUBPAGE) #if defined(DEBUG_SUBPAGE)
@ -1456,7 +1456,7 @@ static MemTxResult subpage_write(struct uc_struct* uc, void *opaque, hwaddr addr
uint64_t value, unsigned len, MemTxAttrs attrs) uint64_t value, unsigned len, MemTxAttrs attrs)
{ {
subpage_t *subpage = opaque; subpage_t *subpage = opaque;
uint8_t buf[4]; uint8_t buf[8];
#if defined(DEBUG_SUBPAGE) #if defined(DEBUG_SUBPAGE)
printf("%s: subpage %p len %u addr " TARGET_FMT_plx printf("%s: subpage %p len %u addr " TARGET_FMT_plx
@ -1503,8 +1503,11 @@ static const MemoryRegionOps subpage_ops = {
subpage_write, subpage_write,
DEVICE_NATIVE_ENDIAN, DEVICE_NATIVE_ENDIAN,
{ {
0, 0, false, subpage_accepts, 1, 8, false, subpage_accepts,
}, },
{
1, 8, false,
}
}; };
static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end, static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end,