1 | This bug seemed worth fixing for 8.0 since we need an rc4 anyway: | 1 | Nothing exciting here: two minor bug fixes, some fixes for |
---|---|---|---|
2 | we were using uninitialized data for the guarded bit when | 2 | running on a 32-bit host, and a docs tweak. |
3 | combining stage 1 and stage 2 attrs. | ||
4 | 3 | ||
5 | thanks | 4 | thanks |
6 | -- PMM | 5 | -- PMM |
7 | 6 | ||
8 | The following changes since commit 08dede07030973c1053868bc64de7e10bfa02ad6: | 7 | The following changes since commit 6af9d12c88b9720f209912f6e4b01fefe5906d59: |
9 | 8 | ||
10 | Merge tag 'pull-ppc-20230409' of https://github.com/legoater/qemu into staging (2023-04-10 11:47:52 +0100) | 9 | Merge tag 'migration-20240331-pull-request' of https://gitlab.com/peterx/qemu into staging (2024-04-01 13:12:40 +0100) |
11 | 10 | ||
12 | are available in the Git repository at: | 11 | are available in the Git repository at: |
13 | 12 | ||
14 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20230410 | 13 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20240402 |
15 | 14 | ||
16 | for you to fetch changes up to 8539dc00552e8ea60420856fc1262c8299bc6308: | 15 | for you to fetch changes up to 393770d7a02135e7468018f52da610712f151ec0: |
17 | 16 | ||
18 | target/arm: Copy guarded bit in combine_cacheattrs (2023-04-10 14:31:40 +0100) | 17 | raspi4b: Reduce RAM to 1Gb on 32-bit hosts (2024-04-02 10:13:48 +0100) |
19 | 18 | ||
20 | ---------------------------------------------------------------- | 19 | ---------------------------------------------------------------- |
21 | target-arm: Fix bug where we weren't initializing | 20 | target-arm queue: |
22 | guarded bit state when combining S1/S2 attrs | 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 | ||
23 | 26 | ||
24 | ---------------------------------------------------------------- | 27 | ---------------------------------------------------------------- |
25 | Richard Henderson (2): | 28 | Cédric Le Goater (2): |
26 | target/arm: PTE bit GP only applies to stage1 | 29 | tests/qtest: Fix STM32L4x5 GPIO test on 32-bit |
27 | target/arm: Copy guarded bit in combine_cacheattrs | 30 | raspi4b: Reduce RAM to 1Gb on 32-bit hosts |
28 | 31 | ||
29 | target/arm/ptw.c | 11 ++++++----- | 32 | Marcin Juszkiewicz (1): |
30 | 1 file changed, 6 insertions(+), 5 deletions(-) | 33 | docs: sbsa: update specs, add dt note |
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 |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | The guarded bit comes from the stage1 walk. | 3 | Hardware of sbsa-ref board is nowadays defined by both BSA and SBSA |
4 | specifications. Then BBR defines firmware interface. | ||
4 | 5 | ||
5 | Fixes: Coverity CID 1507929 | 6 | Added note about DeviceTree data passed from QEMU to firmware. It is |
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 7 | very minimal and provides only data we use in firmware. |
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | |
8 | Message-id: 20230407185149.3253946-3-richard.henderson@linaro.org | 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> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 15 | --- |
11 | target/arm/ptw.c | 1 + | 16 | docs/system/arm/sbsa.rst | 35 ++++++++++++++++++++++++++--------- |
12 | 1 file changed, 1 insertion(+) | 17 | 1 file changed, 26 insertions(+), 9 deletions(-) |
13 | 18 | ||
14 | diff --git a/target/arm/ptw.c b/target/arm/ptw.c | 19 | diff --git a/docs/system/arm/sbsa.rst b/docs/system/arm/sbsa.rst |
15 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/ptw.c | 21 | --- a/docs/system/arm/sbsa.rst |
17 | +++ b/target/arm/ptw.c | 22 | +++ b/docs/system/arm/sbsa.rst |
18 | @@ -XXX,XX +XXX,XX @@ static ARMCacheAttrs combine_cacheattrs(uint64_t hcr, | 23 | @@ -XXX,XX +XXX,XX @@ |
19 | 24 | Arm Server Base System Architecture Reference board (``sbsa-ref``) | |
20 | assert(!s1.is_s2_format); | 25 | ================================================================== |
21 | ret.is_s2_format = false; | 26 | |
22 | + ret.guarded = s1.guarded; | 27 | -While the ``virt`` board is a generic board platform that doesn't match |
23 | 28 | -any real hardware the ``sbsa-ref`` board intends to look like real | |
24 | if (s1.attrs == 0xf0) { | 29 | -hardware. The `Server Base System Architecture |
25 | tagged = true; | 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. | ||
26 | -- | 84 | -- |
27 | 2.34.1 | 85 | 2.34.1 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 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().) | ||
2 | 6 | ||
3 | Only perform the extract of GP during the stage1 walk. | 7 | Make HPPIR reads honour the group disable, the way we already do |
8 | when determining whether to preempt in icc_hppi_can_preempt(). | ||
4 | 9 | ||
5 | Reported-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Cc: qemu-stable@nongnu.org |
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Message-id: 20230407185149.3253946-2-richard.henderson@linaro.org | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.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 | ||
10 | --- | 14 | --- |
11 | target/arm/ptw.c | 10 +++++----- | 15 | hw/intc/arm_gicv3_cpuif.c | 4 ++-- |
12 | 1 file changed, 5 insertions(+), 5 deletions(-) | 16 | 1 file changed, 2 insertions(+), 2 deletions(-) |
13 | 17 | ||
14 | diff --git a/target/arm/ptw.c b/target/arm/ptw.c | 18 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c |
15 | index XXXXXXX..XXXXXXX 100644 | 19 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/ptw.c | 20 | --- a/hw/intc/arm_gicv3_cpuif.c |
17 | +++ b/target/arm/ptw.c | 21 | +++ b/hw/intc/arm_gicv3_cpuif.c |
18 | @@ -XXX,XX +XXX,XX @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw, | 22 | @@ -XXX,XX +XXX,XX @@ static uint64_t icc_hppir0_value(GICv3CPUState *cs, CPUARMState *env) |
19 | result->f.attrs.secure = false; | 23 | */ |
24 | bool irq_is_secure; | ||
25 | |||
26 | - if (cs->hppi.prio == 0xff) { | ||
27 | + if (icc_no_enabled_hppi(cs)) { | ||
28 | return INTID_SPURIOUS; | ||
20 | } | 29 | } |
21 | 30 | ||
22 | - /* When in aarch64 mode, and BTI is enabled, remember GP in the TLB. */ | 31 | @@ -XXX,XX +XXX,XX @@ static uint64_t icc_hppir1_value(GICv3CPUState *cs, CPUARMState *env) |
23 | - if (aarch64 && cpu_isar_feature(aa64_bti, cpu)) { | 32 | */ |
24 | - result->f.guarded = extract64(attrs, 50, 1); /* GP */ | 33 | bool irq_is_secure; |
25 | - } | 34 | |
26 | - | 35 | - if (cs->hppi.prio == 0xff) { |
27 | if (regime_is_stage2(mmu_idx)) { | 36 | + if (icc_no_enabled_hppi(cs)) { |
28 | result->cacheattrs.is_s2_format = true; | 37 | return INTID_SPURIOUS; |
29 | result->cacheattrs.attrs = extract32(attrs, 2, 4); | ||
30 | @@ -XXX,XX +XXX,XX @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw, | ||
31 | assert(attrindx <= 7); | ||
32 | result->cacheattrs.is_s2_format = false; | ||
33 | result->cacheattrs.attrs = extract64(mair, attrindx * 8, 8); | ||
34 | + | ||
35 | + /* When in aarch64 mode, and BTI is enabled, remember GP in the TLB. */ | ||
36 | + if (aarch64 && cpu_isar_feature(aa64_bti, cpu)) { | ||
37 | + result->f.guarded = extract64(attrs, 50, 1); /* GP */ | ||
38 | + } | ||
39 | } | 38 | } |
40 | 39 | ||
41 | /* | ||
42 | -- | 40 | -- |
43 | 2.34.1 | 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 |
New patch | |||
---|---|---|---|
1 | From: Cédric Le Goater <clg@redhat.com> | ||
1 | 2 | ||
3 | Change the board revision number and RAM size to 1Gb on 32-bit hosts. | ||
4 | On these systems, RAM has a 2047 MB limit and this breaks the tests. | ||
5 | |||
6 | Fixes: 7785e8ea2204 ("hw/arm: Introduce Raspberry PI 4 machine") | ||
7 | Signed-off-by: Cédric Le Goater <clg@redhat.com> | ||
8 | Message-id: 20240329150155.357043-1-clg@redhat.com | ||
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | --- | ||
12 | hw/arm/raspi4b.c | 4 ++++ | ||
13 | 1 file changed, 4 insertions(+) | ||
14 | |||
15 | diff --git a/hw/arm/raspi4b.c b/hw/arm/raspi4b.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/hw/arm/raspi4b.c | ||
18 | +++ b/hw/arm/raspi4b.c | ||
19 | @@ -XXX,XX +XXX,XX @@ static void raspi4b_machine_class_init(ObjectClass *oc, void *data) | ||
20 | MachineClass *mc = MACHINE_CLASS(oc); | ||
21 | RaspiBaseMachineClass *rmc = RASPI_BASE_MACHINE_CLASS(oc); | ||
22 | |||
23 | +#if HOST_LONG_BITS == 32 | ||
24 | + rmc->board_rev = 0xa03111; /* Revision 1.1, 1 Gb RAM */ | ||
25 | +#else | ||
26 | rmc->board_rev = 0xb03115; /* Revision 1.5, 2 Gb RAM */ | ||
27 | +#endif | ||
28 | raspi_machine_class_common_init(mc, rmc->board_rev); | ||
29 | mc->init = raspi4b_machine_init; | ||
30 | } | ||
31 | -- | ||
32 | 2.34.1 | ||
33 | |||
34 | diff view generated by jsdifflib |