1
The following changes since commit 1ea06abceec61b6f3ab33dadb0510b6e09fb61e2:
1
Hi; here's the latest round of arm patches. I have included also
2
my patchset for the RTC devices to avoid keeping time_t and
3
time_t diffs in 32-bit variables.
2
4
3
Merge remote-tracking branch 'remotes/berrange-gitlab/tags/misc-fixes-pull-request' into staging (2021-06-14 15:59:13 +0100)
5
thanks
6
-- PMM
7
8
The following changes since commit 156618d9ea67f2f2e31d9dedd97f2dcccbe6808c:
9
10
Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-08-30 09:20:27 -0400)
4
11
5
are available in the Git repository at:
12
are available in the Git repository at:
6
13
7
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20210615
14
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20230831
8
15
9
for you to fetch changes up to c611c956c7fdce651e30687b1f5d19b4cab78b6a:
16
for you to fetch changes up to e73b8bb8a3e9a162f70e9ffbf922d4fafc96bbfb:
10
17
11
include/qemu/int128.h: Add function to create Int128 from int64_t (2021-06-15 16:18:50 +0100)
18
hw/arm: Set number of MPU regions correctly for an505, an521, an524 (2023-08-31 11:07:02 +0100)
12
19
13
----------------------------------------------------------------
20
----------------------------------------------------------------
14
target-arm queue:
21
target-arm queue:
15
* hw/intc/arm_gicv3_cpuif: Tolerate spurious EOIR writes
22
* Some of the preliminary patches for Cortex-A710 support
16
* handle some UNALLOCATED decode cases correctly rather
23
* i.MX7 and i.MX6UL refactoring
17
than asserting
24
* Implement SRC device for i.MX7
18
* hw: virt: consider hw_compat_6_0
25
* Catch illegal-exception-return from EL3 with bad NSE/NS
19
* hw/arm: add quanta-gbs-bmc machine
26
* Use 64-bit offsets for holding time_t differences in RTC devices
20
* hw/intc/armv7m_nvic: Remove stale comment
27
* Model correct number of MPU regions for an505, an521, an524 boards
21
* arm, acpi: Remove dependency on presence of 'virt' board
22
* target/arm: Fix mte page crossing test
23
* hw/arm: quanta-q71l add pca954x muxes
24
* target/arm: First few parts of MVE support
25
28
26
----------------------------------------------------------------
29
----------------------------------------------------------------
27
Heinrich Schuchardt (1):
30
Alex Bennée (1):
28
hw: virt: consider hw_compat_6_0
31
target/arm: properly document FEAT_CRC32
29
32
30
Jean-Philippe Brucker (1):
33
Jean-Christophe Dubois (6):
31
hw/intc/arm_gicv3_cpuif: Tolerate spurious EOIR writes
34
Remove i.MX7 IOMUX GPR device from i.MX6UL
35
Refactor i.MX6UL processor code
36
Add i.MX6UL missing devices.
37
Refactor i.MX7 processor code
38
Add i.MX7 missing TZ devices and memory regions
39
Add i.MX7 SRC device implementation
32
40
33
Patrick Venture (5):
41
Peter Maydell (8):
34
hw/arm: add quanta-gbs-bmc machine
42
target/arm: Catch illegal-exception-return from EL3 with bad NSE/NS
35
hw/arm: quanta-gbs-bmc add i2c comments
43
hw/rtc/m48t59: Use 64-bit arithmetic in set_alarm()
36
hw/arm: gsj add i2c comments
44
hw/rtc/twl92230: Use int64_t for sec_offset and alm_sec
37
hw/arm: gsj add pca9548
45
hw/rtc/aspeed_rtc: Use 64-bit offset for holding time_t difference
38
hw/arm: quanta-q71l add pca954x muxes
46
rtc: Use time_t for passing and returning time offsets
47
target/arm: Do all "ARM_FEATURE_X implies Y" checks in post_init
48
hw/arm/armv7m: Add mpu-ns-regions and mpu-s-regions properties
49
hw/arm: Set number of MPU regions correctly for an505, an521, an524
39
50
40
Peter Maydell (17):
51
Richard Henderson (9):
41
hw/intc/armv7m_nvic: Remove stale comment
52
target/arm: Reduce dcz_blocksize to uint8_t
42
hw/acpi: Provide stub version of acpi_ghes_record_errors()
53
target/arm: Allow cpu to configure GM blocksize
43
hw/acpi: Provide function acpi_ghes_present()
54
target/arm: Support more GM blocksizes
44
target/arm: Use acpi_ghes_present() to see if we report ACPI memory errors
55
target/arm: When tag memory is not present, set MTE=1
45
target/arm: Provide and use H8 and H1_8 macros
56
target/arm: Introduce make_ccsidr64
46
target/arm: Enable FPSCR.QC bit for MVE
57
target/arm: Apply access checks to neoverse-n1 special registers
47
target/arm: Handle VPR semantics in existing code
58
target/arm: Apply access checks to neoverse-v1 special registers
48
target/arm: Add handling for PSR.ECI/ICI
59
target/arm: Suppress FEAT_TRBE (Trace Buffer Extension)
49
target/arm: Let vfp_access_check() handle late NOCP checks
60
target/arm: Implement FEAT_HPDS2 as a no-op
50
target/arm: Implement MVE LCTP
51
target/arm: Implement MVE WLSTP insn
52
target/arm: Implement MVE DLSTP
53
target/arm: Implement MVE LETP insn
54
target/arm: Add framework for MVE decode
55
target/arm: Move expand_pred_b() data to vec_helper.c
56
bitops.h: Provide hswap32(), hswap64(), wswap64() swapping operations
57
include/qemu/int128.h: Add function to create Int128 from int64_t
58
61
59
Richard Henderson (4):
62
docs/system/arm/emulation.rst | 2 +
60
target/arm: Diagnose UNALLOCATED in disas_simd_two_reg_misc_fp16
63
include/hw/arm/armsse.h | 5 +
61
target/arm: Remove fprintf from disas_simd_mod_imm
64
include/hw/arm/armv7m.h | 8 +
62
target/arm: Diagnose UNALLOCATED in disas_simd_three_reg_same_fp16
65
include/hw/arm/fsl-imx6ul.h | 158 ++++++++++++++++---
63
target/arm: Fix mte page crossing test
66
include/hw/arm/fsl-imx7.h | 338 ++++++++++++++++++++++++++++++-----------
67
include/hw/misc/imx7_src.h | 66 ++++++++
68
include/hw/rtc/aspeed_rtc.h | 2 +-
69
include/sysemu/rtc.h | 4 +-
70
target/arm/cpregs.h | 2 +
71
target/arm/cpu.h | 5 +-
72
target/arm/internals.h | 6 -
73
target/arm/tcg/translate.h | 2 +
74
hw/arm/armsse.c | 16 ++
75
hw/arm/armv7m.c | 21 +++
76
hw/arm/fsl-imx6ul.c | 174 +++++++++++++--------
77
hw/arm/fsl-imx7.c | 201 +++++++++++++++++++-----
78
hw/arm/mps2-tz.c | 29 ++++
79
hw/misc/imx7_src.c | 276 +++++++++++++++++++++++++++++++++
80
hw/rtc/aspeed_rtc.c | 5 +-
81
hw/rtc/m48t59.c | 2 +-
82
hw/rtc/twl92230.c | 4 +-
83
softmmu/rtc.c | 4 +-
84
target/arm/cpu.c | 207 ++++++++++++++-----------
85
target/arm/helper.c | 15 +-
86
target/arm/tcg/cpu32.c | 2 +-
87
target/arm/tcg/cpu64.c | 102 +++++++++----
88
target/arm/tcg/helper-a64.c | 9 ++
89
target/arm/tcg/mte_helper.c | 90 ++++++++---
90
target/arm/tcg/translate-a64.c | 5 +-
91
hw/misc/meson.build | 1 +
92
hw/misc/trace-events | 4 +
93
31 files changed, 1393 insertions(+), 372 deletions(-)
94
create mode 100644 include/hw/misc/imx7_src.h
95
create mode 100644 hw/misc/imx7_src.c
64
96
65
include/hw/acpi/ghes.h | 9 +
66
include/qemu/bitops.h | 29 +++
67
include/qemu/int128.h | 10 +
68
target/arm/translate-a32.h | 2 +
69
target/arm/translate.h | 9 +
70
target/arm/vec_internal.h | 9 +
71
target/arm/mve.decode | 20 ++
72
target/arm/t32.decode | 15 +-
73
hw/acpi/ghes-stub.c | 22 +++
74
hw/acpi/ghes.c | 17 ++
75
hw/arm/aspeed.c | 11 +-
76
hw/arm/npcm7xx_boards.c | 107 ++++++++++-
77
hw/arm/virt.c | 2 +
78
hw/intc/arm_gicv3_cpuif.c | 5 +-
79
hw/intc/armv7m_nvic.c | 6 -
80
target/arm/kvm64.c | 6 +-
81
target/arm/m_helper.c | 54 +++++-
82
target/arm/mte_helper.c | 2 +-
83
target/arm/sve_helper.c | 381 +++++++++++++-------------------------
84
target/arm/translate-a64.c | 87 +++++----
85
target/arm/translate-m-nocp.c | 16 +-
86
target/arm/translate-mve.c | 29 +++
87
target/arm/translate-vfp.c | 65 +++++--
88
target/arm/translate.c | 300 ++++++++++++++++++++++++++++--
89
target/arm/vec_helper.c | 116 +++++++++++-
90
target/arm/vfp_helper.c | 3 +-
91
tests/tcg/aarch64/mte-7.c | 31 ++++
92
hw/acpi/meson.build | 6 +-
93
hw/arm/Kconfig | 2 +
94
target/arm/meson.build | 2 +
95
tests/tcg/aarch64/Makefile.target | 2 +-
96
31 files changed, 1019 insertions(+), 356 deletions(-)
97
create mode 100644 target/arm/mve.decode
98
create mode 100644 hw/acpi/ghes-stub.c
99
create mode 100644 target/arm/translate-mve.c
100
create mode 100644 tests/tcg/aarch64/mte-7.c
101
diff view generated by jsdifflib
1
For MVE, we want to re-use the large data table from expand_pred_b().
1
From: Richard Henderson <richard.henderson@linaro.org>
2
Move the data table to vec_helper.c so it is no longer in an SVE
3
specific source file.
4
2
3
This value is only 4 bits wide.
4
5
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
7
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
8
Message-id: 20230811214031.171020-2-richard.henderson@linaro.org
5
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
7
Message-id: 20210614151007.4545-14-peter.maydell@linaro.org
8
---
10
---
9
target/arm/vec_internal.h | 3 ++
11
target/arm/cpu.h | 3 ++-
10
target/arm/sve_helper.c | 103 ++------------------------------------
12
1 file changed, 2 insertions(+), 1 deletion(-)
11
target/arm/vec_helper.c | 102 +++++++++++++++++++++++++++++++++++++
12
3 files changed, 109 insertions(+), 99 deletions(-)
13
13
14
diff --git a/target/arm/vec_internal.h b/target/arm/vec_internal.h
14
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
15
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
16
--- a/target/arm/vec_internal.h
16
--- a/target/arm/cpu.h
17
+++ b/target/arm/vec_internal.h
17
+++ b/target/arm/cpu.h
18
@@ -XXX,XX +XXX,XX @@
18
@@ -XXX,XX +XXX,XX @@ struct ArchCPU {
19
#define H8(x) (x)
19
bool prop_lpa2;
20
#define H1_8(x) (x)
20
21
21
/* DCZ blocksize, in log_2(words), ie low 4 bits of DCZID_EL0 */
22
+/* Data for expanding active predicate bits to bytes, for byte elements. */
22
- uint32_t dcz_blocksize;
23
+extern const uint64_t expand_pred_b_data[256];
23
+ uint8_t dcz_blocksize;
24
+
24
+
25
static inline void clear_tail(void *vd, uintptr_t opr_sz, uintptr_t max_sz)
25
uint64_t rvbar_prop; /* Property/input signals. */
26
{
26
27
uint64_t *d = vd + opr_sz;
27
/* Configurable aspects of GIC cpu interface (which is part of the CPU) */
28
diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
29
index XXXXXXX..XXXXXXX 100644
30
--- a/target/arm/sve_helper.c
31
+++ b/target/arm/sve_helper.c
32
@@ -XXX,XX +XXX,XX @@ uint32_t HELPER(sve_predtest)(void *vd, void *vg, uint32_t words)
33
return flags;
34
}
35
36
-/* Expand active predicate bits to bytes, for byte elements.
37
- * for (i = 0; i < 256; ++i) {
38
- * unsigned long m = 0;
39
- * for (j = 0; j < 8; j++) {
40
- * if ((i >> j) & 1) {
41
- * m |= 0xfful << (j << 3);
42
- * }
43
- * }
44
- * printf("0x%016lx,\n", m);
45
- * }
46
+/*
47
+ * Expand active predicate bits to bytes, for byte elements.
48
+ * (The data table itself is in vec_helper.c as MVE also needs it.)
49
*/
50
static inline uint64_t expand_pred_b(uint8_t byte)
51
{
52
- static const uint64_t word[256] = {
53
- 0x0000000000000000, 0x00000000000000ff, 0x000000000000ff00,
54
- 0x000000000000ffff, 0x0000000000ff0000, 0x0000000000ff00ff,
55
- 0x0000000000ffff00, 0x0000000000ffffff, 0x00000000ff000000,
56
- 0x00000000ff0000ff, 0x00000000ff00ff00, 0x00000000ff00ffff,
57
- 0x00000000ffff0000, 0x00000000ffff00ff, 0x00000000ffffff00,
58
- 0x00000000ffffffff, 0x000000ff00000000, 0x000000ff000000ff,
59
- 0x000000ff0000ff00, 0x000000ff0000ffff, 0x000000ff00ff0000,
60
- 0x000000ff00ff00ff, 0x000000ff00ffff00, 0x000000ff00ffffff,
61
- 0x000000ffff000000, 0x000000ffff0000ff, 0x000000ffff00ff00,
62
- 0x000000ffff00ffff, 0x000000ffffff0000, 0x000000ffffff00ff,
63
- 0x000000ffffffff00, 0x000000ffffffffff, 0x0000ff0000000000,
64
- 0x0000ff00000000ff, 0x0000ff000000ff00, 0x0000ff000000ffff,
65
- 0x0000ff0000ff0000, 0x0000ff0000ff00ff, 0x0000ff0000ffff00,
66
- 0x0000ff0000ffffff, 0x0000ff00ff000000, 0x0000ff00ff0000ff,
67
- 0x0000ff00ff00ff00, 0x0000ff00ff00ffff, 0x0000ff00ffff0000,
68
- 0x0000ff00ffff00ff, 0x0000ff00ffffff00, 0x0000ff00ffffffff,
69
- 0x0000ffff00000000, 0x0000ffff000000ff, 0x0000ffff0000ff00,
70
- 0x0000ffff0000ffff, 0x0000ffff00ff0000, 0x0000ffff00ff00ff,
71
- 0x0000ffff00ffff00, 0x0000ffff00ffffff, 0x0000ffffff000000,
72
- 0x0000ffffff0000ff, 0x0000ffffff00ff00, 0x0000ffffff00ffff,
73
- 0x0000ffffffff0000, 0x0000ffffffff00ff, 0x0000ffffffffff00,
74
- 0x0000ffffffffffff, 0x00ff000000000000, 0x00ff0000000000ff,
75
- 0x00ff00000000ff00, 0x00ff00000000ffff, 0x00ff000000ff0000,
76
- 0x00ff000000ff00ff, 0x00ff000000ffff00, 0x00ff000000ffffff,
77
- 0x00ff0000ff000000, 0x00ff0000ff0000ff, 0x00ff0000ff00ff00,
78
- 0x00ff0000ff00ffff, 0x00ff0000ffff0000, 0x00ff0000ffff00ff,
79
- 0x00ff0000ffffff00, 0x00ff0000ffffffff, 0x00ff00ff00000000,
80
- 0x00ff00ff000000ff, 0x00ff00ff0000ff00, 0x00ff00ff0000ffff,
81
- 0x00ff00ff00ff0000, 0x00ff00ff00ff00ff, 0x00ff00ff00ffff00,
82
- 0x00ff00ff00ffffff, 0x00ff00ffff000000, 0x00ff00ffff0000ff,
83
- 0x00ff00ffff00ff00, 0x00ff00ffff00ffff, 0x00ff00ffffff0000,
84
- 0x00ff00ffffff00ff, 0x00ff00ffffffff00, 0x00ff00ffffffffff,
85
- 0x00ffff0000000000, 0x00ffff00000000ff, 0x00ffff000000ff00,
86
- 0x00ffff000000ffff, 0x00ffff0000ff0000, 0x00ffff0000ff00ff,
87
- 0x00ffff0000ffff00, 0x00ffff0000ffffff, 0x00ffff00ff000000,
88
- 0x00ffff00ff0000ff, 0x00ffff00ff00ff00, 0x00ffff00ff00ffff,
89
- 0x00ffff00ffff0000, 0x00ffff00ffff00ff, 0x00ffff00ffffff00,
90
- 0x00ffff00ffffffff, 0x00ffffff00000000, 0x00ffffff000000ff,
91
- 0x00ffffff0000ff00, 0x00ffffff0000ffff, 0x00ffffff00ff0000,
92
- 0x00ffffff00ff00ff, 0x00ffffff00ffff00, 0x00ffffff00ffffff,
93
- 0x00ffffffff000000, 0x00ffffffff0000ff, 0x00ffffffff00ff00,
94
- 0x00ffffffff00ffff, 0x00ffffffffff0000, 0x00ffffffffff00ff,
95
- 0x00ffffffffffff00, 0x00ffffffffffffff, 0xff00000000000000,
96
- 0xff000000000000ff, 0xff0000000000ff00, 0xff0000000000ffff,
97
- 0xff00000000ff0000, 0xff00000000ff00ff, 0xff00000000ffff00,
98
- 0xff00000000ffffff, 0xff000000ff000000, 0xff000000ff0000ff,
99
- 0xff000000ff00ff00, 0xff000000ff00ffff, 0xff000000ffff0000,
100
- 0xff000000ffff00ff, 0xff000000ffffff00, 0xff000000ffffffff,
101
- 0xff0000ff00000000, 0xff0000ff000000ff, 0xff0000ff0000ff00,
102
- 0xff0000ff0000ffff, 0xff0000ff00ff0000, 0xff0000ff00ff00ff,
103
- 0xff0000ff00ffff00, 0xff0000ff00ffffff, 0xff0000ffff000000,
104
- 0xff0000ffff0000ff, 0xff0000ffff00ff00, 0xff0000ffff00ffff,
105
- 0xff0000ffffff0000, 0xff0000ffffff00ff, 0xff0000ffffffff00,
106
- 0xff0000ffffffffff, 0xff00ff0000000000, 0xff00ff00000000ff,
107
- 0xff00ff000000ff00, 0xff00ff000000ffff, 0xff00ff0000ff0000,
108
- 0xff00ff0000ff00ff, 0xff00ff0000ffff00, 0xff00ff0000ffffff,
109
- 0xff00ff00ff000000, 0xff00ff00ff0000ff, 0xff00ff00ff00ff00,
110
- 0xff00ff00ff00ffff, 0xff00ff00ffff0000, 0xff00ff00ffff00ff,
111
- 0xff00ff00ffffff00, 0xff00ff00ffffffff, 0xff00ffff00000000,
112
- 0xff00ffff000000ff, 0xff00ffff0000ff00, 0xff00ffff0000ffff,
113
- 0xff00ffff00ff0000, 0xff00ffff00ff00ff, 0xff00ffff00ffff00,
114
- 0xff00ffff00ffffff, 0xff00ffffff000000, 0xff00ffffff0000ff,
115
- 0xff00ffffff00ff00, 0xff00ffffff00ffff, 0xff00ffffffff0000,
116
- 0xff00ffffffff00ff, 0xff00ffffffffff00, 0xff00ffffffffffff,
117
- 0xffff000000000000, 0xffff0000000000ff, 0xffff00000000ff00,
118
- 0xffff00000000ffff, 0xffff000000ff0000, 0xffff000000ff00ff,
119
- 0xffff000000ffff00, 0xffff000000ffffff, 0xffff0000ff000000,
120
- 0xffff0000ff0000ff, 0xffff0000ff00ff00, 0xffff0000ff00ffff,
121
- 0xffff0000ffff0000, 0xffff0000ffff00ff, 0xffff0000ffffff00,
122
- 0xffff0000ffffffff, 0xffff00ff00000000, 0xffff00ff000000ff,
123
- 0xffff00ff0000ff00, 0xffff00ff0000ffff, 0xffff00ff00ff0000,
124
- 0xffff00ff00ff00ff, 0xffff00ff00ffff00, 0xffff00ff00ffffff,
125
- 0xffff00ffff000000, 0xffff00ffff0000ff, 0xffff00ffff00ff00,
126
- 0xffff00ffff00ffff, 0xffff00ffffff0000, 0xffff00ffffff00ff,
127
- 0xffff00ffffffff00, 0xffff00ffffffffff, 0xffffff0000000000,
128
- 0xffffff00000000ff, 0xffffff000000ff00, 0xffffff000000ffff,
129
- 0xffffff0000ff0000, 0xffffff0000ff00ff, 0xffffff0000ffff00,
130
- 0xffffff0000ffffff, 0xffffff00ff000000, 0xffffff00ff0000ff,
131
- 0xffffff00ff00ff00, 0xffffff00ff00ffff, 0xffffff00ffff0000,
132
- 0xffffff00ffff00ff, 0xffffff00ffffff00, 0xffffff00ffffffff,
133
- 0xffffffff00000000, 0xffffffff000000ff, 0xffffffff0000ff00,
134
- 0xffffffff0000ffff, 0xffffffff00ff0000, 0xffffffff00ff00ff,
135
- 0xffffffff00ffff00, 0xffffffff00ffffff, 0xffffffffff000000,
136
- 0xffffffffff0000ff, 0xffffffffff00ff00, 0xffffffffff00ffff,
137
- 0xffffffffffff0000, 0xffffffffffff00ff, 0xffffffffffffff00,
138
- 0xffffffffffffffff,
139
- };
140
- return word[byte];
141
+ return expand_pred_b_data[byte];
142
}
143
144
/* Similarly for half-word elements.
145
diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c
146
index XXXXXXX..XXXXXXX 100644
147
--- a/target/arm/vec_helper.c
148
+++ b/target/arm/vec_helper.c
149
@@ -XXX,XX +XXX,XX @@
150
#include "qemu/int128.h"
151
#include "vec_internal.h"
152
153
+/*
154
+ * Data for expanding active predicate bits to bytes, for byte elements.
155
+ *
156
+ * for (i = 0; i < 256; ++i) {
157
+ * unsigned long m = 0;
158
+ * for (j = 0; j < 8; j++) {
159
+ * if ((i >> j) & 1) {
160
+ * m |= 0xfful << (j << 3);
161
+ * }
162
+ * }
163
+ * printf("0x%016lx,\n", m);
164
+ * }
165
+ */
166
+const uint64_t expand_pred_b_data[256] = {
167
+ 0x0000000000000000, 0x00000000000000ff, 0x000000000000ff00,
168
+ 0x000000000000ffff, 0x0000000000ff0000, 0x0000000000ff00ff,
169
+ 0x0000000000ffff00, 0x0000000000ffffff, 0x00000000ff000000,
170
+ 0x00000000ff0000ff, 0x00000000ff00ff00, 0x00000000ff00ffff,
171
+ 0x00000000ffff0000, 0x00000000ffff00ff, 0x00000000ffffff00,
172
+ 0x00000000ffffffff, 0x000000ff00000000, 0x000000ff000000ff,
173
+ 0x000000ff0000ff00, 0x000000ff0000ffff, 0x000000ff00ff0000,
174
+ 0x000000ff00ff00ff, 0x000000ff00ffff00, 0x000000ff00ffffff,
175
+ 0x000000ffff000000, 0x000000ffff0000ff, 0x000000ffff00ff00,
176
+ 0x000000ffff00ffff, 0x000000ffffff0000, 0x000000ffffff00ff,
177
+ 0x000000ffffffff00, 0x000000ffffffffff, 0x0000ff0000000000,
178
+ 0x0000ff00000000ff, 0x0000ff000000ff00, 0x0000ff000000ffff,
179
+ 0x0000ff0000ff0000, 0x0000ff0000ff00ff, 0x0000ff0000ffff00,
180
+ 0x0000ff0000ffffff, 0x0000ff00ff000000, 0x0000ff00ff0000ff,
181
+ 0x0000ff00ff00ff00, 0x0000ff00ff00ffff, 0x0000ff00ffff0000,
182
+ 0x0000ff00ffff00ff, 0x0000ff00ffffff00, 0x0000ff00ffffffff,
183
+ 0x0000ffff00000000, 0x0000ffff000000ff, 0x0000ffff0000ff00,
184
+ 0x0000ffff0000ffff, 0x0000ffff00ff0000, 0x0000ffff00ff00ff,
185
+ 0x0000ffff00ffff00, 0x0000ffff00ffffff, 0x0000ffffff000000,
186
+ 0x0000ffffff0000ff, 0x0000ffffff00ff00, 0x0000ffffff00ffff,
187
+ 0x0000ffffffff0000, 0x0000ffffffff00ff, 0x0000ffffffffff00,
188
+ 0x0000ffffffffffff, 0x00ff000000000000, 0x00ff0000000000ff,
189
+ 0x00ff00000000ff00, 0x00ff00000000ffff, 0x00ff000000ff0000,
190
+ 0x00ff000000ff00ff, 0x00ff000000ffff00, 0x00ff000000ffffff,
191
+ 0x00ff0000ff000000, 0x00ff0000ff0000ff, 0x00ff0000ff00ff00,
192
+ 0x00ff0000ff00ffff, 0x00ff0000ffff0000, 0x00ff0000ffff00ff,
193
+ 0x00ff0000ffffff00, 0x00ff0000ffffffff, 0x00ff00ff00000000,
194
+ 0x00ff00ff000000ff, 0x00ff00ff0000ff00, 0x00ff00ff0000ffff,
195
+ 0x00ff00ff00ff0000, 0x00ff00ff00ff00ff, 0x00ff00ff00ffff00,
196
+ 0x00ff00ff00ffffff, 0x00ff00ffff000000, 0x00ff00ffff0000ff,
197
+ 0x00ff00ffff00ff00, 0x00ff00ffff00ffff, 0x00ff00ffffff0000,
198
+ 0x00ff00ffffff00ff, 0x00ff00ffffffff00, 0x00ff00ffffffffff,
199
+ 0x00ffff0000000000, 0x00ffff00000000ff, 0x00ffff000000ff00,
200
+ 0x00ffff000000ffff, 0x00ffff0000ff0000, 0x00ffff0000ff00ff,
201
+ 0x00ffff0000ffff00, 0x00ffff0000ffffff, 0x00ffff00ff000000,
202
+ 0x00ffff00ff0000ff, 0x00ffff00ff00ff00, 0x00ffff00ff00ffff,
203
+ 0x00ffff00ffff0000, 0x00ffff00ffff00ff, 0x00ffff00ffffff00,
204
+ 0x00ffff00ffffffff, 0x00ffffff00000000, 0x00ffffff000000ff,
205
+ 0x00ffffff0000ff00, 0x00ffffff0000ffff, 0x00ffffff00ff0000,
206
+ 0x00ffffff00ff00ff, 0x00ffffff00ffff00, 0x00ffffff00ffffff,
207
+ 0x00ffffffff000000, 0x00ffffffff0000ff, 0x00ffffffff00ff00,
208
+ 0x00ffffffff00ffff, 0x00ffffffffff0000, 0x00ffffffffff00ff,
209
+ 0x00ffffffffffff00, 0x00ffffffffffffff, 0xff00000000000000,
210
+ 0xff000000000000ff, 0xff0000000000ff00, 0xff0000000000ffff,
211
+ 0xff00000000ff0000, 0xff00000000ff00ff, 0xff00000000ffff00,
212
+ 0xff00000000ffffff, 0xff000000ff000000, 0xff000000ff0000ff,
213
+ 0xff000000ff00ff00, 0xff000000ff00ffff, 0xff000000ffff0000,
214
+ 0xff000000ffff00ff, 0xff000000ffffff00, 0xff000000ffffffff,
215
+ 0xff0000ff00000000, 0xff0000ff000000ff, 0xff0000ff0000ff00,
216
+ 0xff0000ff0000ffff, 0xff0000ff00ff0000, 0xff0000ff00ff00ff,
217
+ 0xff0000ff00ffff00, 0xff0000ff00ffffff, 0xff0000ffff000000,
218
+ 0xff0000ffff0000ff, 0xff0000ffff00ff00, 0xff0000ffff00ffff,
219
+ 0xff0000ffffff0000, 0xff0000ffffff00ff, 0xff0000ffffffff00,
220
+ 0xff0000ffffffffff, 0xff00ff0000000000, 0xff00ff00000000ff,
221
+ 0xff00ff000000ff00, 0xff00ff000000ffff, 0xff00ff0000ff0000,
222
+ 0xff00ff0000ff00ff, 0xff00ff0000ffff00, 0xff00ff0000ffffff,
223
+ 0xff00ff00ff000000, 0xff00ff00ff0000ff, 0xff00ff00ff00ff00,
224
+ 0xff00ff00ff00ffff, 0xff00ff00ffff0000, 0xff00ff00ffff00ff,
225
+ 0xff00ff00ffffff00, 0xff00ff00ffffffff, 0xff00ffff00000000,
226
+ 0xff00ffff000000ff, 0xff00ffff0000ff00, 0xff00ffff0000ffff,
227
+ 0xff00ffff00ff0000, 0xff00ffff00ff00ff, 0xff00ffff00ffff00,
228
+ 0xff00ffff00ffffff, 0xff00ffffff000000, 0xff00ffffff0000ff,
229
+ 0xff00ffffff00ff00, 0xff00ffffff00ffff, 0xff00ffffffff0000,
230
+ 0xff00ffffffff00ff, 0xff00ffffffffff00, 0xff00ffffffffffff,
231
+ 0xffff000000000000, 0xffff0000000000ff, 0xffff00000000ff00,
232
+ 0xffff00000000ffff, 0xffff000000ff0000, 0xffff000000ff00ff,
233
+ 0xffff000000ffff00, 0xffff000000ffffff, 0xffff0000ff000000,
234
+ 0xffff0000ff0000ff, 0xffff0000ff00ff00, 0xffff0000ff00ffff,
235
+ 0xffff0000ffff0000, 0xffff0000ffff00ff, 0xffff0000ffffff00,
236
+ 0xffff0000ffffffff, 0xffff00ff00000000, 0xffff00ff000000ff,
237
+ 0xffff00ff0000ff00, 0xffff00ff0000ffff, 0xffff00ff00ff0000,
238
+ 0xffff00ff00ff00ff, 0xffff00ff00ffff00, 0xffff00ff00ffffff,
239
+ 0xffff00ffff000000, 0xffff00ffff0000ff, 0xffff00ffff00ff00,
240
+ 0xffff00ffff00ffff, 0xffff00ffffff0000, 0xffff00ffffff00ff,
241
+ 0xffff00ffffffff00, 0xffff00ffffffffff, 0xffffff0000000000,
242
+ 0xffffff00000000ff, 0xffffff000000ff00, 0xffffff000000ffff,
243
+ 0xffffff0000ff0000, 0xffffff0000ff00ff, 0xffffff0000ffff00,
244
+ 0xffffff0000ffffff, 0xffffff00ff000000, 0xffffff00ff0000ff,
245
+ 0xffffff00ff00ff00, 0xffffff00ff00ffff, 0xffffff00ffff0000,
246
+ 0xffffff00ffff00ff, 0xffffff00ffffff00, 0xffffff00ffffffff,
247
+ 0xffffffff00000000, 0xffffffff000000ff, 0xffffffff0000ff00,
248
+ 0xffffffff0000ffff, 0xffffffff00ff0000, 0xffffffff00ff00ff,
249
+ 0xffffffff00ffff00, 0xffffffff00ffffff, 0xffffffffff000000,
250
+ 0xffffffffff0000ff, 0xffffffffff00ff00, 0xffffffffff00ffff,
251
+ 0xffffffffffff0000, 0xffffffffffff00ff, 0xffffffffffffff00,
252
+ 0xffffffffffffffff,
253
+};
254
+
255
/* Signed saturating rounding doubling multiply-accumulate high half, 8-bit */
256
int8_t do_sqrdmlah_b(int8_t src1, int8_t src2, int8_t src3,
257
bool neg, bool round)
258
--
28
--
259
2.20.1
29
2.34.1
260
30
261
31
diff view generated by jsdifflib
1
From: Patrick Venture <venture@google.com>
1
From: Richard Henderson <richard.henderson@linaro.org>
2
2
3
Add a comment and i2c method that describes the board layout.
3
Previously we hard-coded the blocksize with GMID_EL1_BS.
4
4
But the value we choose for -cpu max does not match the
5
Tested: firmware booted to userspace.
5
value that cortex-a710 uses.
6
Signed-off-by: Patrick Venture <venture@google.com>
6
7
Reviewed-by: Brandon Kim <brandonkim@google.com>
7
Mirror the way we handle dcz_blocksize.
8
Reviewed-by: Hao Wu <wuhaotsh@google.com>
8
9
Message-id: 20210608193605.2611114-3-venture@google.com
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
11
Message-id: 20230811214031.171020-3-richard.henderson@linaro.org
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
13
---
12
hw/arm/npcm7xx_boards.c | 60 +++++++++++++++++++++++++++++++++++++++++
14
target/arm/cpu.h | 2 ++
13
1 file changed, 60 insertions(+)
15
target/arm/internals.h | 6 -----
14
16
target/arm/tcg/translate.h | 2 ++
15
diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c
17
target/arm/helper.c | 11 +++++---
16
index XXXXXXX..XXXXXXX 100644
18
target/arm/tcg/cpu64.c | 1 +
17
--- a/hw/arm/npcm7xx_boards.c
19
target/arm/tcg/mte_helper.c | 46 ++++++++++++++++++++++------------
18
+++ b/hw/arm/npcm7xx_boards.c
20
target/arm/tcg/translate-a64.c | 5 ++--
19
@@ -XXX,XX +XXX,XX @@ static void quanta_gsj_fan_init(NPCM7xxMachine *machine, NPCM7xxState *soc)
21
7 files changed, 45 insertions(+), 28 deletions(-)
20
npcm7xx_connect_pwm_fan(soc, &splitter[2], 0x05, 1);
22
23
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
24
index XXXXXXX..XXXXXXX 100644
25
--- a/target/arm/cpu.h
26
+++ b/target/arm/cpu.h
27
@@ -XXX,XX +XXX,XX @@ struct ArchCPU {
28
29
/* DCZ blocksize, in log_2(words), ie low 4 bits of DCZID_EL0 */
30
uint8_t dcz_blocksize;
31
+ /* GM blocksize, in log_2(words), ie low 4 bits of GMID_EL0 */
32
+ uint8_t gm_blocksize;
33
34
uint64_t rvbar_prop; /* Property/input signals. */
35
36
diff --git a/target/arm/internals.h b/target/arm/internals.h
37
index XXXXXXX..XXXXXXX 100644
38
--- a/target/arm/internals.h
39
+++ b/target/arm/internals.h
40
@@ -XXX,XX +XXX,XX @@ void arm_log_exception(CPUState *cs);
41
42
#endif /* !CONFIG_USER_ONLY */
43
44
-/*
45
- * The log2 of the words in the tag block, for GMID_EL1.BS.
46
- * The is the maximum, 256 bytes, which manipulates 64-bits of tags.
47
- */
48
-#define GMID_EL1_BS 6
49
-
50
/*
51
* SVE predicates are 1/8 the size of SVE vectors, and cannot use
52
* the same simd_desc() encoding due to restrictions on size.
53
diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h
54
index XXXXXXX..XXXXXXX 100644
55
--- a/target/arm/tcg/translate.h
56
+++ b/target/arm/tcg/translate.h
57
@@ -XXX,XX +XXX,XX @@ typedef struct DisasContext {
58
int8_t btype;
59
/* A copy of cpu->dcz_blocksize. */
60
uint8_t dcz_blocksize;
61
+ /* A copy of cpu->gm_blocksize. */
62
+ uint8_t gm_blocksize;
63
/* True if this page is guarded. */
64
bool guarded_page;
65
/* Bottom two bits of XScale c15_cpar coprocessor access control reg */
66
diff --git a/target/arm/helper.c b/target/arm/helper.c
67
index XXXXXXX..XXXXXXX 100644
68
--- a/target/arm/helper.c
69
+++ b/target/arm/helper.c
70
@@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo mte_reginfo[] = {
71
.opc0 = 3, .opc1 = 0, .crn = 1, .crm = 0, .opc2 = 6,
72
.access = PL1_RW, .accessfn = access_mte,
73
.fieldoffset = offsetof(CPUARMState, cp15.gcr_el1) },
74
- { .name = "GMID_EL1", .state = ARM_CP_STATE_AA64,
75
- .opc0 = 3, .opc1 = 1, .crn = 0, .crm = 0, .opc2 = 4,
76
- .access = PL1_R, .accessfn = access_aa64_tid5,
77
- .type = ARM_CP_CONST, .resetvalue = GMID_EL1_BS },
78
{ .name = "TCO", .state = ARM_CP_STATE_AA64,
79
.opc0 = 3, .opc1 = 3, .crn = 4, .crm = 2, .opc2 = 7,
80
.type = ARM_CP_NO_RAW,
81
@@ -XXX,XX +XXX,XX @@ void register_cp_regs_for_features(ARMCPU *cpu)
82
* then define only a RAZ/WI version of PSTATE.TCO.
83
*/
84
if (cpu_isar_feature(aa64_mte, cpu)) {
85
+ ARMCPRegInfo gmid_reginfo = {
86
+ .name = "GMID_EL1", .state = ARM_CP_STATE_AA64,
87
+ .opc0 = 3, .opc1 = 1, .crn = 0, .crm = 0, .opc2 = 4,
88
+ .access = PL1_R, .accessfn = access_aa64_tid5,
89
+ .type = ARM_CP_CONST, .resetvalue = cpu->gm_blocksize,
90
+ };
91
+ define_one_arm_cp_reg(cpu, &gmid_reginfo);
92
define_arm_cp_regs(cpu, mte_reginfo);
93
define_arm_cp_regs(cpu, mte_el0_cacheop_reginfo);
94
} else if (cpu_isar_feature(aa64_mte_insn_reg, cpu)) {
95
diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c
96
index XXXXXXX..XXXXXXX 100644
97
--- a/target/arm/tcg/cpu64.c
98
+++ b/target/arm/tcg/cpu64.c
99
@@ -XXX,XX +XXX,XX @@ void aarch64_max_tcg_initfn(Object *obj)
100
cpu->ctr = 0x80038003; /* 32 byte I and D cacheline size, VIPT icache */
101
cpu->dcz_blocksize = 7; /* 512 bytes */
102
#endif
103
+ cpu->gm_blocksize = 6; /* 256 bytes */
104
105
cpu->sve_vq.supported = MAKE_64BIT_MASK(0, ARM_MAX_VQ);
106
cpu->sme_vq.supported = SVE_VQ_POW2_MAP;
107
diff --git a/target/arm/tcg/mte_helper.c b/target/arm/tcg/mte_helper.c
108
index XXXXXXX..XXXXXXX 100644
109
--- a/target/arm/tcg/mte_helper.c
110
+++ b/target/arm/tcg/mte_helper.c
111
@@ -XXX,XX +XXX,XX @@ void HELPER(st2g_stub)(CPUARMState *env, uint64_t ptr)
112
}
21
}
113
}
22
114
23
+static void quanta_gbs_i2c_init(NPCM7xxState *soc)
115
-#define LDGM_STGM_SIZE (4 << GMID_EL1_BS)
24
+{
116
-
25
+ /*
117
uint64_t HELPER(ldgm)(CPUARMState *env, uint64_t ptr)
26
+ * i2c-0:
27
+ * pca9546@71
28
+ *
29
+ * i2c-1:
30
+ * pca9535@24
31
+ * pca9535@20
32
+ * pca9535@21
33
+ * pca9535@22
34
+ * pca9535@23
35
+ * pca9535@25
36
+ * pca9535@26
37
+ *
38
+ * i2c-2:
39
+ * sbtsi@4c
40
+ *
41
+ * i2c-5:
42
+ * atmel,24c64@50 mb_fru
43
+ * pca9546@71
44
+ * - channel 0: max31725@54
45
+ * - channel 1: max31725@55
46
+ * - channel 2: max31725@5d
47
+ * atmel,24c64@51 fan_fru
48
+ * - channel 3: atmel,24c64@52 hsbp_fru
49
+ *
50
+ * i2c-6:
51
+ * pca9545@73
52
+ *
53
+ * i2c-7:
54
+ * pca9545@72
55
+ *
56
+ * i2c-8:
57
+ * adi,adm1272@10
58
+ *
59
+ * i2c-9:
60
+ * pca9546@71
61
+ * - channel 0: isil,isl68137@60
62
+ * - channel 1: isil,isl68137@61
63
+ * - channel 2: isil,isl68137@63
64
+ * - channel 3: isil,isl68137@45
65
+ *
66
+ * i2c-10:
67
+ * pca9545@71
68
+ *
69
+ * i2c-11:
70
+ * pca9545@76
71
+ *
72
+ * i2c-12:
73
+ * maxim,max34451@4e
74
+ * isil,isl68137@5d
75
+ * isil,isl68137@5e
76
+ *
77
+ * i2c-14:
78
+ * pca9545@70
79
+ */
80
+}
81
+
82
static void npcm750_evb_init(MachineState *machine)
83
{
118
{
84
NPCM7xxState *soc;
119
int mmu_idx = cpu_mmu_index(env, false);
85
@@ -XXX,XX +XXX,XX @@ static void quanta_gbs_init(MachineState *machine)
120
uintptr_t ra = GETPC();
86
npcm7xx_connect_flash(&soc->fiu[0], 0, "mx66u51235f",
121
+ int gm_bs = env_archcpu(env)->gm_blocksize;
87
drive_get(IF_MTD, 0, 0));
122
+ int gm_bs_bytes = 4 << gm_bs;
88
123
void *tag_mem;
89
+ quanta_gbs_i2c_init(soc);
124
90
npcm7xx_load_kernel(machine, soc);
125
- ptr = QEMU_ALIGN_DOWN(ptr, LDGM_STGM_SIZE);
126
+ ptr = QEMU_ALIGN_DOWN(ptr, gm_bs_bytes);
127
128
/* Trap if accessing an invalid page. */
129
tag_mem = allocation_tag_mem(env, mmu_idx, ptr, MMU_DATA_LOAD,
130
- LDGM_STGM_SIZE, MMU_DATA_LOAD,
131
- LDGM_STGM_SIZE / (2 * TAG_GRANULE), ra);
132
+ gm_bs_bytes, MMU_DATA_LOAD,
133
+ gm_bs_bytes / (2 * TAG_GRANULE), ra);
134
135
/* The tag is squashed to zero if the page does not support tags. */
136
if (!tag_mem) {
137
return 0;
138
}
139
140
- QEMU_BUILD_BUG_ON(GMID_EL1_BS != 6);
141
/*
142
- * We are loading 64-bits worth of tags. The ordering of elements
143
- * within the word corresponds to a 64-bit little-endian operation.
144
+ * The ordering of elements within the word corresponds to
145
+ * a little-endian operation.
146
*/
147
- return ldq_le_p(tag_mem);
148
+ switch (gm_bs) {
149
+ case 6:
150
+ /* 256 bytes -> 16 tags -> 64 result bits */
151
+ return ldq_le_p(tag_mem);
152
+ default:
153
+ /* cpu configured with unsupported gm blocksize. */
154
+ g_assert_not_reached();
155
+ }
91
}
156
}
92
157
158
void HELPER(stgm)(CPUARMState *env, uint64_t ptr, uint64_t val)
159
{
160
int mmu_idx = cpu_mmu_index(env, false);
161
uintptr_t ra = GETPC();
162
+ int gm_bs = env_archcpu(env)->gm_blocksize;
163
+ int gm_bs_bytes = 4 << gm_bs;
164
void *tag_mem;
165
166
- ptr = QEMU_ALIGN_DOWN(ptr, LDGM_STGM_SIZE);
167
+ ptr = QEMU_ALIGN_DOWN(ptr, gm_bs_bytes);
168
169
/* Trap if accessing an invalid page. */
170
tag_mem = allocation_tag_mem(env, mmu_idx, ptr, MMU_DATA_STORE,
171
- LDGM_STGM_SIZE, MMU_DATA_LOAD,
172
- LDGM_STGM_SIZE / (2 * TAG_GRANULE), ra);
173
+ gm_bs_bytes, MMU_DATA_LOAD,
174
+ gm_bs_bytes / (2 * TAG_GRANULE), ra);
175
176
/*
177
* Tag store only happens if the page support tags,
178
@@ -XXX,XX +XXX,XX @@ void HELPER(stgm)(CPUARMState *env, uint64_t ptr, uint64_t val)
179
return;
180
}
181
182
- QEMU_BUILD_BUG_ON(GMID_EL1_BS != 6);
183
/*
184
- * We are storing 64-bits worth of tags. The ordering of elements
185
- * within the word corresponds to a 64-bit little-endian operation.
186
+ * The ordering of elements within the word corresponds to
187
+ * a little-endian operation.
188
*/
189
- stq_le_p(tag_mem, val);
190
+ switch (gm_bs) {
191
+ case 6:
192
+ stq_le_p(tag_mem, val);
193
+ break;
194
+ default:
195
+ /* cpu configured with unsupported gm blocksize. */
196
+ g_assert_not_reached();
197
+ }
198
}
199
200
void HELPER(stzgm_tags)(CPUARMState *env, uint64_t ptr, uint64_t val)
201
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
202
index XXXXXXX..XXXXXXX 100644
203
--- a/target/arm/tcg/translate-a64.c
204
+++ b/target/arm/tcg/translate-a64.c
205
@@ -XXX,XX +XXX,XX @@ static bool trans_STGM(DisasContext *s, arg_ldst_tag *a)
206
gen_helper_stgm(cpu_env, addr, tcg_rt);
207
} else {
208
MMUAccessType acc = MMU_DATA_STORE;
209
- int size = 4 << GMID_EL1_BS;
210
+ int size = 4 << s->gm_blocksize;
211
212
clean_addr = clean_data_tbi(s, addr);
213
tcg_gen_andi_i64(clean_addr, clean_addr, -size);
214
@@ -XXX,XX +XXX,XX @@ static bool trans_LDGM(DisasContext *s, arg_ldst_tag *a)
215
gen_helper_ldgm(tcg_rt, cpu_env, addr);
216
} else {
217
MMUAccessType acc = MMU_DATA_LOAD;
218
- int size = 4 << GMID_EL1_BS;
219
+ int size = 4 << s->gm_blocksize;
220
221
clean_addr = clean_data_tbi(s, addr);
222
tcg_gen_andi_i64(clean_addr, clean_addr, -size);
223
@@ -XXX,XX +XXX,XX @@ static void aarch64_tr_init_disas_context(DisasContextBase *dcbase,
224
dc->cp_regs = arm_cpu->cp_regs;
225
dc->features = env->features;
226
dc->dcz_blocksize = arm_cpu->dcz_blocksize;
227
+ dc->gm_blocksize = arm_cpu->gm_blocksize;
228
229
#ifdef CONFIG_USER_ONLY
230
/* In sve_probe_page, we assume TBI is enabled. */
93
--
231
--
94
2.20.1
232
2.34.1
95
96
diff view generated by jsdifflib
1
From: Richard Henderson <richard.henderson@linaro.org>
1
From: Richard Henderson <richard.henderson@linaro.org>
2
2
3
This fprintf+assert has been in place since the beginning.
3
Support all of the easy GM block sizes.
4
It is after to the fp_access_check, so we need to move the
4
Use direct memory operations, since the pointers are aligned.
5
check up. Fold that in to the pairwise filter.
5
6
While BS=2 (16 bytes, 1 tag) is a legal setting, that requires
7
an atomic store of one nibble. This is not difficult, but there
8
is also no point in supporting it until required.
9
10
Note that cortex-a710 sets GM blocksize to match its cacheline
11
size of 64 bytes. I expect many implementations will also
12
match the cacheline, which makes 16 bytes very unlikely.
6
13
7
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
14
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
8
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
9
Message-id: 20210604183506.916654-4-richard.henderson@linaro.org
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
15
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
16
Message-id: 20230811214031.171020-4-richard.henderson@linaro.org
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
17
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
---
18
---
13
target/arm/translate-a64.c | 82 +++++++++++++++++++++++---------------
19
target/arm/cpu.c | 18 +++++++++---
14
1 file changed, 50 insertions(+), 32 deletions(-)
20
target/arm/tcg/mte_helper.c | 56 +++++++++++++++++++++++++++++++------
21
2 files changed, 62 insertions(+), 12 deletions(-)
15
22
16
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
23
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
17
index XXXXXXX..XXXXXXX 100644
24
index XXXXXXX..XXXXXXX 100644
18
--- a/target/arm/translate-a64.c
25
--- a/target/arm/cpu.c
19
+++ b/target/arm/translate-a64.c
26
+++ b/target/arm/cpu.c
20
@@ -XXX,XX +XXX,XX @@ static void disas_simd_three_reg_same(DisasContext *s, uint32_t insn)
27
@@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
21
*/
28
ID_PFR1, VIRTUALIZATION, 0);
22
static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)
29
}
23
{
30
24
- int opcode, fpopcode;
31
+ if (cpu_isar_feature(aa64_mte, cpu)) {
25
- int is_q, u, a, rm, rn, rd;
32
+ /*
26
- int datasize, elements;
33
+ * The architectural range of GM blocksize is 2-6, however qemu
27
- int pass;
34
+ * doesn't support blocksize of 2 (see HELPER(ldgm)).
28
+ int opcode = extract32(insn, 11, 3);
35
+ */
29
+ int u = extract32(insn, 29, 1);
36
+ if (tcg_enabled()) {
30
+ int a = extract32(insn, 23, 1);
37
+ assert(cpu->gm_blocksize >= 3 && cpu->gm_blocksize <= 6);
31
+ int is_q = extract32(insn, 30, 1);
38
+ }
32
+ int rm = extract32(insn, 16, 5);
33
+ int rn = extract32(insn, 5, 5);
34
+ int rd = extract32(insn, 0, 5);
35
+ /*
36
+ * For these floating point ops, the U, a and opcode bits
37
+ * together indicate the operation.
38
+ */
39
+ int fpopcode = opcode | (a << 3) | (u << 4);
40
+ int datasize = is_q ? 128 : 64;
41
+ int elements = datasize / 16;
42
+ bool pairwise;
43
TCGv_ptr fpst;
44
- bool pairwise = false;
45
+ int pass;
46
+
39
+
47
+ switch (fpopcode) {
40
#ifndef CONFIG_USER_ONLY
48
+ case 0x0: /* FMAXNM */
41
- if (cpu->tag_memory == NULL && cpu_isar_feature(aa64_mte, cpu)) {
49
+ case 0x1: /* FMLA */
42
/*
50
+ case 0x2: /* FADD */
43
* Disable the MTE feature bits if we do not have tag-memory
51
+ case 0x3: /* FMULX */
44
* provided by the machine.
52
+ case 0x4: /* FCMEQ */
45
*/
53
+ case 0x6: /* FMAX */
46
- cpu->isar.id_aa64pfr1 =
54
+ case 0x7: /* FRECPS */
47
- FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 0);
55
+ case 0x8: /* FMINNM */
48
- }
56
+ case 0x9: /* FMLS */
49
+ if (cpu->tag_memory == NULL) {
57
+ case 0xa: /* FSUB */
50
+ cpu->isar.id_aa64pfr1 =
58
+ case 0xe: /* FMIN */
51
+ FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 0);
59
+ case 0xf: /* FRSQRTS */
52
+ }
60
+ case 0x13: /* FMUL */
53
#endif
61
+ case 0x14: /* FCMGE */
54
+ }
62
+ case 0x15: /* FACGE */
55
63
+ case 0x17: /* FDIV */
56
if (tcg_enabled()) {
64
+ case 0x1a: /* FABD */
57
/*
65
+ case 0x1c: /* FCMGT */
58
diff --git a/target/arm/tcg/mte_helper.c b/target/arm/tcg/mte_helper.c
66
+ case 0x1d: /* FACGT */
59
index XXXXXXX..XXXXXXX 100644
67
+ pairwise = false;
60
--- a/target/arm/tcg/mte_helper.c
61
+++ b/target/arm/tcg/mte_helper.c
62
@@ -XXX,XX +XXX,XX @@ uint64_t HELPER(ldgm)(CPUARMState *env, uint64_t ptr)
63
int gm_bs = env_archcpu(env)->gm_blocksize;
64
int gm_bs_bytes = 4 << gm_bs;
65
void *tag_mem;
66
+ uint64_t ret;
67
+ int shift;
68
69
ptr = QEMU_ALIGN_DOWN(ptr, gm_bs_bytes);
70
71
@@ -XXX,XX +XXX,XX @@ uint64_t HELPER(ldgm)(CPUARMState *env, uint64_t ptr)
72
73
/*
74
* The ordering of elements within the word corresponds to
75
- * a little-endian operation.
76
+ * a little-endian operation. Computation of shift comes from
77
+ *
78
+ * index = address<LOG2_TAG_GRANULE+3:LOG2_TAG_GRANULE>
79
+ * data<index*4+3:index*4> = tag
80
+ *
81
+ * Because of the alignment of ptr above, BS=6 has shift=0.
82
+ * All memory operations are aligned. Defer support for BS=2,
83
+ * requiring insertion or extraction of a nibble, until we
84
+ * support a cpu that requires it.
85
*/
86
switch (gm_bs) {
87
+ case 3:
88
+ /* 32 bytes -> 2 tags -> 8 result bits */
89
+ ret = *(uint8_t *)tag_mem;
68
+ break;
90
+ break;
69
+ case 0x10: /* FMAXNMP */
91
+ case 4:
70
+ case 0x12: /* FADDP */
92
+ /* 64 bytes -> 4 tags -> 16 result bits */
71
+ case 0x16: /* FMAXP */
93
+ ret = cpu_to_le16(*(uint16_t *)tag_mem);
72
+ case 0x18: /* FMINNMP */
73
+ case 0x1e: /* FMINP */
74
+ pairwise = true;
75
+ break;
94
+ break;
76
+ default:
95
+ case 5:
77
+ unallocated_encoding(s);
96
+ /* 128 bytes -> 8 tags -> 32 result bits */
78
+ return;
97
+ ret = cpu_to_le32(*(uint32_t *)tag_mem);
79
+ }
98
+ break;
80
99
case 6:
81
if (!dc_isar_feature(aa64_fp16, s)) {
100
/* 256 bytes -> 16 tags -> 64 result bits */
82
unallocated_encoding(s);
101
- return ldq_le_p(tag_mem);
83
@@ -XXX,XX +XXX,XX @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)
102
+ return cpu_to_le64(*(uint64_t *)tag_mem);
103
default:
104
- /* cpu configured with unsupported gm blocksize. */
105
+ /*
106
+ * CPU configured with unsupported/invalid gm blocksize.
107
+ * This is detected early in arm_cpu_realizefn.
108
+ */
109
g_assert_not_reached();
110
}
111
+ shift = extract64(ptr, LOG2_TAG_GRANULE, 4) * 4;
112
+ return ret << shift;
113
}
114
115
void HELPER(stgm)(CPUARMState *env, uint64_t ptr, uint64_t val)
116
@@ -XXX,XX +XXX,XX @@ void HELPER(stgm)(CPUARMState *env, uint64_t ptr, uint64_t val)
117
int gm_bs = env_archcpu(env)->gm_blocksize;
118
int gm_bs_bytes = 4 << gm_bs;
119
void *tag_mem;
120
+ int shift;
121
122
ptr = QEMU_ALIGN_DOWN(ptr, gm_bs_bytes);
123
124
@@ -XXX,XX +XXX,XX @@ void HELPER(stgm)(CPUARMState *env, uint64_t ptr, uint64_t val)
84
return;
125
return;
85
}
126
}
86
127
87
- /* For these floating point ops, the U, a and opcode bits
128
- /*
88
- * together indicate the operation.
129
- * The ordering of elements within the word corresponds to
130
- * a little-endian operation.
89
- */
131
- */
90
- opcode = extract32(insn, 11, 3);
132
+ /* See LDGM for comments on BS and on shift. */
91
- u = extract32(insn, 29, 1);
133
+ shift = extract64(ptr, LOG2_TAG_GRANULE, 4) * 4;
92
- a = extract32(insn, 23, 1);
134
+ val >>= shift;
93
- is_q = extract32(insn, 30, 1);
135
switch (gm_bs) {
94
- rm = extract32(insn, 16, 5);
136
+ case 3:
95
- rn = extract32(insn, 5, 5);
137
+ /* 32 bytes -> 2 tags -> 8 result bits */
96
- rd = extract32(insn, 0, 5);
138
+ *(uint8_t *)tag_mem = val;
97
-
139
+ break;
98
- fpopcode = opcode | (a << 3) | (u << 4);
140
+ case 4:
99
- datasize = is_q ? 128 : 64;
141
+ /* 64 bytes -> 4 tags -> 16 result bits */
100
- elements = datasize / 16;
142
+ *(uint16_t *)tag_mem = cpu_to_le16(val);
101
-
143
+ break;
102
- switch (fpopcode) {
144
+ case 5:
103
- case 0x10: /* FMAXNMP */
145
+ /* 128 bytes -> 8 tags -> 32 result bits */
104
- case 0x12: /* FADDP */
146
+ *(uint32_t *)tag_mem = cpu_to_le32(val);
105
- case 0x16: /* FMAXP */
147
+ break;
106
- case 0x18: /* FMINNMP */
148
case 6:
107
- case 0x1e: /* FMINP */
149
- stq_le_p(tag_mem, val);
108
- pairwise = true;
150
+ /* 256 bytes -> 16 tags -> 64 result bits */
109
- break;
151
+ *(uint64_t *)tag_mem = cpu_to_le64(val);
110
- }
152
break;
111
-
153
default:
112
fpst = fpstatus_ptr(FPST_FPCR_F16);
154
/* cpu configured with unsupported gm blocksize. */
113
114
if (pairwise) {
115
@@ -XXX,XX +XXX,XX @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)
116
gen_helper_advsimd_acgt_f16(tcg_res, tcg_op1, tcg_op2, fpst);
117
break;
118
default:
119
- fprintf(stderr, "%s: insn 0x%04x, fpop 0x%2x @ 0x%" PRIx64 "\n",
120
- __func__, insn, fpopcode, s->pc_curr);
121
g_assert_not_reached();
122
}
123
124
--
155
--
125
2.20.1
156
2.34.1
126
127
diff view generated by jsdifflib
1
Add the framework for decoding MVE insns, with the necessary new
1
From: Richard Henderson <richard.henderson@linaro.org>
2
files and the meson.build rules, but no actual content yet.
3
2
3
When the cpu support MTE, but the system does not, reduce cpu
4
support to user instructions at EL0 instead of completely
5
disabling MTE. If we encounter a cpu implementation which does
6
something else, we can revisit this setting.
7
8
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10
Message-id: 20230811214031.171020-5-richard.henderson@linaro.org
4
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6
Message-id: 20210614151007.4545-11-peter.maydell@linaro.org
7
---
12
---
8
target/arm/translate-a32.h | 1 +
13
target/arm/cpu.c | 7 ++++---
9
target/arm/mve.decode | 20 ++++++++++++++++++++
14
1 file changed, 4 insertions(+), 3 deletions(-)
10
target/arm/translate-mve.c | 29 +++++++++++++++++++++++++++++
11
target/arm/translate.c | 1 +
12
target/arm/meson.build | 2 ++
13
5 files changed, 53 insertions(+)
14
create mode 100644 target/arm/mve.decode
15
create mode 100644 target/arm/translate-mve.c
16
15
17
diff --git a/target/arm/translate-a32.h b/target/arm/translate-a32.h
16
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
18
index XXXXXXX..XXXXXXX 100644
17
index XXXXXXX..XXXXXXX 100644
19
--- a/target/arm/translate-a32.h
18
--- a/target/arm/cpu.c
20
+++ b/target/arm/translate-a32.h
19
+++ b/target/arm/cpu.c
21
@@ -XXX,XX +XXX,XX @@
20
@@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
22
21
23
/* Prototypes for autogenerated disassembler functions */
22
#ifndef CONFIG_USER_ONLY
24
bool disas_m_nocp(DisasContext *dc, uint32_t insn);
23
/*
25
+bool disas_mve(DisasContext *dc, uint32_t insn);
24
- * Disable the MTE feature bits if we do not have tag-memory
26
bool disas_vfp(DisasContext *s, uint32_t insn);
25
- * provided by the machine.
27
bool disas_vfp_uncond(DisasContext *s, uint32_t insn);
26
+ * If we do not have tag-memory provided by the machine,
28
bool disas_neon_dp(DisasContext *s, uint32_t insn);
27
+ * reduce MTE support to instructions enabled at EL0.
29
diff --git a/target/arm/mve.decode b/target/arm/mve.decode
28
+ * This matches Cortex-A710 BROADCASTMTE input being LOW.
30
new file mode 100644
29
*/
31
index XXXXXXX..XXXXXXX
30
if (cpu->tag_memory == NULL) {
32
--- /dev/null
31
cpu->isar.id_aa64pfr1 =
33
+++ b/target/arm/mve.decode
32
- FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 0);
34
@@ -XXX,XX +XXX,XX @@
33
+ FIELD_DP64(cpu->isar.id_aa64pfr1, ID_AA64PFR1, MTE, 1);
35
+# M-profile MVE instruction descriptions
34
}
36
+#
35
#endif
37
+# Copyright (c) 2021 Linaro, Ltd
38
+#
39
+# This library is free software; you can redistribute it and/or
40
+# modify it under the terms of the GNU Lesser General Public
41
+# License as published by the Free Software Foundation; either
42
+# version 2.1 of the License, or (at your option) any later version.
43
+#
44
+# This library is distributed in the hope that it will be useful,
45
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
46
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
47
+# Lesser General Public License for more details.
48
+#
49
+# You should have received a copy of the GNU Lesser General Public
50
+# License along with this library; if not, see <http://www.gnu.org/licenses/>.
51
+
52
+#
53
+# This file is processed by scripts/decodetree.py
54
+#
55
diff --git a/target/arm/translate-mve.c b/target/arm/translate-mve.c
56
new file mode 100644
57
index XXXXXXX..XXXXXXX
58
--- /dev/null
59
+++ b/target/arm/translate-mve.c
60
@@ -XXX,XX +XXX,XX @@
61
+/*
62
+ * ARM translation: M-profile MVE instructions
63
+ *
64
+ * Copyright (c) 2021 Linaro, Ltd.
65
+ *
66
+ * This library is free software; you can redistribute it and/or
67
+ * modify it under the terms of the GNU Lesser General Public
68
+ * License as published by the Free Software Foundation; either
69
+ * version 2.1 of the License, or (at your option) any later version.
70
+ *
71
+ * This library is distributed in the hope that it will be useful,
72
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
73
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74
+ * Lesser General Public License for more details.
75
+ *
76
+ * You should have received a copy of the GNU Lesser General Public
77
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
78
+ */
79
+
80
+#include "qemu/osdep.h"
81
+#include "tcg/tcg-op.h"
82
+#include "tcg/tcg-op-gvec.h"
83
+#include "exec/exec-all.h"
84
+#include "exec/gen-icount.h"
85
+#include "translate.h"
86
+#include "translate-a32.h"
87
+
88
+/* Include the generated decoder */
89
+#include "decode-mve.c.inc"
90
diff --git a/target/arm/translate.c b/target/arm/translate.c
91
index XXXXXXX..XXXXXXX 100644
92
--- a/target/arm/translate.c
93
+++ b/target/arm/translate.c
94
@@ -XXX,XX +XXX,XX @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn)
95
if (disas_t32(s, insn) ||
96
disas_vfp_uncond(s, insn) ||
97
disas_neon_shared(s, insn) ||
98
+ disas_mve(s, insn) ||
99
((insn >> 28) == 0xe && disas_vfp(s, insn))) {
100
return;
101
}
36
}
102
diff --git a/target/arm/meson.build b/target/arm/meson.build
103
index XXXXXXX..XXXXXXX 100644
104
--- a/target/arm/meson.build
105
+++ b/target/arm/meson.build
106
@@ -XXX,XX +XXX,XX @@ gen = [
107
decodetree.process('vfp.decode', extra_args: '--decode=disas_vfp'),
108
decodetree.process('vfp-uncond.decode', extra_args: '--decode=disas_vfp_uncond'),
109
decodetree.process('m-nocp.decode', extra_args: '--decode=disas_m_nocp'),
110
+ decodetree.process('mve.decode', extra_args: '--decode=disas_mve'),
111
decodetree.process('a32.decode', extra_args: '--static-decode=disas_a32'),
112
decodetree.process('a32-uncond.decode', extra_args: '--static-decode=disas_a32_uncond'),
113
decodetree.process('t32.decode', extra_args: '--static-decode=disas_t32'),
114
@@ -XXX,XX +XXX,XX @@ arm_ss.add(files(
115
'tlb_helper.c',
116
'translate.c',
117
'translate-m-nocp.c',
118
+ 'translate-mve.c',
119
'translate-neon.c',
120
'translate-vfp.c',
121
'vec_helper.c',
122
--
37
--
123
2.20.1
38
2.34.1
124
125
diff view generated by jsdifflib
1
From: Richard Henderson <richard.henderson@linaro.org>
1
From: Richard Henderson <richard.henderson@linaro.org>
2
2
3
The test was off-by-one, because tag_last points to the
3
Do not hard-code the constants for Neoverse V1.
4
last byte of the tag to check, thus tag_last - prev_page
5
will equal TARGET_PAGE_SIZE when we use the first byte
6
of the next page.
7
4
8
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/403
9
Reported-by: Peter Collingbourne <pcc@google.com>
10
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
5
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
11
Message-id: 20210612195707.840217-1-richard.henderson@linaro.org
12
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
7
Message-id: 20230811214031.171020-6-richard.henderson@linaro.org
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
---
9
---
15
target/arm/mte_helper.c | 2 +-
10
target/arm/tcg/cpu64.c | 48 ++++++++++++++++++++++++++++--------------
16
tests/tcg/aarch64/mte-7.c | 31 +++++++++++++++++++++++++++++++
11
1 file changed, 32 insertions(+), 16 deletions(-)
17
tests/tcg/aarch64/Makefile.target | 2 +-
18
3 files changed, 33 insertions(+), 2 deletions(-)
19
create mode 100644 tests/tcg/aarch64/mte-7.c
20
12
21
diff --git a/target/arm/mte_helper.c b/target/arm/mte_helper.c
13
diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c
22
index XXXXXXX..XXXXXXX 100644
14
index XXXXXXX..XXXXXXX 100644
23
--- a/target/arm/mte_helper.c
15
--- a/target/arm/tcg/cpu64.c
24
+++ b/target/arm/mte_helper.c
16
+++ b/target/arm/tcg/cpu64.c
25
@@ -XXX,XX +XXX,XX @@ static int mte_probe_int(CPUARMState *env, uint32_t desc, uint64_t ptr,
26
prev_page = ptr & TARGET_PAGE_MASK;
27
next_page = prev_page + TARGET_PAGE_SIZE;
28
29
- if (likely(tag_last - prev_page <= TARGET_PAGE_SIZE)) {
30
+ if (likely(tag_last - prev_page < TARGET_PAGE_SIZE)) {
31
/* Memory access stays on one page. */
32
tag_size = ((tag_byte_last - tag_byte_first) / (2 * TAG_GRANULE)) + 1;
33
mem1 = allocation_tag_mem(env, mmu_idx, ptr, type, sizem1 + 1,
34
diff --git a/tests/tcg/aarch64/mte-7.c b/tests/tcg/aarch64/mte-7.c
35
new file mode 100644
36
index XXXXXXX..XXXXXXX
37
--- /dev/null
38
+++ b/tests/tcg/aarch64/mte-7.c
39
@@ -XXX,XX +XXX,XX @@
17
@@ -XXX,XX +XXX,XX @@
40
+/*
18
#include "qemu/module.h"
41
+ * Memory tagging, unaligned access crossing pages.
19
#include "qapi/visitor.h"
42
+ * https://gitlab.com/qemu-project/qemu/-/issues/403
20
#include "hw/qdev-properties.h"
43
+ *
21
+#include "qemu/units.h"
44
+ * Copyright (c) 2021 Linaro Ltd
22
#include "internals.h"
45
+ * SPDX-License-Identifier: GPL-2.0-or-later
23
#include "cpregs.h"
46
+ */
24
47
+
25
+static uint64_t make_ccsidr64(unsigned assoc, unsigned linesize,
48
+#include "mte.h"
26
+ unsigned cachesize)
49
+
50
+int main(int ac, char **av)
51
+{
27
+{
52
+ void *p;
28
+ unsigned lg_linesize = ctz32(linesize);
53
+
29
+ unsigned sets;
54
+ enable_mte(PR_MTE_TCF_SYNC);
55
+ p = alloc_mte_mem(2 * 0x1000);
56
+
57
+ /* Tag the pointer. */
58
+ p = (void *)((unsigned long)p | (1ul << 56));
59
+
60
+ /* Store tag in sequential granules. */
61
+ asm("stg %0, [%0]" : : "r"(p + 0x0ff0));
62
+ asm("stg %0, [%0]" : : "r"(p + 0x1000));
63
+
30
+
64
+ /*
31
+ /*
65
+ * Perform an unaligned store with tag 1 crossing the pages.
32
+ * The 64-bit CCSIDR_EL1 format is:
66
+ * Failure dies with SIGSEGV.
33
+ * [55:32] number of sets - 1
34
+ * [23:3] associativity - 1
35
+ * [2:0] log2(linesize) - 4
36
+ * so 0 == 16 bytes, 1 == 32 bytes, 2 == 64 bytes, etc
67
+ */
37
+ */
68
+ asm("str %0, [%0]" : : "r"(p + 0x0ffc));
38
+ assert(assoc != 0);
69
+ return 0;
39
+ assert(is_power_of_2(linesize));
40
+ assert(lg_linesize >= 4 && lg_linesize <= 7 + 4);
41
+
42
+ /* sets * associativity * linesize == cachesize. */
43
+ sets = cachesize / (assoc * linesize);
44
+ assert(cachesize % (assoc * linesize) == 0);
45
+
46
+ return ((uint64_t)(sets - 1) << 32)
47
+ | ((assoc - 1) << 3)
48
+ | (lg_linesize - 4);
70
+}
49
+}
71
diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target
50
+
72
index XXXXXXX..XXXXXXX 100644
51
static void aarch64_a35_initfn(Object *obj)
73
--- a/tests/tcg/aarch64/Makefile.target
52
{
74
+++ b/tests/tcg/aarch64/Makefile.target
53
ARMCPU *cpu = ARM_CPU(obj);
75
@@ -XXX,XX +XXX,XX @@ AARCH64_TESTS += bti-2
54
@@ -XXX,XX +XXX,XX @@ static void aarch64_neoverse_v1_initfn(Object *obj)
76
55
* The Neoverse-V1 r1p2 TRM lists 32-bit format CCSIDR_EL1 values,
77
# MTE Tests
56
* but also says it implements CCIDX, which means they should be
78
ifneq ($(DOCKER_IMAGE)$(CROSS_CC_HAS_ARMV8_MTE),)
57
* 64-bit format. So we here use values which are based on the textual
79
-AARCH64_TESTS += mte-1 mte-2 mte-3 mte-4 mte-5 mte-6
58
- * information in chapter 2 of the TRM (and on the fact that
80
+AARCH64_TESTS += mte-1 mte-2 mte-3 mte-4 mte-5 mte-6 mte-7
59
- * sets * associativity * linesize == cachesize).
81
mte-%: CFLAGS += -march=armv8.5-a+memtag
60
- *
82
endif
61
- * The 64-bit CCSIDR_EL1 format is:
83
62
- * [55:32] number of sets - 1
63
- * [23:3] associativity - 1
64
- * [2:0] log2(linesize) - 4
65
- * so 0 == 16 bytes, 1 == 32 bytes, 2 == 64 bytes, etc
66
- *
67
- * L1: 4-way set associative 64-byte line size, total size 64K,
68
- * so sets is 256.
69
+ * information in chapter 2 of the TRM:
70
*
71
+ * L1: 4-way set associative 64-byte line size, total size 64K.
72
* L2: 8-way set associative, 64 byte line size, either 512K or 1MB.
73
- * We pick 1MB, so this has 2048 sets.
74
- *
75
* L3: No L3 (this matches the CLIDR_EL1 value).
76
*/
77
- cpu->ccsidr[0] = 0x000000ff0000001aull; /* 64KB L1 dcache */
78
- cpu->ccsidr[1] = 0x000000ff0000001aull; /* 64KB L1 icache */
79
- cpu->ccsidr[2] = 0x000007ff0000003aull; /* 1MB L2 cache */
80
+ cpu->ccsidr[0] = make_ccsidr64(4, 64, 64 * KiB); /* L1 dcache */
81
+ cpu->ccsidr[1] = cpu->ccsidr[0]; /* L1 icache */
82
+ cpu->ccsidr[2] = make_ccsidr64(8, 64, 1 * MiB); /* L2 cache */
83
84
/* From 3.2.115 SCTLR_EL3 */
85
cpu->reset_sctlr = 0x30c50838;
84
--
86
--
85
2.20.1
87
2.34.1
86
87
diff view generated by jsdifflib
1
Implement the MVE LCTP instruction.
1
From: Richard Henderson <richard.henderson@linaro.org>
2
2
3
We put its decode and implementation with the other
3
Access to many of the special registers is enabled or disabled
4
low-overhead-branch insns because although it is only present if MVE
4
by ACTLR_EL[23], which we implement as constant 0, which means
5
is implemented it is logically in the same group as the other LOB
5
that all writes outside EL3 should trap.
6
insns.
7
6
7
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
8
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
9
Message-id: 20230811214031.171020-7-richard.henderson@linaro.org
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
10
Message-id: 20210614151007.4545-7-peter.maydell@linaro.org
11
---
11
---
12
target/arm/t32.decode | 2 ++
12
target/arm/cpregs.h | 2 ++
13
target/arm/translate.c | 24 ++++++++++++++++++++++++
13
target/arm/helper.c | 4 ++--
14
2 files changed, 26 insertions(+)
14
target/arm/tcg/cpu64.c | 46 +++++++++++++++++++++++++++++++++---------
15
3 files changed, 41 insertions(+), 11 deletions(-)
15
16
16
diff --git a/target/arm/t32.decode b/target/arm/t32.decode
17
diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h
17
index XXXXXXX..XXXXXXX 100644
18
index XXXXXXX..XXXXXXX 100644
18
--- a/target/arm/t32.decode
19
--- a/target/arm/cpregs.h
19
+++ b/target/arm/t32.decode
20
+++ b/target/arm/cpregs.h
20
@@ -XXX,XX +XXX,XX @@ BL 1111 0. .......... 11.1 ............ @branch24
21
@@ -XXX,XX +XXX,XX @@ static inline void define_cortex_a72_a57_a53_cp_reginfo(ARMCPU *cpu) { }
21
DLS 1111 0 0000 100 rn:4 1110 0000 0000 0001
22
void define_cortex_a72_a57_a53_cp_reginfo(ARMCPU *cpu);
22
WLS 1111 0 0000 100 rn:4 1100 . .......... 1 imm=%lob_imm
23
#endif
23
LE 1111 0 0000 0 f:1 0 1111 1100 . .......... 1 imm=%lob_imm
24
25
+CPAccessResult access_tvm_trvm(CPUARMState *, const ARMCPRegInfo *, bool);
24
+
26
+
25
+ LCTP 1111 0 0000 000 1111 1110 0000 0000 0001
27
#endif /* TARGET_ARM_CPREGS_H */
26
]
28
diff --git a/target/arm/helper.c b/target/arm/helper.c
29
index XXXXXXX..XXXXXXX 100644
30
--- a/target/arm/helper.c
31
+++ b/target/arm/helper.c
32
@@ -XXX,XX +XXX,XX @@ static CPAccessResult access_tpm(CPUARMState *env, const ARMCPRegInfo *ri,
27
}
33
}
28
diff --git a/target/arm/translate.c b/target/arm/translate.c
34
35
/* Check for traps from EL1 due to HCR_EL2.TVM and HCR_EL2.TRVM. */
36
-static CPAccessResult access_tvm_trvm(CPUARMState *env, const ARMCPRegInfo *ri,
37
- bool isread)
38
+CPAccessResult access_tvm_trvm(CPUARMState *env, const ARMCPRegInfo *ri,
39
+ bool isread)
40
{
41
if (arm_current_el(env) == 1) {
42
uint64_t trap = isread ? HCR_TRVM : HCR_TVM;
43
diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c
29
index XXXXXXX..XXXXXXX 100644
44
index XXXXXXX..XXXXXXX 100644
30
--- a/target/arm/translate.c
45
--- a/target/arm/tcg/cpu64.c
31
+++ b/target/arm/translate.c
46
+++ b/target/arm/tcg/cpu64.c
32
@@ -XXX,XX +XXX,XX @@ static bool trans_LE(DisasContext *s, arg_LE *a)
47
@@ -XXX,XX +XXX,XX @@ static void aarch64_a64fx_initfn(Object *obj)
33
return true;
48
/* TODO: Add A64FX specific HPC extension registers */
34
}
49
}
35
50
36
+static bool trans_LCTP(DisasContext *s, arg_LCTP *a)
51
+static CPAccessResult access_actlr_w(CPUARMState *env, const ARMCPRegInfo *r,
52
+ bool read)
37
+{
53
+{
38
+ /*
54
+ if (!read) {
39
+ * M-profile Loop Clear with Tail Predication. Since our implementation
55
+ int el = arm_current_el(env);
40
+ * doesn't cache branch information, all we need to do is reset
41
+ * FPSCR.LTPSIZE to 4.
42
+ */
43
+ TCGv_i32 ltpsize;
44
+
56
+
45
+ if (!dc_isar_feature(aa32_lob, s) ||
57
+ /* Because ACTLR_EL2 is constant 0, writes below EL2 trap to EL2. */
46
+ !dc_isar_feature(aa32_mve, s)) {
58
+ if (el < 2 && arm_is_el2_enabled(env)) {
47
+ return false;
59
+ return CP_ACCESS_TRAP_EL2;
60
+ }
61
+ /* Because ACTLR_EL3 is constant 0, writes below EL3 trap to EL3. */
62
+ if (el < 3 && arm_feature(env, ARM_FEATURE_EL3)) {
63
+ return CP_ACCESS_TRAP_EL3;
64
+ }
48
+ }
65
+ }
49
+
66
+ return CP_ACCESS_OK;
50
+ if (!vfp_access_check(s)) {
51
+ return true;
52
+ }
53
+
54
+ ltpsize = tcg_const_i32(4);
55
+ store_cpu_field(ltpsize, v7m.ltpsize);
56
+ return true;
57
+}
67
+}
58
+
68
+
59
+
69
static const ARMCPRegInfo neoverse_n1_cp_reginfo[] = {
60
static bool op_tbranch(DisasContext *s, arg_tbranch *a, bool half)
70
{ .name = "ATCR_EL1", .state = ARM_CP_STATE_AA64,
61
{
71
.opc0 = 3, .opc1 = 0, .crn = 15, .crm = 7, .opc2 = 0,
62
TCGv_i32 addr, tmp;
72
- .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
73
+ .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0,
74
+ /* Traps and enables are the same as for TCR_EL1. */
75
+ .accessfn = access_tvm_trvm, .fgt = FGT_TCR_EL1, },
76
{ .name = "ATCR_EL2", .state = ARM_CP_STATE_AA64,
77
.opc0 = 3, .opc1 = 4, .crn = 15, .crm = 7, .opc2 = 0,
78
.access = PL2_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
79
@@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo neoverse_n1_cp_reginfo[] = {
80
.access = PL2_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
81
{ .name = "CPUACTLR_EL1", .state = ARM_CP_STATE_AA64,
82
.opc0 = 3, .opc1 = 0, .crn = 15, .crm = 1, .opc2 = 0,
83
- .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
84
+ .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0,
85
+ .accessfn = access_actlr_w },
86
{ .name = "CPUACTLR2_EL1", .state = ARM_CP_STATE_AA64,
87
.opc0 = 3, .opc1 = 0, .crn = 15, .crm = 1, .opc2 = 1,
88
- .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
89
+ .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0,
90
+ .accessfn = access_actlr_w },
91
{ .name = "CPUACTLR3_EL1", .state = ARM_CP_STATE_AA64,
92
.opc0 = 3, .opc1 = 0, .crn = 15, .crm = 1, .opc2 = 2,
93
- .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
94
+ .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0,
95
+ .accessfn = access_actlr_w },
96
/*
97
* Report CPUCFR_EL1.SCU as 1, as we do not implement the DSU
98
* (and in particular its system registers).
99
@@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo neoverse_n1_cp_reginfo[] = {
100
.access = PL1_R, .type = ARM_CP_CONST, .resetvalue = 4 },
101
{ .name = "CPUECTLR_EL1", .state = ARM_CP_STATE_AA64,
102
.opc0 = 3, .opc1 = 0, .crn = 15, .crm = 1, .opc2 = 4,
103
- .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0x961563010 },
104
+ .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0x961563010,
105
+ .accessfn = access_actlr_w },
106
{ .name = "CPUPCR_EL3", .state = ARM_CP_STATE_AA64,
107
.opc0 = 3, .opc1 = 6, .crn = 15, .crm = 8, .opc2 = 1,
108
.access = PL3_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
109
@@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo neoverse_n1_cp_reginfo[] = {
110
.access = PL3_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
111
{ .name = "CPUPWRCTLR_EL1", .state = ARM_CP_STATE_AA64,
112
.opc0 = 3, .opc1 = 0, .crn = 15, .crm = 2, .opc2 = 7,
113
- .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
114
+ .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0,
115
+ .accessfn = access_actlr_w },
116
{ .name = "ERXPFGCDN_EL1", .state = ARM_CP_STATE_AA64,
117
.opc0 = 3, .opc1 = 0, .crn = 15, .crm = 2, .opc2 = 2,
118
- .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
119
+ .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0,
120
+ .accessfn = access_actlr_w },
121
{ .name = "ERXPFGCTL_EL1", .state = ARM_CP_STATE_AA64,
122
.opc0 = 3, .opc1 = 0, .crn = 15, .crm = 2, .opc2 = 1,
123
- .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
124
+ .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0,
125
+ .accessfn = access_actlr_w },
126
{ .name = "ERXPFGF_EL1", .state = ARM_CP_STATE_AA64,
127
.opc0 = 3, .opc1 = 0, .crn = 15, .crm = 2, .opc2 = 0,
128
- .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
129
+ .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0,
130
+ .accessfn = access_actlr_w },
131
};
132
133
static void define_neoverse_n1_cp_reginfo(ARMCPU *cpu)
63
--
134
--
64
2.20.1
135
2.34.1
65
66
diff view generated by jsdifflib
1
From: Patrick Venture <venture@google.com>
1
From: Richard Henderson <richard.henderson@linaro.org>
2
2
3
Adds the pca954x muxes expected.
3
There is only one additional EL1 register modeled, which
4
also needs to use access_actlr_w.
4
5
5
Tested: Booted quanta-q71l image to userspace.
6
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
Signed-off-by: Patrick Venture <venture@google.com>
7
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
7
Reviewed-by: Hao Wu <wuhaotsh@google.com>
8
Message-id: 20230811214031.171020-8-richard.henderson@linaro.org
8
Reviewed-by: Joel Stanley <joel@jms.id.au>
9
Reviewed-by: Cédric Le Goater <clg@kaod.org>
10
Message-id: 20210608202522.2677850-4-venture@google.com
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
---
10
---
13
hw/arm/aspeed.c | 11 ++++++++---
11
target/arm/tcg/cpu64.c | 3 ++-
14
hw/arm/Kconfig | 1 +
12
1 file changed, 2 insertions(+), 1 deletion(-)
15
2 files changed, 9 insertions(+), 3 deletions(-)
16
13
17
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
14
diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c
18
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
19
--- a/hw/arm/aspeed.c
16
--- a/target/arm/tcg/cpu64.c
20
+++ b/hw/arm/aspeed.c
17
+++ b/target/arm/tcg/cpu64.c
21
@@ -XXX,XX +XXX,XX @@
18
@@ -XXX,XX +XXX,XX @@ static void define_neoverse_n1_cp_reginfo(ARMCPU *cpu)
22
#include "hw/arm/boot.h"
19
static const ARMCPRegInfo neoverse_v1_cp_reginfo[] = {
23
#include "hw/arm/aspeed.h"
20
{ .name = "CPUECTLR2_EL1", .state = ARM_CP_STATE_AA64,
24
#include "hw/arm/aspeed_soc.h"
21
.opc0 = 3, .opc1 = 0, .crn = 15, .crm = 1, .opc2 = 5,
25
+#include "hw/i2c/i2c_mux_pca954x.h"
22
- .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
26
#include "hw/i2c/smbus_eeprom.h"
23
+ .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0,
27
#include "hw/misc/pca9552.h"
24
+ .accessfn = access_actlr_w },
28
#include "hw/misc/tmp105.h"
25
{ .name = "CPUPPMCR_EL3", .state = ARM_CP_STATE_AA64,
29
@@ -XXX,XX +XXX,XX @@ static void quanta_q71l_bmc_i2c_init(AspeedMachineState *bmc)
26
.opc0 = 3, .opc1 = 6, .crn = 15, .crm = 2, .opc2 = 0,
30
/* TODO: i2c-1: Add Frontpanel FRU eeprom@57 24c64 */
27
.access = PL3_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
31
/* TODO: Add Memory Riser i2c mux and eeproms. */
32
33
- /* TODO: i2c-2: pca9546@74 */
34
- /* TODO: i2c-2: pca9548@77 */
35
+ i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "pca9546", 0x74);
36
+ i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 2), "pca9548", 0x77);
37
+
38
/* TODO: i2c-3: Add BIOS FRU eeprom@56 24c64 */
39
- /* TODO: i2c-7: Add pca9546@70 */
40
+
41
+ /* i2c-7 */
42
+ i2c_slave_create_simple(aspeed_i2c_get_bus(&soc->i2c, 7), "pca9546", 0x70);
43
/* - i2c@0: pmbus@59 */
44
/* - i2c@1: pmbus@58 */
45
/* - i2c@2: pmbus@58 */
46
/* - i2c@3: pmbus@59 */
47
+
48
/* TODO: i2c-7: Add PDB FRU eeprom@52 */
49
/* TODO: i2c-8: Add BMC FRU eeprom@50 */
50
}
51
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
52
index XXXXXXX..XXXXXXX 100644
53
--- a/hw/arm/Kconfig
54
+++ b/hw/arm/Kconfig
55
@@ -XXX,XX +XXX,XX @@ config ASPEED_SOC
56
select PCA9552
57
select SERIAL
58
select SMBUS_EEPROM
59
+ select PCA954X
60
select SSI
61
select SSI_M25P80
62
select TMP105
63
--
28
--
64
2.20.1
29
2.34.1
65
66
diff view generated by jsdifflib
1
From: Richard Henderson <richard.henderson@linaro.org>
1
From: Richard Henderson <richard.henderson@linaro.org>
2
2
3
The default of this switch is truly unreachable.
3
Like FEAT_TRF (Self-hosted Trace Extension), suppress tracing
4
The switch selector is 3 bits, and all 8 cases are present.
4
external to the cpu, which is out of scope for QEMU.
5
5
6
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
7
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8
Message-id: 20210604183506.916654-3-richard.henderson@linaro.org
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
7
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
8
Message-id: 20230811214031.171020-10-richard.henderson@linaro.org
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
10
---
12
target/arm/translate-a64.c | 1 -
11
target/arm/cpu.c | 3 +++
13
1 file changed, 1 deletion(-)
12
1 file changed, 3 insertions(+)
14
13
15
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
14
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
16
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
17
--- a/target/arm/translate-a64.c
16
--- a/target/arm/cpu.c
18
+++ b/target/arm/translate-a64.c
17
+++ b/target/arm/cpu.c
19
@@ -XXX,XX +XXX,XX @@ static void disas_simd_mod_imm(DisasContext *s, uint32_t insn)
18
@@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
20
}
19
/* FEAT_SPE (Statistical Profiling Extension) */
21
break;
20
cpu->isar.id_aa64dfr0 =
22
default:
21
FIELD_DP64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, PMSVER, 0);
23
- fprintf(stderr, "%s: cmode_3_1: %x\n", __func__, cmode_3_1);
22
+ /* FEAT_TRBE (Trace Buffer Extension) */
24
g_assert_not_reached();
23
+ cpu->isar.id_aa64dfr0 =
25
}
24
+ FIELD_DP64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, TRACEBUFFER, 0);
26
25
/* FEAT_TRF (Self-hosted Trace Extension) */
26
cpu->isar.id_aa64dfr0 =
27
FIELD_DP64(cpu->isar.id_aa64dfr0, ID_AA64DFR0, TRACEFILT, 0);
27
--
28
--
28
2.20.1
29
2.34.1
29
30
diff view generated by jsdifflib
1
From: Richard Henderson <richard.henderson@linaro.org>
1
From: Richard Henderson <richard.henderson@linaro.org>
2
2
3
This fprintf+assert has been in place since the beginning.
3
This feature allows the operating system to set TCR_ELx.HWU*
4
It is prior to the fp_access_check, so we're still good to
4
to allow the implementation to use the PBHA bits from the
5
raise sigill here.
5
block and page descriptors for for IMPLEMENTATION DEFINED
6
purposes. Since QEMU has no need to use these bits, we may
7
simply ignore them.
6
8
7
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/381
8
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
9
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
10
Message-id: 20210604183506.916654-2-richard.henderson@linaro.org
11
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
11
Message-id: 20230811214031.171020-11-richard.henderson@linaro.org
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
---
13
---
14
target/arm/translate-a64.c | 4 ++--
14
docs/system/arm/emulation.rst | 1 +
15
1 file changed, 2 insertions(+), 2 deletions(-)
15
target/arm/tcg/cpu32.c | 2 +-
16
target/arm/tcg/cpu64.c | 2 +-
17
3 files changed, 3 insertions(+), 2 deletions(-)
16
18
17
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
19
diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst
18
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
19
--- a/target/arm/translate-a64.c
21
--- a/docs/system/arm/emulation.rst
20
+++ b/target/arm/translate-a64.c
22
+++ b/docs/system/arm/emulation.rst
21
@@ -XXX,XX +XXX,XX @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)
23
@@ -XXX,XX +XXX,XX @@ the following architecture extensions:
22
case 0x7f: /* FSQRT (vector) */
24
- FEAT_HAFDBS (Hardware management of the access flag and dirty bit state)
23
break;
25
- FEAT_HCX (Support for the HCRX_EL2 register)
24
default:
26
- FEAT_HPDS (Hierarchical permission disables)
25
- fprintf(stderr, "%s: insn 0x%04x fpop 0x%2x\n", __func__, insn, fpop);
27
+- FEAT_HPDS2 (Translation table page-based hardware attributes)
26
- g_assert_not_reached();
28
- FEAT_I8MM (AArch64 Int8 matrix multiplication instructions)
27
+ unallocated_encoding(s);
29
- FEAT_IDST (ID space trap handling)
28
+ return;
30
- FEAT_IESB (Implicit error synchronization event)
29
}
31
diff --git a/target/arm/tcg/cpu32.c b/target/arm/tcg/cpu32.c
30
32
index XXXXXXX..XXXXXXX 100644
31
33
--- a/target/arm/tcg/cpu32.c
34
+++ b/target/arm/tcg/cpu32.c
35
@@ -XXX,XX +XXX,XX @@ void aa32_max_features(ARMCPU *cpu)
36
cpu->isar.id_mmfr3 = t;
37
38
t = cpu->isar.id_mmfr4;
39
- t = FIELD_DP32(t, ID_MMFR4, HPDS, 1); /* FEAT_AA32HPD */
40
+ t = FIELD_DP32(t, ID_MMFR4, HPDS, 2); /* FEAT_HPDS2 */
41
t = FIELD_DP32(t, ID_MMFR4, AC2, 1); /* ACTLR2, HACTLR2 */
42
t = FIELD_DP32(t, ID_MMFR4, CNP, 1); /* FEAT_TTCNP */
43
t = FIELD_DP32(t, ID_MMFR4, XNX, 1); /* FEAT_XNX */
44
diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c
45
index XXXXXXX..XXXXXXX 100644
46
--- a/target/arm/tcg/cpu64.c
47
+++ b/target/arm/tcg/cpu64.c
48
@@ -XXX,XX +XXX,XX @@ void aarch64_max_tcg_initfn(Object *obj)
49
t = FIELD_DP64(t, ID_AA64MMFR1, HAFDBS, 2); /* FEAT_HAFDBS */
50
t = FIELD_DP64(t, ID_AA64MMFR1, VMIDBITS, 2); /* FEAT_VMID16 */
51
t = FIELD_DP64(t, ID_AA64MMFR1, VH, 1); /* FEAT_VHE */
52
- t = FIELD_DP64(t, ID_AA64MMFR1, HPDS, 1); /* FEAT_HPDS */
53
+ t = FIELD_DP64(t, ID_AA64MMFR1, HPDS, 2); /* FEAT_HPDS2 */
54
t = FIELD_DP64(t, ID_AA64MMFR1, LO, 1); /* FEAT_LOR */
55
t = FIELD_DP64(t, ID_AA64MMFR1, PAN, 3); /* FEAT_PAN3 */
56
t = FIELD_DP64(t, ID_AA64MMFR1, XNX, 1); /* FEAT_XNX */
32
--
57
--
33
2.20.1
58
2.34.1
34
35
diff view generated by jsdifflib
1
From: Patrick Venture <venture@google.com>
1
From: Alex Bennée <alex.bennee@linaro.org>
2
2
3
Tested: Quanta-gsj firmware booted.
3
This is a mandatory feature for Armv8.1 architectures but we don't
4
state the feature clearly in our emulation list. Also include
5
FEAT_CRC32 comment in aarch64_max_tcg_initfn for ease of grepping.
4
6
5
i2c /dev entries driver
7
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6
I2C init bus 1 freq 100000
8
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
7
I2C init bus 2 freq 100000
9
Message-id: 20230824075406.1515566-1-alex.bennee@linaro.org
8
I2C init bus 3 freq 100000
10
Cc: qemu-stable@nongnu.org
9
I2C init bus 4 freq 100000
11
Message-Id: <20230222110104.3996971-1-alex.bennee@linaro.org>
10
I2C init bus 8 freq 100000
12
[PMM: pluralize 'instructions' in docs]
11
I2C init bus 9 freq 100000
12
at24 9-0055: 8192 byte 24c64 EEPROM, writable, 1 bytes/write
13
I2C init bus 10 freq 100000
14
at24 10-0055: 8192 byte 24c64 EEPROM, writable, 1 bytes/write
15
I2C init bus 12 freq 100000
16
I2C init bus 15 freq 100000
17
i2c i2c-15: Added multiplexed i2c bus 16
18
i2c i2c-15: Added multiplexed i2c bus 17
19
i2c i2c-15: Added multiplexed i2c bus 18
20
i2c i2c-15: Added multiplexed i2c bus 19
21
i2c i2c-15: Added multiplexed i2c bus 20
22
i2c i2c-15: Added multiplexed i2c bus 21
23
i2c i2c-15: Added multiplexed i2c bus 22
24
i2c i2c-15: Added multiplexed i2c bus 23
25
pca954x 15-0075: registered 8 multiplexed busses for I2C switch pca9548
26
27
Signed-off-by: Patrick Venture <venture@google.com>
28
Reviewed-by: Hao Wu <wuhaotsh@google.com>
29
Reviewed-by: Joel Stanley <joel@jms.id.au>
30
Message-id: 20210608202522.2677850-3-venture@google.com
31
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
32
---
14
---
33
hw/arm/npcm7xx_boards.c | 6 ++----
15
docs/system/arm/emulation.rst | 1 +
34
hw/arm/Kconfig | 1 +
16
target/arm/tcg/cpu64.c | 2 +-
35
2 files changed, 3 insertions(+), 4 deletions(-)
17
2 files changed, 2 insertions(+), 1 deletion(-)
36
18
37
diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c
19
diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst
38
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
39
--- a/hw/arm/npcm7xx_boards.c
21
--- a/docs/system/arm/emulation.rst
40
+++ b/hw/arm/npcm7xx_boards.c
22
+++ b/docs/system/arm/emulation.rst
41
@@ -XXX,XX +XXX,XX @@
23
@@ -XXX,XX +XXX,XX @@ the following architecture extensions:
42
24
- FEAT_BBM at level 2 (Translation table break-before-make levels)
43
#include "hw/arm/npcm7xx.h"
25
- FEAT_BF16 (AArch64 BFloat16 instructions)
44
#include "hw/core/cpu.h"
26
- FEAT_BTI (Branch Target Identification)
45
+#include "hw/i2c/i2c_mux_pca954x.h"
27
+- FEAT_CRC32 (CRC32 instructions)
46
#include "hw/i2c/smbus_eeprom.h"
28
- FEAT_CSV2 (Cache speculation variant 2)
47
#include "hw/loader.h"
29
- FEAT_CSV2_1p1 (Cache speculation variant 2, version 1.1)
48
#include "hw/qdev-core.h"
30
- FEAT_CSV2_1p2 (Cache speculation variant 2, version 1.2)
49
@@ -XXX,XX +XXX,XX @@ static void quanta_gsj_i2c_init(NPCM7xxState *soc)
31
diff --git a/target/arm/tcg/cpu64.c b/target/arm/tcg/cpu64.c
50
* - ucd90160@6b
51
*/
52
53
- /*
54
- * i2c-15:
55
- * - pca9548@75
56
- */
57
+ i2c_slave_create_simple(npcm7xx_i2c_get_bus(soc, 15), "pca9548", 0x75);
58
}
59
60
static void quanta_gsj_fan_init(NPCM7xxMachine *machine, NPCM7xxState *soc)
61
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
62
index XXXXXXX..XXXXXXX 100644
32
index XXXXXXX..XXXXXXX 100644
63
--- a/hw/arm/Kconfig
33
--- a/target/arm/tcg/cpu64.c
64
+++ b/hw/arm/Kconfig
34
+++ b/target/arm/tcg/cpu64.c
65
@@ -XXX,XX +XXX,XX @@ config NPCM7XX
35
@@ -XXX,XX +XXX,XX @@ void aarch64_max_tcg_initfn(Object *obj)
66
select SERIAL
36
t = FIELD_DP64(t, ID_AA64ISAR0, AES, 2); /* FEAT_PMULL */
67
select SSI
37
t = FIELD_DP64(t, ID_AA64ISAR0, SHA1, 1); /* FEAT_SHA1 */
68
select UNIMP
38
t = FIELD_DP64(t, ID_AA64ISAR0, SHA2, 2); /* FEAT_SHA512 */
69
+ select PCA954X
39
- t = FIELD_DP64(t, ID_AA64ISAR0, CRC32, 1);
70
40
+ t = FIELD_DP64(t, ID_AA64ISAR0, CRC32, 1); /* FEAT_CRC32 */
71
config FSL_IMX25
41
t = FIELD_DP64(t, ID_AA64ISAR0, ATOMIC, 2); /* FEAT_LSE */
72
bool
42
t = FIELD_DP64(t, ID_AA64ISAR0, RDM, 1); /* FEAT_RDM */
43
t = FIELD_DP64(t, ID_AA64ISAR0, SHA3, 1); /* FEAT_SHA3 */
73
--
44
--
74
2.20.1
45
2.34.1
75
46
76
47
diff view generated by jsdifflib
1
From: Jean-Philippe Brucker <jean-philippe@linaro.org>
1
From: Jean-Christophe Dubois <jcd@tribudubois.net>
2
2
3
Commit 382c7160d1cd ("hw/intc/arm_gicv3_cpuif: Fix EOIR write access
3
i.MX7 IOMUX GPR device is not equivalent to i.MX6UL IOMUXC GPR device.
4
check logic") added an assert_not_reached() if the guest writes the EOIR
4
In particular, register 22 is not present on i.MX6UL and this is actualy
5
register while no interrupt is active.
5
The only register that is really emulated in the i.MX7 IOMUX GPR device.
6
6
7
It turns out some software does this: EDK2, in
7
Note: The i.MX6UL code is actually also implementing the IOMUX GPR device
8
GicV3ExitBootServicesEvent(), unconditionally write EOIR for all
8
as an unimplemented device at the same bus adress and the 2 instantiations
9
interrupts that it manages. This now causes QEMU to abort when running
9
were actualy colliding. So we go back to the unimplemented device for now.
10
UEFI on a VM with GICv3. Although it is UNPREDICTABLE behavior and EDK2
11
does need fixing, the punishment seems a little harsh, especially since
12
icc_eoir_write() already tolerates writes of nonexistent interrupt
13
numbers. Display a guest error and tolerate spurious EOIR writes.
14
10
15
Fixes: 382c7160d1cd ("hw/intc/arm_gicv3_cpuif: Fix EOIR write access check logic")
11
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
16
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
12
Message-id: 48681bf51ee97646479bb261bee19abebbc8074e.1692964892.git.jcd@tribudubois.net
17
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
18
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
19
Tested-by: Alex Bennée <alex.bennee@linaro.org>
20
Message-id: 20210604130352.1887560-1-jean-philippe@linaro.org
21
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
13
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
22
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
23
---
15
---
24
hw/intc/arm_gicv3_cpuif.c | 5 ++++-
16
include/hw/arm/fsl-imx6ul.h | 2 --
25
1 file changed, 4 insertions(+), 1 deletion(-)
17
hw/arm/fsl-imx6ul.c | 11 -----------
18
2 files changed, 13 deletions(-)
26
19
27
diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c
20
diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h
28
index XXXXXXX..XXXXXXX 100644
21
index XXXXXXX..XXXXXXX 100644
29
--- a/hw/intc/arm_gicv3_cpuif.c
22
--- a/include/hw/arm/fsl-imx6ul.h
30
+++ b/hw/intc/arm_gicv3_cpuif.c
23
+++ b/include/hw/arm/fsl-imx6ul.h
31
@@ -XXX,XX +XXX,XX @@
24
@@ -XXX,XX +XXX,XX @@
32
25
#include "hw/misc/imx6ul_ccm.h"
33
#include "qemu/osdep.h"
26
#include "hw/misc/imx6_src.h"
34
#include "qemu/bitops.h"
27
#include "hw/misc/imx7_snvs.h"
35
+#include "qemu/log.h"
28
-#include "hw/misc/imx7_gpr.h"
36
#include "qemu/main-loop.h"
29
#include "hw/intc/imx_gpcv2.h"
37
#include "trace.h"
30
#include "hw/watchdog/wdt_imx2.h"
38
#include "gicv3_internal.h"
31
#include "hw/gpio/imx_gpio.h"
39
@@ -XXX,XX +XXX,XX @@ static void icc_eoir_write(CPUARMState *env, const ARMCPRegInfo *ri,
32
@@ -XXX,XX +XXX,XX @@ struct FslIMX6ULState {
40
}
33
IMX6SRCState src;
41
break;
34
IMX7SNVSState snvs;
42
default:
35
IMXGPCv2State gpcv2;
43
- g_assert_not_reached();
36
- IMX7GPRState gpr;
44
+ qemu_log_mask(LOG_GUEST_ERROR,
37
IMXSPIState spi[FSL_IMX6UL_NUM_ECSPIS];
45
+ "%s: IRQ %d isn't active\n", __func__, irq);
38
IMXI2CState i2c[FSL_IMX6UL_NUM_I2CS];
46
+ return;
39
IMXSerialState uart[FSL_IMX6UL_NUM_UARTS];
40
diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c
41
index XXXXXXX..XXXXXXX 100644
42
--- a/hw/arm/fsl-imx6ul.c
43
+++ b/hw/arm/fsl-imx6ul.c
44
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_init(Object *obj)
45
*/
46
object_initialize_child(obj, "snvs", &s->snvs, TYPE_IMX7_SNVS);
47
48
- /*
49
- * GPR
50
- */
51
- object_initialize_child(obj, "gpr", &s->gpr, TYPE_IMX7_GPR);
52
-
53
/*
54
* GPIOs 1 to 5
55
*/
56
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
57
FSL_IMX6UL_WDOGn_IRQ[i]));
47
}
58
}
48
59
49
icc_drop_prio(cs, grp);
60
- /*
61
- * GPR
62
- */
63
- sysbus_realize(SYS_BUS_DEVICE(&s->gpr), &error_abort);
64
- sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpr), 0, FSL_IMX6UL_IOMUXC_GPR_ADDR);
65
-
66
/*
67
* SDMA
68
*/
50
--
69
--
51
2.20.1
70
2.34.1
52
53
diff view generated by jsdifflib
1
From: Patrick Venture <venture@google.com>
1
From: Jean-Christophe Dubois <jcd@tribudubois.net>
2
2
3
Adds initial quanta-gbs-bmc machine support.
3
* Add Addr and size definition for most i.MX6UL devices in i.MX6UL header file.
4
* Use those newly defined named constants whenever possible.
5
* Standardize the way we init a familly of unimplemented devices
6
- SAI
7
- PWM
8
- CAN
9
* Add/rework few comments
4
10
5
Tested: Boots to userspace.
11
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
6
Signed-off-by: Patrick Venture <venture@google.com>
12
Message-id: d579043fbd4e4b490370783fda43fc02c8e9be75.1692964892.git.jcd@tribudubois.net
7
Reviewed-by: Brandon Kim <brandonkim@google.com>
8
Reviewed-by: Hao Wu <wuhaotsh@google.com>
9
Message-id: 20210608193605.2611114-2-venture@google.com
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
13
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
---
15
---
13
hw/arm/npcm7xx_boards.c | 33 +++++++++++++++++++++++++++++++++
16
include/hw/arm/fsl-imx6ul.h | 156 +++++++++++++++++++++++++++++++-----
14
1 file changed, 33 insertions(+)
17
hw/arm/fsl-imx6ul.c | 147 ++++++++++++++++++++++-----------
18
2 files changed, 232 insertions(+), 71 deletions(-)
15
19
16
diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c
20
diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h
17
index XXXXXXX..XXXXXXX 100644
21
index XXXXXXX..XXXXXXX 100644
18
--- a/hw/arm/npcm7xx_boards.c
22
--- a/include/hw/arm/fsl-imx6ul.h
19
+++ b/hw/arm/npcm7xx_boards.c
23
+++ b/include/hw/arm/fsl-imx6ul.h
20
@@ -XXX,XX +XXX,XX @@
24
@@ -XXX,XX +XXX,XX @@
21
25
#include "exec/memory.h"
22
#define NPCM750_EVB_POWER_ON_STRAPS 0x00001ff7
26
#include "cpu.h"
23
#define QUANTA_GSJ_POWER_ON_STRAPS 0x00001fff
27
#include "qom/object.h"
24
+#define QUANTA_GBS_POWER_ON_STRAPS 0x000017ff
28
+#include "qemu/units.h"
25
29
26
static const char npcm7xx_default_bootrom[] = "npcm7xx_bootrom.bin";
30
#define TYPE_FSL_IMX6UL "fsl-imx6ul"
27
31
OBJECT_DECLARE_SIMPLE_TYPE(FslIMX6ULState, FSL_IMX6UL)
28
@@ -XXX,XX +XXX,XX @@ static void quanta_gsj_init(MachineState *machine)
32
@@ -XXX,XX +XXX,XX @@ enum FslIMX6ULConfiguration {
29
npcm7xx_load_kernel(machine, soc);
33
FSL_IMX6UL_NUM_ADCS = 2,
30
}
34
FSL_IMX6UL_NUM_USB_PHYS = 2,
31
35
FSL_IMX6UL_NUM_USBS = 2,
32
+static void quanta_gbs_init(MachineState *machine)
36
+ FSL_IMX6UL_NUM_SAIS = 3,
33
+{
37
+ FSL_IMX6UL_NUM_CANS = 2,
34
+ NPCM7xxState *soc;
38
+ FSL_IMX6UL_NUM_PWMS = 4,
35
+
36
+ soc = npcm7xx_create_soc(machine, QUANTA_GBS_POWER_ON_STRAPS);
37
+ npcm7xx_connect_dram(soc, machine->ram);
38
+ qdev_realize(DEVICE(soc), NULL, &error_fatal);
39
+
40
+ npcm7xx_load_bootrom(machine, soc);
41
+
42
+ npcm7xx_connect_flash(&soc->fiu[0], 0, "mx66u51235f",
43
+ drive_get(IF_MTD, 0, 0));
44
+
45
+ npcm7xx_load_kernel(machine, soc);
46
+}
47
+
48
static void npcm7xx_set_soc_type(NPCM7xxMachineClass *nmc, const char *type)
49
{
50
NPCM7xxClass *sc = NPCM7XX_CLASS(object_class_by_name(type));
51
@@ -XXX,XX +XXX,XX @@ static void gsj_machine_class_init(ObjectClass *oc, void *data)
52
mc->default_ram_size = 512 * MiB;
53
};
39
};
54
40
55
+static void gbs_bmc_machine_class_init(ObjectClass *oc, void *data)
41
struct FslIMX6ULState {
56
+{
42
@@ -XXX,XX +XXX,XX @@ struct FslIMX6ULState {
57
+ NPCM7xxMachineClass *nmc = NPCM7XX_MACHINE_CLASS(oc);
43
58
+ MachineClass *mc = MACHINE_CLASS(oc);
44
enum FslIMX6ULMemoryMap {
59
+
45
FSL_IMX6UL_MMDC_ADDR = 0x80000000,
60
+ npcm7xx_set_soc_type(nmc, TYPE_NPCM730);
46
- FSL_IMX6UL_MMDC_SIZE = 2 * 1024 * 1024 * 1024UL,
61
+
47
+ FSL_IMX6UL_MMDC_SIZE = (2 * GiB),
62
+ mc->desc = "Quanta GBS (Cortex-A9)";
48
63
+ mc->init = quanta_gbs_init;
49
FSL_IMX6UL_QSPI1_MEM_ADDR = 0x60000000,
64
+ mc->default_ram_size = 1 * GiB;
50
- FSL_IMX6UL_EIM_ALIAS_ADDR = 0x58000000,
65
+}
51
- FSL_IMX6UL_EIM_CS_ADDR = 0x50000000,
66
+
52
- FSL_IMX6UL_AES_ENCRYPT_ADDR = 0x10000000,
67
static const TypeInfo npcm7xx_machine_types[] = {
53
- FSL_IMX6UL_QSPI1_RX_ADDR = 0x0C000000,
68
{
54
+ FSL_IMX6UL_QSPI1_MEM_SIZE = (256 * MiB),
69
.name = TYPE_NPCM7XX_MACHINE,
55
70
@@ -XXX,XX +XXX,XX @@ static const TypeInfo npcm7xx_machine_types[] = {
56
- /* AIPS-2 */
71
.name = MACHINE_TYPE_NAME("quanta-gsj"),
57
+ FSL_IMX6UL_EIM_ALIAS_ADDR = 0x58000000,
72
.parent = TYPE_NPCM7XX_MACHINE,
58
+ FSL_IMX6UL_EIM_ALIAS_SIZE = (128 * MiB),
73
.class_init = gsj_machine_class_init,
59
+
74
+ }, {
60
+ FSL_IMX6UL_EIM_CS_ADDR = 0x50000000,
75
+ .name = MACHINE_TYPE_NAME("quanta-gbs-bmc"),
61
+ FSL_IMX6UL_EIM_CS_SIZE = (128 * MiB),
76
+ .parent = TYPE_NPCM7XX_MACHINE,
62
+
77
+ .class_init = gbs_bmc_machine_class_init,
63
+ FSL_IMX6UL_AES_ENCRYPT_ADDR = 0x10000000,
78
},
64
+ FSL_IMX6UL_AES_ENCRYPT_SIZE = (1 * MiB),
65
+
66
+ FSL_IMX6UL_QSPI1_RX_ADDR = 0x0C000000,
67
+ FSL_IMX6UL_QSPI1_RX_SIZE = (32 * MiB),
68
+
69
+ /* AIPS-2 Begin */
70
FSL_IMX6UL_UART6_ADDR = 0x021FC000,
71
+
72
FSL_IMX6UL_I2C4_ADDR = 0x021F8000,
73
+
74
FSL_IMX6UL_UART5_ADDR = 0x021F4000,
75
FSL_IMX6UL_UART4_ADDR = 0x021F0000,
76
FSL_IMX6UL_UART3_ADDR = 0x021EC000,
77
FSL_IMX6UL_UART2_ADDR = 0x021E8000,
78
+
79
FSL_IMX6UL_WDOG3_ADDR = 0x021E4000,
80
+
81
FSL_IMX6UL_QSPI_ADDR = 0x021E0000,
82
+ FSL_IMX6UL_QSPI_SIZE = 0x500,
83
+
84
FSL_IMX6UL_SYS_CNT_CTRL_ADDR = 0x021DC000,
85
+ FSL_IMX6UL_SYS_CNT_CTRL_SIZE = (16 * KiB),
86
+
87
FSL_IMX6UL_SYS_CNT_CMP_ADDR = 0x021D8000,
88
+ FSL_IMX6UL_SYS_CNT_CMP_SIZE = (16 * KiB),
89
+
90
FSL_IMX6UL_SYS_CNT_RD_ADDR = 0x021D4000,
91
+ FSL_IMX6UL_SYS_CNT_RD_SIZE = (16 * KiB),
92
+
93
FSL_IMX6UL_TZASC_ADDR = 0x021D0000,
94
+ FSL_IMX6UL_TZASC_SIZE = (16 * KiB),
95
+
96
FSL_IMX6UL_PXP_ADDR = 0x021CC000,
97
+ FSL_IMX6UL_PXP_SIZE = (16 * KiB),
98
+
99
FSL_IMX6UL_LCDIF_ADDR = 0x021C8000,
100
+ FSL_IMX6UL_LCDIF_SIZE = 0x100,
101
+
102
FSL_IMX6UL_CSI_ADDR = 0x021C4000,
103
+ FSL_IMX6UL_CSI_SIZE = 0x100,
104
+
105
FSL_IMX6UL_CSU_ADDR = 0x021C0000,
106
+ FSL_IMX6UL_CSU_SIZE = (16 * KiB),
107
+
108
FSL_IMX6UL_OCOTP_CTRL_ADDR = 0x021BC000,
109
+ FSL_IMX6UL_OCOTP_CTRL_SIZE = (4 * KiB),
110
+
111
FSL_IMX6UL_EIM_ADDR = 0x021B8000,
112
+ FSL_IMX6UL_EIM_SIZE = 0x100,
113
+
114
FSL_IMX6UL_SIM2_ADDR = 0x021B4000,
115
+
116
FSL_IMX6UL_MMDC_CFG_ADDR = 0x021B0000,
117
+ FSL_IMX6UL_MMDC_CFG_SIZE = (4 * KiB),
118
+
119
FSL_IMX6UL_ROMCP_ADDR = 0x021AC000,
120
+ FSL_IMX6UL_ROMCP_SIZE = 0x300,
121
+
122
FSL_IMX6UL_I2C3_ADDR = 0x021A8000,
123
FSL_IMX6UL_I2C2_ADDR = 0x021A4000,
124
FSL_IMX6UL_I2C1_ADDR = 0x021A0000,
125
+
126
FSL_IMX6UL_ADC2_ADDR = 0x0219C000,
127
FSL_IMX6UL_ADC1_ADDR = 0x02198000,
128
+ FSL_IMX6UL_ADCn_SIZE = 0x100,
129
+
130
FSL_IMX6UL_USDHC2_ADDR = 0x02194000,
131
FSL_IMX6UL_USDHC1_ADDR = 0x02190000,
132
- FSL_IMX6UL_SIM1_ADDR = 0x0218C000,
133
- FSL_IMX6UL_ENET1_ADDR = 0x02188000,
134
- FSL_IMX6UL_USBO2_USBMISC_ADDR = 0x02184800,
135
- FSL_IMX6UL_USBO2_USB_ADDR = 0x02184000,
136
- FSL_IMX6UL_USBO2_PL301_ADDR = 0x02180000,
137
- FSL_IMX6UL_AIPS2_CFG_ADDR = 0x0217C000,
138
- FSL_IMX6UL_CAAM_ADDR = 0x02140000,
139
- FSL_IMX6UL_A7MPCORE_DAP_ADDR = 0x02100000,
140
141
- /* AIPS-1 */
142
+ FSL_IMX6UL_SIM1_ADDR = 0x0218C000,
143
+ FSL_IMX6UL_SIMn_SIZE = (16 * KiB),
144
+
145
+ FSL_IMX6UL_ENET1_ADDR = 0x02188000,
146
+
147
+ FSL_IMX6UL_USBO2_USBMISC_ADDR = 0x02184800,
148
+ FSL_IMX6UL_USBO2_USB1_ADDR = 0x02184000,
149
+ FSL_IMX6UL_USBO2_USB2_ADDR = 0x02184200,
150
+
151
+ FSL_IMX6UL_USBO2_PL301_ADDR = 0x02180000,
152
+ FSL_IMX6UL_USBO2_PL301_SIZE = (16 * KiB),
153
+
154
+ FSL_IMX6UL_AIPS2_CFG_ADDR = 0x0217C000,
155
+ FSL_IMX6UL_AIPS2_CFG_SIZE = 0x100,
156
+
157
+ FSL_IMX6UL_CAAM_ADDR = 0x02140000,
158
+ FSL_IMX6UL_CAAM_SIZE = (16 * KiB),
159
+
160
+ FSL_IMX6UL_A7MPCORE_DAP_ADDR = 0x02100000,
161
+ FSL_IMX6UL_A7MPCORE_DAP_SIZE = (4 * KiB),
162
+ /* AIPS-2 End */
163
+
164
+ /* AIPS-1 Begin */
165
FSL_IMX6UL_PWM8_ADDR = 0x020FC000,
166
FSL_IMX6UL_PWM7_ADDR = 0x020F8000,
167
FSL_IMX6UL_PWM6_ADDR = 0x020F4000,
168
FSL_IMX6UL_PWM5_ADDR = 0x020F0000,
169
+
170
FSL_IMX6UL_SDMA_ADDR = 0x020EC000,
171
+ FSL_IMX6UL_SDMA_SIZE = 0x300,
172
+
173
FSL_IMX6UL_GPT2_ADDR = 0x020E8000,
174
+
175
FSL_IMX6UL_IOMUXC_GPR_ADDR = 0x020E4000,
176
+ FSL_IMX6UL_IOMUXC_GPR_SIZE = 0x40,
177
+
178
FSL_IMX6UL_IOMUXC_ADDR = 0x020E0000,
179
+ FSL_IMX6UL_IOMUXC_SIZE = 0x700,
180
+
181
FSL_IMX6UL_GPC_ADDR = 0x020DC000,
182
+
183
FSL_IMX6UL_SRC_ADDR = 0x020D8000,
184
+
185
FSL_IMX6UL_EPIT2_ADDR = 0x020D4000,
186
FSL_IMX6UL_EPIT1_ADDR = 0x020D0000,
187
+
188
FSL_IMX6UL_SNVS_HP_ADDR = 0x020CC000,
189
+
190
FSL_IMX6UL_USBPHY2_ADDR = 0x020CA000,
191
- FSL_IMX6UL_USBPHY2_SIZE = (4 * 1024),
192
FSL_IMX6UL_USBPHY1_ADDR = 0x020C9000,
193
- FSL_IMX6UL_USBPHY1_SIZE = (4 * 1024),
194
+
195
FSL_IMX6UL_ANALOG_ADDR = 0x020C8000,
196
+ FSL_IMX6UL_ANALOG_SIZE = 0x300,
197
+
198
FSL_IMX6UL_CCM_ADDR = 0x020C4000,
199
+
200
FSL_IMX6UL_WDOG2_ADDR = 0x020C0000,
201
FSL_IMX6UL_WDOG1_ADDR = 0x020BC000,
202
+
203
FSL_IMX6UL_KPP_ADDR = 0x020B8000,
204
+ FSL_IMX6UL_KPP_SIZE = 0x10,
205
+
206
FSL_IMX6UL_ENET2_ADDR = 0x020B4000,
207
+
208
FSL_IMX6UL_SNVS_LP_ADDR = 0x020B0000,
209
+ FSL_IMX6UL_SNVS_LP_SIZE = (16 * KiB),
210
+
211
FSL_IMX6UL_GPIO5_ADDR = 0x020AC000,
212
FSL_IMX6UL_GPIO4_ADDR = 0x020A8000,
213
FSL_IMX6UL_GPIO3_ADDR = 0x020A4000,
214
FSL_IMX6UL_GPIO2_ADDR = 0x020A0000,
215
FSL_IMX6UL_GPIO1_ADDR = 0x0209C000,
216
+
217
FSL_IMX6UL_GPT1_ADDR = 0x02098000,
218
+
219
FSL_IMX6UL_CAN2_ADDR = 0x02094000,
220
FSL_IMX6UL_CAN1_ADDR = 0x02090000,
221
+ FSL_IMX6UL_CANn_SIZE = (4 * KiB),
222
+
223
FSL_IMX6UL_PWM4_ADDR = 0x0208C000,
224
FSL_IMX6UL_PWM3_ADDR = 0x02088000,
225
FSL_IMX6UL_PWM2_ADDR = 0x02084000,
226
FSL_IMX6UL_PWM1_ADDR = 0x02080000,
227
+ FSL_IMX6UL_PWMn_SIZE = 0x20,
228
+
229
FSL_IMX6UL_AIPS1_CFG_ADDR = 0x0207C000,
230
+ FSL_IMX6UL_AIPS1_CFG_SIZE = (16 * KiB),
231
+
232
FSL_IMX6UL_BEE_ADDR = 0x02044000,
233
+ FSL_IMX6UL_BEE_SIZE = (16 * KiB),
234
+
235
FSL_IMX6UL_TOUCH_CTRL_ADDR = 0x02040000,
236
+ FSL_IMX6UL_TOUCH_CTRL_SIZE = 0x100,
237
+
238
FSL_IMX6UL_SPBA_ADDR = 0x0203C000,
239
+ FSL_IMX6UL_SPBA_SIZE = 0x100,
240
+
241
FSL_IMX6UL_ASRC_ADDR = 0x02034000,
242
+ FSL_IMX6UL_ASRC_SIZE = 0x100,
243
+
244
FSL_IMX6UL_SAI3_ADDR = 0x02030000,
245
FSL_IMX6UL_SAI2_ADDR = 0x0202C000,
246
FSL_IMX6UL_SAI1_ADDR = 0x02028000,
247
+ FSL_IMX6UL_SAIn_SIZE = 0x200,
248
+
249
FSL_IMX6UL_UART8_ADDR = 0x02024000,
250
FSL_IMX6UL_UART1_ADDR = 0x02020000,
251
FSL_IMX6UL_UART7_ADDR = 0x02018000,
252
+
253
FSL_IMX6UL_ECSPI4_ADDR = 0x02014000,
254
FSL_IMX6UL_ECSPI3_ADDR = 0x02010000,
255
FSL_IMX6UL_ECSPI2_ADDR = 0x0200C000,
256
FSL_IMX6UL_ECSPI1_ADDR = 0x02008000,
257
+
258
FSL_IMX6UL_SPDIF_ADDR = 0x02004000,
259
+ FSL_IMX6UL_SPDIF_SIZE = 0x100,
260
+ /* AIPS-1 End */
261
+
262
+ FSL_IMX6UL_BCH_ADDR = 0x01808000,
263
+ FSL_IMX6UL_BCH_SIZE = 0x200,
264
+
265
+ FSL_IMX6UL_GPMI_ADDR = 0x01806000,
266
+ FSL_IMX6UL_GPMI_SIZE = 0x200,
267
268
FSL_IMX6UL_APBH_DMA_ADDR = 0x01804000,
269
- FSL_IMX6UL_APBH_DMA_SIZE = (32 * 1024),
270
+ FSL_IMX6UL_APBH_DMA_SIZE = (4 * KiB),
271
272
FSL_IMX6UL_A7MPCORE_ADDR = 0x00A00000,
273
274
FSL_IMX6UL_OCRAM_ALIAS_ADDR = 0x00920000,
275
- FSL_IMX6UL_OCRAM_ALIAS_SIZE = 0x00060000,
276
+ FSL_IMX6UL_OCRAM_ALIAS_SIZE = (384 * KiB),
277
+
278
FSL_IMX6UL_OCRAM_MEM_ADDR = 0x00900000,
279
- FSL_IMX6UL_OCRAM_MEM_SIZE = 0x00020000,
280
+ FSL_IMX6UL_OCRAM_MEM_SIZE = (128 * KiB),
281
+
282
FSL_IMX6UL_CAAM_MEM_ADDR = 0x00100000,
283
- FSL_IMX6UL_CAAM_MEM_SIZE = 0x00008000,
284
+ FSL_IMX6UL_CAAM_MEM_SIZE = (32 * KiB),
285
+
286
FSL_IMX6UL_ROM_ADDR = 0x00000000,
287
- FSL_IMX6UL_ROM_SIZE = 0x00018000,
288
+ FSL_IMX6UL_ROM_SIZE = (96 * KiB),
79
};
289
};
80
290
291
enum FslIMX6ULIRQs {
292
diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c
293
index XXXXXXX..XXXXXXX 100644
294
--- a/hw/arm/fsl-imx6ul.c
295
+++ b/hw/arm/fsl-imx6ul.c
296
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_init(Object *obj)
297
object_initialize_child(obj, "snvs", &s->snvs, TYPE_IMX7_SNVS);
298
299
/*
300
- * GPIOs 1 to 5
301
+ * GPIOs
302
*/
303
for (i = 0; i < FSL_IMX6UL_NUM_GPIOS; i++) {
304
snprintf(name, NAME_SIZE, "gpio%d", i);
305
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_init(Object *obj)
306
}
307
308
/*
309
- * GPT 1, 2
310
+ * GPTs
311
*/
312
for (i = 0; i < FSL_IMX6UL_NUM_GPTS; i++) {
313
snprintf(name, NAME_SIZE, "gpt%d", i);
314
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_init(Object *obj)
315
}
316
317
/*
318
- * EPIT 1, 2
319
+ * EPITs
320
*/
321
for (i = 0; i < FSL_IMX6UL_NUM_EPITS; i++) {
322
snprintf(name, NAME_SIZE, "epit%d", i + 1);
323
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_init(Object *obj)
324
}
325
326
/*
327
- * eCSPI
328
+ * eCSPIs
329
*/
330
for (i = 0; i < FSL_IMX6UL_NUM_ECSPIS; i++) {
331
snprintf(name, NAME_SIZE, "spi%d", i + 1);
332
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_init(Object *obj)
333
}
334
335
/*
336
- * I2C
337
+ * I2Cs
338
*/
339
for (i = 0; i < FSL_IMX6UL_NUM_I2CS; i++) {
340
snprintf(name, NAME_SIZE, "i2c%d", i + 1);
341
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_init(Object *obj)
342
}
343
344
/*
345
- * UART
346
+ * UARTs
347
*/
348
for (i = 0; i < FSL_IMX6UL_NUM_UARTS; i++) {
349
snprintf(name, NAME_SIZE, "uart%d", i);
350
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_init(Object *obj)
351
}
352
353
/*
354
- * Ethernet
355
+ * Ethernets
356
*/
357
for (i = 0; i < FSL_IMX6UL_NUM_ETHS; i++) {
358
snprintf(name, NAME_SIZE, "eth%d", i);
359
object_initialize_child(obj, name, &s->eth[i], TYPE_IMX_ENET);
360
}
361
362
- /* USB */
363
+ /*
364
+ * USB PHYs
365
+ */
366
for (i = 0; i < FSL_IMX6UL_NUM_USB_PHYS; i++) {
367
snprintf(name, NAME_SIZE, "usbphy%d", i);
368
object_initialize_child(obj, name, &s->usbphy[i], TYPE_IMX_USBPHY);
369
}
370
+
371
+ /*
372
+ * USBs
373
+ */
374
for (i = 0; i < FSL_IMX6UL_NUM_USBS; i++) {
375
snprintf(name, NAME_SIZE, "usb%d", i);
376
object_initialize_child(obj, name, &s->usb[i], TYPE_CHIPIDEA);
377
}
378
379
/*
380
- * SDHCI
381
+ * SDHCIs
382
*/
383
for (i = 0; i < FSL_IMX6UL_NUM_USDHCS; i++) {
384
snprintf(name, NAME_SIZE, "usdhc%d", i);
385
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_init(Object *obj)
386
}
387
388
/*
389
- * Watchdog
390
+ * Watchdogs
391
*/
392
for (i = 0; i < FSL_IMX6UL_NUM_WDTS; i++) {
393
snprintf(name, NAME_SIZE, "wdt%d", i);
394
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
395
* A7MPCORE DAP
396
*/
397
create_unimplemented_device("a7mpcore-dap", FSL_IMX6UL_A7MPCORE_DAP_ADDR,
398
- 0x100000);
399
+ FSL_IMX6UL_A7MPCORE_DAP_SIZE);
400
401
/*
402
- * GPT 1, 2
403
+ * GPTs
404
*/
405
for (i = 0; i < FSL_IMX6UL_NUM_GPTS; i++) {
406
static const hwaddr FSL_IMX6UL_GPTn_ADDR[FSL_IMX6UL_NUM_GPTS] = {
407
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
408
}
409
410
/*
411
- * EPIT 1, 2
412
+ * EPITs
413
*/
414
for (i = 0; i < FSL_IMX6UL_NUM_EPITS; i++) {
415
static const hwaddr FSL_IMX6UL_EPITn_ADDR[FSL_IMX6UL_NUM_EPITS] = {
416
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
417
}
418
419
/*
420
- * GPIO
421
+ * GPIOs
422
*/
423
for (i = 0; i < FSL_IMX6UL_NUM_GPIOS; i++) {
424
static const hwaddr FSL_IMX6UL_GPIOn_ADDR[FSL_IMX6UL_NUM_GPIOS] = {
425
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
426
}
427
428
/*
429
- * IOMUXC and IOMUXC_GPR
430
+ * IOMUXC
431
*/
432
- for (i = 0; i < 1; i++) {
433
- static const hwaddr FSL_IMX6UL_IOMUXCn_ADDR[FSL_IMX6UL_NUM_IOMUXCS] = {
434
- FSL_IMX6UL_IOMUXC_ADDR,
435
- FSL_IMX6UL_IOMUXC_GPR_ADDR,
436
- };
437
-
438
- snprintf(name, NAME_SIZE, "iomuxc%d", i);
439
- create_unimplemented_device(name, FSL_IMX6UL_IOMUXCn_ADDR[i], 0x4000);
440
- }
441
+ create_unimplemented_device("iomuxc", FSL_IMX6UL_IOMUXC_ADDR,
442
+ FSL_IMX6UL_IOMUXC_SIZE);
443
+ create_unimplemented_device("iomuxc_gpr", FSL_IMX6UL_IOMUXC_GPR_ADDR,
444
+ FSL_IMX6UL_IOMUXC_GPR_SIZE);
445
446
/*
447
* CCM
448
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
449
sysbus_realize(SYS_BUS_DEVICE(&s->gpcv2), &error_abort);
450
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpcv2), 0, FSL_IMX6UL_GPC_ADDR);
451
452
- /* Initialize all ECSPI */
453
+ /*
454
+ * ECSPIs
455
+ */
456
for (i = 0; i < FSL_IMX6UL_NUM_ECSPIS; i++) {
457
static const hwaddr FSL_IMX6UL_SPIn_ADDR[FSL_IMX6UL_NUM_ECSPIS] = {
458
FSL_IMX6UL_ECSPI1_ADDR,
459
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
460
}
461
462
/*
463
- * I2C
464
+ * I2Cs
465
*/
466
for (i = 0; i < FSL_IMX6UL_NUM_I2CS; i++) {
467
static const hwaddr FSL_IMX6UL_I2Cn_ADDR[FSL_IMX6UL_NUM_I2CS] = {
468
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
469
}
470
471
/*
472
- * UART
473
+ * UARTs
474
*/
475
for (i = 0; i < FSL_IMX6UL_NUM_UARTS; i++) {
476
static const hwaddr FSL_IMX6UL_UARTn_ADDR[FSL_IMX6UL_NUM_UARTS] = {
477
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
478
}
479
480
/*
481
- * Ethernet
482
+ * Ethernets
483
*
484
* We must use two loops since phy_connected affects the other interface
485
* and we have to set all properties before calling sysbus_realize().
486
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
487
FSL_IMX6UL_ENETn_TIMER_IRQ[i]));
488
}
489
490
- /* USB */
491
+ /*
492
+ * USB PHYs
493
+ */
494
for (i = 0; i < FSL_IMX6UL_NUM_USB_PHYS; i++) {
495
+ static const hwaddr
496
+ FSL_IMX6UL_USB_PHYn_ADDR[FSL_IMX6UL_NUM_USB_PHYS] = {
497
+ FSL_IMX6UL_USBPHY1_ADDR,
498
+ FSL_IMX6UL_USBPHY2_ADDR,
499
+ };
500
+
501
sysbus_realize(SYS_BUS_DEVICE(&s->usbphy[i]), &error_abort);
502
sysbus_mmio_map(SYS_BUS_DEVICE(&s->usbphy[i]), 0,
503
- FSL_IMX6UL_USBPHY1_ADDR + i * 0x1000);
504
+ FSL_IMX6UL_USB_PHYn_ADDR[i]);
505
}
506
507
+ /*
508
+ * USBs
509
+ */
510
for (i = 0; i < FSL_IMX6UL_NUM_USBS; i++) {
511
+ static const hwaddr FSL_IMX6UL_USB02_USBn_ADDR[FSL_IMX6UL_NUM_USBS] = {
512
+ FSL_IMX6UL_USBO2_USB1_ADDR,
513
+ FSL_IMX6UL_USBO2_USB2_ADDR,
514
+ };
515
+
516
static const int FSL_IMX6UL_USBn_IRQ[] = {
517
FSL_IMX6UL_USB1_IRQ,
518
FSL_IMX6UL_USB2_IRQ,
519
};
520
+
521
sysbus_realize(SYS_BUS_DEVICE(&s->usb[i]), &error_abort);
522
sysbus_mmio_map(SYS_BUS_DEVICE(&s->usb[i]), 0,
523
- FSL_IMX6UL_USBO2_USB_ADDR + i * 0x200);
524
+ FSL_IMX6UL_USB02_USBn_ADDR[i]);
525
sysbus_connect_irq(SYS_BUS_DEVICE(&s->usb[i]), 0,
526
qdev_get_gpio_in(DEVICE(&s->a7mpcore),
527
FSL_IMX6UL_USBn_IRQ[i]));
528
}
529
530
/*
531
- * USDHC
532
+ * USDHCs
533
*/
534
for (i = 0; i < FSL_IMX6UL_NUM_USDHCS; i++) {
535
static const hwaddr FSL_IMX6UL_USDHCn_ADDR[FSL_IMX6UL_NUM_USDHCS] = {
536
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
537
sysbus_mmio_map(SYS_BUS_DEVICE(&s->snvs), 0, FSL_IMX6UL_SNVS_HP_ADDR);
538
539
/*
540
- * Watchdog
541
+ * Watchdogs
542
*/
543
for (i = 0; i < FSL_IMX6UL_NUM_WDTS; i++) {
544
static const hwaddr FSL_IMX6UL_WDOGn_ADDR[FSL_IMX6UL_NUM_WDTS] = {
545
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
546
FSL_IMX6UL_WDOG2_ADDR,
547
FSL_IMX6UL_WDOG3_ADDR,
548
};
549
+
550
static const int FSL_IMX6UL_WDOGn_IRQ[FSL_IMX6UL_NUM_WDTS] = {
551
FSL_IMX6UL_WDOG1_IRQ,
552
FSL_IMX6UL_WDOG2_IRQ,
553
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
554
/*
555
* SDMA
556
*/
557
- create_unimplemented_device("sdma", FSL_IMX6UL_SDMA_ADDR, 0x4000);
558
+ create_unimplemented_device("sdma", FSL_IMX6UL_SDMA_ADDR,
559
+ FSL_IMX6UL_SDMA_SIZE);
560
561
/*
562
- * SAI (Audio SSI (Synchronous Serial Interface))
563
+ * SAIs (Audio SSI (Synchronous Serial Interface))
564
*/
565
- create_unimplemented_device("sai1", FSL_IMX6UL_SAI1_ADDR, 0x4000);
566
- create_unimplemented_device("sai2", FSL_IMX6UL_SAI2_ADDR, 0x4000);
567
- create_unimplemented_device("sai3", FSL_IMX6UL_SAI3_ADDR, 0x4000);
568
+ for (i = 0; i < FSL_IMX6UL_NUM_SAIS; i++) {
569
+ static const hwaddr FSL_IMX6UL_SAIn_ADDR[FSL_IMX6UL_NUM_SAIS] = {
570
+ FSL_IMX6UL_SAI1_ADDR,
571
+ FSL_IMX6UL_SAI2_ADDR,
572
+ FSL_IMX6UL_SAI3_ADDR,
573
+ };
574
+
575
+ snprintf(name, NAME_SIZE, "sai%d", i);
576
+ create_unimplemented_device(name, FSL_IMX6UL_SAIn_ADDR[i],
577
+ FSL_IMX6UL_SAIn_SIZE);
578
+ }
579
580
/*
581
- * PWM
582
+ * PWMs
583
*/
584
- create_unimplemented_device("pwm1", FSL_IMX6UL_PWM1_ADDR, 0x4000);
585
- create_unimplemented_device("pwm2", FSL_IMX6UL_PWM2_ADDR, 0x4000);
586
- create_unimplemented_device("pwm3", FSL_IMX6UL_PWM3_ADDR, 0x4000);
587
- create_unimplemented_device("pwm4", FSL_IMX6UL_PWM4_ADDR, 0x4000);
588
+ for (i = 0; i < FSL_IMX6UL_NUM_PWMS; i++) {
589
+ static const hwaddr FSL_IMX6UL_PWMn_ADDR[FSL_IMX6UL_NUM_PWMS] = {
590
+ FSL_IMX6UL_PWM1_ADDR,
591
+ FSL_IMX6UL_PWM2_ADDR,
592
+ FSL_IMX6UL_PWM3_ADDR,
593
+ FSL_IMX6UL_PWM4_ADDR,
594
+ };
595
+
596
+ snprintf(name, NAME_SIZE, "pwm%d", i);
597
+ create_unimplemented_device(name, FSL_IMX6UL_PWMn_ADDR[i],
598
+ FSL_IMX6UL_PWMn_SIZE);
599
+ }
600
601
/*
602
* Audio ASRC (asynchronous sample rate converter)
603
*/
604
- create_unimplemented_device("asrc", FSL_IMX6UL_ASRC_ADDR, 0x4000);
605
+ create_unimplemented_device("asrc", FSL_IMX6UL_ASRC_ADDR,
606
+ FSL_IMX6UL_ASRC_SIZE);
607
608
/*
609
- * CAN
610
+ * CANs
611
*/
612
- create_unimplemented_device("can1", FSL_IMX6UL_CAN1_ADDR, 0x4000);
613
- create_unimplemented_device("can2", FSL_IMX6UL_CAN2_ADDR, 0x4000);
614
+ for (i = 0; i < FSL_IMX6UL_NUM_CANS; i++) {
615
+ static const hwaddr FSL_IMX6UL_CANn_ADDR[FSL_IMX6UL_NUM_CANS] = {
616
+ FSL_IMX6UL_CAN1_ADDR,
617
+ FSL_IMX6UL_CAN2_ADDR,
618
+ };
619
+
620
+ snprintf(name, NAME_SIZE, "can%d", i);
621
+ create_unimplemented_device(name, FSL_IMX6UL_CANn_ADDR[i],
622
+ FSL_IMX6UL_CANn_SIZE);
623
+ }
624
625
/*
626
* APHB_DMA
627
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
628
};
629
630
snprintf(name, NAME_SIZE, "adc%d", i);
631
- create_unimplemented_device(name, FSL_IMX6UL_ADCn_ADDR[i], 0x4000);
632
+ create_unimplemented_device(name, FSL_IMX6UL_ADCn_ADDR[i],
633
+ FSL_IMX6UL_ADCn_SIZE);
634
}
635
636
/*
637
* LCD
638
*/
639
- create_unimplemented_device("lcdif", FSL_IMX6UL_LCDIF_ADDR, 0x4000);
640
+ create_unimplemented_device("lcdif", FSL_IMX6UL_LCDIF_ADDR,
641
+ FSL_IMX6UL_LCDIF_SIZE);
642
643
/*
644
* ROM memory
81
--
645
--
82
2.20.1
646
2.34.1
83
84
diff view generated by jsdifflib
1
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
1
From: Jean-Christophe Dubois <jcd@tribudubois.net>
2
2
3
virt-6.0 must consider hw_compat_6_0.
3
* Add TZASC as unimplemented device.
4
- Allow bare metal application to access this (unimplemented) device
5
* Add CSU as unimplemented device.
6
- Allow bare metal application to access this (unimplemented) device
7
* Add 4 missing PWM devices
4
8
5
Fixes: da7e13c00b59 ("hw: add compat machines for 6.1")
9
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
6
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
10
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
7
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
11
Message-id: 59e4dc56e14eccfefd379275ec19048dff9c10b3.1692964892.git.jcd@tribudubois.net
8
Message-id: 20210610183500.54207-1-xypron.glpk@gmx.de
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
---
13
---
11
hw/arm/virt.c | 2 ++
14
include/hw/arm/fsl-imx6ul.h | 2 +-
12
1 file changed, 2 insertions(+)
15
hw/arm/fsl-imx6ul.c | 16 ++++++++++++++++
16
2 files changed, 17 insertions(+), 1 deletion(-)
13
17
14
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
18
diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h
15
index XXXXXXX..XXXXXXX 100644
19
index XXXXXXX..XXXXXXX 100644
16
--- a/hw/arm/virt.c
20
--- a/include/hw/arm/fsl-imx6ul.h
17
+++ b/hw/arm/virt.c
21
+++ b/include/hw/arm/fsl-imx6ul.h
18
@@ -XXX,XX +XXX,XX @@ DEFINE_VIRT_MACHINE_AS_LATEST(6, 1)
22
@@ -XXX,XX +XXX,XX @@ enum FslIMX6ULConfiguration {
19
23
FSL_IMX6UL_NUM_USBS = 2,
20
static void virt_machine_6_0_options(MachineClass *mc)
24
FSL_IMX6UL_NUM_SAIS = 3,
21
{
25
FSL_IMX6UL_NUM_CANS = 2,
22
+ virt_machine_6_1_options(mc);
26
- FSL_IMX6UL_NUM_PWMS = 4,
23
+ compat_props_add(mc->compat_props, hw_compat_6_0, hw_compat_6_0_len);
27
+ FSL_IMX6UL_NUM_PWMS = 8,
24
}
28
};
25
DEFINE_VIRT_MACHINE(6, 0)
29
26
30
struct FslIMX6ULState {
31
diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c
32
index XXXXXXX..XXXXXXX 100644
33
--- a/hw/arm/fsl-imx6ul.c
34
+++ b/hw/arm/fsl-imx6ul.c
35
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
36
FSL_IMX6UL_PWM2_ADDR,
37
FSL_IMX6UL_PWM3_ADDR,
38
FSL_IMX6UL_PWM4_ADDR,
39
+ FSL_IMX6UL_PWM5_ADDR,
40
+ FSL_IMX6UL_PWM6_ADDR,
41
+ FSL_IMX6UL_PWM7_ADDR,
42
+ FSL_IMX6UL_PWM8_ADDR,
43
};
44
45
snprintf(name, NAME_SIZE, "pwm%d", i);
46
@@ -XXX,XX +XXX,XX @@ static void fsl_imx6ul_realize(DeviceState *dev, Error **errp)
47
create_unimplemented_device("lcdif", FSL_IMX6UL_LCDIF_ADDR,
48
FSL_IMX6UL_LCDIF_SIZE);
49
50
+ /*
51
+ * CSU
52
+ */
53
+ create_unimplemented_device("csu", FSL_IMX6UL_CSU_ADDR,
54
+ FSL_IMX6UL_CSU_SIZE);
55
+
56
+ /*
57
+ * TZASC
58
+ */
59
+ create_unimplemented_device("tzasc", FSL_IMX6UL_TZASC_ADDR,
60
+ FSL_IMX6UL_TZASC_SIZE);
61
+
62
/*
63
* ROM memory
64
*/
27
--
65
--
28
2.20.1
66
2.34.1
29
67
30
68
diff view generated by jsdifflib
Deleted patch
1
In commit da6d674e509f0939b we split the NVIC code out from the GIC.
2
This allowed us to specify the NVIC's default value for the num-irq
3
property (64) in the usual way in its property list, and we deleted
4
the previous hack where we updated the value in the state struct in
5
the instance init function. Remove a stale comment about that hack
6
which we forgot to delete at that time.
7
1
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
10
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
11
Message-id: 20210614161243.14211-1-peter.maydell@linaro.org
12
---
13
hw/intc/armv7m_nvic.c | 6 ------
14
1 file changed, 6 deletions(-)
15
16
diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/hw/intc/armv7m_nvic.c
19
+++ b/hw/intc/armv7m_nvic.c
20
@@ -XXX,XX +XXX,XX @@ static void armv7m_nvic_realize(DeviceState *dev, Error **errp)
21
22
static void armv7m_nvic_instance_init(Object *obj)
23
{
24
- /* We have a different default value for the num-irq property
25
- * than our superclass. This function runs after qdev init
26
- * has set the defaults from the Property array and before
27
- * any user-specified property setting, so just modify the
28
- * value in the GICState struct.
29
- */
30
DeviceState *dev = DEVICE(obj);
31
NVICState *nvic = NVIC(obj);
32
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
33
--
34
2.20.1
35
36
diff view generated by jsdifflib
1
Implement the MVE LETP insn. This is like the existing LE loop-end
1
From: Jean-Christophe Dubois <jcd@tribudubois.net>
2
insn, but it must perform an FPU-enabled check, and on loop-exit it
3
resets LTPSIZE to 4.
4
2
5
To accommodate the requirement to do something on loop-exit, we drop
3
* Add Addr and size definition for all i.MX7 devices in i.MX7 header file.
6
the use of condlabel and instead manage both the TB exits manually,
4
* Use those newly defined named constants whenever possible.
7
in the same way we already do in trans_WLS().
5
* Standardize the way we init a familly of unimplemented devices
6
- SAI
7
- PWM
8
- CAN
9
* Add/rework few comments
8
10
9
The other MVE-specific change to the LE insn is that we must raise an
11
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
10
INVSTATE UsageFault insn if LTPSIZE is not 4.
12
Message-id: 59e195d33e4d486a8d131392acd46633c8c10ed7.1692964892.git.jcd@tribudubois.net
13
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
15
---
16
include/hw/arm/fsl-imx7.h | 330 ++++++++++++++++++++++++++++----------
17
hw/arm/fsl-imx7.c | 130 ++++++++++-----
18
2 files changed, 335 insertions(+), 125 deletions(-)
11
19
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
20
diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h
13
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
14
Message-id: 20210614151007.4545-10-peter.maydell@linaro.org
15
---
16
target/arm/t32.decode | 2 +-
17
target/arm/translate.c | 104 +++++++++++++++++++++++++++++++++++++----
18
2 files changed, 97 insertions(+), 9 deletions(-)
19
20
diff --git a/target/arm/t32.decode b/target/arm/t32.decode
21
index XXXXXXX..XXXXXXX 100644
21
index XXXXXXX..XXXXXXX 100644
22
--- a/target/arm/t32.decode
22
--- a/include/hw/arm/fsl-imx7.h
23
+++ b/target/arm/t32.decode
23
+++ b/include/hw/arm/fsl-imx7.h
24
@@ -XXX,XX +XXX,XX @@ BL 1111 0. .......... 11.1 ............ @branch24
24
@@ -XXX,XX +XXX,XX @@
25
DLS 1111 0 0000 100 rn:4 1110 0000 0000 0001 size=4
25
#include "hw/misc/imx7_ccm.h"
26
WLS 1111 0 0000 100 rn:4 1100 . .......... 1 imm=%lob_imm size=4
26
#include "hw/misc/imx7_snvs.h"
27
{
27
#include "hw/misc/imx7_gpr.h"
28
- LE 1111 0 0000 0 f:1 0 1111 1100 . .......... 1 imm=%lob_imm
28
-#include "hw/misc/imx6_src.h"
29
+ LE 1111 0 0000 0 f:1 tp:1 1111 1100 . .......... 1 imm=%lob_imm
29
#include "hw/watchdog/wdt_imx2.h"
30
# This is WLSTP
30
#include "hw/gpio/imx_gpio.h"
31
WLS 1111 0 0000 0 size:2 rn:4 1100 . .......... 1 imm=%lob_imm
31
#include "hw/char/imx_serial.h"
32
}
32
@@ -XXX,XX +XXX,XX @@
33
diff --git a/target/arm/translate.c b/target/arm/translate.c
33
#include "hw/usb/chipidea.h"
34
#include "cpu.h"
35
#include "qom/object.h"
36
+#include "qemu/units.h"
37
38
#define TYPE_FSL_IMX7 "fsl-imx7"
39
OBJECT_DECLARE_SIMPLE_TYPE(FslIMX7State, FSL_IMX7)
40
@@ -XXX,XX +XXX,XX @@ enum FslIMX7Configuration {
41
FSL_IMX7_NUM_ECSPIS = 4,
42
FSL_IMX7_NUM_USBS = 3,
43
FSL_IMX7_NUM_ADCS = 2,
44
+ FSL_IMX7_NUM_SAIS = 3,
45
+ FSL_IMX7_NUM_CANS = 2,
46
+ FSL_IMX7_NUM_PWMS = 4,
47
};
48
49
struct FslIMX7State {
50
@@ -XXX,XX +XXX,XX @@ struct FslIMX7State {
51
52
enum FslIMX7MemoryMap {
53
FSL_IMX7_MMDC_ADDR = 0x80000000,
54
- FSL_IMX7_MMDC_SIZE = 2 * 1024 * 1024 * 1024UL,
55
+ FSL_IMX7_MMDC_SIZE = (2 * GiB),
56
57
- FSL_IMX7_GPIO1_ADDR = 0x30200000,
58
- FSL_IMX7_GPIO2_ADDR = 0x30210000,
59
- FSL_IMX7_GPIO3_ADDR = 0x30220000,
60
- FSL_IMX7_GPIO4_ADDR = 0x30230000,
61
- FSL_IMX7_GPIO5_ADDR = 0x30240000,
62
- FSL_IMX7_GPIO6_ADDR = 0x30250000,
63
- FSL_IMX7_GPIO7_ADDR = 0x30260000,
64
+ FSL_IMX7_QSPI1_MEM_ADDR = 0x60000000,
65
+ FSL_IMX7_QSPI1_MEM_SIZE = (256 * MiB),
66
67
- FSL_IMX7_IOMUXC_LPSR_GPR_ADDR = 0x30270000,
68
+ FSL_IMX7_PCIE1_MEM_ADDR = 0x40000000,
69
+ FSL_IMX7_PCIE1_MEM_SIZE = (256 * MiB),
70
71
- FSL_IMX7_WDOG1_ADDR = 0x30280000,
72
- FSL_IMX7_WDOG2_ADDR = 0x30290000,
73
- FSL_IMX7_WDOG3_ADDR = 0x302A0000,
74
- FSL_IMX7_WDOG4_ADDR = 0x302B0000,
75
+ FSL_IMX7_QSPI1_RX_BUF_ADDR = 0x34000000,
76
+ FSL_IMX7_QSPI1_RX_BUF_SIZE = (32 * MiB),
77
78
- FSL_IMX7_IOMUXC_LPSR_ADDR = 0x302C0000,
79
+ /* PCIe Peripherals */
80
+ FSL_IMX7_PCIE_REG_ADDR = 0x33800000,
81
82
- FSL_IMX7_GPT1_ADDR = 0x302D0000,
83
- FSL_IMX7_GPT2_ADDR = 0x302E0000,
84
- FSL_IMX7_GPT3_ADDR = 0x302F0000,
85
- FSL_IMX7_GPT4_ADDR = 0x30300000,
86
+ /* MMAP Peripherals */
87
+ FSL_IMX7_DMA_APBH_ADDR = 0x33000000,
88
+ FSL_IMX7_DMA_APBH_SIZE = 0x8000,
89
90
- FSL_IMX7_IOMUXC_ADDR = 0x30330000,
91
- FSL_IMX7_IOMUXC_GPR_ADDR = 0x30340000,
92
- FSL_IMX7_IOMUXCn_SIZE = 0x1000,
93
+ /* GPV configuration */
94
+ FSL_IMX7_GPV6_ADDR = 0x32600000,
95
+ FSL_IMX7_GPV5_ADDR = 0x32500000,
96
+ FSL_IMX7_GPV4_ADDR = 0x32400000,
97
+ FSL_IMX7_GPV3_ADDR = 0x32300000,
98
+ FSL_IMX7_GPV2_ADDR = 0x32200000,
99
+ FSL_IMX7_GPV1_ADDR = 0x32100000,
100
+ FSL_IMX7_GPV0_ADDR = 0x32000000,
101
+ FSL_IMX7_GPVn_SIZE = (1 * MiB),
102
103
- FSL_IMX7_OCOTP_ADDR = 0x30350000,
104
- FSL_IMX7_OCOTP_SIZE = 0x10000,
105
+ /* Arm Peripherals */
106
+ FSL_IMX7_A7MPCORE_ADDR = 0x31000000,
107
108
- FSL_IMX7_ANALOG_ADDR = 0x30360000,
109
- FSL_IMX7_SNVS_ADDR = 0x30370000,
110
- FSL_IMX7_CCM_ADDR = 0x30380000,
111
+ /* AIPS-3 Begin */
112
113
- FSL_IMX7_SRC_ADDR = 0x30390000,
114
- FSL_IMX7_SRC_SIZE = 0x1000,
115
+ FSL_IMX7_ENET2_ADDR = 0x30BF0000,
116
+ FSL_IMX7_ENET1_ADDR = 0x30BE0000,
117
118
- FSL_IMX7_ADC1_ADDR = 0x30610000,
119
- FSL_IMX7_ADC2_ADDR = 0x30620000,
120
- FSL_IMX7_ADCn_SIZE = 0x1000,
121
+ FSL_IMX7_SDMA_ADDR = 0x30BD0000,
122
+ FSL_IMX7_SDMA_SIZE = (4 * KiB),
123
124
- FSL_IMX7_PWM1_ADDR = 0x30660000,
125
- FSL_IMX7_PWM2_ADDR = 0x30670000,
126
- FSL_IMX7_PWM3_ADDR = 0x30680000,
127
- FSL_IMX7_PWM4_ADDR = 0x30690000,
128
- FSL_IMX7_PWMn_SIZE = 0x10000,
129
+ FSL_IMX7_EIM_ADDR = 0x30BC0000,
130
+ FSL_IMX7_EIM_SIZE = (4 * KiB),
131
132
- FSL_IMX7_PCIE_PHY_ADDR = 0x306D0000,
133
- FSL_IMX7_PCIE_PHY_SIZE = 0x10000,
134
+ FSL_IMX7_QSPI_ADDR = 0x30BB0000,
135
+ FSL_IMX7_QSPI_SIZE = 0x8000,
136
137
- FSL_IMX7_GPC_ADDR = 0x303A0000,
138
+ FSL_IMX7_SIM2_ADDR = 0x30BA0000,
139
+ FSL_IMX7_SIM1_ADDR = 0x30B90000,
140
+ FSL_IMX7_SIMn_SIZE = (4 * KiB),
141
+
142
+ FSL_IMX7_USDHC3_ADDR = 0x30B60000,
143
+ FSL_IMX7_USDHC2_ADDR = 0x30B50000,
144
+ FSL_IMX7_USDHC1_ADDR = 0x30B40000,
145
+
146
+ FSL_IMX7_USB3_ADDR = 0x30B30000,
147
+ FSL_IMX7_USBMISC3_ADDR = 0x30B30200,
148
+ FSL_IMX7_USB2_ADDR = 0x30B20000,
149
+ FSL_IMX7_USBMISC2_ADDR = 0x30B20200,
150
+ FSL_IMX7_USB1_ADDR = 0x30B10000,
151
+ FSL_IMX7_USBMISC1_ADDR = 0x30B10200,
152
+ FSL_IMX7_USBMISCn_SIZE = 0x200,
153
+
154
+ FSL_IMX7_USB_PL301_ADDR = 0x30AD0000,
155
+ FSL_IMX7_USB_PL301_SIZE = (64 * KiB),
156
+
157
+ FSL_IMX7_SEMAPHORE_HS_ADDR = 0x30AC0000,
158
+ FSL_IMX7_SEMAPHORE_HS_SIZE = (64 * KiB),
159
+
160
+ FSL_IMX7_MUB_ADDR = 0x30AB0000,
161
+ FSL_IMX7_MUA_ADDR = 0x30AA0000,
162
+ FSL_IMX7_MUn_SIZE = (KiB),
163
+
164
+ FSL_IMX7_UART7_ADDR = 0x30A90000,
165
+ FSL_IMX7_UART6_ADDR = 0x30A80000,
166
+ FSL_IMX7_UART5_ADDR = 0x30A70000,
167
+ FSL_IMX7_UART4_ADDR = 0x30A60000,
168
+
169
+ FSL_IMX7_I2C4_ADDR = 0x30A50000,
170
+ FSL_IMX7_I2C3_ADDR = 0x30A40000,
171
+ FSL_IMX7_I2C2_ADDR = 0x30A30000,
172
+ FSL_IMX7_I2C1_ADDR = 0x30A20000,
173
+
174
+ FSL_IMX7_CAN2_ADDR = 0x30A10000,
175
+ FSL_IMX7_CAN1_ADDR = 0x30A00000,
176
+ FSL_IMX7_CANn_SIZE = (4 * KiB),
177
+
178
+ FSL_IMX7_AIPS3_CONF_ADDR = 0x309F0000,
179
+ FSL_IMX7_AIPS3_CONF_SIZE = (64 * KiB),
180
181
FSL_IMX7_CAAM_ADDR = 0x30900000,
182
- FSL_IMX7_CAAM_SIZE = 0x40000,
183
+ FSL_IMX7_CAAM_SIZE = (256 * KiB),
184
185
- FSL_IMX7_CAN1_ADDR = 0x30A00000,
186
- FSL_IMX7_CAN2_ADDR = 0x30A10000,
187
- FSL_IMX7_CANn_SIZE = 0x10000,
188
+ FSL_IMX7_SPBA_ADDR = 0x308F0000,
189
+ FSL_IMX7_SPBA_SIZE = (4 * KiB),
190
191
- FSL_IMX7_I2C1_ADDR = 0x30A20000,
192
- FSL_IMX7_I2C2_ADDR = 0x30A30000,
193
- FSL_IMX7_I2C3_ADDR = 0x30A40000,
194
- FSL_IMX7_I2C4_ADDR = 0x30A50000,
195
+ FSL_IMX7_SAI3_ADDR = 0x308C0000,
196
+ FSL_IMX7_SAI2_ADDR = 0x308B0000,
197
+ FSL_IMX7_SAI1_ADDR = 0x308A0000,
198
+ FSL_IMX7_SAIn_SIZE = (4 * KiB),
199
200
- FSL_IMX7_ECSPI1_ADDR = 0x30820000,
201
- FSL_IMX7_ECSPI2_ADDR = 0x30830000,
202
- FSL_IMX7_ECSPI3_ADDR = 0x30840000,
203
- FSL_IMX7_ECSPI4_ADDR = 0x30630000,
204
-
205
- FSL_IMX7_LCDIF_ADDR = 0x30730000,
206
- FSL_IMX7_LCDIF_SIZE = 0x1000,
207
-
208
- FSL_IMX7_UART1_ADDR = 0x30860000,
209
+ FSL_IMX7_UART3_ADDR = 0x30880000,
210
/*
211
* Some versions of the reference manual claim that UART2 is @
212
* 0x30870000, but experiments with HW + DT files in upstream
213
@@ -XXX,XX +XXX,XX @@ enum FslIMX7MemoryMap {
214
* actually located @ 0x30890000
215
*/
216
FSL_IMX7_UART2_ADDR = 0x30890000,
217
- FSL_IMX7_UART3_ADDR = 0x30880000,
218
- FSL_IMX7_UART4_ADDR = 0x30A60000,
219
- FSL_IMX7_UART5_ADDR = 0x30A70000,
220
- FSL_IMX7_UART6_ADDR = 0x30A80000,
221
- FSL_IMX7_UART7_ADDR = 0x30A90000,
222
+ FSL_IMX7_UART1_ADDR = 0x30860000,
223
224
- FSL_IMX7_SAI1_ADDR = 0x308A0000,
225
- FSL_IMX7_SAI2_ADDR = 0x308B0000,
226
- FSL_IMX7_SAI3_ADDR = 0x308C0000,
227
- FSL_IMX7_SAIn_SIZE = 0x10000,
228
+ FSL_IMX7_ECSPI3_ADDR = 0x30840000,
229
+ FSL_IMX7_ECSPI2_ADDR = 0x30830000,
230
+ FSL_IMX7_ECSPI1_ADDR = 0x30820000,
231
+ FSL_IMX7_ECSPIn_SIZE = (4 * KiB),
232
233
- FSL_IMX7_ENET1_ADDR = 0x30BE0000,
234
- FSL_IMX7_ENET2_ADDR = 0x30BF0000,
235
+ /* AIPS-3 End */
236
237
- FSL_IMX7_USB1_ADDR = 0x30B10000,
238
- FSL_IMX7_USBMISC1_ADDR = 0x30B10200,
239
- FSL_IMX7_USB2_ADDR = 0x30B20000,
240
- FSL_IMX7_USBMISC2_ADDR = 0x30B20200,
241
- FSL_IMX7_USB3_ADDR = 0x30B30000,
242
- FSL_IMX7_USBMISC3_ADDR = 0x30B30200,
243
- FSL_IMX7_USBMISCn_SIZE = 0x200,
244
+ /* AIPS-2 Begin */
245
246
- FSL_IMX7_USDHC1_ADDR = 0x30B40000,
247
- FSL_IMX7_USDHC2_ADDR = 0x30B50000,
248
- FSL_IMX7_USDHC3_ADDR = 0x30B60000,
249
+ FSL_IMX7_AXI_DEBUG_MON_ADDR = 0x307E0000,
250
+ FSL_IMX7_AXI_DEBUG_MON_SIZE = (64 * KiB),
251
252
- FSL_IMX7_SDMA_ADDR = 0x30BD0000,
253
- FSL_IMX7_SDMA_SIZE = 0x1000,
254
+ FSL_IMX7_PERFMON2_ADDR = 0x307D0000,
255
+ FSL_IMX7_PERFMON1_ADDR = 0x307C0000,
256
+ FSL_IMX7_PERFMONn_SIZE = (64 * KiB),
257
+
258
+ FSL_IMX7_DDRC_ADDR = 0x307A0000,
259
+ FSL_IMX7_DDRC_SIZE = (4 * KiB),
260
+
261
+ FSL_IMX7_DDRC_PHY_ADDR = 0x30790000,
262
+ FSL_IMX7_DDRC_PHY_SIZE = (4 * KiB),
263
+
264
+ FSL_IMX7_TZASC_ADDR = 0x30780000,
265
+ FSL_IMX7_TZASC_SIZE = (64 * KiB),
266
+
267
+ FSL_IMX7_MIPI_DSI_ADDR = 0x30760000,
268
+ FSL_IMX7_MIPI_DSI_SIZE = (4 * KiB),
269
+
270
+ FSL_IMX7_MIPI_CSI_ADDR = 0x30750000,
271
+ FSL_IMX7_MIPI_CSI_SIZE = 0x4000,
272
+
273
+ FSL_IMX7_LCDIF_ADDR = 0x30730000,
274
+ FSL_IMX7_LCDIF_SIZE = 0x8000,
275
+
276
+ FSL_IMX7_CSI_ADDR = 0x30710000,
277
+ FSL_IMX7_CSI_SIZE = (4 * KiB),
278
+
279
+ FSL_IMX7_PXP_ADDR = 0x30700000,
280
+ FSL_IMX7_PXP_SIZE = 0x4000,
281
+
282
+ FSL_IMX7_EPDC_ADDR = 0x306F0000,
283
+ FSL_IMX7_EPDC_SIZE = (4 * KiB),
284
+
285
+ FSL_IMX7_PCIE_PHY_ADDR = 0x306D0000,
286
+ FSL_IMX7_PCIE_PHY_SIZE = (4 * KiB),
287
+
288
+ FSL_IMX7_SYSCNT_CTRL_ADDR = 0x306C0000,
289
+ FSL_IMX7_SYSCNT_CMP_ADDR = 0x306B0000,
290
+ FSL_IMX7_SYSCNT_RD_ADDR = 0x306A0000,
291
+
292
+ FSL_IMX7_PWM4_ADDR = 0x30690000,
293
+ FSL_IMX7_PWM3_ADDR = 0x30680000,
294
+ FSL_IMX7_PWM2_ADDR = 0x30670000,
295
+ FSL_IMX7_PWM1_ADDR = 0x30660000,
296
+ FSL_IMX7_PWMn_SIZE = (4 * KiB),
297
+
298
+ FSL_IMX7_FlEXTIMER2_ADDR = 0x30650000,
299
+ FSL_IMX7_FlEXTIMER1_ADDR = 0x30640000,
300
+ FSL_IMX7_FLEXTIMERn_SIZE = (4 * KiB),
301
+
302
+ FSL_IMX7_ECSPI4_ADDR = 0x30630000,
303
+
304
+ FSL_IMX7_ADC2_ADDR = 0x30620000,
305
+ FSL_IMX7_ADC1_ADDR = 0x30610000,
306
+ FSL_IMX7_ADCn_SIZE = (4 * KiB),
307
+
308
+ FSL_IMX7_AIPS2_CONF_ADDR = 0x305F0000,
309
+ FSL_IMX7_AIPS2_CONF_SIZE = (64 * KiB),
310
+
311
+ /* AIPS-2 End */
312
+
313
+ /* AIPS-1 Begin */
314
+
315
+ FSL_IMX7_CSU_ADDR = 0x303E0000,
316
+ FSL_IMX7_CSU_SIZE = (64 * KiB),
317
+
318
+ FSL_IMX7_RDC_ADDR = 0x303D0000,
319
+ FSL_IMX7_RDC_SIZE = (4 * KiB),
320
+
321
+ FSL_IMX7_SEMAPHORE2_ADDR = 0x303C0000,
322
+ FSL_IMX7_SEMAPHORE1_ADDR = 0x303B0000,
323
+ FSL_IMX7_SEMAPHOREn_SIZE = (4 * KiB),
324
+
325
+ FSL_IMX7_GPC_ADDR = 0x303A0000,
326
+
327
+ FSL_IMX7_SRC_ADDR = 0x30390000,
328
+ FSL_IMX7_SRC_SIZE = (4 * KiB),
329
+
330
+ FSL_IMX7_CCM_ADDR = 0x30380000,
331
+
332
+ FSL_IMX7_SNVS_HP_ADDR = 0x30370000,
333
+
334
+ FSL_IMX7_ANALOG_ADDR = 0x30360000,
335
+
336
+ FSL_IMX7_OCOTP_ADDR = 0x30350000,
337
+ FSL_IMX7_OCOTP_SIZE = 0x10000,
338
+
339
+ FSL_IMX7_IOMUXC_GPR_ADDR = 0x30340000,
340
+ FSL_IMX7_IOMUXC_GPR_SIZE = (4 * KiB),
341
+
342
+ FSL_IMX7_IOMUXC_ADDR = 0x30330000,
343
+ FSL_IMX7_IOMUXC_SIZE = (4 * KiB),
344
+
345
+ FSL_IMX7_KPP_ADDR = 0x30320000,
346
+ FSL_IMX7_KPP_SIZE = (4 * KiB),
347
+
348
+ FSL_IMX7_ROMCP_ADDR = 0x30310000,
349
+ FSL_IMX7_ROMCP_SIZE = (4 * KiB),
350
+
351
+ FSL_IMX7_GPT4_ADDR = 0x30300000,
352
+ FSL_IMX7_GPT3_ADDR = 0x302F0000,
353
+ FSL_IMX7_GPT2_ADDR = 0x302E0000,
354
+ FSL_IMX7_GPT1_ADDR = 0x302D0000,
355
+
356
+ FSL_IMX7_IOMUXC_LPSR_ADDR = 0x302C0000,
357
+ FSL_IMX7_IOMUXC_LPSR_SIZE = (4 * KiB),
358
+
359
+ FSL_IMX7_WDOG4_ADDR = 0x302B0000,
360
+ FSL_IMX7_WDOG3_ADDR = 0x302A0000,
361
+ FSL_IMX7_WDOG2_ADDR = 0x30290000,
362
+ FSL_IMX7_WDOG1_ADDR = 0x30280000,
363
+
364
+ FSL_IMX7_IOMUXC_LPSR_GPR_ADDR = 0x30270000,
365
+
366
+ FSL_IMX7_GPIO7_ADDR = 0x30260000,
367
+ FSL_IMX7_GPIO6_ADDR = 0x30250000,
368
+ FSL_IMX7_GPIO5_ADDR = 0x30240000,
369
+ FSL_IMX7_GPIO4_ADDR = 0x30230000,
370
+ FSL_IMX7_GPIO3_ADDR = 0x30220000,
371
+ FSL_IMX7_GPIO2_ADDR = 0x30210000,
372
+ FSL_IMX7_GPIO1_ADDR = 0x30200000,
373
+
374
+ FSL_IMX7_AIPS1_CONF_ADDR = 0x301F0000,
375
+ FSL_IMX7_AIPS1_CONF_SIZE = (64 * KiB),
376
377
- FSL_IMX7_A7MPCORE_ADDR = 0x31000000,
378
FSL_IMX7_A7MPCORE_DAP_ADDR = 0x30000000,
379
+ FSL_IMX7_A7MPCORE_DAP_SIZE = (1 * MiB),
380
381
- FSL_IMX7_PCIE_REG_ADDR = 0x33800000,
382
- FSL_IMX7_PCIE_REG_SIZE = 16 * 1024,
383
+ /* AIPS-1 End */
384
385
- FSL_IMX7_GPR_ADDR = 0x30340000,
386
+ FSL_IMX7_EIM_CS0_ADDR = 0x28000000,
387
+ FSL_IMX7_EIM_CS0_SIZE = (128 * MiB),
388
389
- FSL_IMX7_DMA_APBH_ADDR = 0x33000000,
390
- FSL_IMX7_DMA_APBH_SIZE = 0x2000,
391
+ FSL_IMX7_OCRAM_PXP_ADDR = 0x00940000,
392
+ FSL_IMX7_OCRAM_PXP_SIZE = (32 * KiB),
393
+
394
+ FSL_IMX7_OCRAM_EPDC_ADDR = 0x00920000,
395
+ FSL_IMX7_OCRAM_EPDC_SIZE = (128 * KiB),
396
+
397
+ FSL_IMX7_OCRAM_MEM_ADDR = 0x00900000,
398
+ FSL_IMX7_OCRAM_MEM_SIZE = (128 * KiB),
399
+
400
+ FSL_IMX7_TCMU_ADDR = 0x00800000,
401
+ FSL_IMX7_TCMU_SIZE = (32 * KiB),
402
+
403
+ FSL_IMX7_TCML_ADDR = 0x007F8000,
404
+ FSL_IMX7_TCML_SIZE = (32 * KiB),
405
+
406
+ FSL_IMX7_OCRAM_S_ADDR = 0x00180000,
407
+ FSL_IMX7_OCRAM_S_SIZE = (32 * KiB),
408
+
409
+ FSL_IMX7_CAAM_MEM_ADDR = 0x00100000,
410
+ FSL_IMX7_CAAM_MEM_SIZE = (32 * KiB),
411
+
412
+ FSL_IMX7_ROM_ADDR = 0x00000000,
413
+ FSL_IMX7_ROM_SIZE = (96 * KiB),
414
};
415
416
enum FslIMX7IRQs {
417
diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c
34
index XXXXXXX..XXXXXXX 100644
418
index XXXXXXX..XXXXXXX 100644
35
--- a/target/arm/translate.c
419
--- a/hw/arm/fsl-imx7.c
36
+++ b/target/arm/translate.c
420
+++ b/hw/arm/fsl-imx7.c
37
@@ -XXX,XX +XXX,XX @@ static bool trans_LE(DisasContext *s, arg_LE *a)
421
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_init(Object *obj)
38
* any faster.
422
char name[NAME_SIZE];
39
*/
423
int i;
40
TCGv_i32 tmp;
424
41
+ TCGLabel *loopend;
425
+ /*
42
+ bool fpu_active;
426
+ * CPUs
43
427
+ */
44
if (!dc_isar_feature(aa32_lob, s)) {
428
for (i = 0; i < MIN(ms->smp.cpus, FSL_IMX7_NUM_CPUS); i++) {
45
return false;
429
snprintf(name, NAME_SIZE, "cpu%d", i);
46
}
430
object_initialize_child(obj, name, &s->cpu[i],
47
+ if (a->f && a->tp) {
431
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_init(Object *obj)
48
+ return false;
432
TYPE_A15MPCORE_PRIV);
433
434
/*
435
- * GPIOs 1 to 7
436
+ * GPIOs
437
*/
438
for (i = 0; i < FSL_IMX7_NUM_GPIOS; i++) {
439
snprintf(name, NAME_SIZE, "gpio%d", i);
440
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_init(Object *obj)
441
}
442
443
/*
444
- * GPT1, 2, 3, 4
445
+ * GPTs
446
*/
447
for (i = 0; i < FSL_IMX7_NUM_GPTS; i++) {
448
snprintf(name, NAME_SIZE, "gpt%d", i);
449
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_init(Object *obj)
450
*/
451
object_initialize_child(obj, "gpcv2", &s->gpcv2, TYPE_IMX_GPCV2);
452
453
+ /*
454
+ * ECSPIs
455
+ */
456
for (i = 0; i < FSL_IMX7_NUM_ECSPIS; i++) {
457
snprintf(name, NAME_SIZE, "spi%d", i + 1);
458
object_initialize_child(obj, name, &s->spi[i], TYPE_IMX_SPI);
459
}
460
461
-
462
+ /*
463
+ * I2Cs
464
+ */
465
for (i = 0; i < FSL_IMX7_NUM_I2CS; i++) {
466
snprintf(name, NAME_SIZE, "i2c%d", i + 1);
467
object_initialize_child(obj, name, &s->i2c[i], TYPE_IMX_I2C);
468
}
469
470
/*
471
- * UART
472
+ * UARTs
473
*/
474
for (i = 0; i < FSL_IMX7_NUM_UARTS; i++) {
475
snprintf(name, NAME_SIZE, "uart%d", i);
476
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_init(Object *obj)
477
}
478
479
/*
480
- * Ethernet
481
+ * Ethernets
482
*/
483
for (i = 0; i < FSL_IMX7_NUM_ETHS; i++) {
484
snprintf(name, NAME_SIZE, "eth%d", i);
485
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_init(Object *obj)
486
}
487
488
/*
489
- * SDHCI
490
+ * SDHCIs
491
*/
492
for (i = 0; i < FSL_IMX7_NUM_USDHCS; i++) {
493
snprintf(name, NAME_SIZE, "usdhc%d", i);
494
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_init(Object *obj)
495
object_initialize_child(obj, "snvs", &s->snvs, TYPE_IMX7_SNVS);
496
497
/*
498
- * Watchdog
499
+ * Watchdogs
500
*/
501
for (i = 0; i < FSL_IMX7_NUM_WDTS; i++) {
502
snprintf(name, NAME_SIZE, "wdt%d", i);
503
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_init(Object *obj)
504
*/
505
object_initialize_child(obj, "gpr", &s->gpr, TYPE_IMX7_GPR);
506
507
+ /*
508
+ * PCIE
509
+ */
510
object_initialize_child(obj, "pcie", &s->pcie, TYPE_DESIGNWARE_PCIE_HOST);
511
512
+ /*
513
+ * USBs
514
+ */
515
for (i = 0; i < FSL_IMX7_NUM_USBS; i++) {
516
snprintf(name, NAME_SIZE, "usb%d", i);
517
object_initialize_child(obj, name, &s->usb[i], TYPE_CHIPIDEA);
518
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
519
return;
520
}
521
522
+ /*
523
+ * CPUs
524
+ */
525
for (i = 0; i < smp_cpus; i++) {
526
o = OBJECT(&s->cpu[i]);
527
528
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
529
* A7MPCORE DAP
530
*/
531
create_unimplemented_device("a7mpcore-dap", FSL_IMX7_A7MPCORE_DAP_ADDR,
532
- 0x100000);
533
+ FSL_IMX7_A7MPCORE_DAP_SIZE);
534
535
/*
536
- * GPT1, 2, 3, 4
537
+ * GPTs
538
*/
539
for (i = 0; i < FSL_IMX7_NUM_GPTS; i++) {
540
static const hwaddr FSL_IMX7_GPTn_ADDR[FSL_IMX7_NUM_GPTS] = {
541
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
542
FSL_IMX7_GPTn_IRQ[i]));
543
}
544
545
+ /*
546
+ * GPIOs
547
+ */
548
for (i = 0; i < FSL_IMX7_NUM_GPIOS; i++) {
549
static const hwaddr FSL_IMX7_GPIOn_ADDR[FSL_IMX7_NUM_GPIOS] = {
550
FSL_IMX7_GPIO1_ADDR,
551
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
552
/*
553
* IOMUXC and IOMUXC_LPSR
554
*/
555
- for (i = 0; i < FSL_IMX7_NUM_IOMUXCS; i++) {
556
- static const hwaddr FSL_IMX7_IOMUXCn_ADDR[FSL_IMX7_NUM_IOMUXCS] = {
557
- FSL_IMX7_IOMUXC_ADDR,
558
- FSL_IMX7_IOMUXC_LPSR_ADDR,
559
- };
560
-
561
- snprintf(name, NAME_SIZE, "iomuxc%d", i);
562
- create_unimplemented_device(name, FSL_IMX7_IOMUXCn_ADDR[i],
563
- FSL_IMX7_IOMUXCn_SIZE);
564
- }
565
+ create_unimplemented_device("iomuxc", FSL_IMX7_IOMUXC_ADDR,
566
+ FSL_IMX7_IOMUXC_SIZE);
567
+ create_unimplemented_device("iomuxc_lspr", FSL_IMX7_IOMUXC_LPSR_ADDR,
568
+ FSL_IMX7_IOMUXC_LPSR_SIZE);
569
570
/*
571
* CCM
572
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
573
sysbus_realize(SYS_BUS_DEVICE(&s->gpcv2), &error_abort);
574
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpcv2), 0, FSL_IMX7_GPC_ADDR);
575
576
- /* Initialize all ECSPI */
577
+ /*
578
+ * ECSPIs
579
+ */
580
for (i = 0; i < FSL_IMX7_NUM_ECSPIS; i++) {
581
static const hwaddr FSL_IMX7_SPIn_ADDR[FSL_IMX7_NUM_ECSPIS] = {
582
FSL_IMX7_ECSPI1_ADDR,
583
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
584
FSL_IMX7_SPIn_IRQ[i]));
585
}
586
587
+ /*
588
+ * I2Cs
589
+ */
590
for (i = 0; i < FSL_IMX7_NUM_I2CS; i++) {
591
static const hwaddr FSL_IMX7_I2Cn_ADDR[FSL_IMX7_NUM_I2CS] = {
592
FSL_IMX7_I2C1_ADDR,
593
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
594
}
595
596
/*
597
- * UART
598
+ * UARTs
599
*/
600
for (i = 0; i < FSL_IMX7_NUM_UARTS; i++) {
601
static const hwaddr FSL_IMX7_UARTn_ADDR[FSL_IMX7_NUM_UARTS] = {
602
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
603
}
604
605
/*
606
- * Ethernet
607
+ * Ethernets
608
*
609
* We must use two loops since phy_connected affects the other interface
610
* and we have to set all properties before calling sysbus_realize().
611
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
612
}
613
614
/*
615
- * USDHC
616
+ * USDHCs
617
*/
618
for (i = 0; i < FSL_IMX7_NUM_USDHCS; i++) {
619
static const hwaddr FSL_IMX7_USDHCn_ADDR[FSL_IMX7_NUM_USDHCS] = {
620
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
621
* SNVS
622
*/
623
sysbus_realize(SYS_BUS_DEVICE(&s->snvs), &error_abort);
624
- sysbus_mmio_map(SYS_BUS_DEVICE(&s->snvs), 0, FSL_IMX7_SNVS_ADDR);
625
+ sysbus_mmio_map(SYS_BUS_DEVICE(&s->snvs), 0, FSL_IMX7_SNVS_HP_ADDR);
626
627
/*
628
* SRC
629
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
630
create_unimplemented_device("src", FSL_IMX7_SRC_ADDR, FSL_IMX7_SRC_SIZE);
631
632
/*
633
- * Watchdog
634
+ * Watchdogs
635
*/
636
for (i = 0; i < FSL_IMX7_NUM_WDTS; i++) {
637
static const hwaddr FSL_IMX7_WDOGn_ADDR[FSL_IMX7_NUM_WDTS] = {
638
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
639
create_unimplemented_device("caam", FSL_IMX7_CAAM_ADDR, FSL_IMX7_CAAM_SIZE);
640
641
/*
642
- * PWM
643
+ * PWMs
644
*/
645
- create_unimplemented_device("pwm1", FSL_IMX7_PWM1_ADDR, FSL_IMX7_PWMn_SIZE);
646
- create_unimplemented_device("pwm2", FSL_IMX7_PWM2_ADDR, FSL_IMX7_PWMn_SIZE);
647
- create_unimplemented_device("pwm3", FSL_IMX7_PWM3_ADDR, FSL_IMX7_PWMn_SIZE);
648
- create_unimplemented_device("pwm4", FSL_IMX7_PWM4_ADDR, FSL_IMX7_PWMn_SIZE);
649
+ for (i = 0; i < FSL_IMX7_NUM_PWMS; i++) {
650
+ static const hwaddr FSL_IMX7_PWMn_ADDR[FSL_IMX7_NUM_PWMS] = {
651
+ FSL_IMX7_PWM1_ADDR,
652
+ FSL_IMX7_PWM2_ADDR,
653
+ FSL_IMX7_PWM3_ADDR,
654
+ FSL_IMX7_PWM4_ADDR,
655
+ };
656
+
657
+ snprintf(name, NAME_SIZE, "pwm%d", i);
658
+ create_unimplemented_device(name, FSL_IMX7_PWMn_ADDR[i],
659
+ FSL_IMX7_PWMn_SIZE);
49
+ }
660
+ }
50
+ if (s->condexec_mask) {
661
51
+ /*
662
/*
52
+ * LE in an IT block is CONSTRAINED UNPREDICTABLE;
663
- * CAN
53
+ * we choose to UNDEF, because otherwise our use of
664
+ * CANs
54
+ * gen_goto_tb(1) would clash with the use of TB exit 1
665
*/
55
+ * in the dc->condjmp condition-failed codepath in
666
- create_unimplemented_device("can1", FSL_IMX7_CAN1_ADDR, FSL_IMX7_CANn_SIZE);
56
+ * arm_tr_tb_stop() and we'd get an assertion.
667
- create_unimplemented_device("can2", FSL_IMX7_CAN2_ADDR, FSL_IMX7_CANn_SIZE);
57
+ */
668
+ for (i = 0; i < FSL_IMX7_NUM_CANS; i++) {
58
+ return false;
669
+ static const hwaddr FSL_IMX7_CANn_ADDR[FSL_IMX7_NUM_CANS] = {
670
+ FSL_IMX7_CAN1_ADDR,
671
+ FSL_IMX7_CAN2_ADDR,
672
+ };
673
+
674
+ snprintf(name, NAME_SIZE, "can%d", i);
675
+ create_unimplemented_device(name, FSL_IMX7_CANn_ADDR[i],
676
+ FSL_IMX7_CANn_SIZE);
59
+ }
677
+ }
60
+ if (a->tp) {
678
61
+ /* LETP */
679
/*
62
+ if (!dc_isar_feature(aa32_mve, s)) {
680
- * SAI (Audio SSI (Synchronous Serial Interface))
63
+ return false;
681
+ * SAIs (Audio SSI (Synchronous Serial Interface))
64
+ }
682
*/
65
+ if (!vfp_access_check(s)) {
683
- create_unimplemented_device("sai1", FSL_IMX7_SAI1_ADDR, FSL_IMX7_SAIn_SIZE);
66
+ s->eci_handled = true;
684
- create_unimplemented_device("sai2", FSL_IMX7_SAI2_ADDR, FSL_IMX7_SAIn_SIZE);
67
+ return true;
685
- create_unimplemented_device("sai2", FSL_IMX7_SAI3_ADDR, FSL_IMX7_SAIn_SIZE);
68
+ }
686
+ for (i = 0; i < FSL_IMX7_NUM_SAIS; i++) {
687
+ static const hwaddr FSL_IMX7_SAIn_ADDR[FSL_IMX7_NUM_SAIS] = {
688
+ FSL_IMX7_SAI1_ADDR,
689
+ FSL_IMX7_SAI2_ADDR,
690
+ FSL_IMX7_SAI3_ADDR,
691
+ };
692
+
693
+ snprintf(name, NAME_SIZE, "sai%d", i);
694
+ create_unimplemented_device(name, FSL_IMX7_SAIn_ADDR[i],
695
+ FSL_IMX7_SAIn_SIZE);
69
+ }
696
+ }
70
697
71
/* LE/LETP is OK with ECI set and leaves it untouched */
698
/*
72
s->eci_handled = true;
699
* OCOTP
73
700
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
74
- if (!a->f) {
701
create_unimplemented_device("ocotp", FSL_IMX7_OCOTP_ADDR,
75
- /* Not loop-forever. If LR <= 1 this is the last loop: do nothing. */
702
FSL_IMX7_OCOTP_SIZE);
76
- arm_gen_condlabel(s);
703
77
- tcg_gen_brcondi_i32(TCG_COND_LEU, cpu_R[14], 1, s->condlabel);
704
+ /*
78
- /* Decrement LR */
705
+ * GPR
79
- tmp = load_reg(s, 14);
706
+ */
80
- tcg_gen_addi_i32(tmp, tmp, -1);
707
sysbus_realize(SYS_BUS_DEVICE(&s->gpr), &error_abort);
81
- store_reg(s, 14, tmp);
708
- sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpr), 0, FSL_IMX7_GPR_ADDR);
82
+ /*
709
+ sysbus_mmio_map(SYS_BUS_DEVICE(&s->gpr), 0, FSL_IMX7_IOMUXC_GPR_ADDR);
83
+ * With MVE, LTPSIZE might not be 4, and we must emit an INVSTATE
710
84
+ * UsageFault exception for the LE insn in that case. Note that we
711
+ /*
85
+ * are not directly checking FPSCR.LTPSIZE but instead check the
712
+ * PCIE
86
+ * pseudocode LTPSIZE() function, which returns 4 if the FPU is
713
+ */
87
+ * not currently active (ie ActiveFPState() returns false). We
714
sysbus_realize(SYS_BUS_DEVICE(&s->pcie), &error_abort);
88
+ * can identify not-active purely from our TB state flags, as the
715
sysbus_mmio_map(SYS_BUS_DEVICE(&s->pcie), 0, FSL_IMX7_PCIE_REG_ADDR);
89
+ * FPU is active only if:
716
90
+ * the FPU is enabled
717
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
91
+ * AND lazy state preservation is not active
718
irq = qdev_get_gpio_in(DEVICE(&s->a7mpcore), FSL_IMX7_PCI_INTD_IRQ);
92
+ * AND we do not need a new fp context (this is the ASPEN/FPCA check)
719
sysbus_connect_irq(SYS_BUS_DEVICE(&s->pcie), 3, irq);
93
+ *
720
94
+ * Usually we don't need to care about this distinction between
721
-
95
+ * LTPSIZE and FPSCR.LTPSIZE, because the code in vfp_access_check()
722
+ /*
96
+ * will either take an exception or clear the conditions that make
723
+ * USBs
97
+ * the FPU not active. But LE is an unusual case of a non-FP insn
724
+ */
98
+ * that looks at LTPSIZE.
725
for (i = 0; i < FSL_IMX7_NUM_USBS; i++) {
99
+ */
726
static const hwaddr FSL_IMX7_USBMISCn_ADDR[FSL_IMX7_NUM_USBS] = {
100
+ fpu_active = !s->fp_excp_el && !s->v7m_lspact && !s->v7m_new_fp_ctxt_needed;
727
FSL_IMX7_USBMISC1_ADDR,
101
+
728
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
102
+ if (!a->tp && dc_isar_feature(aa32_mve, s) && fpu_active) {
729
*/
103
+ /* Need to do a runtime check for LTPSIZE != 4 */
730
create_unimplemented_device("pcie-phy", FSL_IMX7_PCIE_PHY_ADDR,
104
+ TCGLabel *skipexc = gen_new_label();
731
FSL_IMX7_PCIE_PHY_SIZE);
105
+ tmp = load_cpu_field(v7m.ltpsize);
732
+
106
+ tcg_gen_brcondi_i32(TCG_COND_EQ, tmp, 4, skipexc);
107
+ tcg_temp_free_i32(tmp);
108
+ gen_exception_insn(s, s->pc_curr, EXCP_INVSTATE, syn_uncategorized(),
109
+ default_exception_el(s));
110
+ gen_set_label(skipexc);
111
+ }
112
+
113
+ if (a->f) {
114
+ /* Loop-forever: just jump back to the loop start */
115
+ gen_jmp(s, read_pc(s) - a->imm);
116
+ return true;
117
+ }
118
+
119
+ /*
120
+ * Not loop-forever. If LR <= loop-decrement-value this is the last loop.
121
+ * For LE, we know at this point that LTPSIZE must be 4 and the
122
+ * loop decrement value is 1. For LETP we need to calculate the decrement
123
+ * value from LTPSIZE.
124
+ */
125
+ loopend = gen_new_label();
126
+ if (!a->tp) {
127
+ tcg_gen_brcondi_i32(TCG_COND_LEU, cpu_R[14], 1, loopend);
128
+ tcg_gen_addi_i32(cpu_R[14], cpu_R[14], -1);
129
+ } else {
130
+ /*
131
+ * Decrement by 1 << (4 - LTPSIZE). We need to use a TCG local
132
+ * so that decr stays live after the brcondi.
133
+ */
134
+ TCGv_i32 decr = tcg_temp_local_new_i32();
135
+ TCGv_i32 ltpsize = load_cpu_field(v7m.ltpsize);
136
+ tcg_gen_sub_i32(decr, tcg_constant_i32(4), ltpsize);
137
+ tcg_gen_shl_i32(decr, tcg_constant_i32(1), decr);
138
+ tcg_temp_free_i32(ltpsize);
139
+
140
+ tcg_gen_brcond_i32(TCG_COND_LEU, cpu_R[14], decr, loopend);
141
+
142
+ tcg_gen_sub_i32(cpu_R[14], cpu_R[14], decr);
143
+ tcg_temp_free_i32(decr);
144
}
145
/* Jump back to the loop start */
146
gen_jmp(s, read_pc(s) - a->imm);
147
+
148
+ gen_set_label(loopend);
149
+ if (a->tp) {
150
+ /* Exits from tail-pred loops must reset LTPSIZE to 4 */
151
+ tmp = tcg_const_i32(4);
152
+ store_cpu_field(tmp, v7m.ltpsize);
153
+ }
154
+ /* End TB, continuing to following insn */
155
+ gen_jmp_tb(s, s->base.pc_next, 1);
156
return true;
157
}
733
}
158
734
735
static Property fsl_imx7_properties[] = {
159
--
736
--
160
2.20.1
737
2.34.1
161
162
diff view generated by jsdifflib
1
From: Patrick Venture <venture@google.com>
1
From: Jean-Christophe Dubois <jcd@tribudubois.net>
2
2
3
Adds comments to the board init to identify missing i2c devices.
3
* Add TZASC as unimplemented device.
4
- Allow bare metal application to access this (unimplemented) device
5
* Add CSU as unimplemented device.
6
- Allow bare metal application to access this (unimplemented) device
7
* Add various memory segments
8
- OCRAM
9
- OCRAM EPDC
10
- OCRAM PXP
11
- OCRAM S
12
- ROM
13
- CAAM
4
14
5
Signed-off-by: Patrick Venture <venture@google.com>
15
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
6
Reviewed-by: Hao Wu <wuhaotsh@google.com>
16
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
7
Reviewed-by: Joel Stanley <joel@jms.id.au>
17
Message-id: f887a3483996ba06d40bd62ffdfb0ecf68621987.1692964892.git.jcd@tribudubois.net
8
Message-id: 20210608202522.2677850-2-venture@google.com
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
18
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
---
19
---
11
hw/arm/npcm7xx_boards.c | 16 +++++++++++++++-
20
include/hw/arm/fsl-imx7.h | 7 +++++
12
1 file changed, 15 insertions(+), 1 deletion(-)
21
hw/arm/fsl-imx7.c | 63 +++++++++++++++++++++++++++++++++++++++
22
2 files changed, 70 insertions(+)
13
23
14
diff --git a/hw/arm/npcm7xx_boards.c b/hw/arm/npcm7xx_boards.c
24
diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h
15
index XXXXXXX..XXXXXXX 100644
25
index XXXXXXX..XXXXXXX 100644
16
--- a/hw/arm/npcm7xx_boards.c
26
--- a/include/hw/arm/fsl-imx7.h
17
+++ b/hw/arm/npcm7xx_boards.c
27
+++ b/include/hw/arm/fsl-imx7.h
18
@@ -XXX,XX +XXX,XX @@ static void quanta_gsj_i2c_init(NPCM7xxState *soc)
28
@@ -XXX,XX +XXX,XX @@ struct FslIMX7State {
19
at24c_eeprom_init(soc, 9, 0x55, 8192);
29
IMX7GPRState gpr;
20
at24c_eeprom_init(soc, 10, 0x55, 8192);
30
ChipideaState usb[FSL_IMX7_NUM_USBS];
21
31
DesignwarePCIEHost pcie;
22
- /* TODO: Add additional i2c devices. */
32
+ MemoryRegion rom;
33
+ MemoryRegion caam;
34
+ MemoryRegion ocram;
35
+ MemoryRegion ocram_epdc;
36
+ MemoryRegion ocram_pxp;
37
+ MemoryRegion ocram_s;
38
+
39
uint32_t phy_num[FSL_IMX7_NUM_ETHS];
40
bool phy_connected[FSL_IMX7_NUM_ETHS];
41
};
42
diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c
43
index XXXXXXX..XXXXXXX 100644
44
--- a/hw/arm/fsl-imx7.c
45
+++ b/hw/arm/fsl-imx7.c
46
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
47
create_unimplemented_device("pcie-phy", FSL_IMX7_PCIE_PHY_ADDR,
48
FSL_IMX7_PCIE_PHY_SIZE);
49
23
+ /*
50
+ /*
24
+ * i2c-11:
51
+ * CSU
25
+ * - power-brick@36: delta,dps800
26
+ * - hotswap@15: ti,lm5066i
27
+ */
52
+ */
53
+ create_unimplemented_device("csu", FSL_IMX7_CSU_ADDR,
54
+ FSL_IMX7_CSU_SIZE);
28
+
55
+
29
+ /*
56
+ /*
30
+ * i2c-12:
57
+ * TZASC
31
+ * - ucd90160@6b
32
+ */
58
+ */
59
+ create_unimplemented_device("tzasc", FSL_IMX7_TZASC_ADDR,
60
+ FSL_IMX7_TZASC_SIZE);
33
+
61
+
34
+ /*
62
+ /*
35
+ * i2c-15:
63
+ * OCRAM memory
36
+ * - pca9548@75
37
+ */
64
+ */
65
+ memory_region_init_ram(&s->ocram, NULL, "imx7.ocram",
66
+ FSL_IMX7_OCRAM_MEM_SIZE,
67
+ &error_abort);
68
+ memory_region_add_subregion(get_system_memory(), FSL_IMX7_OCRAM_MEM_ADDR,
69
+ &s->ocram);
70
+
71
+ /*
72
+ * OCRAM EPDC memory
73
+ */
74
+ memory_region_init_ram(&s->ocram_epdc, NULL, "imx7.ocram_epdc",
75
+ FSL_IMX7_OCRAM_EPDC_SIZE,
76
+ &error_abort);
77
+ memory_region_add_subregion(get_system_memory(), FSL_IMX7_OCRAM_EPDC_ADDR,
78
+ &s->ocram_epdc);
79
+
80
+ /*
81
+ * OCRAM PXP memory
82
+ */
83
+ memory_region_init_ram(&s->ocram_pxp, NULL, "imx7.ocram_pxp",
84
+ FSL_IMX7_OCRAM_PXP_SIZE,
85
+ &error_abort);
86
+ memory_region_add_subregion(get_system_memory(), FSL_IMX7_OCRAM_PXP_ADDR,
87
+ &s->ocram_pxp);
88
+
89
+ /*
90
+ * OCRAM_S memory
91
+ */
92
+ memory_region_init_ram(&s->ocram_s, NULL, "imx7.ocram_s",
93
+ FSL_IMX7_OCRAM_S_SIZE,
94
+ &error_abort);
95
+ memory_region_add_subregion(get_system_memory(), FSL_IMX7_OCRAM_S_ADDR,
96
+ &s->ocram_s);
97
+
98
+ /*
99
+ * ROM memory
100
+ */
101
+ memory_region_init_rom(&s->rom, OBJECT(dev), "imx7.rom",
102
+ FSL_IMX7_ROM_SIZE, &error_abort);
103
+ memory_region_add_subregion(get_system_memory(), FSL_IMX7_ROM_ADDR,
104
+ &s->rom);
105
+
106
+ /*
107
+ * CAAM memory
108
+ */
109
+ memory_region_init_rom(&s->caam, OBJECT(dev), "imx7.caam",
110
+ FSL_IMX7_CAAM_MEM_SIZE, &error_abort);
111
+ memory_region_add_subregion(get_system_memory(), FSL_IMX7_CAAM_MEM_ADDR,
112
+ &s->caam);
38
}
113
}
39
114
40
static void quanta_gsj_fan_init(NPCM7xxMachine *machine, NPCM7xxState *soc)
115
static Property fsl_imx7_properties[] = {
41
--
116
--
42
2.20.1
117
2.34.1
43
118
44
119
diff view generated by jsdifflib
1
Generic code in target/arm wants to call acpi_ghes_record_errors();
1
From: Jean-Christophe Dubois <jcd@tribudubois.net>
2
provide a stub version so that we don't fail to link when
2
3
CONFIG_ACPI_APEI is not set. This requires us to add a new
3
The SRC device is normally used to start the secondary CPU.
4
ghes-stub.c file to contain it and the meson.build mechanics
4
5
to use it when appropriate.
5
When running Linux directly, QEMU is emulating a PSCI interface that UBOOT
6
6
is installing at boot time and therefore the fact that the SRC device is
7
unimplemented is hidden as Qemu respond directly to PSCI requets without
8
using the SRC device.
9
10
But if you try to run a more bare metal application (maybe uboot itself),
11
then it is not possible to start the secondary CPU as the SRC is an
12
unimplemented device.
13
14
This patch adds the ability to start the secondary CPU through the SRC
15
device so that you can use this feature in bare metal applications.
16
17
Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
18
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
19
Message-id: ce9a0162defd2acee5dc7f8a674743de0cded569.1692964892.git.jcd@tribudubois.net
7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
20
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
9
Reviewed-by: Dongjiu Geng <gengdongjiu1@gmail.com>
10
Message-id: 20210603171259.27962-2-peter.maydell@linaro.org
11
---
21
---
12
hw/acpi/ghes-stub.c | 17 +++++++++++++++++
22
include/hw/arm/fsl-imx7.h | 3 +-
13
hw/acpi/meson.build | 6 +++---
23
include/hw/misc/imx7_src.h | 66 +++++++++
14
2 files changed, 20 insertions(+), 3 deletions(-)
24
hw/arm/fsl-imx7.c | 8 +-
15
create mode 100644 hw/acpi/ghes-stub.c
25
hw/misc/imx7_src.c | 276 +++++++++++++++++++++++++++++++++++++
16
26
hw/misc/meson.build | 1 +
17
diff --git a/hw/acpi/ghes-stub.c b/hw/acpi/ghes-stub.c
27
hw/misc/trace-events | 4 +
28
6 files changed, 356 insertions(+), 2 deletions(-)
29
create mode 100644 include/hw/misc/imx7_src.h
30
create mode 100644 hw/misc/imx7_src.c
31
32
diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h
33
index XXXXXXX..XXXXXXX 100644
34
--- a/include/hw/arm/fsl-imx7.h
35
+++ b/include/hw/arm/fsl-imx7.h
36
@@ -XXX,XX +XXX,XX @@
37
#include "hw/misc/imx7_ccm.h"
38
#include "hw/misc/imx7_snvs.h"
39
#include "hw/misc/imx7_gpr.h"
40
+#include "hw/misc/imx7_src.h"
41
#include "hw/watchdog/wdt_imx2.h"
42
#include "hw/gpio/imx_gpio.h"
43
#include "hw/char/imx_serial.h"
44
@@ -XXX,XX +XXX,XX @@ struct FslIMX7State {
45
IMX7CCMState ccm;
46
IMX7AnalogState analog;
47
IMX7SNVSState snvs;
48
+ IMX7SRCState src;
49
IMXGPCv2State gpcv2;
50
IMXSPIState spi[FSL_IMX7_NUM_ECSPIS];
51
IMXI2CState i2c[FSL_IMX7_NUM_I2CS];
52
@@ -XXX,XX +XXX,XX @@ enum FslIMX7MemoryMap {
53
FSL_IMX7_GPC_ADDR = 0x303A0000,
54
55
FSL_IMX7_SRC_ADDR = 0x30390000,
56
- FSL_IMX7_SRC_SIZE = (4 * KiB),
57
58
FSL_IMX7_CCM_ADDR = 0x30380000,
59
60
diff --git a/include/hw/misc/imx7_src.h b/include/hw/misc/imx7_src.h
18
new file mode 100644
61
new file mode 100644
19
index XXXXXXX..XXXXXXX
62
index XXXXXXX..XXXXXXX
20
--- /dev/null
63
--- /dev/null
21
+++ b/hw/acpi/ghes-stub.c
64
+++ b/include/hw/misc/imx7_src.h
22
@@ -XXX,XX +XXX,XX @@
65
@@ -XXX,XX +XXX,XX @@
23
+/*
66
+/*
24
+ * Support for generating APEI tables and recording CPER for Guests:
67
+ * IMX7 System Reset Controller
25
+ * stub functions.
26
+ *
68
+ *
27
+ * Copyright (c) 2021 Linaro, Ltd
69
+ * Copyright (C) 2023 Jean-Christophe Dubois <jcd@tribudubois.net>
28
+ *
70
+ *
29
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
71
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
30
+ * See the COPYING file in the top-level directory.
72
+ * See the COPYING file in the top-level directory.
31
+ */
73
+ */
32
+
74
+
75
+#ifndef IMX7_SRC_H
76
+#define IMX7_SRC_H
77
+
78
+#include "hw/sysbus.h"
79
+#include "qemu/bitops.h"
80
+#include "qom/object.h"
81
+
82
+#define SRC_SCR 0
83
+#define SRC_A7RCR0 1
84
+#define SRC_A7RCR1 2
85
+#define SRC_M4RCR 3
86
+#define SRC_ERCR 5
87
+#define SRC_HSICPHY_RCR 7
88
+#define SRC_USBOPHY1_RCR 8
89
+#define SRC_USBOPHY2_RCR 9
90
+#define SRC_MPIPHY_RCR 10
91
+#define SRC_PCIEPHY_RCR 11
92
+#define SRC_SBMR1 22
93
+#define SRC_SRSR 23
94
+#define SRC_SISR 26
95
+#define SRC_SIMR 27
96
+#define SRC_SBMR2 28
97
+#define SRC_GPR1 29
98
+#define SRC_GPR2 30
99
+#define SRC_GPR3 31
100
+#define SRC_GPR4 32
101
+#define SRC_GPR5 33
102
+#define SRC_GPR6 34
103
+#define SRC_GPR7 35
104
+#define SRC_GPR8 36
105
+#define SRC_GPR9 37
106
+#define SRC_GPR10 38
107
+#define SRC_MAX 39
108
+
109
+/* SRC_A7SCR1 */
110
+#define R_CORE1_ENABLE_SHIFT 1
111
+#define R_CORE1_ENABLE_LENGTH 1
112
+/* SRC_A7SCR0 */
113
+#define R_CORE1_RST_SHIFT 5
114
+#define R_CORE1_RST_LENGTH 1
115
+#define R_CORE0_RST_SHIFT 4
116
+#define R_CORE0_RST_LENGTH 1
117
+
118
+#define TYPE_IMX7_SRC "imx7.src"
119
+OBJECT_DECLARE_SIMPLE_TYPE(IMX7SRCState, IMX7_SRC)
120
+
121
+struct IMX7SRCState {
122
+ /* <private> */
123
+ SysBusDevice parent_obj;
124
+
125
+ /* <public> */
126
+ MemoryRegion iomem;
127
+
128
+ uint32_t regs[SRC_MAX];
129
+};
130
+
131
+#endif /* IMX7_SRC_H */
132
diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c
133
index XXXXXXX..XXXXXXX 100644
134
--- a/hw/arm/fsl-imx7.c
135
+++ b/hw/arm/fsl-imx7.c
136
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_init(Object *obj)
137
*/
138
object_initialize_child(obj, "gpcv2", &s->gpcv2, TYPE_IMX_GPCV2);
139
140
+ /*
141
+ * SRC
142
+ */
143
+ object_initialize_child(obj, "src", &s->src, TYPE_IMX7_SRC);
144
+
145
/*
146
* ECSPIs
147
*/
148
@@ -XXX,XX +XXX,XX @@ static void fsl_imx7_realize(DeviceState *dev, Error **errp)
149
/*
150
* SRC
151
*/
152
- create_unimplemented_device("src", FSL_IMX7_SRC_ADDR, FSL_IMX7_SRC_SIZE);
153
+ sysbus_realize(SYS_BUS_DEVICE(&s->src), &error_abort);
154
+ sysbus_mmio_map(SYS_BUS_DEVICE(&s->src), 0, FSL_IMX7_SRC_ADDR);
155
156
/*
157
* Watchdogs
158
diff --git a/hw/misc/imx7_src.c b/hw/misc/imx7_src.c
159
new file mode 100644
160
index XXXXXXX..XXXXXXX
161
--- /dev/null
162
+++ b/hw/misc/imx7_src.c
163
@@ -XXX,XX +XXX,XX @@
164
+/*
165
+ * IMX7 System Reset Controller
166
+ *
167
+ * Copyright (c) 2023 Jean-Christophe Dubois <jcd@tribudubois.net>
168
+ *
169
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
170
+ * See the COPYING file in the top-level directory.
171
+ *
172
+ */
173
+
33
+#include "qemu/osdep.h"
174
+#include "qemu/osdep.h"
34
+#include "hw/acpi/ghes.h"
175
+#include "hw/misc/imx7_src.h"
35
+
176
+#include "migration/vmstate.h"
36
+int acpi_ghes_record_errors(uint8_t source_id, uint64_t physical_address)
177
+#include "qemu/bitops.h"
37
+{
178
+#include "qemu/log.h"
38
+ return -1;
179
+#include "qemu/main-loop.h"
39
+}
180
+#include "qemu/module.h"
40
diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build
181
+#include "target/arm/arm-powerctl.h"
182
+#include "hw/core/cpu.h"
183
+#include "hw/registerfields.h"
184
+
185
+#include "trace.h"
186
+
187
+static const char *imx7_src_reg_name(uint32_t reg)
188
+{
189
+ static char unknown[20];
190
+
191
+ switch (reg) {
192
+ case SRC_SCR:
193
+ return "SRC_SCR";
194
+ case SRC_A7RCR0:
195
+ return "SRC_A7RCR0";
196
+ case SRC_A7RCR1:
197
+ return "SRC_A7RCR1";
198
+ case SRC_M4RCR:
199
+ return "SRC_M4RCR";
200
+ case SRC_ERCR:
201
+ return "SRC_ERCR";
202
+ case SRC_HSICPHY_RCR:
203
+ return "SRC_HSICPHY_RCR";
204
+ case SRC_USBOPHY1_RCR:
205
+ return "SRC_USBOPHY1_RCR";
206
+ case SRC_USBOPHY2_RCR:
207
+ return "SRC_USBOPHY2_RCR";
208
+ case SRC_PCIEPHY_RCR:
209
+ return "SRC_PCIEPHY_RCR";
210
+ case SRC_SBMR1:
211
+ return "SRC_SBMR1";
212
+ case SRC_SRSR:
213
+ return "SRC_SRSR";
214
+ case SRC_SISR:
215
+ return "SRC_SISR";
216
+ case SRC_SIMR:
217
+ return "SRC_SIMR";
218
+ case SRC_SBMR2:
219
+ return "SRC_SBMR2";
220
+ case SRC_GPR1:
221
+ return "SRC_GPR1";
222
+ case SRC_GPR2:
223
+ return "SRC_GPR2";
224
+ case SRC_GPR3:
225
+ return "SRC_GPR3";
226
+ case SRC_GPR4:
227
+ return "SRC_GPR4";
228
+ case SRC_GPR5:
229
+ return "SRC_GPR5";
230
+ case SRC_GPR6:
231
+ return "SRC_GPR6";
232
+ case SRC_GPR7:
233
+ return "SRC_GPR7";
234
+ case SRC_GPR8:
235
+ return "SRC_GPR8";
236
+ case SRC_GPR9:
237
+ return "SRC_GPR9";
238
+ case SRC_GPR10:
239
+ return "SRC_GPR10";
240
+ default:
241
+ sprintf(unknown, "%u ?", reg);
242
+ return unknown;
243
+ }
244
+}
245
+
246
+static const VMStateDescription vmstate_imx7_src = {
247
+ .name = TYPE_IMX7_SRC,
248
+ .version_id = 1,
249
+ .minimum_version_id = 1,
250
+ .fields = (VMStateField[]) {
251
+ VMSTATE_UINT32_ARRAY(regs, IMX7SRCState, SRC_MAX),
252
+ VMSTATE_END_OF_LIST()
253
+ },
254
+};
255
+
256
+static void imx7_src_reset(DeviceState *dev)
257
+{
258
+ IMX7SRCState *s = IMX7_SRC(dev);
259
+
260
+ memset(s->regs, 0, sizeof(s->regs));
261
+
262
+ /* Set reset values */
263
+ s->regs[SRC_SCR] = 0xA0;
264
+ s->regs[SRC_SRSR] = 0x1;
265
+ s->regs[SRC_SIMR] = 0x1F;
266
+}
267
+
268
+static uint64_t imx7_src_read(void *opaque, hwaddr offset, unsigned size)
269
+{
270
+ uint32_t value = 0;
271
+ IMX7SRCState *s = (IMX7SRCState *)opaque;
272
+ uint32_t index = offset >> 2;
273
+
274
+ if (index < SRC_MAX) {
275
+ value = s->regs[index];
276
+ } else {
277
+ qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad register at offset 0x%"
278
+ HWADDR_PRIx "\n", TYPE_IMX7_SRC, __func__, offset);
279
+ }
280
+
281
+ trace_imx7_src_read(imx7_src_reg_name(index), value);
282
+
283
+ return value;
284
+}
285
+
286
+
287
+/*
288
+ * The reset is asynchronous so we need to defer clearing the reset
289
+ * bit until the work is completed.
290
+ */
291
+
292
+struct SRCSCRResetInfo {
293
+ IMX7SRCState *s;
294
+ uint32_t reset_bit;
295
+};
296
+
297
+static void imx7_clear_reset_bit(CPUState *cpu, run_on_cpu_data data)
298
+{
299
+ struct SRCSCRResetInfo *ri = data.host_ptr;
300
+ IMX7SRCState *s = ri->s;
301
+
302
+ assert(qemu_mutex_iothread_locked());
303
+
304
+ s->regs[SRC_A7RCR0] = deposit32(s->regs[SRC_A7RCR0], ri->reset_bit, 1, 0);
305
+
306
+ trace_imx7_src_write(imx7_src_reg_name(SRC_A7RCR0), s->regs[SRC_A7RCR0]);
307
+
308
+ g_free(ri);
309
+}
310
+
311
+static void imx7_defer_clear_reset_bit(uint32_t cpuid,
312
+ IMX7SRCState *s,
313
+ uint32_t reset_shift)
314
+{
315
+ struct SRCSCRResetInfo *ri;
316
+ CPUState *cpu = arm_get_cpu_by_id(cpuid);
317
+
318
+ if (!cpu) {
319
+ return;
320
+ }
321
+
322
+ ri = g_new(struct SRCSCRResetInfo, 1);
323
+ ri->s = s;
324
+ ri->reset_bit = reset_shift;
325
+
326
+ async_run_on_cpu(cpu, imx7_clear_reset_bit, RUN_ON_CPU_HOST_PTR(ri));
327
+}
328
+
329
+
330
+static void imx7_src_write(void *opaque, hwaddr offset, uint64_t value,
331
+ unsigned size)
332
+{
333
+ IMX7SRCState *s = (IMX7SRCState *)opaque;
334
+ uint32_t index = offset >> 2;
335
+ long unsigned int change_mask;
336
+ uint32_t current_value = value;
337
+
338
+ if (index >= SRC_MAX) {
339
+ qemu_log_mask(LOG_GUEST_ERROR, "[%s]%s: Bad register at offset 0x%"
340
+ HWADDR_PRIx "\n", TYPE_IMX7_SRC, __func__, offset);
341
+ return;
342
+ }
343
+
344
+ trace_imx7_src_write(imx7_src_reg_name(SRC_A7RCR0), s->regs[SRC_A7RCR0]);
345
+
346
+ change_mask = s->regs[index] ^ (uint32_t)current_value;
347
+
348
+ switch (index) {
349
+ case SRC_A7RCR0:
350
+ if (FIELD_EX32(change_mask, CORE0, RST)) {
351
+ arm_reset_cpu(0);
352
+ imx7_defer_clear_reset_bit(0, s, R_CORE0_RST_SHIFT);
353
+ }
354
+ if (FIELD_EX32(change_mask, CORE1, RST)) {
355
+ arm_reset_cpu(1);
356
+ imx7_defer_clear_reset_bit(1, s, R_CORE1_RST_SHIFT);
357
+ }
358
+ s->regs[index] = current_value;
359
+ break;
360
+ case SRC_A7RCR1:
361
+ /*
362
+ * On real hardware when the system reset controller starts a
363
+ * secondary CPU it runs through some boot ROM code which reads
364
+ * the SRC_GPRX registers controlling the start address and branches
365
+ * to it.
366
+ * Here we are taking a short cut and branching directly to the
367
+ * requested address (we don't want to run the boot ROM code inside
368
+ * QEMU)
369
+ */
370
+ if (FIELD_EX32(change_mask, CORE1, ENABLE)) {
371
+ if (FIELD_EX32(current_value, CORE1, ENABLE)) {
372
+ /* CORE 1 is brought up */
373
+ arm_set_cpu_on(1, s->regs[SRC_GPR3], s->regs[SRC_GPR4],
374
+ 3, false);
375
+ } else {
376
+ /* CORE 1 is shut down */
377
+ arm_set_cpu_off(1);
378
+ }
379
+ /* We clear the reset bits as the processor changed state */
380
+ imx7_defer_clear_reset_bit(1, s, R_CORE1_RST_SHIFT);
381
+ clear_bit(R_CORE1_RST_SHIFT, &change_mask);
382
+ }
383
+ s->regs[index] = current_value;
384
+ break;
385
+ default:
386
+ s->regs[index] = current_value;
387
+ break;
388
+ }
389
+}
390
+
391
+static const struct MemoryRegionOps imx7_src_ops = {
392
+ .read = imx7_src_read,
393
+ .write = imx7_src_write,
394
+ .endianness = DEVICE_NATIVE_ENDIAN,
395
+ .valid = {
396
+ /*
397
+ * Our device would not work correctly if the guest was doing
398
+ * unaligned access. This might not be a limitation on the real
399
+ * device but in practice there is no reason for a guest to access
400
+ * this device unaligned.
401
+ */
402
+ .min_access_size = 4,
403
+ .max_access_size = 4,
404
+ .unaligned = false,
405
+ },
406
+};
407
+
408
+static void imx7_src_realize(DeviceState *dev, Error **errp)
409
+{
410
+ IMX7SRCState *s = IMX7_SRC(dev);
411
+
412
+ memory_region_init_io(&s->iomem, OBJECT(dev), &imx7_src_ops, s,
413
+ TYPE_IMX7_SRC, 0x1000);
414
+ sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
415
+}
416
+
417
+static void imx7_src_class_init(ObjectClass *klass, void *data)
418
+{
419
+ DeviceClass *dc = DEVICE_CLASS(klass);
420
+
421
+ dc->realize = imx7_src_realize;
422
+ dc->reset = imx7_src_reset;
423
+ dc->vmsd = &vmstate_imx7_src;
424
+ dc->desc = "i.MX6 System Reset Controller";
425
+}
426
+
427
+static const TypeInfo imx7_src_info = {
428
+ .name = TYPE_IMX7_SRC,
429
+ .parent = TYPE_SYS_BUS_DEVICE,
430
+ .instance_size = sizeof(IMX7SRCState),
431
+ .class_init = imx7_src_class_init,
432
+};
433
+
434
+static void imx7_src_register_types(void)
435
+{
436
+ type_register_static(&imx7_src_info);
437
+}
438
+
439
+type_init(imx7_src_register_types)
440
diff --git a/hw/misc/meson.build b/hw/misc/meson.build
41
index XXXXXXX..XXXXXXX 100644
441
index XXXXXXX..XXXXXXX 100644
42
--- a/hw/acpi/meson.build
442
--- a/hw/misc/meson.build
43
+++ b/hw/acpi/meson.build
443
+++ b/hw/misc/meson.build
44
@@ -XXX,XX +XXX,XX @@ acpi_ss.add(when: 'CONFIG_ACPI_PCI', if_true: files('pci.c'))
444
@@ -XXX,XX +XXX,XX @@ system_ss.add(when: 'CONFIG_IMX', if_true: files(
45
acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.c'))
445
'imx6_src.c',
46
acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('generic_event_device.c'))
446
'imx6ul_ccm.c',
47
acpi_ss.add(when: 'CONFIG_ACPI_HMAT', if_true: files('hmat.c'))
447
'imx7_ccm.c',
48
-acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c'))
448
+ 'imx7_src.c',
49
+acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c'), if_false:('ghes-stub.c'))
449
'imx7_gpr.c',
50
acpi_ss.add(when: 'CONFIG_ACPI_X86', if_true: files('core.c', 'piix4.c', 'pcihp.c'), if_false: files('acpi-stub.c'))
450
'imx7_snvs.c',
51
acpi_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('ich9.c', 'tco.c'))
451
'imx_ccm.c',
52
acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c'))
452
diff --git a/hw/misc/trace-events b/hw/misc/trace-events
53
acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c'))
453
index XXXXXXX..XXXXXXX 100644
54
acpi_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c'))
454
--- a/hw/misc/trace-events
55
-softmmu_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-build-stub.c'))
455
+++ b/hw/misc/trace-events
56
+softmmu_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c'))
456
@@ -XXX,XX +XXX,XX @@ ccm_clock_freq(uint32_t clock, uint32_t freq) "(Clock = %d) = %d"
57
softmmu_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss)
457
ccm_read_reg(const char *reg_name, uint32_t value) "reg[%s] <= 0x%" PRIx32
58
softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('acpi-stub.c', 'aml-build-stub.c',
458
ccm_write_reg(const char *reg_name, uint32_t value) "reg[%s] => 0x%" PRIx32
59
- 'acpi-x86-stub.c', 'ipmi-stub.c'))
459
60
+ 'acpi-x86-stub.c', 'ipmi-stub.c', 'ghes-stub.c'))
460
+# imx7_src.c
461
+imx7_src_read(const char *reg_name, uint32_t value) "reg[%s] => 0x%" PRIx32
462
+imx7_src_write(const char *reg_name, uint32_t value) "reg[%s] <= 0x%" PRIx32
463
+
464
# iotkit-sysinfo.c
465
iotkit_sysinfo_read(uint64_t offset, uint64_t data, unsigned size) "IoTKit SysInfo read: offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u"
466
iotkit_sysinfo_write(uint64_t offset, uint64_t data, unsigned size) "IoTKit SysInfo write: offset 0x%" PRIx64 " data 0x%" PRIx64 " size %u"
61
--
467
--
62
2.20.1
468
2.34.1
63
64
diff view generated by jsdifflib
Deleted patch
1
Allow code elsewhere in the system to check whether the ACPI GHES
2
table is present, so it can determine whether it is OK to try to
3
record an error by calling acpi_ghes_record_errors().
4
1
5
(We don't need to migrate the new 'present' field in AcpiGhesState,
6
because it is set once at system initialization and doesn't change.)
7
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
10
Reviewed-by: Dongjiu Geng <gengdongjiu1@gmail.com>
11
Message-id: 20210603171259.27962-3-peter.maydell@linaro.org
12
---
13
include/hw/acpi/ghes.h | 9 +++++++++
14
hw/acpi/ghes-stub.c | 5 +++++
15
hw/acpi/ghes.c | 17 +++++++++++++++++
16
3 files changed, 31 insertions(+)
17
18
diff --git a/include/hw/acpi/ghes.h b/include/hw/acpi/ghes.h
19
index XXXXXXX..XXXXXXX 100644
20
--- a/include/hw/acpi/ghes.h
21
+++ b/include/hw/acpi/ghes.h
22
@@ -XXX,XX +XXX,XX @@ enum {
23
24
typedef struct AcpiGhesState {
25
uint64_t ghes_addr_le;
26
+ bool present; /* True if GHES is present at all on this board */
27
} AcpiGhesState;
28
29
void build_ghes_error_table(GArray *hardware_errors, BIOSLinker *linker);
30
@@ -XXX,XX +XXX,XX @@ void acpi_build_hest(GArray *table_data, BIOSLinker *linker,
31
void acpi_ghes_add_fw_cfg(AcpiGhesState *vms, FWCfgState *s,
32
GArray *hardware_errors);
33
int acpi_ghes_record_errors(uint8_t notify, uint64_t error_physical_addr);
34
+
35
+/**
36
+ * acpi_ghes_present: Report whether ACPI GHES table is present
37
+ *
38
+ * Returns: true if the system has an ACPI GHES table and it is
39
+ * safe to call acpi_ghes_record_errors() to record a memory error.
40
+ */
41
+bool acpi_ghes_present(void);
42
#endif
43
diff --git a/hw/acpi/ghes-stub.c b/hw/acpi/ghes-stub.c
44
index XXXXXXX..XXXXXXX 100644
45
--- a/hw/acpi/ghes-stub.c
46
+++ b/hw/acpi/ghes-stub.c
47
@@ -XXX,XX +XXX,XX @@ int acpi_ghes_record_errors(uint8_t source_id, uint64_t physical_address)
48
{
49
return -1;
50
}
51
+
52
+bool acpi_ghes_present(void)
53
+{
54
+ return false;
55
+}
56
diff --git a/hw/acpi/ghes.c b/hw/acpi/ghes.c
57
index XXXXXXX..XXXXXXX 100644
58
--- a/hw/acpi/ghes.c
59
+++ b/hw/acpi/ghes.c
60
@@ -XXX,XX +XXX,XX @@ void acpi_ghes_add_fw_cfg(AcpiGhesState *ags, FWCfgState *s,
61
/* Create a read-write fw_cfg file for Address */
62
fw_cfg_add_file_callback(s, ACPI_GHES_DATA_ADDR_FW_CFG_FILE, NULL, NULL,
63
NULL, &(ags->ghes_addr_le), sizeof(ags->ghes_addr_le), false);
64
+
65
+ ags->present = true;
66
}
67
68
int acpi_ghes_record_errors(uint8_t source_id, uint64_t physical_address)
69
@@ -XXX,XX +XXX,XX @@ int acpi_ghes_record_errors(uint8_t source_id, uint64_t physical_address)
70
71
return ret;
72
}
73
+
74
+bool acpi_ghes_present(void)
75
+{
76
+ AcpiGedState *acpi_ged_state;
77
+ AcpiGhesState *ags;
78
+
79
+ acpi_ged_state = ACPI_GED(object_resolve_path_type("", TYPE_ACPI_GED,
80
+ NULL));
81
+
82
+ if (!acpi_ged_state) {
83
+ return false;
84
+ }
85
+ ags = &acpi_ged_state->ghes_state;
86
+ return ags->present;
87
+}
88
--
89
2.20.1
90
91
diff view generated by jsdifflib
Deleted patch
1
The virt_is_acpi_enabled() function is specific to the virt board, as
2
is the check for its 'ras' property. Use the new acpi_ghes_present()
3
function to check whether we should report memory errors via
4
acpi_ghes_record_errors().
5
1
6
This avoids a link error if QEMU was built without support for the
7
virt board, and provides a mechanism that can be used by any future
8
board models that want to add ACPI memory error reporting support
9
(they only need to call acpi_ghes_add_fw_cfg()).
10
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
13
Reviewed-by: Dongjiu Geng <gengdongjiu1@gmail.com>
14
Message-id: 20210603171259.27962-4-peter.maydell@linaro.org
15
---
16
target/arm/kvm64.c | 6 +-----
17
1 file changed, 1 insertion(+), 5 deletions(-)
18
19
diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
20
index XXXXXXX..XXXXXXX 100644
21
--- a/target/arm/kvm64.c
22
+++ b/target/arm/kvm64.c
23
@@ -XXX,XX +XXX,XX @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr)
24
{
25
ram_addr_t ram_addr;
26
hwaddr paddr;
27
- Object *obj = qdev_get_machine();
28
- VirtMachineState *vms = VIRT_MACHINE(obj);
29
- bool acpi_enabled = virt_is_acpi_enabled(vms);
30
31
assert(code == BUS_MCEERR_AR || code == BUS_MCEERR_AO);
32
33
- if (acpi_enabled && addr &&
34
- object_property_get_bool(obj, "ras", NULL)) {
35
+ if (acpi_ghes_present() && addr) {
36
ram_addr = qemu_ram_addr_from_host(addr);
37
if (ram_addr != RAM_ADDR_INVALID &&
38
kvm_physical_memory_addr_from_host(c->kvm_state, addr, &paddr)) {
39
--
40
2.20.1
41
42
diff view generated by jsdifflib
Deleted patch
1
Currently we provide Hn and H1_n macros for accessing the correct
2
data within arrays of vector elements of size 1, 2 and 4, accounting
3
for host endianness. We don't provide any macros for elements of
4
size 8 because there the host endianness doesn't matter. However,
5
this does result in awkwardness where we need to pass empty arguments
6
to macros, because checkpatch complains about them. The empty
7
argument is a little confusing for humans to read as well.
8
1
9
Add H8() and H1_8() macros and use them where we were previously
10
passing empty arguments to macros.
11
12
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
15
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
16
Message-id: 20210614151007.4545-2-peter.maydell@linaro.org
17
Message-id: 20210610132505.5827-1-peter.maydell@linaro.org
18
---
19
target/arm/vec_internal.h | 8 +-
20
target/arm/sve_helper.c | 258 +++++++++++++++++++-------------------
21
target/arm/vec_helper.c | 14 +--
22
3 files changed, 143 insertions(+), 137 deletions(-)
23
24
diff --git a/target/arm/vec_internal.h b/target/arm/vec_internal.h
25
index XXXXXXX..XXXXXXX 100644
26
--- a/target/arm/vec_internal.h
27
+++ b/target/arm/vec_internal.h
28
@@ -XXX,XX +XXX,XX @@
29
#define H2(x) (x)
30
#define H4(x) (x)
31
#endif
32
-
33
+/*
34
+ * Access to 64-bit elements isn't host-endian dependent; we provide H8
35
+ * and H1_8 so that when a function is being generated from a macro we
36
+ * can pass these rather than an empty macro argument, for clarity.
37
+ */
38
+#define H8(x) (x)
39
+#define H1_8(x) (x)
40
41
static inline void clear_tail(void *vd, uintptr_t opr_sz, uintptr_t max_sz)
42
{
43
diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
44
index XXXXXXX..XXXXXXX 100644
45
--- a/target/arm/sve_helper.c
46
+++ b/target/arm/sve_helper.c
47
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *vg, \
48
49
DO_ZPZZ_PAIR_FP(sve2_faddp_zpzz_h, float16, H1_2, float16_add)
50
DO_ZPZZ_PAIR_FP(sve2_faddp_zpzz_s, float32, H1_4, float32_add)
51
-DO_ZPZZ_PAIR_FP(sve2_faddp_zpzz_d, float64, , float64_add)
52
+DO_ZPZZ_PAIR_FP(sve2_faddp_zpzz_d, float64, H1_8, float64_add)
53
54
DO_ZPZZ_PAIR_FP(sve2_fmaxnmp_zpzz_h, float16, H1_2, float16_maxnum)
55
DO_ZPZZ_PAIR_FP(sve2_fmaxnmp_zpzz_s, float32, H1_4, float32_maxnum)
56
-DO_ZPZZ_PAIR_FP(sve2_fmaxnmp_zpzz_d, float64, , float64_maxnum)
57
+DO_ZPZZ_PAIR_FP(sve2_fmaxnmp_zpzz_d, float64, H1_8, float64_maxnum)
58
59
DO_ZPZZ_PAIR_FP(sve2_fminnmp_zpzz_h, float16, H1_2, float16_minnum)
60
DO_ZPZZ_PAIR_FP(sve2_fminnmp_zpzz_s, float32, H1_4, float32_minnum)
61
-DO_ZPZZ_PAIR_FP(sve2_fminnmp_zpzz_d, float64, , float64_minnum)
62
+DO_ZPZZ_PAIR_FP(sve2_fminnmp_zpzz_d, float64, H1_8, float64_minnum)
63
64
DO_ZPZZ_PAIR_FP(sve2_fmaxp_zpzz_h, float16, H1_2, float16_max)
65
DO_ZPZZ_PAIR_FP(sve2_fmaxp_zpzz_s, float32, H1_4, float32_max)
66
-DO_ZPZZ_PAIR_FP(sve2_fmaxp_zpzz_d, float64, , float64_max)
67
+DO_ZPZZ_PAIR_FP(sve2_fmaxp_zpzz_d, float64, H1_8, float64_max)
68
69
DO_ZPZZ_PAIR_FP(sve2_fminp_zpzz_h, float16, H1_2, float16_min)
70
DO_ZPZZ_PAIR_FP(sve2_fminp_zpzz_s, float32, H1_4, float32_min)
71
-DO_ZPZZ_PAIR_FP(sve2_fminp_zpzz_d, float64, , float64_min)
72
+DO_ZPZZ_PAIR_FP(sve2_fminp_zpzz_d, float64, H1_8, float64_min)
73
74
#undef DO_ZPZZ_PAIR_FP
75
76
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \
77
78
DO_ZZZ_TB(sve2_saddl_h, int16_t, int8_t, H1_2, H1, DO_ADD)
79
DO_ZZZ_TB(sve2_saddl_s, int32_t, int16_t, H1_4, H1_2, DO_ADD)
80
-DO_ZZZ_TB(sve2_saddl_d, int64_t, int32_t, , H1_4, DO_ADD)
81
+DO_ZZZ_TB(sve2_saddl_d, int64_t, int32_t, H1_8, H1_4, DO_ADD)
82
83
DO_ZZZ_TB(sve2_ssubl_h, int16_t, int8_t, H1_2, H1, DO_SUB)
84
DO_ZZZ_TB(sve2_ssubl_s, int32_t, int16_t, H1_4, H1_2, DO_SUB)
85
-DO_ZZZ_TB(sve2_ssubl_d, int64_t, int32_t, , H1_4, DO_SUB)
86
+DO_ZZZ_TB(sve2_ssubl_d, int64_t, int32_t, H1_8, H1_4, DO_SUB)
87
88
DO_ZZZ_TB(sve2_sabdl_h, int16_t, int8_t, H1_2, H1, DO_ABD)
89
DO_ZZZ_TB(sve2_sabdl_s, int32_t, int16_t, H1_4, H1_2, DO_ABD)
90
-DO_ZZZ_TB(sve2_sabdl_d, int64_t, int32_t, , H1_4, DO_ABD)
91
+DO_ZZZ_TB(sve2_sabdl_d, int64_t, int32_t, H1_8, H1_4, DO_ABD)
92
93
DO_ZZZ_TB(sve2_uaddl_h, uint16_t, uint8_t, H1_2, H1, DO_ADD)
94
DO_ZZZ_TB(sve2_uaddl_s, uint32_t, uint16_t, H1_4, H1_2, DO_ADD)
95
-DO_ZZZ_TB(sve2_uaddl_d, uint64_t, uint32_t, , H1_4, DO_ADD)
96
+DO_ZZZ_TB(sve2_uaddl_d, uint64_t, uint32_t, H1_8, H1_4, DO_ADD)
97
98
DO_ZZZ_TB(sve2_usubl_h, uint16_t, uint8_t, H1_2, H1, DO_SUB)
99
DO_ZZZ_TB(sve2_usubl_s, uint32_t, uint16_t, H1_4, H1_2, DO_SUB)
100
-DO_ZZZ_TB(sve2_usubl_d, uint64_t, uint32_t, , H1_4, DO_SUB)
101
+DO_ZZZ_TB(sve2_usubl_d, uint64_t, uint32_t, H1_8, H1_4, DO_SUB)
102
103
DO_ZZZ_TB(sve2_uabdl_h, uint16_t, uint8_t, H1_2, H1, DO_ABD)
104
DO_ZZZ_TB(sve2_uabdl_s, uint32_t, uint16_t, H1_4, H1_2, DO_ABD)
105
-DO_ZZZ_TB(sve2_uabdl_d, uint64_t, uint32_t, , H1_4, DO_ABD)
106
+DO_ZZZ_TB(sve2_uabdl_d, uint64_t, uint32_t, H1_8, H1_4, DO_ABD)
107
108
DO_ZZZ_TB(sve2_smull_zzz_h, int16_t, int8_t, H1_2, H1, DO_MUL)
109
DO_ZZZ_TB(sve2_smull_zzz_s, int32_t, int16_t, H1_4, H1_2, DO_MUL)
110
-DO_ZZZ_TB(sve2_smull_zzz_d, int64_t, int32_t, , H1_4, DO_MUL)
111
+DO_ZZZ_TB(sve2_smull_zzz_d, int64_t, int32_t, H1_8, H1_4, DO_MUL)
112
113
DO_ZZZ_TB(sve2_umull_zzz_h, uint16_t, uint8_t, H1_2, H1, DO_MUL)
114
DO_ZZZ_TB(sve2_umull_zzz_s, uint32_t, uint16_t, H1_4, H1_2, DO_MUL)
115
-DO_ZZZ_TB(sve2_umull_zzz_d, uint64_t, uint32_t, , H1_4, DO_MUL)
116
+DO_ZZZ_TB(sve2_umull_zzz_d, uint64_t, uint32_t, H1_8, H1_4, DO_MUL)
117
118
/* Note that the multiply cannot overflow, but the doubling can. */
119
static inline int16_t do_sqdmull_h(int16_t n, int16_t m)
120
@@ -XXX,XX +XXX,XX @@ static inline int64_t do_sqdmull_d(int64_t n, int64_t m)
121
122
DO_ZZZ_TB(sve2_sqdmull_zzz_h, int16_t, int8_t, H1_2, H1, do_sqdmull_h)
123
DO_ZZZ_TB(sve2_sqdmull_zzz_s, int32_t, int16_t, H1_4, H1_2, do_sqdmull_s)
124
-DO_ZZZ_TB(sve2_sqdmull_zzz_d, int64_t, int32_t, , H1_4, do_sqdmull_d)
125
+DO_ZZZ_TB(sve2_sqdmull_zzz_d, int64_t, int32_t, H1_8, H1_4, do_sqdmull_d)
126
127
#undef DO_ZZZ_TB
128
129
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \
130
131
DO_ZZZ_WTB(sve2_saddw_h, int16_t, int8_t, H1_2, H1, DO_ADD)
132
DO_ZZZ_WTB(sve2_saddw_s, int32_t, int16_t, H1_4, H1_2, DO_ADD)
133
-DO_ZZZ_WTB(sve2_saddw_d, int64_t, int32_t, , H1_4, DO_ADD)
134
+DO_ZZZ_WTB(sve2_saddw_d, int64_t, int32_t, H1_8, H1_4, DO_ADD)
135
136
DO_ZZZ_WTB(sve2_ssubw_h, int16_t, int8_t, H1_2, H1, DO_SUB)
137
DO_ZZZ_WTB(sve2_ssubw_s, int32_t, int16_t, H1_4, H1_2, DO_SUB)
138
-DO_ZZZ_WTB(sve2_ssubw_d, int64_t, int32_t, , H1_4, DO_SUB)
139
+DO_ZZZ_WTB(sve2_ssubw_d, int64_t, int32_t, H1_8, H1_4, DO_SUB)
140
141
DO_ZZZ_WTB(sve2_uaddw_h, uint16_t, uint8_t, H1_2, H1, DO_ADD)
142
DO_ZZZ_WTB(sve2_uaddw_s, uint32_t, uint16_t, H1_4, H1_2, DO_ADD)
143
-DO_ZZZ_WTB(sve2_uaddw_d, uint64_t, uint32_t, , H1_4, DO_ADD)
144
+DO_ZZZ_WTB(sve2_uaddw_d, uint64_t, uint32_t, H1_8, H1_4, DO_ADD)
145
146
DO_ZZZ_WTB(sve2_usubw_h, uint16_t, uint8_t, H1_2, H1, DO_SUB)
147
DO_ZZZ_WTB(sve2_usubw_s, uint32_t, uint16_t, H1_4, H1_2, DO_SUB)
148
-DO_ZZZ_WTB(sve2_usubw_d, uint64_t, uint32_t, , H1_4, DO_SUB)
149
+DO_ZZZ_WTB(sve2_usubw_d, uint64_t, uint32_t, H1_8, H1_4, DO_SUB)
150
151
#undef DO_ZZZ_WTB
152
153
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \
154
DO_ZZZ_NTB(sve2_eoril_b, uint8_t, H1, DO_EOR)
155
DO_ZZZ_NTB(sve2_eoril_h, uint16_t, H1_2, DO_EOR)
156
DO_ZZZ_NTB(sve2_eoril_s, uint32_t, H1_4, DO_EOR)
157
-DO_ZZZ_NTB(sve2_eoril_d, uint64_t, , DO_EOR)
158
+DO_ZZZ_NTB(sve2_eoril_d, uint64_t, H1_8, DO_EOR)
159
160
#undef DO_ZZZ_NTB
161
162
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, uint32_t desc) \
163
164
DO_ZZZW_ACC(sve2_sabal_h, int16_t, int8_t, H1_2, H1, DO_ABD)
165
DO_ZZZW_ACC(sve2_sabal_s, int32_t, int16_t, H1_4, H1_2, DO_ABD)
166
-DO_ZZZW_ACC(sve2_sabal_d, int64_t, int32_t, , H1_4, DO_ABD)
167
+DO_ZZZW_ACC(sve2_sabal_d, int64_t, int32_t, H1_8, H1_4, DO_ABD)
168
169
DO_ZZZW_ACC(sve2_uabal_h, uint16_t, uint8_t, H1_2, H1, DO_ABD)
170
DO_ZZZW_ACC(sve2_uabal_s, uint32_t, uint16_t, H1_4, H1_2, DO_ABD)
171
-DO_ZZZW_ACC(sve2_uabal_d, uint64_t, uint32_t, , H1_4, DO_ABD)
172
+DO_ZZZW_ACC(sve2_uabal_d, uint64_t, uint32_t, H1_8, H1_4, DO_ABD)
173
174
DO_ZZZW_ACC(sve2_smlal_zzzw_h, int16_t, int8_t, H1_2, H1, DO_MUL)
175
DO_ZZZW_ACC(sve2_smlal_zzzw_s, int32_t, int16_t, H1_4, H1_2, DO_MUL)
176
-DO_ZZZW_ACC(sve2_smlal_zzzw_d, int64_t, int32_t, , H1_4, DO_MUL)
177
+DO_ZZZW_ACC(sve2_smlal_zzzw_d, int64_t, int32_t, H1_8, H1_4, DO_MUL)
178
179
DO_ZZZW_ACC(sve2_umlal_zzzw_h, uint16_t, uint8_t, H1_2, H1, DO_MUL)
180
DO_ZZZW_ACC(sve2_umlal_zzzw_s, uint32_t, uint16_t, H1_4, H1_2, DO_MUL)
181
-DO_ZZZW_ACC(sve2_umlal_zzzw_d, uint64_t, uint32_t, , H1_4, DO_MUL)
182
+DO_ZZZW_ACC(sve2_umlal_zzzw_d, uint64_t, uint32_t, H1_8, H1_4, DO_MUL)
183
184
#define DO_NMUL(N, M) -(N * M)
185
186
DO_ZZZW_ACC(sve2_smlsl_zzzw_h, int16_t, int8_t, H1_2, H1, DO_NMUL)
187
DO_ZZZW_ACC(sve2_smlsl_zzzw_s, int32_t, int16_t, H1_4, H1_2, DO_NMUL)
188
-DO_ZZZW_ACC(sve2_smlsl_zzzw_d, int64_t, int32_t, , H1_4, DO_NMUL)
189
+DO_ZZZW_ACC(sve2_smlsl_zzzw_d, int64_t, int32_t, H1_8, H1_4, DO_NMUL)
190
191
DO_ZZZW_ACC(sve2_umlsl_zzzw_h, uint16_t, uint8_t, H1_2, H1, DO_NMUL)
192
DO_ZZZW_ACC(sve2_umlsl_zzzw_s, uint32_t, uint16_t, H1_4, H1_2, DO_NMUL)
193
-DO_ZZZW_ACC(sve2_umlsl_zzzw_d, uint64_t, uint32_t, , H1_4, DO_NMUL)
194
+DO_ZZZW_ACC(sve2_umlsl_zzzw_d, uint64_t, uint32_t, H1_8, H1_4, DO_NMUL)
195
196
#undef DO_ZZZW_ACC
197
198
@@ -XXX,XX +XXX,XX @@ DO_SQDMLAL(sve2_sqdmlal_zzzw_h, int16_t, int8_t, H1_2, H1,
199
do_sqdmull_h, DO_SQADD_H)
200
DO_SQDMLAL(sve2_sqdmlal_zzzw_s, int32_t, int16_t, H1_4, H1_2,
201
do_sqdmull_s, DO_SQADD_S)
202
-DO_SQDMLAL(sve2_sqdmlal_zzzw_d, int64_t, int32_t, , H1_4,
203
+DO_SQDMLAL(sve2_sqdmlal_zzzw_d, int64_t, int32_t, H1_8, H1_4,
204
do_sqdmull_d, do_sqadd_d)
205
206
DO_SQDMLAL(sve2_sqdmlsl_zzzw_h, int16_t, int8_t, H1_2, H1,
207
do_sqdmull_h, DO_SQSUB_H)
208
DO_SQDMLAL(sve2_sqdmlsl_zzzw_s, int32_t, int16_t, H1_4, H1_2,
209
do_sqdmull_s, DO_SQSUB_S)
210
-DO_SQDMLAL(sve2_sqdmlsl_zzzw_d, int64_t, int32_t, , H1_4,
211
+DO_SQDMLAL(sve2_sqdmlsl_zzzw_d, int64_t, int32_t, H1_8, H1_4,
212
do_sqdmull_d, do_sqsub_d)
213
214
#undef DO_SQDMLAL
215
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, uint32_t desc) \
216
DO_CMLA_FUNC(sve2_cmla_zzzz_b, uint8_t, H1, DO_CMLA)
217
DO_CMLA_FUNC(sve2_cmla_zzzz_h, uint16_t, H2, DO_CMLA)
218
DO_CMLA_FUNC(sve2_cmla_zzzz_s, uint32_t, H4, DO_CMLA)
219
-DO_CMLA_FUNC(sve2_cmla_zzzz_d, uint64_t, , DO_CMLA)
220
+DO_CMLA_FUNC(sve2_cmla_zzzz_d, uint64_t, H8, DO_CMLA)
221
222
#define DO_SQRDMLAH_B(N, M, A, S) \
223
do_sqrdmlah_b(N, M, A, S, true)
224
@@ -XXX,XX +XXX,XX @@ DO_CMLA_FUNC(sve2_cmla_zzzz_d, uint64_t, , DO_CMLA)
225
DO_CMLA_FUNC(sve2_sqrdcmlah_zzzz_b, int8_t, H1, DO_SQRDMLAH_B)
226
DO_CMLA_FUNC(sve2_sqrdcmlah_zzzz_h, int16_t, H2, DO_SQRDMLAH_H)
227
DO_CMLA_FUNC(sve2_sqrdcmlah_zzzz_s, int32_t, H4, DO_SQRDMLAH_S)
228
-DO_CMLA_FUNC(sve2_sqrdcmlah_zzzz_d, int64_t, , DO_SQRDMLAH_D)
229
+DO_CMLA_FUNC(sve2_sqrdcmlah_zzzz_d, int64_t, H8, DO_SQRDMLAH_D)
230
231
#define DO_CMLA_IDX_FUNC(NAME, TYPE, H, OP) \
232
void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, uint32_t desc) \
233
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, uint32_t desc) \
234
235
DO_ZZXZ(sve2_sqrdmlah_idx_h, int16_t, H2, DO_SQRDMLAH_H)
236
DO_ZZXZ(sve2_sqrdmlah_idx_s, int32_t, H4, DO_SQRDMLAH_S)
237
-DO_ZZXZ(sve2_sqrdmlah_idx_d, int64_t, , DO_SQRDMLAH_D)
238
+DO_ZZXZ(sve2_sqrdmlah_idx_d, int64_t, H8, DO_SQRDMLAH_D)
239
240
#define DO_SQRDMLSH_H(N, M, A) \
241
({ uint32_t discard; do_sqrdmlah_h(N, M, A, true, true, &discard); })
242
@@ -XXX,XX +XXX,XX @@ DO_ZZXZ(sve2_sqrdmlah_idx_d, int64_t, , DO_SQRDMLAH_D)
243
244
DO_ZZXZ(sve2_sqrdmlsh_idx_h, int16_t, H2, DO_SQRDMLSH_H)
245
DO_ZZXZ(sve2_sqrdmlsh_idx_s, int32_t, H4, DO_SQRDMLSH_S)
246
-DO_ZZXZ(sve2_sqrdmlsh_idx_d, int64_t, , DO_SQRDMLSH_D)
247
+DO_ZZXZ(sve2_sqrdmlsh_idx_d, int64_t, H8, DO_SQRDMLSH_D)
248
249
#undef DO_ZZXZ
250
251
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, uint32_t desc) \
252
#define DO_MLA(N, M, A) (A + N * M)
253
254
DO_ZZXW(sve2_smlal_idx_s, int32_t, int16_t, H1_4, H1_2, DO_MLA)
255
-DO_ZZXW(sve2_smlal_idx_d, int64_t, int32_t, , H1_4, DO_MLA)
256
+DO_ZZXW(sve2_smlal_idx_d, int64_t, int32_t, H1_8, H1_4, DO_MLA)
257
DO_ZZXW(sve2_umlal_idx_s, uint32_t, uint16_t, H1_4, H1_2, DO_MLA)
258
-DO_ZZXW(sve2_umlal_idx_d, uint64_t, uint32_t, , H1_4, DO_MLA)
259
+DO_ZZXW(sve2_umlal_idx_d, uint64_t, uint32_t, H1_8, H1_4, DO_MLA)
260
261
#define DO_MLS(N, M, A) (A - N * M)
262
263
DO_ZZXW(sve2_smlsl_idx_s, int32_t, int16_t, H1_4, H1_2, DO_MLS)
264
-DO_ZZXW(sve2_smlsl_idx_d, int64_t, int32_t, , H1_4, DO_MLS)
265
+DO_ZZXW(sve2_smlsl_idx_d, int64_t, int32_t, H1_8, H1_4, DO_MLS)
266
DO_ZZXW(sve2_umlsl_idx_s, uint32_t, uint16_t, H1_4, H1_2, DO_MLS)
267
-DO_ZZXW(sve2_umlsl_idx_d, uint64_t, uint32_t, , H1_4, DO_MLS)
268
+DO_ZZXW(sve2_umlsl_idx_d, uint64_t, uint32_t, H1_8, H1_4, DO_MLS)
269
270
#define DO_SQDMLAL_S(N, M, A) DO_SQADD_S(A, do_sqdmull_s(N, M))
271
#define DO_SQDMLAL_D(N, M, A) do_sqadd_d(A, do_sqdmull_d(N, M))
272
273
DO_ZZXW(sve2_sqdmlal_idx_s, int32_t, int16_t, H1_4, H1_2, DO_SQDMLAL_S)
274
-DO_ZZXW(sve2_sqdmlal_idx_d, int64_t, int32_t, , H1_4, DO_SQDMLAL_D)
275
+DO_ZZXW(sve2_sqdmlal_idx_d, int64_t, int32_t, H1_8, H1_4, DO_SQDMLAL_D)
276
277
#define DO_SQDMLSL_S(N, M, A) DO_SQSUB_S(A, do_sqdmull_s(N, M))
278
#define DO_SQDMLSL_D(N, M, A) do_sqsub_d(A, do_sqdmull_d(N, M))
279
280
DO_ZZXW(sve2_sqdmlsl_idx_s, int32_t, int16_t, H1_4, H1_2, DO_SQDMLSL_S)
281
-DO_ZZXW(sve2_sqdmlsl_idx_d, int64_t, int32_t, , H1_4, DO_SQDMLSL_D)
282
+DO_ZZXW(sve2_sqdmlsl_idx_d, int64_t, int32_t, H1_8, H1_4, DO_SQDMLSL_D)
283
284
#undef DO_MLA
285
#undef DO_MLS
286
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \
287
}
288
289
DO_ZZX(sve2_sqdmull_idx_s, int32_t, int16_t, H1_4, H1_2, do_sqdmull_s)
290
-DO_ZZX(sve2_sqdmull_idx_d, int64_t, int32_t, , H1_4, do_sqdmull_d)
291
+DO_ZZX(sve2_sqdmull_idx_d, int64_t, int32_t, H1_8, H1_4, do_sqdmull_d)
292
293
DO_ZZX(sve2_smull_idx_s, int32_t, int16_t, H1_4, H1_2, DO_MUL)
294
-DO_ZZX(sve2_smull_idx_d, int64_t, int32_t, , H1_4, DO_MUL)
295
+DO_ZZX(sve2_smull_idx_d, int64_t, int32_t, H1_8, H1_4, DO_MUL)
296
297
DO_ZZX(sve2_umull_idx_s, uint32_t, uint16_t, H1_4, H1_2, DO_MUL)
298
-DO_ZZX(sve2_umull_idx_d, uint64_t, uint32_t, , H1_4, DO_MUL)
299
+DO_ZZX(sve2_umull_idx_d, uint64_t, uint32_t, H1_8, H1_4, DO_MUL)
300
301
#undef DO_ZZX
302
303
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \
304
DO_CADD(sve2_cadd_b, int8_t, H1, DO_ADD, DO_SUB)
305
DO_CADD(sve2_cadd_h, int16_t, H1_2, DO_ADD, DO_SUB)
306
DO_CADD(sve2_cadd_s, int32_t, H1_4, DO_ADD, DO_SUB)
307
-DO_CADD(sve2_cadd_d, int64_t, , DO_ADD, DO_SUB)
308
+DO_CADD(sve2_cadd_d, int64_t, H1_8, DO_ADD, DO_SUB)
309
310
DO_CADD(sve2_sqcadd_b, int8_t, H1, DO_SQADD_B, DO_SQSUB_B)
311
DO_CADD(sve2_sqcadd_h, int16_t, H1_2, DO_SQADD_H, DO_SQSUB_H)
312
DO_CADD(sve2_sqcadd_s, int32_t, H1_4, DO_SQADD_S, DO_SQSUB_S)
313
-DO_CADD(sve2_sqcadd_d, int64_t, , do_sqadd_d, do_sqsub_d)
314
+DO_CADD(sve2_sqcadd_d, int64_t, H1_8, do_sqadd_d, do_sqsub_d)
315
316
#undef DO_CADD
317
318
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, uint32_t desc) \
319
320
DO_ZZI_SHLL(sve2_sshll_h, int16_t, int8_t, H1_2, H1)
321
DO_ZZI_SHLL(sve2_sshll_s, int32_t, int16_t, H1_4, H1_2)
322
-DO_ZZI_SHLL(sve2_sshll_d, int64_t, int32_t, , H1_4)
323
+DO_ZZI_SHLL(sve2_sshll_d, int64_t, int32_t, H1_8, H1_4)
324
325
DO_ZZI_SHLL(sve2_ushll_h, uint16_t, uint8_t, H1_2, H1)
326
DO_ZZI_SHLL(sve2_ushll_s, uint32_t, uint16_t, H1_4, H1_2)
327
-DO_ZZI_SHLL(sve2_ushll_d, uint64_t, uint32_t, , H1_4)
328
+DO_ZZI_SHLL(sve2_ushll_d, uint64_t, uint32_t, H1_8, H1_4)
329
330
#undef DO_ZZI_SHLL
331
332
@@ -XXX,XX +XXX,XX @@ DO_SHRNB(sve2_shrnb_d, uint64_t, uint32_t, DO_SHR)
333
334
DO_SHRNT(sve2_shrnt_h, uint16_t, uint8_t, H1_2, H1, DO_SHR)
335
DO_SHRNT(sve2_shrnt_s, uint32_t, uint16_t, H1_4, H1_2, DO_SHR)
336
-DO_SHRNT(sve2_shrnt_d, uint64_t, uint32_t, , H1_4, DO_SHR)
337
+DO_SHRNT(sve2_shrnt_d, uint64_t, uint32_t, H1_8, H1_4, DO_SHR)
338
339
DO_SHRNB(sve2_rshrnb_h, uint16_t, uint8_t, do_urshr)
340
DO_SHRNB(sve2_rshrnb_s, uint32_t, uint16_t, do_urshr)
341
@@ -XXX,XX +XXX,XX @@ DO_SHRNB(sve2_rshrnb_d, uint64_t, uint32_t, do_urshr)
342
343
DO_SHRNT(sve2_rshrnt_h, uint16_t, uint8_t, H1_2, H1, do_urshr)
344
DO_SHRNT(sve2_rshrnt_s, uint32_t, uint16_t, H1_4, H1_2, do_urshr)
345
-DO_SHRNT(sve2_rshrnt_d, uint64_t, uint32_t, , H1_4, do_urshr)
346
+DO_SHRNT(sve2_rshrnt_d, uint64_t, uint32_t, H1_8, H1_4, do_urshr)
347
348
#define DO_SQSHRUN_H(x, sh) do_sat_bhs((int64_t)(x) >> sh, 0, UINT8_MAX)
349
#define DO_SQSHRUN_S(x, sh) do_sat_bhs((int64_t)(x) >> sh, 0, UINT16_MAX)
350
@@ -XXX,XX +XXX,XX @@ DO_SHRNB(sve2_sqshrunb_d, int64_t, uint32_t, DO_SQSHRUN_D)
351
352
DO_SHRNT(sve2_sqshrunt_h, int16_t, uint8_t, H1_2, H1, DO_SQSHRUN_H)
353
DO_SHRNT(sve2_sqshrunt_s, int32_t, uint16_t, H1_4, H1_2, DO_SQSHRUN_S)
354
-DO_SHRNT(sve2_sqshrunt_d, int64_t, uint32_t, , H1_4, DO_SQSHRUN_D)
355
+DO_SHRNT(sve2_sqshrunt_d, int64_t, uint32_t, H1_8, H1_4, DO_SQSHRUN_D)
356
357
#define DO_SQRSHRUN_H(x, sh) do_sat_bhs(do_srshr(x, sh), 0, UINT8_MAX)
358
#define DO_SQRSHRUN_S(x, sh) do_sat_bhs(do_srshr(x, sh), 0, UINT16_MAX)
359
@@ -XXX,XX +XXX,XX @@ DO_SHRNB(sve2_sqrshrunb_d, int64_t, uint32_t, DO_SQRSHRUN_D)
360
361
DO_SHRNT(sve2_sqrshrunt_h, int16_t, uint8_t, H1_2, H1, DO_SQRSHRUN_H)
362
DO_SHRNT(sve2_sqrshrunt_s, int32_t, uint16_t, H1_4, H1_2, DO_SQRSHRUN_S)
363
-DO_SHRNT(sve2_sqrshrunt_d, int64_t, uint32_t, , H1_4, DO_SQRSHRUN_D)
364
+DO_SHRNT(sve2_sqrshrunt_d, int64_t, uint32_t, H1_8, H1_4, DO_SQRSHRUN_D)
365
366
#define DO_SQSHRN_H(x, sh) do_sat_bhs(x >> sh, INT8_MIN, INT8_MAX)
367
#define DO_SQSHRN_S(x, sh) do_sat_bhs(x >> sh, INT16_MIN, INT16_MAX)
368
@@ -XXX,XX +XXX,XX @@ DO_SHRNB(sve2_sqshrnb_d, int64_t, uint32_t, DO_SQSHRN_D)
369
370
DO_SHRNT(sve2_sqshrnt_h, int16_t, uint8_t, H1_2, H1, DO_SQSHRN_H)
371
DO_SHRNT(sve2_sqshrnt_s, int32_t, uint16_t, H1_4, H1_2, DO_SQSHRN_S)
372
-DO_SHRNT(sve2_sqshrnt_d, int64_t, uint32_t, , H1_4, DO_SQSHRN_D)
373
+DO_SHRNT(sve2_sqshrnt_d, int64_t, uint32_t, H1_8, H1_4, DO_SQSHRN_D)
374
375
#define DO_SQRSHRN_H(x, sh) do_sat_bhs(do_srshr(x, sh), INT8_MIN, INT8_MAX)
376
#define DO_SQRSHRN_S(x, sh) do_sat_bhs(do_srshr(x, sh), INT16_MIN, INT16_MAX)
377
@@ -XXX,XX +XXX,XX @@ DO_SHRNB(sve2_sqrshrnb_d, int64_t, uint32_t, DO_SQRSHRN_D)
378
379
DO_SHRNT(sve2_sqrshrnt_h, int16_t, uint8_t, H1_2, H1, DO_SQRSHRN_H)
380
DO_SHRNT(sve2_sqrshrnt_s, int32_t, uint16_t, H1_4, H1_2, DO_SQRSHRN_S)
381
-DO_SHRNT(sve2_sqrshrnt_d, int64_t, uint32_t, , H1_4, DO_SQRSHRN_D)
382
+DO_SHRNT(sve2_sqrshrnt_d, int64_t, uint32_t, H1_8, H1_4, DO_SQRSHRN_D)
383
384
#define DO_UQSHRN_H(x, sh) MIN(x >> sh, UINT8_MAX)
385
#define DO_UQSHRN_S(x, sh) MIN(x >> sh, UINT16_MAX)
386
@@ -XXX,XX +XXX,XX @@ DO_SHRNB(sve2_uqshrnb_d, uint64_t, uint32_t, DO_UQSHRN_D)
387
388
DO_SHRNT(sve2_uqshrnt_h, uint16_t, uint8_t, H1_2, H1, DO_UQSHRN_H)
389
DO_SHRNT(sve2_uqshrnt_s, uint32_t, uint16_t, H1_4, H1_2, DO_UQSHRN_S)
390
-DO_SHRNT(sve2_uqshrnt_d, uint64_t, uint32_t, , H1_4, DO_UQSHRN_D)
391
+DO_SHRNT(sve2_uqshrnt_d, uint64_t, uint32_t, H1_8, H1_4, DO_UQSHRN_D)
392
393
#define DO_UQRSHRN_H(x, sh) MIN(do_urshr(x, sh), UINT8_MAX)
394
#define DO_UQRSHRN_S(x, sh) MIN(do_urshr(x, sh), UINT16_MAX)
395
@@ -XXX,XX +XXX,XX @@ DO_SHRNB(sve2_uqrshrnb_d, uint64_t, uint32_t, DO_UQRSHRN_D)
396
397
DO_SHRNT(sve2_uqrshrnt_h, uint16_t, uint8_t, H1_2, H1, DO_UQRSHRN_H)
398
DO_SHRNT(sve2_uqrshrnt_s, uint32_t, uint16_t, H1_4, H1_2, DO_UQRSHRN_S)
399
-DO_SHRNT(sve2_uqrshrnt_d, uint64_t, uint32_t, , H1_4, DO_UQRSHRN_D)
400
+DO_SHRNT(sve2_uqrshrnt_d, uint64_t, uint32_t, H1_8, H1_4, DO_UQRSHRN_D)
401
402
#undef DO_SHRNB
403
#undef DO_SHRNT
404
@@ -XXX,XX +XXX,XX @@ DO_BINOPNB(sve2_addhnb_d, uint64_t, uint32_t, 32, DO_ADDHN)
405
406
DO_BINOPNT(sve2_addhnt_h, uint16_t, uint8_t, 8, H1_2, H1, DO_ADDHN)
407
DO_BINOPNT(sve2_addhnt_s, uint32_t, uint16_t, 16, H1_4, H1_2, DO_ADDHN)
408
-DO_BINOPNT(sve2_addhnt_d, uint64_t, uint32_t, 32, , H1_4, DO_ADDHN)
409
+DO_BINOPNT(sve2_addhnt_d, uint64_t, uint32_t, 32, H1_8, H1_4, DO_ADDHN)
410
411
DO_BINOPNB(sve2_raddhnb_h, uint16_t, uint8_t, 8, DO_RADDHN)
412
DO_BINOPNB(sve2_raddhnb_s, uint32_t, uint16_t, 16, DO_RADDHN)
413
@@ -XXX,XX +XXX,XX @@ DO_BINOPNB(sve2_raddhnb_d, uint64_t, uint32_t, 32, DO_RADDHN)
414
415
DO_BINOPNT(sve2_raddhnt_h, uint16_t, uint8_t, 8, H1_2, H1, DO_RADDHN)
416
DO_BINOPNT(sve2_raddhnt_s, uint32_t, uint16_t, 16, H1_4, H1_2, DO_RADDHN)
417
-DO_BINOPNT(sve2_raddhnt_d, uint64_t, uint32_t, 32, , H1_4, DO_RADDHN)
418
+DO_BINOPNT(sve2_raddhnt_d, uint64_t, uint32_t, 32, H1_8, H1_4, DO_RADDHN)
419
420
DO_BINOPNB(sve2_subhnb_h, uint16_t, uint8_t, 8, DO_SUBHN)
421
DO_BINOPNB(sve2_subhnb_s, uint32_t, uint16_t, 16, DO_SUBHN)
422
@@ -XXX,XX +XXX,XX @@ DO_BINOPNB(sve2_subhnb_d, uint64_t, uint32_t, 32, DO_SUBHN)
423
424
DO_BINOPNT(sve2_subhnt_h, uint16_t, uint8_t, 8, H1_2, H1, DO_SUBHN)
425
DO_BINOPNT(sve2_subhnt_s, uint32_t, uint16_t, 16, H1_4, H1_2, DO_SUBHN)
426
-DO_BINOPNT(sve2_subhnt_d, uint64_t, uint32_t, 32, , H1_4, DO_SUBHN)
427
+DO_BINOPNT(sve2_subhnt_d, uint64_t, uint32_t, 32, H1_8, H1_4, DO_SUBHN)
428
429
DO_BINOPNB(sve2_rsubhnb_h, uint16_t, uint8_t, 8, DO_RSUBHN)
430
DO_BINOPNB(sve2_rsubhnb_s, uint32_t, uint16_t, 16, DO_RSUBHN)
431
@@ -XXX,XX +XXX,XX @@ DO_BINOPNB(sve2_rsubhnb_d, uint64_t, uint32_t, 32, DO_RSUBHN)
432
433
DO_BINOPNT(sve2_rsubhnt_h, uint16_t, uint8_t, 8, H1_2, H1, DO_RSUBHN)
434
DO_BINOPNT(sve2_rsubhnt_s, uint32_t, uint16_t, 16, H1_4, H1_2, DO_RSUBHN)
435
-DO_BINOPNT(sve2_rsubhnt_d, uint64_t, uint32_t, 32, , H1_4, DO_RSUBHN)
436
+DO_BINOPNT(sve2_rsubhnt_d, uint64_t, uint32_t, 32, H1_8, H1_4, DO_RSUBHN)
437
438
#undef DO_RSUBHN
439
#undef DO_SUBHN
440
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, uint64_t val, uint32_t desc) \
441
DO_INSR(sve_insr_b, uint8_t, H1)
442
DO_INSR(sve_insr_h, uint16_t, H1_2)
443
DO_INSR(sve_insr_s, uint32_t, H1_4)
444
-DO_INSR(sve_insr_d, uint64_t, )
445
+DO_INSR(sve_insr_d, uint64_t, H1_8)
446
447
#undef DO_INSR
448
449
@@ -XXX,XX +XXX,XX @@ void HELPER(sve2_tbx_##SUFF)(void *vd, void *vn, void *vm, uint32_t desc) \
450
DO_TB(b, uint8_t, H1)
451
DO_TB(h, uint16_t, H2)
452
DO_TB(s, uint32_t, H4)
453
-DO_TB(d, uint64_t, )
454
+DO_TB(d, uint64_t, H8)
455
456
#undef DO_TB
457
458
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, uint32_t desc) \
459
460
DO_UNPK(sve_sunpk_h, int16_t, int8_t, H2, H1)
461
DO_UNPK(sve_sunpk_s, int32_t, int16_t, H4, H2)
462
-DO_UNPK(sve_sunpk_d, int64_t, int32_t, , H4)
463
+DO_UNPK(sve_sunpk_d, int64_t, int32_t, H8, H4)
464
465
DO_UNPK(sve_uunpk_h, uint16_t, uint8_t, H2, H1)
466
DO_UNPK(sve_uunpk_s, uint32_t, uint16_t, H4, H2)
467
-DO_UNPK(sve_uunpk_d, uint64_t, uint32_t, , H4)
468
+DO_UNPK(sve_uunpk_d, uint64_t, uint32_t, H8, H4)
469
470
#undef DO_UNPK
471
472
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \
473
DO_ZIP(sve_zip_b, uint8_t, H1)
474
DO_ZIP(sve_zip_h, uint16_t, H1_2)
475
DO_ZIP(sve_zip_s, uint32_t, H1_4)
476
-DO_ZIP(sve_zip_d, uint64_t, )
477
+DO_ZIP(sve_zip_d, uint64_t, H1_8)
478
DO_ZIP(sve2_zip_q, Int128, )
479
480
#define DO_UZP(NAME, TYPE, H) \
481
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \
482
DO_UZP(sve_uzp_b, uint8_t, H1)
483
DO_UZP(sve_uzp_h, uint16_t, H1_2)
484
DO_UZP(sve_uzp_s, uint32_t, H1_4)
485
-DO_UZP(sve_uzp_d, uint64_t, )
486
+DO_UZP(sve_uzp_d, uint64_t, H1_8)
487
DO_UZP(sve2_uzp_q, Int128, )
488
489
#define DO_TRN(NAME, TYPE, H) \
490
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \
491
DO_TRN(sve_trn_b, uint8_t, H1)
492
DO_TRN(sve_trn_h, uint16_t, H1_2)
493
DO_TRN(sve_trn_s, uint32_t, H1_4)
494
-DO_TRN(sve_trn_d, uint64_t, )
495
+DO_TRN(sve_trn_d, uint64_t, H1_8)
496
DO_TRN(sve2_trn_q, Int128, )
497
498
#undef DO_ZIP
499
@@ -XXX,XX +XXX,XX @@ uint32_t HELPER(NAME)(void *vd, void *vn, void *vm, void *vg, uint32_t desc) \
500
#define DO_CMP_PPZZ_S(NAME, TYPE, OP) \
501
DO_CMP_PPZZ(NAME, TYPE, OP, H1_4, 0x1111111111111111ull)
502
#define DO_CMP_PPZZ_D(NAME, TYPE, OP) \
503
- DO_CMP_PPZZ(NAME, TYPE, OP, , 0x0101010101010101ull)
504
+ DO_CMP_PPZZ(NAME, TYPE, OP, H1_8, 0x0101010101010101ull)
505
506
DO_CMP_PPZZ_B(sve_cmpeq_ppzz_b, uint8_t, ==)
507
DO_CMP_PPZZ_H(sve_cmpeq_ppzz_h, uint16_t, ==)
508
@@ -XXX,XX +XXX,XX @@ uint32_t HELPER(NAME)(void *vd, void *vn, void *vg, uint32_t desc) \
509
#define DO_CMP_PPZI_S(NAME, TYPE, OP) \
510
DO_CMP_PPZI(NAME, TYPE, OP, H1_4, 0x1111111111111111ull)
511
#define DO_CMP_PPZI_D(NAME, TYPE, OP) \
512
- DO_CMP_PPZI(NAME, TYPE, OP, , 0x0101010101010101ull)
513
+ DO_CMP_PPZI(NAME, TYPE, OP, H1_8, 0x0101010101010101ull)
514
515
DO_CMP_PPZI_B(sve_cmpeq_ppzi_b, uint8_t, ==)
516
DO_CMP_PPZI_H(sve_cmpeq_ppzi_h, uint16_t, ==)
517
@@ -XXX,XX +XXX,XX @@ uint64_t HELPER(NAME)(void *vn, void *vg, void *vs, uint32_t desc) \
518
519
DO_REDUCE(sve_faddv_h, float16, H1_2, add, float16_zero)
520
DO_REDUCE(sve_faddv_s, float32, H1_4, add, float32_zero)
521
-DO_REDUCE(sve_faddv_d, float64, , add, float64_zero)
522
+DO_REDUCE(sve_faddv_d, float64, H1_8, add, float64_zero)
523
524
/* Identity is floatN_default_nan, without the function call. */
525
DO_REDUCE(sve_fminnmv_h, float16, H1_2, minnum, 0x7E00)
526
DO_REDUCE(sve_fminnmv_s, float32, H1_4, minnum, 0x7FC00000)
527
-DO_REDUCE(sve_fminnmv_d, float64, , minnum, 0x7FF8000000000000ULL)
528
+DO_REDUCE(sve_fminnmv_d, float64, H1_8, minnum, 0x7FF8000000000000ULL)
529
530
DO_REDUCE(sve_fmaxnmv_h, float16, H1_2, maxnum, 0x7E00)
531
DO_REDUCE(sve_fmaxnmv_s, float32, H1_4, maxnum, 0x7FC00000)
532
-DO_REDUCE(sve_fmaxnmv_d, float64, , maxnum, 0x7FF8000000000000ULL)
533
+DO_REDUCE(sve_fmaxnmv_d, float64, H1_8, maxnum, 0x7FF8000000000000ULL)
534
535
DO_REDUCE(sve_fminv_h, float16, H1_2, min, float16_infinity)
536
DO_REDUCE(sve_fminv_s, float32, H1_4, min, float32_infinity)
537
-DO_REDUCE(sve_fminv_d, float64, , min, float64_infinity)
538
+DO_REDUCE(sve_fminv_d, float64, H1_8, min, float64_infinity)
539
540
DO_REDUCE(sve_fmaxv_h, float16, H1_2, max, float16_chs(float16_infinity))
541
DO_REDUCE(sve_fmaxv_s, float32, H1_4, max, float32_chs(float32_infinity))
542
-DO_REDUCE(sve_fmaxv_d, float64, , max, float64_chs(float64_infinity))
543
+DO_REDUCE(sve_fmaxv_d, float64, H1_8, max, float64_chs(float64_infinity))
544
545
#undef DO_REDUCE
546
547
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *vg, \
548
549
DO_ZPZZ_FP(sve_fadd_h, uint16_t, H1_2, float16_add)
550
DO_ZPZZ_FP(sve_fadd_s, uint32_t, H1_4, float32_add)
551
-DO_ZPZZ_FP(sve_fadd_d, uint64_t, , float64_add)
552
+DO_ZPZZ_FP(sve_fadd_d, uint64_t, H1_8, float64_add)
553
554
DO_ZPZZ_FP(sve_fsub_h, uint16_t, H1_2, float16_sub)
555
DO_ZPZZ_FP(sve_fsub_s, uint32_t, H1_4, float32_sub)
556
-DO_ZPZZ_FP(sve_fsub_d, uint64_t, , float64_sub)
557
+DO_ZPZZ_FP(sve_fsub_d, uint64_t, H1_8, float64_sub)
558
559
DO_ZPZZ_FP(sve_fmul_h, uint16_t, H1_2, float16_mul)
560
DO_ZPZZ_FP(sve_fmul_s, uint32_t, H1_4, float32_mul)
561
-DO_ZPZZ_FP(sve_fmul_d, uint64_t, , float64_mul)
562
+DO_ZPZZ_FP(sve_fmul_d, uint64_t, H1_8, float64_mul)
563
564
DO_ZPZZ_FP(sve_fdiv_h, uint16_t, H1_2, float16_div)
565
DO_ZPZZ_FP(sve_fdiv_s, uint32_t, H1_4, float32_div)
566
-DO_ZPZZ_FP(sve_fdiv_d, uint64_t, , float64_div)
567
+DO_ZPZZ_FP(sve_fdiv_d, uint64_t, H1_8, float64_div)
568
569
DO_ZPZZ_FP(sve_fmin_h, uint16_t, H1_2, float16_min)
570
DO_ZPZZ_FP(sve_fmin_s, uint32_t, H1_4, float32_min)
571
-DO_ZPZZ_FP(sve_fmin_d, uint64_t, , float64_min)
572
+DO_ZPZZ_FP(sve_fmin_d, uint64_t, H1_8, float64_min)
573
574
DO_ZPZZ_FP(sve_fmax_h, uint16_t, H1_2, float16_max)
575
DO_ZPZZ_FP(sve_fmax_s, uint32_t, H1_4, float32_max)
576
-DO_ZPZZ_FP(sve_fmax_d, uint64_t, , float64_max)
577
+DO_ZPZZ_FP(sve_fmax_d, uint64_t, H1_8, float64_max)
578
579
DO_ZPZZ_FP(sve_fminnum_h, uint16_t, H1_2, float16_minnum)
580
DO_ZPZZ_FP(sve_fminnum_s, uint32_t, H1_4, float32_minnum)
581
-DO_ZPZZ_FP(sve_fminnum_d, uint64_t, , float64_minnum)
582
+DO_ZPZZ_FP(sve_fminnum_d, uint64_t, H1_8, float64_minnum)
583
584
DO_ZPZZ_FP(sve_fmaxnum_h, uint16_t, H1_2, float16_maxnum)
585
DO_ZPZZ_FP(sve_fmaxnum_s, uint32_t, H1_4, float32_maxnum)
586
-DO_ZPZZ_FP(sve_fmaxnum_d, uint64_t, , float64_maxnum)
587
+DO_ZPZZ_FP(sve_fmaxnum_d, uint64_t, H1_8, float64_maxnum)
588
589
static inline float16 abd_h(float16 a, float16 b, float_status *s)
590
{
591
@@ -XXX,XX +XXX,XX @@ static inline float64 abd_d(float64 a, float64 b, float_status *s)
592
593
DO_ZPZZ_FP(sve_fabd_h, uint16_t, H1_2, abd_h)
594
DO_ZPZZ_FP(sve_fabd_s, uint32_t, H1_4, abd_s)
595
-DO_ZPZZ_FP(sve_fabd_d, uint64_t, , abd_d)
596
+DO_ZPZZ_FP(sve_fabd_d, uint64_t, H1_8, abd_d)
597
598
static inline float64 scalbn_d(float64 a, int64_t b, float_status *s)
599
{
600
@@ -XXX,XX +XXX,XX @@ static inline float64 scalbn_d(float64 a, int64_t b, float_status *s)
601
602
DO_ZPZZ_FP(sve_fscalbn_h, int16_t, H1_2, float16_scalbn)
603
DO_ZPZZ_FP(sve_fscalbn_s, int32_t, H1_4, float32_scalbn)
604
-DO_ZPZZ_FP(sve_fscalbn_d, int64_t, , scalbn_d)
605
+DO_ZPZZ_FP(sve_fscalbn_d, int64_t, H1_8, scalbn_d)
606
607
DO_ZPZZ_FP(sve_fmulx_h, uint16_t, H1_2, helper_advsimd_mulxh)
608
DO_ZPZZ_FP(sve_fmulx_s, uint32_t, H1_4, helper_vfp_mulxs)
609
-DO_ZPZZ_FP(sve_fmulx_d, uint64_t, , helper_vfp_mulxd)
610
+DO_ZPZZ_FP(sve_fmulx_d, uint64_t, H1_8, helper_vfp_mulxd)
611
612
#undef DO_ZPZZ_FP
613
614
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vg, uint64_t scalar, \
615
616
DO_ZPZS_FP(sve_fadds_h, float16, H1_2, float16_add)
617
DO_ZPZS_FP(sve_fadds_s, float32, H1_4, float32_add)
618
-DO_ZPZS_FP(sve_fadds_d, float64, , float64_add)
619
+DO_ZPZS_FP(sve_fadds_d, float64, H1_8, float64_add)
620
621
DO_ZPZS_FP(sve_fsubs_h, float16, H1_2, float16_sub)
622
DO_ZPZS_FP(sve_fsubs_s, float32, H1_4, float32_sub)
623
-DO_ZPZS_FP(sve_fsubs_d, float64, , float64_sub)
624
+DO_ZPZS_FP(sve_fsubs_d, float64, H1_8, float64_sub)
625
626
DO_ZPZS_FP(sve_fmuls_h, float16, H1_2, float16_mul)
627
DO_ZPZS_FP(sve_fmuls_s, float32, H1_4, float32_mul)
628
-DO_ZPZS_FP(sve_fmuls_d, float64, , float64_mul)
629
+DO_ZPZS_FP(sve_fmuls_d, float64, H1_8, float64_mul)
630
631
static inline float16 subr_h(float16 a, float16 b, float_status *s)
632
{
633
@@ -XXX,XX +XXX,XX @@ static inline float64 subr_d(float64 a, float64 b, float_status *s)
634
635
DO_ZPZS_FP(sve_fsubrs_h, float16, H1_2, subr_h)
636
DO_ZPZS_FP(sve_fsubrs_s, float32, H1_4, subr_s)
637
-DO_ZPZS_FP(sve_fsubrs_d, float64, , subr_d)
638
+DO_ZPZS_FP(sve_fsubrs_d, float64, H1_8, subr_d)
639
640
DO_ZPZS_FP(sve_fmaxnms_h, float16, H1_2, float16_maxnum)
641
DO_ZPZS_FP(sve_fmaxnms_s, float32, H1_4, float32_maxnum)
642
-DO_ZPZS_FP(sve_fmaxnms_d, float64, , float64_maxnum)
643
+DO_ZPZS_FP(sve_fmaxnms_d, float64, H1_8, float64_maxnum)
644
645
DO_ZPZS_FP(sve_fminnms_h, float16, H1_2, float16_minnum)
646
DO_ZPZS_FP(sve_fminnms_s, float32, H1_4, float32_minnum)
647
-DO_ZPZS_FP(sve_fminnms_d, float64, , float64_minnum)
648
+DO_ZPZS_FP(sve_fminnms_d, float64, H1_8, float64_minnum)
649
650
DO_ZPZS_FP(sve_fmaxs_h, float16, H1_2, float16_max)
651
DO_ZPZS_FP(sve_fmaxs_s, float32, H1_4, float32_max)
652
-DO_ZPZS_FP(sve_fmaxs_d, float64, , float64_max)
653
+DO_ZPZS_FP(sve_fmaxs_d, float64, H1_8, float64_max)
654
655
DO_ZPZS_FP(sve_fmins_h, float16, H1_2, float16_min)
656
DO_ZPZS_FP(sve_fmins_s, float32, H1_4, float32_min)
657
-DO_ZPZS_FP(sve_fmins_d, float64, , float64_min)
658
+DO_ZPZS_FP(sve_fmins_d, float64, H1_8, float64_min)
659
660
/* Fully general two-operand expander, controlled by a predicate,
661
* With the extra float_status parameter.
662
@@ -XXX,XX +XXX,XX @@ static inline uint64_t vfp_float64_to_uint64_rtz(float64 f, float_status *s)
663
DO_ZPZ_FP(sve_fcvt_sh, uint32_t, H1_4, sve_f32_to_f16)
664
DO_ZPZ_FP(sve_fcvt_hs, uint32_t, H1_4, sve_f16_to_f32)
665
DO_ZPZ_FP(sve_bfcvt, uint32_t, H1_4, float32_to_bfloat16)
666
-DO_ZPZ_FP(sve_fcvt_dh, uint64_t, , sve_f64_to_f16)
667
-DO_ZPZ_FP(sve_fcvt_hd, uint64_t, , sve_f16_to_f64)
668
-DO_ZPZ_FP(sve_fcvt_ds, uint64_t, , float64_to_float32)
669
-DO_ZPZ_FP(sve_fcvt_sd, uint64_t, , float32_to_float64)
670
+DO_ZPZ_FP(sve_fcvt_dh, uint64_t, H1_8, sve_f64_to_f16)
671
+DO_ZPZ_FP(sve_fcvt_hd, uint64_t, H1_8, sve_f16_to_f64)
672
+DO_ZPZ_FP(sve_fcvt_ds, uint64_t, H1_8, float64_to_float32)
673
+DO_ZPZ_FP(sve_fcvt_sd, uint64_t, H1_8, float32_to_float64)
674
675
DO_ZPZ_FP(sve_fcvtzs_hh, uint16_t, H1_2, vfp_float16_to_int16_rtz)
676
DO_ZPZ_FP(sve_fcvtzs_hs, uint32_t, H1_4, helper_vfp_tosizh)
677
DO_ZPZ_FP(sve_fcvtzs_ss, uint32_t, H1_4, helper_vfp_tosizs)
678
-DO_ZPZ_FP(sve_fcvtzs_hd, uint64_t, , vfp_float16_to_int64_rtz)
679
-DO_ZPZ_FP(sve_fcvtzs_sd, uint64_t, , vfp_float32_to_int64_rtz)
680
-DO_ZPZ_FP(sve_fcvtzs_ds, uint64_t, , helper_vfp_tosizd)
681
-DO_ZPZ_FP(sve_fcvtzs_dd, uint64_t, , vfp_float64_to_int64_rtz)
682
+DO_ZPZ_FP(sve_fcvtzs_hd, uint64_t, H1_8, vfp_float16_to_int64_rtz)
683
+DO_ZPZ_FP(sve_fcvtzs_sd, uint64_t, H1_8, vfp_float32_to_int64_rtz)
684
+DO_ZPZ_FP(sve_fcvtzs_ds, uint64_t, H1_8, helper_vfp_tosizd)
685
+DO_ZPZ_FP(sve_fcvtzs_dd, uint64_t, H1_8, vfp_float64_to_int64_rtz)
686
687
DO_ZPZ_FP(sve_fcvtzu_hh, uint16_t, H1_2, vfp_float16_to_uint16_rtz)
688
DO_ZPZ_FP(sve_fcvtzu_hs, uint32_t, H1_4, helper_vfp_touizh)
689
DO_ZPZ_FP(sve_fcvtzu_ss, uint32_t, H1_4, helper_vfp_touizs)
690
-DO_ZPZ_FP(sve_fcvtzu_hd, uint64_t, , vfp_float16_to_uint64_rtz)
691
-DO_ZPZ_FP(sve_fcvtzu_sd, uint64_t, , vfp_float32_to_uint64_rtz)
692
-DO_ZPZ_FP(sve_fcvtzu_ds, uint64_t, , helper_vfp_touizd)
693
-DO_ZPZ_FP(sve_fcvtzu_dd, uint64_t, , vfp_float64_to_uint64_rtz)
694
+DO_ZPZ_FP(sve_fcvtzu_hd, uint64_t, H1_8, vfp_float16_to_uint64_rtz)
695
+DO_ZPZ_FP(sve_fcvtzu_sd, uint64_t, H1_8, vfp_float32_to_uint64_rtz)
696
+DO_ZPZ_FP(sve_fcvtzu_ds, uint64_t, H1_8, helper_vfp_touizd)
697
+DO_ZPZ_FP(sve_fcvtzu_dd, uint64_t, H1_8, vfp_float64_to_uint64_rtz)
698
699
DO_ZPZ_FP(sve_frint_h, uint16_t, H1_2, helper_advsimd_rinth)
700
DO_ZPZ_FP(sve_frint_s, uint32_t, H1_4, helper_rints)
701
-DO_ZPZ_FP(sve_frint_d, uint64_t, , helper_rintd)
702
+DO_ZPZ_FP(sve_frint_d, uint64_t, H1_8, helper_rintd)
703
704
DO_ZPZ_FP(sve_frintx_h, uint16_t, H1_2, float16_round_to_int)
705
DO_ZPZ_FP(sve_frintx_s, uint32_t, H1_4, float32_round_to_int)
706
-DO_ZPZ_FP(sve_frintx_d, uint64_t, , float64_round_to_int)
707
+DO_ZPZ_FP(sve_frintx_d, uint64_t, H1_8, float64_round_to_int)
708
709
DO_ZPZ_FP(sve_frecpx_h, uint16_t, H1_2, helper_frecpx_f16)
710
DO_ZPZ_FP(sve_frecpx_s, uint32_t, H1_4, helper_frecpx_f32)
711
-DO_ZPZ_FP(sve_frecpx_d, uint64_t, , helper_frecpx_f64)
712
+DO_ZPZ_FP(sve_frecpx_d, uint64_t, H1_8, helper_frecpx_f64)
713
714
DO_ZPZ_FP(sve_fsqrt_h, uint16_t, H1_2, float16_sqrt)
715
DO_ZPZ_FP(sve_fsqrt_s, uint32_t, H1_4, float32_sqrt)
716
-DO_ZPZ_FP(sve_fsqrt_d, uint64_t, , float64_sqrt)
717
+DO_ZPZ_FP(sve_fsqrt_d, uint64_t, H1_8, float64_sqrt)
718
719
DO_ZPZ_FP(sve_scvt_hh, uint16_t, H1_2, int16_to_float16)
720
DO_ZPZ_FP(sve_scvt_sh, uint32_t, H1_4, int32_to_float16)
721
DO_ZPZ_FP(sve_scvt_ss, uint32_t, H1_4, int32_to_float32)
722
-DO_ZPZ_FP(sve_scvt_sd, uint64_t, , int32_to_float64)
723
-DO_ZPZ_FP(sve_scvt_dh, uint64_t, , int64_to_float16)
724
-DO_ZPZ_FP(sve_scvt_ds, uint64_t, , int64_to_float32)
725
-DO_ZPZ_FP(sve_scvt_dd, uint64_t, , int64_to_float64)
726
+DO_ZPZ_FP(sve_scvt_sd, uint64_t, H1_8, int32_to_float64)
727
+DO_ZPZ_FP(sve_scvt_dh, uint64_t, H1_8, int64_to_float16)
728
+DO_ZPZ_FP(sve_scvt_ds, uint64_t, H1_8, int64_to_float32)
729
+DO_ZPZ_FP(sve_scvt_dd, uint64_t, H1_8, int64_to_float64)
730
731
DO_ZPZ_FP(sve_ucvt_hh, uint16_t, H1_2, uint16_to_float16)
732
DO_ZPZ_FP(sve_ucvt_sh, uint32_t, H1_4, uint32_to_float16)
733
DO_ZPZ_FP(sve_ucvt_ss, uint32_t, H1_4, uint32_to_float32)
734
-DO_ZPZ_FP(sve_ucvt_sd, uint64_t, , uint32_to_float64)
735
-DO_ZPZ_FP(sve_ucvt_dh, uint64_t, , uint64_to_float16)
736
-DO_ZPZ_FP(sve_ucvt_ds, uint64_t, , uint64_to_float32)
737
-DO_ZPZ_FP(sve_ucvt_dd, uint64_t, , uint64_to_float64)
738
+DO_ZPZ_FP(sve_ucvt_sd, uint64_t, H1_8, uint32_to_float64)
739
+DO_ZPZ_FP(sve_ucvt_dh, uint64_t, H1_8, uint64_to_float16)
740
+DO_ZPZ_FP(sve_ucvt_ds, uint64_t, H1_8, uint64_to_float32)
741
+DO_ZPZ_FP(sve_ucvt_dd, uint64_t, H1_8, uint64_to_float64)
742
743
static int16_t do_float16_logb_as_int(float16 a, float_status *s)
744
{
745
@@ -XXX,XX +XXX,XX @@ static int64_t do_float64_logb_as_int(float64 a, float_status *s)
746
747
DO_ZPZ_FP(flogb_h, float16, H1_2, do_float16_logb_as_int)
748
DO_ZPZ_FP(flogb_s, float32, H1_4, do_float32_logb_as_int)
749
-DO_ZPZ_FP(flogb_d, float64, , do_float64_logb_as_int)
750
+DO_ZPZ_FP(flogb_d, float64, H1_8, do_float64_logb_as_int)
751
752
#undef DO_ZPZ_FP
753
754
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *vg, \
755
#define DO_FPCMP_PPZZ_S(NAME, OP) \
756
DO_FPCMP_PPZZ(NAME##_s, float32, H1_4, OP)
757
#define DO_FPCMP_PPZZ_D(NAME, OP) \
758
- DO_FPCMP_PPZZ(NAME##_d, float64, , OP)
759
+ DO_FPCMP_PPZZ(NAME##_d, float64, H1_8, OP)
760
761
#define DO_FPCMP_PPZZ_ALL(NAME, OP) \
762
DO_FPCMP_PPZZ_H(NAME, OP) \
763
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vg, \
764
#define DO_FPCMP_PPZ0_S(NAME, OP) \
765
DO_FPCMP_PPZ0(NAME##_s, float32, H1_4, OP)
766
#define DO_FPCMP_PPZ0_D(NAME, OP) \
767
- DO_FPCMP_PPZ0(NAME##_d, float64, , OP)
768
+ DO_FPCMP_PPZ0(NAME##_d, float64, H1_8, OP)
769
770
#define DO_FPCMP_PPZ0_ALL(NAME, OP) \
771
DO_FPCMP_PPZ0_H(NAME, OP) \
772
@@ -XXX,XX +XXX,XX @@ DO_LD_PRIM_1(ld1bhu, H1_2, uint16_t, uint8_t)
773
DO_LD_PRIM_1(ld1bhs, H1_2, uint16_t, int8_t)
774
DO_LD_PRIM_1(ld1bsu, H1_4, uint32_t, uint8_t)
775
DO_LD_PRIM_1(ld1bss, H1_4, uint32_t, int8_t)
776
-DO_LD_PRIM_1(ld1bdu, , uint64_t, uint8_t)
777
-DO_LD_PRIM_1(ld1bds, , uint64_t, int8_t)
778
+DO_LD_PRIM_1(ld1bdu, H1_8, uint64_t, uint8_t)
779
+DO_LD_PRIM_1(ld1bds, H1_8, uint64_t, int8_t)
780
781
#define DO_ST_PRIM_1(NAME, H, TE, TM) \
782
DO_ST_HOST(st1##NAME, H, TE, TM, stb_p) \
783
@@ -XXX,XX +XXX,XX @@ DO_LD_PRIM_1(ld1bds, , uint64_t, int8_t)
784
DO_ST_PRIM_1(bb, H1, uint8_t, uint8_t)
785
DO_ST_PRIM_1(bh, H1_2, uint16_t, uint8_t)
786
DO_ST_PRIM_1(bs, H1_4, uint32_t, uint8_t)
787
-DO_ST_PRIM_1(bd, , uint64_t, uint8_t)
788
+DO_ST_PRIM_1(bd, H1_8, uint64_t, uint8_t)
789
790
#define DO_LD_PRIM_2(NAME, H, TE, TM, LD) \
791
DO_LD_HOST(ld1##NAME##_be, H, TE, TM, LD##_be_p) \
792
@@ -XXX,XX +XXX,XX @@ DO_ST_PRIM_1(bd, , uint64_t, uint8_t)
793
DO_LD_PRIM_2(hh, H1_2, uint16_t, uint16_t, lduw)
794
DO_LD_PRIM_2(hsu, H1_4, uint32_t, uint16_t, lduw)
795
DO_LD_PRIM_2(hss, H1_4, uint32_t, int16_t, lduw)
796
-DO_LD_PRIM_2(hdu, , uint64_t, uint16_t, lduw)
797
-DO_LD_PRIM_2(hds, , uint64_t, int16_t, lduw)
798
+DO_LD_PRIM_2(hdu, H1_8, uint64_t, uint16_t, lduw)
799
+DO_LD_PRIM_2(hds, H1_8, uint64_t, int16_t, lduw)
800
801
DO_ST_PRIM_2(hh, H1_2, uint16_t, uint16_t, stw)
802
DO_ST_PRIM_2(hs, H1_4, uint32_t, uint16_t, stw)
803
-DO_ST_PRIM_2(hd, , uint64_t, uint16_t, stw)
804
+DO_ST_PRIM_2(hd, H1_8, uint64_t, uint16_t, stw)
805
806
DO_LD_PRIM_2(ss, H1_4, uint32_t, uint32_t, ldl)
807
-DO_LD_PRIM_2(sdu, , uint64_t, uint32_t, ldl)
808
-DO_LD_PRIM_2(sds, , uint64_t, int32_t, ldl)
809
+DO_LD_PRIM_2(sdu, H1_8, uint64_t, uint32_t, ldl)
810
+DO_LD_PRIM_2(sds, H1_8, uint64_t, int32_t, ldl)
811
812
DO_ST_PRIM_2(ss, H1_4, uint32_t, uint32_t, stl)
813
-DO_ST_PRIM_2(sd, , uint64_t, uint32_t, stl)
814
+DO_ST_PRIM_2(sd, H1_8, uint64_t, uint32_t, stl)
815
816
-DO_LD_PRIM_2(dd, , uint64_t, uint64_t, ldq)
817
-DO_ST_PRIM_2(dd, , uint64_t, uint64_t, stq)
818
+DO_LD_PRIM_2(dd, H1_8, uint64_t, uint64_t, ldq)
819
+DO_ST_PRIM_2(dd, H1_8, uint64_t, uint64_t, stq)
820
821
#undef DO_LD_TLB
822
#undef DO_ST_TLB
823
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vg, void *status, uint32_t desc) \
824
825
DO_FCVTNT(sve_bfcvtnt, uint32_t, uint16_t, H1_4, H1_2, float32_to_bfloat16)
826
DO_FCVTNT(sve2_fcvtnt_sh, uint32_t, uint16_t, H1_4, H1_2, sve_f32_to_f16)
827
-DO_FCVTNT(sve2_fcvtnt_ds, uint64_t, uint32_t, , H1_4, float64_to_float32)
828
+DO_FCVTNT(sve2_fcvtnt_ds, uint64_t, uint32_t, H1_8, H1_4, float64_to_float32)
829
830
#define DO_FCVTLT(NAME, TYPEW, TYPEN, HW, HN, OP) \
831
void HELPER(NAME)(void *vd, void *vn, void *vg, void *status, uint32_t desc) \
832
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vg, void *status, uint32_t desc) \
833
}
834
835
DO_FCVTLT(sve2_fcvtlt_hs, uint32_t, uint16_t, H1_4, H1_2, sve_f16_to_f32)
836
-DO_FCVTLT(sve2_fcvtlt_sd, uint64_t, uint32_t, , H1_4, float32_to_float64)
837
+DO_FCVTLT(sve2_fcvtlt_sd, uint64_t, uint32_t, H1_8, H1_4, float32_to_float64)
838
839
#undef DO_FCVTLT
840
#undef DO_FCVTNT
841
diff --git a/target/arm/vec_helper.c b/target/arm/vec_helper.c
842
index XXXXXXX..XXXXXXX 100644
843
--- a/target/arm/vec_helper.c
844
+++ b/target/arm/vec_helper.c
845
@@ -XXX,XX +XXX,XX @@ DO_DOT_IDX(gvec_sdot_idx_b, int32_t, int8_t, int8_t, H4)
846
DO_DOT_IDX(gvec_udot_idx_b, uint32_t, uint8_t, uint8_t, H4)
847
DO_DOT_IDX(gvec_sudot_idx_b, int32_t, int8_t, uint8_t, H4)
848
DO_DOT_IDX(gvec_usdot_idx_b, int32_t, uint8_t, int8_t, H4)
849
-DO_DOT_IDX(gvec_sdot_idx_h, int64_t, int16_t, int16_t, )
850
-DO_DOT_IDX(gvec_udot_idx_h, uint64_t, uint16_t, uint16_t, )
851
+DO_DOT_IDX(gvec_sdot_idx_h, int64_t, int16_t, int16_t, H8)
852
+DO_DOT_IDX(gvec_udot_idx_h, uint64_t, uint16_t, uint16_t, H8)
853
854
void HELPER(gvec_fcaddh)(void *vd, void *vn, void *vm,
855
void *vfpst, uint32_t desc)
856
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, uint32_t desc) \
857
858
DO_MUL_IDX(gvec_mul_idx_h, uint16_t, H2)
859
DO_MUL_IDX(gvec_mul_idx_s, uint32_t, H4)
860
-DO_MUL_IDX(gvec_mul_idx_d, uint64_t, )
861
+DO_MUL_IDX(gvec_mul_idx_d, uint64_t, H8)
862
863
#undef DO_MUL_IDX
864
865
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, uint32_t desc) \
866
867
DO_MLA_IDX(gvec_mla_idx_h, uint16_t, +, H2)
868
DO_MLA_IDX(gvec_mla_idx_s, uint32_t, +, H4)
869
-DO_MLA_IDX(gvec_mla_idx_d, uint64_t, +, )
870
+DO_MLA_IDX(gvec_mla_idx_d, uint64_t, +, H8)
871
872
DO_MLA_IDX(gvec_mls_idx_h, uint16_t, -, H2)
873
DO_MLA_IDX(gvec_mls_idx_s, uint32_t, -, H4)
874
-DO_MLA_IDX(gvec_mls_idx_d, uint64_t, -, )
875
+DO_MLA_IDX(gvec_mls_idx_d, uint64_t, -, H8)
876
877
#undef DO_MLA_IDX
878
879
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *stat, uint32_t desc) \
880
881
DO_FMUL_IDX(gvec_fmul_idx_h, nop, float16, H2)
882
DO_FMUL_IDX(gvec_fmul_idx_s, nop, float32, H4)
883
-DO_FMUL_IDX(gvec_fmul_idx_d, nop, float64, )
884
+DO_FMUL_IDX(gvec_fmul_idx_d, nop, float64, H8)
885
886
/*
887
* Non-fused multiply-accumulate operations, for Neon. NB that unlike
888
@@ -XXX,XX +XXX,XX @@ void HELPER(NAME)(void *vd, void *vn, void *vm, void *va, \
889
890
DO_FMLA_IDX(gvec_fmla_idx_h, float16, H2)
891
DO_FMLA_IDX(gvec_fmla_idx_s, float32, H4)
892
-DO_FMLA_IDX(gvec_fmla_idx_d, float64, )
893
+DO_FMLA_IDX(gvec_fmla_idx_d, float64, H8)
894
895
#undef DO_FMLA_IDX
896
897
--
898
2.20.1
899
900
diff view generated by jsdifflib
1
MVE has an FPSCR.QC bit similar to the A-profile Neon one; when MVE
1
The architecture requires (R_TYTWB) that an attempt to return from EL3
2
is implemented make the bit writeable, both in the generic "load and
2
when SCR_EL3.{NSE,NS} are {1,0} is an illegal exception return. (This
3
store FPSCR" helper functions and in the code for handling the NZCVQC
3
enforces that the CPU can't ever be executing below EL3 with the
4
sysreg which we had previously left as "TODO when we implement MVE".
4
NSE,NS bits indicating an invalid security state.)
5
6
We were missing this check; add it.
5
7
6
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
9
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
8
Message-id: 20210614151007.4545-3-peter.maydell@linaro.org
10
Message-id: 20230807150618.101357-1-peter.maydell@linaro.org
9
---
11
---
10
target/arm/translate-vfp.c | 30 +++++++++++++++++++++---------
12
target/arm/tcg/helper-a64.c | 9 +++++++++
11
target/arm/vfp_helper.c | 3 ++-
13
1 file changed, 9 insertions(+)
12
2 files changed, 23 insertions(+), 10 deletions(-)
13
14
14
diff --git a/target/arm/translate-vfp.c b/target/arm/translate-vfp.c
15
diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c
15
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
16
--- a/target/arm/translate-vfp.c
17
--- a/target/arm/tcg/helper-a64.c
17
+++ b/target/arm/translate-vfp.c
18
+++ b/target/arm/tcg/helper-a64.c
18
@@ -XXX,XX +XXX,XX @@ static bool gen_M_fp_sysreg_write(DisasContext *s, int regno,
19
@@ -XXX,XX +XXX,XX @@ void HELPER(exception_return)(CPUARMState *env, uint64_t new_pc)
19
{
20
spsr &= ~PSTATE_SS;
20
TCGv_i32 fpscr;
21
tmp = loadfn(s, opaque);
22
- /*
23
- * TODO: when we implement MVE, write the QC bit.
24
- * For non-MVE, QC is RES0.
25
- */
26
+ if (dc_isar_feature(aa32_mve, s)) {
27
+ /* QC is only present for MVE; otherwise RES0 */
28
+ TCGv_i32 qc = tcg_temp_new_i32();
29
+ tcg_gen_andi_i32(qc, tmp, FPCR_QC);
30
+ /*
31
+ * The 4 vfp.qc[] fields need only be "zero" vs "non-zero";
32
+ * here writing the same value into all elements is simplest.
33
+ */
34
+ tcg_gen_gvec_dup_i32(MO_32, offsetof(CPUARMState, vfp.qc),
35
+ 16, 16, qc);
36
+ }
37
tcg_gen_andi_i32(tmp, tmp, FPCR_NZCV_MASK);
38
fpscr = load_cpu_field(vfp.xregs[ARM_VFP_FPSCR]);
39
tcg_gen_andi_i32(fpscr, fpscr, ~FPCR_NZCV_MASK);
40
@@ -XXX,XX +XXX,XX @@ static bool gen_M_fp_sysreg_read(DisasContext *s, int regno,
41
break;
42
}
21
}
43
22
44
+ if (regno == ARM_VFP_FPSCR_NZCVQC && !dc_isar_feature(aa32_mve, s)) {
23
+ /*
45
+ /* QC is RES0 without MVE, so NZCVQC simplifies to NZCV */
24
+ * FEAT_RME forbids return from EL3 with an invalid security state.
46
+ regno = QEMU_VFP_FPSCR_NZCV;
25
+ * We don't need an explicit check for FEAT_RME here because we enforce
26
+ * in scr_write() that you can't set the NSE bit without it.
27
+ */
28
+ if (cur_el == 3 && (env->cp15.scr_el3 & (SCR_NS | SCR_NSE)) == SCR_NSE) {
29
+ goto illegal_return;
47
+ }
30
+ }
48
+
31
+
49
switch (regno) {
32
new_el = el_from_spsr(spsr);
50
case ARM_VFP_FPSCR:
33
if (new_el == -1) {
51
tmp = tcg_temp_new_i32();
34
goto illegal_return;
52
@@ -XXX,XX +XXX,XX @@ static bool gen_M_fp_sysreg_read(DisasContext *s, int regno,
53
storefn(s, opaque, tmp);
54
break;
55
case ARM_VFP_FPSCR_NZCVQC:
56
- /*
57
- * TODO: MVE has a QC bit, which we probably won't store
58
- * in the xregs[] field. For non-MVE, where QC is RES0,
59
- * we can just fall through to the FPSCR_NZCV case.
60
- */
61
+ tmp = tcg_temp_new_i32();
62
+ gen_helper_vfp_get_fpscr(tmp, cpu_env);
63
+ tcg_gen_andi_i32(tmp, tmp, FPCR_NZCVQC_MASK);
64
+ storefn(s, opaque, tmp);
65
+ break;
66
case QEMU_VFP_FPSCR_NZCV:
67
/*
68
* Read just NZCV; this is a special case to avoid the
69
diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c
70
index XXXXXXX..XXXXXXX 100644
71
--- a/target/arm/vfp_helper.c
72
+++ b/target/arm/vfp_helper.c
73
@@ -XXX,XX +XXX,XX @@ void HELPER(vfp_set_fpscr)(CPUARMState *env, uint32_t val)
74
FPCR_LTPSIZE_LENGTH);
75
}
76
77
- if (arm_feature(env, ARM_FEATURE_NEON)) {
78
+ if (arm_feature(env, ARM_FEATURE_NEON) ||
79
+ cpu_isar_feature(aa32_mve, cpu)) {
80
/*
81
* The bit we set within fpscr_q is arbitrary; the register as a
82
* whole being zero/non-zero is what counts.
83
--
35
--
84
2.20.1
36
2.34.1
85
86
diff view generated by jsdifflib
1
Implement the MVE WLSTP insn; this is like the existing WLS insn,
1
In the m48t59 device we almost always use 64-bit arithmetic when
2
except that it specifies a size value which is used to set
2
dealing with time_t deltas. The one exception is in set_alarm(),
3
FPSCR.LTPSIZE.
3
which currently uses a plain 'int' to hold the difference between two
4
time_t values. Switch to int64_t instead to avoid any possible
5
overflow issues.
4
6
5
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
8
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
7
Message-id: 20210614151007.4545-8-peter.maydell@linaro.org
8
---
9
---
9
target/arm/t32.decode | 8 ++++++--
10
hw/rtc/m48t59.c | 2 +-
10
target/arm/translate.c | 37 ++++++++++++++++++++++++++++++++++++-
11
1 file changed, 1 insertion(+), 1 deletion(-)
11
2 files changed, 42 insertions(+), 3 deletions(-)
12
12
13
diff --git a/target/arm/t32.decode b/target/arm/t32.decode
13
diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c
14
index XXXXXXX..XXXXXXX 100644
14
index XXXXXXX..XXXXXXX 100644
15
--- a/target/arm/t32.decode
15
--- a/hw/rtc/m48t59.c
16
+++ b/target/arm/t32.decode
16
+++ b/hw/rtc/m48t59.c
17
@@ -XXX,XX +XXX,XX @@ BL 1111 0. .......... 11.1 ............ @branch24
17
@@ -XXX,XX +XXX,XX @@ static void alarm_cb (void *opaque)
18
%lob_imm 1:10 11:1 !function=times_2
18
19
19
static void set_alarm(M48t59State *NVRAM)
20
DLS 1111 0 0000 100 rn:4 1110 0000 0000 0001
20
{
21
- WLS 1111 0 0000 100 rn:4 1100 . .......... 1 imm=%lob_imm
21
- int diff;
22
- LE 1111 0 0000 0 f:1 0 1111 1100 . .......... 1 imm=%lob_imm
22
+ int64_t diff;
23
+ WLS 1111 0 0000 100 rn:4 1100 . .......... 1 imm=%lob_imm size=4
23
if (NVRAM->alrm_timer != NULL) {
24
+ {
24
timer_del(NVRAM->alrm_timer);
25
+ LE 1111 0 0000 0 f:1 0 1111 1100 . .......... 1 imm=%lob_imm
25
diff = qemu_timedate_diff(&NVRAM->alarm) - NVRAM->time_offset;
26
+ # This is WLSTP
27
+ WLS 1111 0 0000 0 size:2 rn:4 1100 . .......... 1 imm=%lob_imm
28
+ }
29
30
LCTP 1111 0 0000 000 1111 1110 0000 0000 0001
31
]
32
diff --git a/target/arm/translate.c b/target/arm/translate.c
33
index XXXXXXX..XXXXXXX 100644
34
--- a/target/arm/translate.c
35
+++ b/target/arm/translate.c
36
@@ -XXX,XX +XXX,XX @@ static bool trans_WLS(DisasContext *s, arg_WLS *a)
37
return false;
38
}
39
if (a->rn == 13 || a->rn == 15) {
40
- /* CONSTRAINED UNPREDICTABLE: we choose to UNDEF */
41
+ /*
42
+ * For WLSTP rn == 15 is a related encoding (LE); the
43
+ * other cases caught by this condition are all
44
+ * CONSTRAINED UNPREDICTABLE: we choose to UNDEF
45
+ */
46
return false;
47
}
48
if (s->condexec_mask) {
49
@@ -XXX,XX +XXX,XX @@ static bool trans_WLS(DisasContext *s, arg_WLS *a)
50
*/
51
return false;
52
}
53
+ if (a->size != 4) {
54
+ /* WLSTP */
55
+ if (!dc_isar_feature(aa32_mve, s)) {
56
+ return false;
57
+ }
58
+ /*
59
+ * We need to check that the FPU is enabled here, but mustn't
60
+ * call vfp_access_check() to do that because we don't want to
61
+ * do the lazy state preservation in the "loop count is zero" case.
62
+ * Do the check-and-raise-exception by hand.
63
+ */
64
+ if (s->fp_excp_el) {
65
+ gen_exception_insn(s, s->pc_curr, EXCP_NOCP,
66
+ syn_uncategorized(), s->fp_excp_el);
67
+ return true;
68
+ }
69
+ }
70
+
71
nextlabel = gen_new_label();
72
tcg_gen_brcondi_i32(TCG_COND_EQ, cpu_R[a->rn], 0, nextlabel);
73
tmp = load_reg(s, a->rn);
74
store_reg(s, 14, tmp);
75
+ if (a->size != 4) {
76
+ /*
77
+ * WLSTP: set FPSCR.LTPSIZE. This requires that we do the
78
+ * lazy state preservation, new FP context creation, etc,
79
+ * that vfp_access_check() does. We know that the actual
80
+ * access check will succeed (ie it won't generate code that
81
+ * throws an exception) because we did that check by hand earlier.
82
+ */
83
+ bool ok = vfp_access_check(s);
84
+ assert(ok);
85
+ tmp = tcg_const_i32(a->size);
86
+ store_cpu_field(tmp, v7m.ltpsize);
87
+ }
88
gen_jmp_tb(s, s->base.pc_next, 1);
89
90
gen_set_label(nextlabel);
91
--
26
--
92
2.20.1
27
2.34.1
93
28
94
29
diff view generated by jsdifflib
1
In commit a3494d4671797c we reworked the M-profile handling of its
1
In the twl92230 device, use int64_t for the two state fields
2
checks for when the NOCP exception should be raised because the FPU
2
sec_offset and alm_sec, because we set these to values that
3
is disabled, so that (in line with the architecture) the NOCP check
3
are either time_t or differences between two time_t values.
4
is done early over a large range of the encoding space, and takes
5
precedence over UNDEF exceptions. As part of this, we removed the
6
code from full_vfp_access_check() which raised an exception there for
7
M-profile with the FPU disabled, because it was no longer reachable.
8
4
9
For MVE, some instructions which are outside the "coprocessor space"
5
These fields aren't saved in vmstate anywhere, so we can
10
region of the encoding space must nonetheless do "is the FPU enabled"
6
safely widen them.
11
checks and possibly raise a NOCP exception. (In particular this
12
covers the MVE-specific low-overhead branch insns LCTP, DLSTP and
13
WLSTP.) To support these insns, reinstate the code in
14
full_vfp_access_check(), so that their trans functions can call
15
vfp_access_check() and get the correct behaviour.
16
7
17
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
18
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
9
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
19
Message-id: 20210614151007.4545-6-peter.maydell@linaro.org
20
---
10
---
21
target/arm/translate-vfp.c | 20 +++++++++++++++-----
11
hw/rtc/twl92230.c | 4 ++--
22
1 file changed, 15 insertions(+), 5 deletions(-)
12
1 file changed, 2 insertions(+), 2 deletions(-)
23
13
24
diff --git a/target/arm/translate-vfp.c b/target/arm/translate-vfp.c
14
diff --git a/hw/rtc/twl92230.c b/hw/rtc/twl92230.c
25
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
26
--- a/target/arm/translate-vfp.c
16
--- a/hw/rtc/twl92230.c
27
+++ b/target/arm/translate-vfp.c
17
+++ b/hw/rtc/twl92230.c
28
@@ -XXX,XX +XXX,XX @@ static void gen_preserve_fp_state(DisasContext *s)
18
@@ -XXX,XX +XXX,XX @@ struct MenelausState {
29
static bool full_vfp_access_check(DisasContext *s, bool ignore_vfp_enabled)
19
struct tm tm;
30
{
20
struct tm new;
31
if (s->fp_excp_el) {
21
struct tm alm;
32
- /* M-profile handled this earlier, in disas_m_nocp() */
22
- int sec_offset;
33
- assert (!arm_dc_feature(s, ARM_FEATURE_M));
23
- int alm_sec;
34
- gen_exception_insn(s, s->pc_curr, EXCP_UDEF,
24
+ int64_t sec_offset;
35
- syn_fp_access_trap(1, 0xe, false),
25
+ int64_t alm_sec;
36
- s->fp_excp_el);
26
int next_comp;
37
+ if (arm_dc_feature(s, ARM_FEATURE_M)) {
27
} rtc;
38
+ /*
28
uint16_t rtc_next_vmstate;
39
+ * M-profile mostly catches the "FPU disabled" case early, in
40
+ * disas_m_nocp(), but a few insns (eg LCTP, WLSTP, DLSTP)
41
+ * which do coprocessor-checks are outside the large ranges of
42
+ * the encoding space handled by the patterns in m-nocp.decode,
43
+ * and for them we may need to raise NOCP here.
44
+ */
45
+ gen_exception_insn(s, s->pc_curr, EXCP_NOCP,
46
+ syn_uncategorized(), s->fp_excp_el);
47
+ } else {
48
+ gen_exception_insn(s, s->pc_curr, EXCP_UDEF,
49
+ syn_fp_access_trap(1, 0xe, false),
50
+ s->fp_excp_el);
51
+ }
52
return false;
53
}
54
55
--
29
--
56
2.20.1
30
2.34.1
57
31
58
32
diff view generated by jsdifflib
1
On A-profile, PSR bits [15:10][26:25] are always the IT state bits.
1
In the aspeed_rtc device we store a difference between two time_t
2
On M-profile, some of the reserved encodings of the IT state are used
2
values in an 'int'. This is not really correct when time_t could
3
to instead indicate partial progress through instructions that were
3
be 64 bits. Enlarge the field to 'int64_t'.
4
interrupted partway through by an exception and can be resumed.
5
4
6
These resumable instructions fall into two categories:
5
This is a migration compatibility break for the aspeed boards.
7
6
While we are changing the vmstate, remove the accidental
8
(1) load/store multiple instructions, where these bits are called
7
duplicate of the offset field.
9
"ICI" and specify the register in the ldm/stm list where execution
10
should resume. (Specifically: LDM, STM, VLDM, VSTM, VLLDM, VLSTM,
11
CLRM, VSCCLRM.)
12
13
(2) MVE instructions subject to beatwise execution, where these bits
14
are called "ECI" and specify which beats in this and possibly also
15
the following MVE insn have been executed.
16
17
There are also a few insns (LE, LETP, and BKPT) which do not use the
18
ICI/ECI bits but must leave them alone.
19
20
Otherwise, we should raise an INVSTATE UsageFault for any attempt to
21
execute an insn with non-zero ICI/ECI bits.
22
23
So far we have been able to ignore ECI/ICI, because the architecture
24
allows the IMPDEF choice of "always restart load/store multiple from
25
the beginning regardless of ICI state", so the only thing we have
26
been missing is that we don't raise the INVSTATE fault for bad guest
27
code. However, MVE requires that we honour ECI bits and do not
28
rexecute beats of an insn that have already been executed.
29
30
Add the support in the decoder for handling ECI/ICI:
31
* identify the ECI/ICI case in the CONDEXEC TB flags
32
* when a load/store multiple insn succeeds, it updates the ECI/ICI
33
state (both in DisasContext and in the CPU state), and sets a flag
34
to say that the ECI/ICI state was handled
35
* if we find that the insn we just decoded did not handle the
36
ECI/ICI state, we delete all the code that we just generated for
37
it and instead emit the code to raise the INVFAULT. This allows
38
us to avoid having to update every non-MVE non-LDM/STM insn to
39
make it check for "is ECI/ICI set?".
40
41
We continue with our existing IMPDEF choice of not caring about the
42
ICI state for the load/store multiples and simply restarting them
43
from the beginning. Because we don't allow interrupts in the middle
44
of an insn, the only way we would see this state is if the guest set
45
ICI manually on return from an exception handler, so it's a corner
46
case which doesn't merit optimisation.
47
48
ICI update for LDM/STM is simple -- it always zeroes the state. ECI
49
update for MVE beatwise insns will be a little more complex, since
50
the ECI state may include information for the following insn.
51
8
52
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
53
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
10
Reviewed-by: Cédric Le Goater <clg@kaod.org>
54
Message-id: 20210614151007.4545-5-peter.maydell@linaro.org
55
---
11
---
56
target/arm/translate-a32.h | 1 +
12
include/hw/rtc/aspeed_rtc.h | 2 +-
57
target/arm/translate.h | 9 +++
13
hw/rtc/aspeed_rtc.c | 5 ++---
58
target/arm/translate-m-nocp.c | 11 ++++
14
2 files changed, 3 insertions(+), 4 deletions(-)
59
target/arm/translate-vfp.c | 6 ++
60
target/arm/translate.c | 111 ++++++++++++++++++++++++++++++++--
61
5 files changed, 133 insertions(+), 5 deletions(-)
62
15
63
diff --git a/target/arm/translate-a32.h b/target/arm/translate-a32.h
16
diff --git a/include/hw/rtc/aspeed_rtc.h b/include/hw/rtc/aspeed_rtc.h
64
index XXXXXXX..XXXXXXX 100644
17
index XXXXXXX..XXXXXXX 100644
65
--- a/target/arm/translate-a32.h
18
--- a/include/hw/rtc/aspeed_rtc.h
66
+++ b/target/arm/translate-a32.h
19
+++ b/include/hw/rtc/aspeed_rtc.h
67
@@ -XXX,XX +XXX,XX @@ long vfp_reg_offset(bool dp, unsigned reg);
20
@@ -XXX,XX +XXX,XX @@ struct AspeedRtcState {
68
long neon_full_reg_offset(unsigned reg);
21
qemu_irq irq;
69
long neon_element_offset(int reg, int element, MemOp memop);
22
70
void gen_rev16(TCGv_i32 dest, TCGv_i32 var);
23
uint32_t reg[0x18];
71
+void clear_eci_state(DisasContext *s);
24
- int offset;
72
25
+ int64_t offset;
73
static inline TCGv_i32 load_cpu_offset(int offset)
26
74
{
27
};
75
diff --git a/target/arm/translate.h b/target/arm/translate.h
28
29
diff --git a/hw/rtc/aspeed_rtc.c b/hw/rtc/aspeed_rtc.c
76
index XXXXXXX..XXXXXXX 100644
30
index XXXXXXX..XXXXXXX 100644
77
--- a/target/arm/translate.h
31
--- a/hw/rtc/aspeed_rtc.c
78
+++ b/target/arm/translate.h
32
+++ b/hw/rtc/aspeed_rtc.c
79
@@ -XXX,XX +XXX,XX @@ typedef struct DisasContext {
33
@@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps aspeed_rtc_ops = {
80
/* Thumb-2 conditional execution bits. */
34
81
int condexec_mask;
35
static const VMStateDescription vmstate_aspeed_rtc = {
82
int condexec_cond;
36
.name = TYPE_ASPEED_RTC,
83
+ /* M-profile ECI/ICI exception-continuable instruction state */
37
- .version_id = 1,
84
+ int eci;
38
+ .version_id = 2,
85
+ /*
39
.fields = (VMStateField[]) {
86
+ * trans_ functions for insns which are continuable should set this true
40
VMSTATE_UINT32_ARRAY(reg, AspeedRtcState, 0x18),
87
+ * after decode (ie after any UNDEF checks)
41
- VMSTATE_INT32(offset, AspeedRtcState),
88
+ */
42
- VMSTATE_INT32(offset, AspeedRtcState),
89
+ bool eci_handled;
43
+ VMSTATE_INT64(offset, AspeedRtcState),
90
+ /* TCG op to rewind to if this turns out to be an invalid ECI state */
44
VMSTATE_END_OF_LIST()
91
+ TCGOp *insn_eci_rewind;
92
int thumb;
93
int sctlr_b;
94
MemOp be_data;
95
diff --git a/target/arm/translate-m-nocp.c b/target/arm/translate-m-nocp.c
96
index XXXXXXX..XXXXXXX 100644
97
--- a/target/arm/translate-m-nocp.c
98
+++ b/target/arm/translate-m-nocp.c
99
@@ -XXX,XX +XXX,XX @@ static bool trans_VLLDM_VLSTM(DisasContext *s, arg_VLLDM_VLSTM *a)
100
unallocated_encoding(s);
101
return true;
102
}
45
}
103
+
46
};
104
+ s->eci_handled = true;
105
+
106
/* If no fpu, NOP. */
107
if (!dc_isar_feature(aa32_vfp, s)) {
108
+ clear_eci_state(s);
109
return true;
110
}
111
112
@@ -XXX,XX +XXX,XX @@ static bool trans_VLLDM_VLSTM(DisasContext *s, arg_VLLDM_VLSTM *a)
113
}
114
tcg_temp_free_i32(fptr);
115
116
+ clear_eci_state(s);
117
+
118
/* End the TB, because we have updated FP control bits */
119
s->base.is_jmp = DISAS_UPDATE_EXIT;
120
return true;
121
@@ -XXX,XX +XXX,XX @@ static bool trans_VSCCLRM(DisasContext *s, arg_VSCCLRM *a)
122
return true;
123
}
124
125
+ s->eci_handled = true;
126
+
127
if (!dc_isar_feature(aa32_vfp_simd, s)) {
128
/* NOP if we have neither FP nor MVE */
129
+ clear_eci_state(s);
130
return true;
131
}
132
133
@@ -XXX,XX +XXX,XX @@ static bool trans_VSCCLRM(DisasContext *s, arg_VSCCLRM *a)
134
TCGv_i32 z32 = tcg_const_i32(0);
135
store_cpu_field(z32, v7m.vpr);
136
}
137
+
138
+ clear_eci_state(s);
139
return true;
140
}
141
142
diff --git a/target/arm/translate-vfp.c b/target/arm/translate-vfp.c
143
index XXXXXXX..XXXXXXX 100644
144
--- a/target/arm/translate-vfp.c
145
+++ b/target/arm/translate-vfp.c
146
@@ -XXX,XX +XXX,XX @@ static bool trans_VLDM_VSTM_sp(DisasContext *s, arg_VLDM_VSTM_sp *a)
147
return false;
148
}
149
150
+ s->eci_handled = true;
151
+
152
if (!vfp_access_check(s)) {
153
return true;
154
}
155
@@ -XXX,XX +XXX,XX @@ static bool trans_VLDM_VSTM_sp(DisasContext *s, arg_VLDM_VSTM_sp *a)
156
tcg_temp_free_i32(addr);
157
}
158
159
+ clear_eci_state(s);
160
return true;
161
}
162
163
@@ -XXX,XX +XXX,XX @@ static bool trans_VLDM_VSTM_dp(DisasContext *s, arg_VLDM_VSTM_dp *a)
164
return false;
165
}
166
167
+ s->eci_handled = true;
168
+
169
if (!vfp_access_check(s)) {
170
return true;
171
}
172
@@ -XXX,XX +XXX,XX @@ static bool trans_VLDM_VSTM_dp(DisasContext *s, arg_VLDM_VSTM_dp *a)
173
tcg_temp_free_i32(addr);
174
}
175
176
+ clear_eci_state(s);
177
return true;
178
}
179
180
diff --git a/target/arm/translate.c b/target/arm/translate.c
181
index XXXXXXX..XXXXXXX 100644
182
--- a/target/arm/translate.c
183
+++ b/target/arm/translate.c
184
@@ -XXX,XX +XXX,XX @@ static inline bool is_singlestepping(DisasContext *s)
185
return s->base.singlestep_enabled || s->ss_active;
186
}
187
188
+void clear_eci_state(DisasContext *s)
189
+{
190
+ /*
191
+ * Clear any ECI/ICI state: used when a load multiple/store
192
+ * multiple insn executes.
193
+ */
194
+ if (s->eci) {
195
+ TCGv_i32 tmp = tcg_const_i32(0);
196
+ store_cpu_field(tmp, condexec_bits);
197
+ s->eci = 0;
198
+ }
199
+}
200
+
201
static void gen_smul_dual(TCGv_i32 a, TCGv_i32 b)
202
{
203
TCGv_i32 tmp1 = tcg_temp_new_i32();
204
@@ -XXX,XX +XXX,XX @@ static bool trans_BKPT(DisasContext *s, arg_BKPT *a)
205
if (!ENABLE_ARCH_5) {
206
return false;
207
}
208
+ /* BKPT is OK with ECI set and leaves it untouched */
209
+ s->eci_handled = true;
210
if (arm_dc_feature(s, ARM_FEATURE_M) &&
211
semihosting_enabled() &&
212
#ifndef CONFIG_USER_ONLY
213
@@ -XXX,XX +XXX,XX @@ static bool op_stm(DisasContext *s, arg_ldst_block *a, int min_n)
214
return true;
215
}
216
217
+ s->eci_handled = true;
218
+
219
addr = op_addr_block_pre(s, a, n);
220
mem_idx = get_mem_index(s);
221
222
@@ -XXX,XX +XXX,XX @@ static bool op_stm(DisasContext *s, arg_ldst_block *a, int min_n)
223
}
224
225
op_addr_block_post(s, a, addr, n);
226
+ clear_eci_state(s);
227
return true;
228
}
229
230
@@ -XXX,XX +XXX,XX @@ static bool do_ldm(DisasContext *s, arg_ldst_block *a, int min_n)
231
return true;
232
}
233
234
+ s->eci_handled = true;
235
+
236
addr = op_addr_block_pre(s, a, n);
237
mem_idx = get_mem_index(s);
238
loaded_base = false;
239
@@ -XXX,XX +XXX,XX @@ static bool do_ldm(DisasContext *s, arg_ldst_block *a, int min_n)
240
/* Must exit loop to check un-masked IRQs */
241
s->base.is_jmp = DISAS_EXIT;
242
}
243
+ clear_eci_state(s);
244
return true;
245
}
246
247
@@ -XXX,XX +XXX,XX @@ static bool trans_CLRM(DisasContext *s, arg_CLRM *a)
248
return false;
249
}
250
251
+ s->eci_handled = true;
252
+
253
zero = tcg_const_i32(0);
254
for (i = 0; i < 15; i++) {
255
if (extract32(a->list, i, 1)) {
256
@@ -XXX,XX +XXX,XX @@ static bool trans_CLRM(DisasContext *s, arg_CLRM *a)
257
tcg_temp_free_i32(maskreg);
258
}
259
tcg_temp_free_i32(zero);
260
+ clear_eci_state(s);
261
return true;
262
}
263
264
@@ -XXX,XX +XXX,XX @@ static bool trans_LE(DisasContext *s, arg_LE *a)
265
return false;
266
}
267
268
+ /* LE/LETP is OK with ECI set and leaves it untouched */
269
+ s->eci_handled = true;
270
+
271
if (!a->f) {
272
/* Not loop-forever. If LR <= 1 this is the last loop: do nothing. */
273
arm_gen_condlabel(s);
274
@@ -XXX,XX +XXX,XX @@ static void arm_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
275
dc->thumb = EX_TBFLAG_AM32(tb_flags, THUMB);
276
dc->be_data = EX_TBFLAG_ANY(tb_flags, BE_DATA) ? MO_BE : MO_LE;
277
condexec = EX_TBFLAG_AM32(tb_flags, CONDEXEC);
278
- dc->condexec_mask = (condexec & 0xf) << 1;
279
- dc->condexec_cond = condexec >> 4;
280
+ /*
281
+ * the CONDEXEC TB flags are CPSR bits [15:10][26:25]. On A-profile this
282
+ * is always the IT bits. On M-profile, some of the reserved encodings
283
+ * of IT are used instead to indicate either ICI or ECI, which
284
+ * indicate partial progress of a restartable insn that was interrupted
285
+ * partway through by an exception:
286
+ * * if CONDEXEC[3:0] != 0b0000 : CONDEXEC is IT bits
287
+ * * if CONDEXEC[3:0] == 0b0000 : CONDEXEC is ICI or ECI bits
288
+ * In all cases CONDEXEC == 0 means "not in IT block or restartable
289
+ * insn, behave normally".
290
+ */
291
+ dc->eci = dc->condexec_mask = dc->condexec_cond = 0;
292
+ dc->eci_handled = false;
293
+ dc->insn_eci_rewind = NULL;
294
+ if (condexec & 0xf) {
295
+ dc->condexec_mask = (condexec & 0xf) << 1;
296
+ dc->condexec_cond = condexec >> 4;
297
+ } else {
298
+ if (arm_feature(env, ARM_FEATURE_M)) {
299
+ dc->eci = condexec >> 4;
300
+ }
301
+ }
302
303
core_mmu_idx = EX_TBFLAG_ANY(tb_flags, MMUIDX);
304
dc->mmu_idx = core_to_arm_mmu_idx(env, core_mmu_idx);
305
@@ -XXX,XX +XXX,XX @@ static void arm_tr_tb_start(DisasContextBase *dcbase, CPUState *cpu)
306
static void arm_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu)
307
{
308
DisasContext *dc = container_of(dcbase, DisasContext, base);
309
+ /*
310
+ * The ECI/ICI bits share PSR bits with the IT bits, so we
311
+ * need to reconstitute the bits from the split-out DisasContext
312
+ * fields here.
313
+ */
314
+ uint32_t condexec_bits;
315
316
- tcg_gen_insn_start(dc->base.pc_next,
317
- (dc->condexec_cond << 4) | (dc->condexec_mask >> 1),
318
- 0);
319
+ if (dc->eci) {
320
+ condexec_bits = dc->eci << 4;
321
+ } else {
322
+ condexec_bits = (dc->condexec_cond << 4) | (dc->condexec_mask >> 1);
323
+ }
324
+ tcg_gen_insn_start(dc->base.pc_next, condexec_bits, 0);
325
dc->insn_start = tcg_last_op();
326
}
327
328
@@ -XXX,XX +XXX,XX @@ static void thumb_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
329
}
330
dc->insn = insn;
331
332
+ if (dc->eci) {
333
+ /*
334
+ * For M-profile continuable instructions, ECI/ICI handling
335
+ * falls into these cases:
336
+ * - interrupt-continuable instructions
337
+ * These are the various load/store multiple insns (both
338
+ * integer and fp). The ICI bits indicate the register
339
+ * where the load/store can resume. We make the IMPDEF
340
+ * choice to always do "instruction restart", ie ignore
341
+ * the ICI value and always execute the ldm/stm from the
342
+ * start. So all we need to do is zero PSR.ICI if the
343
+ * insn executes.
344
+ * - MVE instructions subject to beat-wise execution
345
+ * Here the ECI bits indicate which beats have already been
346
+ * executed, and we must honour this. Each insn of this
347
+ * type will handle it correctly. We will update PSR.ECI
348
+ * in the helper function for the insn (some ECI values
349
+ * mean that the following insn also has been partially
350
+ * executed).
351
+ * - Special cases which don't advance ECI
352
+ * The insns LE, LETP and BKPT leave the ECI/ICI state
353
+ * bits untouched.
354
+ * - all other insns (the common case)
355
+ * Non-zero ECI/ICI means an INVSTATE UsageFault.
356
+ * We place a rewind-marker here. Insns in the previous
357
+ * three categories will set a flag in the DisasContext.
358
+ * If the flag isn't set after we call disas_thumb_insn()
359
+ * or disas_thumb2_insn() then we know we have a "some other
360
+ * insn" case. We will rewind to the marker (ie throwing away
361
+ * all the generated code) and instead emit "take exception".
362
+ */
363
+ dc->insn_eci_rewind = tcg_last_op();
364
+ }
365
+
366
if (dc->condexec_mask && !thumb_insn_is_unconditional(dc, insn)) {
367
uint32_t cond = dc->condexec_cond;
368
369
@@ -XXX,XX +XXX,XX @@ static void thumb_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
370
}
371
}
372
373
+ if (dc->eci && !dc->eci_handled) {
374
+ /*
375
+ * Insn wasn't valid for ECI/ICI at all: undo what we
376
+ * just generated and instead emit an exception
377
+ */
378
+ tcg_remove_ops_after(dc->insn_eci_rewind);
379
+ dc->condjmp = 0;
380
+ gen_exception_insn(dc, dc->pc_curr, EXCP_INVSTATE, syn_uncategorized(),
381
+ default_exception_el(dc));
382
+ }
383
+
384
arm_post_translate_insn(dc);
385
386
/* Thumb is a variable-length ISA. Stop translation when the next insn
387
--
47
--
388
2.20.1
48
2.34.1
389
49
390
50
diff view generated by jsdifflib
1
int128_make64() creates an Int128 from an unsigned 64 bit value; add
1
The functions qemu_get_timedate() and qemu_timedate_diff() take
2
a function int128_makes64() creating an Int128 from a signed 64 bit
2
and return a time offset as an integer. Coverity points out that
3
value.
3
means that when an RTC device implementation holds an offset
4
as a time_t, as the m48t59 does, the time_t will get truncated.
5
(CID 1507157, 1517772).
6
7
The functions work with time_t internally, so make them use that type
8
in their APIs.
9
10
Note that this won't help any Y2038 issues where either the device
11
model itself is keeping the offset in a 32-bit integer, or where the
12
hardware under emulation has Y2038 or other rollover problems. If we
13
missed any cases of the former then hopefully Coverity will warn us
14
about them since after this patch we'd be truncating a time_t in
15
assignments from qemu_timedate_diff().)
4
16
5
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
17
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
18
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
7
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8
Message-id: 20210614151007.4545-34-peter.maydell@linaro.org
9
---
19
---
10
include/qemu/int128.h | 10 ++++++++++
20
include/sysemu/rtc.h | 4 ++--
11
1 file changed, 10 insertions(+)
21
softmmu/rtc.c | 4 ++--
22
2 files changed, 4 insertions(+), 4 deletions(-)
12
23
13
diff --git a/include/qemu/int128.h b/include/qemu/int128.h
24
diff --git a/include/sysemu/rtc.h b/include/sysemu/rtc.h
14
index XXXXXXX..XXXXXXX 100644
25
index XXXXXXX..XXXXXXX 100644
15
--- a/include/qemu/int128.h
26
--- a/include/sysemu/rtc.h
16
+++ b/include/qemu/int128.h
27
+++ b/include/sysemu/rtc.h
17
@@ -XXX,XX +XXX,XX @@ static inline Int128 int128_make64(uint64_t a)
28
@@ -XXX,XX +XXX,XX @@
18
return a;
29
* The behaviour of the clock whose value this function returns will
30
* depend on the -rtc command line option passed by the user.
31
*/
32
-void qemu_get_timedate(struct tm *tm, int offset);
33
+void qemu_get_timedate(struct tm *tm, time_t offset);
34
35
/**
36
* qemu_timedate_diff: Return difference between a struct tm and the RTC
37
@@ -XXX,XX +XXX,XX @@ void qemu_get_timedate(struct tm *tm, int offset);
38
* a timestamp one hour further ahead than the current RTC time
39
* then this function will return 3600.
40
*/
41
-int qemu_timedate_diff(struct tm *tm);
42
+time_t qemu_timedate_diff(struct tm *tm);
43
44
#endif
45
diff --git a/softmmu/rtc.c b/softmmu/rtc.c
46
index XXXXXXX..XXXXXXX 100644
47
--- a/softmmu/rtc.c
48
+++ b/softmmu/rtc.c
49
@@ -XXX,XX +XXX,XX @@ static time_t qemu_ref_timedate(QEMUClockType clock)
50
return value;
19
}
51
}
20
52
21
+static inline Int128 int128_makes64(int64_t a)
53
-void qemu_get_timedate(struct tm *tm, int offset)
22
+{
54
+void qemu_get_timedate(struct tm *tm, time_t offset)
23
+ return a;
24
+}
25
+
26
static inline Int128 int128_make128(uint64_t lo, uint64_t hi)
27
{
55
{
28
return (__uint128_t)hi << 64 | lo;
56
time_t ti = qemu_ref_timedate(rtc_clock);
29
@@ -XXX,XX +XXX,XX @@ static inline Int128 int128_make64(uint64_t a)
57
30
return (Int128) { a, 0 };
58
@@ -XXX,XX +XXX,XX @@ void qemu_get_timedate(struct tm *tm, int offset)
59
}
31
}
60
}
32
61
33
+static inline Int128 int128_makes64(int64_t a)
62
-int qemu_timedate_diff(struct tm *tm)
34
+{
63
+time_t qemu_timedate_diff(struct tm *tm)
35
+ return (Int128) { a, a >> 63 };
36
+}
37
+
38
static inline Int128 int128_make128(uint64_t lo, uint64_t hi)
39
{
64
{
40
return (Int128) { lo, hi };
65
time_t seconds;
66
41
--
67
--
42
2.20.1
68
2.34.1
43
69
44
70
diff view generated by jsdifflib
1
Currently the ARM SVE helper code defines locally some utility
1
Where architecturally one ARM_FEATURE_X flag implies another
2
functions for swapping 16-bit halfwords within 32-bit or 64-bit
2
ARM_FEATURE_Y, we allow the CPU init function to only set X, and then
3
values and for swapping 32-bit words within 64-bit values,
3
set Y for it. Currently we do this in two places -- we set a few
4
parallel to the byte-swapping bswap16/32/64 functions.
4
flags in arm_cpu_post_init() because we need them to decide which
5
5
properties to create on the CPU object, and then we do the rest in
6
We want these also for the ARM MVE code, and they're potentially
6
arm_cpu_realizefn(). However, this is fragile, because it's easy to
7
generally useful for other targets, so move them to bitops.h.
7
add a new property and not notice that this means that an X-implies-Y
8
(We don't put them in bswap.h with the bswap* functions because
8
check now has to move from realize to post-init.
9
they are implemented in terms of the rotate operations also
9
10
defined in bitops.h, and including bitops.h from bswap.h seems
10
As a specific example, the pmsav7-dregion property is conditional
11
better avoided.)
11
on ARM_FEATURE_PMSA && ARM_FEATURE_V7, which means it won't appear
12
on the Cortex-M33 and -M55, because they set ARM_FEATURE_V8 and
13
rely on V8-implies-V7, which doesn't happen until the realizefn.
14
15
Move all of these X-implies-Y checks into a new function, which
16
we call at the top of arm_cpu_post_init(), so the feature bits
17
are available at that point.
18
19
This does now give us the reverse issue, that if there's a feature
20
bit which is enabled or disabled by the setting of a property then
21
then X-implies-Y features that are dependent on that property need to
22
be in realize, not in this new function. But the only one of those
23
is the "EL3 implies VBAR" which is already in the right place, so
24
putting things this way round seems better to me.
12
25
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
26
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
27
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
15
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
28
Message-id: 20230724174335.2150499-2-peter.maydell@linaro.org
16
Message-id: 20210614151007.4545-17-peter.maydell@linaro.org
17
---
29
---
18
include/qemu/bitops.h | 29 +++++++++++++++++++++++++++++
30
target/arm/cpu.c | 179 +++++++++++++++++++++++++----------------------
19
target/arm/sve_helper.c | 20 --------------------
31
1 file changed, 97 insertions(+), 82 deletions(-)
20
2 files changed, 29 insertions(+), 20 deletions(-)
32
21
33
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
22
diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h
23
index XXXXXXX..XXXXXXX 100644
34
index XXXXXXX..XXXXXXX 100644
24
--- a/include/qemu/bitops.h
35
--- a/target/arm/cpu.c
25
+++ b/include/qemu/bitops.h
36
+++ b/target/arm/cpu.c
26
@@ -XXX,XX +XXX,XX @@ static inline uint64_t ror64(uint64_t word, unsigned int shift)
37
@@ -XXX,XX +XXX,XX @@ unsigned int gt_cntfrq_period_ns(ARMCPU *cpu)
27
return (word >> shift) | (word << ((64 - shift) & 63));
38
NANOSECONDS_PER_SECOND / cpu->gt_cntfrq_hz : 1;
28
}
39
}
29
40
30
+/**
41
+static void arm_cpu_propagate_feature_implications(ARMCPU *cpu)
31
+ * hswap32 - swap 16-bit halfwords within a 32-bit value
32
+ * @h: value to swap
33
+ */
34
+static inline uint32_t hswap32(uint32_t h)
35
+{
42
+{
36
+ return rol32(h, 16);
43
+ CPUARMState *env = &cpu->env;
44
+ bool no_aa32 = false;
45
+
46
+ /*
47
+ * Some features automatically imply others: set the feature
48
+ * bits explicitly for these cases.
49
+ */
50
+
51
+ if (arm_feature(env, ARM_FEATURE_M)) {
52
+ set_feature(env, ARM_FEATURE_PMSA);
53
+ }
54
+
55
+ if (arm_feature(env, ARM_FEATURE_V8)) {
56
+ if (arm_feature(env, ARM_FEATURE_M)) {
57
+ set_feature(env, ARM_FEATURE_V7);
58
+ } else {
59
+ set_feature(env, ARM_FEATURE_V7VE);
60
+ }
61
+ }
62
+
63
+ /*
64
+ * There exist AArch64 cpus without AArch32 support. When KVM
65
+ * queries ID_ISAR0_EL1 on such a host, the value is UNKNOWN.
66
+ * Similarly, we cannot check ID_AA64PFR0 without AArch64 support.
67
+ * As a general principle, we also do not make ID register
68
+ * consistency checks anywhere unless using TCG, because only
69
+ * for TCG would a consistency-check failure be a QEMU bug.
70
+ */
71
+ if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) {
72
+ no_aa32 = !cpu_isar_feature(aa64_aa32, cpu);
73
+ }
74
+
75
+ if (arm_feature(env, ARM_FEATURE_V7VE)) {
76
+ /*
77
+ * v7 Virtualization Extensions. In real hardware this implies
78
+ * EL2 and also the presence of the Security Extensions.
79
+ * For QEMU, for backwards-compatibility we implement some
80
+ * CPUs or CPU configs which have no actual EL2 or EL3 but do
81
+ * include the various other features that V7VE implies.
82
+ * Presence of EL2 itself is ARM_FEATURE_EL2, and of the
83
+ * Security Extensions is ARM_FEATURE_EL3.
84
+ */
85
+ assert(!tcg_enabled() || no_aa32 ||
86
+ cpu_isar_feature(aa32_arm_div, cpu));
87
+ set_feature(env, ARM_FEATURE_LPAE);
88
+ set_feature(env, ARM_FEATURE_V7);
89
+ }
90
+ if (arm_feature(env, ARM_FEATURE_V7)) {
91
+ set_feature(env, ARM_FEATURE_VAPA);
92
+ set_feature(env, ARM_FEATURE_THUMB2);
93
+ set_feature(env, ARM_FEATURE_MPIDR);
94
+ if (!arm_feature(env, ARM_FEATURE_M)) {
95
+ set_feature(env, ARM_FEATURE_V6K);
96
+ } else {
97
+ set_feature(env, ARM_FEATURE_V6);
98
+ }
99
+
100
+ /*
101
+ * Always define VBAR for V7 CPUs even if it doesn't exist in
102
+ * non-EL3 configs. This is needed by some legacy boards.
103
+ */
104
+ set_feature(env, ARM_FEATURE_VBAR);
105
+ }
106
+ if (arm_feature(env, ARM_FEATURE_V6K)) {
107
+ set_feature(env, ARM_FEATURE_V6);
108
+ set_feature(env, ARM_FEATURE_MVFR);
109
+ }
110
+ if (arm_feature(env, ARM_FEATURE_V6)) {
111
+ set_feature(env, ARM_FEATURE_V5);
112
+ if (!arm_feature(env, ARM_FEATURE_M)) {
113
+ assert(!tcg_enabled() || no_aa32 ||
114
+ cpu_isar_feature(aa32_jazelle, cpu));
115
+ set_feature(env, ARM_FEATURE_AUXCR);
116
+ }
117
+ }
118
+ if (arm_feature(env, ARM_FEATURE_V5)) {
119
+ set_feature(env, ARM_FEATURE_V4T);
120
+ }
121
+ if (arm_feature(env, ARM_FEATURE_LPAE)) {
122
+ set_feature(env, ARM_FEATURE_V7MP);
123
+ }
124
+ if (arm_feature(env, ARM_FEATURE_CBAR_RO)) {
125
+ set_feature(env, ARM_FEATURE_CBAR);
126
+ }
127
+ if (arm_feature(env, ARM_FEATURE_THUMB2) &&
128
+ !arm_feature(env, ARM_FEATURE_M)) {
129
+ set_feature(env, ARM_FEATURE_THUMB_DSP);
130
+ }
37
+}
131
+}
38
+
132
+
39
+/**
133
void arm_cpu_post_init(Object *obj)
40
+ * hswap64 - swap 16-bit halfwords within a 64-bit value
134
{
41
+ * @h: value to swap
135
ARMCPU *cpu = ARM_CPU(obj);
42
+ */
136
43
+static inline uint64_t hswap64(uint64_t h)
137
- /* M profile implies PMSA. We have to do this here rather than
44
+{
138
- * in realize with the other feature-implication checks because
45
+ uint64_t m = 0x0000ffff0000ffffull;
139
- * we look at the PMSA bit to see if we should add some properties.
46
+ h = rol64(h, 32);
140
+ /*
47
+ return ((h & m) << 16) | ((h >> 16) & m);
141
+ * Some features imply others. Figure this out now, because we
48
+}
142
+ * are going to look at the feature bits in deciding which
49
+
143
+ * properties to add.
50
+/**
144
*/
51
+ * wswap64 - swap 32-bit words within a 64-bit value
145
- if (arm_feature(&cpu->env, ARM_FEATURE_M)) {
52
+ * @h: value to swap
146
- set_feature(&cpu->env, ARM_FEATURE_PMSA);
53
+ */
147
- }
54
+static inline uint64_t wswap64(uint64_t h)
148
+ arm_cpu_propagate_feature_implications(cpu);
55
+{
149
56
+ return rol64(h, 32);
150
if (arm_feature(&cpu->env, ARM_FEATURE_CBAR) ||
57
+}
151
arm_feature(&cpu->env, ARM_FEATURE_CBAR_RO)) {
58
+
152
@@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
59
/**
153
CPUARMState *env = &cpu->env;
60
* extract32:
154
int pagebits;
61
* @value: the value to extract the bit field from
155
Error *local_err = NULL;
62
diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
156
- bool no_aa32 = false;
63
index XXXXXXX..XXXXXXX 100644
157
64
--- a/target/arm/sve_helper.c
158
/* Use pc-relative instructions in system-mode */
65
+++ b/target/arm/sve_helper.c
159
#ifndef CONFIG_USER_ONLY
66
@@ -XXX,XX +XXX,XX @@ static inline uint64_t expand_pred_s(uint8_t byte)
160
@@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
67
return word[byte & 0x11];
161
cpu->isar.id_isar3 = u;
68
}
162
}
69
163
70
-/* Swap 16-bit words within a 32-bit word. */
164
- /* Some features automatically imply others: */
71
-static inline uint32_t hswap32(uint32_t h)
165
- if (arm_feature(env, ARM_FEATURE_V8)) {
72
-{
166
- if (arm_feature(env, ARM_FEATURE_M)) {
73
- return rol32(h, 16);
167
- set_feature(env, ARM_FEATURE_V7);
74
-}
168
- } else {
169
- set_feature(env, ARM_FEATURE_V7VE);
170
- }
171
- }
75
-
172
-
76
-/* Swap 16-bit words within a 64-bit word. */
173
- /*
77
-static inline uint64_t hswap64(uint64_t h)
174
- * There exist AArch64 cpus without AArch32 support. When KVM
78
-{
175
- * queries ID_ISAR0_EL1 on such a host, the value is UNKNOWN.
79
- uint64_t m = 0x0000ffff0000ffffull;
176
- * Similarly, we cannot check ID_AA64PFR0 without AArch64 support.
80
- h = rol64(h, 32);
177
- * As a general principle, we also do not make ID register
81
- return ((h & m) << 16) | ((h >> 16) & m);
178
- * consistency checks anywhere unless using TCG, because only
82
-}
179
- * for TCG would a consistency-check failure be a QEMU bug.
180
- */
181
- if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) {
182
- no_aa32 = !cpu_isar_feature(aa64_aa32, cpu);
183
- }
83
-
184
-
84
-/* Swap 32-bit words within a 64-bit word. */
185
- if (arm_feature(env, ARM_FEATURE_V7VE)) {
85
-static inline uint64_t wswap64(uint64_t h)
186
- /* v7 Virtualization Extensions. In real hardware this implies
86
-{
187
- * EL2 and also the presence of the Security Extensions.
87
- return rol64(h, 32);
188
- * For QEMU, for backwards-compatibility we implement some
88
-}
189
- * CPUs or CPU configs which have no actual EL2 or EL3 but do
190
- * include the various other features that V7VE implies.
191
- * Presence of EL2 itself is ARM_FEATURE_EL2, and of the
192
- * Security Extensions is ARM_FEATURE_EL3.
193
- */
194
- assert(!tcg_enabled() || no_aa32 ||
195
- cpu_isar_feature(aa32_arm_div, cpu));
196
- set_feature(env, ARM_FEATURE_LPAE);
197
- set_feature(env, ARM_FEATURE_V7);
198
- }
199
- if (arm_feature(env, ARM_FEATURE_V7)) {
200
- set_feature(env, ARM_FEATURE_VAPA);
201
- set_feature(env, ARM_FEATURE_THUMB2);
202
- set_feature(env, ARM_FEATURE_MPIDR);
203
- if (!arm_feature(env, ARM_FEATURE_M)) {
204
- set_feature(env, ARM_FEATURE_V6K);
205
- } else {
206
- set_feature(env, ARM_FEATURE_V6);
207
- }
89
-
208
-
90
#define LOGICAL_PPPP(NAME, FUNC) \
209
- /* Always define VBAR for V7 CPUs even if it doesn't exist in
91
void HELPER(NAME)(void *vd, void *vn, void *vm, void *vg, uint32_t desc) \
210
- * non-EL3 configs. This is needed by some legacy boards.
92
{ \
211
- */
212
- set_feature(env, ARM_FEATURE_VBAR);
213
- }
214
- if (arm_feature(env, ARM_FEATURE_V6K)) {
215
- set_feature(env, ARM_FEATURE_V6);
216
- set_feature(env, ARM_FEATURE_MVFR);
217
- }
218
- if (arm_feature(env, ARM_FEATURE_V6)) {
219
- set_feature(env, ARM_FEATURE_V5);
220
- if (!arm_feature(env, ARM_FEATURE_M)) {
221
- assert(!tcg_enabled() || no_aa32 ||
222
- cpu_isar_feature(aa32_jazelle, cpu));
223
- set_feature(env, ARM_FEATURE_AUXCR);
224
- }
225
- }
226
- if (arm_feature(env, ARM_FEATURE_V5)) {
227
- set_feature(env, ARM_FEATURE_V4T);
228
- }
229
- if (arm_feature(env, ARM_FEATURE_LPAE)) {
230
- set_feature(env, ARM_FEATURE_V7MP);
231
- }
232
- if (arm_feature(env, ARM_FEATURE_CBAR_RO)) {
233
- set_feature(env, ARM_FEATURE_CBAR);
234
- }
235
- if (arm_feature(env, ARM_FEATURE_THUMB2) &&
236
- !arm_feature(env, ARM_FEATURE_M)) {
237
- set_feature(env, ARM_FEATURE_THUMB_DSP);
238
- }
239
240
/*
241
* We rely on no XScale CPU having VFP so we can use the same bits in the
93
--
242
--
94
2.20.1
243
2.34.1
95
96
diff view generated by jsdifflib
1
Implement the MVE DLSTP insn; this is like the existing DLS
1
M-profile CPUs generally allow configuration of the number of MPU
2
insn, except that it must do an FPU access check and it
2
regions that they have. We don't currently model this, so our
3
sets LTPSIZE to the value specified in the insn.
3
implementations of some of the board models provide CPUs with the
4
wrong number of regions. RTOSes like Zephyr that hardcode the
5
expected number of regions may therefore not run on the model if they
6
are set up to run on real hardware.
7
8
Add properties mpu-ns-regions and mpu-s-regions to the ARMV7M object,
9
matching the ability of hardware to configure the number of Secure
10
and NonSecure regions separately. Our actual CPU implementation
11
doesn't currently support that, and it happens that none of the MPS
12
boards we model set the number of regions differently for Secure vs
13
NonSecure, so we provide an interface to the boards and SoCs that
14
won't need to change if we ever do add that functionality in future,
15
but make it an error to configure the two properties to different
16
values.
17
18
(The property name on the CPU is the somewhat misnamed-for-M-profile
19
"pmsav7-dregion", so we don't follow that naming convention for
20
the properties here. The TRM doesn't say what the CPU configuration
21
variable names are, so we pick something, and follow the lowercase
22
convention we already have for properties here.)
4
23
5
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
24
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
25
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
7
Message-id: 20210614151007.4545-9-peter.maydell@linaro.org
26
Message-id: 20230724174335.2150499-3-peter.maydell@linaro.org
8
---
27
---
9
target/arm/t32.decode | 9 ++++++---
28
include/hw/arm/armv7m.h | 8 ++++++++
10
target/arm/translate.c | 23 +++++++++++++++++++++--
29
hw/arm/armv7m.c | 21 +++++++++++++++++++++
11
2 files changed, 27 insertions(+), 5 deletions(-)
30
2 files changed, 29 insertions(+)
12
31
13
diff --git a/target/arm/t32.decode b/target/arm/t32.decode
32
diff --git a/include/hw/arm/armv7m.h b/include/hw/arm/armv7m.h
14
index XXXXXXX..XXXXXXX 100644
33
index XXXXXXX..XXXXXXX 100644
15
--- a/target/arm/t32.decode
34
--- a/include/hw/arm/armv7m.h
16
+++ b/target/arm/t32.decode
35
+++ b/include/hw/arm/armv7m.h
17
@@ -XXX,XX +XXX,XX @@ BL 1111 0. .......... 11.1 ............ @branch24
36
@@ -XXX,XX +XXX,XX @@ OBJECT_DECLARE_SIMPLE_TYPE(ARMv7MState, ARMV7M)
18
# LE and WLS immediate
37
* + Property "vfp": enable VFP (forwarded to CPU object)
19
%lob_imm 1:10 11:1 !function=times_2
38
* + Property "dsp": enable DSP (forwarded to CPU object)
20
39
* + Property "enable-bitband": expose bitbanded IO
21
- DLS 1111 0 0000 100 rn:4 1110 0000 0000 0001
40
+ * + Property "mpu-ns-regions": number of Non-Secure MPU regions (forwarded
22
+ DLS 1111 0 0000 100 rn:4 1110 0000 0000 0001 size=4
41
+ * to CPU object pmsav7-dregion property; default is whatever the default
23
WLS 1111 0 0000 100 rn:4 1100 . .......... 1 imm=%lob_imm size=4
42
+ * for the CPU is)
24
{
43
+ * + Property "mpu-s-regions": number of Secure MPU regions (default is
25
LE 1111 0 0000 0 f:1 0 1111 1100 . .......... 1 imm=%lob_imm
44
+ * whatever the default for the CPU is; must currently be set to the same
26
# This is WLSTP
45
+ * value as mpu-ns-regions if the CPU implements the Security Extension)
27
WLS 1111 0 0000 0 size:2 rn:4 1100 . .......... 1 imm=%lob_imm
46
* + Clock input "refclk" is the external reference clock for the systick timers
47
* + Clock input "cpuclk" is the main CPU clock
48
*/
49
@@ -XXX,XX +XXX,XX @@ struct ARMv7MState {
50
Object *idau;
51
uint32_t init_svtor;
52
uint32_t init_nsvtor;
53
+ uint32_t mpu_ns_regions;
54
+ uint32_t mpu_s_regions;
55
bool enable_bitband;
56
bool start_powered_off;
57
bool vfp;
58
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c
59
index XXXXXXX..XXXXXXX 100644
60
--- a/hw/arm/armv7m.c
61
+++ b/hw/arm/armv7m.c
62
@@ -XXX,XX +XXX,XX @@ static void armv7m_realize(DeviceState *dev, Error **errp)
63
}
28
}
64
}
29
-
65
30
- LCTP 1111 0 0000 000 1111 1110 0000 0000 0001
66
+ /*
31
+ {
67
+ * Real M-profile hardware can be configured with a different number of
32
+ LCTP 1111 0 0000 000 1111 1110 0000 0000 0001
68
+ * MPU regions for Secure vs NonSecure. QEMU's CPU implementation doesn't
33
+ # This is DLSTP
69
+ * support that yet, so catch attempts to select that.
34
+ DLS 1111 0 0000 0 size:2 rn:4 1110 0000 0000 0001
70
+ */
71
+ if (arm_feature(&s->cpu->env, ARM_FEATURE_M_SECURITY) &&
72
+ s->mpu_ns_regions != s->mpu_s_regions) {
73
+ error_setg(errp,
74
+ "mpu-ns-regions and mpu-s-regions properties must have the same value");
75
+ return;
35
+ }
76
+ }
36
]
77
+ if (s->mpu_ns_regions != UINT_MAX &&
37
}
78
+ object_property_find(OBJECT(s->cpu), "pmsav7-dregion")) {
38
diff --git a/target/arm/translate.c b/target/arm/translate.c
79
+ if (!object_property_set_uint(OBJECT(s->cpu), "pmsav7-dregion",
39
index XXXXXXX..XXXXXXX 100644
80
+ s->mpu_ns_regions, errp)) {
40
--- a/target/arm/translate.c
81
+ return;
41
+++ b/target/arm/translate.c
42
@@ -XXX,XX +XXX,XX @@ static bool trans_DLS(DisasContext *s, arg_DLS *a)
43
return false;
44
}
45
if (a->rn == 13 || a->rn == 15) {
46
- /* CONSTRAINED UNPREDICTABLE: we choose to UNDEF */
47
+ /*
48
+ * For DLSTP rn == 15 is a related encoding (LCTP); the
49
+ * other cases caught by this condition are all
50
+ * CONSTRAINED UNPREDICTABLE: we choose to UNDEF
51
+ */
52
return false;
53
}
54
55
- /* Not a while loop, no tail predication: just set LR to the count */
56
+ if (a->size != 4) {
57
+ /* DLSTP */
58
+ if (!dc_isar_feature(aa32_mve, s)) {
59
+ return false;
60
+ }
61
+ if (!vfp_access_check(s)) {
62
+ return true;
63
+ }
82
+ }
64
+ }
83
+ }
65
+
84
+
66
+ /* Not a while loop: set LR to the count, and set LTPSIZE for DLSTP */
85
/*
67
tmp = load_reg(s, a->rn);
86
* Tell the CPU where the NVIC is; it will fail realize if it doesn't
68
store_reg(s, 14, tmp);
87
* have one. Similarly, tell the NVIC where its CPU is.
69
+ if (a->size != 4) {
88
@@ -XXX,XX +XXX,XX @@ static Property armv7m_properties[] = {
70
+ /* DLSTP: set FPSCR.LTPSIZE */
89
false),
71
+ tmp = tcg_const_i32(a->size);
90
DEFINE_PROP_BOOL("vfp", ARMv7MState, vfp, true),
72
+ store_cpu_field(tmp, v7m.ltpsize);
91
DEFINE_PROP_BOOL("dsp", ARMv7MState, dsp, true),
73
+ }
92
+ DEFINE_PROP_UINT32("mpu-ns-regions", ARMv7MState, mpu_ns_regions, UINT_MAX),
74
return true;
93
+ DEFINE_PROP_UINT32("mpu-s-regions", ARMv7MState, mpu_s_regions, UINT_MAX),
75
}
94
DEFINE_PROP_END_OF_LIST(),
95
};
76
96
77
--
97
--
78
2.20.1
98
2.34.1
79
99
80
100
diff view generated by jsdifflib
1
When MVE is supported, the VPR register has a place on the exception
1
The IoTKit, SSE200 and SSE300 all default to 8 MPU regions. The
2
stack frame in a previously reserved slot just above the FPSCR.
2
MPS2/MPS3 FPGA images don't override these except in the case of
3
It must also be zeroed in various situations when we invalidate
3
AN547, which uses 16 MPU regions.
4
FPU context.
4
5
5
Define properties on the ARMSSE object for the MPU regions (using the
6
Update the code which handles the stack frames (exception entry and
6
same names as the documented RTL configuration settings, and
7
exit code, VLLDM, and VLSTM) to save/restore VPR.
7
following the pattern we already have for this device of using
8
8
all-caps names as the RTL does), and set them in the board code.
9
Update code which invalidates FP registers (mostly also exception
9
10
entry and exit code, but also VSCCLRM and the code in
10
We don't actually need to override the default except on AN547,
11
full_vfp_access_check() that corresponds to the ExecuteFPCheck()
11
but it's simpler code to have the board code set them always
12
pseudocode) to zero VPR.
12
rather than tracking which board subtypes want to set them to
13
13
a non-default value separately from what that value is.
14
15
Tho overall effect is that for mps2-an505, mps2-an521 and mps3-an524
16
we now correctly use 8 MPU regions, while mps3-an547 stays at its
17
current 16 regions.
18
19
It's possible some guest code wrongly depended on the previous
20
incorrectly modeled number of memory regions. (Such guest code
21
should ideally check the number of regions via the MPU_TYPE
22
register.) The old behaviour can be obtained with additional
23
-global arguments to QEMU:
24
25
For mps2-an521 and mps2-an524:
26
-global sse-200.CPU0_MPU_NS=16 -global sse-200.CPU0_MPU_S=16 -global sse-200.CPU1_MPU_NS=16 -global sse-200.CPU1_MPU_S=16
27
28
For mps2-an505:
29
-global sse-200.CPU0_MPU_NS=16 -global sse-200.CPU0_MPU_S=16
30
31
NB that the way the implementation allows this use of -global
32
is slightly fragile: if the board code explicitly sets the
33
properties on the sse-200 object, this overrides the -global
34
command line option. So we rely on:
35
- the boards that need fixing all happen to use the SSE defaults
36
- we can write the board code to only set the property if it
37
is different from the default, rather than having all boards
38
explicitly set the property
39
- the board that does need to use a non-default value happens
40
to need to set it to the same value (16) we previously used
41
This works, but there are some kinds of refactoring of the
42
mps2-tz.c code that would break the support for -global here.
43
44
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1772
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
45
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
15
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
46
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
16
Message-id: 20210614151007.4545-4-peter.maydell@linaro.org
47
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
48
Message-id: 20230724174335.2150499-4-peter.maydell@linaro.org
17
---
49
---
18
target/arm/m_helper.c | 54 +++++++++++++++++++++++++++++------
50
include/hw/arm/armsse.h | 5 +++++
19
target/arm/translate-m-nocp.c | 5 +++-
51
hw/arm/armsse.c | 16 ++++++++++++++++
20
target/arm/translate-vfp.c | 9 ++++--
52
hw/arm/mps2-tz.c | 29 +++++++++++++++++++++++++++++
21
3 files changed, 57 insertions(+), 11 deletions(-)
53
3 files changed, 50 insertions(+)
22
54
23
diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c
55
diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h
24
index XXXXXXX..XXXXXXX 100644
56
index XXXXXXX..XXXXXXX 100644
25
--- a/target/arm/m_helper.c
57
--- a/include/hw/arm/armsse.h
26
+++ b/target/arm/m_helper.c
58
+++ b/include/hw/arm/armsse.h
27
@@ -XXX,XX +XXX,XX @@ void HELPER(v7m_preserve_fp_state)(CPUARMState *env)
59
@@ -XXX,XX +XXX,XX @@
28
uint32_t shi = extract64(dn, 32, 32);
60
* (matching the hardware) is that for CPU0 in an IoTKit and CPU1 in an
29
61
* SSE-200 both are present; CPU0 in an SSE-200 has neither.
30
if (i >= 16) {
62
* Since the IoTKit has only one CPU, it does not have the CPU1_* properties.
31
- faddr += 8; /* skip the slot for the FPSCR */
63
+ * + QOM properties "CPU0_MPU_NS", "CPU0_MPU_S", "CPU1_MPU_NS" and "CPU1_MPU_S"
32
+ faddr += 8; /* skip the slot for the FPSCR/VPR */
64
+ * which set the number of MPU regions on the CPUs. If there is only one
33
}
65
+ * CPU the CPU1 properties are not present.
34
stacked_ok = stacked_ok &&
66
* + Named GPIO inputs "EXP_IRQ" 0..n are the expansion interrupts for CPU 0,
35
v7m_stack_write(cpu, faddr, slo, mmu_idx, STACK_LAZYFP) &&
67
* which are wired to its NVIC lines 32 .. n+32
36
@@ -XXX,XX +XXX,XX @@ void HELPER(v7m_preserve_fp_state)(CPUARMState *env)
68
* + Named GPIO inputs "EXP_CPU1_IRQ" 0..n are the expansion interrupts for
37
stacked_ok = stacked_ok &&
69
@@ -XXX,XX +XXX,XX @@ struct ARMSSE {
38
v7m_stack_write(cpu, fpcar + 0x40,
70
uint32_t exp_numirq;
39
vfp_get_fpscr(env), mmu_idx, STACK_LAZYFP);
71
uint32_t sram_addr_width;
40
+ if (cpu_isar_feature(aa32_mve, cpu)) {
72
uint32_t init_svtor;
41
+ stacked_ok = stacked_ok &&
73
+ uint32_t cpu_mpu_ns[SSE_MAX_CPUS];
42
+ v7m_stack_write(cpu, fpcar + 0x44,
74
+ uint32_t cpu_mpu_s[SSE_MAX_CPUS];
43
+ env->v7m.vpr, mmu_idx, STACK_LAZYFP);
75
bool cpu_fpu[SSE_MAX_CPUS];
44
+ }
76
bool cpu_dsp[SSE_MAX_CPUS];
45
}
77
};
46
78
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
47
/*
79
index XXXXXXX..XXXXXXX 100644
48
@@ -XXX,XX +XXX,XX @@ void HELPER(v7m_preserve_fp_state)(CPUARMState *env)
80
--- a/hw/arm/armsse.c
49
env->v7m.fpccr[is_secure] &= ~R_V7M_FPCCR_LSPACT_MASK;
81
+++ b/hw/arm/armsse.c
50
82
@@ -XXX,XX +XXX,XX @@ static Property iotkit_properties[] = {
51
if (ts) {
83
DEFINE_PROP_UINT32("init-svtor", ARMSSE, init_svtor, 0x10000000),
52
- /* Clear s0 to s31 and the FPSCR */
84
DEFINE_PROP_BOOL("CPU0_FPU", ARMSSE, cpu_fpu[0], true),
53
+ /* Clear s0 to s31 and the FPSCR and VPR */
85
DEFINE_PROP_BOOL("CPU0_DSP", ARMSSE, cpu_dsp[0], true),
54
int i;
86
+ DEFINE_PROP_UINT32("CPU0_MPU_NS", ARMSSE, cpu_mpu_ns[0], 8),
55
87
+ DEFINE_PROP_UINT32("CPU0_MPU_S", ARMSSE, cpu_mpu_s[0], 8),
56
for (i = 0; i < 32; i += 2) {
88
DEFINE_PROP_END_OF_LIST()
57
*aa32_vfp_dreg(env, i / 2) = 0;
89
};
58
}
90
59
vfp_set_fpscr(env, 0);
91
@@ -XXX,XX +XXX,XX @@ static Property sse200_properties[] = {
60
+ if (cpu_isar_feature(aa32_mve, cpu)) {
92
DEFINE_PROP_BOOL("CPU0_DSP", ARMSSE, cpu_dsp[0], false),
61
+ env->v7m.vpr = 0;
93
DEFINE_PROP_BOOL("CPU1_FPU", ARMSSE, cpu_fpu[1], true),
62
+ }
94
DEFINE_PROP_BOOL("CPU1_DSP", ARMSSE, cpu_dsp[1], true),
63
}
95
+ DEFINE_PROP_UINT32("CPU0_MPU_NS", ARMSSE, cpu_mpu_ns[0], 8),
64
/*
96
+ DEFINE_PROP_UINT32("CPU0_MPU_S", ARMSSE, cpu_mpu_s[0], 8),
65
- * Otherwise s0 to s15 and FPSCR are UNKNOWN; we choose to leave them
97
+ DEFINE_PROP_UINT32("CPU1_MPU_NS", ARMSSE, cpu_mpu_ns[1], 8),
66
+ * Otherwise s0 to s15, FPSCR and VPR are UNKNOWN; we choose to leave them
98
+ DEFINE_PROP_UINT32("CPU1_MPU_S", ARMSSE, cpu_mpu_s[1], 8),
67
* unchanged.
99
DEFINE_PROP_END_OF_LIST()
68
*/
100
};
69
}
101
70
@@ -XXX,XX +XXX,XX @@ static void v7m_update_fpccr(CPUARMState *env, uint32_t frameptr,
102
@@ -XXX,XX +XXX,XX @@ static Property sse300_properties[] = {
71
void HELPER(v7m_vlstm)(CPUARMState *env, uint32_t fptr)
103
DEFINE_PROP_UINT32("init-svtor", ARMSSE, init_svtor, 0x10000000),
72
{
104
DEFINE_PROP_BOOL("CPU0_FPU", ARMSSE, cpu_fpu[0], true),
73
/* fptr is the value of Rn, the frame pointer we store the FP regs to */
105
DEFINE_PROP_BOOL("CPU0_DSP", ARMSSE, cpu_dsp[0], true),
74
+ ARMCPU *cpu = env_archcpu(env);
106
+ DEFINE_PROP_UINT32("CPU0_MPU_NS", ARMSSE, cpu_mpu_ns[0], 8),
75
bool s = env->v7m.fpccr[M_REG_S] & R_V7M_FPCCR_S_MASK;
107
+ DEFINE_PROP_UINT32("CPU0_MPU_S", ARMSSE, cpu_mpu_s[0], 8),
76
bool lspact = env->v7m.fpccr[s] & R_V7M_FPCCR_LSPACT_MASK;
108
DEFINE_PROP_END_OF_LIST()
77
uintptr_t ra = GETPC();
109
};
78
@@ -XXX,XX +XXX,XX @@ void HELPER(v7m_vlstm)(CPUARMState *env, uint32_t fptr)
110
79
cpu_stl_data_ra(env, faddr + 4, shi, ra);
111
@@ -XXX,XX +XXX,XX @@ static void armsse_realize(DeviceState *dev, Error **errp)
80
}
112
return;
81
cpu_stl_data_ra(env, fptr + 0x40, vfp_get_fpscr(env), ra);
82
+ if (cpu_isar_feature(aa32_mve, cpu)) {
83
+ cpu_stl_data_ra(env, fptr + 0x44, env->v7m.vpr, ra);
84
+ }
85
86
/*
87
- * If TS is 0 then s0 to s15 and FPSCR are UNKNOWN; we choose to
88
+ * If TS is 0 then s0 to s15, FPSCR and VPR are UNKNOWN; we choose to
89
* leave them unchanged, matching our choice in v7m_preserve_fp_state.
90
*/
91
if (ts) {
92
@@ -XXX,XX +XXX,XX @@ void HELPER(v7m_vlstm)(CPUARMState *env, uint32_t fptr)
93
*aa32_vfp_dreg(env, i / 2) = 0;
94
}
95
vfp_set_fpscr(env, 0);
96
+ if (cpu_isar_feature(aa32_mve, cpu)) {
97
+ env->v7m.vpr = 0;
98
+ }
99
}
100
} else {
101
v7m_update_fpccr(env, fptr, false);
102
@@ -XXX,XX +XXX,XX @@ void HELPER(v7m_vlstm)(CPUARMState *env, uint32_t fptr)
103
104
void HELPER(v7m_vlldm)(CPUARMState *env, uint32_t fptr)
105
{
106
+ ARMCPU *cpu = env_archcpu(env);
107
uintptr_t ra = GETPC();
108
109
/* fptr is the value of Rn, the frame pointer we load the FP regs from */
110
@@ -XXX,XX +XXX,XX @@ void HELPER(v7m_vlldm)(CPUARMState *env, uint32_t fptr)
111
uint32_t faddr = fptr + 4 * i;
112
113
if (i >= 16) {
114
- faddr += 8; /* skip the slot for the FPSCR */
115
+ faddr += 8; /* skip the slot for the FPSCR and VPR */
116
}
117
118
slo = cpu_ldl_data_ra(env, faddr, ra);
119
@@ -XXX,XX +XXX,XX @@ void HELPER(v7m_vlldm)(CPUARMState *env, uint32_t fptr)
120
}
121
fpscr = cpu_ldl_data_ra(env, fptr + 0x40, ra);
122
vfp_set_fpscr(env, fpscr);
123
+ if (cpu_isar_feature(aa32_mve, cpu)) {
124
+ env->v7m.vpr = cpu_ldl_data_ra(env, fptr + 0x44, ra);
125
+ }
126
}
127
128
env->v7m.control[M_REG_S] |= R_V7M_CONTROL_FPCA_MASK;
129
@@ -XXX,XX +XXX,XX @@ static bool v7m_push_stack(ARMCPU *cpu)
130
uint32_t shi = extract64(dn, 32, 32);
131
132
if (i >= 16) {
133
- faddr += 8; /* skip the slot for the FPSCR */
134
+ faddr += 8; /* skip the slot for the FPSCR and VPR */
135
}
136
stacked_ok = stacked_ok &&
137
v7m_stack_write(cpu, faddr, slo,
138
@@ -XXX,XX +XXX,XX @@ static bool v7m_push_stack(ARMCPU *cpu)
139
stacked_ok = stacked_ok &&
140
v7m_stack_write(cpu, frameptr + 0x60,
141
vfp_get_fpscr(env), mmu_idx, STACK_NORMAL);
142
+ if (cpu_isar_feature(aa32_mve, cpu)) {
143
+ stacked_ok = stacked_ok &&
144
+ v7m_stack_write(cpu, frameptr + 0x64,
145
+ env->v7m.vpr, mmu_idx, STACK_NORMAL);
146
+ }
147
if (cpacr_pass) {
148
for (i = 0; i < ((framesize == 0xa8) ? 32 : 16); i += 2) {
149
*aa32_vfp_dreg(env, i / 2) = 0;
150
}
151
vfp_set_fpscr(env, 0);
152
+ if (cpu_isar_feature(aa32_mve, cpu)) {
153
+ env->v7m.vpr = 0;
154
+ }
155
}
156
} else {
157
/* Lazy stacking enabled, save necessary info to stack later */
158
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
159
v7m_exception_taken(cpu, excret, true, false);
160
}
161
}
162
- /* Clear s0..s15 and FPSCR; TODO also VPR when MVE is implemented */
163
+ /* Clear s0..s15, FPSCR and VPR */
164
int i;
165
166
for (i = 0; i < 16; i += 2) {
167
*aa32_vfp_dreg(env, i / 2) = 0;
168
}
169
vfp_set_fpscr(env, 0);
170
+ if (cpu_isar_feature(aa32_mve, cpu)) {
171
+ env->v7m.vpr = 0;
172
+ }
173
}
174
}
175
176
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
177
uint32_t faddr = frameptr + 0x20 + 4 * i;
178
179
if (i >= 16) {
180
- faddr += 8; /* Skip the slot for the FPSCR */
181
+ faddr += 8; /* Skip the slot for the FPSCR and VPR */
182
}
183
184
pop_ok = pop_ok &&
185
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
186
if (pop_ok) {
187
vfp_set_fpscr(env, fpscr);
188
}
189
+ if (cpu_isar_feature(aa32_mve, cpu)) {
190
+ pop_ok = pop_ok &&
191
+ v7m_stack_read(cpu, &env->v7m.vpr,
192
+ frameptr + 0x64, mmu_idx);
193
+ }
194
if (!pop_ok) {
195
/*
196
* These regs are 0 if security extension present;
197
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
198
*aa32_vfp_dreg(env, i / 2) = 0;
199
}
200
vfp_set_fpscr(env, 0);
201
+ if (cpu_isar_feature(aa32_mve, cpu)) {
202
+ env->v7m.vpr = 0;
203
+ }
204
}
205
}
113
}
206
}
114
}
207
diff --git a/target/arm/translate-m-nocp.c b/target/arm/translate-m-nocp.c
115
+ if (!object_property_set_uint(cpuobj, "mpu-ns-regions",
116
+ s->cpu_mpu_ns[i], errp)) {
117
+ return;
118
+ }
119
+ if (!object_property_set_uint(cpuobj, "mpu-s-regions",
120
+ s->cpu_mpu_s[i], errp)) {
121
+ return;
122
+ }
123
124
if (i > 0) {
125
memory_region_add_subregion_overlap(&s->cpu_container[i], 0,
126
diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
208
index XXXXXXX..XXXXXXX 100644
127
index XXXXXXX..XXXXXXX 100644
209
--- a/target/arm/translate-m-nocp.c
128
--- a/hw/arm/mps2-tz.c
210
+++ b/target/arm/translate-m-nocp.c
129
+++ b/hw/arm/mps2-tz.c
211
@@ -XXX,XX +XXX,XX @@ static bool trans_VSCCLRM(DisasContext *s, arg_VSCCLRM *a)
130
@@ -XXX,XX +XXX,XX @@ struct MPS2TZMachineClass {
212
btmreg++;
131
int uart_overflow_irq; /* number of the combined UART overflow IRQ */
213
}
132
uint32_t init_svtor; /* init-svtor setting for SSE */
214
assert(btmreg == topreg + 1);
133
uint32_t sram_addr_width; /* SRAM_ADDR_WIDTH setting for SSE */
215
- /* TODO: when MVE is implemented, zero VPR here */
134
+ uint32_t cpu0_mpu_ns; /* CPU0_MPU_NS setting for SSE */
216
+ if (dc_isar_feature(aa32_mve, s)) {
135
+ uint32_t cpu0_mpu_s; /* CPU0_MPU_S setting for SSE */
217
+ TCGv_i32 z32 = tcg_const_i32(0);
136
+ uint32_t cpu1_mpu_ns; /* CPU1_MPU_NS setting for SSE */
218
+ store_cpu_field(z32, v7m.vpr);
137
+ uint32_t cpu1_mpu_s; /* CPU1_MPU_S setting for SSE */
138
const RAMInfo *raminfo;
139
const char *armsse_type;
140
uint32_t boot_ram_size; /* size of ram at address 0; 0 == find in raminfo */
141
@@ -XXX,XX +XXX,XX @@ OBJECT_DECLARE_TYPE(MPS2TZMachineState, MPS2TZMachineClass, MPS2TZ_MACHINE)
142
#define MPS3_DDR_SIZE (2 * GiB)
143
#endif
144
145
+/* For cpu{0,1}_mpu_{ns,s}, means "leave at SSE's default value" */
146
+#define MPU_REGION_DEFAULT UINT32_MAX
147
+
148
static const uint32_t an505_oscclk[] = {
149
40000000,
150
24580000,
151
@@ -XXX,XX +XXX,XX @@ static void mps2tz_common_init(MachineState *machine)
152
OBJECT(system_memory), &error_abort);
153
qdev_prop_set_uint32(iotkitdev, "EXP_NUMIRQ", mmc->numirq);
154
qdev_prop_set_uint32(iotkitdev, "init-svtor", mmc->init_svtor);
155
+ if (mmc->cpu0_mpu_ns != MPU_REGION_DEFAULT) {
156
+ qdev_prop_set_uint32(iotkitdev, "CPU0_MPU_NS", mmc->cpu0_mpu_ns);
219
+ }
157
+ }
220
return true;
158
+ if (mmc->cpu0_mpu_s != MPU_REGION_DEFAULT) {
159
+ qdev_prop_set_uint32(iotkitdev, "CPU0_MPU_S", mmc->cpu0_mpu_s);
160
+ }
161
+ if (object_property_find(OBJECT(iotkitdev), "CPU1_MPU_NS")) {
162
+ if (mmc->cpu1_mpu_ns != MPU_REGION_DEFAULT) {
163
+ qdev_prop_set_uint32(iotkitdev, "CPU1_MPU_NS", mmc->cpu1_mpu_ns);
164
+ }
165
+ if (mmc->cpu1_mpu_s != MPU_REGION_DEFAULT) {
166
+ qdev_prop_set_uint32(iotkitdev, "CPU1_MPU_S", mmc->cpu1_mpu_s);
167
+ }
168
+ }
169
qdev_prop_set_uint32(iotkitdev, "SRAM_ADDR_WIDTH", mmc->sram_addr_width);
170
qdev_connect_clock_in(iotkitdev, "MAINCLK", mms->sysclk);
171
qdev_connect_clock_in(iotkitdev, "S32KCLK", mms->s32kclk);
172
@@ -XXX,XX +XXX,XX @@ static void mps2tz_class_init(ObjectClass *oc, void *data)
173
{
174
MachineClass *mc = MACHINE_CLASS(oc);
175
IDAUInterfaceClass *iic = IDAU_INTERFACE_CLASS(oc);
176
+ MPS2TZMachineClass *mmc = MPS2TZ_MACHINE_CLASS(oc);
177
178
mc->init = mps2tz_common_init;
179
mc->reset = mps2_machine_reset;
180
iic->check = mps2_tz_idau_check;
181
+
182
+ /* Most machines leave these at the SSE defaults */
183
+ mmc->cpu0_mpu_ns = MPU_REGION_DEFAULT;
184
+ mmc->cpu0_mpu_s = MPU_REGION_DEFAULT;
185
+ mmc->cpu1_mpu_ns = MPU_REGION_DEFAULT;
186
+ mmc->cpu1_mpu_s = MPU_REGION_DEFAULT;
221
}
187
}
222
188
223
diff --git a/target/arm/translate-vfp.c b/target/arm/translate-vfp.c
189
static void mps2tz_set_default_ram_info(MPS2TZMachineClass *mmc)
224
index XXXXXXX..XXXXXXX 100644
190
@@ -XXX,XX +XXX,XX @@ static void mps3tz_an547_class_init(ObjectClass *oc, void *data)
225
--- a/target/arm/translate-vfp.c
191
mmc->numirq = 96;
226
+++ b/target/arm/translate-vfp.c
192
mmc->uart_overflow_irq = 48;
227
@@ -XXX,XX +XXX,XX @@ static bool full_vfp_access_check(DisasContext *s, bool ignore_vfp_enabled)
193
mmc->init_svtor = 0x00000000;
228
194
+ mmc->cpu0_mpu_s = mmc->cpu0_mpu_ns = 16;
229
if (s->v7m_new_fp_ctxt_needed) {
195
mmc->sram_addr_width = 21;
230
/*
196
mmc->raminfo = an547_raminfo;
231
- * Create new FP context by updating CONTROL.FPCA, CONTROL.SFPA
197
mmc->armsse_type = TYPE_SSE300;
232
- * and the FPSCR.
233
+ * Create new FP context by updating CONTROL.FPCA, CONTROL.SFPA,
234
+ * the FPSCR, and VPR.
235
*/
236
TCGv_i32 control, fpscr;
237
uint32_t bits = R_V7M_CONTROL_FPCA_MASK;
238
@@ -XXX,XX +XXX,XX @@ static bool full_vfp_access_check(DisasContext *s, bool ignore_vfp_enabled)
239
fpscr = load_cpu_field(v7m.fpdscr[s->v8m_secure]);
240
gen_helper_vfp_set_fpscr(cpu_env, fpscr);
241
tcg_temp_free_i32(fpscr);
242
+ if (dc_isar_feature(aa32_mve, s)) {
243
+ TCGv_i32 z32 = tcg_const_i32(0);
244
+ store_cpu_field(z32, v7m.vpr);
245
+ }
246
+
247
/*
248
* We don't need to arrange to end the TB, because the only
249
* parts of FPSCR which we cache in the TB flags are the VECLEN
250
--
198
--
251
2.20.1
199
2.34.1
252
200
253
201
diff view generated by jsdifflib