[RFC PATCH 0/9] hw/misc: Add support for interleaved memory accesses

Philippe Mathieu-Daudé posted 9 patches 3 years, 8 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora passed
Test checkpatch passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200817161853.593247-1-f4bug@amsat.org
include/exec/memory.h         |   6 +
include/hw/misc/interleaver.h |  40 +++++
include/hw/misc/testdev.h     |  15 ++
hw/core/null-machine.c        |   2 +
hw/misc/interleaver.c         | 283 ++++++++++++++++++++++++++++++++++
hw/misc/mmio-testdev.c        | 150 ++++++++++++++++++
softmmu/memory.c              |  32 ++++
softmmu/qtest.c               |  40 +++--
tests/qtest/mmio-test.c       | 146 ++++++++++++++++++
MAINTAINERS                   |   9 ++
hw/misc/Kconfig               |   9 ++
hw/misc/Makefile.objs         |   2 +
hw/misc/trace-events          |   6 +
tests/qtest/Makefile.include  |   1 +
14 files changed, 728 insertions(+), 13 deletions(-)
create mode 100644 include/hw/misc/interleaver.h
create mode 100644 include/hw/misc/testdev.h
create mode 100644 hw/misc/interleaver.c
create mode 100644 hw/misc/mmio-testdev.c
create mode 100644 tests/qtest/mmio-test.c
[RFC PATCH 0/9] hw/misc: Add support for interleaved memory accesses
Posted by Philippe Mathieu-Daudé 3 years, 8 months ago
This is a follow up on last year patch from Stephen Checkoway:
"block/pflash_cfi02: Implement intereleaved flash devices"
https://www.mail-archive.com/qemu-devel@nongnu.org/msg613077.html

Instead of making the PFLASH device more complex, I went
implementing a generic interleaver device (that can be re-used
for other MMIO devices, probably pointless, still useful for
simple testing).

The series is available on [1] and is organized as:

1/ Fix a pair of issues in memory.c as we are not exercing much
the memory_region_[read/write]_with_attrs_accessor functions (see
also [2]).

2/ Allow to use qtest helpers with the 'none' machine (without any
CPU).

3/ Add the interleaver device

4/ Add a device to test the interleaver device (later I'll expand
it to other MMIO accesses, such access_with_adjusted_size, endianess
and unaligned accesses). Let the 'none' machine create this device
from command line.

5/ Add qtests using 4/ to test 3/.

6/ Add a way to display the interleaved memory (sub)regions in
the HMP 'info mtree' command.

Based-on: <20200816173051.16274-1-f4bug@amsat.org>
[1] https://gitlab.com/philmd/qemu/-/tree/interleaved_device-v1
[2] https://www.mail-archive.com/qemu-devel@nongnu.org/msg730279.html

Philippe Mathieu-Daudé (9):
  memory: Initialize MemoryRegionOps for RAM memory regions
  qtest: Add local qtest_mem_as() getter
  qtest: Directly use global address_space_memory when no CPU available
  hw/misc: Add interleaver device to make interleaved memory accesses
  hw/misc: Add MMIO test device
  hw/core/null-machine: Allow to use the MMIO 'test' device
  tests/qtest: Add generic MMIO tests
  memory: Allow memory region to display its subregions own descriptions
  hw/misc/interleaver: Display subregions in 'info mtree'

 include/exec/memory.h         |   6 +
 include/hw/misc/interleaver.h |  40 +++++
 include/hw/misc/testdev.h     |  15 ++
 hw/core/null-machine.c        |   2 +
 hw/misc/interleaver.c         | 283 ++++++++++++++++++++++++++++++++++
 hw/misc/mmio-testdev.c        | 150 ++++++++++++++++++
 softmmu/memory.c              |  32 ++++
 softmmu/qtest.c               |  40 +++--
 tests/qtest/mmio-test.c       | 146 ++++++++++++++++++
 MAINTAINERS                   |   9 ++
 hw/misc/Kconfig               |   9 ++
 hw/misc/Makefile.objs         |   2 +
 hw/misc/trace-events          |   6 +
 tests/qtest/Makefile.include  |   1 +
 14 files changed, 728 insertions(+), 13 deletions(-)
 create mode 100644 include/hw/misc/interleaver.h
 create mode 100644 include/hw/misc/testdev.h
 create mode 100644 hw/misc/interleaver.c
 create mode 100644 hw/misc/mmio-testdev.c
 create mode 100644 tests/qtest/mmio-test.c

-- 
2.26.2


Re: [RFC PATCH 0/9] hw/misc: Add support for interleaved memory accesses
Posted by no-reply@patchew.org 3 years, 8 months ago
Patchew URL: https://patchew.org/QEMU/20200817161853.593247-1-f4bug@amsat.org/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      tests/qtest/e1000-test.o
  CC      tests/qtest/e1000e-test.o
  CC      tests/qtest/eepro100-test.o
/tmp/qemu-test/src/tests/qtest/mmio-test.c:9:24: fatal error: qemu/osdep.h: No such file or directory
 #include "qemu/osdep.h"
                        ^
compilation terminated.
  CC      tests/qtest/es1370-test.o
  CC      tests/qtest/ipoctal232-test.o
  CC      tests/qtest/megasas-test.o
make: *** [tests/qtest/mmio-test] Error 1
make: *** Waiting for unfinished jobs....
  CC      test_abcz_f32.o
  CC      test_ab_f32_z_bool.o
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=84ffc0d808a34b62824e6e470c7b703a', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-4imsyimq/src/docker-src.2020-08-17-16.08.23.7359:/var/tmp/qemu:z,ro', 'qemu/centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=84ffc0d808a34b62824e6e470c7b703a
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-4imsyimq/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    5m5.999s
user    0m6.598s


The full log is available at
http://patchew.org/logs/20200817161853.593247-1-f4bug@amsat.org/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [RFC PATCH 0/9] hw/misc: Add support for interleaved memory accesses
Posted by Philippe Mathieu-Daudé 3 years, 8 months ago
On 8/17/20 6:18 PM, Philippe Mathieu-Daudé wrote:
> This is a follow up on last year patch from Stephen Checkoway:
> "block/pflash_cfi02: Implement intereleaved flash devices"
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg613077.html
> 
> Instead of making the PFLASH device more complex, I went
> implementing a generic interleaver device (that can be re-used
> for other MMIO devices, probably pointless, still useful for
> simple testing).
> 
> The series is available on [1] and is organized as:
> 
> 1/ Fix a pair of issues in memory.c as we are not exercing much
> the memory_region_[read/write]_with_attrs_accessor functions (see
> also [2]).
> 
> 2/ Allow to use qtest helpers with the 'none' machine (without any
> CPU).
> 
> 3/ Add the interleaver device
> 
> 4/ Add a device to test the interleaver device (later I'll expand
> it to other MMIO accesses, such access_with_adjusted_size, endianess
> and unaligned accesses). Let the 'none' machine create this device
> from command line.
> 
> 5/ Add qtests using 4/ to test 3/.
> 
> 6/ Add a way to display the interleaved memory (sub)regions in
> the HMP 'info mtree' command.
> 
> Based-on: <20200816173051.16274-1-f4bug@amsat.org>
> [1] https://gitlab.com/philmd/qemu/-/tree/interleaved_device-v1
> [2] https://www.mail-archive.com/qemu-devel@nongnu.org/msg730279.html

I followed Paolo's suggestion to use qtest_memread/qtest_memwrite to
avoid endianess swapping, and now cross-endianess works :)

Review still welcome, but I'll respin in September.

Regards,

Phil.

Re: [RFC PATCH 0/9] hw/misc: Add support for interleaved memory accesses
Posted by Philippe Mathieu-Daudé 3 years, 8 months ago
On 8/17/20 6:18 PM, Philippe Mathieu-Daudé wrote:
> This is a follow up on last year patch from Stephen Checkoway:
> "block/pflash_cfi02: Implement intereleaved flash devices"
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg613077.html
> 
> Instead of making the PFLASH device more complex, I went
> implementing a generic interleaver device (that can be re-used
> for other MMIO devices, probably pointless, still useful for
> simple testing).
> 
> The series is available on [1] and is organized as:
> 
> 1/ Fix a pair of issues in memory.c as we are not exercing much
> the memory_region_[read/write]_with_attrs_accessor functions (see
> also [2]).
> 
> 2/ Allow to use qtest helpers with the 'none' machine (without any
> CPU).
> 
> 3/ Add the interleaver device
> 
> 4/ Add a device to test the interleaver device (later I'll expand
> it to other MMIO accesses, such access_with_adjusted_size, endianess
> and unaligned accesses). Let the 'none' machine create this device
> from command line.
> 
> 5/ Add qtests using 4/ to test 3/.
> 
> 6/ Add a way to display the interleaved memory (sub)regions in
> the HMP 'info mtree' command.
> 
> Based-on: <20200816173051.16274-1-f4bug@amsat.org>
> [1] https://gitlab.com/philmd/qemu/-/tree/interleaved_device-v1
> [2] https://www.mail-archive.com/qemu-devel@nongnu.org/msg730279.html

I followed Paolo's suggestion to use qtest_memread/qtest_memwrite to
avoid endianess swapping, and now cross-endianess works :)

Review still welcome, but I'll respin in September.

Regards,

Phil.