1
A last handful of patches before the rc0. These are all bugfixes
1
Changes v2->v3:
2
so they could equally well go into rc1, but since my pullreq
2
dropped the aspeed new board patch as it fails in
3
queue is otherwise empty I might as well push them out. The
3
tests/qom-test on OSX (intermittently).
4
FPSCR bugfix is definitely one I'd like in rc0; the rest are
5
not really user-visible I think.
6
4
7
thanks
5
thanks
8
-- PMM
6
-- PMM
9
7
10
The following changes since commit c4107e8208d0222f9b328691b519aaee4101db87:
8
The following changes since commit f9bec781379dd7ccf9d01b4b6a79a9ec82c192e5:
11
9
12
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2019-07-08 10:26:18 +0100)
10
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20191022' into staging (2019-10-22 13:45:09 +0100)
13
11
14
are available in the Git repository at:
12
are available in the Git repository at:
15
13
16
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190708
14
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20191022-2
17
15
18
for you to fetch changes up to 85795187f416326f87177cabc39fae1911f04c50:
16
for you to fetch changes up to 90600829b3355b8d27b791b893095c18f529aec3:
19
17
20
target/arm/vfp_helper: Call set_fpscr_to_host before updating to FPSCR (2019-07-08 14:11:31 +0100)
18
hw/arm/digic4: Inline digic4_board_setup_ram() function (2019-10-22 17:44:01 +0100)
21
19
22
----------------------------------------------------------------
20
----------------------------------------------------------------
23
target-arm queue:
21
* Fix sign-extension for SMLAL* instructions
24
* tests/migration-test: Fix read off end of aarch64_kernel array
22
* Various ptimer device conversions to new transaction API
25
* Fix sve_zcr_len_for_el off-by-one error
23
* Add a dummy Samsung SDHCI controller model to exynos4 boards
26
* hw/arm/sbsa-ref: Silence Coverity nit
24
* Minor refactorings of RAM creation for some arm boards
27
* vfp_helper: Call set_fpscr_to_host before updating to FPSCR
28
25
29
----------------------------------------------------------------
26
----------------------------------------------------------------
30
Peter Maydell (2):
27
Guenter Roeck (1):
31
tests/migration-test: Fix read off end of aarch64_kernel array
28
hw/timer/exynos4210_mct: Initialize ptimer before starting it
32
hw/arm/sbsa-ref: Remove unnecessary check for secure_sysmem == NULL
33
29
34
Philippe Mathieu-Daudé (1):
30
Peter Maydell (7):
35
target/arm/vfp_helper: Call set_fpscr_to_host before updating to FPSCR
31
hw/timer/arm_mptimer.c: Undo accidental rename of arm_mptimer_init()
32
hw/timer/puv3_ost.c: Switch to transaction-based ptimer API
33
hw/timer/sh_timer: Switch to transaction-based ptimer API
34
hw/timer/lm32_timer: Switch to transaction-based ptimer API
35
hw/timer/altera_timer.c: Switch to transaction-based ptimer API
36
hw/watchdog/etraxfs_timer.c: Switch to transaction-based ptimer API
37
hw/m68k/mcf5208.c: Switch to transaction-based ptimer API
38
39
Philippe Mathieu-Daudé (9):
40
hw/sd/sdhci: Add a comment to distinct the i.MX eSDHC functions
41
hw/sd/sdhci: Add dummy Samsung SDHCI controller
42
hw/arm/exynos4210: Use the Samsung s3c SDHCI controller
43
hw/arm/xilinx_zynq: Use the IEC binary prefix definitions
44
hw/arm/mps2: Use the IEC binary prefix definitions
45
hw/arm/collie: Create the RAM in the board
46
hw/arm/omap2: Create the RAM in the board
47
hw/arm/omap1: Create the RAM in the board
48
hw/arm/digic4: Inline digic4_board_setup_ram() function
36
49
37
Richard Henderson (1):
50
Richard Henderson (1):
38
target/arm: Fix sve_zcr_len_for_el
51
target/arm: Fix sign-extension for SMLAL*
39
52
40
hw/arm/sbsa-ref.c | 8 ++------
53
hw/arm/strongarm.h | 4 +--
41
target/arm/helper.c | 4 ++--
54
include/hw/arm/omap.h | 10 +++----
42
target/arm/vfp_helper.c | 4 ++--
55
include/hw/sd/sdhci.h | 2 ++
43
tests/migration-test.c | 22 +++++++---------------
56
hw/arm/collie.c | 8 ++++--
44
4 files changed, 13 insertions(+), 25 deletions(-)
57
hw/arm/digic_boards.c | 9 ++-----
58
hw/arm/exynos4210.c | 2 +-
59
hw/arm/mps2-tz.c | 3 ++-
60
hw/arm/mps2.c | 3 ++-
61
hw/arm/nseries.c | 10 ++++---
62
hw/arm/omap1.c | 12 ++++-----
63
hw/arm/omap2.c | 13 ++++-----
64
hw/arm/omap_sx1.c | 8 ++++--
65
hw/arm/palm.c | 8 ++++--
66
hw/arm/strongarm.c | 7 +----
67
hw/arm/xilinx_zynq.c | 3 ++-
68
hw/m68k/mcf5208.c | 9 ++++---
69
hw/sd/sdhci.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++-
70
hw/timer/altera_timer.c | 13 ++++++---
71
hw/timer/arm_mptimer.c | 4 +--
72
hw/timer/etraxfs_timer.c | 23 +++++++++-------
73
hw/timer/exynos4210_mct.c | 2 +-
74
hw/timer/lm32_timer.c | 13 ++++++---
75
hw/timer/puv3_ost.c | 9 ++++---
76
hw/timer/sh_timer.c | 13 ++++++---
77
target/arm/translate.c | 4 ++-
78
25 files changed, 174 insertions(+), 86 deletions(-)
45
79
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