Drop old_mmio accessor support
cover Drop old_mmio accessor support
Hi; this patchset removes support for the old_mmio accessors from the memory core code, now that we have fixed all the devices that were using it.
Patch 1 does that removal.
Patch 2 fixes up a wart in fw_cfg that was only needed while we had the old_mmio accessors (spotted because of the comment coming up in my grep for 'old_mmio'...)
Patch 3 is a bonus that adds documentation for the _with_attrs accessors, since I noticed while writing patch 1 that we hadn't actually written any.
Based-on: <[email protected]> ("[PATCH 0/2] hw/net/pcnet-pci: Convert away from old_mmio accessors")
The pcnet-pci patches are the only "convert away from old_mmio" patches still not yet in master; they've been reviewed, they just haven't been picked up by anybody yet.
thanks
-- PMM
Peter Maydell (3):
memory: Remove old_mmio accessors
hw/nvram/fw_cfg: Use memberwise copy of MemoryRegionOps struct docs/devel/memory.txt: Document _with_attrs accessors
docs/devel/memory.txt | 13 ++++++--- include/exec/memory.h | 5 ---- hw/nvram/fw_cfg.c | 7 +---- memory.c | 64 ++----------------------------------------- 4 files changed, 12 insertions(+), 77 deletions(-)
Signature · 1 line
2.18.0
PATCH 1/3 memory: Remove old_mmio accessors
Now that all the users of old_mmio MemoryRegion accessors have been converted, we can remove the core code support.
--- docs/devel/memory.txt | 2 -- include/exec/memory.h | 5 ---- memory.c | 64 ++----------------------------------------- 3 files changed, 2 insertions(+), 69 deletions(-)
docs/devel/memory.txt +0 -2
@@ -342,5 +342,3 @@ various constraints can be supplied to control how these callbacks are called: - .impl.unaligned specifies that the *implementation* supports unaligned accesses; if false, unaligned accesses will be emulated by two aligned accesses. - - .old_mmio eases the porting of code that was formerly using - cpu_register_io_memory(). It should not be used in new code.
include/exec/memory.h +0 -5
@@ -201,11 +201,6 @@ struct MemoryRegionOps {*/ bool unaligned; } impl; - -/* If .read and .write are not present, old_mmio may be used for -* backwards compatibility with old mmio registration -*/ -const MemoryRegionMmio old_mmio; };enum IOMMUMemoryRegionAttr {
memory.c +2 -62
99 lines not on this page · raw message
Signature · 1 line
2.18.0
Re: [Qemu-devel] [PATCH 1/3] memory: Remove old_mmio accessors
Quoted 9 lines · Peter Maydell
Now that all the users of
old_mmioMemoryRegion accessors have been converted, we can remove the core code support.Signed-off-by Peter Maydell <[email protected]>--- docs/devel/memory.txt | 2 -- include/exec/memory.h | 5 ---- memory.c | 64 ++----------------------------------------- 3 files changed, 2 insertions(+), 69 deletions(-)
r~
PATCH 2/3 hw/nvram/fw_cfg: Use memberwise copy of MemoryRegionOps struct
In reply to Peter MaydellWe've now removed the 'old_mmio' member from MemoryRegionOps, so we can perform the copy as a simple struct copy rather than having to do it via a memberwise copy.
--- hw/nvram/fw_cfg.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
hw/nvram/fw_cfg.c +1 -6
@@ -1109,12 +1109,7 @@ static void fw_cfg_mem_realize(DeviceState *dev, Error **errp)sysbus_init_mmio (sbd, &s->ctl_iomem);if (s->data_width > data_ops->valid.max_access_size) { -/* memberwise copy because the "old_mmio" member is const */ - s->wide_data_ops.read = data_ops->read; - s->wide_data_ops.write = data_ops->write; - s->wide_data_ops.endianness = data_ops->endianness; - s->wide_data_ops.valid = data_ops->valid; - s->wide_data_ops.impl = data_ops->impl; + s->wide_data_ops = *data_ops; s->wide_data_ops.valid.max_access_size = s->data_width; s->wide_data_ops.impl.max_access_size = s->data_width;
Signature · 1 line
2.18.0
Re: [Qemu-devel] [PATCH 2/3] hw/nvram/fw_cfg: Use memberwise copy of MemoryRegionOps struct
Quoted 8 lines · Peter Maydell
We've now removed the '
old_mmio' member from MemoryRegionOps, so we can perform the copy as a simple struct copy rather than having to do it via a memberwise copy.Signed-off-by Peter Maydell <[email protected]>--- hw/nvram/fw_cfg.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
r~
PATCH 3/3 docs/devel/memory.txt: Document _with_attrs accessors
In reply to Peter MaydellWhen we added the _with_attrs accessors we forgot to mention them in the documentation.
--- docs/devel/memory.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
docs/devel/memory.txt +9 -2
@@ -326,8 +326,15 @@ visible as the pci-hole alias clips it to a 0.5GB range. MMIO Operations --------------- -MMIO regions are provided with ->read() and ->write() callbacks; in addition -various constraints can be supplied to control how these callbacks are called: +MMIO regions are provided with ->read() and ->write() callbacks, +which are sufficient for most devices. Some devices change behaviour +based on the attributes used for the memory transaction, or need +to be able to respond that the access should provoke a bus error +rather than completing successfully; those devices can use the +->read_with_attrs() and ->write_with_attrs() callbacks instead. + +In addition various constraints can be supplied to control how these +callbacks are called: - .valid.min_access_size, .valid.max_access_size define the access sizes (in bytes) which the device accepts; accesses outside this range will
Signature · 1 line
2.18.0