1 | The following changes since commit e3debd5e7d0ce031356024878a0a18b9d109354a: | 1 | Nothing exciting here: two minor bug fixes, some fixes for |
---|---|---|---|
2 | running on a 32-bit host, and a docs tweak. | ||
2 | 3 | ||
3 | Merge tag 'pull-request-2023-03-24' of https://gitlab.com/thuth/qemu into staging (2023-03-24 16:08:46 +0000) | 4 | thanks |
5 | -- PMM | ||
6 | |||
7 | The following changes since commit 6af9d12c88b9720f209912f6e4b01fefe5906d59: | ||
8 | |||
9 | Merge tag 'migration-20240331-pull-request' of https://gitlab.com/peterx/qemu into staging (2024-04-01 13:12:40 +0100) | ||
4 | 10 | ||
5 | are available in the Git repository at: | 11 | are available in the Git repository at: |
6 | 12 | ||
7 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20230328 | 13 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20240402 |
8 | 14 | ||
9 | for you to fetch changes up to 46e3b237c52e0c48bfd81bce020b51fbe300b23a: | 15 | for you to fetch changes up to 393770d7a02135e7468018f52da610712f151ec0: |
10 | 16 | ||
11 | target/arm/gdbstub: Only advertise M-profile features if TCG available (2023-03-28 10:53:40 +0100) | 17 | raspi4b: Reduce RAM to 1Gb on 32-bit hosts (2024-04-02 10:13:48 +0100) |
12 | 18 | ||
13 | ---------------------------------------------------------------- | 19 | ---------------------------------------------------------------- |
14 | target-arm queue: | 20 | target-arm queue: |
15 | * fix part of the "TCG-disabled builds are broken" issue | 21 | * take HSTR traps of cp15 accesses to EL2, not EL1 |
22 | * docs: sbsa: update specs, add dt note | ||
23 | * hw/intc/arm_gicv3: ICC_HPPIR* return SPURIOUS if int group is disabled | ||
24 | * tests/qtest: Fix STM32L4x5 GPIO test on 32-bit | ||
25 | * raspi4b: Reduce RAM to 1Gb on 32-bit hosts | ||
16 | 26 | ||
17 | ---------------------------------------------------------------- | 27 | ---------------------------------------------------------------- |
18 | Philippe Mathieu-Daudé (1): | 28 | Cédric Le Goater (2): |
19 | target/arm/gdbstub: Only advertise M-profile features if TCG available | 29 | tests/qtest: Fix STM32L4x5 GPIO test on 32-bit |
30 | raspi4b: Reduce RAM to 1Gb on 32-bit hosts | ||
20 | 31 | ||
21 | target/arm/gdbstub.c | 5 +++-- | 32 | Marcin Juszkiewicz (1): |
22 | 1 file changed, 3 insertions(+), 2 deletions(-) | 33 | docs: sbsa: update specs, add dt note |
23 | 34 | ||
35 | Peter Maydell (2): | ||
36 | target/arm: take HSTR traps of cp15 accesses to EL2, not EL1 | ||
37 | hw/intc/arm_gicv3: ICC_HPPIR* return SPURIOUS if int group is disabled | ||
38 | |||
39 | docs/system/arm/sbsa.rst | 35 +++++++++++++++++------ | ||
40 | hw/arm/raspi4b.c | 4 +++ | ||
41 | hw/intc/arm_gicv3_cpuif.c | 4 +-- | ||
42 | target/arm/tcg/translate.c | 2 +- | ||
43 | tests/qtest/stm32l4x5_gpio-test.c | 59 +++++++++++++++++++++++---------------- | ||
44 | 5 files changed, 68 insertions(+), 36 deletions(-) | ||
45 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | The HSTR_EL2 register allows the hypervisor to trap AArch32 EL1 and | ||
2 | EL0 accesses to cp15 registers. We incorrectly implemented this so | ||
3 | they trap to EL1 when we detect the need for a HSTR trap at code | ||
4 | generation time. (The check in access_check_cp_reg() which we do at | ||
5 | runtime to catch traps from EL0 is correctly routing them to EL2.) | ||
1 | 6 | ||
7 | Use the correct target EL when generating the code to take the trap. | ||
8 | |||
9 | Cc: qemu-stable@nongnu.org | ||
10 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2226 | ||
11 | Fixes: 049edada5e93df ("target/arm: Make HSTR_EL2 traps take priority over UNDEF-at-EL1") | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
14 | Message-id: 20240325133116.2075362-1-peter.maydell@linaro.org | ||
15 | --- | ||
16 | target/arm/tcg/translate.c | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c | ||
20 | index XXXXXXX..XXXXXXX 100644 | ||
21 | --- a/target/arm/tcg/translate.c | ||
22 | +++ b/target/arm/tcg/translate.c | ||
23 | @@ -XXX,XX +XXX,XX @@ static void do_coproc_insn(DisasContext *s, int cpnum, int is64, | ||
24 | tcg_gen_andi_i32(t, t, 1u << maskbit); | ||
25 | tcg_gen_brcondi_i32(TCG_COND_EQ, t, 0, over.label); | ||
26 | |||
27 | - gen_exception_insn(s, 0, EXCP_UDEF, syndrome); | ||
28 | + gen_exception_insn_el(s, 0, EXCP_UDEF, syndrome, 2); | ||
29 | /* | ||
30 | * gen_exception_insn() will set is_jmp to DISAS_NORETURN, | ||
31 | * but since we're conditionally branching over it, we want | ||
32 | -- | ||
33 | 2.34.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> | ||
1 | 2 | ||
3 | Hardware of sbsa-ref board is nowadays defined by both BSA and SBSA | ||
4 | specifications. Then BBR defines firmware interface. | ||
5 | |||
6 | Added note about DeviceTree data passed from QEMU to firmware. It is | ||
7 | very minimal and provides only data we use in firmware. | ||
8 | |||
9 | Added NUMA information to list of things reported by DeviceTree. | ||
10 | |||
11 | Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> | ||
12 | Message-id: 20240328163851.1386176-1-marcin.juszkiewicz@linaro.org | ||
13 | Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> | ||
14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
15 | --- | ||
16 | docs/system/arm/sbsa.rst | 35 ++++++++++++++++++++++++++--------- | ||
17 | 1 file changed, 26 insertions(+), 9 deletions(-) | ||
18 | |||
19 | diff --git a/docs/system/arm/sbsa.rst b/docs/system/arm/sbsa.rst | ||
20 | index XXXXXXX..XXXXXXX 100644 | ||
21 | --- a/docs/system/arm/sbsa.rst | ||
22 | +++ b/docs/system/arm/sbsa.rst | ||
23 | @@ -XXX,XX +XXX,XX @@ | ||
24 | Arm Server Base System Architecture Reference board (``sbsa-ref``) | ||
25 | ================================================================== | ||
26 | |||
27 | -While the ``virt`` board is a generic board platform that doesn't match | ||
28 | -any real hardware the ``sbsa-ref`` board intends to look like real | ||
29 | -hardware. The `Server Base System Architecture | ||
30 | -<https://developer.arm.com/documentation/den0029/latest>`_ defines a | ||
31 | -minimum base line of hardware support and importantly how the firmware | ||
32 | -reports that to any operating system. | ||
33 | +The ``sbsa-ref`` board intends to look like real hardware (while the ``virt`` | ||
34 | +board is a generic board platform that doesn't match any real hardware). | ||
35 | + | ||
36 | +The hardware part is defined by two specifications: | ||
37 | + | ||
38 | + - `Base System Architecture <https://developer.arm.com/documentation/den0094/>`__ (BSA) | ||
39 | + - `Server Base System Architecture <https://developer.arm.com/documentation/den0029/>`__ (SBSA) | ||
40 | + | ||
41 | +The `Arm Base Boot Requirements <https://developer.arm.com/documentation/den0044/>`__ (BBR) | ||
42 | +specification defines how the firmware reports that to any operating system. | ||
43 | |||
44 | It is intended to be a machine for developing firmware and testing | ||
45 | standards compliance with operating systems. | ||
46 | @@ -XXX,XX +XXX,XX @@ includes both internal hardware and parts affected by the qemu command line | ||
47 | (i.e. CPUs and memory). As a result it must have a firmware specifically built | ||
48 | to expect a certain hardware layout (as you would in a real machine). | ||
49 | |||
50 | +Note | ||
51 | +'''' | ||
52 | + | ||
53 | +QEMU provides the guest EL3 firmware with minimal information about hardware | ||
54 | +platform using minimalistic devicetree. This is not a Linux devicetree. It is | ||
55 | +not even a firmware devicetree. | ||
56 | + | ||
57 | +It is information passed from QEMU to describe the information a hardware | ||
58 | +platform would have other mechanisms to discover at runtime, that are affected | ||
59 | +by the QEMU command line. | ||
60 | + | ||
61 | +Ultimately this devicetree may be replaced by IPC calls to an emulated SCP. | ||
62 | + | ||
63 | DeviceTree information | ||
64 | '''''''''''''''''''''' | ||
65 | |||
66 | -The devicetree provided by the board model to the firmware is not intended | ||
67 | -to be a complete compliant DT. It currently reports: | ||
68 | +The devicetree reports: | ||
69 | |||
70 | - CPUs | ||
71 | - memory | ||
72 | - platform version | ||
73 | - GIC addresses | ||
74 | + - NUMA node id for CPUs and memory | ||
75 | |||
76 | Platform version | ||
77 | '''''''''''''''' | ||
78 | @@ -XXX,XX +XXX,XX @@ Platform version changes: | ||
79 | GIC ITS information is present in devicetree. | ||
80 | |||
81 | 0.3 | ||
82 | - The USB controller is an XHCI device, not EHCI | ||
83 | + The USB controller is an XHCI device, not EHCI. | ||
84 | -- | ||
85 | 2.34.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | If the group of the highest priority pending interrupt is disabled | ||
2 | via ICC_IGRPEN*, the ICC_HPPIR* registers should return | ||
3 | INTID_SPURIOUS, not the interrupt ID. (See the GIC architecture | ||
4 | specification pseudocode functions ICC_HPPIR1_EL1[] and | ||
5 | HighestPriorityPendingInterrupt().) | ||
1 | 6 | ||
7 | Make HPPIR reads honour the group disable, the way we already do | ||
8 | when determining whether to preempt in icc_hppi_can_preempt(). | ||
9 | |||
10 | Cc: qemu-stable@nongnu.org | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
13 | Message-id: 20240328153333.2522667-1-peter.maydell@linaro.org | ||
14 | --- | ||
15 | hw/intc/arm_gicv3_cpuif.c | 4 ++-- | ||
16 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | ||
19 | index XXXXXXX..XXXXXXX 100644 | ||
20 | --- a/hw/intc/arm_gicv3_cpuif.c | ||
21 | +++ b/hw/intc/arm_gicv3_cpuif.c | ||
22 | @@ -XXX,XX +XXX,XX @@ static uint64_t icc_hppir0_value(GICv3CPUState *cs, CPUARMState *env) | ||
23 | */ | ||
24 | bool irq_is_secure; | ||
25 | |||
26 | - if (cs->hppi.prio == 0xff) { | ||
27 | + if (icc_no_enabled_hppi(cs)) { | ||
28 | return INTID_SPURIOUS; | ||
29 | } | ||
30 | |||
31 | @@ -XXX,XX +XXX,XX @@ static uint64_t icc_hppir1_value(GICv3CPUState *cs, CPUARMState *env) | ||
32 | */ | ||
33 | bool irq_is_secure; | ||
34 | |||
35 | - if (cs->hppi.prio == 0xff) { | ||
36 | + if (icc_no_enabled_hppi(cs)) { | ||
37 | return INTID_SPURIOUS; | ||
38 | } | ||
39 | |||
40 | -- | ||
41 | 2.34.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Cédric Le Goater <clg@redhat.com> | ||
1 | 2 | ||
3 | The test mangles the GPIO address and the pin number in the | ||
4 | qtest_add_data_func data parameter. Doing so, it assumes that the host | ||
5 | pointer size is always 64-bit, which breaks on 32-bit : | ||
6 | |||
7 | ../tests/qtest/stm32l4x5_gpio-test.c: In function ‘test_gpio_output_mode’: | ||
8 | ../tests/qtest/stm32l4x5_gpio-test.c:272:25: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] | ||
9 | 272 | unsigned int pin = ((uint64_t)data) & 0xF; | ||
10 | | ^ | ||
11 | ../tests/qtest/stm32l4x5_gpio-test.c:273:22: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] | ||
12 | 273 | uint32_t gpio = ((uint64_t)data) >> 32; | ||
13 | | ^ | ||
14 | |||
15 | To fix, improve the mangling of the GPIO address and pin number fields | ||
16 | by using GPIO_SIZE so that the resulting value fits in a 32-bit pointer. | ||
17 | While at it, include some helpers to hide the details. | ||
18 | |||
19 | Cc: Arnaud Minier <arnaud.minier@telecom-paris.fr> | ||
20 | Cc: Inès Varhol <ines.varhol@telecom-paris.fr> | ||
21 | Signed-off-by: Cédric Le Goater <clg@redhat.com> | ||
22 | Message-id: 20240329092747.298259-1-clg@redhat.com | ||
23 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
24 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
25 | --- | ||
26 | tests/qtest/stm32l4x5_gpio-test.c | 59 ++++++++++++++++++------------- | ||
27 | 1 file changed, 35 insertions(+), 24 deletions(-) | ||
28 | |||
29 | diff --git a/tests/qtest/stm32l4x5_gpio-test.c b/tests/qtest/stm32l4x5_gpio-test.c | ||
30 | index XXXXXXX..XXXXXXX 100644 | ||
31 | --- a/tests/qtest/stm32l4x5_gpio-test.c | ||
32 | +++ b/tests/qtest/stm32l4x5_gpio-test.c | ||
33 | @@ -XXX,XX +XXX,XX @@ const uint32_t idr_reset[NUM_GPIOS] = { | ||
34 | 0x00000000 | ||
35 | }; | ||
36 | |||
37 | +#define PIN_MASK 0xF | ||
38 | +#define GPIO_ADDR_MASK (~(GPIO_SIZE - 1)) | ||
39 | + | ||
40 | +static inline void *test_data(uint32_t gpio_addr, uint8_t pin) | ||
41 | +{ | ||
42 | + return (void *)(uintptr_t)((gpio_addr & GPIO_ADDR_MASK) | (pin & PIN_MASK)); | ||
43 | +} | ||
44 | + | ||
45 | +#define test_gpio_addr(data) ((uintptr_t)(data) & GPIO_ADDR_MASK) | ||
46 | +#define test_pin(data) ((uintptr_t)(data) & PIN_MASK) | ||
47 | + | ||
48 | static uint32_t gpio_readl(unsigned int gpio, unsigned int offset) | ||
49 | { | ||
50 | return readl(gpio + offset); | ||
51 | @@ -XXX,XX +XXX,XX @@ static void test_gpio_output_mode(const void *data) | ||
52 | * Additionally, it checks that values written to ODR | ||
53 | * when not in output mode are stored and not discarded. | ||
54 | */ | ||
55 | - unsigned int pin = ((uint64_t)data) & 0xF; | ||
56 | - uint32_t gpio = ((uint64_t)data) >> 32; | ||
57 | + unsigned int pin = test_pin(data); | ||
58 | + uint32_t gpio = test_gpio_addr(data); | ||
59 | unsigned int gpio_id = get_gpio_id(gpio); | ||
60 | |||
61 | qtest_irq_intercept_in(global_qtest, "/machine/soc/syscfg"); | ||
62 | @@ -XXX,XX +XXX,XX @@ static void test_gpio_input_mode(const void *data) | ||
63 | * corresponding GPIO line high/low : it should set the | ||
64 | * right bit in IDR and send an irq to syscfg. | ||
65 | */ | ||
66 | - unsigned int pin = ((uint64_t)data) & 0xF; | ||
67 | - uint32_t gpio = ((uint64_t)data) >> 32; | ||
68 | + unsigned int pin = test_pin(data); | ||
69 | + uint32_t gpio = test_gpio_addr(data); | ||
70 | unsigned int gpio_id = get_gpio_id(gpio); | ||
71 | |||
72 | qtest_irq_intercept_in(global_qtest, "/machine/soc/syscfg"); | ||
73 | @@ -XXX,XX +XXX,XX @@ static void test_pull_up_pull_down(const void *data) | ||
74 | * Test that a floating pin with pull-up sets the pin | ||
75 | * high and vice-versa. | ||
76 | */ | ||
77 | - unsigned int pin = ((uint64_t)data) & 0xF; | ||
78 | - uint32_t gpio = ((uint64_t)data) >> 32; | ||
79 | + unsigned int pin = test_pin(data); | ||
80 | + uint32_t gpio = test_gpio_addr(data); | ||
81 | unsigned int gpio_id = get_gpio_id(gpio); | ||
82 | |||
83 | qtest_irq_intercept_in(global_qtest, "/machine/soc/syscfg"); | ||
84 | @@ -XXX,XX +XXX,XX @@ static void test_push_pull(const void *data) | ||
85 | * disconnects the pin, that the pin can't be set or reset | ||
86 | * externally afterwards. | ||
87 | */ | ||
88 | - unsigned int pin = ((uint64_t)data) & 0xF; | ||
89 | - uint32_t gpio = ((uint64_t)data) >> 32; | ||
90 | + unsigned int pin = test_pin(data); | ||
91 | + uint32_t gpio = test_gpio_addr(data); | ||
92 | uint32_t gpio2 = GPIO_BASE_ADDR + (GPIO_H - gpio); | ||
93 | |||
94 | qtest_irq_intercept_in(global_qtest, "/machine/soc/syscfg"); | ||
95 | @@ -XXX,XX +XXX,XX @@ static void test_open_drain(const void *data) | ||
96 | * However a pin set low externally shouldn't be disconnected, | ||
97 | * and it can be set low externally when in open-drain mode. | ||
98 | */ | ||
99 | - unsigned int pin = ((uint64_t)data) & 0xF; | ||
100 | - uint32_t gpio = ((uint64_t)data) >> 32; | ||
101 | + unsigned int pin = test_pin(data); | ||
102 | + uint32_t gpio = test_gpio_addr(data); | ||
103 | uint32_t gpio2 = GPIO_BASE_ADDR + (GPIO_H - gpio); | ||
104 | |||
105 | qtest_irq_intercept_in(global_qtest, "/machine/soc/syscfg"); | ||
106 | @@ -XXX,XX +XXX,XX @@ static void test_bsrr_brr(const void *data) | ||
107 | * has the desired effect on ODR. | ||
108 | * In BSRR, BSx has priority over BRx. | ||
109 | */ | ||
110 | - unsigned int pin = ((uint64_t)data) & 0xF; | ||
111 | - uint32_t gpio = ((uint64_t)data) >> 32; | ||
112 | + unsigned int pin = test_pin(data); | ||
113 | + uint32_t gpio = test_gpio_addr(data); | ||
114 | |||
115 | gpio_writel(gpio, BSRR, (1 << pin)); | ||
116 | g_assert_cmphex(gpio_readl(gpio, ODR), ==, reset(gpio, ODR) | (1 << pin)); | ||
117 | @@ -XXX,XX +XXX,XX @@ int main(int argc, char **argv) | ||
118 | * is problematic since the pin was already high. | ||
119 | */ | ||
120 | qtest_add_data_func("stm32l4x5/gpio/test_gpioc5_output_mode", | ||
121 | - (void *)((uint64_t)GPIO_C << 32 | 5), | ||
122 | + test_data(GPIO_C, 5), | ||
123 | test_gpio_output_mode); | ||
124 | qtest_add_data_func("stm32l4x5/gpio/test_gpioh3_output_mode", | ||
125 | - (void *)((uint64_t)GPIO_H << 32 | 3), | ||
126 | + test_data(GPIO_H, 3), | ||
127 | test_gpio_output_mode); | ||
128 | qtest_add_data_func("stm32l4x5/gpio/test_gpio_input_mode1", | ||
129 | - (void *)((uint64_t)GPIO_D << 32 | 6), | ||
130 | + test_data(GPIO_D, 6), | ||
131 | test_gpio_input_mode); | ||
132 | qtest_add_data_func("stm32l4x5/gpio/test_gpio_input_mode2", | ||
133 | - (void *)((uint64_t)GPIO_C << 32 | 10), | ||
134 | + test_data(GPIO_C, 10), | ||
135 | test_gpio_input_mode); | ||
136 | qtest_add_data_func("stm32l4x5/gpio/test_gpio_pull_up_pull_down1", | ||
137 | - (void *)((uint64_t)GPIO_B << 32 | 5), | ||
138 | + test_data(GPIO_B, 5), | ||
139 | test_pull_up_pull_down); | ||
140 | qtest_add_data_func("stm32l4x5/gpio/test_gpio_pull_up_pull_down2", | ||
141 | - (void *)((uint64_t)GPIO_F << 32 | 1), | ||
142 | + test_data(GPIO_F, 1), | ||
143 | test_pull_up_pull_down); | ||
144 | qtest_add_data_func("stm32l4x5/gpio/test_gpio_push_pull1", | ||
145 | - (void *)((uint64_t)GPIO_G << 32 | 6), | ||
146 | + test_data(GPIO_G, 6), | ||
147 | test_push_pull); | ||
148 | qtest_add_data_func("stm32l4x5/gpio/test_gpio_push_pull2", | ||
149 | - (void *)((uint64_t)GPIO_H << 32 | 3), | ||
150 | + test_data(GPIO_H, 3), | ||
151 | test_push_pull); | ||
152 | qtest_add_data_func("stm32l4x5/gpio/test_gpio_open_drain1", | ||
153 | - (void *)((uint64_t)GPIO_C << 32 | 4), | ||
154 | + test_data(GPIO_C, 4), | ||
155 | test_open_drain); | ||
156 | qtest_add_data_func("stm32l4x5/gpio/test_gpio_open_drain2", | ||
157 | - (void *)((uint64_t)GPIO_E << 32 | 11), | ||
158 | + test_data(GPIO_E, 11), | ||
159 | test_open_drain); | ||
160 | qtest_add_data_func("stm32l4x5/gpio/test_bsrr_brr1", | ||
161 | - (void *)((uint64_t)GPIO_A << 32 | 12), | ||
162 | + test_data(GPIO_A, 12), | ||
163 | test_bsrr_brr); | ||
164 | qtest_add_data_func("stm32l4x5/gpio/test_bsrr_brr2", | ||
165 | - (void *)((uint64_t)GPIO_D << 32 | 0), | ||
166 | + test_data(GPIO_D, 0), | ||
167 | test_bsrr_brr); | ||
168 | |||
169 | qtest_start("-machine b-l475e-iot01a"); | ||
170 | -- | ||
171 | 2.34.1 | ||
172 | |||
173 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@linaro.org> | 1 | From: Cédric Le Goater <clg@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Cortex-M profile is only emulable from TCG accelerator. Restrict | 3 | Change the board revision number and RAM size to 1Gb on 32-bit hosts. |
4 | the GDBstub features to its availability in order to avoid a link | 4 | On these systems, RAM has a 2047 MB limit and this breaks the tests. |
5 | error when TCG is not enabled: | ||
6 | 5 | ||
7 | Undefined symbols for architecture arm64: | 6 | Fixes: 7785e8ea2204 ("hw/arm: Introduce Raspberry PI 4 machine") |
8 | "_arm_v7m_get_sp_ptr", referenced from: | 7 | Signed-off-by: Cédric Le Goater <clg@redhat.com> |
9 | _m_sysreg_get in target_arm_gdbstub.c.o | 8 | Message-id: 20240329150155.357043-1-clg@redhat.com |
10 | "_arm_v7m_mrs_control", referenced from: | 9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
11 | _arm_gdb_get_m_systemreg in target_arm_gdbstub.c.o | ||
12 | ld: symbol(s) not found for architecture arm64 | ||
13 | clang: error: linker command failed with exit code 1 (use -v to see invocation) | ||
14 | |||
15 | Fixes: 7d8b28b8b5 ("target/arm: Implement gdbstub m-profile systemreg and secext") | ||
16 | Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
17 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
18 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
19 | Message-id: 20230322142902.69511-3-philmd@linaro.org | ||
20 | [PMM: add #include since I cherry-picked this patch from the series] | ||
21 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
22 | --- | 11 | --- |
23 | target/arm/gdbstub.c | 5 +++-- | 12 | hw/arm/raspi4b.c | 4 ++++ |
24 | 1 file changed, 3 insertions(+), 2 deletions(-) | 13 | 1 file changed, 4 insertions(+) |
25 | 14 | ||
26 | diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c | 15 | diff --git a/hw/arm/raspi4b.c b/hw/arm/raspi4b.c |
27 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
28 | --- a/target/arm/gdbstub.c | 17 | --- a/hw/arm/raspi4b.c |
29 | +++ b/target/arm/gdbstub.c | 18 | +++ b/hw/arm/raspi4b.c |
30 | @@ -XXX,XX +XXX,XX @@ | 19 | @@ -XXX,XX +XXX,XX @@ static void raspi4b_machine_class_init(ObjectClass *oc, void *data) |
31 | #include "cpu.h" | 20 | MachineClass *mc = MACHINE_CLASS(oc); |
32 | #include "exec/gdbstub.h" | 21 | RaspiBaseMachineClass *rmc = RASPI_BASE_MACHINE_CLASS(oc); |
33 | #include "gdbstub/helpers.h" | 22 | |
34 | +#include "sysemu/tcg.h" | 23 | +#if HOST_LONG_BITS == 32 |
35 | #include "internals.h" | 24 | + rmc->board_rev = 0xa03111; /* Revision 1.1, 1 Gb RAM */ |
36 | #include "cpregs.h" | 25 | +#else |
37 | 26 | rmc->board_rev = 0xb03115; /* Revision 1.5, 2 Gb RAM */ | |
38 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) | 27 | +#endif |
39 | 2, "arm-vfp-sysregs.xml", 0); | 28 | raspi_machine_class_common_init(mc, rmc->board_rev); |
40 | } | 29 | mc->init = raspi4b_machine_init; |
41 | } | 30 | } |
42 | - if (cpu_isar_feature(aa32_mve, cpu)) { | ||
43 | + if (cpu_isar_feature(aa32_mve, cpu) && tcg_enabled()) { | ||
44 | gdb_register_coprocessor(cs, mve_gdb_get_reg, mve_gdb_set_reg, | ||
45 | 1, "arm-m-profile-mve.xml", 0); | ||
46 | } | ||
47 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu) | ||
48 | arm_gen_dynamic_sysreg_xml(cs, cs->gdb_num_regs), | ||
49 | "system-registers.xml", 0); | ||
50 | |||
51 | - if (arm_feature(env, ARM_FEATURE_M)) { | ||
52 | + if (arm_feature(env, ARM_FEATURE_M) && tcg_enabled()) { | ||
53 | gdb_register_coprocessor(cs, | ||
54 | arm_gdb_get_m_systemreg, arm_gdb_set_m_systemreg, | ||
55 | arm_gen_dynamic_m_systemreg_xml(cs, cs->gdb_num_regs), | ||
56 | -- | 31 | -- |
57 | 2.34.1 | 32 | 2.34.1 |
58 | 33 | ||
59 | 34 | diff view generated by jsdifflib |