1
Hi; this pullreq contains some minor bug fixes, and also
1
The following changes since commit 131c58469f6fb68c89b38fee6aba8bbb20c7f4bf:
2
the txt-to-rST document conversions I did. The latter are not
3
strictly speaking bugfixes but I think for rc2 they're OK. Let
4
me know if you'd rather I respin this without them.
5
2
6
thanks
3
rust: add --rust-target option for bindgen (2025-02-06 13:51:46 -0500)
7
-- PMM
8
9
The following changes since commit 0f397dcfecc9211d12c2c720c01eb32f0eaa7d23:
10
11
Merge tag 'pull-nbd-2024-08-08' of https://repo.or.cz/qemu/ericb into staging (2024-08-09 08:40:37 +1000)
12
4
13
are available in the Git repository at:
5
are available in the Git repository at:
14
6
15
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20240809
7
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20250210
16
8
17
for you to fetch changes up to 77100e100d76a568800e19ee20c7e9255053b84a:
9
for you to fetch changes up to 27a8d899c7a100fd5aa040a8b993bb257687c393:
18
10
19
arm/virt: place power button pin number on a define (2024-08-09 17:37:56 +0100)
11
linux-user: Do not define struct sched_attr if libc headers do (2025-02-07 16:09:20 +0000)
20
12
21
----------------------------------------------------------------
13
----------------------------------------------------------------
22
target-arm queue:
14
target-arm queue:
23
* Fix BTI versus CF_PCREL
15
* Deprecate pxa2xx CPUs, iwMMXt emulation, -old-param option
24
* include: Fix typo in name of MAKE_IDENTFIER macro
16
* Drop unused AArch64DecodeTable typedefs
25
* docs: Various txt-to-rST conversions
17
* Minor code cleanups
26
* add support for PMUv3 64-bit PMCCNTR in AArch32 mode
18
* hw/net/cadence_gem: Fix the mask/compare/disable-mask logic
27
* hw/core/ptimer: fix timer zero period condition for freq > 1GHz
19
* linux-user: Do not define struct sched_attr if libc headers do
28
* arm/virt: place power button pin number on a define
29
20
30
----------------------------------------------------------------
21
----------------------------------------------------------------
31
Alex Richardson (1):
22
Andrew Yuan (1):
32
target/arm: add support for PMUv3 64-bit PMCCNTR in AArch32 mode
23
hw/net/cadence_gem: Fix the mask/compare/disable-mask logic
33
24
34
Eric Blake (1):
25
Khem Raj (1):
35
docs: Typo fix in live disk backup
26
linux-user: Do not define struct sched_attr if libc headers do
36
27
37
Jianzhou Yue (1):
28
Peter Maydell (4):
38
hw/core/ptimer: fix timer zero period condition for freq > 1GHz
29
target/arm: deprecate the pxa2xx CPUs and iwMMXt emulation
30
tests/tcg/arm: Remove test-arm-iwmmxt test
31
target/arm: Drop unused AArch64DecodeTable typedefs
32
qemu-options: Deprecate -old-param command line option
39
33
40
Mauro Carvalho Chehab (1):
34
Philippe Mathieu-Daudé (6):
41
arm/virt: place power button pin number on a define
35
hw/arm/boot: Propagate vCPU to arm_load_dtb()
36
hw/arm/fsl-imx6: Add local 'mpcore/gic' variables
37
hw/arm/fsl-imx6ul: Add local 'mpcore/gic' variables
38
hw/arm/fsl-imx7: Add local 'mpcore/gic' variables
39
hw/cpu/arm: Alias 'num-cpu' property on TYPE_REALVIEW_MPCORE
40
hw/cpu/arm: Declare CPU QOM types using DEFINE_TYPES() macro
42
41
43
Peter Maydell (6):
42
docs/about/deprecated.rst | 34 ++++++++++++++++++++++
44
include: Fix typo in name of MAKE_IDENTFIER macro
43
include/hw/arm/boot.h | 4 ++-
45
docs/specs/rocker.txt: Convert to rST
44
target/arm/cpu.h | 1 +
46
docs/interop/nbd.txt: Convert to rST
45
hw/arm/boot.c | 11 +++----
47
docs/interop/parallels.txt: Convert to rST
46
hw/arm/fsl-imx6.c | 52 ++++++++++++++-------------------
48
docs/interop/prl-xml.txt: Convert to rST
47
hw/arm/fsl-imx6ul.c | 64 +++++++++++++++++------------------------
49
docs/interop/prl-xml.rst: Fix minor grammar nits
48
hw/arm/fsl-imx7.c | 52 +++++++++++++++------------------
49
hw/arm/virt.c | 2 +-
50
hw/cpu/a15mpcore.c | 21 ++++++--------
51
hw/cpu/a9mpcore.c | 21 ++++++--------
52
hw/cpu/arm11mpcore.c | 21 ++++++--------
53
hw/cpu/realview_mpcore.c | 29 +++++++------------
54
hw/net/cadence_gem.c | 26 +++++++++++++----
55
linux-user/syscall.c | 4 ++-
56
system/vl.c | 1 +
57
target/arm/cpu.c | 3 ++
58
target/arm/tcg/cpu32.c | 36 +++++++++++++++--------
59
target/arm/tcg/translate-a64.c | 11 -------
60
tests/tcg/arm/Makefile.target | 7 -----
61
tests/tcg/arm/README | 5 ----
62
tests/tcg/arm/test-arm-iwmmxt.S | 49 -------------------------------
63
21 files changed, 205 insertions(+), 249 deletions(-)
64
delete mode 100644 tests/tcg/arm/test-arm-iwmmxt.S
50
65
51
Richard Henderson (1):
52
target/arm: Fix BTI versus CF_PCREL
53
54
MAINTAINERS | 7 +-
55
docs/interop/index.rst | 3 +
56
docs/interop/live-block-operations.rst | 4 +-
57
docs/interop/nbd.rst | 89 ++++++++++++
58
docs/interop/nbd.txt | 72 ----------
59
docs/interop/{parallels.txt => parallels.rst} | 108 ++++++++-------
60
docs/interop/prl-xml.rst | 192 ++++++++++++++++++++++++++
61
docs/interop/prl-xml.txt | 158 ---------------------
62
docs/specs/index.rst | 1 +
63
docs/specs/{rocker.txt => rocker.rst} | 181 ++++++++++++------------
64
include/hw/arm/virt.h | 3 +
65
include/qapi/qmp/qobject.h | 2 +-
66
include/qemu/atomic.h | 2 +-
67
include/qemu/compiler.h | 2 +-
68
include/qemu/osdep.h | 6 +-
69
target/arm/tcg/helper-a64.h | 3 +
70
target/arm/tcg/translate.h | 2 -
71
hw/arm/virt-acpi-build.c | 6 +-
72
hw/arm/virt.c | 7 +-
73
hw/core/ptimer.c | 4 +-
74
target/arm/helper.c | 6 +
75
target/arm/tcg/helper-a64.c | 39 ++++++
76
target/arm/tcg/translate-a64.c | 64 ++-------
77
tests/unit/ptimer-test.c | 33 +++++
78
24 files changed, 553 insertions(+), 441 deletions(-)
79
create mode 100644 docs/interop/nbd.rst
80
delete mode 100644 docs/interop/nbd.txt
81
rename docs/interop/{parallels.txt => parallels.rst} (72%)
82
create mode 100644 docs/interop/prl-xml.rst
83
delete mode 100644 docs/interop/prl-xml.txt
84
rename docs/specs/{rocker.txt => rocker.rst} (91%)
diff view generated by jsdifflib
1
Fix some minor grammar nits in the prl-xml documentation.
1
The pxa2xx CPUs are now only useful with user-mode emulation, because
2
we dropped all the machine types that used them in 9.2. (Technically
3
you could alse use "-cpu pxa270" with a board model like versatilepb
4
which doesn't sanity-check the CPU type, but that has never been a
5
supported config.)
6
7
To use them (or iwMMXt emulation) with QEMU user-mode you would need
8
to explicitly select them with the -cpu option or the QEMU_CPU
9
environment variable. A google search finds no examples of anybody
10
doing this in the last decade; I don't believe the GCC folks are
11
using QEMU to test their iwMMXt codegen either. In fact, GCC is in
12
the process of dropping support for iwMMXT entirely.
13
14
The iwMMXt emulation is thousands of lines of code in QEMU, and
15
is now the only bit of Arm insn decode which doesn't use decodetree.
16
We have no way to test or validate changes to it. This code is
17
just dead weight that is almost certainly not being used by anybody.
18
Mark it as deprecated.
2
19
3
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
20
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
21
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
5
Reviewed-by: Eric Blake <eblake@redhat.com>
22
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6
Message-id: 20240801170131.3977807-6-peter.maydell@linaro.org
23
Message-id: 20250127112715.2936555-2-peter.maydell@linaro.org
7
---
24
---
8
docs/interop/prl-xml.rst | 73 +++++++++++++++++++++-------------------
25
docs/about/deprecated.rst | 21 +++++++++++++++++++++
9
1 file changed, 39 insertions(+), 34 deletions(-)
26
target/arm/cpu.h | 1 +
27
target/arm/cpu.c | 3 +++
28
target/arm/tcg/cpu32.c | 36 ++++++++++++++++++++++++------------
29
4 files changed, 49 insertions(+), 12 deletions(-)
10
30
11
diff --git a/docs/interop/prl-xml.rst b/docs/interop/prl-xml.rst
31
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
12
index XXXXXXX..XXXXXXX 100644
32
index XXXXXXX..XXXXXXX 100644
13
--- a/docs/interop/prl-xml.rst
33
--- a/docs/about/deprecated.rst
14
+++ b/docs/interop/prl-xml.rst
34
+++ b/docs/about/deprecated.rst
15
@@ -XXX,XX +XXX,XX @@ Parallels Disk Format
35
@@ -XXX,XX +XXX,XX @@ is going to be so much slower it wouldn't make sense for any serious
16
See the COPYING file in the top-level directory.
36
instrumentation. Due to implementation differences there will also be
17
37
anomalies in things like memory instrumentation.
18
This specification contains minimal information about Parallels Disk Format,
38
19
-which is enough to proper work with QEMU. Nevertheless, Parallels Cloud Server
39
+linux-user mode CPUs
20
-and Parallels Desktop are able to add some unspecified nodes to xml and use
40
+--------------------
21
+which is enough to properly work with QEMU. Nevertheless, Parallels Cloud Server
22
+and Parallels Desktop are able to add some unspecified nodes to the xml and use
23
them, but they are for internal work and don't affect functionality. Also it
24
-uses auxiliary xml ``Snapshot.xml``, which allows to store optional snapshot
25
-information, but it doesn't influence open/read/write functionality. QEMU and
26
-other software should not use fields not covered in this document and
27
-``Snapshot.xml`` file and must leave them as is.
28
+uses auxiliary xml ``Snapshot.xml``, which allows storage of optional snapshot
29
+information, but this doesn't influence open/read/write functionality. QEMU and
30
+other software should not use fields not covered in this document or the
31
+``Snapshot.xml`` file, and must leave them as is.
32
33
-Parallels disk consists of two parts: the set of snapshots and the disk
34
+A Parallels disk consists of two parts: the set of snapshots and the disk
35
descriptor file, which stores information about all files and snapshots.
36
37
Definitions
38
@@ -XXX,XX +XXX,XX @@ Definitions
39
40
Snapshot
41
a record of the contents captured at a particular time, capable
42
- of storing current state. A snapshot has UUID and parent UUID.
43
+ of storing current state. A snapshot has a UUID and a parent UUID.
44
45
Snapshot image
46
an overlay representing the difference between this
47
@@ -XXX,XX +XXX,XX @@ Overlay
48
an image storing the different sectors between two captured states.
49
50
Root image
51
- snapshot image with no parent, the root of snapshot tree.
52
+ a snapshot image with no parent, the root of the snapshot tree.
53
54
Storage
55
the backing storage for a subset of the virtual disk. When
56
there is more than one storage in a Parallels disk then that
57
is referred to as a split image. In this case every storage
58
- covers specific address space area of the disk and has its
59
+ covers a specific address space area of the disk and has its
60
particular root image. Split images are not considered here
61
and are not supported. Each storage consists of disk
62
parameters and a list of images. The list of images always
63
@@ -XXX,XX +XXX,XX @@ Storage
64
65
Description file
66
``DiskDescriptor.xml`` stores information about disk parameters,
67
- snapshots, storages.
68
+ snapshots, and storages.
69
70
Top Snapshot
71
The overlay between actual state and some previous snapshot.
72
@@ -XXX,XX +XXX,XX @@ Description file
73
74
All information is placed in a single XML element
75
``Parallels_disk_image``.
76
-The element has only one attribute ``Version``, that must be ``1.0``.
77
+The element has only one attribute, ``Version``, which must be ``1.0``.
78
79
-Schema of ``DiskDescriptor.xml``::
80
+The schema of ``DiskDescriptor.xml``::
81
82
<Parallels_disk_image Version="1.0">
83
<Disk_Parameters>
84
@@ -XXX,XX +XXX,XX @@ The ``Disk_Parameters`` element MUST contain the following child elements:
85
* ``Heads`` - number of the disk heads.
86
* ``Sectors`` - number of the disk sectors per cylinder
87
(sector size is 512 bytes)
88
- Limitation: Product of the ``Heads``, ``Sectors`` and ``Cylinders``
89
+ Limitation: The product of the ``Heads``, ``Sectors`` and ``Cylinders``
90
values MUST be equal to the value of the Disk_size parameter.
91
* ``Padding`` - must be 0. Parallels Cloud Server and Parallels Desktop may
92
- use padding set to 1, however this case is not covered
93
- by this spec, QEMU and other software should not open
94
+ use padding set to 1; however this case is not covered
95
+ by this specification. QEMU and other software should not open
96
such disks and should not create them.
97
98
``StorageData`` element
99
@@ -XXX,XX +XXX,XX @@ as shown below::
100
</Storage>
101
</StorageData>
102
103
-A ``Storage`` element has following child elements:
104
+A ``Storage`` element has the following child elements:
105
106
* ``Start`` - start sector of the storage, in case of non split storage
107
equals to 0.
108
* ``End`` - number of sector following the last sector, in case of non
109
split storage equals to ``Disk_size``.
110
* ``Blocksize`` - storage cluster size, number of sectors per one cluster.
111
- Cluster size for each "Compressed" (see below) image in
112
- parallels disk must be equal to this field. Note: cluster
113
- size for Parallels Expandable Image is in ``tracks`` field of
114
+ The cluster size for each "Compressed" (see below) image in
115
+ a parallels disk must be equal to this field. Note: the cluster
116
+ size for a Parallels Expandable Image is in the ``tracks`` field of
117
its header (see :doc:`parallels`).
118
* Several ``Image`` child elements.
119
120
-Each ``Image`` element has following child elements:
121
+Each ``Image`` element has the following child elements:
122
123
* ``GUID`` - image identifier, UUID in curly brackets.
124
For instance, ``{12345678-9abc-def1-2345-6789abcdef12}.``
125
@@ -XXX,XX +XXX,XX @@ Each ``Image`` element has following child elements:
126
* ``Plain`` for raw files.
127
* ``Compressed`` for expanding disks.
128
129
-* ``File`` - path to image file. Path can be relative to
130
+* ``File`` - path to image file. The path can be relative to
131
``DiskDescriptor.xml`` or absolute.
132
133
``Snapshots`` element
134
@@ -XXX,XX +XXX,XX @@ Each ``Shot`` element contains the following child elements:
135
* ``GUID`` - an image GUID.
136
* ``ParentGUID`` - GUID of the image of the parent snapshot.
137
138
-The software may traverse snapshots from child to parent using ``<ParentGUID>``
139
-field as reference. ``ParentGUID`` of root snapshot is
140
-``{00000000-0000-0000-0000-000000000000}``. There should be only one root
141
-snapshot. Top snapshot could be described via two ways: via ``TopGUID`` child
142
-element of the ``Snapshots`` element or via predefined GUID
143
+The software may traverse snapshots from child to parent using the
144
+``<ParentGUID>`` field as reference. The ``ParentGUID`` of the root
145
+snapshot is ``{00000000-0000-0000-0000-000000000000}``.
146
+There should be only one root snapshot.
147
+
41
+
148
+The Top snapshot could be
42
+iwMMXt emulation and the ``pxa`` CPUs (since 10.0)
149
+described via two ways: via the ``TopGUID`` child
43
+''''''''''''''''''''''''''''''''''''''''''''''''''
150
+element of the ``Snapshots`` element, or via the predefined GUID
151
``{5fbaabe3-6958-40ff-92a7-860e329aab41}``. If ``TopGUID`` is defined,
152
-predefined GUID is interpreted as usual GUID. All snapshot images
153
-(except Top Snapshot) should be
154
-opened read-only. There is another predefined GUID,
155
+the predefined GUID is interpreted as a normal GUID. All snapshot images
156
+(except the Top Snapshot) should be
157
+opened read-only.
158
+
44
+
159
+There is another predefined GUID,
45
+The ``pxa`` CPU family (``pxa250``, ``pxa255``, ``pxa260``,
160
``BackupID = {704718e1-2314-44c8-9087-d78ed36b0f4e}``, which is used by
46
+``pxa261``, ``pxa262``, ``pxa270-a0``, ``pxa270-a1``, ``pxa270``,
161
-original and some third-party software for backup, QEMU and other
47
+``pxa270-b0``, ``pxa270-b1``, ``pxa270-c0``, ``pxa270-c5``) are no
162
-software may operate with images with ``GUID = BackupID`` as usual,
48
+longer used in system emulation, because all the machine types which
163
-however, it is not recommended to use this
49
+used these CPUs were removed in the QEMU 9.2 release. These CPUs can
164
-GUID for new disks. Top snapshot cannot have this GUID.
50
+now only be used in linux-user mode, and to do that you would have to
165
+original and some third-party software for backup. QEMU and other
51
+explicitly select one of these CPUs with the ``-cpu`` command line
166
+software may operate with images with ``GUID = BackupID`` as usual.
52
+option or the ``QEMU_CPU`` environment variable.
167
+However, it is not recommended to use this
53
+
168
+GUID for new disks. The Top snapshot cannot have this GUID.
54
+We don't believe that anybody is using the iwMMXt emulation, and we do
55
+not have any tests to validate it or any real hardware or similar
56
+known-good implementation to test against. GCC is in the process of
57
+dropping their support for iwMMXt codegen. These CPU types are
58
+therefore deprecated in QEMU, and will be removed in a future release.
59
+
60
System emulator CPUs
61
--------------------
62
63
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
64
index XXXXXXX..XXXXXXX 100644
65
--- a/target/arm/cpu.h
66
+++ b/target/arm/cpu.h
67
@@ -XXX,XX +XXX,XX @@ struct ArchCPU {
68
69
typedef struct ARMCPUInfo {
70
const char *name;
71
+ const char *deprecation_note;
72
void (*initfn)(Object *obj);
73
void (*class_init)(ObjectClass *oc, void *data);
74
} ARMCPUInfo;
75
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
76
index XXXXXXX..XXXXXXX 100644
77
--- a/target/arm/cpu.c
78
+++ b/target/arm/cpu.c
79
@@ -XXX,XX +XXX,XX @@ static void cpu_register_class_init(ObjectClass *oc, void *data)
80
81
acc->info = data;
82
cc->gdb_core_xml_file = "arm-core.xml";
83
+ if (acc->info->deprecation_note) {
84
+ cc->deprecation_note = acc->info->deprecation_note;
85
+ }
86
}
87
88
void arm_cpu_register(const ARMCPUInfo *info)
89
diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c
90
index XXXXXXX..XXXXXXX 100644
91
--- a/target/arm/tcg/cpu32.c
92
+++ b/target/arm/tcg/cpu32.c
93
@@ -XXX,XX +XXX,XX @@ static const ARMCPUInfo arm_tcg_cpus[] = {
94
{ .name = "ti925t", .initfn = ti925t_initfn },
95
{ .name = "sa1100", .initfn = sa1100_initfn },
96
{ .name = "sa1110", .initfn = sa1110_initfn },
97
- { .name = "pxa250", .initfn = pxa250_initfn },
98
- { .name = "pxa255", .initfn = pxa255_initfn },
99
- { .name = "pxa260", .initfn = pxa260_initfn },
100
- { .name = "pxa261", .initfn = pxa261_initfn },
101
- { .name = "pxa262", .initfn = pxa262_initfn },
102
+ { .name = "pxa250", .initfn = pxa250_initfn,
103
+ .deprecation_note = "iwMMXt CPUs are no longer supported", },
104
+ { .name = "pxa255", .initfn = pxa255_initfn,
105
+ .deprecation_note = "iwMMXt CPUs are no longer supported", },
106
+ { .name = "pxa260", .initfn = pxa260_initfn,
107
+ .deprecation_note = "iwMMXt CPUs are no longer supported", },
108
+ { .name = "pxa261", .initfn = pxa261_initfn,
109
+ .deprecation_note = "iwMMXt CPUs are no longer supported", },
110
+ { .name = "pxa262", .initfn = pxa262_initfn,
111
+ .deprecation_note = "iwMMXt CPUs are no longer supported", },
112
/* "pxa270" is an alias for "pxa270-a0" */
113
- { .name = "pxa270", .initfn = pxa270a0_initfn },
114
- { .name = "pxa270-a0", .initfn = pxa270a0_initfn },
115
- { .name = "pxa270-a1", .initfn = pxa270a1_initfn },
116
- { .name = "pxa270-b0", .initfn = pxa270b0_initfn },
117
- { .name = "pxa270-b1", .initfn = pxa270b1_initfn },
118
- { .name = "pxa270-c0", .initfn = pxa270c0_initfn },
119
- { .name = "pxa270-c5", .initfn = pxa270c5_initfn },
120
+ { .name = "pxa270", .initfn = pxa270a0_initfn,
121
+ .deprecation_note = "iwMMXt CPUs are no longer supported", },
122
+ { .name = "pxa270-a0", .initfn = pxa270a0_initfn,
123
+ .deprecation_note = "iwMMXt CPUs are no longer supported", },
124
+ { .name = "pxa270-a1", .initfn = pxa270a1_initfn,
125
+ .deprecation_note = "iwMMXt CPUs are no longer supported", },
126
+ { .name = "pxa270-b0", .initfn = pxa270b0_initfn,
127
+ .deprecation_note = "iwMMXt CPUs are no longer supported", },
128
+ { .name = "pxa270-b1", .initfn = pxa270b1_initfn,
129
+ .deprecation_note = "iwMMXt CPUs are no longer supported", },
130
+ { .name = "pxa270-c0", .initfn = pxa270c0_initfn,
131
+ .deprecation_note = "iwMMXt CPUs are no longer supported", },
132
+ { .name = "pxa270-c5", .initfn = pxa270c5_initfn,
133
+ .deprecation_note = "iwMMXt CPUs are no longer supported", },
134
#ifndef TARGET_AARCH64
135
{ .name = "max", .initfn = arm_max_initfn },
136
#endif
169
--
137
--
170
2.34.1
138
2.34.1
139
140
diff view generated by jsdifflib
1
Convert prl-xml.txt to rST format.
1
The test-arm-iwmmmxt test isn't testing what it thinks it's testing.
2
3
If you run it with a CPU type that supports iwMMXt then it will crash
4
immediately with a SIGILL, because (even with -marm) GCC will link it
5
against startup code that is in Thumb mode, and no iwMMXt CPU has
6
Thumb:
7
8
00010338 <_start>:
9
10338: f04f 0b00 mov.w fp, #0
10
1033c: f04f 0e00 mov.w lr, #0
11
12
If you run it with a CPU type which does *not* support iwMMXt, which
13
is what 'make check-tcg' does, then QEMU will not try to handle the
14
insns as iwMMXt. Instead the translator turns them into illegal
15
instructions. Then in the linux-user cpu_loop() code we identify
16
them as FPA11 instructions inside emulate_arm_fpa11(), because the
17
FPA11 happened to use the same coprocessor number as these iwMMXt
18
insns. So we execute a completely different set of FPA11 insns,
19
which means we don't crash, but we will print garbage to stdout.
20
Then the test binary always exits with a 0 return code, so 'make
21
check-tcg' thinks the test passes.
22
23
Modern gnueabihf toolchains assume in their startup code that the CPU
24
is not so old as to not support Thumb, so there's no way to get them
25
to generate a binary that actually does what the test wants. Since
26
we're deprecating iwMMXt emulation anyway, it's not worth trying to
27
salvage the test case to get it to really test the iwMMXt insns.
28
29
Delete the test entirely.
2
30
3
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
31
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
32
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
5
Reviewed-by: Eric Blake <eblake@redhat.com>
33
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6
Message-id: 20240801170131.3977807-5-peter.maydell@linaro.org
34
Message-id: 20250127112715.2936555-3-peter.maydell@linaro.org
7
---
35
---
8
MAINTAINERS | 1 +
36
tests/tcg/arm/Makefile.target | 7 -----
9
docs/interop/index.rst | 1 +
37
tests/tcg/arm/README | 5 ----
10
docs/interop/prl-xml.rst | 187 +++++++++++++++++++++++++++++++++++++++
38
tests/tcg/arm/test-arm-iwmmxt.S | 49 ---------------------------------
11
docs/interop/prl-xml.txt | 158 ---------------------------------
39
3 files changed, 61 deletions(-)
12
4 files changed, 189 insertions(+), 158 deletions(-)
40
delete mode 100644 tests/tcg/arm/test-arm-iwmmxt.S
13
create mode 100644 docs/interop/prl-xml.rst
14
delete mode 100644 docs/interop/prl-xml.txt
15
41
16
diff --git a/MAINTAINERS b/MAINTAINERS
42
diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target
17
index XXXXXXX..XXXXXXX 100644
43
index XXXXXXX..XXXXXXX 100644
18
--- a/MAINTAINERS
44
--- a/tests/tcg/arm/Makefile.target
19
+++ b/MAINTAINERS
45
+++ b/tests/tcg/arm/Makefile.target
20
@@ -XXX,XX +XXX,XX @@ S: Supported
46
@@ -XXX,XX +XXX,XX @@ ARM_TESTS = hello-arm
21
F: block/parallels.c
47
hello-arm: CFLAGS+=-marm -ffreestanding -fno-stack-protector
22
F: block/parallels-ext.c
48
hello-arm: LDFLAGS+=-nostdlib
23
F: docs/interop/parallels.rst
49
24
+F: docs/interop/prl-xml.rst
50
-# IWMXT floating point extensions
25
T: git https://src.openvz.org/scm/~den/qemu.git parallels
51
-ARM_TESTS += test-arm-iwmmxt
26
52
-# Clang assembler does not support IWMXT, so use the external assembler.
27
qed
53
-test-arm-iwmmxt: CFLAGS += -marm -march=iwmmxt -mabi=aapcs -mfpu=fpv4-sp-d16 $(CROSS_CC_HAS_FNIA)
28
diff --git a/docs/interop/index.rst b/docs/interop/index.rst
54
-test-arm-iwmmxt: test-arm-iwmmxt.S
55
-    $(CC) $(CFLAGS) -Wa,--noexecstack $< -o $@ $(LDFLAGS)
56
-
57
# Float-convert Tests
58
ARM_TESTS += fcvt
59
fcvt: LDFLAGS += -lm
60
diff --git a/tests/tcg/arm/README b/tests/tcg/arm/README
29
index XXXXXXX..XXXXXXX 100644
61
index XXXXXXX..XXXXXXX 100644
30
--- a/docs/interop/index.rst
62
--- a/tests/tcg/arm/README
31
+++ b/docs/interop/index.rst
63
+++ b/tests/tcg/arm/README
32
@@ -XXX,XX +XXX,XX @@ are useful for making QEMU interoperate with other software.
64
@@ -XXX,XX +XXX,XX @@ hello-arm
33
live-block-operations
65
---------
34
nbd
66
35
parallels
67
A very simple inline assembly, write syscall based hello world
36
+ prl-xml
68
-
37
pr-helper
69
-test-arm-iwmmxt
38
qmp-spec
70
----------------
39
qemu-ga
71
-
40
diff --git a/docs/interop/prl-xml.rst b/docs/interop/prl-xml.rst
72
-A simple test case for older iwmmxt extended ARMs
41
new file mode 100644
73
diff --git a/tests/tcg/arm/test-arm-iwmmxt.S b/tests/tcg/arm/test-arm-iwmmxt.S
42
index XXXXXXX..XXXXXXX
43
--- /dev/null
44
+++ b/docs/interop/prl-xml.rst
45
@@ -XXX,XX +XXX,XX @@
46
+Parallels Disk Format
47
+=====================
48
+
49
+..
50
+ Copyright (c) 2015-2017, Virtuozzo, Inc.
51
+ Authors:
52
+ 2015 Denis Lunev <den@openvz.org>
53
+ 2015 Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
54
+ 2016-2017 Klim Kireev <klim.kireev@virtuozzo.com>
55
+ 2016-2017 Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
56
+
57
+ This work is licensed under the terms of the GNU GPL, version 2 or later.
58
+ See the COPYING file in the top-level directory.
59
+
60
+This specification contains minimal information about Parallels Disk Format,
61
+which is enough to proper work with QEMU. Nevertheless, Parallels Cloud Server
62
+and Parallels Desktop are able to add some unspecified nodes to xml and use
63
+them, but they are for internal work and don't affect functionality. Also it
64
+uses auxiliary xml ``Snapshot.xml``, which allows to store optional snapshot
65
+information, but it doesn't influence open/read/write functionality. QEMU and
66
+other software should not use fields not covered in this document and
67
+``Snapshot.xml`` file and must leave them as is.
68
+
69
+Parallels disk consists of two parts: the set of snapshots and the disk
70
+descriptor file, which stores information about all files and snapshots.
71
+
72
+Definitions
73
+-----------
74
+
75
+Snapshot
76
+ a record of the contents captured at a particular time, capable
77
+ of storing current state. A snapshot has UUID and parent UUID.
78
+
79
+Snapshot image
80
+ an overlay representing the difference between this
81
+ snapshot and some earlier snapshot.
82
+
83
+Overlay
84
+ an image storing the different sectors between two captured states.
85
+
86
+Root image
87
+ snapshot image with no parent, the root of snapshot tree.
88
+
89
+Storage
90
+ the backing storage for a subset of the virtual disk. When
91
+ there is more than one storage in a Parallels disk then that
92
+ is referred to as a split image. In this case every storage
93
+ covers specific address space area of the disk and has its
94
+ particular root image. Split images are not considered here
95
+ and are not supported. Each storage consists of disk
96
+ parameters and a list of images. The list of images always
97
+ contains a root image and may also contain overlays. The
98
+ root image can be an expandable Parallels image file or
99
+ plain. Overlays must be expandable.
100
+
101
+Description file
102
+ ``DiskDescriptor.xml`` stores information about disk parameters,
103
+ snapshots, storages.
104
+
105
+Top Snapshot
106
+ The overlay between actual state and some previous snapshot.
107
+ It is not a snapshot in the classical sense because it
108
+ serves as the active image that the guest writes to.
109
+
110
+Sector
111
+ a 512-byte data chunk.
112
+
113
+Description file
114
+----------------
115
+
116
+All information is placed in a single XML element
117
+``Parallels_disk_image``.
118
+The element has only one attribute ``Version``, that must be ``1.0``.
119
+
120
+Schema of ``DiskDescriptor.xml``::
121
+
122
+ <Parallels_disk_image Version="1.0">
123
+ <Disk_Parameters>
124
+ ...
125
+ </Disk_Parameters>
126
+ <StorageData>
127
+ ...
128
+ </StorageData>
129
+ <Snapshots>
130
+ ...
131
+ </Snapshots>
132
+ </Parallels_disk_image>
133
+
134
+``Disk_Parameters`` element
135
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
136
+
137
+The ``Disk_Parameters`` element describes the physical layout of the
138
+virtual disk and some general settings.
139
+
140
+The ``Disk_Parameters`` element MUST contain the following child elements:
141
+
142
+* ``Disk_size`` - number of sectors in the disk,
143
+ desired size of the disk.
144
+* ``Cylinders`` - number of the disk cylinders.
145
+* ``Heads`` - number of the disk heads.
146
+* ``Sectors`` - number of the disk sectors per cylinder
147
+ (sector size is 512 bytes)
148
+ Limitation: Product of the ``Heads``, ``Sectors`` and ``Cylinders``
149
+ values MUST be equal to the value of the Disk_size parameter.
150
+* ``Padding`` - must be 0. Parallels Cloud Server and Parallels Desktop may
151
+ use padding set to 1, however this case is not covered
152
+ by this spec, QEMU and other software should not open
153
+ such disks and should not create them.
154
+
155
+``StorageData`` element
156
+^^^^^^^^^^^^^^^^^^^^^^^
157
+
158
+This element of the file describes the root image and all snapshot images.
159
+
160
+The ``StorageData`` element consists of the ``Storage`` child element,
161
+as shown below::
162
+
163
+ <StorageData>
164
+ <Storage>
165
+ ...
166
+ </Storage>
167
+ </StorageData>
168
+
169
+A ``Storage`` element has following child elements:
170
+
171
+* ``Start`` - start sector of the storage, in case of non split storage
172
+ equals to 0.
173
+* ``End`` - number of sector following the last sector, in case of non
174
+ split storage equals to ``Disk_size``.
175
+* ``Blocksize`` - storage cluster size, number of sectors per one cluster.
176
+ Cluster size for each "Compressed" (see below) image in
177
+ parallels disk must be equal to this field. Note: cluster
178
+ size for Parallels Expandable Image is in ``tracks`` field of
179
+ its header (see :doc:`parallels`).
180
+* Several ``Image`` child elements.
181
+
182
+Each ``Image`` element has following child elements:
183
+
184
+* ``GUID`` - image identifier, UUID in curly brackets.
185
+ For instance, ``{12345678-9abc-def1-2345-6789abcdef12}.``
186
+ The GUID is used by the Snapshots element to reference images
187
+ (see below)
188
+* ``Type`` - image type of the element. It can be:
189
+
190
+ * ``Plain`` for raw files.
191
+ * ``Compressed`` for expanding disks.
192
+
193
+* ``File`` - path to image file. Path can be relative to
194
+ ``DiskDescriptor.xml`` or absolute.
195
+
196
+``Snapshots`` element
197
+^^^^^^^^^^^^^^^^^^^^^
198
+
199
+The ``Snapshots`` element describes the snapshot relations with the snapshot tree.
200
+
201
+The element contains the set of ``Shot`` child elements, as shown below::
202
+
203
+ <Snapshots>
204
+ <TopGUID> ... </TopGUID> /* Optional child element */
205
+ <Shot>
206
+ ...
207
+ </Shot>
208
+ <Shot>
209
+ ...
210
+ </Shot>
211
+ ...
212
+ </Snapshots>
213
+
214
+Each ``Shot`` element contains the following child elements:
215
+
216
+* ``GUID`` - an image GUID.
217
+* ``ParentGUID`` - GUID of the image of the parent snapshot.
218
+
219
+The software may traverse snapshots from child to parent using ``<ParentGUID>``
220
+field as reference. ``ParentGUID`` of root snapshot is
221
+``{00000000-0000-0000-0000-000000000000}``. There should be only one root
222
+snapshot. Top snapshot could be described via two ways: via ``TopGUID`` child
223
+element of the ``Snapshots`` element or via predefined GUID
224
+``{5fbaabe3-6958-40ff-92a7-860e329aab41}``. If ``TopGUID`` is defined,
225
+predefined GUID is interpreted as usual GUID. All snapshot images
226
+(except Top Snapshot) should be
227
+opened read-only. There is another predefined GUID,
228
+``BackupID = {704718e1-2314-44c8-9087-d78ed36b0f4e}``, which is used by
229
+original and some third-party software for backup, QEMU and other
230
+software may operate with images with ``GUID = BackupID`` as usual,
231
+however, it is not recommended to use this
232
+GUID for new disks. Top snapshot cannot have this GUID.
233
diff --git a/docs/interop/prl-xml.txt b/docs/interop/prl-xml.txt
234
deleted file mode 100644
74
deleted file mode 100644
235
index XXXXXXX..XXXXXXX
75
index XXXXXXX..XXXXXXX
236
--- a/docs/interop/prl-xml.txt
76
--- a/tests/tcg/arm/test-arm-iwmmxt.S
237
+++ /dev/null
77
+++ /dev/null
238
@@ -XXX,XX +XXX,XX @@
78
@@ -XXX,XX +XXX,XX @@
239
-= License =
79
-@ Checks whether iwMMXt is functional.
80
-.code    32
81
-.globl    main
240
-
82
-
241
-Copyright (c) 2015-2017, Virtuozzo, Inc.
83
-main:
242
-Authors:
84
-ldr    r0, =data0
243
- 2015 Denis Lunev <den@openvz.org>
85
-ldr    r1, =data1
244
- 2015 Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
86
-ldr    r2, =data2
245
- 2016-2017 Klim Kireev <klim.kireev@virtuozzo.com>
87
-#ifndef FPA
246
- 2016-2017 Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
88
-wldrd    wr0, [r0, #0]
89
-wldrd    wr1, [r0, #8]
90
-wldrd    wr2, [r1, #0]
91
-wldrd    wr3, [r1, #8]
92
-wsubb    wr2, wr2, wr0
93
-wsubb    wr3, wr3, wr1
94
-wldrd    wr0, [r2, #0]
95
-wldrd    wr1, [r2, #8]
96
-waddb    wr0, wr0, wr2
97
-waddb    wr1, wr1, wr3
98
-wstrd    wr0, [r2, #0]
99
-wstrd    wr1, [r2, #8]
100
-#else
101
-ldfe    f0, [r0, #0]
102
-ldfe    f1, [r0, #8]
103
-ldfe    f2, [r1, #0]
104
-ldfe    f3, [r1, #8]
105
-adfdp    f2, f2, f0
106
-adfdp    f3, f3, f1
107
-ldfe    f0, [r2, #0]
108
-ldfe    f1, [r2, #8]
109
-adfd    f0, f0, f2
110
-adfd    f1, f1, f3
111
-stfe    f0, [r2, #0]
112
-stfe    f1, [r2, #8]
113
-#endif
114
-mov    r0, #1
115
-mov    r1, r2
116
-mov    r2, #0x11
117
-swi    #0x900004
118
-mov    r0, #0
119
-swi    #0x900001
247
-
120
-
248
-This work is licensed under the terms of the GNU GPL, version 2 or later.
121
-.data
249
-See the COPYING file in the top-level directory.
122
-data0:
250
-
123
-.string    "aaaabbbbccccdddd"
251
-This specification contains minimal information about Parallels Disk Format,
124
-data1:
252
-which is enough to proper work with QEMU. Nevertheless, Parallels Cloud Server
125
-.string    "bbbbccccddddeeee"
253
-and Parallels Desktop are able to add some unspecified nodes to xml and use
126
-data2:
254
-them, but they are for internal work and don't affect functionality. Also it
127
-.string    "hvLLWs\x1fsdrs9\x1fNJ-\n"
255
-uses auxiliary xml "Snapshot.xml", which allows to store optional snapshot
256
-information, but it doesn't influence open/read/write functionality. QEMU and
257
-other software should not use fields not covered in this document and
258
-Snapshot.xml file and must leave them as is.
259
-
260
-= Parallels Disk Format =
261
-
262
-Parallels disk consists of two parts: the set of snapshots and the disk
263
-descriptor file, which stores information about all files and snapshots.
264
-
265
-== Definitions ==
266
- Snapshot a record of the contents captured at a particular time,
267
- capable of storing current state. A snapshot has UUID and
268
- parent UUID.
269
-
270
- Snapshot image an overlay representing the difference between this
271
- snapshot and some earlier snapshot.
272
-
273
- Overlay an image storing the different sectors between two captured
274
- states.
275
-
276
- Root image snapshot image with no parent, the root of snapshot tree.
277
-
278
- Storage the backing storage for a subset of the virtual disk. When
279
- there is more than one storage in a Parallels disk then that
280
- is referred to as a split image. In this case every storage
281
- covers specific address space area of the disk and has its
282
- particular root image. Split images are not considered here
283
- and are not supported. Each storage consists of disk
284
- parameters and a list of images. The list of images always
285
- contains a root image and may also contain overlays. The
286
- root image can be an expandable Parallels image file or
287
- plain. Overlays must be expandable.
288
-
289
- Description DiskDescriptor.xml stores information about disk parameters,
290
- file snapshots, storages.
291
-
292
- Top The overlay between actual state and some previous snapshot.
293
- Snapshot It is not a snapshot in the classical sense because it
294
- serves as the active image that the guest writes to.
295
-
296
- Sector a 512-byte data chunk.
297
-
298
-== Description file ==
299
-All information is placed in a single XML element Parallels_disk_image.
300
-The element has only one attribute "Version", that must be 1.0.
301
-Schema of DiskDescriptor.xml:
302
-
303
-<Parallels_disk_image Version="1.0">
304
- <Disk_Parameters>
305
- ...
306
- </Disk_Parameters>
307
- <StorageData>
308
- ...
309
- </StorageData>
310
- <Snapshots>
311
- ...
312
- </Snapshots>
313
-</Parallels_disk_image>
314
-
315
-== Disk_Parameters element ==
316
-The Disk_Parameters element describes the physical layout of the virtual disk
317
-and some general settings.
318
-
319
-The Disk_Parameters element MUST contain the following child elements:
320
- * Disk_size - number of sectors in the disk,
321
- desired size of the disk.
322
- * Cylinders - number of the disk cylinders.
323
- * Heads - number of the disk heads.
324
- * Sectors - number of the disk sectors per cylinder
325
- (sector size is 512 bytes)
326
- Limitation: Product of the Heads, Sectors and Cylinders
327
- values MUST be equal to the value of the Disk_size parameter.
328
- * Padding - must be 0. Parallels Cloud Server and Parallels Desktop may
329
- use padding set to 1, however this case is not covered
330
- by this spec, QEMU and other software should not open
331
- such disks and should not create them.
332
-
333
-== StorageData element ==
334
-This element of the file describes the root image and all snapshot images.
335
-
336
-The StorageData element consists of the Storage child element, as shown below:
337
-<StorageData>
338
- <Storage>
339
- ...
340
- </Storage>
341
-</StorageData>
342
-
343
-A Storage element has following child elements:
344
- * Start - start sector of the storage, in case of non split storage
345
- equals to 0.
346
- * End - number of sector following the last sector, in case of non
347
- split storage equals to Disk_size.
348
- * Blocksize - storage cluster size, number of sectors per one cluster.
349
- Cluster size for each "Compressed" (see below) image in
350
- parallels disk must be equal to this field. Note: cluster
351
- size for Parallels Expandable Image is in 'tracks' field of
352
- its header (see docs/interop/parallels.txt).
353
- * Several Image child elements.
354
-
355
-Each Image element has following child elements:
356
- * GUID - image identifier, UUID in curly brackets.
357
- For instance, {12345678-9abc-def1-2345-6789abcdef12}.
358
- The GUID is used by the Snapshots element to reference images
359
- (see below)
360
- * Type - image type of the element. It can be:
361
- "Plain" for raw files.
362
- "Compressed" for expanding disks.
363
- * File - path to image file. Path can be relative to DiskDescriptor.xml or
364
- absolute.
365
-
366
-== Snapshots element ==
367
-The Snapshots element describes the snapshot relations with the snapshot tree.
368
-
369
-The element contains the set of Shot child elements, as shown below:
370
-<Snapshots>
371
- <TopGUID> ... </TopGUID> /* Optional child element */
372
- <Shot>
373
- ...
374
- </Shot>
375
- <Shot>
376
- ...
377
- </Shot>
378
- ...
379
-</Snapshots>
380
-
381
-Each Shot element contains the following child elements:
382
- * GUID - an image GUID.
383
- * ParentGUID - GUID of the image of the parent snapshot.
384
-
385
-The software may traverse snapshots from child to parent using <ParentGUID>
386
-field as reference. ParentGUID of root snapshot is
387
-{00000000-0000-0000-0000-000000000000}. There should be only one root
388
-snapshot. Top snapshot could be described via two ways: via TopGUID child
389
-element of the Snapshots element or via predefined GUID
390
-{5fbaabe3-6958-40ff-92a7-860e329aab41}. If TopGUID is defined, predefined GUID is
391
-interpreted as usual GUID. All snapshot images (except Top Snapshot) should be
392
-opened read-only. There is another predefined GUID,
393
-BackupID = {704718e1-2314-44c8-9087-d78ed36b0f4e}, which is used by original and
394
-some third-party software for backup, QEMU and other software may operate with
395
-images with GUID = BackupID as usual, however, it is not recommended to use this
396
-GUID for new disks. Top snapshot cannot have this GUID.
397
--
128
--
398
2.34.1
129
2.34.1
130
131
diff view generated by jsdifflib
1
Convert parallels.txt to rST format.
1
We removed the old table-based decoder in favour of decodetree, but
2
we left a couple of typedefs that are now unused; delete them.
2
3
3
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
5
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
5
Reviewed-by: Eric Blake <eblake@redhat.com>
6
Message-id: 20250128135046.4108775-1-peter.maydell@linaro.org
6
Message-id: 20240801170131.3977807-4-peter.maydell@linaro.org
7
---
7
---
8
MAINTAINERS | 2 +-
8
target/arm/tcg/translate-a64.c | 11 -----------
9
docs/interop/index.rst | 1 +
9
1 file changed, 11 deletions(-)
10
docs/interop/{parallels.txt => parallels.rst} | 108 ++++++++++--------
11
3 files changed, 60 insertions(+), 51 deletions(-)
12
rename docs/interop/{parallels.txt => parallels.rst} (72%)
13
10
14
diff --git a/MAINTAINERS b/MAINTAINERS
11
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
15
index XXXXXXX..XXXXXXX 100644
12
index XXXXXXX..XXXXXXX 100644
16
--- a/MAINTAINERS
13
--- a/target/arm/tcg/translate-a64.c
17
+++ b/MAINTAINERS
14
+++ b/target/arm/tcg/translate-a64.c
18
@@ -XXX,XX +XXX,XX @@ L: qemu-block@nongnu.org
15
@@ -XXX,XX +XXX,XX @@ static int scale_by_log2_tag_granule(DisasContext *s, int x)
19
S: Supported
16
#include "decode-sme-fa64.c.inc"
20
F: block/parallels.c
17
#include "decode-a64.c.inc"
21
F: block/parallels-ext.c
18
22
-F: docs/interop/parallels.txt
19
-/* Table based decoder typedefs - used when the relevant bits for decode
23
+F: docs/interop/parallels.rst
20
- * are too awkwardly scattered across the instruction (eg SIMD).
24
T: git https://src.openvz.org/scm/~den/qemu.git parallels
21
- */
25
22
-typedef void AArch64DecodeFn(DisasContext *s, uint32_t insn);
26
qed
27
diff --git a/docs/interop/index.rst b/docs/interop/index.rst
28
index XXXXXXX..XXXXXXX 100644
29
--- a/docs/interop/index.rst
30
+++ b/docs/interop/index.rst
31
@@ -XXX,XX +XXX,XX @@ are useful for making QEMU interoperate with other software.
32
dbus-display
33
live-block-operations
34
nbd
35
+ parallels
36
pr-helper
37
qmp-spec
38
qemu-ga
39
diff --git a/docs/interop/parallels.txt b/docs/interop/parallels.rst
40
similarity index 72%
41
rename from docs/interop/parallels.txt
42
rename to docs/interop/parallels.rst
43
index XXXXXXX..XXXXXXX 100644
44
--- a/docs/interop/parallels.txt
45
+++ b/docs/interop/parallels.rst
46
@@ -XXX,XX +XXX,XX @@
47
-= License =
48
+Parallels Expandable Image File Format
49
+======================================
50
51
-Copyright (c) 2015 Denis Lunev
52
-Copyright (c) 2015 Vladimir Sementsov-Ogievskiy
53
+..
54
+ Copyright (c) 2015 Denis Lunev
55
+ Copyright (c) 2015 Vladimir Sementsov-Ogievskiy
56
57
-This work is licensed under the terms of the GNU GPL, version 2 or later.
58
-See the COPYING file in the top-level directory.
59
+ This work is licensed under the terms of the GNU GPL, version 2 or later.
60
+ See the COPYING file in the top-level directory.
61
62
-= Parallels Expandable Image File Format =
63
64
A Parallels expandable image file consists of three consecutive parts:
65
- * header
66
- * BAT
67
- * data area
68
+
69
+* header
70
+* BAT
71
+* data area
72
73
All numbers in a Parallels expandable image are stored in little-endian byte
74
order.
75
76
77
-== Definitions ==
78
+Definitions
79
+-----------
80
81
- Sector A 512-byte data chunk.
82
+Sector
83
+ A 512-byte data chunk.
84
85
- Cluster A data chunk of the size specified in the image header.
86
- Currently, the default size is 1MiB (2048 sectors). In previous
87
- versions, cluster sizes of 63 sectors, 256 and 252 kilobytes were
88
- used.
89
+Cluster
90
+ A data chunk of the size specified in the image header.
91
+ Currently, the default size is 1MiB (2048 sectors). In previous
92
+ versions, cluster sizes of 63 sectors, 256 and 252 kilobytes were used.
93
94
- BAT Block Allocation Table, an entity that contains information for
95
- guest-to-host I/O data address translation.
96
+BAT
97
+ Block Allocation Table, an entity that contains information for
98
+ guest-to-host I/O data address translation.
99
100
-
23
-
101
-== Header ==
24
-typedef struct AArch64DecodeTable {
102
+Header
25
- uint32_t pattern;
103
+------
26
- uint32_t mask;
104
27
- AArch64DecodeFn *disas_fn;
105
The header is placed at the start of an image and contains the following
28
-} AArch64DecodeTable;
106
-fields:
107
+fields::
108
109
-Bytes:
110
+ Bytes:
111
0 - 15: magic
112
Must contain "WithoutFreeSpace" or "WithouFreSpacExt".
113
114
@@ -XXX,XX +XXX,XX @@ Bytes:
115
ext_off must meet the same requirements as cluster offsets
116
defined by BAT entries (see below).
117
118
-
29
-
119
-== BAT ==
30
/* initialize TCG globals. */
120
+BAT
31
void a64_translate_init(void)
121
+---
32
{
122
123
BAT is placed immediately after the image header. In the file, BAT is a
124
contiguous array of 32-bit unsigned little-endian integers with
125
-(bat_entries * 4) bytes size.
126
+``(bat_entries * 4)`` bytes size.
127
128
Each BAT entry contains an offset from the start of the file to the
129
-corresponding cluster. The offset set in clusters for "WithouFreSpacExt" images
130
-and in sectors for "WithoutFreeSpace" images.
131
+corresponding cluster. The offset set in clusters for ``WithouFreSpacExt``
132
+images and in sectors for ``WithoutFreeSpace`` images.
133
134
If a BAT entry is zero, the corresponding cluster is not allocated and should
135
be considered as filled with zeroes.
136
137
Cluster offsets specified by BAT entries must meet the following requirements:
138
- - the value must not be lower than data offset (provided by header.data_off
139
- or calculated as specified above),
140
- - the value must be lower than the desired file size,
141
- - the value must be unique among all BAT entries,
142
- - the result of (cluster offset - data offset) must be aligned to cluster
143
- size.
144
145
+- the value must not be lower than data offset (provided by ``header.data_off``
146
+ or calculated as specified above)
147
+- the value must be lower than the desired file size
148
+- the value must be unique among all BAT entries
149
+- the result of ``(cluster offset - data offset)`` must be aligned to
150
+ cluster size
151
152
-== Data Area ==
153
+Data Area
154
+---------
155
156
-The data area is an area from the data offset (provided by header.data_off or
157
-calculated as specified above) to the end of the file. It represents a
158
+The data area is an area from the data offset (provided by ``header.data_off``
159
+or calculated as specified above) to the end of the file. It represents a
160
contiguous array of clusters. Most of them are allocated by the BAT, some may
161
-be allocated by the ext_off field in the header while other may be allocated by
162
-extensions. All clusters allocated by ext_off and extensions should meet the
163
-same requirements as clusters specified by BAT entries.
164
+be allocated by the ``ext_off`` field in the header while other may be
165
+allocated by extensions. All clusters allocated by ``ext_off`` and extensions
166
+should meet the same requirements as clusters specified by BAT entries.
167
168
169
-== Format Extension ==
170
+Format Extension
171
+----------------
172
173
The Format Extension is an area 1 cluster in size that provides additional
174
format features. This cluster is addressed by the ext_off field in the header.
175
-The format of the Format Extension area is the following:
176
+The format of the Format Extension area is the following::
177
178
0 - 7: magic
179
Must be 0xAB234CEF23DCEA87
180
@@ -XXX,XX +XXX,XX @@ The format of the Format Extension area is the following:
181
The MD5 checksum of the entire Header Extension cluster except
182
the first 24 bytes.
183
184
- The above are followed by feature sections or "extensions". The last
185
- extension must be "End of features" (see below).
186
+The above are followed by feature sections or "extensions". The last
187
+extension must be "End of features" (see below).
188
189
-Each feature section has the following format:
190
+Each feature section has the following format::
191
192
0 - 7: magic
193
The identifier of the feature:
194
@@ -XXX,XX +XXX,XX @@ Each feature section has the following format:
195
196
variable: data (data_size bytes)
197
198
- The above is followed by padding to the next 8 bytes boundary, then the
199
- next extension starts.
200
+The above is followed by padding to the next 8 bytes boundary, then the
201
+next extension starts.
202
203
- The last extension must be "End of features" with all the fields set to 0.
204
+The last extension must be "End of features" with all the fields set to 0.
205
206
207
-=== Dirty bitmaps feature ===
208
+Dirty bitmaps feature
209
+---------------------
210
211
This feature provides a way of storing dirty bitmaps in the image. The fields
212
-of its data area are:
213
+of its data area are::
214
215
0 - 7: size
216
The bitmap size, should be equal to disk size in sectors.
217
@@ -XXX,XX +XXX,XX @@ clusters inside the Parallels image file. The offsets of these clusters are
218
saved in the L1 offset table specified by the feature extension. Each L1 table
219
entry is a 64 bit integer as described below:
220
221
-Given an offset in bytes into the bitmap data, corresponding L1 entry is
222
+Given an offset in bytes into the bitmap data, corresponding L1 entry is::
223
224
l1_table[offset / cluster_size]
225
226
@@ -XXX,XX +XXX,XX @@ are assumed to be 1.
227
228
If an L1 table entry is not 0 or 1, it contains the corresponding cluster
229
offset (in 512b sectors). Given an offset in bytes into the bitmap data the
230
-offset in bytes into the image file can be obtained as follows:
231
+offset in bytes into the image file can be obtained as follows::
232
233
offset = l1_table[offset / cluster_size] * 512 + (offset % cluster_size)
234
--
33
--
235
2.34.1
34
2.34.1
diff view generated by jsdifflib
1
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1
From: Philippe Mathieu-Daudé <philmd@linaro.org>
2
2
3
Having magic numbers inside the code is not a good idea, as it
3
In heterogeneous setup the first vCPU might not be
4
is error-prone. So, instead, create a macro with the number
4
the one expected, better pass it explicitly.
5
definition.
6
5
7
Link: https://lore.kernel.org/qemu-devel/CAFEAcA-PYnZ-32MRX+PgvzhnoAV80zBKMYg61j2f=oHaGfwSsg@mail.gmail.com/
6
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
8
7
Reviewed-by: Cédric Le Goater <clg@kaod.org>
9
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
8
Message-id: 20250130112615.3219-2-philmd@linaro.org
10
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
11
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
12
Message-id: ef0e7f5fca6cd94eda415ecee670c3028c671b74.1723121692.git.mchehab+huawei@kernel.org
13
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
14
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
15
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
16
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
17
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
18
---
10
---
19
include/hw/arm/virt.h | 3 +++
11
include/hw/arm/boot.h | 4 +++-
20
hw/arm/virt-acpi-build.c | 6 +++---
12
hw/arm/boot.c | 11 ++++++-----
21
hw/arm/virt.c | 7 ++++---
13
hw/arm/virt.c | 2 +-
22
3 files changed, 10 insertions(+), 6 deletions(-)
14
3 files changed, 10 insertions(+), 7 deletions(-)
23
15
24
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
16
diff --git a/include/hw/arm/boot.h b/include/hw/arm/boot.h
25
index XXXXXXX..XXXXXXX 100644
17
index XXXXXXX..XXXXXXX 100644
26
--- a/include/hw/arm/virt.h
18
--- a/include/hw/arm/boot.h
27
+++ b/include/hw/arm/virt.h
19
+++ b/include/hw/arm/boot.h
28
@@ -XXX,XX +XXX,XX @@
20
@@ -XXX,XX +XXX,XX @@ AddressSpace *arm_boot_address_space(ARMCPU *cpu,
29
/* See Linux kernel arch/arm64/include/asm/pvclock-abi.h */
21
* @binfo: struct describing the boot environment
30
#define PVTIME_SIZE_PER_CPU 64
22
* @addr_limit: upper limit of the available memory area at @addr
31
23
* @as: address space to load image to
32
+/* GPIO pins */
24
+ * @cpu: ARM CPU object
33
+#define GPIO_PIN_POWER_BUTTON 3
25
*
34
+
26
* Load a device tree supplied by the machine or by the user with the
35
enum {
27
* '-dtb' command line option, and put it at offset @addr in target
36
VIRT_FLASH,
28
@@ -XXX,XX +XXX,XX @@ AddressSpace *arm_boot_address_space(ARMCPU *cpu,
37
VIRT_MEM,
29
* Note: Must not be called unless have_dtb(binfo) is true.
38
diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
30
*/
31
int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
32
- hwaddr addr_limit, AddressSpace *as, MachineState *ms);
33
+ hwaddr addr_limit, AddressSpace *as, MachineState *ms,
34
+ ARMCPU *cpu);
35
36
/* Write a secure board setup routine with a dummy handler for SMCs */
37
void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu,
38
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
39
index XXXXXXX..XXXXXXX 100644
39
index XXXXXXX..XXXXXXX 100644
40
--- a/hw/arm/virt-acpi-build.c
40
--- a/hw/arm/boot.c
41
+++ b/hw/arm/virt-acpi-build.c
41
+++ b/hw/arm/boot.c
42
@@ -XXX,XX +XXX,XX @@ static void acpi_dsdt_add_gpio(Aml *scope, const MemMapEntry *gpio_memmap,
42
@@ -XXX,XX +XXX,XX @@ out:
43
aml_append(dev, aml_name_decl("_CRS", crs));
43
return ret;
44
44
}
45
Aml *aei = aml_resource_template();
45
46
- /* Pin 3 for power button */
46
-static void fdt_add_psci_node(void *fdt)
47
- const uint32_t pin_list[1] = {3};
47
+static void fdt_add_psci_node(void *fdt, ARMCPU *armcpu)
48
+
48
{
49
+ const uint32_t pin = GPIO_PIN_POWER_BUTTON;
49
uint32_t cpu_suspend_fn;
50
aml_append(aei, aml_gpio_int(AML_CONSUMER, AML_EDGE, AML_ACTIVE_HIGH,
50
uint32_t cpu_off_fn;
51
- AML_EXCLUSIVE, AML_PULL_UP, 0, pin_list, 1,
51
uint32_t cpu_on_fn;
52
+ AML_EXCLUSIVE, AML_PULL_UP, 0, &pin, 1,
52
uint32_t migrate_fn;
53
"GPO0", NULL, 0));
53
- ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(0));
54
aml_append(dev, aml_name_decl("_AEI", aei));
54
const char *psci_method;
55
55
int64_t psci_conduit;
56
int rc;
57
@@ -XXX,XX +XXX,XX @@ static void fdt_add_psci_node(void *fdt)
58
}
59
60
int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
61
- hwaddr addr_limit, AddressSpace *as, MachineState *ms)
62
+ hwaddr addr_limit, AddressSpace *as, MachineState *ms,
63
+ ARMCPU *cpu)
64
{
65
void *fdt = NULL;
66
int size, rc, n = 0;
67
@@ -XXX,XX +XXX,XX @@ int arm_load_dtb(hwaddr addr, const struct arm_boot_info *binfo,
68
}
69
}
70
71
- fdt_add_psci_node(fdt);
72
+ fdt_add_psci_node(fdt, cpu);
73
74
if (binfo->modify_dtb) {
75
binfo->modify_dtb(binfo, fdt);
76
@@ -XXX,XX +XXX,XX @@ void arm_load_kernel(ARMCPU *cpu, MachineState *ms, struct arm_boot_info *info)
77
* decided whether to enable PSCI and set the psci-conduit CPU properties.
78
*/
79
if (!info->skip_dtb_autoload && have_dtb(info)) {
80
- if (arm_load_dtb(info->dtb_start, info, info->dtb_limit, as, ms) < 0) {
81
+ if (arm_load_dtb(info->dtb_start, info, info->dtb_limit,
82
+ as, ms, cpu) < 0) {
83
exit(1);
84
}
85
}
56
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
86
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
57
index XXXXXXX..XXXXXXX 100644
87
index XXXXXXX..XXXXXXX 100644
58
--- a/hw/arm/virt.c
88
--- a/hw/arm/virt.c
59
+++ b/hw/arm/virt.c
89
+++ b/hw/arm/virt.c
60
@@ -XXX,XX +XXX,XX @@ static void virt_powerdown_req(Notifier *n, void *opaque)
90
@@ -XXX,XX +XXX,XX @@ void virt_machine_done(Notifier *notifier, void *data)
61
if (s->acpi_dev) {
91
vms->memmap[VIRT_PLATFORM_BUS].size,
62
acpi_send_event(s->acpi_dev, ACPI_POWER_DOWN_STATUS);
92
vms->irqmap[VIRT_PLATFORM_BUS]);
63
} else {
64
- /* use gpio Pin 3 for power button event */
65
+ /* use gpio Pin for power button event */
66
qemu_set_irq(qdev_get_gpio_in(gpio_key_dev, 0), 1);
67
}
93
}
68
}
94
- if (arm_load_dtb(info->dtb_start, info, info->dtb_limit, as, ms) < 0) {
69
@@ -XXX,XX +XXX,XX @@ static void create_gpio_keys(char *fdt, DeviceState *pl061_dev,
95
+ if (arm_load_dtb(info->dtb_start, info, info->dtb_limit, as, ms, cpu) < 0) {
70
uint32_t phandle)
96
exit(1);
71
{
97
}
72
gpio_key_dev = sysbus_create_simple("gpio-key", -1,
98
73
- qdev_get_gpio_in(pl061_dev, 3));
74
+ qdev_get_gpio_in(pl061_dev,
75
+ GPIO_PIN_POWER_BUTTON));
76
77
qemu_fdt_add_subnode(fdt, "/gpio-keys");
78
qemu_fdt_setprop_string(fdt, "/gpio-keys", "compatible", "gpio-keys");
79
@@ -XXX,XX +XXX,XX @@ static void create_gpio_keys(char *fdt, DeviceState *pl061_dev,
80
qemu_fdt_setprop_cell(fdt, "/gpio-keys/poweroff", "linux,code",
81
KEY_POWER);
82
qemu_fdt_setprop_cells(fdt, "/gpio-keys/poweroff",
83
- "gpios", phandle, 3, 0);
84
+ "gpios", phandle, GPIO_PIN_POWER_BUTTON, 0);
85
}
86
87
#define SECURE_GPIO_POWEROFF 0
88
--
99
--
89
2.34.1
100
2.34.1
101
102
diff view generated by jsdifflib
1
Convert nbd.txt to rST format.
1
From: Philippe Mathieu-Daudé <philmd@linaro.org>
2
2
3
The A9MPCore forward the IRQs from its internal GIC.
4
To make the code clearer, add the 'mpcore' and 'gic'
5
variables.
6
7
Reviewed-by: Cédric Le Goater <clg@kaod.org>
8
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
9
Message-id: 20250130112615.3219-3-philmd@linaro.org
3
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
5
Reviewed-by: Eric Blake <eblake@redhat.com>
6
Message-id: 20240801170131.3977807-3-peter.maydell@linaro.org
7
---
11
---
8
MAINTAINERS | 2 +-
12
hw/arm/fsl-imx6.c | 52 +++++++++++++++++++----------------------------
9
docs/interop/index.rst | 1 +
13
1 file changed, 21 insertions(+), 31 deletions(-)
10
docs/interop/nbd.rst | 89 ++++++++++++++++++++++++++++++++++++++++++
11
docs/interop/nbd.txt | 72 ----------------------------------
12
4 files changed, 91 insertions(+), 73 deletions(-)
13
create mode 100644 docs/interop/nbd.rst
14
delete mode 100644 docs/interop/nbd.txt
15
14
16
diff --git a/MAINTAINERS b/MAINTAINERS
15
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
17
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
18
--- a/MAINTAINERS
17
--- a/hw/arm/fsl-imx6.c
19
+++ b/MAINTAINERS
18
+++ b/hw/arm/fsl-imx6.c
20
@@ -XXX,XX +XXX,XX @@ F: nbd/
19
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
21
F: include/block/nbd*
20
uint16_t i;
22
F: qemu-nbd.*
21
qemu_irq irq;
23
F: blockdev-nbd.c
22
unsigned int smp_cpus = ms->smp.cpus;
24
-F: docs/interop/nbd.txt
23
+ DeviceState *mpcore = DEVICE(&s->a9mpcore);
25
+F: docs/interop/nbd.rst
24
+ DeviceState *gic;
26
F: docs/tools/qemu-nbd.rst
25
27
F: tests/qemu-iotests/tests/*nbd*
26
if (smp_cpus > FSL_IMX6_NUM_CPUS) {
28
T: git https://repo.or.cz/qemu/ericb.git nbd
27
error_setg(errp, "%s: Only %d CPUs are supported (%d requested)",
29
diff --git a/docs/interop/index.rst b/docs/interop/index.rst
28
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
30
index XXXXXXX..XXXXXXX 100644
29
}
31
--- a/docs/interop/index.rst
30
}
32
+++ b/docs/interop/index.rst
31
33
@@ -XXX,XX +XXX,XX @@ are useful for making QEMU interoperate with other software.
32
- object_property_set_int(OBJECT(&s->a9mpcore), "num-cpu", smp_cpus,
34
dbus-vmstate
33
- &error_abort);
35
dbus-display
34
+ object_property_set_int(OBJECT(mpcore), "num-cpu", smp_cpus, &error_abort);
36
live-block-operations
35
37
+ nbd
36
- object_property_set_int(OBJECT(&s->a9mpcore), "num-irq",
38
pr-helper
37
+ object_property_set_int(OBJECT(mpcore), "num-irq",
39
qmp-spec
38
FSL_IMX6_MAX_IRQ + GIC_INTERNAL, &error_abort);
40
qemu-ga
39
41
diff --git a/docs/interop/nbd.rst b/docs/interop/nbd.rst
40
- if (!sysbus_realize(SYS_BUS_DEVICE(&s->a9mpcore), errp)) {
42
new file mode 100644
41
+ if (!sysbus_realize(SYS_BUS_DEVICE(mpcore), errp)) {
43
index XXXXXXX..XXXXXXX
42
return;
44
--- /dev/null
43
}
45
+++ b/docs/interop/nbd.rst
44
- sysbus_mmio_map(SYS_BUS_DEVICE(&s->a9mpcore), 0, FSL_IMX6_A9MPCORE_ADDR);
46
@@ -XXX,XX +XXX,XX @@
45
+ sysbus_mmio_map(SYS_BUS_DEVICE(mpcore), 0, FSL_IMX6_A9MPCORE_ADDR);
47
+QEMU NBD protocol support
46
48
+=========================
47
+ gic = mpcore;
49
+
48
for (i = 0; i < smp_cpus; i++) {
50
+QEMU supports the NBD protocol, and has an internal NBD client (see
49
- sysbus_connect_irq(SYS_BUS_DEVICE(&s->a9mpcore), i,
51
+``block/nbd.c``), an internal NBD server (see ``blockdev-nbd.c``), and an
50
+ sysbus_connect_irq(SYS_BUS_DEVICE(gic), i,
52
+external NBD server tool (see ``qemu-nbd.c``). The common code is placed
51
qdev_get_gpio_in(DEVICE(&s->cpu[i]), ARM_CPU_IRQ));
53
+in ``nbd/*``.
52
- sysbus_connect_irq(SYS_BUS_DEVICE(&s->a9mpcore), i + smp_cpus,
54
+
53
+ sysbus_connect_irq(SYS_BUS_DEVICE(gic), i + smp_cpus,
55
+The NBD protocol is specified here:
54
qdev_get_gpio_in(DEVICE(&s->cpu[i]), ARM_CPU_FIQ));
56
+https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md
55
}
57
+
56
58
+The following paragraphs describe some specific properties of NBD
57
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
59
+protocol realization in QEMU.
58
60
+
59
sysbus_mmio_map(SYS_BUS_DEVICE(&s->uart[i]), 0, serial_table[i].addr);
61
+Metadata namespaces
60
sysbus_connect_irq(SYS_BUS_DEVICE(&s->uart[i]), 0,
62
+-------------------
61
- qdev_get_gpio_in(DEVICE(&s->a9mpcore),
63
+
62
- serial_table[i].irq));
64
+QEMU supports the ``base:allocation`` metadata context as defined in the
63
+ qdev_get_gpio_in(gic, serial_table[i].irq));
65
+NBD protocol specification, and also defines an additional metadata
64
}
66
+namespace ``qemu``.
65
67
+
66
s->gpt.ccm = IMX_CCM(&s->ccm);
68
+``qemu`` namespace
67
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
69
+------------------
68
70
+
69
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpt), 0, FSL_IMX6_GPT_ADDR);
71
+The ``qemu`` namespace currently contains two available metadata context
70
sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpt), 0,
72
+types. The first is related to exposing the contents of a dirty
71
- qdev_get_gpio_in(DEVICE(&s->a9mpcore),
73
+bitmap alongside the associated disk contents. That metadata context
72
- FSL_IMX6_GPT_IRQ));
74
+is named with the following form::
73
+ qdev_get_gpio_in(gic, FSL_IMX6_GPT_IRQ));
75
+
74
76
+ qemu:dirty-bitmap:<dirty-bitmap-export-name>
75
/* Initialize all EPIT timers */
77
+
76
for (i = 0; i < FSL_IMX6_NUM_EPITS; i++) {
78
+Each dirty-bitmap metadata context defines only one flag for extents
77
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
79
+in reply for ``NBD_CMD_BLOCK_STATUS``:
78
80
+
79
sysbus_mmio_map(SYS_BUS_DEVICE(&s->epit[i]), 0, epit_table[i].addr);
81
+bit 0:
80
sysbus_connect_irq(SYS_BUS_DEVICE(&s->epit[i]), 0,
82
+ ``NBD_STATE_DIRTY``, set when the extent is "dirty"
81
- qdev_get_gpio_in(DEVICE(&s->a9mpcore),
83
+
82
- epit_table[i].irq));
84
+The second is related to exposing the source of various extents within
83
+ qdev_get_gpio_in(gic, epit_table[i].irq));
85
+the image, with a single metadata context named::
84
}
86
+
85
87
+ qemu:allocation-depth
86
/* Initialize all I2C */
88
+
87
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
89
+In the allocation depth context, the entire 32-bit value represents a
88
90
+depth of which layer in a thin-provisioned backing chain provided the
89
sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c[i]), 0, i2c_table[i].addr);
91
+data (0 for unallocated, 1 for the active layer, 2 for the first
90
sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c[i]), 0,
92
+backing layer, and so forth).
91
- qdev_get_gpio_in(DEVICE(&s->a9mpcore),
93
+
92
- i2c_table[i].irq));
94
+For ``NBD_OPT_LIST_META_CONTEXT`` the following queries are supported
93
+ qdev_get_gpio_in(gic, i2c_table[i].irq));
95
+in addition to the specific ``qemu:allocation-depth`` and
94
}
96
+``qemu:dirty-bitmap:<dirty-bitmap-export-name>``:
95
97
+
96
/* Initialize all GPIOs */
98
+``qemu:``
97
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
99
+ returns list of all available metadata contexts in the namespace
98
100
+``qemu:dirty-bitmap:``
99
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpio[i]), 0, gpio_table[i].addr);
101
+ returns list of all available dirty-bitmap metadata contexts
100
sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio[i]), 0,
102
+
101
- qdev_get_gpio_in(DEVICE(&s->a9mpcore),
103
+Features by version
102
- gpio_table[i].irq_low));
104
+-------------------
103
+ qdev_get_gpio_in(gic, gpio_table[i].irq_low));
105
+
104
sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio[i]), 1,
106
+The following list documents which qemu version first implemented
105
- qdev_get_gpio_in(DEVICE(&s->a9mpcore),
107
+various features (both as a server exposing the feature, and as a
106
- gpio_table[i].irq_high));
108
+client taking advantage of the feature when present), to make it
107
+ qdev_get_gpio_in(gic, gpio_table[i].irq_high));
109
+easier to plan for cross-version interoperability. Note that in
108
}
110
+several cases, the initial release containing a feature may require
109
111
+additional patches from the corresponding stable branch to fix bugs in
110
/* Initialize all SDHC */
112
+the operation of that feature.
111
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
113
+
112
}
114
+2.6
113
sysbus_mmio_map(SYS_BUS_DEVICE(&s->esdhc[i]), 0, esdhc_table[i].addr);
115
+ ``NBD_OPT_STARTTLS`` with TLS X.509 Certificates
114
sysbus_connect_irq(SYS_BUS_DEVICE(&s->esdhc[i]), 0,
116
+2.8
115
- qdev_get_gpio_in(DEVICE(&s->a9mpcore),
117
+ ``NBD_CMD_WRITE_ZEROES``
116
- esdhc_table[i].irq));
118
+2.10
117
+ qdev_get_gpio_in(gic, esdhc_table[i].irq));
119
+ ``NBD_OPT_GO``, ``NBD_INFO_BLOCK``
118
}
120
+2.11
119
121
+ ``NBD_OPT_STRUCTURED_REPLY``
120
/* USB */
122
+2.12
121
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
123
+ ``NBD_CMD_BLOCK_STATUS`` for ``base:allocation``
122
sysbus_mmio_map(SYS_BUS_DEVICE(&s->usb[i]), 0,
124
+3.0
123
FSL_IMX6_USBOH3_USB_ADDR + i * 0x200);
125
+ ``NBD_OPT_STARTTLS`` with TLS Pre-Shared Keys (PSK),
124
sysbus_connect_irq(SYS_BUS_DEVICE(&s->usb[i]), 0,
126
+ ``NBD_CMD_BLOCK_STATUS`` for ``qemu:dirty-bitmap:``, ``NBD_CMD_CACHE``
125
- qdev_get_gpio_in(DEVICE(&s->a9mpcore),
127
+4.2
126
- FSL_IMX6_USBn_IRQ[i]));
128
+ ``NBD_FLAG_CAN_MULTI_CONN`` for shareable read-only exports,
127
+ qdev_get_gpio_in(gic, FSL_IMX6_USBn_IRQ[i]));
129
+ ``NBD_CMD_FLAG_FAST_ZERO``
128
}
130
+5.2
129
131
+ ``NBD_CMD_BLOCK_STATUS`` for ``qemu:allocation-depth``
130
/* Initialize all ECSPI */
132
+7.1
131
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
133
+ ``NBD_FLAG_CAN_MULTI_CONN`` for shareable writable exports
132
134
+8.2
133
sysbus_mmio_map(SYS_BUS_DEVICE(&s->spi[i]), 0, spi_table[i].addr);
135
+ ``NBD_OPT_EXTENDED_HEADERS``, ``NBD_FLAG_BLOCK_STATUS_PAYLOAD``
134
sysbus_connect_irq(SYS_BUS_DEVICE(&s->spi[i]), 0,
136
diff --git a/docs/interop/nbd.txt b/docs/interop/nbd.txt
135
- qdev_get_gpio_in(DEVICE(&s->a9mpcore),
137
deleted file mode 100644
136
- spi_table[i].irq));
138
index XXXXXXX..XXXXXXX
137
+ qdev_get_gpio_in(gic, spi_table[i].irq));
139
--- a/docs/interop/nbd.txt
138
}
140
+++ /dev/null
139
141
@@ -XXX,XX +XXX,XX @@
140
object_property_set_uint(OBJECT(&s->eth), "phy-num", s->phy_num,
142
-QEMU supports the NBD protocol, and has an internal NBD client (see
141
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
143
-block/nbd.c), an internal NBD server (see blockdev-nbd.c), and an
142
}
144
-external NBD server tool (see qemu-nbd.c). The common code is placed
143
sysbus_mmio_map(SYS_BUS_DEVICE(&s->eth), 0, FSL_IMX6_ENET_ADDR);
145
-in nbd/*.
144
sysbus_connect_irq(SYS_BUS_DEVICE(&s->eth), 0,
146
-
145
- qdev_get_gpio_in(DEVICE(&s->a9mpcore),
147
-The NBD protocol is specified here:
146
- FSL_IMX6_ENET_MAC_IRQ));
148
-https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md
147
+ qdev_get_gpio_in(gic, FSL_IMX6_ENET_MAC_IRQ));
149
-
148
sysbus_connect_irq(SYS_BUS_DEVICE(&s->eth), 1,
150
-The following paragraphs describe some specific properties of NBD
149
- qdev_get_gpio_in(DEVICE(&s->a9mpcore),
151
-protocol realization in QEMU.
150
- FSL_IMX6_ENET_MAC_1588_IRQ));
152
-
151
+ qdev_get_gpio_in(gic, FSL_IMX6_ENET_MAC_1588_IRQ));
153
-= Metadata namespaces =
152
154
-
153
/*
155
-QEMU supports the "base:allocation" metadata context as defined in the
154
* SNVS
156
-NBD protocol specification, and also defines an additional metadata
155
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp)
157
-namespace "qemu".
156
158
-
157
sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0, FSL_IMX6_WDOGn_ADDR[i]);
159
-== "qemu" namespace ==
158
sysbus_connect_irq(SYS_BUS_DEVICE(&s->wdt[i]), 0,
160
-
159
- qdev_get_gpio_in(DEVICE(&s->a9mpcore),
161
-The "qemu" namespace currently contains two available metadata context
160
- FSL_IMX6_WDOGn_IRQ[i]));
162
-types. The first is related to exposing the contents of a dirty
161
+ qdev_get_gpio_in(gic, FSL_IMX6_WDOGn_IRQ[i]));
163
-bitmap alongside the associated disk contents. That metadata context
162
}
164
-is named with the following form:
163
165
-
164
/*
166
- qemu:dirty-bitmap:<dirty-bitmap-export-name>
167
-
168
-Each dirty-bitmap metadata context defines only one flag for extents
169
-in reply for NBD_CMD_BLOCK_STATUS:
170
-
171
- bit 0: NBD_STATE_DIRTY, set when the extent is "dirty"
172
-
173
-The second is related to exposing the source of various extents within
174
-the image, with a single metadata context named:
175
-
176
- qemu:allocation-depth
177
-
178
-In the allocation depth context, the entire 32-bit value represents a
179
-depth of which layer in a thin-provisioned backing chain provided the
180
-data (0 for unallocated, 1 for the active layer, 2 for the first
181
-backing layer, and so forth).
182
-
183
-For NBD_OPT_LIST_META_CONTEXT the following queries are supported
184
-in addition to the specific "qemu:allocation-depth" and
185
-"qemu:dirty-bitmap:<dirty-bitmap-export-name>":
186
-
187
-* "qemu:" - returns list of all available metadata contexts in the
188
- namespace.
189
-* "qemu:dirty-bitmap:" - returns list of all available dirty-bitmap
190
- metadata contexts.
191
-
192
-= Features by version =
193
-
194
-The following list documents which qemu version first implemented
195
-various features (both as a server exposing the feature, and as a
196
-client taking advantage of the feature when present), to make it
197
-easier to plan for cross-version interoperability. Note that in
198
-several cases, the initial release containing a feature may require
199
-additional patches from the corresponding stable branch to fix bugs in
200
-the operation of that feature.
201
-
202
-* 2.6: NBD_OPT_STARTTLS with TLS X.509 Certificates
203
-* 2.8: NBD_CMD_WRITE_ZEROES
204
-* 2.10: NBD_OPT_GO, NBD_INFO_BLOCK
205
-* 2.11: NBD_OPT_STRUCTURED_REPLY
206
-* 2.12: NBD_CMD_BLOCK_STATUS for "base:allocation"
207
-* 3.0: NBD_OPT_STARTTLS with TLS Pre-Shared Keys (PSK),
208
-NBD_CMD_BLOCK_STATUS for "qemu:dirty-bitmap:", NBD_CMD_CACHE
209
-* 4.2: NBD_FLAG_CAN_MULTI_CONN for shareable read-only exports,
210
-NBD_CMD_FLAG_FAST_ZERO
211
-* 5.2: NBD_CMD_BLOCK_STATUS for "qemu:allocation-depth"
212
-* 7.1: NBD_FLAG_CAN_MULTI_CONN for shareable writable exports
213
-* 8.2: NBD_OPT_EXTENDED_HEADERS, NBD_FLAG_BLOCK_STATUS_PAYLOAD
214
--
165
--
215
2.34.1
166
2.34.1
167
168
diff view generated by jsdifflib
1
Convert the rocker.txt specification document to rST format. We make
1
From: Philippe Mathieu-Daudé <philmd@linaro.org>
2
extensive use of the :: marker to introduce a literal block for all
3
the tables and ASCII art, rather than trying to convert the tables to
4
rST table syntax. This produces a valid rST document without needing
5
a huge diff.
6
2
3
The A7MPCore forward the IRQs from its internal GIC.
4
To make the code clearer, add the 'mpcore' and 'gic'
5
variables. Rename 'd' variable as 'cpu'.
6
7
Reviewed-by: Cédric Le Goater <clg@kaod.org>
8
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
9
Message-id: 20250130112615.3219-4-philmd@linaro.org
7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
9
Message-id: 20240801170131.3977807-2-peter.maydell@linaro.org
10
---
11
---
11
MAINTAINERS | 2 +-
12
hw/arm/fsl-imx6ul.c | 64 +++++++++++++++++++--------------------------
12
docs/specs/index.rst | 1 +
13
1 file changed, 27 insertions(+), 37 deletions(-)
13
docs/specs/{rocker.txt => rocker.rst} | 181 +++++++++++++-------------
14
3 files changed, 93 insertions(+), 91 deletions(-)
15
rename docs/specs/{rocker.txt => rocker.rst} (91%)
16
14
17
diff --git a/MAINTAINERS b/MAINTAINERS
15
diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c
18
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
19
--- a/MAINTAINERS
17
--- a/hw/arm/fsl-imx6ul.c
20
+++ b/MAINTAINERS
18
+++ b/hw/arm/fsl-imx6ul.c
21
@@ -XXX,XX +XXX,XX @@ S: Maintained
19
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
22
F: hw/net/rocker/
20
{
23
F: qapi/rocker.json
21
MachineState *ms = MACHINE(qdev_get_machine());
24
F: tests/rocker/
22
FslIMX6ULState *s = FSL_IMX6UL(dev);
25
-F: docs/specs/rocker.txt
23
+ DeviceState *mpcore = DEVICE(&s->a7mpcore);
26
+F: docs/specs/rocker.rst
24
int i;
27
25
char name[NAME_SIZE];
28
e1000x
26
- SysBusDevice *sbd;
29
M: Dmitry Fleytman <dmitry.fleytman@gmail.com>
27
- DeviceState *d;
30
diff --git a/docs/specs/index.rst b/docs/specs/index.rst
28
+ DeviceState *gic;
31
index XXXXXXX..XXXXXXX 100644
29
+ SysBusDevice *gicsbd;
32
--- a/docs/specs/index.rst
30
+ DeviceState *cpu;
33
+++ b/docs/specs/index.rst
31
34
@@ -XXX,XX +XXX,XX @@ guest hardware that is specific to QEMU.
32
if (ms->smp.cpus > 1) {
35
vmcoreinfo
33
error_setg(errp, "%s: Only a single CPU is supported (%d requested)",
36
vmgenid
34
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
37
rapl-msr
35
/*
38
+ rocker
36
* A7MPCORE
39
diff --git a/docs/specs/rocker.txt b/docs/specs/rocker.rst
37
*/
40
similarity index 91%
38
- object_property_set_int(OBJECT(&s->a7mpcore), "num-cpu", 1, &error_abort);
41
rename from docs/specs/rocker.txt
39
- object_property_set_int(OBJECT(&s->a7mpcore), "num-irq",
42
rename to docs/specs/rocker.rst
40
+ object_property_set_int(OBJECT(mpcore), "num-cpu", 1, &error_abort);
43
index XXXXXXX..XXXXXXX 100644
41
+ object_property_set_int(OBJECT(mpcore), "num-irq",
44
--- a/docs/specs/rocker.txt
42
FSL_IMX6UL_MAX_IRQ + GIC_INTERNAL, &error_abort);
45
+++ b/docs/specs/rocker.rst
43
- sysbus_realize(SYS_BUS_DEVICE(&s->a7mpcore), &error_abort);
46
@@ -XXX,XX +XXX,XX @@
44
- sysbus_mmio_map(SYS_BUS_DEVICE(&s->a7mpcore), 0, FSL_IMX6UL_A7MPCORE_ADDR);
47
Rocker Network Switch Register Programming Guide
45
+ sysbus_realize(SYS_BUS_DEVICE(mpcore), &error_abort);
48
-Copyright (c) Scott Feldman <sfeldma@gmail.com>
46
+ sysbus_mmio_map(SYS_BUS_DEVICE(mpcore), 0, FSL_IMX6UL_A7MPCORE_ADDR);
49
-Copyright (c) Neil Horman <nhorman@tuxdriver.com>
47
50
-Version 0.11, 12/29/2014
48
- sbd = SYS_BUS_DEVICE(&s->a7mpcore);
51
+************************************************
49
- d = DEVICE(&s->cpu);
52
53
-LICENSE
54
-=======
55
+..
56
+ Copyright (c) Scott Feldman <sfeldma@gmail.com>
57
+ Copyright (c) Neil Horman <nhorman@tuxdriver.com>
58
+ Version 0.11, 12/29/2014
59
60
-This program is free software; you can redistribute it and/or modify
61
-it under the terms of the GNU General Public License as published by
62
-the Free Software Foundation; either version 2 of the License, or
63
-(at your option) any later version.
64
+ This program is free software; you can redistribute it and/or modify
65
+ it under the terms of the GNU General Public License as published by
66
+ the Free Software Foundation; either version 2 of the License, or
67
+ (at your option) any later version.
68
69
-This program is distributed in the hope that it will be useful,
70
-but WITHOUT ANY WARRANTY; without even the implied warranty of
71
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
72
-GNU General Public License for more details.
73
+ This program is distributed in the hope that it will be useful,
74
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
75
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
76
+ GNU General Public License for more details.
77
78
-SECTION 1: Introduction
79
-=======================
80
+Introduction
81
+============
82
83
Overview
84
--------
85
@@ -XXX,XX +XXX,XX @@ software.
86
Notations and Conventions
87
-------------------------
88
89
-o In register descriptions, [n:m] indicates a range from bit n to bit m,
90
-inclusive.
91
-o Use of leading 0x indicates a hexadecimal number.
92
-o Use of leading 0b indicates a binary number.
93
-o The use of RSVD or Reserved indicates that a bit or field is reserved for
94
-future use.
95
-o Field width is in bytes, unless otherwise noted.
96
-o Register are (R) read-only, (R/W) read/write, (W) write-only, or (COR) clear
97
-on read
98
-o TLV values in network-byte-order are designated with (N).
99
+* In register descriptions, [n:m] indicates a range from bit n to bit m,
100
+ inclusive.
101
+* Use of leading 0x indicates a hexadecimal number.
102
+* Use of leading 0b indicates a binary number.
103
+* The use of RSVD or Reserved indicates that a bit or field is reserved for
104
+ future use.
105
+* Field width is in bytes, unless otherwise noted.
106
+* Register are (R) read-only, (R/W) read/write, (W) write-only, or (COR) clear
107
+ on read
108
+* TLV values in network-byte-order are designated with (N).
109
110
111
-SECTION 2: PCI Configuration Registers
112
-======================================
113
+PCI Configuration Registers
114
+===========================
115
116
PCI Configuration Space
117
-----------------------
118
119
-Each switch instance registers as a PCI device with PCI configuration space:
120
+Each switch instance registers as a PCI device with PCI configuration space::
121
122
    offset    width    description        value
123
    ---------------------------------------------
124
@@ -XXX,XX +XXX,XX @@ Each switch instance registers as a PCI device with PCI configuration space:
125
    0x41    1    Retry count
126
    0x42    2    Reserved
127
128
+ * Assigned by sub-system implementation
129
130
-* Assigned by sub-system implementation
131
-
50
-
132
-SECTION 3: Memory-Mapped Register Space
51
- sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(d, ARM_CPU_IRQ));
133
-=======================================
52
- sysbus_connect_irq(sbd, 1, qdev_get_gpio_in(d, ARM_CPU_FIQ));
134
+Memory-Mapped Register Space
53
- sysbus_connect_irq(sbd, 2, qdev_get_gpio_in(d, ARM_CPU_VIRQ));
135
+============================
54
- sysbus_connect_irq(sbd, 3, qdev_get_gpio_in(d, ARM_CPU_VFIQ));
136
55
+ gic = mpcore;
137
There are two memory-mapped BARs. BAR0 maps device register space and is
56
+ gicsbd = SYS_BUS_DEVICE(gic);
138
0x2000 in size. BAR1 maps MSI-X vector and PBA tables and is also 0x2000 in
57
+ cpu = DEVICE(&s->cpu);
139
@@ -XXX,XX +XXX,XX @@ byte registers with one 4-byte access, and 8 byte registers with either two
58
+ sysbus_connect_irq(gicsbd, 0, qdev_get_gpio_in(cpu, ARM_CPU_IRQ));
140
4-byte accesses or a single 8-byte access. In the case of two 4-byte accesses,
59
+ sysbus_connect_irq(gicsbd, 1, qdev_get_gpio_in(cpu, ARM_CPU_FIQ));
141
access must be lower and then upper 4-bytes, in that order.
60
+ sysbus_connect_irq(gicsbd, 2, qdev_get_gpio_in(cpu, ARM_CPU_VIRQ));
142
61
+ sysbus_connect_irq(gicsbd, 3, qdev_get_gpio_in(cpu, ARM_CPU_VFIQ));
143
-BAR0 device register space is organized as follows:
62
144
+BAR0 device register space is organized as follows::
63
/*
145
64
* A7MPCORE DAP
146
    offset        description
65
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
147
    ------------------------------------------------------
66
FSL_IMX6UL_GPTn_ADDR[i]);
148
@@ -XXX,XX +XXX,XX @@ Reads to reserved registers read back as 0.
67
149
68
sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpt[i]), 0,
150
No fancy stuff like write-combining is enabled on any of the registers.
69
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
151
70
- FSL_IMX6UL_GPTn_IRQ[i]));
152
-BAR1 MSI-X register space is organized as follows:
71
+ qdev_get_gpio_in(gic, FSL_IMX6UL_GPTn_IRQ[i]));
153
+BAR1 MSI-X register space is organized as follows::
72
}
154
73
155
    offset        description
74
/*
156
    ------------------------------------------------------
75
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
157
@@ -XXX,XX +XXX,XX @@ BAR1 MSI-X register space is organized as follows:
76
FSL_IMX6UL_EPITn_ADDR[i]);
158
    0x1000-0x1fff    MSI-X PBA table
77
159
78
sysbus_connect_irq(SYS_BUS_DEVICE(&s->epit[i]), 0,
160
79
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
161
-SECTION 4: Interrupts, DMA, and Endianness
80
- FSL_IMX6UL_EPITn_IRQ[i]));
162
-==========================================
81
+ qdev_get_gpio_in(gic, FSL_IMX6UL_EPITn_IRQ[i]));
163
+Interrupts, DMA, and Endianness
82
}
164
+===============================
83
165
84
/*
166
PCI Interrupts
85
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
167
--------------
86
FSL_IMX6UL_GPIOn_ADDR[i]);
168
@@ -XXX,XX +XXX,XX @@ PCI Interrupts
87
169
The device supports only MSI-X interrupts. BAR1 memory-mapped region contains
88
sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio[i]), 0,
170
the MSI-X vector and PBA tables, with support for up to 256 MSI-X vectors.
89
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
171
90
- FSL_IMX6UL_GPIOn_LOW_IRQ[i]));
172
-The vector assignment is:
91
+ qdev_get_gpio_in(gic, FSL_IMX6UL_GPIOn_LOW_IRQ[i]));
173
+The vector assignment is::
92
174
93
sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio[i]), 1,
175
    vector        description
94
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
176
    -----------------------------------------------------
95
- FSL_IMX6UL_GPIOn_HIGH_IRQ[i]));
177
@@ -XXX,XX +XXX,XX @@ The vector assignment is:
96
+ qdev_get_gpio_in(gic, FSL_IMX6UL_GPIOn_HIGH_IRQ[i]));
178
             Tx vector is even
97
}
179
             Rx vector is odd
98
180
99
/*
181
-A MSI-X vector table entry is 16 bytes:
100
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
182
+A MSI-X vector table entry is 16 bytes::
101
FSL_IMX6UL_SPIn_ADDR[i]);
183
102
184
    field        offset    width    description
103
sysbus_connect_irq(SYS_BUS_DEVICE(&s->spi[i]), 0,
185
    -------------------------------------------------------------
104
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
186
@@ -XXX,XX +XXX,XX @@ ring, and hardware will set this bit when the descriptor is complete.
105
- FSL_IMX6UL_SPIn_IRQ[i]));
187
Descriptor ring sizes must be a power of 2 and range from 2 to 64K entries.
106
+ qdev_get_gpio_in(gic, FSL_IMX6UL_SPIn_IRQ[i]));
188
Descriptor rings' base address must be 8-byte aligned. Descriptors must be
107
}
189
packed within ring. Each descriptor in each ring must also be aligned on an 8
108
190
-byte boundary. Each descriptor ring will have these registers:
109
/*
191
+byte boundary. Each descriptor ring will have these registers::
110
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
192
111
sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c[i]), 0, FSL_IMX6UL_I2Cn_ADDR[i]);
193
    DMA_DESC_xxx_BASE_ADDR, offset 0x1000 + (x * 32), 64-bit, (R/W)
112
194
    DMA_DESC_xxx_SIZE, offset 0x1008 + (x * 32), 32-bit, (R/W)
113
sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c[i]), 0,
195
@@ -XXX,XX +XXX,XX @@ byte boundary. Each descriptor ring will have these registers:
114
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
196
    DMA_DESC_xxx_CREDITS, offset 0x1018 + (x * 32), 32-bit, (R/W)
115
- FSL_IMX6UL_I2Cn_IRQ[i]));
197
    DMA_DESC_xxx_RSVD1, offset 0x101c + (x * 32), 32-bit, (R/W)
116
+ qdev_get_gpio_in(gic, FSL_IMX6UL_I2Cn_IRQ[i]));
198
117
}
199
-Where x is descriptor ring index:
118
200
+Where x is descriptor ring index::
119
/*
201
120
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
202
    index        ring
121
FSL_IMX6UL_UARTn_ADDR[i]);
203
    --------------------
122
204
@@ -XXX,XX +XXX,XX @@ written past TAIL. To do so would wrap the ring. An empty ring is when HEAD
123
sysbus_connect_irq(SYS_BUS_DEVICE(&s->uart[i]), 0,
205
== TAIL. A full ring is when HEAD is one position behind TAIL. Both HEAD and
124
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
206
TAIL increment and modulo wrap at the ring size.
125
- FSL_IMX6UL_UARTn_IRQ[i]));
207
126
+ qdev_get_gpio_in(gic, FSL_IMX6UL_UARTn_IRQ[i]));
208
-CTRL register bits:
127
}
209
+CTRL register bits::
128
210
129
/*
211
    bit    name        description
130
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
212
    ------------------------------------------------------------------------
131
FSL_IMX6UL_ENETn_ADDR[i]);
213
    [0]    CTRL_RESET    Reset the descriptor ring
132
214
    [1:31]    Reserved
133
sysbus_connect_irq(SYS_BUS_DEVICE(&s->eth[i]), 0,
215
134
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
216
-All descriptor types share some common fields:
135
- FSL_IMX6UL_ENETn_IRQ[i]));
217
+All descriptor types share some common fields::
136
+ qdev_get_gpio_in(gic, FSL_IMX6UL_ENETn_IRQ[i]));
218
137
219
    field            width    description
138
sysbus_connect_irq(SYS_BUS_DEVICE(&s->eth[i]), 1,
220
    -------------------------------------------------------------------
139
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
221
@@ -XXX,XX +XXX,XX @@ filled in by the switch. Likewise, the switch will ignore unknown fields
140
- FSL_IMX6UL_ENETn_TIMER_IRQ[i]));
222
filled in by software.
141
+ qdev_get_gpio_in(gic, FSL_IMX6UL_ENETn_TIMER_IRQ[i]));
223
142
}
224
Descriptor payload buffer is 8-byte aligned and TLVs are 8-byte aligned. The
143
225
-value within a TLV is also 8-byte aligned. The (packed, 8 byte) TLV header is:
144
/*
226
+value within a TLV is also 8-byte aligned. The (packed, 8 byte) TLV header is::
145
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
227
146
sysbus_mmio_map(SYS_BUS_DEVICE(&s->usb[i]), 0,
228
    field    width    description
147
FSL_IMX6UL_USB02_USBn_ADDR[i]);
229
    -----------------------------
148
sysbus_connect_irq(SYS_BUS_DEVICE(&s->usb[i]), 0,
230
@@ -XXX,XX +XXX,XX @@ The alignment requirements for descriptors and TLVs are to avoid unaligned
149
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
231
access exceptions in software. Note that the payload for each TLV is also
150
- FSL_IMX6UL_USBn_IRQ[i]));
232
8 byte aligned.
151
+ qdev_get_gpio_in(gic, FSL_IMX6UL_USBn_IRQ[i]));
233
152
}
234
-Figure 1 shows an example descriptor buffer with two TLVs.
153
235
+Figure 1 shows an example descriptor buffer with two TLVs::
154
/*
236
155
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
237
<------- 8 bytes ------->
156
FSL_IMX6UL_USDHCn_ADDR[i]);
238
157
239
@@ -XXX,XX +XXX,XX @@ network packet data. All non-network-packet TLV multi-byte values will be LE.
158
sysbus_connect_irq(SYS_BUS_DEVICE(&s->usdhc[i]), 0,
240
TLV values in network-byte-order are designated with (N).
159
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
241
160
- FSL_IMX6UL_USDHCn_IRQ[i]));
242
161
+ qdev_get_gpio_in(gic, FSL_IMX6UL_USDHCn_IRQ[i]));
243
-SECTION 5: Test Registers
162
}
244
-=========================
163
245
+Test Registers
164
/*
246
+==============
165
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
247
166
sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0,
248
Rocker has several test registers to support troubleshooting register access,
167
FSL_IMX6UL_WDOGn_ADDR[i]);
249
-interrupt generation, and DMA operations:
168
sysbus_connect_irq(SYS_BUS_DEVICE(&s->wdt[i]), 0,
250
+interrupt generation, and DMA operations::
169
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
251
170
- FSL_IMX6UL_WDOGn_IRQ[i]));
252
    TEST_REG, offset 0x0010, 32-bit (R/W)
171
+ qdev_get_gpio_in(gic, FSL_IMX6UL_WDOGn_IRQ[i]));
253
    TEST_REG64, offset 0x0018, 64-bit (R/W)
172
}
254
@@ -XXX,XX +XXX,XX @@ for that vector.
173
255
174
/*
256
To test basic DMA operations, allocate a DMA-able host buffer and put the
257
buffer address into TEST_DMA_ADDR and size into TEST_DMA_SIZE. Then, write to
258
-TEST_DMA_CTRL to manipulate the buffer contents. TEST_DMA_CTRL operations are:
259
+TEST_DMA_CTRL to manipulate the buffer contents. TEST_DMA_CTRL operations are::
260
261
    operation        value    description
262
    -----------------------------------------------------------
263
@@ -XXX,XX +XXX,XX @@ issue exists. In particular, buffers that start on odd-8-byte boundary and/or
264
span multiple PAGE sizes should be tested.
265
266
267
-SECTION 6: Ports
268
-================
269
+Ports
270
+=====
271
272
Physical and Logical Ports
273
------------------------------------
274
275
The switch supports up to 62 physical (front-panel) ports. Register
276
-PORT_PHYS_COUNT returns the actual number of physical ports available:
277
+PORT_PHYS_COUNT returns the actual number of physical ports available::
278
279
    PORT_PHYS_COUNT, offset 0x0304, 32-bit, (R)
280
281
@@ -XXX,XX +XXX,XX @@ Front-panel ports and logical tunnel ports are mapped into a single 32-bit port
282
space. A special CPU port is assigned port 0. The front-panel ports are
283
mapped to ports 1-62. A special loopback port is assigned port 63. Logical
284
tunnel ports are assigned ports 0x0001000-0x0001ffff.
285
-To summarize the port assignments:
286
+To summarize the port assignments::
287
288
    port            mapping
289
    -------------------------------------------------------
290
@@ -XXX,XX +XXX,XX @@ set/get the mode for front-panel ports, see port settings, below.
291
Port Settings
292
-------------
293
294
-Link status for all front-panel ports is available via PORT_PHYS_LINK_STATUS:
295
+Link status for all front-panel ports is available via PORT_PHYS_LINK_STATUS::
296
297
    PORT_PHYS_LINK_STATUS, offset 0x0310, 64-bit, (R)
298
299
    Value is port bitmap. Bits 0 and 63 always read 0. Bits 1-62
300
    read 1 for link UP and 0 for link DOWN for respective front-panel ports.
301
302
-Other properties for front-panel ports are available via DMA CMD descriptors:
303
+Other properties for front-panel ports are available via DMA CMD descriptors::
304
305
    Get PORT_SETTINGS descriptor:
306
307
@@ -XXX,XX +XXX,XX @@ Port Enable
308
-----------
309
310
Front-panel ports are initially disabled, which means port ingress and egress
311
-packets will be dropped. To enable or disable a port, use PORT_PHYS_ENABLE:
312
+packets will be dropped. To enable or disable a port, use PORT_PHYS_ENABLE::
313
314
    PORT_PHYS_ENABLE: offset 0x0318, 64-bit, (R/W)
315
316
@@ -XXX,XX +XXX,XX @@ packets will be dropped. To enable or disable a port, use PORT_PHYS_ENABLE:
317
    Default is 0.
318
319
320
-SECTION 7: Switch Control
321
-=========================
322
+Switch Control
323
+==============
324
325
This section covers switch-wide register settings.
326
327
Control
328
-------
329
330
-This register is used for low level control of the switch.
331
+This register is used for low level control of the switch::
332
333
    CONTROL: offset 0x0300, 32-bit, (W)
334
335
@@ -XXX,XX +XXX,XX @@ Switch ID
336
---------
337
338
The switch has a SWITCH_ID to be used by software to uniquely identify the
339
-switch:
340
+switch::
341
342
    SWITCH_ID: offset 0x0320, 64-bit, (R)
343
344
    Value is opaque to switch software and no special encoding is implied.
345
346
347
-SECTION 8: Events
348
-=================
349
+Events
350
+======
351
352
Non-I/O asynchronous events from the device are notified to the host using the
353
-event ring. The TLV structure for events is:
354
+event ring. The TLV structure for events is::
355
356
    field        width    description
357
    ---------------------------------------------------
358
@@ -XXX,XX +XXX,XX @@ event ring. The TLV structure for events is:
359
Link Changed Event
360
------------------
361
362
-When link status changes on a physical port, this event is generated.
363
+When link status changes on a physical port, this event is generated::
364
365
    field        width    description
366
    ---------------------------------------------------
367
@@ -XXX,XX +XXX,XX @@ driver should install to the device the MAC/VLAN on the port into the bridge
368
table. Once installed, the MAC/VLAN is known on the port and this event will
369
no longer be generated.
370
371
+::
372
+
373
    field        width    description
374
    ---------------------------------------------------
375
    INFO        <nest>
376
@@ -XXX,XX +XXX,XX @@ no longer be generated.
377
     VLAN        2    VLAN ID
378
379
380
-SECTION 9: CPU Packet Processing
381
-================================
382
+CPU Packet Processing
383
+=====================
384
385
Ingress packets directed to the host CPU for further processing are delivered
386
in the DMA RX ring. Likewise, host CPU originating packets destined to egress
387
@@ -XXX,XX +XXX,XX @@ software that Tx is complete and software resources (e.g. skb) backing packet
388
can be released.
389
390
Figure 2 shows an example 3-fragment packet queued with one Tx descriptor. A
391
-TLV is used for each packet fragment.
392
+TLV is used for each packet fragment::
393
394
     pkt frag 1
395
     +–––––––+ +–+
396
@@ -XXX,XX +XXX,XX @@ TLV is used for each packet fragment.
397
398
                fig 2.
399
400
-The TLVs for Tx descriptor buffer are:
401
+The TLVs for Tx descriptor buffer are::
402
403
    field            width    description
404
    ---------------------------------------------------------------------
405
@@ -XXX,XX +XXX,XX @@ The TLVs for Tx descriptor buffer are:
406
     TX_FRAG_ADDR    8    DMA address of packet fragment
407
     TX_FRAG_LEN        2    Packet fragment length
408
409
-Possible status return codes in descriptor on completion are:
410
+Possible status return codes in descriptor on completion are::
411
412
    DESC_COMP_ERR    reason
413
    --------------------------------------------------------------------
414
@@ -XXX,XX +XXX,XX @@ worst-case packet size. A single Rx descriptor will contain the entire Rx
415
packet data in one RX_FRAG. Other Rx TLVs describe and hardware offloads
416
performed on the packet, such as checksum validation.
417
418
-The TLVs for Rx descriptor buffer are:
419
+The TLVs for Rx descriptor buffer are::
420
421
    field        width    description
422
    ---------------------------------------------------
423
@@ -XXX,XX +XXX,XX @@ The TLVs for Rx descriptor buffer are:
424
Offload forward RX_FLAG indicates the device has already forwarded the packet
425
so the host CPU should not also forward the packet.
426
427
-Possible status return codes in descriptor on completion are:
428
+Possible status return codes in descriptor on completion are::
429
430
    DESC_COMP_ERR    reason
431
    --------------------------------------------------------------------
432
@@ -XXX,XX +XXX,XX @@ Possible status return codes in descriptor on completion are:
433
            packet data TLV and other TLVs.
434
435
436
-SECTION 10: OF-DPA Mode
437
-======================
438
+OF-DPA Mode
439
+===========
440
441
OF-DPA mode allows the switch to offload flow packet processing functions to
442
hardware. An OpenFlow controller would communicate with an OpenFlow agent
443
installed on the switch. The OpenFlow agent would (directly or indirectly)
444
communicate with the Rocker switch driver, which in turn would program switch
445
-hardware with flow functionality, as defined in OF-DPA. The block diagram is:
446
+hardware with flow functionality, as defined in OF-DPA. The block diagram is::
447
448
        +–––––––––––––––----–––+
449
        | OF |
450
@@ -XXX,XX +XXX,XX @@ OF-DPA Flow Table Interface
451
452
There are commands to add, modify, delete, and get stats of flow table entries.
453
The commands are issued using the DMA CMD descriptor ring. The following
454
-commands are defined:
455
+commands are defined::
456
457
    CMD_ADD:        add an entry to flow table
458
    CMD_MOD:        modify an entry in flow table
459
    CMD_DEL:        delete an entry from flow table
460
    CMD_GET_STATS:        get stats for flow entry
461
462
-TLVs for add and modify commands are:
463
+TLVs for add and modify commands are::
464
465
    field            width    description
466
    ----------------------------------------------------
467
@@ -XXX,XX +XXX,XX @@ TLVs for add and modify commands are:
468
469
Additional TLVs based on flow table ID:
470
471
-Table ID 0: ingress port
472
+Table ID 0: ingress port::
473
474
    field            width    description
475
    ----------------------------------------------------
476
    OF_DPA_IN_PPORT        4    ingress physical port number
477
    OF_DPA_GOTO_TBL        2    goto table ID; zero to drop
478
479
-Table ID 10: vlan
480
+Table ID 10: vlan::
481
482
    field            width    description
483
    ----------------------------------------------------
484
@@ -XXX,XX +XXX,XX @@ Table ID 10: vlan
485
    OF_DPA_GOTO_TBL        2    goto table ID; zero to drop
486
    OF_DPA_NEW_VLAN_ID    2 (N)    new vlan ID
487
488
-Table ID 20: termination mac
489
+Table ID 20: termination mac::
490
491
    field            width    description
492
    ----------------------------------------------------
493
@@ -XXX,XX +XXX,XX @@ Table ID 20: termination mac
494
    OF_DPA_OUT_PPORT    2    if specified, must be
495
                    controller, set zero otherwise
496
497
-Table ID 30: unicast routing
498
+Table ID 30: unicast routing::
499
500
    field            width    description
501
    ----------------------------------------------------
502
@@ -XXX,XX +XXX,XX @@ Table ID 30: unicast routing
503
    OF_DPA_GROUP_ID        4    data for GROUP action must
504
                    be an L3 Unicast group entry
505
506
-Table ID 40: multicast routing
507
+Table ID 40: multicast routing::
508
509
    field            width    description
510
    ----------------------------------------------------
511
@@ -XXX,XX +XXX,XX @@ Table ID 40: multicast routing
512
    OF_DPA_GROUP_ID        4    data for GROUP action must
513
                    be an L3 multicast group entry
514
515
-Table ID 50: bridging
516
+Table ID 50: bridging::
517
518
    field            width    description
519
    ----------------------------------------------------
520
@@ -XXX,XX +XXX,XX @@ Table ID 50: bridging
521
                    restricted to CONTROLLER,
522
                    set to 0 otherwise
523
524
-Table ID 60: acl policy
525
+Table ID 60: acl policy::
526
527
    field            width    description
528
    ----------------------------------------------------
529
@@ -XXX,XX +XXX,XX @@ Table ID 60: acl policy
530
                    dropped (all other instructions
531
                    ignored)
532
533
-TLVs for flow delete and get stats command are:
534
+TLVs for flow delete and get stats command are::
535
536
    field            width    description
537
    ---------------------------------------------------
538
@@ -XXX,XX +XXX,XX @@ TLVs for flow delete and get stats command are:
539
    OF_DPA_COOKIE        8    Cookie
540
541
On completion of get stats command, the descriptor buffer is written back with
542
-the following TLVs:
543
+the following TLVs::
544
545
    field            width    description
546
    ---------------------------------------------------
547
@@ -XXX,XX +XXX,XX @@ the following TLVs:
548
    OF_DPA_STAT_RX_PKTS    8    Received packets
549
    OF_DPA_STAT_TX_PKTS    8    Transmit packets
550
551
-Possible status return codes in descriptor on completion are:
552
+Possible status return codes in descriptor on completion are::
553
554
    DESC_COMP_ERR    command            reason
555
    --------------------------------------------------------------------
556
@@ -XXX,XX +XXX,XX @@ Group Table Interface
557
558
There are commands to add, modify, delete, and get stats of group table
559
entries. The commands are issued using the DMA CMD descriptor ring. The
560
-following commands are defined:
561
+following commands are defined::
562
563
    CMD_ADD:        add an entry to group table
564
    CMD_MOD:        modify an entry in group table
565
    CMD_DEL:        delete an entry from group table
566
    CMD_GET_STATS:        get stats for group entry
567
568
-TLVs for add and modify commands are:
569
+TLVs for add and modify commands are::
570
571
    field            width    description
572
    -----------------------------------------------------------
573
@@ -XXX,XX +XXX,XX @@ TLVs for add and modify commands are:
574
     FLOW_SRC_MAC        6    (types 1, 2, 5)
575
     FLOW_DST_MAC        6    (types 1, 2)
576
577
-TLVs for flow delete and get stats command are:
578
+TLVs for flow delete and get stats command are::
579
580
    field            width    description
581
    -----------------------------------------------------------
582
@@ -XXX,XX +XXX,XX @@ TLVs for flow delete and get stats command are:
583
    FLOW_GROUP_ID        2    Flow group ID
584
585
On completion of get stats command, the descriptor buffer is written back with
586
-the following TLVs:
587
+the following TLVs::
588
589
    field            width    description
590
    ---------------------------------------------------
591
@@ -XXX,XX +XXX,XX @@ the following TLVs:
592
    FLOW_STAT_REF_COUNT    4    Flow reference count
593
    FLOW_STAT_BUCKET_COUNT    4    Flow bucket count
594
595
-Possible status return codes in descriptor on completion are:
596
+Possible status return codes in descriptor on completion are::
597
598
    DESC_COMP_ERR    command            reason
599
    --------------------------------------------------------------------
600
--
175
--
601
2.34.1
176
2.34.1
602
177
603
178
diff view generated by jsdifflib
1
From: Eric Blake <eblake@redhat.com>
1
From: Philippe Mathieu-Daudé <philmd@linaro.org>
2
2
3
Add in the missing space in the section header.
3
The A7MPCore forward the IRQs from its internal GIC.
4
To make the code clearer, add the 'mpcore' and 'gic'
5
variables.
4
6
5
Fixes: 1084159b31 ("qapi: deprecate drive-backup", v6.2.0)
7
Reviewed-by: Cédric Le Goater <clg@kaod.org>
6
Signed-off-by: Eric Blake <eblake@redhat.com>
8
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
9
Message-id: 20250130112615.3219-5-philmd@linaro.org
7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
---
11
---
9
docs/interop/live-block-operations.rst | 4 ++--
12
hw/arm/fsl-imx7.c | 52 +++++++++++++++++++++--------------------------
10
1 file changed, 2 insertions(+), 2 deletions(-)
13
1 file changed, 23 insertions(+), 29 deletions(-)
11
14
12
diff --git a/docs/interop/live-block-operations.rst b/docs/interop/live-block-operations.rst
15
diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c
13
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
14
--- a/docs/interop/live-block-operations.rst
17
--- a/hw/arm/fsl-imx7.c
15
+++ b/docs/interop/live-block-operations.rst
18
+++ b/hw/arm/fsl-imx7.c
16
@@ -XXX,XX +XXX,XX @@ Shutdown the guest, by issuing the ``quit`` QMP command::
19
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
20
{
21
MachineState *ms = MACHINE(qdev_get_machine());
22
FslIMX7State *s = FSL_IMX7(dev);
23
- Object *o;
24
+ DeviceState *mpcore = DEVICE(&s->a7mpcore);
25
+ DeviceState *gic;
26
int i;
27
qemu_irq irq;
28
char name[NAME_SIZE];
29
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
30
* CPUs
31
*/
32
for (i = 0; i < smp_cpus; i++) {
33
- o = OBJECT(&s->cpu[i]);
34
+ Object *o = OBJECT(&s->cpu[i]);
35
36
/* On uniprocessor, the CBAR is set to 0 */
37
if (smp_cpus > 1) {
38
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
39
/*
40
* A7MPCORE
41
*/
42
- object_property_set_int(OBJECT(&s->a7mpcore), "num-cpu", smp_cpus,
43
- &error_abort);
44
- object_property_set_int(OBJECT(&s->a7mpcore), "num-irq",
45
+ object_property_set_int(OBJECT(mpcore), "num-cpu", smp_cpus, &error_abort);
46
+ object_property_set_int(OBJECT(mpcore), "num-irq",
47
FSL_IMX7_MAX_IRQ + GIC_INTERNAL, &error_abort);
48
+ sysbus_realize(SYS_BUS_DEVICE(mpcore), &error_abort);
49
+ sysbus_mmio_map(SYS_BUS_DEVICE(mpcore), 0, FSL_IMX7_A7MPCORE_ADDR);
50
51
- sysbus_realize(SYS_BUS_DEVICE(&s->a7mpcore), &error_abort);
52
- sysbus_mmio_map(SYS_BUS_DEVICE(&s->a7mpcore), 0, FSL_IMX7_A7MPCORE_ADDR);
53
-
54
+ gic = mpcore;
55
for (i = 0; i < smp_cpus; i++) {
56
- SysBusDevice *sbd = SYS_BUS_DEVICE(&s->a7mpcore);
57
+ SysBusDevice *sbd = SYS_BUS_DEVICE(gic);
58
DeviceState *d = DEVICE(qemu_get_cpu(i));
59
60
irq = qdev_get_gpio_in(d, ARM_CPU_IRQ);
61
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
62
sysbus_realize(SYS_BUS_DEVICE(&s->gpt[i]), &error_abort);
63
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpt[i]), 0, FSL_IMX7_GPTn_ADDR[i]);
64
sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpt[i]), 0,
65
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
66
- FSL_IMX7_GPTn_IRQ[i]));
67
+ qdev_get_gpio_in(gic, FSL_IMX7_GPTn_IRQ[i]));
17
}
68
}
18
69
19
70
/*
20
-Live disk backup --- ``blockdev-backup`` and the deprecated``drive-backup``
71
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
21
----------------------------------------------------------------------------
72
FSL_IMX7_GPIOn_ADDR[i]);
22
+Live disk backup --- ``blockdev-backup`` and the deprecated ``drive-backup``
73
23
+----------------------------------------------------------------------------
74
sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio[i]), 0,
24
75
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
25
The ``blockdev-backup`` (and the deprecated ``drive-backup``) allows
76
- FSL_IMX7_GPIOn_LOW_IRQ[i]));
26
you to create a point-in-time snapshot.
77
+ qdev_get_gpio_in(gic, FSL_IMX7_GPIOn_LOW_IRQ[i]));
78
79
sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio[i]), 1,
80
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
81
- FSL_IMX7_GPIOn_HIGH_IRQ[i]));
82
+ qdev_get_gpio_in(gic, FSL_IMX7_GPIOn_HIGH_IRQ[i]));
83
}
84
85
/*
86
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
87
sysbus_mmio_map(SYS_BUS_DEVICE(&s->spi[i]), 0,
88
FSL_IMX7_SPIn_ADDR[i]);
89
sysbus_connect_irq(SYS_BUS_DEVICE(&s->spi[i]), 0,
90
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
91
- FSL_IMX7_SPIn_IRQ[i]));
92
+ qdev_get_gpio_in(gic, FSL_IMX7_SPIn_IRQ[i]));
93
}
94
95
/*
96
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
97
sysbus_mmio_map(SYS_BUS_DEVICE(&s->i2c[i]), 0, FSL_IMX7_I2Cn_ADDR[i]);
98
99
sysbus_connect_irq(SYS_BUS_DEVICE(&s->i2c[i]), 0,
100
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
101
- FSL_IMX7_I2Cn_IRQ[i]));
102
+ qdev_get_gpio_in(gic, FSL_IMX7_I2Cn_IRQ[i]));
103
}
104
105
/*
106
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
107
108
sysbus_mmio_map(SYS_BUS_DEVICE(&s->uart[i]), 0, FSL_IMX7_UARTn_ADDR[i]);
109
110
- irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_UARTn_IRQ[i]);
111
+ irq = qdev_get_gpio_in(gic, FSL_IMX7_UARTn_IRQ[i]);
112
sysbus_connect_irq(SYS_BUS_DEVICE(&s->uart[i]), 0, irq);
113
}
114
115
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
116
117
sysbus_mmio_map(SYS_BUS_DEVICE(&s->eth[i]), 0, FSL_IMX7_ENETn_ADDR[i]);
118
119
- irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_ENET_IRQ(i, 0));
120
+ irq = qdev_get_gpio_in(gic, FSL_IMX7_ENET_IRQ(i, 0));
121
sysbus_connect_irq(SYS_BUS_DEVICE(&s->eth[i]), 0, irq);
122
- irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_ENET_IRQ(i, 3));
123
+ irq = qdev_get_gpio_in(gic, FSL_IMX7_ENET_IRQ(i, 3));
124
sysbus_connect_irq(SYS_BUS_DEVICE(&s->eth[i]), 1, irq);
125
}
126
127
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
128
sysbus_mmio_map(SYS_BUS_DEVICE(&s->usdhc[i]), 0,
129
FSL_IMX7_USDHCn_ADDR[i]);
130
131
- irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_USDHCn_IRQ[i]);
132
+ irq = qdev_get_gpio_in(gic, FSL_IMX7_USDHCn_IRQ[i]);
133
sysbus_connect_irq(SYS_BUS_DEVICE(&s->usdhc[i]), 0, irq);
134
}
135
136
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
137
138
sysbus_mmio_map(SYS_BUS_DEVICE(&s->wdt[i]), 0, FSL_IMX7_WDOGn_ADDR[i]);
139
sysbus_connect_irq(SYS_BUS_DEVICE(&s->wdt[i]), 0,
140
- qdev_get_gpio_in(DEVICE(&s->a7mpcore),
141
- FSL_IMX7_WDOGn_IRQ[i]));
142
+ qdev_get_gpio_in(gic, FSL_IMX7_WDOGn_IRQ[i]));
143
}
144
145
/*
146
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
147
irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTD_MSI_IRQ);
148
qdev_connect_gpio_out(DEVICE(&s->pcie4_msi_irq), 0, irq);
149
150
- irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTA_IRQ);
151
+ irq = qdev_get_gpio_in(gic, FSL_IMX7_PCI_INTA_IRQ);
152
sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 0, irq);
153
- irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTB_IRQ);
154
+ irq = qdev_get_gpio_in(gic, FSL_IMX7_PCI_INTB_IRQ);
155
sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 1, irq);
156
- irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTC_IRQ);
157
+ irq = qdev_get_gpio_in(gic, FSL_IMX7_PCI_INTC_IRQ);
158
sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 2, irq);
159
irq = qdev_get_gpio_in(DEVICE(&s->pcie4_msi_irq), 0);
160
sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 3, irq);
161
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
162
sysbus_mmio_map(SYS_BUS_DEVICE(&s->usb[i]), 0,
163
FSL_IMX7_USBn_ADDR[i]);
164
165
- irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_USBn_IRQ[i]);
166
+ irq = qdev_get_gpio_in(gic, FSL_IMX7_USBn_IRQ[i]);
167
sysbus_connect_irq(SYS_BUS_DEVICE(&s->usb[i]), 0, irq);
168
169
snprintf(name, NAME_SIZE, "usbmisc%d", i);
27
--
170
--
28
2.34.1
171
2.34.1
172
173
diff view generated by jsdifflib
1
From: Richard Henderson <richard.henderson@linaro.org>
1
From: Philippe Mathieu-Daudé <philmd@linaro.org>
2
2
3
With pcrel, we cannot check the guarded page bit at translation
3
No need to duplicate and forward the 'num-cpu' property from
4
time, as different mappings of the same physical page may or may
4
TYPE_ARM11MPCORE_PRIV to TYPE_REALVIEW_MPCORE, alias it with
5
not have the GP bit set.
5
QOM object_property_add_alias().
6
6
7
Instead, add a couple of helpers to check the page at runtime,
7
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
8
after all other filters that might obviate the need for the check.
8
Reviewed-by: Cédric Le Goater <clg@kaod.org>
9
9
Message-id: 20250130112615.3219-6-philmd@linaro.org
10
The set_btype_for_br call must be moved after the gen_a64_set_pc
11
call to ensure the current pc can still be computed.
12
13
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
14
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
15
Message-id: 20240802003028.795476-1-richard.henderson@linaro.org
16
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
17
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
18
---
11
---
19
target/arm/tcg/helper-a64.h | 3 ++
12
hw/cpu/realview_mpcore.c | 8 +-------
20
target/arm/tcg/translate.h | 2 --
13
1 file changed, 1 insertion(+), 7 deletions(-)
21
target/arm/tcg/helper-a64.c | 39 +++++++++++++++++++++
22
target/arm/tcg/translate-a64.c | 64 ++++++++--------------------------
23
4 files changed, 56 insertions(+), 52 deletions(-)
24
14
25
diff --git a/target/arm/tcg/helper-a64.h b/target/arm/tcg/helper-a64.h
15
diff --git a/hw/cpu/realview_mpcore.c b/hw/cpu/realview_mpcore.c
26
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
27
--- a/target/arm/tcg/helper-a64.h
17
--- a/hw/cpu/realview_mpcore.c
28
+++ b/target/arm/tcg/helper-a64.h
18
+++ b/hw/cpu/realview_mpcore.c
29
@@ -XXX,XX +XXX,XX @@ DEF_HELPER_4(cpyfp, void, env, i32, i32, i32)
19
@@ -XXX,XX +XXX,XX @@
30
DEF_HELPER_4(cpyfm, void, env, i32, i32, i32)
20
#include "hw/cpu/arm11mpcore.h"
31
DEF_HELPER_4(cpyfe, void, env, i32, i32, i32)
21
#include "hw/intc/realview_gic.h"
32
22
#include "hw/irq.h"
33
+DEF_HELPER_FLAGS_1(guarded_page_check, TCG_CALL_NO_WG, void, env)
23
-#include "hw/qdev-properties.h"
34
+DEF_HELPER_FLAGS_2(guarded_page_br, TCG_CALL_NO_RWG, void, env, tl)
24
#include "qom/object.h"
35
+
25
36
DEF_HELPER_FLAGS_5(gvec_fdiv_h, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
26
#define TYPE_REALVIEW_MPCORE_RIRQ "realview_mpcore"
37
DEF_HELPER_FLAGS_5(gvec_fdiv_s, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
27
@@ -XXX,XX +XXX,XX @@ static void realview_mpcore_realize(DeviceState *dev, Error **errp)
38
DEF_HELPER_FLAGS_5(gvec_fdiv_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32)
28
int n;
39
diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h
29
int i;
40
index XXXXXXX..XXXXXXX 100644
30
41
--- a/target/arm/tcg/translate.h
31
- qdev_prop_set_uint32(priv, "num-cpu", s->num_cpu);
42
+++ b/target/arm/tcg/translate.h
32
if (!sysbus_realize(SYS_BUS_DEVICE(&s->priv), errp)) {
43
@@ -XXX,XX +XXX,XX @@ typedef struct DisasContext {
33
return;
44
uint8_t dcz_blocksize;
34
}
45
/* A copy of cpu->gm_blocksize. */
35
@@ -XXX,XX +XXX,XX @@ static void mpcore_rirq_init(Object *obj)
46
uint8_t gm_blocksize;
36
int i;
47
- /* True if this page is guarded. */
37
48
- bool guarded_page;
38
object_initialize_child(obj, "a11priv", &s->priv, TYPE_ARM11MPCORE_PRIV);
49
/* True if the current insn_start has been updated. */
39
+ object_property_add_alias(obj, "num-cpu", OBJECT(&s->priv), "num-cpu");
50
bool insn_start_updated;
40
privbusdev = SYS_BUS_DEVICE(&s->priv);
51
/* Bottom two bits of XScale c15_cpar coprocessor access control reg */
41
sysbus_init_mmio(sbd, sysbus_mmio_get_region(privbusdev, 0));
52
diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c
42
53
index XXXXXXX..XXXXXXX 100644
43
@@ -XXX,XX +XXX,XX @@ static void mpcore_rirq_init(Object *obj)
54
--- a/target/arm/tcg/helper-a64.c
55
+++ b/target/arm/tcg/helper-a64.c
56
@@ -XXX,XX +XXX,XX @@ void HELPER(cpyfe)(CPUARMState *env, uint32_t syndrome, uint32_t wdesc,
57
{
58
do_cpye(env, syndrome, wdesc, rdesc, false, GETPC());
59
}
60
+
61
+static bool is_guarded_page(CPUARMState *env, target_ulong addr, uintptr_t ra)
62
+{
63
+#ifdef CONFIG_USER_ONLY
64
+ return page_get_flags(addr) & PAGE_BTI;
65
+#else
66
+ CPUTLBEntryFull *full;
67
+ void *host;
68
+ int mmu_idx = cpu_mmu_index(env_cpu(env), true);
69
+ int flags = probe_access_full(env, addr, 0, MMU_INST_FETCH, mmu_idx,
70
+ false, &host, &full, ra);
71
+
72
+ assert(!(flags & TLB_INVALID_MASK));
73
+ return full->extra.arm.guarded;
74
+#endif
75
+}
76
+
77
+void HELPER(guarded_page_check)(CPUARMState *env)
78
+{
79
+ /*
80
+ * We have already verified that bti is enabled, and that the
81
+ * instruction at PC is not ok for BTYPE. This is always at
82
+ * the beginning of a block, so PC is always up-to-date and
83
+ * no unwind is required.
84
+ */
85
+ if (is_guarded_page(env, env->pc, 0)) {
86
+ raise_exception(env, EXCP_UDEF, syn_btitrap(env->btype),
87
+ exception_target_el(env));
88
+ }
89
+}
90
+
91
+void HELPER(guarded_page_br)(CPUARMState *env, target_ulong pc)
92
+{
93
+ /*
94
+ * We have already checked for branch via x16 and x17.
95
+ * What remains for choosing BTYPE is checking for a guarded page.
96
+ */
97
+ env->btype = is_guarded_page(env, pc, GETPC()) ? 3 : 1;
98
+}
99
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
100
index XXXXXXX..XXXXXXX 100644
101
--- a/target/arm/tcg/translate-a64.c
102
+++ b/target/arm/tcg/translate-a64.c
103
@@ -XXX,XX +XXX,XX @@ static void set_btype_for_br(DisasContext *s, int rn)
104
{
105
if (dc_isar_feature(aa64_bti, s)) {
106
/* BR to {x16,x17} or !guard -> 1, else 3. */
107
- set_btype(s, rn == 16 || rn == 17 || !s->guarded_page ? 1 : 3);
108
+ if (rn == 16 || rn == 17) {
109
+ set_btype(s, 1);
110
+ } else {
111
+ TCGv_i64 pc = tcg_temp_new_i64();
112
+ gen_pc_plus_diff(s, pc, 0);
113
+ gen_helper_guarded_page_br(tcg_env, pc);
114
+ s->btype = -1;
115
+ }
116
}
44
}
117
}
45
}
118
46
119
@@ -XXX,XX +XXX,XX @@ static void set_btype_for_blr(DisasContext *s)
47
-static const Property mpcore_rirq_properties[] = {
120
48
- DEFINE_PROP_UINT32("num-cpu", mpcore_rirq_state, num_cpu, 1),
121
static bool trans_BR(DisasContext *s, arg_r *a)
49
-};
50
-
51
static void mpcore_rirq_class_init(ObjectClass *klass, void *data)
122
{
52
{
123
- gen_a64_set_pc(s, cpu_reg(s, a->rn));
53
DeviceClass *dc = DEVICE_CLASS(klass);
124
set_btype_for_br(s, a->rn);
54
125
+ gen_a64_set_pc(s, cpu_reg(s, a->rn));
55
dc->realize = realview_mpcore_realize;
126
s->base.is_jmp = DISAS_JUMP;
56
- device_class_set_props(dc, mpcore_rirq_properties);
127
return true;
128
}
57
}
129
@@ -XXX,XX +XXX,XX @@ static bool trans_BRAZ(DisasContext *s, arg_braz *a)
58
130
}
59
static const TypeInfo mpcore_rirq_info = {
131
132
dst = auth_branch_target(s, cpu_reg(s, a->rn), tcg_constant_i64(0), !a->m);
133
- gen_a64_set_pc(s, dst);
134
set_btype_for_br(s, a->rn);
135
+ gen_a64_set_pc(s, dst);
136
s->base.is_jmp = DISAS_JUMP;
137
return true;
138
}
139
@@ -XXX,XX +XXX,XX @@ static bool trans_FAIL(DisasContext *s, arg_OK *a)
140
return true;
141
}
142
143
-/**
144
- * is_guarded_page:
145
- * @env: The cpu environment
146
- * @s: The DisasContext
147
- *
148
- * Return true if the page is guarded.
149
- */
150
-static bool is_guarded_page(CPUARMState *env, DisasContext *s)
151
-{
152
- uint64_t addr = s->base.pc_first;
153
-#ifdef CONFIG_USER_ONLY
154
- return page_get_flags(addr) & PAGE_BTI;
155
-#else
156
- CPUTLBEntryFull *full;
157
- void *host;
158
- int mmu_idx = arm_to_core_mmu_idx(s->mmu_idx);
159
- int flags;
160
-
161
- /*
162
- * We test this immediately after reading an insn, which means
163
- * that the TLB entry must be present and valid, and thus this
164
- * access will never raise an exception.
165
- */
166
- flags = probe_access_full(env, addr, 0, MMU_INST_FETCH, mmu_idx,
167
- false, &host, &full, 0);
168
- assert(!(flags & TLB_INVALID_MASK));
169
-
170
- return full->extra.arm.guarded;
171
-#endif
172
-}
173
-
174
/**
175
* btype_destination_ok:
176
* @insn: The instruction at the branch destination
177
@@ -XXX,XX +XXX,XX @@ static void aarch64_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
178
179
if (dc_isar_feature(aa64_bti, s)) {
180
if (s->base.num_insns == 1) {
181
- /*
182
- * At the first insn of the TB, compute s->guarded_page.
183
- * We delayed computing this until successfully reading
184
- * the first insn of the TB, above. This (mostly) ensures
185
- * that the softmmu tlb entry has been populated, and the
186
- * page table GP bit is available.
187
- *
188
- * Note that we need to compute this even if btype == 0,
189
- * because this value is used for BR instructions later
190
- * where ENV is not available.
191
- */
192
- s->guarded_page = is_guarded_page(env, s);
193
-
194
/* First insn can have btype set to non-zero. */
195
tcg_debug_assert(s->btype >= 0);
196
197
@@ -XXX,XX +XXX,XX @@ static void aarch64_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
198
* priority -- below debugging exceptions but above most
199
* everything else. This allows us to handle this now
200
* instead of waiting until the insn is otherwise decoded.
201
+ *
202
+ * We can check all but the guarded page check here;
203
+ * defer the latter to a helper.
204
*/
205
if (s->btype != 0
206
- && s->guarded_page
207
&& !btype_destination_ok(insn, s->bt, s->btype)) {
208
- gen_exception_insn(s, 0, EXCP_UDEF, syn_btitrap(s->btype));
209
- return;
210
+ gen_helper_guarded_page_check(tcg_env);
211
}
212
} else {
213
/* Not the first insn: btype must be 0. */
214
--
60
--
215
2.34.1
61
2.34.1
216
62
217
63
diff view generated by jsdifflib
1
From: Jianzhou Yue <JianZhou.Yue@verisilicon.com>
1
From: Philippe Mathieu-Daudé <philmd@linaro.org>
2
2
3
The real period is zero when both period and period_frac are zero.
3
When multiple QOM types are registered in the same file,
4
Check the method ptimer_set_freq, if freq is larger than 1000 MHz,
4
it is simpler to use the the DEFINE_TYPES() macro. In
5
the period is zero, but the period_frac is not, in this case, the
5
particular because type array declared with such macro
6
ptimer will work but the current code incorrectly recognizes that
6
are easier to review.
7
the ptimer is disabled.
8
7
9
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2306
8
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
10
Signed-off-by: JianZhou Yue <JianZhou.Yue@verisilicon.com>
9
Reviewed-by: Cédric Le Goater <clg@kaod.org>
11
Message-id: 3DA024AEA8B57545AF1B3CAA37077D0FB75E82C8@SHASXM03.verisilicon.com
10
Message-id: 20250130112615.3219-7-philmd@linaro.org
12
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
---
12
---
15
hw/core/ptimer.c | 4 ++--
13
hw/cpu/a15mpcore.c | 21 +++++++++------------
16
tests/unit/ptimer-test.c | 33 +++++++++++++++++++++++++++++++++
14
hw/cpu/a9mpcore.c | 21 +++++++++------------
17
2 files changed, 35 insertions(+), 2 deletions(-)
15
hw/cpu/arm11mpcore.c | 21 +++++++++------------
16
hw/cpu/realview_mpcore.c | 21 +++++++++------------
17
4 files changed, 36 insertions(+), 48 deletions(-)
18
18
19
diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c
19
diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
20
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
21
--- a/hw/core/ptimer.c
21
--- a/hw/cpu/a15mpcore.c
22
+++ b/hw/core/ptimer.c
22
+++ b/hw/cpu/a15mpcore.c
23
@@ -XXX,XX +XXX,XX @@ static void ptimer_reload(ptimer_state *s, int delta_adjust)
23
@@ -XXX,XX +XXX,XX @@ static void a15mp_priv_class_init(ObjectClass *klass, void *data)
24
delta = s->delta = s->limit;
24
/* We currently have no saveable state */
25
}
25
}
26
26
27
- if (s->period == 0) {
27
-static const TypeInfo a15mp_priv_info = {
28
+ if (s->period == 0 && s->period_frac == 0) {
28
- .name = TYPE_A15MPCORE_PRIV,
29
if (!qtest_enabled()) {
29
- .parent = TYPE_SYS_BUS_DEVICE,
30
fprintf(stderr, "Timer with period zero, disabling\n");
30
- .instance_size = sizeof(A15MPPrivState),
31
}
31
- .instance_init = a15mp_priv_initfn,
32
@@ -XXX,XX +XXX,XX @@ void ptimer_run(ptimer_state *s, int oneshot)
32
- .class_init = a15mp_priv_class_init,
33
33
+static const TypeInfo a15mp_types[] = {
34
assert(s->in_transaction);
34
+ {
35
35
+ .name = TYPE_A15MPCORE_PRIV,
36
- if (was_disabled && s->period == 0) {
36
+ .parent = TYPE_SYS_BUS_DEVICE,
37
+ if (was_disabled && s->period == 0 && s->period_frac == 0) {
37
+ .instance_size = sizeof(A15MPPrivState),
38
if (!qtest_enabled()) {
38
+ .instance_init = a15mp_priv_initfn,
39
fprintf(stderr, "Timer with period zero, disabling\n");
39
+ .class_init = a15mp_priv_class_init,
40
}
40
+ },
41
diff --git a/tests/unit/ptimer-test.c b/tests/unit/ptimer-test.c
41
};
42
43
-static void a15mp_register_types(void)
44
-{
45
- type_register_static(&a15mp_priv_info);
46
-}
47
-
48
-type_init(a15mp_register_types)
49
+DEFINE_TYPES(a15mp_types)
50
diff --git a/hw/cpu/a9mpcore.c b/hw/cpu/a9mpcore.c
42
index XXXXXXX..XXXXXXX 100644
51
index XXXXXXX..XXXXXXX 100644
43
--- a/tests/unit/ptimer-test.c
52
--- a/hw/cpu/a9mpcore.c
44
+++ b/tests/unit/ptimer-test.c
53
+++ b/hw/cpu/a9mpcore.c
45
@@ -XXX,XX +XXX,XX @@ static void check_oneshot_with_load_0(gconstpointer arg)
54
@@ -XXX,XX +XXX,XX @@ static void a9mp_priv_class_init(ObjectClass *klass, void *data)
46
ptimer_free(ptimer);
55
device_class_set_props(dc, a9mp_priv_properties);
47
}
56
}
48
57
49
+static void check_freq_more_than_1000M(gconstpointer arg)
58
-static const TypeInfo a9mp_priv_info = {
50
+{
59
- .name = TYPE_A9MPCORE_PRIV,
51
+ const uint8_t *policy = arg;
60
- .parent = TYPE_SYS_BUS_DEVICE,
52
+ ptimer_state *ptimer = ptimer_init(ptimer_trigger, NULL, *policy);
61
- .instance_size = sizeof(A9MPPrivState),
53
+ bool no_round_down = (*policy & PTIMER_POLICY_NO_COUNTER_ROUND_DOWN);
62
- .instance_init = a9mp_priv_initfn,
54
+
63
- .class_init = a9mp_priv_class_init,
55
+ triggered = false;
64
+static const TypeInfo a9mp_types[] = {
56
+
65
+ {
57
+ ptimer_transaction_begin(ptimer);
66
+ .name = TYPE_A9MPCORE_PRIV,
58
+ ptimer_set_freq(ptimer, 2000000000);
67
+ .parent = TYPE_SYS_BUS_DEVICE,
59
+ ptimer_set_limit(ptimer, 8, 1);
68
+ .instance_size = sizeof(A9MPPrivState),
60
+ ptimer_run(ptimer, 1);
69
+ .instance_init = a9mp_priv_initfn,
61
+ ptimer_transaction_commit(ptimer);
70
+ .class_init = a9mp_priv_class_init,
62
+
71
+ },
63
+ qemu_clock_step(3);
72
};
64
+
73
65
+ g_assert_cmpuint(ptimer_get_count(ptimer), ==, no_round_down ? 3 : 2);
74
-static void a9mp_register_types(void)
66
+ g_assert_false(triggered);
75
-{
67
+
76
- type_register_static(&a9mp_priv_info);
68
+ qemu_clock_step(1);
77
-}
69
+
78
-
70
+ g_assert_cmpuint(ptimer_get_count(ptimer), ==, 0);
79
-type_init(a9mp_register_types)
71
+ g_assert_true(triggered);
80
+DEFINE_TYPES(a9mp_types)
72
+
81
diff --git a/hw/cpu/arm11mpcore.c b/hw/cpu/arm11mpcore.c
73
+ ptimer_free(ptimer);
82
index XXXXXXX..XXXXXXX 100644
74
+}
83
--- a/hw/cpu/arm11mpcore.c
75
+
84
+++ b/hw/cpu/arm11mpcore.c
76
static void add_ptimer_tests(uint8_t policy)
85
@@ -XXX,XX +XXX,XX @@ static void mpcore_priv_class_init(ObjectClass *klass, void *data)
77
{
86
device_class_set_props(dc, mpcore_priv_properties);
78
char policy_name[256] = "";
79
@@ -XXX,XX +XXX,XX @@ static void add_ptimer_tests(uint8_t policy)
80
policy_name),
81
g_memdup2(&policy, 1), check_oneshot_with_load_0, g_free);
82
g_free(tmp);
83
+
84
+ g_test_add_data_func_full(
85
+ tmp = g_strdup_printf("/ptimer/freq_more_than_1000M policy=%s",
86
+ policy_name),
87
+ g_memdup2(&policy, 1), check_freq_more_than_1000M, g_free);
88
+ g_free(tmp);
89
}
87
}
90
88
91
static void add_all_ptimer_policies_comb_tests(void)
89
-static const TypeInfo mpcore_priv_info = {
90
- .name = TYPE_ARM11MPCORE_PRIV,
91
- .parent = TYPE_SYS_BUS_DEVICE,
92
- .instance_size = sizeof(ARM11MPCorePriveState),
93
- .instance_init = mpcore_priv_initfn,
94
- .class_init = mpcore_priv_class_init,
95
+static const TypeInfo arm11mp_types[] = {
96
+ {
97
+ .name = TYPE_ARM11MPCORE_PRIV,
98
+ .parent = TYPE_SYS_BUS_DEVICE,
99
+ .instance_size = sizeof(ARM11MPCorePriveState),
100
+ .instance_init = mpcore_priv_initfn,
101
+ .class_init = mpcore_priv_class_init,
102
+ },
103
};
104
105
-static void arm11mpcore_register_types(void)
106
-{
107
- type_register_static(&mpcore_priv_info);
108
-}
109
-
110
-type_init(arm11mpcore_register_types)
111
+DEFINE_TYPES(arm11mp_types)
112
diff --git a/hw/cpu/realview_mpcore.c b/hw/cpu/realview_mpcore.c
113
index XXXXXXX..XXXXXXX 100644
114
--- a/hw/cpu/realview_mpcore.c
115
+++ b/hw/cpu/realview_mpcore.c
116
@@ -XXX,XX +XXX,XX @@ static void mpcore_rirq_class_init(ObjectClass *klass, void *data)
117
dc->realize = realview_mpcore_realize;
118
}
119
120
-static const TypeInfo mpcore_rirq_info = {
121
- .name = TYPE_REALVIEW_MPCORE_RIRQ,
122
- .parent = TYPE_SYS_BUS_DEVICE,
123
- .instance_size = sizeof(mpcore_rirq_state),
124
- .instance_init = mpcore_rirq_init,
125
- .class_init = mpcore_rirq_class_init,
126
+static const TypeInfo realview_mpcore_types[] = {
127
+ {
128
+ .name = TYPE_REALVIEW_MPCORE_RIRQ,
129
+ .parent = TYPE_SYS_BUS_DEVICE,
130
+ .instance_size = sizeof(mpcore_rirq_state),
131
+ .instance_init = mpcore_rirq_init,
132
+ .class_init = mpcore_rirq_class_init,
133
+ },
134
};
135
136
-static void realview_mpcore_register_types(void)
137
-{
138
- type_register_static(&mpcore_rirq_info);
139
-}
140
-
141
-type_init(realview_mpcore_register_types)
142
+DEFINE_TYPES(realview_mpcore_types)
92
--
143
--
93
2.34.1
144
2.34.1
145
146
diff view generated by jsdifflib
New patch
1
From: Andrew Yuan <andrew.yuan@jaguarmicro.com>
1
2
3
Our current handling of the mask/compare logic in the Cadence
4
GEM ethernet device is wrong:
5
(1) we load the same byte twice from rx_buf when
6
creating the compare value
7
(2) we ignore the DISABLE_MASK flag
8
9
The "Cadence IP for Gigabit Ethernet MAC Part Number: IP7014 IP Rev:
10
R1p12 - Doc Rev: 1.3 User Guide" states that if the DISABLE_MASK bit
11
in type2_compare_x_word_1 is set, the mask_value field in
12
type2_compare_x_word_0 is used as an additional 2 byte Compare Value.
13
14
Correct these bugs:
15
* in the !disable_mask codepath, use lduw_le_p() so we
16
correctly load a 16-bit value for comparison
17
* in the disable_mask codepath, we load a full 4-byte value
18
from rx_buf for the comparison, set the compare value to
19
the whole of the cr0 register (i.e. the concatenation of
20
the mask and compare fields), and set mask to 0xffffffff
21
to force a 32-bit comparison
22
23
Signed-off-by: Andrew Yuan <andrew.yuan@jaguarmicro.com>
24
Message-id: 20241219061658.805-1-andrew.yuan@jaguarmicro.com
25
Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
26
[PMM: Expand commit message and comment]
27
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
28
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
29
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
30
---
31
hw/net/cadence_gem.c | 26 +++++++++++++++++++++-----
32
1 file changed, 21 insertions(+), 5 deletions(-)
33
34
diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
35
index XXXXXXX..XXXXXXX 100644
36
--- a/hw/net/cadence_gem.c
37
+++ b/hw/net/cadence_gem.c
38
@@ -XXX,XX +XXX,XX @@ static int get_queue_from_screen(CadenceGEMState *s, uint8_t *rxbuf_ptr,
39
40
/* Compare A, B, C */
41
for (j = 0; j < 3; j++) {
42
- uint32_t cr0, cr1, mask, compare;
43
- uint16_t rx_cmp;
44
+ uint32_t cr0, cr1, mask, compare, disable_mask;
45
+ uint32_t rx_cmp;
46
int offset;
47
int cr_idx = extract32(reg, R_SCREENING_TYPE2_REG0_COMPARE_A_SHIFT + j * 6,
48
R_SCREENING_TYPE2_REG0_COMPARE_A_LENGTH);
49
@@ -XXX,XX +XXX,XX @@ static int get_queue_from_screen(CadenceGEMState *s, uint8_t *rxbuf_ptr,
50
break;
51
}
52
53
- rx_cmp = rxbuf_ptr[offset] << 8 | rxbuf_ptr[offset];
54
- mask = FIELD_EX32(cr0, TYPE2_COMPARE_0_WORD_0, MASK_VALUE);
55
- compare = FIELD_EX32(cr0, TYPE2_COMPARE_0_WORD_0, COMPARE_VALUE);
56
+ disable_mask =
57
+ FIELD_EX32(cr1, TYPE2_COMPARE_0_WORD_1, DISABLE_MASK);
58
+ if (disable_mask) {
59
+ /*
60
+ * If disable_mask is set, mask_value is used as an
61
+ * additional 2 byte Compare Value; that is equivalent
62
+ * to using the whole cr0 register as the comparison value.
63
+ * Load 32 bits of data from rx_buf, and set mask to
64
+ * all-ones so we compare all 32 bits.
65
+ */
66
+ rx_cmp = ldl_le_p(rxbuf_ptr + offset);
67
+ mask = 0xFFFFFFFF;
68
+ compare = cr0;
69
+ } else {
70
+ rx_cmp = lduw_le_p(rxbuf_ptr + offset);
71
+ mask = FIELD_EX32(cr0, TYPE2_COMPARE_0_WORD_0, MASK_VALUE);
72
+ compare =
73
+ FIELD_EX32(cr0, TYPE2_COMPARE_0_WORD_0, COMPARE_VALUE);
74
+ }
75
76
if ((rx_cmp & mask) == (compare & mask)) {
77
matched = true;
78
--
79
2.34.1
80
81
diff view generated by jsdifflib
1
In commit bb71846325e23 we added some macro magic to avoid
1
The '-old-param' command line option is specific to Arm targets; it
2
variable-shadowing when using some of our more complicated
2
is very briefly documented as "old param mode". What this option
3
macros. One of the internal components of this is a macro
3
actually does is change the behaviour when directly booting a guest
4
named MAKE_IDENTFIER. Fix the typo in its name: it should
4
kernel, so that command line arguments are passed to the kernel using
5
be MAKE_IDENTIFIER.
5
the extremely old "param_struct" ABI, rather than the newer ATAGS or
6
even newer DTB mechanisms.
6
7
7
Commit created with
8
This support was added back in 2007 to support an old vendor kernel
8
sed -i -e 's/MAKE_IDENTFIER/MAKE_IDENTIFIER/g' include/qemu/*.h include/qapi/qmp/qobject.h
9
on the akita/terrier board types:
10
https://mail.gnu.org/archive/html/qemu-devel/2007-07/msg00344.html
11
Even then, it was an out-of-date mechanism from the kernel's
12
point of view -- the kernel has had a comment since 2001 marking
13
it as deprecated. As of mid-2024, the kernel only retained
14
param_struct support for the RiscPC and Footbridge platforms:
15
https://lore.kernel.org/linux-arm-kernel/2831c5a6-cfbf-4fe0-b51c-0396e5b0aeb7@app.fastmail.com/
16
17
None of the board types QEMU supports need param_struct support;
18
mark this option as deprecated.
9
19
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
20
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
Reviewed-by: Markus Armbruster <armbru@redhat.com>
21
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
12
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
22
Message-id: 20250127123113.2947620-1-peter.maydell@linaro.org
13
Message-id: 20240801102516.3843780-1-peter.maydell@linaro.org
14
---
23
---
15
include/qapi/qmp/qobject.h | 2 +-
24
docs/about/deprecated.rst | 13 +++++++++++++
16
include/qemu/atomic.h | 2 +-
25
system/vl.c | 1 +
17
include/qemu/compiler.h | 2 +-
26
2 files changed, 14 insertions(+)
18
include/qemu/osdep.h | 6 +++---
19
4 files changed, 6 insertions(+), 6 deletions(-)
20
27
21
diff --git a/include/qapi/qmp/qobject.h b/include/qapi/qmp/qobject.h
28
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
22
index XXXXXXX..XXXXXXX 100644
29
index XXXXXXX..XXXXXXX 100644
23
--- a/include/qapi/qmp/qobject.h
30
--- a/docs/about/deprecated.rst
24
+++ b/include/qapi/qmp/qobject.h
31
+++ b/docs/about/deprecated.rst
25
@@ -XXX,XX +XXX,XX @@ struct QObject {
32
@@ -XXX,XX +XXX,XX @@ configurations (e.g. -smp drawers=1,books=1,clusters=1 for x86 PC machine) is
26
typeof(obj) _obj = (obj); \
33
marked deprecated since 9.0, users have to ensure that all the topology members
27
_obj ? container_of(&_obj->base, QObject, base) : NULL; \
34
described with -smp are supported by the target machine.
28
})
35
29
-#define QOBJECT(obj) QOBJECT_INTERNAL((obj), MAKE_IDENTFIER(_obj))
36
+``-old-param`` option for booting Arm kernels via param_struct (since 10.0)
30
+#define QOBJECT(obj) QOBJECT_INTERNAL((obj), MAKE_IDENTIFIER(_obj))
37
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
31
38
+
32
/* Required for qobject_to() */
39
+The ``-old-param`` command line option is specific to Arm targets:
33
#define QTYPE_CAST_TO_QNull QTYPE_QNULL
40
+it is used when directly booting a guest kernel to pass it the
34
diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h
41
+command line and other information via the old ``param_struct`` ABI,
42
+rather than the newer ATAGS or DTB mechanisms. This option was only
43
+ever needed to support ancient kernels on some old board types
44
+like the ``akita`` or ``terrier``; it has been deprecated in the
45
+kernel since 2001. None of the board types QEMU supports need
46
+``param_struct`` support, so this option has been deprecated and will
47
+be removed in a future QEMU version.
48
+
49
User-mode emulator command line arguments
50
-----------------------------------------
51
52
diff --git a/system/vl.c b/system/vl.c
35
index XXXXXXX..XXXXXXX 100644
53
index XXXXXXX..XXXXXXX 100644
36
--- a/include/qemu/atomic.h
54
--- a/system/vl.c
37
+++ b/include/qemu/atomic.h
55
+++ b/system/vl.c
38
@@ -XXX,XX +XXX,XX @@
56
@@ -XXX,XX +XXX,XX @@ void qemu_init(int argc, char **argv)
39
_val; \
57
nb_prom_envs++;
40
})
58
break;
41
#define qatomic_rcu_read(ptr) \
59
case QEMU_OPTION_old_param:
42
- qatomic_rcu_read_internal((ptr), MAKE_IDENTFIER(_val))
60
+ warn_report("-old-param is deprecated");
43
+ qatomic_rcu_read_internal((ptr), MAKE_IDENTIFIER(_val))
61
old_param = 1;
44
62
break;
45
#define qatomic_rcu_set(ptr, i) do { \
63
case QEMU_OPTION_rtc:
46
qemu_build_assert(sizeof(*ptr) <= ATOMIC_REG_SIZE); \
47
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
48
index XXXXXXX..XXXXXXX 100644
49
--- a/include/qemu/compiler.h
50
+++ b/include/qemu/compiler.h
51
@@ -XXX,XX +XXX,XX @@
52
#endif
53
54
/* Expands into an identifier stemN, where N is another number each time */
55
-#define MAKE_IDENTFIER(stem) glue(stem, __COUNTER__)
56
+#define MAKE_IDENTIFIER(stem) glue(stem, __COUNTER__)
57
58
#ifndef likely
59
#define likely(x) __builtin_expect(!!(x), 1)
60
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
61
index XXXXXXX..XXXXXXX 100644
62
--- a/include/qemu/osdep.h
63
+++ b/include/qemu/osdep.h
64
@@ -XXX,XX +XXX,XX @@ void QEMU_ERROR("code path is reachable")
65
})
66
#undef MIN
67
#define MIN(a, b) \
68
- MIN_INTERNAL((a), (b), MAKE_IDENTFIER(_a), MAKE_IDENTFIER(_b))
69
+ MIN_INTERNAL((a), (b), MAKE_IDENTIFIER(_a), MAKE_IDENTIFIER(_b))
70
71
#define MAX_INTERNAL(a, b, _a, _b) \
72
({ \
73
@@ -XXX,XX +XXX,XX @@ void QEMU_ERROR("code path is reachable")
74
})
75
#undef MAX
76
#define MAX(a, b) \
77
- MAX_INTERNAL((a), (b), MAKE_IDENTFIER(_a), MAKE_IDENTFIER(_b))
78
+ MAX_INTERNAL((a), (b), MAKE_IDENTIFIER(_a), MAKE_IDENTIFIER(_b))
79
80
#ifdef __COVERITY__
81
# define MIN_CONST(a, b) ((a) < (b) ? (a) : (b))
82
@@ -XXX,XX +XXX,XX @@ void QEMU_ERROR("code path is reachable")
83
_a == 0 ? _b : (_b == 0 || _b > _a) ? _a : _b; \
84
})
85
#define MIN_NON_ZERO(a, b) \
86
- MIN_NON_ZERO_INTERNAL((a), (b), MAKE_IDENTFIER(_a), MAKE_IDENTFIER(_b))
87
+ MIN_NON_ZERO_INTERNAL((a), (b), MAKE_IDENTIFIER(_a), MAKE_IDENTIFIER(_b))
88
89
/*
90
* Round number down to multiple. Safe when m is not a power of 2 (see
91
--
64
--
92
2.34.1
65
2.34.1
93
66
94
67
diff view generated by jsdifflib
1
From: Alex Richardson <alexrichardson@google.com>
1
From: Khem Raj <raj.khem@gmail.com>
2
2
3
In the PMUv3, a new AArch32 64-bit (MCRR/MRRC) accessor for the
3
glibc 2.41+ has added [1] definitions for sched_setattr and
4
PMCCNTR was added. In QEMU we forgot to implement this, so only
4
sched_getattr functions and struct sched_attr. Therefore, it needs
5
provide the 32-bit accessor. Since we have a 64-bit PMCCNTR
5
to be checked for here as well before defining sched_attr, to avoid
6
sysreg for AArch64, adding the 64-bit AArch32 version is easy.
6
a compilation failure.
7
7
8
We add the PMCCNTR to the v8_cp_reginfo because PMUv3 was added
8
Define sched_attr conditionally only when SCHED_ATTR_SIZE_VER0 is
9
in the ARMv8 architecture. This is consistent with how we
9
not defined.
10
handle the existing PMCCNTR support, where we always implement
11
it for all v7 CPUs. This is arguably something we should
12
clean up so it is gated on ARM_FEATURE_PMU and/or an ID
13
register check for the relevant PMU version, but we should
14
do that as its own tidyup rather than being inconsistent between
15
this PMCCNTR accessor and the others.
16
10
17
See https://developer.arm.com/documentation/ddi0601/2024-06/AArch32-Registers/PMCCNTR--Performance-Monitors-Cycle-Count-Register?lang=en
11
[1] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=21571ca0d70302909cf72707b2a7736cf12190a0;hp=298bc488fdc047da37482f4003023cb9adef78f8
18
12
19
Signed-off-by: Alex Richardson <alexrichardson@google.com>
13
Signed-off-by: Khem Raj <raj.khem@gmail.com>
20
Message-id: 20240801220328.941866-1-alexrichardson@google.com
14
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2799
15
Cc: qemu-stable@nongnu.org
21
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
16
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
22
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
17
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
23
---
18
---
24
target/arm/helper.c | 6 ++++++
19
linux-user/syscall.c | 4 +++-
25
1 file changed, 6 insertions(+)
20
1 file changed, 3 insertions(+), 1 deletion(-)
26
21
27
diff --git a/target/arm/helper.c b/target/arm/helper.c
22
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
28
index XXXXXXX..XXXXXXX 100644
23
index XXXXXXX..XXXXXXX 100644
29
--- a/target/arm/helper.c
24
--- a/linux-user/syscall.c
30
+++ b/target/arm/helper.c
25
+++ b/linux-user/syscall.c
31
@@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo v8_cp_reginfo[] = {
26
@@ -XXX,XX +XXX,XX @@ _syscall3(int, sys_sched_getaffinity, pid_t, pid, unsigned int, len,
32
.access = PL1_RW, .accessfn = access_trap_aa32s_el1,
27
#define __NR_sys_sched_setaffinity __NR_sched_setaffinity
33
.writefn = sdcr_write,
28
_syscall3(int, sys_sched_setaffinity, pid_t, pid, unsigned int, len,
34
.fieldoffset = offsetoflow32(CPUARMState, cp15.mdcr_el3) },
29
unsigned long *, user_mask_ptr);
35
+ { .name = "PMCCNTR", .state = ARM_CP_STATE_AA32,
30
-/* sched_attr is not defined in glibc */
36
+ .type = ARM_CP_ALIAS | ARM_CP_IO | ARM_CP_64BIT,
31
+/* sched_attr is not defined in glibc < 2.41 */
37
+ .cp = 15, .crm = 9, .opc1 = 0,
32
+#ifndef SCHED_ATTR_SIZE_VER0
38
+ .access = PL0_RW, .resetvalue = 0, .fgt = FGT_PMCCNTR_EL0,
33
struct sched_attr {
39
+ .readfn = pmccntr_read, .writefn = pmccntr_write,
34
uint32_t size;
40
+ .accessfn = pmreg_access_ccntr },
35
uint32_t sched_policy;
36
@@ -XXX,XX +XXX,XX @@ struct sched_attr {
37
uint32_t sched_util_min;
38
uint32_t sched_util_max;
41
};
39
};
42
40
+#endif
43
/* These are present only when EL1 supports AArch32 */
41
#define __NR_sys_sched_getattr __NR_sched_getattr
42
_syscall4(int, sys_sched_getattr, pid_t, pid, struct sched_attr *, attr,
43
unsigned int, size, unsigned int, flags);
44
--
44
--
45
2.34.1
45
2.34.1
diff view generated by jsdifflib