1 | A last handful of patches before the rc0. These are all bugfixes | 1 | no changes to v1, except adding the CVE identifier to one of the commit |
---|---|---|---|
2 | so they could equally well go into rc1, but since my pullreq | 2 | messages. |
3 | queue is otherwise empty I might as well push them out. The | ||
4 | FPSCR bugfix is definitely one I'd like in rc0; the rest are | ||
5 | not really user-visible I think. | ||
6 | 3 | ||
7 | thanks | ||
8 | -- PMM | 4 | -- PMM |
9 | 5 | ||
10 | The following changes since commit c4107e8208d0222f9b328691b519aaee4101db87: | 6 | The following changes since commit cf7ca7d5b9faca13f1f8e3ea92cfb2f741eb0c0e: |
11 | 7 | ||
12 | Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2019-07-08 10:26:18 +0100) | 8 | Merge remote-tracking branch 'remotes/stefanha-gitlab/tags/tracing-pull-request' into staging (2021-02-01 16:28:00 +0000) |
13 | 9 | ||
14 | are available in the Git repository at: | 10 | are available in the Git repository at: |
15 | 11 | ||
16 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190708 | 12 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20210203 |
17 | 13 | ||
18 | for you to fetch changes up to 85795187f416326f87177cabc39fae1911f04c50: | 14 | for you to fetch changes up to fd8f71b95da86f530aae3d02a14b0ccd9e024772: |
19 | 15 | ||
20 | target/arm/vfp_helper: Call set_fpscr_to_host before updating to FPSCR (2019-07-08 14:11:31 +0100) | 16 | hw/arm: Display CPU type in machine description (2021-02-03 10:15:51 +0000) |
21 | 17 | ||
22 | ---------------------------------------------------------------- | 18 | ---------------------------------------------------------------- |
23 | target-arm queue: | 19 | target-arm queue: |
24 | * tests/migration-test: Fix read off end of aarch64_kernel array | 20 | * hw/intc/arm_gic: Allow to use QTest without crashing |
25 | * Fix sve_zcr_len_for_el off-by-one error | 21 | * hw/char/exynos4210_uart: Fix buffer size reporting with FIFO disabled |
26 | * hw/arm/sbsa-ref: Silence Coverity nit | 22 | * hw/char/exynos4210_uart: Fix missing call to report ready for input |
27 | * vfp_helper: Call set_fpscr_to_host before updating to FPSCR | 23 | * hw/arm/smmuv3: Fix addr_mask for range-based invalidation |
24 | * hw/ssi/imx_spi: Fix various minor bugs | ||
25 | * hw/intc/arm_gic: Fix interrupt ID in GICD_SGIR register | ||
26 | * hw/arm: Add missing Kconfig dependencies | ||
27 | * hw/arm: Display CPU type in machine description | ||
28 | 28 | ||
29 | ---------------------------------------------------------------- | 29 | ---------------------------------------------------------------- |
30 | Peter Maydell (2): | 30 | Bin Meng (5): |
31 | tests/migration-test: Fix read off end of aarch64_kernel array | 31 | hw/ssi: imx_spi: Use a macro for number of chip selects supported |
32 | hw/arm/sbsa-ref: Remove unnecessary check for secure_sysmem == NULL | 32 | hw/ssi: imx_spi: Remove imx_spi_update_irq() in imx_spi_reset() |
33 | hw/ssi: imx_spi: Round up the burst length to be multiple of 8 | ||
34 | hw/ssi: imx_spi: Correct the burst length > 32 bit transfer logic | ||
35 | hw/ssi: imx_spi: Correct tx and rx fifo endianness | ||
33 | 36 | ||
34 | Philippe Mathieu-Daudé (1): | 37 | Iris Johnson (2): |
35 | target/arm/vfp_helper: Call set_fpscr_to_host before updating to FPSCR | 38 | hw/char/exynos4210_uart: Fix buffer size reporting with FIFO disabled |
39 | hw/char/exynos4210_uart: Fix missing call to report ready for input | ||
36 | 40 | ||
37 | Richard Henderson (1): | 41 | Philippe Mathieu-Daudé (12): |
38 | target/arm: Fix sve_zcr_len_for_el | 42 | hw/intc/arm_gic: Allow to use QTest without crashing |
43 | hw/ssi: imx_spi: Remove pointless variable initialization | ||
44 | hw/ssi: imx_spi: Rework imx_spi_reset() to keep CONREG register value | ||
45 | hw/ssi: imx_spi: Rework imx_spi_read() to handle block disabled | ||
46 | hw/ssi: imx_spi: Rework imx_spi_write() to handle block disabled | ||
47 | hw/intc/arm_gic: Fix interrupt ID in GICD_SGIR register | ||
48 | hw/arm/stm32f405_soc: Add missing dependency on OR_IRQ | ||
49 | hw/arm/exynos4210: Add missing dependency on OR_IRQ | ||
50 | hw/arm/xlnx-versal: Versal SoC requires ZDMA | ||
51 | hw/arm/xlnx-versal: Versal SoC requires ZynqMP peripherals | ||
52 | hw/net/can: ZynqMP CAN device requires PTIMER | ||
53 | hw/arm: Display CPU type in machine description | ||
39 | 54 | ||
40 | hw/arm/sbsa-ref.c | 8 ++------ | 55 | Xuzhou Cheng (1): |
41 | target/arm/helper.c | 4 ++-- | 56 | hw/ssi: imx_spi: Disable chip selects when controller is disabled |
42 | target/arm/vfp_helper.c | 4 ++-- | ||
43 | tests/migration-test.c | 22 +++++++--------------- | ||
44 | 4 files changed, 13 insertions(+), 25 deletions(-) | ||
45 | 57 | ||
58 | Zenghui Yu (1): | ||
59 | hw/arm/smmuv3: Fix addr_mask for range-based invalidation | ||
60 | |||
61 | include/hw/ssi/imx_spi.h | 5 +- | ||
62 | hw/arm/digic_boards.c | 2 +- | ||
63 | hw/arm/microbit.c | 2 +- | ||
64 | hw/arm/netduino2.c | 2 +- | ||
65 | hw/arm/netduinoplus2.c | 2 +- | ||
66 | hw/arm/orangepi.c | 2 +- | ||
67 | hw/arm/smmuv3.c | 4 +- | ||
68 | hw/arm/stellaris.c | 4 +- | ||
69 | hw/char/exynos4210_uart.c | 7 ++- | ||
70 | hw/intc/arm_gic.c | 5 +- | ||
71 | hw/ssi/imx_spi.c | 153 +++++++++++++++++++++++++++++----------------- | ||
72 | hw/Kconfig | 1 + | ||
73 | hw/arm/Kconfig | 5 ++ | ||
74 | hw/dma/Kconfig | 3 + | ||
75 | hw/dma/meson.build | 2 +- | ||
76 | 15 files changed, 130 insertions(+), 69 deletions(-) | ||
77 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Richard Henderson <richard.henderson@linaro.org> | ||
2 | 1 | ||
3 | Off by one error in the EL2 and EL3 tests. Remove the test | ||
4 | against EL3 entirely, since it must always be true. | ||
5 | |||
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Message-id: 20190702104732.31154-1-richard.henderson@linaro.org | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | target/arm/helper.c | 4 ++-- | ||
12 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper.c | ||
17 | +++ b/target/arm/helper.c | ||
18 | @@ -XXX,XX +XXX,XX @@ uint32_t sve_zcr_len_for_el(CPUARMState *env, int el) | ||
19 | if (el <= 1) { | ||
20 | zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[1]); | ||
21 | } | ||
22 | - if (el < 2 && arm_feature(env, ARM_FEATURE_EL2)) { | ||
23 | + if (el <= 2 && arm_feature(env, ARM_FEATURE_EL2)) { | ||
24 | zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[2]); | ||
25 | } | ||
26 | - if (el < 3 && arm_feature(env, ARM_FEATURE_EL3)) { | ||
27 | + if (arm_feature(env, ARM_FEATURE_EL3)) { | ||
28 | zcr_len = MIN(zcr_len, 0xf & (uint32_t)env->vfp.zcr_el[3]); | ||
29 | } | ||
30 | return zcr_len; | ||
31 | -- | ||
32 | 2.20.1 | ||
33 | |||
34 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | The test aarch64 kernel is in an array defined with | ||
2 | unsigned char aarch64_kernel[] = { [...] } | ||
3 | 1 | ||
4 | which means it could be any size; currently it's quite small. | ||
5 | However we write it to a file using init_bootfile(), which | ||
6 | writes exactly 512 bytes to the file. This will break if | ||
7 | we ever end up with a kernel larger than that, and will | ||
8 | read garbage off the end of the array in the current setup | ||
9 | where the kernel is smaller. | ||
10 | |||
11 | Make init_bootfile() take an argument giving the length of | ||
12 | the data to write. This allows us to use it for all architectures | ||
13 | (previously s390 had a special-purpose init_bootfile_s390x | ||
14 | which hardcoded the file to write so it could write the | ||
15 | correct length). We assert that the x86 bootfile really is | ||
16 | exactly 512 bytes as it should be (and as we were previously | ||
17 | just assuming it was). | ||
18 | |||
19 | This was detected by the clang-7 asan: | ||
20 | ==15607==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55a796f51d20 at pc 0x55a796b89c2f bp 0x7ffc58e89160 sp 0x7ffc58e88908 | ||
21 | READ of size 512 at 0x55a796f51d20 thread T0 | ||
22 | #0 0x55a796b89c2e in fwrite (/home/petmay01/linaro/qemu-from-laptop/qemu/build/sanitizers/tests/migration-test+0xb0c2e) | ||
23 | #1 0x55a796c46492 in init_bootfile /home/petmay01/linaro/qemu-from-laptop/qemu/tests/migration-test.c:99:5 | ||
24 | #2 0x55a796c46492 in test_migrate_start /home/petmay01/linaro/qemu-from-laptop/qemu/tests/migration-test.c:593 | ||
25 | #3 0x55a796c44101 in test_baddest /home/petmay01/linaro/qemu-from-laptop/qemu/tests/migration-test.c:854:9 | ||
26 | #4 0x7f906ffd3cc9 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72cc9) | ||
27 | #5 0x7f906ffd3bfa (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72bfa) | ||
28 | #6 0x7f906ffd3bfa (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72bfa) | ||
29 | #7 0x7f906ffd3ea1 in g_test_run_suite (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72ea1) | ||
30 | #8 0x7f906ffd3ec0 in g_test_run (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x72ec0) | ||
31 | #9 0x55a796c43707 in main /home/petmay01/linaro/qemu-from-laptop/qemu/tests/migration-test.c:1187:11 | ||
32 | #10 0x7f906e9abb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310 | ||
33 | #11 0x55a796b6c2d9 in _start (/home/petmay01/linaro/qemu-from-laptop/qemu/build/sanitizers/tests/migration-test+0x932d9) | ||
34 | |||
35 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
36 | Reviewed-by: Laurent Vivier <lvivier@redhat.com> | ||
37 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
38 | Message-id: 20190702150311.20467-1-peter.maydell@linaro.org | ||
39 | --- | ||
40 | tests/migration-test.c | 22 +++++++--------------- | ||
41 | 1 file changed, 7 insertions(+), 15 deletions(-) | ||
42 | |||
43 | diff --git a/tests/migration-test.c b/tests/migration-test.c | ||
44 | index XXXXXXX..XXXXXXX 100644 | ||
45 | --- a/tests/migration-test.c | ||
46 | +++ b/tests/migration-test.c | ||
47 | @@ -XXX,XX +XXX,XX @@ static const char *tmpfs; | ||
48 | */ | ||
49 | #include "tests/migration/i386/a-b-bootblock.h" | ||
50 | #include "tests/migration/aarch64/a-b-kernel.h" | ||
51 | - | ||
52 | -static void init_bootfile(const char *bootpath, void *content) | ||
53 | -{ | ||
54 | - FILE *bootfile = fopen(bootpath, "wb"); | ||
55 | - | ||
56 | - g_assert_cmpint(fwrite(content, 512, 1, bootfile), ==, 1); | ||
57 | - fclose(bootfile); | ||
58 | -} | ||
59 | - | ||
60 | #include "tests/migration/s390x/a-b-bios.h" | ||
61 | |||
62 | -static void init_bootfile_s390x(const char *bootpath) | ||
63 | +static void init_bootfile(const char *bootpath, void *content, size_t len) | ||
64 | { | ||
65 | FILE *bootfile = fopen(bootpath, "wb"); | ||
66 | - size_t len = sizeof(s390x_elf); | ||
67 | |||
68 | - g_assert_cmpint(fwrite(s390x_elf, len, 1, bootfile), ==, 1); | ||
69 | + g_assert_cmpint(fwrite(content, len, 1, bootfile), ==, 1); | ||
70 | fclose(bootfile); | ||
71 | } | ||
72 | |||
73 | @@ -XXX,XX +XXX,XX @@ static int test_migrate_start(QTestState **from, QTestState **to, | ||
74 | got_stop = false; | ||
75 | bootpath = g_strdup_printf("%s/bootsect", tmpfs); | ||
76 | if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { | ||
77 | - init_bootfile(bootpath, x86_bootsect); | ||
78 | + /* the assembled x86 boot sector should be exactly one sector large */ | ||
79 | + assert(sizeof(x86_bootsect) == 512); | ||
80 | + init_bootfile(bootpath, x86_bootsect, sizeof(x86_bootsect)); | ||
81 | extra_opts = use_shmem ? get_shmem_opts("150M", shmem_path) : NULL; | ||
82 | cmd_src = g_strdup_printf("-machine accel=%s -m 150M" | ||
83 | " -name source,debug-threads=on" | ||
84 | @@ -XXX,XX +XXX,XX @@ static int test_migrate_start(QTestState **from, QTestState **to, | ||
85 | start_address = X86_TEST_MEM_START; | ||
86 | end_address = X86_TEST_MEM_END; | ||
87 | } else if (g_str_equal(arch, "s390x")) { | ||
88 | - init_bootfile_s390x(bootpath); | ||
89 | + init_bootfile(bootpath, s390x_elf, sizeof(s390x_elf)); | ||
90 | extra_opts = use_shmem ? get_shmem_opts("128M", shmem_path) : NULL; | ||
91 | cmd_src = g_strdup_printf("-machine accel=%s -m 128M" | ||
92 | " -name source,debug-threads=on" | ||
93 | @@ -XXX,XX +XXX,XX @@ static int test_migrate_start(QTestState **from, QTestState **to, | ||
94 | start_address = PPC_TEST_MEM_START; | ||
95 | end_address = PPC_TEST_MEM_END; | ||
96 | } else if (strcmp(arch, "aarch64") == 0) { | ||
97 | - init_bootfile(bootpath, aarch64_kernel); | ||
98 | + init_bootfile(bootpath, aarch64_kernel, sizeof(aarch64_kernel)); | ||
99 | extra_opts = use_shmem ? get_shmem_opts("150M", shmem_path) : NULL; | ||
100 | cmd_src = g_strdup_printf("-machine virt,accel=%s,gic-version=max " | ||
101 | "-name vmsource,debug-threads=on -cpu max " | ||
102 | -- | ||
103 | 2.20.1 | ||
104 | |||
105 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | In the virt machine, we support TrustZone being either present or | ||
2 | absent, and so the code must deal with the secure_sysmem pointer | ||
3 | possibly being NULL. In the sbsa-ref machine, TrustZone is always | ||
4 | present, but some code and comments copied from virt still treat | ||
5 | it as possibly not being present. | ||
6 | 1 | ||
7 | This causes Coverity to complain (CID 1407287) that we check | ||
8 | secure_sysmem for being NULL after an unconditional dereference. | ||
9 | Simplify the code so that instead of initializing the variable | ||
10 | to NULL, unconditionally assigning it, and then testing it for NULL, | ||
11 | we just initialize it correctly in the variable declaration and | ||
12 | then assume it to be non-NULL. We also delete a comment which | ||
13 | only applied to the non-TrustZone config. | ||
14 | |||
15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
16 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
17 | Message-id: 20190704142004.7150-1-peter.maydell@linaro.org | ||
18 | Tested-by: Radosław Biernacki <radoslaw.biernacki@linaro.org> | ||
19 | Reviewed-by: Radosław Biernacki <radoslaw.biernacki@linaro.org> | ||
20 | --- | ||
21 | hw/arm/sbsa-ref.c | 8 ++------ | ||
22 | 1 file changed, 2 insertions(+), 6 deletions(-) | ||
23 | |||
24 | diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c | ||
25 | index XXXXXXX..XXXXXXX 100644 | ||
26 | --- a/hw/arm/sbsa-ref.c | ||
27 | +++ b/hw/arm/sbsa-ref.c | ||
28 | @@ -XXX,XX +XXX,XX @@ static void sbsa_flash_map(SBSAMachineState *sms, | ||
29 | * sysmem is the system memory space. secure_sysmem is the secure view | ||
30 | * of the system, and the first flash device should be made visible only | ||
31 | * there. The second flash device is visible to both secure and nonsecure. | ||
32 | - * If sysmem == secure_sysmem this means there is no separate Secure | ||
33 | - * address space and both flash devices are generally visible. | ||
34 | */ | ||
35 | hwaddr flashsize = sbsa_ref_memmap[SBSA_FLASH].size / 2; | ||
36 | hwaddr flashbase = sbsa_ref_memmap[SBSA_FLASH].base; | ||
37 | @@ -XXX,XX +XXX,XX @@ static void sbsa_ref_init(MachineState *machine) | ||
38 | SBSAMachineState *sms = SBSA_MACHINE(machine); | ||
39 | MachineClass *mc = MACHINE_GET_CLASS(machine); | ||
40 | MemoryRegion *sysmem = get_system_memory(); | ||
41 | - MemoryRegion *secure_sysmem = NULL; | ||
42 | + MemoryRegion *secure_sysmem = g_new(MemoryRegion, 1); | ||
43 | MemoryRegion *ram = g_new(MemoryRegion, 1); | ||
44 | bool firmware_loaded; | ||
45 | const CPUArchIdList *possible_cpus; | ||
46 | @@ -XXX,XX +XXX,XX @@ static void sbsa_ref_init(MachineState *machine) | ||
47 | * containing the system memory at low priority; any secure-only | ||
48 | * devices go in at higher priority and take precedence. | ||
49 | */ | ||
50 | - secure_sysmem = g_new(MemoryRegion, 1); | ||
51 | memory_region_init(secure_sysmem, OBJECT(machine), "secure-memory", | ||
52 | UINT64_MAX); | ||
53 | memory_region_add_subregion_overlap(secure_sysmem, 0, sysmem, -1); | ||
54 | |||
55 | - firmware_loaded = sbsa_firmware_init(sms, sysmem, | ||
56 | - secure_sysmem ?: sysmem); | ||
57 | + firmware_loaded = sbsa_firmware_init(sms, sysmem, secure_sysmem); | ||
58 | |||
59 | if (machine->kernel_filename && firmware_loaded) { | ||
60 | error_report("sbsa-ref: No fw_cfg device on this machine, " | ||
61 | -- | ||
62 | 2.20.1 | ||
63 | |||
64 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
2 | 1 | ||
3 | In commit e9d652824b0 we extracted the vfp_set_fpscr_to_host() | ||
4 | function but failed at calling it in the correct place, we call | ||
5 | it after xregs[ARM_VFP_FPSCR] is modified. | ||
6 | |||
7 | Fix by calling this function before we update FPSCR. | ||
8 | |||
9 | Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com> | ||
10 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
11 | Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com> | ||
12 | Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com> | ||
13 | Message-id: 20190705124318.1075-1-philmd@redhat.com | ||
14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
15 | --- | ||
16 | target/arm/vfp_helper.c | 4 ++-- | ||
17 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c | ||
20 | index XXXXXXX..XXXXXXX 100644 | ||
21 | --- a/target/arm/vfp_helper.c | ||
22 | +++ b/target/arm/vfp_helper.c | ||
23 | @@ -XXX,XX +XXX,XX @@ void HELPER(vfp_set_fpscr)(CPUARMState *env, uint32_t val) | ||
24 | val &= 0xf7c0009f; | ||
25 | } | ||
26 | |||
27 | + vfp_set_fpscr_to_host(env, val); | ||
28 | + | ||
29 | /* | ||
30 | * We don't implement trapped exception handling, so the | ||
31 | * trap enable bits, IDE|IXE|UFE|OFE|DZE|IOE are all RAZ/WI (not RES0!) | ||
32 | @@ -XXX,XX +XXX,XX @@ void HELPER(vfp_set_fpscr)(CPUARMState *env, uint32_t val) | ||
33 | env->vfp.qc[1] = 0; | ||
34 | env->vfp.qc[2] = 0; | ||
35 | env->vfp.qc[3] = 0; | ||
36 | - | ||
37 | - vfp_set_fpscr_to_host(env, val); | ||
38 | } | ||
39 | |||
40 | void vfp_set_fpscr(CPUARMState *env, uint32_t val) | ||
41 | -- | ||
42 | 2.20.1 | ||
43 | |||
44 | diff view generated by jsdifflib |