1
Almost nothing in here is arm-related, but the target-arm
1
Patches for rc1: nothing major, just some minor bugfixes and
2
queue was convenient for these last minute bits and pieces
2
code cleanups.
3
for 5.0...
4
3
5
thanks
6
-- PMM
4
-- PMM
7
5
8
The following changes since commit 14e5526b51910efd62cd31cd95b49baca975c83f:
6
The following changes since commit f7e1914adad8885a5d4c70239ab90d901ed97e9f:
9
7
10
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2020-04-13 15:42:51 +0100)
8
Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20201109' into staging (2020-11-10 09:24:56 +0000)
11
9
12
are available in the Git repository at:
10
are available in the Git repository at:
13
11
14
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20200414
12
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20201110
15
13
16
for you to fetch changes up to 84f82ddcbb4ac4ed04c8675e85155329f23184f0:
14
for you to fetch changes up to b6c56c8a9a4064ea783f352f43c5df6231a110fa:
17
15
18
Deprecate KVM support for AArch32 (2020-04-14 17:20:22 +0100)
16
target/arm/translate-neon.c: Handle VTBL UNDEF case before VFP access check (2020-11-10 11:03:48 +0000)
19
17
20
----------------------------------------------------------------
18
----------------------------------------------------------------
21
patch queue:
19
target-arm queue:
22
* Fix some problems that trip up Coverity's scanner
20
* hw/arm/Kconfig: ARM_V7M depends on PTIMER
23
* run-coverity-scan: New script automating the scan-and-upload process
21
* Minor coding style fixes
24
* docs: Improve our gdbstub documentation
22
* docs: add some notes on the sbsa-ref machine
25
* configure: Honour --disable-werror for Sphinx
23
* hw/arm/virt: Remove dependency on Cortex-A15 MPCore peripherals
26
* docs: Fix errors produced when building with Sphinx 3.0
24
* target/arm: Fix neon VTBL/VTBX for len > 1
27
* docs: Require Sphinx 1.6 or better
25
* hw/arm/armsse: Correct expansion MPC interrupt lines
28
* Add deprecation notice for KVM support on AArch32 hosts
26
* hw/misc/stm32f2xx_syscfg: Remove extraneous IRQ
27
* hw/arm/nseries: Remove invalid/unnecessary n8x0_uart_setup()
28
* hw/arm/musicpal: Don't connect two qemu_irqs directly to the same input
29
* hw/arm/musicpal: Only use qdev_get_gpio_in() when necessary
30
* hw/arm/nseries: Check return value from load_image_targphys()
31
* tests/qtest/npcm7xx_rng-test: count runs properly
32
* target/arm/translate-neon.c: Handle VTBL UNDEF case before VFP access check
29
33
30
----------------------------------------------------------------
34
----------------------------------------------------------------
31
Peter Maydell (12):
35
Alex Bennée (1):
32
osdep.h: Drop no-longer-needed Coverity workarounds
36
docs: add some notes on the sbsa-ref machine
33
thread.h: Fix Coverity version of qemu_cond_timedwait()
34
thread.h: Remove trailing semicolons from Coverity qemu_mutex_lock() etc
35
linux-user/flatload.c: Use "" for include of QEMU header target_flat.h
36
scripts/run-coverity-scan: Script to run Coverity Scan build
37
scripts/coverity-scan: Add Docker support
38
docs: Improve our gdbstub documentation
39
configure: Honour --disable-werror for Sphinx
40
scripts/kernel-doc: Add missing close-paren in c:function directives
41
kernel-doc: Use c:struct for Sphinx 3.0 and later
42
docs: Require Sphinx 1.6 or better
43
Deprecate KVM support for AArch32
44
37
45
configure | 9 +-
38
AlexChen (1):
46
Makefile | 2 +-
39
ssi: Fix bad printf format specifiers
47
include/qemu/osdep.h | 14 -
48
include/qemu/thread.h | 12 +-
49
linux-user/flatload.c | 2 +-
50
MAINTAINERS | 5 +
51
docs/conf.py | 6 +-
52
docs/sphinx/kerneldoc.py | 1 +
53
docs/system/deprecated.rst | 8 +
54
docs/system/gdb.rst | 22 +-
55
qemu-options.hx | 24 +-
56
scripts/coverity-scan/coverity-scan.docker | 131 ++++++++++
57
scripts/coverity-scan/run-coverity-scan | 401 +++++++++++++++++++++++++++++
58
scripts/kernel-doc | 18 +-
59
14 files changed, 615 insertions(+), 40 deletions(-)
60
create mode 100644 scripts/coverity-scan/coverity-scan.docker
61
create mode 100755 scripts/coverity-scan/run-coverity-scan
62
40
41
Andrew Jones (1):
42
hw/arm/Kconfig: ARM_V7M depends on PTIMER
43
44
Havard Skinnemoen (1):
45
tests/qtest/npcm7xx_rng-test: count runs properly
46
47
Peter Maydell (2):
48
hw/arm/nseries: Check return value from load_image_targphys()
49
target/arm/translate-neon.c: Handle VTBL UNDEF case before VFP access check
50
51
Philippe Mathieu-Daudé (6):
52
hw/arm/virt: Remove dependency on Cortex-A15 MPCore peripherals
53
hw/arm/armsse: Correct expansion MPC interrupt lines
54
hw/misc/stm32f2xx_syscfg: Remove extraneous IRQ
55
hw/arm/nseries: Remove invalid/unnecessary n8x0_uart_setup()
56
hw/arm/musicpal: Don't connect two qemu_irqs directly to the same input
57
hw/arm/musicpal: Only use qdev_get_gpio_in() when necessary
58
59
Richard Henderson (1):
60
target/arm: Fix neon VTBL/VTBX for len > 1
61
62
Xinhao Zhang (3):
63
target/arm: add spaces around operator
64
target/arm: Don't use '#' flag of printf format
65
target/arm: add space before the open parenthesis '('
66
67
docs/system/arm/sbsa.rst | 32 ++++++++++++++++++++++
68
docs/system/target-arm.rst | 1 +
69
include/hw/misc/stm32f2xx_syscfg.h | 2 --
70
target/arm/helper.h | 2 +-
71
hw/arm/armsse.c | 3 +-
72
hw/arm/musicpal.c | 40 +++++++++++++++++----------
73
hw/arm/nseries.c | 26 ++++++++----------
74
hw/arm/stm32f205_soc.c | 1 -
75
hw/misc/stm32f2xx_syscfg.c | 2 --
76
hw/ssi/imx_spi.c | 2 +-
77
hw/ssi/xilinx_spi.c | 2 +-
78
target/arm/arch_dump.c | 8 +++---
79
target/arm/arm-semi.c | 8 +++---
80
target/arm/helper.c | 2 +-
81
target/arm/op_helper.c | 23 +++++++++-------
82
target/arm/translate-a64.c | 4 +--
83
target/arm/translate.c | 2 +-
84
tests/qtest/npcm7xx_rng-test.c | 2 +-
85
hw/arm/Kconfig | 3 +-
86
target/arm/translate-neon.c.inc | 56 ++++++++++++++------------------------
87
20 files changed, 123 insertions(+), 98 deletions(-)
88
create mode 100644 docs/system/arm/sbsa.rst
89
diff view generated by jsdifflib
1
When kernel-doc generates a 'c:function' directive for a function
1
From: Andrew Jones <drjones@redhat.com>
2
one of whose arguments is a function pointer, it fails to print
3
the close-paren after the argument list of the function pointer
4
argument, for instance in the memory API documentation:
5
.. c:function:: void memory_region_init_resizeable_ram (MemoryRegion * mr, struct Object * owner, const char * name, uint64_t size, uint64_t max_size, void (*resized) (const char*, uint64_t length, void *host, Error ** errp)
6
2
7
which should have a ')' after the 'void *host' which is the
3
commit 32bd322a0134 ("hw/timer/armv7m_systick: Rewrite to use ptimers")
8
last argument to 'resized'.
4
changed armv7m_systick to build on ptimers. Make sure we have ptimers
5
in the build when building armv7m_systick.
9
6
10
Older versions of Sphinx don't try to parse the argumnet
7
Signed-off-by: Andrew Jones <drjones@redhat.com>
11
to c:function, but Sphinx 3.0 does do this and will complain:
8
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
9
Message-id: 20201104103343.30392-1-drjones@redhat.com
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
12
hw/arm/Kconfig | 1 +
13
1 file changed, 1 insertion(+)
12
14
13
/home/petmay01/linaro/qemu-from-laptop/qemu/docs/../include/exec/memory.h:834: WARNING: Error in declarator or parameters
15
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
14
Invalid C declaration: Expecting "," or ")" in parameters, got "EOF". [error at 208]
16
index XXXXXXX..XXXXXXX 100644
15
void memory_region_init_resizeable_ram (MemoryRegion * mr, struct Object * owner, const char * name, uint64_t size, uint64_t max_size, void (*resized) (const char*, uint64_t length, void *host, Error ** errp)
17
--- a/hw/arm/Kconfig
16
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^
18
+++ b/hw/arm/Kconfig
17
19
@@ -XXX,XX +XXX,XX @@ config ZYNQ
18
Add the missing close-paren.
20
19
21
config ARM_V7M
20
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
22
bool
21
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
23
+ select PTIMER
22
Message-id: 20200411182934.28678-3-peter.maydell@linaro.org
24
23
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
25
config ALLWINNER_A10
24
---
26
bool
25
scripts/kernel-doc | 2 +-
26
1 file changed, 1 insertion(+), 1 deletion(-)
27
28
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
29
index XXXXXXX..XXXXXXX 100755
30
--- a/scripts/kernel-doc
31
+++ b/scripts/kernel-doc
32
@@ -XXX,XX +XXX,XX @@ sub output_function_rst(%) {
33
34
    if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
35
     # pointer-to-function
36
-     print $1 . $parameter . ") (" . $2;
37
+     print $1 . $parameter . ") (" . $2 . ")";
38
    } else {
39
     print $type . " " . $parameter;
40
    }
41
--
27
--
42
2.20.1
28
2.20.1
43
29
44
30
diff view generated by jsdifflib
New patch
1
From: AlexChen <alex.chen@huawei.com>
1
2
3
We should use printf format specifier "%u" instead of "%d" for
4
argument of type "unsigned int".
5
6
Reported-by: Euler Robot <euler.robot@huawei.com>
7
Signed-off-by: Alex Chen <alex.chen@huawei.com>
8
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
9
Message-id: 5FA280F5.8060902@huawei.com
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
12
hw/ssi/imx_spi.c | 2 +-
13
hw/ssi/xilinx_spi.c | 2 +-
14
2 files changed, 2 insertions(+), 2 deletions(-)
15
16
diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/hw/ssi/imx_spi.c
19
+++ b/hw/ssi/imx_spi.c
20
@@ -XXX,XX +XXX,XX @@ static const char *imx_spi_reg_name(uint32_t reg)
21
case ECSPI_MSGDATA:
22
return "ECSPI_MSGDATA";
23
default:
24
- sprintf(unknown, "%d ?", reg);
25
+ sprintf(unknown, "%u ?", reg);
26
return unknown;
27
}
28
}
29
diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c
30
index XXXXXXX..XXXXXXX 100644
31
--- a/hw/ssi/xilinx_spi.c
32
+++ b/hw/ssi/xilinx_spi.c
33
@@ -XXX,XX +XXX,XX @@ static void xlx_spi_update_irq(XilinxSPI *s)
34
irq chain unless things really changed. */
35
if (pending != s->irqline) {
36
s->irqline = pending;
37
- DB_PRINT("irq_change of state %d ISR:%x IER:%X\n",
38
+ DB_PRINT("irq_change of state %u ISR:%x IER:%X\n",
39
pending, s->regs[R_IPISR], s->regs[R_IPIER]);
40
qemu_set_irq(s->irq, pending);
41
}
42
--
43
2.20.1
44
45
diff view generated by jsdifflib
New patch
1
From: Xinhao Zhang <zhangxinhao1@huawei.com>
1
2
3
Fix code style. Operator needs spaces both sides.
4
5
Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
6
Signed-off-by: Kai Deng <dengkai1@huawei.com>
7
Message-id: 20201103114529.638233-1-zhangxinhao1@huawei.com
8
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
---
11
target/arm/arch_dump.c | 8 ++++----
12
target/arm/arm-semi.c | 8 ++++----
13
target/arm/helper.c | 2 +-
14
3 files changed, 9 insertions(+), 9 deletions(-)
15
16
diff --git a/target/arm/arch_dump.c b/target/arm/arch_dump.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/target/arm/arch_dump.c
19
+++ b/target/arm/arch_dump.c
20
@@ -XXX,XX +XXX,XX @@ static int aarch64_write_elf64_prfpreg(WriteCoreDumpFunction f,
21
22
for (i = 0; i < 32; ++i) {
23
uint64_t *q = aa64_vfp_qreg(env, i);
24
- note.vfp.vregs[2*i + 0] = cpu_to_dump64(s, q[0]);
25
- note.vfp.vregs[2*i + 1] = cpu_to_dump64(s, q[1]);
26
+ note.vfp.vregs[2 * i + 0] = cpu_to_dump64(s, q[0]);
27
+ note.vfp.vregs[2 * i + 1] = cpu_to_dump64(s, q[1]);
28
}
29
30
if (s->dump_info.d_endian == ELFDATA2MSB) {
31
@@ -XXX,XX +XXX,XX @@ static int aarch64_write_elf64_prfpreg(WriteCoreDumpFunction f,
32
*/
33
for (i = 0; i < 32; ++i) {
34
uint64_t tmp = note.vfp.vregs[2*i];
35
- note.vfp.vregs[2*i] = note.vfp.vregs[2*i+1];
36
- note.vfp.vregs[2*i+1] = tmp;
37
+ note.vfp.vregs[2 * i] = note.vfp.vregs[2 * i + 1];
38
+ note.vfp.vregs[2 * i + 1] = tmp;
39
}
40
}
41
42
diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c
43
index XXXXXXX..XXXXXXX 100644
44
--- a/target/arm/arm-semi.c
45
+++ b/target/arm/arm-semi.c
46
@@ -XXX,XX +XXX,XX @@ target_ulong do_arm_semihosting(CPUARMState *env)
47
if (use_gdb_syscalls()) {
48
arm_semi_open_guestfd = guestfd;
49
ret = arm_gdb_syscall(cpu, arm_semi_open_cb, "open,%s,%x,1a4", arg0,
50
- (int)arg2+1, gdb_open_modeflags[arg1]);
51
+ (int)arg2 + 1, gdb_open_modeflags[arg1]);
52
} else {
53
ret = set_swi_errno(env, open(s, open_modeflags[arg1], 0644));
54
if (ret == (uint32_t)-1) {
55
@@ -XXX,XX +XXX,XX @@ target_ulong do_arm_semihosting(CPUARMState *env)
56
GET_ARG(1);
57
if (use_gdb_syscalls()) {
58
ret = arm_gdb_syscall(cpu, arm_semi_cb, "unlink,%s",
59
- arg0, (int)arg1+1);
60
+ arg0, (int)arg1 + 1);
61
} else {
62
s = lock_user_string(arg0);
63
if (!s) {
64
@@ -XXX,XX +XXX,XX @@ target_ulong do_arm_semihosting(CPUARMState *env)
65
GET_ARG(3);
66
if (use_gdb_syscalls()) {
67
return arm_gdb_syscall(cpu, arm_semi_cb, "rename,%s,%s",
68
- arg0, (int)arg1+1, arg2, (int)arg3+1);
69
+ arg0, (int)arg1 + 1, arg2, (int)arg3 + 1);
70
} else {
71
char *s2;
72
s = lock_user_string(arg0);
73
@@ -XXX,XX +XXX,XX @@ target_ulong do_arm_semihosting(CPUARMState *env)
74
GET_ARG(1);
75
if (use_gdb_syscalls()) {
76
return arm_gdb_syscall(cpu, arm_semi_cb, "system,%s",
77
- arg0, (int)arg1+1);
78
+ arg0, (int)arg1 + 1);
79
} else {
80
s = lock_user_string(arg0);
81
if (!s) {
82
diff --git a/target/arm/helper.c b/target/arm/helper.c
83
index XXXXXXX..XXXXXXX 100644
84
--- a/target/arm/helper.c
85
+++ b/target/arm/helper.c
86
@@ -XXX,XX +XXX,XX @@ uint32_t HELPER(usad8)(uint32_t a, uint32_t b)
87
uint32_t sum;
88
sum = do_usad(a, b);
89
sum += do_usad(a >> 8, b >> 8);
90
- sum += do_usad(a >> 16, b >>16);
91
+ sum += do_usad(a >> 16, b >> 16);
92
sum += do_usad(a >> 24, b >> 24);
93
return sum;
94
}
95
--
96
2.20.1
97
98
diff view generated by jsdifflib
1
The Linux kernel has dropped support for allowing 32-bit Arm systems
1
From: Xinhao Zhang <zhangxinhao1@huawei.com>
2
to host KVM guests (kernel commit 541ad0150ca4aa663a2, which just
3
landed upstream in the 5.7 merge window). Mark QEMU's support for
4
this configuration as deprecated, so that we can delete that support
5
code in 5.2.
6
2
3
Fix code style. Don't use '#' flag of printf format ('%#') in
4
format strings, use '0x' prefix instead
5
6
Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
7
Signed-off-by: Kai Deng <dengkai1@huawei.com>
8
Message-id: 20201103114529.638233-2-zhangxinhao1@huawei.com
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
Reviewed-by: Andrew Jones <drjones@redhat.com>
9
---
11
---
10
docs/system/deprecated.rst | 8 ++++++++
12
target/arm/translate-a64.c | 4 ++--
11
1 file changed, 8 insertions(+)
13
1 file changed, 2 insertions(+), 2 deletions(-)
12
14
13
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
15
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
14
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
15
--- a/docs/system/deprecated.rst
17
--- a/target/arm/translate-a64.c
16
+++ b/docs/system/deprecated.rst
18
+++ b/target/arm/translate-a64.c
17
@@ -XXX,XX +XXX,XX @@ The ``compat`` property used to set backwards compatibility modes for
19
@@ -XXX,XX +XXX,XX @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)
18
the processor has been deprecated. The ``max-cpu-compat`` property of
20
gen_helper_advsimd_acgt_f16(tcg_res, tcg_op1, tcg_op2, fpst);
19
the ``pseries`` machine type should be used instead.
21
break;
20
22
default:
21
+KVM guest support on 32-bit Arm hosts (since 5.0)
23
- fprintf(stderr, "%s: insn %#04x, fpop %#2x @ %#" PRIx64 "\n",
22
+'''''''''''''''''''''''''''''''''''''''''''''''''
24
+ fprintf(stderr, "%s: insn 0x%04x, fpop 0x%2x @ 0x%" PRIx64 "\n",
23
+
25
__func__, insn, fpopcode, s->pc_curr);
24
+The Linux kernel has dropped support for allowing 32-bit Arm systems
26
g_assert_not_reached();
25
+to host KVM guests as of the 5.7 kernel. Accordingly, QEMU is deprecating
27
}
26
+its support for this configuration and will remove it in a future version.
28
@@ -XXX,XX +XXX,XX @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)
27
+Running 32-bit guests on a 64-bit Arm host remains supported.
29
case 0x7f: /* FSQRT (vector) */
28
+
30
break;
29
System emulator devices
31
default:
30
-----------------------
32
- fprintf(stderr, "%s: insn %#04x fpop %#2x\n", __func__, insn, fpop);
33
+ fprintf(stderr, "%s: insn 0x%04x fpop 0x%2x\n", __func__, insn, fpop);
34
g_assert_not_reached();
35
}
31
36
32
--
37
--
33
2.20.1
38
2.20.1
34
39
35
40
diff view generated by jsdifflib
1
For Coverity's benefit, we provide simpler versions of functions like
1
From: Xinhao Zhang <zhangxinhao1@huawei.com>
2
qemu_mutex_lock(), qemu_cond_wait() and qemu_cond_timedwait(). When
3
we added qemu_cond_timedwait() in commit 3dcc9c6ec4ea, a cut and
4
paste error meant that the Coverity version of qemu_cond_timedwait()
5
was using the wrong _impl function, which makes the Coverity parser
6
complain:
7
2
8
"/qemu/include/qemu/thread.h", line 159: warning #140: too many arguments in
3
Fix code style. Space required before the open parenthesis '('.
9
function call
10
return qemu_cond_timedwait(cond, mutex, ms);
11
^
12
4
13
"/qemu/include/qemu/thread.h", line 159: warning #120: return value type does
5
Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
14
not match the function type
6
Signed-off-by: Kai Deng <dengkai1@huawei.com>
15
return qemu_cond_timedwait(cond, mutex, ms);
7
Message-id: 20201103114529.638233-3-zhangxinhao1@huawei.com
16
^
8
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
17
18
"/qemu/include/qemu/thread.h", line 156: warning #1563: function
19
"qemu_cond_timedwait" not emitted, consider modeling it or review
20
parse diagnostics to improve fidelity
21
static inline bool (qemu_cond_timedwait)(QemuCond *cond, QemuMutex *mutex,
22
^
23
24
These aren't fatal, but reduce the scope of the analysis. Fix the error.
25
26
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
27
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
28
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
29
Message-id: 20200319193323.2038-3-peter.maydell@linaro.org
30
---
10
---
31
include/qemu/thread.h | 2 +-
11
target/arm/translate.c | 2 +-
32
1 file changed, 1 insertion(+), 1 deletion(-)
12
1 file changed, 1 insertion(+), 1 deletion(-)
33
13
34
diff --git a/include/qemu/thread.h b/include/qemu/thread.h
14
diff --git a/target/arm/translate.c b/target/arm/translate.c
35
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
36
--- a/include/qemu/thread.h
16
--- a/target/arm/translate.c
37
+++ b/include/qemu/thread.h
17
+++ b/target/arm/translate.c
38
@@ -XXX,XX +XXX,XX @@ extern QemuCondTimedWaitFunc qemu_cond_timedwait_func;
18
@@ -XXX,XX +XXX,XX @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
39
#define qemu_cond_wait(c, m) \
19
- Hardware watchpoints.
40
qemu_cond_wait_impl(c, m, __FILE__, __LINE__);
20
Hardware breakpoints have already been handled and skip this code.
41
#define qemu_cond_timedwait(c, m, ms) \
21
*/
42
- qemu_cond_wait_impl(c, m, ms, __FILE__, __LINE__);
22
- switch(dc->base.is_jmp) {
43
+ qemu_cond_timedwait_impl(c, m, ms, __FILE__, __LINE__);
23
+ switch (dc->base.is_jmp) {
44
#else
24
case DISAS_NEXT:
45
#define qemu_mutex_lock(m) ({ \
25
case DISAS_TOO_MANY:
46
QemuMutexLockFunc _f = atomic_read(&qemu_mutex_lock_func); \
26
gen_goto_tb(dc, 1, dc->base.pc_next);
47
--
27
--
48
2.20.1
28
2.20.1
49
29
50
30
diff view generated by jsdifflib
1
Add support for running the Coverity Scan tools inside a Docker
1
From: Alex Bennée <alex.bennee@linaro.org>
2
container rather than directly on the host system.
3
2
4
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
3
We should at least document what this machine is about.
4
5
Reviewed-by: Graeme Gregory <graeme@nuviainc.com>
6
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
7
Message-id: 20201104165254.24822-1-alex.bennee@linaro.org
8
Cc: Leif Lindholm <leif@nuviainc.com>
9
Cc: Shashi Mallela <shashi.mallela@linaro.org>
10
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
11
[PMM: fixed filename mismatch]
5
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6
Message-id: 20200319193323.2038-7-peter.maydell@linaro.org
7
---
13
---
8
scripts/coverity-scan/coverity-scan.docker | 131 +++++++++++++++++++++
14
docs/system/arm/sbsa.rst | 32 ++++++++++++++++++++++++++++++++
9
scripts/coverity-scan/run-coverity-scan | 90 ++++++++++++++
15
docs/system/target-arm.rst | 1 +
10
2 files changed, 221 insertions(+)
16
2 files changed, 33 insertions(+)
11
create mode 100644 scripts/coverity-scan/coverity-scan.docker
17
create mode 100644 docs/system/arm/sbsa.rst
12
18
13
diff --git a/scripts/coverity-scan/coverity-scan.docker b/scripts/coverity-scan/coverity-scan.docker
19
diff --git a/docs/system/arm/sbsa.rst b/docs/system/arm/sbsa.rst
14
new file mode 100644
20
new file mode 100644
15
index XXXXXXX..XXXXXXX
21
index XXXXXXX..XXXXXXX
16
--- /dev/null
22
--- /dev/null
17
+++ b/scripts/coverity-scan/coverity-scan.docker
23
+++ b/docs/system/arm/sbsa.rst
18
@@ -XXX,XX +XXX,XX @@
24
@@ -XXX,XX +XXX,XX @@
19
+# syntax=docker/dockerfile:1.0.0-experimental
25
+Arm Server Base System Architecture Reference board (``sbsa-ref``)
20
+#
26
+==================================================================
21
+# Docker setup for running the "Coverity Scan" tools over the source
22
+# tree and uploading them to the website, as per
23
+# https://scan.coverity.com/projects/qemu/builds/new
24
+# We do this on a fixed config (currently Fedora 30 with a known
25
+# set of dependencies and a configure command that enables a specific
26
+# set of options) so that random changes don't result in our accidentally
27
+# dropping some files from the scan.
28
+#
29
+# We don't build on top of the fedora.docker file because we don't
30
+# want to accidentally change or break the scan config when that
31
+# is updated.
32
+
27
+
33
+# The work of actually doing the build is handled by the
28
+While the `virt` board is a generic board platform that doesn't match
34
+# run-coverity-scan script.
29
+any real hardware the `sbsa-ref` board intends to look like real
30
+hardware. The `Server Base System Architecture
31
+<https://developer.arm.com/documentation/den0029/latest>` defines a
32
+minimum base line of hardware support and importantly how the firmware
33
+reports that to any operating system. It is a static system that
34
+reports a very minimal DT to the firmware for non-discoverable
35
+information about components affected by the qemu command line (i.e.
36
+cpus and memory). As a result it must have a firmware specifically
37
+built to expect a certain hardware layout (as you would in a real
38
+machine).
35
+
39
+
36
+FROM fedora:30
40
+It is intended to be a machine for developing firmware and testing
37
+ENV PACKAGES \
41
+standards compliance with operating systems.
38
+ alsa-lib-devel \
39
+ bc \
40
+ bison \
41
+ brlapi-devel \
42
+ bzip2 \
43
+ bzip2-devel \
44
+ ccache \
45
+ clang \
46
+ curl \
47
+ cyrus-sasl-devel \
48
+ dbus-daemon \
49
+ device-mapper-multipath-devel \
50
+ findutils \
51
+ flex \
52
+ gcc \
53
+ gcc-c++ \
54
+ gettext \
55
+ git \
56
+ glib2-devel \
57
+ glusterfs-api-devel \
58
+ gnutls-devel \
59
+ gtk3-devel \
60
+ hostname \
61
+ libaio-devel \
62
+ libasan \
63
+ libattr-devel \
64
+ libblockdev-mpath-devel \
65
+ libcap-devel \
66
+ libcap-ng-devel \
67
+ libcurl-devel \
68
+ libepoxy-devel \
69
+ libfdt-devel \
70
+ libgbm-devel \
71
+ libiscsi-devel \
72
+ libjpeg-devel \
73
+ libpmem-devel \
74
+ libnfs-devel \
75
+ libpng-devel \
76
+ librbd-devel \
77
+ libseccomp-devel \
78
+ libssh-devel \
79
+ libubsan \
80
+ libudev-devel \
81
+ libusbx-devel \
82
+ libxml2-devel \
83
+ libzstd-devel \
84
+ llvm \
85
+ lzo-devel \
86
+ make \
87
+ mingw32-bzip2 \
88
+ mingw32-curl \
89
+ mingw32-glib2 \
90
+ mingw32-gmp \
91
+ mingw32-gnutls \
92
+ mingw32-gtk3 \
93
+ mingw32-libjpeg-turbo \
94
+ mingw32-libpng \
95
+ mingw32-libtasn1 \
96
+ mingw32-nettle \
97
+ mingw32-nsis \
98
+ mingw32-pixman \
99
+ mingw32-pkg-config \
100
+ mingw32-SDL2 \
101
+ mingw64-bzip2 \
102
+ mingw64-curl \
103
+ mingw64-glib2 \
104
+ mingw64-gmp \
105
+ mingw64-gnutls \
106
+ mingw64-gtk3 \
107
+ mingw64-libjpeg-turbo \
108
+ mingw64-libpng \
109
+ mingw64-libtasn1 \
110
+ mingw64-nettle \
111
+ mingw64-pixman \
112
+ mingw64-pkg-config \
113
+ mingw64-SDL2 \
114
+ ncurses-devel \
115
+ nettle-devel \
116
+ nss-devel \
117
+ numactl-devel \
118
+ perl \
119
+ perl-Test-Harness \
120
+ pixman-devel \
121
+ pulseaudio-libs-devel \
122
+ python3 \
123
+ python3-sphinx \
124
+ PyYAML \
125
+ rdma-core-devel \
126
+ SDL2-devel \
127
+ snappy-devel \
128
+ sparse \
129
+ spice-server-devel \
130
+ systemd-devel \
131
+ systemtap-sdt-devel \
132
+ tar \
133
+ texinfo \
134
+ usbredir-devel \
135
+ virglrenderer-devel \
136
+ vte291-devel \
137
+ wget \
138
+ which \
139
+ xen-devel \
140
+ xfsprogs-devel \
141
+ zlib-devel
142
+ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3
143
+
42
+
144
+RUN dnf install -y $PACKAGES
43
+Supported devices
145
+RUN rpm -q $PACKAGES | sort > /packages.txt
44
+"""""""""""""""""
146
+ENV PATH $PATH:/usr/libexec/python3-sphinx/
147
+ENV COVERITY_TOOL_BASE=/coverity-tools
148
+COPY run-coverity-scan run-coverity-scan
149
+RUN --mount=type=secret,id=coverity.token,required ./run-coverity-scan --update-tools-only --tokenfile /run/secrets/coverity.token
150
diff --git a/scripts/coverity-scan/run-coverity-scan b/scripts/coverity-scan/run-coverity-scan
151
index XXXXXXX..XXXXXXX 100755
152
--- a/scripts/coverity-scan/run-coverity-scan
153
+++ b/scripts/coverity-scan/run-coverity-scan
154
@@ -XXX,XX +XXX,XX @@
155
156
# Command line options:
157
# --dry-run : run the tools, but don't actually do the upload
158
+# --docker : create and work inside a docker container
159
# --update-tools-only : update the cached copy of the tools, but don't run them
160
# --tokenfile : file to read Coverity token from
161
# --version ver : specify version being analyzed (default: ask git)
162
@@ -XXX,XX +XXX,XX @@
163
# --srcdir : QEMU source tree to analyze (default: current working dir)
164
# --results-tarball : path to copy the results tarball to (default: don't
165
# copy it anywhere, just upload it)
166
+# --src-tarball : tarball to untar into src dir (default: none); this
167
+# is intended mainly for internal use by the Docker support
168
#
169
# User-specifiable environment variables:
170
# COVERITY_TOKEN -- Coverity token
171
@@ -XXX,XX +XXX,XX @@ update_coverity_tools () {
172
# Check user-provided environment variables and arguments
173
DRYRUN=no
174
UPDATE_ONLY=no
175
+DOCKER=no
176
177
while [ "$#" -ge 1 ]; do
178
case "$1" in
179
@@ -XXX,XX +XXX,XX @@ while [ "$#" -ge 1 ]; do
180
RESULTSTARBALL="$1"
181
shift
182
;;
183
+ --src-tarball)
184
+ shift
185
+ if [ $# -eq 0 ]; then
186
+ echo "--src-tarball needs an argument"
187
+ exit 1
188
+ fi
189
+ SRCTARBALL="$1"
190
+ shift
191
+ ;;
192
+ --docker)
193
+ DOCKER=yes
194
+ shift
195
+ ;;
196
*)
197
echo "Unexpected argument '$1'"
198
exit 1
199
@@ -XXX,XX +XXX,XX @@ PROJTOKEN="$COVERITY_TOKEN"
200
PROJNAME=QEMU
201
TARBALL=cov-int.tar.xz
202
203
+if [ "$UPDATE_ONLY" = yes ] && [ "$DOCKER" = yes ]; then
204
+ echo "Combining --docker and --update-only is not supported"
205
+ exit 1
206
+fi
207
208
if [ "$UPDATE_ONLY" = yes ]; then
209
# Just do the tools update; we don't need to check whether
210
@@ -XXX,XX +XXX,XX @@ if [ "$UPDATE_ONLY" = yes ]; then
211
exit 0
212
fi
213
214
+if [ ! -e "$SRCDIR" ]; then
215
+ mkdir "$SRCDIR"
216
+fi
217
+
45
+
218
cd "$SRCDIR"
46
+The sbsa-ref board supports:
219
220
+if [ ! -z "$SRCTARBALL" ]; then
221
+ echo "Untarring source tarball into $SRCDIR..."
222
+ tar xvf "$SRCTARBALL"
223
+fi
224
+
47
+
225
echo "Checking this is a QEMU source tree..."
48
+ - A configurable number of AArch64 CPUs
226
if ! [ -e "$SRCDIR/VERSION" ]; then
49
+ - GIC version 3
227
echo "Not in a QEMU source tree?"
50
+ - System bus AHCI controller
228
@@ -XXX,XX +XXX,XX @@ if [ -z "$COVERITY_EMAIL" ]; then
51
+ - System bus EHCI controller
229
COVERITY_EMAIL="$(git config user.email)"
52
+ - CDROM and hard disc on AHCI bus
230
fi
53
+ - E1000E ethernet card on PCIe bus
231
54
+ - VGA display adaptor on PCIe bus
232
+# Run ourselves inside docker if that's what the user wants
55
+ - A generic SBSA watchdog device
233
+if [ "$DOCKER" = yes ]; then
234
+ # build docker container including the coverity-scan tools
235
+ # Put the Coverity token into a temporary file that only
236
+ # we have read access to, and then pass it to docker build
237
+ # using --secret. This requires at least Docker 18.09.
238
+ # Mostly what we are trying to do here is ensure we don't leak
239
+ # the token into the Docker image.
240
+ umask 077
241
+ SECRETDIR=$(mktemp -d)
242
+ if [ -z "$SECRETDIR" ]; then
243
+ echo "Failed to create temporary directory"
244
+ exit 1
245
+ fi
246
+ trap 'rm -rf "$SECRETDIR"' INT TERM EXIT
247
+ echo "Created temporary directory $SECRETDIR"
248
+ SECRET="$SECRETDIR/token"
249
+ echo "$COVERITY_TOKEN" > "$SECRET"
250
+ echo "Building docker container..."
251
+ # TODO: This re-downloads the tools every time, rather than
252
+ # caching and reusing the image produced with the downloaded tools.
253
+ # Not sure why.
254
+ # TODO: how do you get 'docker build' to print the output of the
255
+ # commands it is running to its stdout? This would be useful for debug.
256
+ DOCKER_BUILDKIT=1 docker build -t coverity-scanner \
257
+ --secret id=coverity.token,src="$SECRET" \
258
+ -f scripts/coverity-scan/coverity-scan.docker \
259
+ scripts/coverity-scan
260
+ echo "Archiving sources to be analyzed..."
261
+ ./scripts/archive-source.sh "$SECRETDIR/qemu-sources.tgz"
262
+ if [ "$DRYRUN" = yes ]; then
263
+ DRYRUNARG=--dry-run
264
+ fi
265
+ echo "Running scanner..."
266
+ # If we need to capture the output tarball, get the inner run to
267
+ # save it to the secrets directory so we can copy it out before the
268
+ # directory is cleaned up.
269
+ if [ ! -z "$RESULTSTARBALL" ]; then
270
+ RTARGS="--results-tarball /work/cov-int.tar.xz"
271
+ else
272
+ RTARGS=""
273
+ fi
274
+ # Arrange for this docker run to get access to the sources with -v.
275
+ # We pass through all the configuration from the outer script to the inner.
276
+ export COVERITY_EMAIL COVERITY_BUILD_CMD
277
+ docker run -it --env COVERITY_EMAIL --env COVERITY_BUILD_CMD \
278
+ -v "$SECRETDIR:/work" coverity-scanner \
279
+ ./run-coverity-scan --version "$VERSION" \
280
+ --description "$DESCRIPTION" $DRYRUNARG --tokenfile /work/token \
281
+ --srcdir /qemu --src-tarball /work/qemu-sources.tgz $RTARGS
282
+ if [ ! -z "$RESULTSTARBALL" ]; then
283
+ echo "Copying results tarball to $RESULTSTARBALL..."
284
+ cp "$SECRETDIR/cov-int.tar.xz" "$RESULTSTARBALL"
285
+ fi
286
+ echo "Docker work complete."
287
+ exit 0
288
+fi
289
+
56
+
290
+# Otherwise, continue with the full build and upload process.
57
diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst
291
+
58
index XXXXXXX..XXXXXXX 100644
292
check_upload_permissions
59
--- a/docs/system/target-arm.rst
293
60
+++ b/docs/system/target-arm.rst
294
update_coverity_tools
61
@@ -XXX,XX +XXX,XX @@ undocumented; you can get a complete list by running
62
arm/mps2
63
arm/musca
64
arm/realview
65
+ arm/sbsa
66
arm/versatile
67
arm/vexpress
68
arm/aspeed
295
--
69
--
296
2.20.1
70
2.20.1
297
71
298
72
diff view generated by jsdifflib
New patch
1
From: Philippe Mathieu-Daudé <philmd@redhat.com>
1
2
3
When using a Cortex-A15, the Virt machine does not use any
4
MPCore peripherals. Remove the dependency.
5
6
Fixes: 7951c7b7c05 ("hw/arm: Express dependencies of the virt machine with Kconfig")
7
Reported-by: Miroslav Rezanina <mrezanin@redhat.com>
8
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
9
Message-id: 20201107114852.271922-1-philmd@redhat.com
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
---
13
hw/arm/Kconfig | 1 -
14
1 file changed, 1 deletion(-)
15
16
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
17
index XXXXXXX..XXXXXXX 100644
18
--- a/hw/arm/Kconfig
19
+++ b/hw/arm/Kconfig
20
@@ -XXX,XX +XXX,XX @@ config ARM_VIRT
21
imply VFIO_PLATFORM
22
imply VFIO_XGMAC
23
imply TPM_TIS_SYSBUS
24
- select A15MPCORE
25
select ACPI
26
select ARM_SMMUV3
27
select GPIO_KEY
28
--
29
2.20.1
30
31
diff view generated by jsdifflib
1
The documentation of our -s and -gdb options is quite old; in
1
From: Richard Henderson <richard.henderson@linaro.org>
2
particular it still claims that it will cause QEMU to stop and wait
3
for the gdb connection, when this has not been true for some time:
4
you also need to pass -S if you want to make QEMU not launch the
5
guest on startup.
6
2
7
Improve the documentation to mention this requirement in the
3
The helper function did not get updated when we reorganized
8
executable's --help output, the documentation of the -gdb option in
4
the vector register file for SVE. Since then, the neon dregs
9
the manual, and in the "GDB usage" chapter.
5
are non-sequential and cannot be simply indexed.
10
6
11
Includes some minor tweaks to these paragraphs of documentation
7
At the same time, make the helper function operate on 64-bit
12
since I was editing them anyway (such as dropping the description
8
quantities so that we do not have to call it twice.
13
of our gdb support as "primitive").
14
9
10
Fixes: c39c2b9043e
11
Reported-by: Ard Biesheuvel <ardb@kernel.org>
12
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
13
[PMM: use aa32_vfp_dreg() rather than opencoding]
14
Message-id: 20201105171126.88014-1-richard.henderson@linaro.org
15
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
15
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
17
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
18
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
19
Message-id: 20200403094014.9589-1-peter.maydell@linaro.org
20
---
17
---
21
docs/system/gdb.rst | 22 +++++++++++++++-------
18
target/arm/helper.h | 2 +-
22
qemu-options.hx | 24 ++++++++++++++++++------
19
target/arm/op_helper.c | 23 +++++++++--------
23
2 files changed, 33 insertions(+), 13 deletions(-)
20
target/arm/translate-neon.c.inc | 44 +++++++++++----------------------
21
3 files changed, 29 insertions(+), 40 deletions(-)
24
22
25
diff --git a/docs/system/gdb.rst b/docs/system/gdb.rst
23
diff --git a/target/arm/helper.h b/target/arm/helper.h
26
index XXXXXXX..XXXXXXX 100644
24
index XXXXXXX..XXXXXXX 100644
27
--- a/docs/system/gdb.rst
25
--- a/target/arm/helper.h
28
+++ b/docs/system/gdb.rst
26
+++ b/target/arm/helper.h
29
@@ -XXX,XX +XXX,XX @@
27
@@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_2(rsqrte_f32, TCG_CALL_NO_RWG, f32, f32, ptr)
30
GDB usage
28
DEF_HELPER_FLAGS_2(rsqrte_f64, TCG_CALL_NO_RWG, f64, f64, ptr)
31
---------
29
DEF_HELPER_FLAGS_1(recpe_u32, TCG_CALL_NO_RWG, i32, i32)
32
30
DEF_HELPER_FLAGS_1(rsqrte_u32, TCG_CALL_NO_RWG, i32, i32)
33
-QEMU has a primitive support to work with gdb, so that you can do
31
-DEF_HELPER_FLAGS_4(neon_tbl, TCG_CALL_NO_RWG, i32, i32, i32, ptr, i32)
34
-'Ctrl-C' while the virtual machine is running and inspect its state.
32
+DEF_HELPER_FLAGS_4(neon_tbl, TCG_CALL_NO_RWG, i64, env, i32, i64, i64)
35
+QEMU supports working with gdb via gdb's remote-connection facility
33
36
+(the "gdbstub"). This allows you to debug guest code in the same
34
DEF_HELPER_3(shl_cc, i32, env, i32, i32)
37
+way that you might with a low-level debug facility like JTAG
35
DEF_HELPER_3(shr_cc, i32, env, i32, i32)
38
+on real hardware. You can stop and start the virtual machine,
36
diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c
39
+examine state like registers and memory, and set breakpoints and
37
index XXXXXXX..XXXXXXX 100644
40
+watchpoints.
38
--- a/target/arm/op_helper.c
41
39
+++ b/target/arm/op_helper.c
42
-In order to use gdb, launch QEMU with the '-s' option. It will wait for
40
@@ -XXX,XX +XXX,XX @@ void raise_exception_ra(CPUARMState *env, uint32_t excp, uint32_t syndrome,
43
-a gdb connection:
41
cpu_loop_exit_restore(cs, ra);
44
+In order to use gdb, launch QEMU with the ``-s`` and ``-S`` options.
42
}
45
+The ``-s`` option will make QEMU listen for an incoming connection
43
46
+from gdb on TCP port 1234, and ``-S`` will make QEMU not start the
44
-uint32_t HELPER(neon_tbl)(uint32_t ireg, uint32_t def, void *vn,
47
+guest until you tell it to from gdb. (If you want to specify which
45
- uint32_t maxindex)
48
+TCP port to use or to use something other than TCP for the gdbstub
46
+uint64_t HELPER(neon_tbl)(CPUARMState *env, uint32_t desc,
49
+connection, use the ``-gdb dev`` option instead of ``-s``.)
47
+ uint64_t ireg, uint64_t def)
50
48
{
51
.. parsed-literal::
49
- uint32_t val, shift;
52
50
- uint64_t *table = vn;
53
- |qemu_system| -s -kernel bzImage -hda rootdisk.img -append "root=/dev/hda"
51
+ uint64_t tmp, val = 0;
54
- Connected to host network interface: tun0
52
+ uint32_t maxindex = ((desc & 3) + 1) * 8;
55
- Waiting gdb connection on port 1234
53
+ uint32_t base_reg = desc >> 2;
56
+ |qemu_system| -s -S -kernel bzImage -hda rootdisk.img -append "root=/dev/hda"
54
+ uint32_t shift, index, reg;
55
56
- val = 0;
57
- for (shift = 0; shift < 32; shift += 8) {
58
- uint32_t index = (ireg >> shift) & 0xff;
59
+ for (shift = 0; shift < 64; shift += 8) {
60
+ index = (ireg >> shift) & 0xff;
61
if (index < maxindex) {
62
- uint32_t tmp = (table[index >> 3] >> ((index & 7) << 3)) & 0xff;
63
- val |= tmp << shift;
64
+ reg = base_reg + (index >> 3);
65
+ tmp = *aa32_vfp_dreg(env, reg);
66
+ tmp = ((tmp >> ((index & 7) << 3)) & 0xff) << shift;
67
} else {
68
- val |= def & (0xff << shift);
69
+ tmp = def & (0xffull << shift);
70
}
71
+ val |= tmp;
72
}
73
return val;
74
}
75
diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.inc
76
index XXXXXXX..XXXXXXX 100644
77
--- a/target/arm/translate-neon.c.inc
78
+++ b/target/arm/translate-neon.c.inc
79
@@ -XXX,XX +XXX,XX @@ static bool trans_VEXT(DisasContext *s, arg_VEXT *a)
80
81
static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
82
{
83
- int n;
84
- TCGv_i32 tmp, tmp2, tmp3, tmp4;
85
- TCGv_ptr ptr1;
86
+ TCGv_i64 val, def;
87
+ TCGv_i32 desc;
88
89
if (!arm_dc_feature(s, ARM_FEATURE_NEON)) {
90
return false;
91
@@ -XXX,XX +XXX,XX @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
92
return true;
93
}
94
95
- n = a->len + 1;
96
- if ((a->vn + n) > 32) {
97
+ if ((a->vn + a->len + 1) > 32) {
98
/*
99
* This is UNPREDICTABLE; we choose to UNDEF to avoid the
100
* helper function running off the end of the register file.
101
*/
102
return false;
103
}
104
- n <<= 3;
105
- tmp = tcg_temp_new_i32();
106
- if (a->op) {
107
- read_neon_element32(tmp, a->vd, 0, MO_32);
108
- } else {
109
- tcg_gen_movi_i32(tmp, 0);
110
- }
111
- tmp2 = tcg_temp_new_i32();
112
- read_neon_element32(tmp2, a->vm, 0, MO_32);
113
- ptr1 = vfp_reg_ptr(true, a->vn);
114
- tmp4 = tcg_const_i32(n);
115
- gen_helper_neon_tbl(tmp2, tmp2, tmp, ptr1, tmp4);
116
117
+ desc = tcg_const_i32((a->vn << 2) | a->len);
118
+ def = tcg_temp_new_i64();
119
if (a->op) {
120
- read_neon_element32(tmp, a->vd, 1, MO_32);
121
+ read_neon_element64(def, a->vd, 0, MO_64);
122
} else {
123
- tcg_gen_movi_i32(tmp, 0);
124
+ tcg_gen_movi_i64(def, 0);
125
}
126
- tmp3 = tcg_temp_new_i32();
127
- read_neon_element32(tmp3, a->vm, 1, MO_32);
128
- gen_helper_neon_tbl(tmp3, tmp3, tmp, ptr1, tmp4);
129
- tcg_temp_free_i32(tmp);
130
- tcg_temp_free_i32(tmp4);
131
- tcg_temp_free_ptr(ptr1);
132
+ val = tcg_temp_new_i64();
133
+ read_neon_element64(val, a->vm, 0, MO_64);
134
135
- write_neon_element32(tmp2, a->vd, 0, MO_32);
136
- write_neon_element32(tmp3, a->vd, 1, MO_32);
137
- tcg_temp_free_i32(tmp2);
138
- tcg_temp_free_i32(tmp3);
139
+ gen_helper_neon_tbl(val, cpu_env, desc, val, def);
140
+ write_neon_element64(val, a->vd, 0, MO_64);
57
+
141
+
58
+QEMU will launch but will silently wait for gdb to connect.
142
+ tcg_temp_free_i64(def);
59
143
+ tcg_temp_free_i64(val);
60
Then launch gdb on the 'vmlinux' executable::
144
+ tcg_temp_free_i32(desc);
61
145
return true;
62
diff --git a/qemu-options.hx b/qemu-options.hx
146
}
63
index XXXXXXX..XXXXXXX 100644
64
--- a/qemu-options.hx
65
+++ b/qemu-options.hx
66
@@ -XXX,XX +XXX,XX @@ SRST
67
ERST
68
69
DEF("gdb", HAS_ARG, QEMU_OPTION_gdb, \
70
- "-gdb dev wait for gdb connection on 'dev'\n", QEMU_ARCH_ALL)
71
+ "-gdb dev accept gdb connection on 'dev'. (QEMU defaults to starting\n"
72
+ " the guest without waiting for gdb to connect; use -S too\n"
73
+ " if you want it to not start execution.)\n",
74
+ QEMU_ARCH_ALL)
75
SRST
76
``-gdb dev``
77
- Wait for gdb connection on device dev (see
78
- :ref:`gdb_005fusage`). Typical connections will likely be
79
- TCP-based, but also UDP, pseudo TTY, or even stdio are reasonable
80
- use case. The latter is allowing to start QEMU from within gdb and
81
- establish the connection via a pipe:
82
+ Accept a gdb connection on device dev (see
83
+ :ref:`gdb_005fusage`). Note that this option does not pause QEMU
84
+ execution -- if you want QEMU to not start the guest until you
85
+ connect with gdb and issue a ``continue`` command, you will need to
86
+ also pass the ``-S`` option to QEMU.
87
+
88
+ The most usual configuration is to listen on a local TCP socket::
89
+
90
+ -gdb tcp::3117
91
+
92
+ but you can specify other backends; UDP, pseudo TTY, or even stdio
93
+ are all reasonable use cases. For example, a stdio connection
94
+ allows you to start QEMU from within gdb and establish the
95
+ connection via a pipe:
96
97
.. parsed-literal::
98
147
99
--
148
--
100
2.20.1
149
2.20.1
101
150
102
151
diff view generated by jsdifflib
New patch
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
1
2
3
We can use one MPC per SRAM bank, but we currently only wire the
4
IRQ from the first expansion MPC to the IRQ splitter. Fix that.
5
6
Fixes: bb75e16d5e6 ("hw/arm/iotkit: Wire up MPC interrupt lines")
7
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8
Message-id: 20201107193403.436146-2-f4bug@amsat.org
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
12
hw/arm/armsse.c | 3 ++-
13
1 file changed, 2 insertions(+), 1 deletion(-)
14
15
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/hw/arm/armsse.c
18
+++ b/hw/arm/armsse.c
19
@@ -XXX,XX +XXX,XX @@ static void armsse_realize(DeviceState *dev, Error **errp)
20
qdev_get_gpio_in(dev_splitter, 0));
21
qdev_connect_gpio_out(dev_splitter, 0,
22
qdev_get_gpio_in_named(dev_secctl,
23
- "mpc_status", 0));
24
+ "mpc_status",
25
+ i - IOTS_NUM_EXP_MPC));
26
}
27
28
qdev_connect_gpio_out(dev_splitter, 1,
29
--
30
2.20.1
31
32
diff view generated by jsdifflib
1
Versions of Sphinx older than 1.6 can't build all of our documentation,
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
because they are too picky about the syntax of the argument to the
3
option:: directive; see Sphinx bugs #646, #3366:
4
2
5
https://github.com/sphinx-doc/sphinx/issues/646
3
The system configuration controller (SYSCFG) doesn't have
6
https://github.com/sphinx-doc/sphinx/issues/3366
4
any output IRQ (and the INTC input #71 belongs to the UART6).
5
Remove the invalid code.
7
6
8
Trying to build with a 1.4.x Sphinx fails with
7
Fixes: db635521a02 ("stm32f205: Add the stm32f205 SoC")
9
docs/system/images.rst:4: SEVERE: Duplicate ID: "cmdoption-qcow2-arg-encrypt"
8
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
10
and a 1.5.x Sphinx fails with
9
Message-id: 20201107193403.436146-3-f4bug@amsat.org
11
docs/system/invocation.rst:544: WARNING: Malformed option description '[enable=]PATTERN', should look like "opt", "-opt
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
12
args", "--opt args", "/opt args" or "+opt args"
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
---
13
include/hw/misc/stm32f2xx_syscfg.h | 2 --
14
hw/arm/stm32f205_soc.c | 1 -
15
hw/misc/stm32f2xx_syscfg.c | 2 --
16
3 files changed, 5 deletions(-)
13
17
14
Update our needs_sphinx setting to indicate that we require at least
18
diff --git a/include/hw/misc/stm32f2xx_syscfg.h b/include/hw/misc/stm32f2xx_syscfg.h
15
1.6. This will allow configure to fall back to "don't build the
16
docs" rather than causing the build to fail entirely, which is
17
probably what most users building on a host old enough to have such
18
an old Sphinx would want; if they do want the docs then they'll have
19
a useful indication of what they need to do (upgrade Sphinx!) rather
20
than a confusing error message.
21
22
In theory our distro support policy would suggest that we should
23
support building on the Sphinx shipped in those distros, but:
24
* EPEL7 has Sphinx 1.2.3 (which we've never supported!)
25
* Debian Stretch has Sphinx 1.4.8
26
27
Trying to get our docs to work with Sphinx 1.4 is not tractable
28
for the 5.0 release and I'm not sure it's worthwhile effort anyway;
29
at least with this change the build as a whole now succeeds.
30
31
Thanks to John Snow for doing the investigation and testing to
32
confirm what Sphinx versions fail in what ways and what distros
33
shipped what.
34
35
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
36
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
37
---
38
docs/conf.py | 6 ++++--
39
1 file changed, 4 insertions(+), 2 deletions(-)
40
41
diff --git a/docs/conf.py b/docs/conf.py
42
index XXXXXXX..XXXXXXX 100644
19
index XXXXXXX..XXXXXXX 100644
43
--- a/docs/conf.py
20
--- a/include/hw/misc/stm32f2xx_syscfg.h
44
+++ b/docs/conf.py
21
+++ b/include/hw/misc/stm32f2xx_syscfg.h
45
@@ -XXX,XX +XXX,XX @@ sys.path.insert(0, os.path.join(qemu_docdir, "sphinx"))
22
@@ -XXX,XX +XXX,XX @@ struct STM32F2XXSyscfgState {
46
23
uint32_t syscfg_exticr3;
47
# If your documentation needs a minimal Sphinx version, state it here.
24
uint32_t syscfg_exticr4;
48
#
25
uint32_t syscfg_cmpcr;
49
-# 1.3 is where the 'alabaster' theme was shipped with Sphinx.
26
-
50
-needs_sphinx = '1.3'
27
- qemu_irq irq;
51
+# Sphinx 1.5 and earlier can't build our docs because they are too
28
};
52
+# picky about the syntax of the argument to the option:: directive
29
53
+# (see Sphinx bugs #646, #3366).
30
#endif /* HW_STM32F2XX_SYSCFG_H */
54
+needs_sphinx = '1.6'
31
diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c
55
32
index XXXXXXX..XXXXXXX 100644
56
# Add any Sphinx extension module names here, as strings. They can be
33
--- a/hw/arm/stm32f205_soc.c
57
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
34
+++ b/hw/arm/stm32f205_soc.c
35
@@ -XXX,XX +XXX,XX @@ static void stm32f205_soc_realize(DeviceState *dev_soc, Error **errp)
36
}
37
busdev = SYS_BUS_DEVICE(dev);
38
sysbus_mmio_map(busdev, 0, 0x40013800);
39
- sysbus_connect_irq(busdev, 0, qdev_get_gpio_in(armv7m, 71));
40
41
/* Attach UART (uses USART registers) and USART controllers */
42
for (i = 0; i < STM_NUM_USARTS; i++) {
43
diff --git a/hw/misc/stm32f2xx_syscfg.c b/hw/misc/stm32f2xx_syscfg.c
44
index XXXXXXX..XXXXXXX 100644
45
--- a/hw/misc/stm32f2xx_syscfg.c
46
+++ b/hw/misc/stm32f2xx_syscfg.c
47
@@ -XXX,XX +XXX,XX @@ static void stm32f2xx_syscfg_init(Object *obj)
48
{
49
STM32F2XXSyscfgState *s = STM32F2XX_SYSCFG(obj);
50
51
- sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq);
52
-
53
memory_region_init_io(&s->mmio, obj, &stm32f2xx_syscfg_ops, s,
54
TYPE_STM32F2XX_SYSCFG, 0x400);
55
sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mmio);
58
--
56
--
59
2.20.1
57
2.20.1
60
58
61
59
diff view generated by jsdifflib
1
If we are not making warnings fatal for compilation, make them
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
non-fatal when building the Sphinx documentation also. (For instance
3
Sphinx 3.0 warns about some constructs that older versions were happy
4
with, which is a build failure if we use the warnings-as-errors
5
flag.)
6
2
7
This provides a workaround at least for LP:1872113.
3
omap2420_mpu_init() introduced in commit 827df9f3c5f ("Add basic
4
OMAP2 chip support") takes care of creating the 3 UARTs.
8
5
6
Then commit 58a26b477e9 ("Emulate a serial bluetooth HCI with H4+
7
extensions and attach to n8x0's UART") added n8x0_uart_setup()
8
which create the UART and connects it to an IRQ output,
9
overwritting the existing peripheral and its IRQ connection.
10
This is incorrect.
11
12
Fortunately we don't need to fix this, because commit 6da68df7f9b
13
("hw/arm/nseries: Replace the bluetooth chardev with a "null"
14
chardev") removed the use of this peripheral. We can simply
15
remove the code.
16
17
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
18
Message-id: 20201107193403.436146-4-f4bug@amsat.org
19
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
20
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
11
Message-id: 20200411182934.28678-2-peter.maydell@linaro.org
12
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
13
---
21
---
14
configure | 9 ++++++++-
22
hw/arm/nseries.c | 11 -----------
15
Makefile | 2 +-
23
1 file changed, 11 deletions(-)
16
2 files changed, 9 insertions(+), 2 deletions(-)
17
24
18
diff --git a/configure b/configure
25
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
19
index XXXXXXX..XXXXXXX 100755
26
index XXXXXXX..XXXXXXX 100644
20
--- a/configure
27
--- a/hw/arm/nseries.c
21
+++ b/configure
28
+++ b/hw/arm/nseries.c
22
@@ -XXX,XX +XXX,XX @@ if check_include sys/kcov.h ; then
29
@@ -XXX,XX +XXX,XX @@ static void n8x0_cbus_setup(struct n800_s *s)
23
kcov=yes
30
cbus_attach(cbus, s->tahvo = tahvo_init(tahvo_irq, 1));
24
fi
25
26
+# If we're making warnings fatal, apply this to Sphinx runs as well
27
+sphinx_werror=""
28
+if test "$werror" = "yes"; then
29
+ sphinx_werror="-W"
30
+fi
31
+
32
# Check we have a new enough version of sphinx-build
33
has_sphinx_build() {
34
# This is a bit awkward but works: create a trivial document and
35
@@ -XXX,XX +XXX,XX @@ has_sphinx_build() {
36
# sphinx-build doesn't exist at all or if it is too old.
37
mkdir -p "$TMPDIR1/sphinx"
38
touch "$TMPDIR1/sphinx/index.rst"
39
- "$sphinx_build" -c "$source_path/docs" -b html "$TMPDIR1/sphinx" "$TMPDIR1/sphinx/out" >/dev/null 2>&1
40
+ "$sphinx_build" $sphinx_werror -c "$source_path/docs" -b html "$TMPDIR1/sphinx" "$TMPDIR1/sphinx/out" >/dev/null 2>&1
41
}
31
}
42
32
43
# Check if tools are available to build documentation.
33
-static void n8x0_uart_setup(struct n800_s *s)
44
@@ -XXX,XX +XXX,XX @@ echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak
34
-{
45
echo "INSTALL_LIB=$install -c -m 0644" >> $config_host_mak
35
- Chardev *radio = qemu_chr_new("bt-dummy-uart", "null", NULL);
46
echo "PYTHON=$python" >> $config_host_mak
36
- /*
47
echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak
37
- * Note: We used to connect N8X0_BT_RESET_GPIO and N8X0_BT_WKUP_GPIO
48
+echo "SPHINX_WERROR=$sphinx_werror" >> $config_host_mak
38
- * here, but this code has been removed with the bluetooth backend.
49
echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
39
- */
50
echo "CC=$cc" >> $config_host_mak
40
- omap_uart_attach(s->mpu->uart[BT_UART], radio);
51
if $iasl -h > /dev/null 2>&1; then
41
-}
52
diff --git a/Makefile b/Makefile
42
-
53
index XXXXXXX..XXXXXXX 100644
43
static void n8x0_usb_setup(struct n800_s *s)
54
--- a/Makefile
44
{
55
+++ b/Makefile
45
SysBusDevice *dev;
56
@@ -XXX,XX +XXX,XX @@ sphinxdocs: $(MANUAL_BUILDDIR)/devel/index.html \
46
@@ -XXX,XX +XXX,XX @@ static void n8x0_init(MachineState *machine,
57
# Note the use of different doctree for each (manual, builder) tuple;
47
n8x0_spi_setup(s);
58
# this works around Sphinx not handling parallel invocation on
48
n8x0_dss_setup(s);
59
# a single doctree: https://github.com/sphinx-doc/sphinx/issues/2946
49
n8x0_cbus_setup(s);
60
-build-manual = $(call quiet-command,CONFDIR="$(qemu_confdir)" $(SPHINX_BUILD) $(if $(V),,-q) -W -b $2 -D version=$(VERSION) -D release="$(FULL_VERSION)" -d .doctrees/$1-$2 $(SRC_PATH)/docs/$1 $(MANUAL_BUILDDIR)/$1 ,"SPHINX","$(MANUAL_BUILDDIR)/$1")
50
- n8x0_uart_setup(s);
61
+build-manual = $(call quiet-command,CONFDIR="$(qemu_confdir)" $(SPHINX_BUILD) $(if $(V),,-q) $(SPHINX_WERROR) -b $2 -D version=$(VERSION) -D release="$(FULL_VERSION)" -d .doctrees/$1-$2 $(SRC_PATH)/docs/$1 $(MANUAL_BUILDDIR)/$1 ,"SPHINX","$(MANUAL_BUILDDIR)/$1")
51
if (machine_usb(machine)) {
62
# We assume all RST files in the manual's directory are used in it
52
n8x0_usb_setup(s);
63
manual-deps = $(wildcard $(SRC_PATH)/docs/$1/*.rst $(SRC_PATH)/docs/$1/*/*.rst) \
53
}
64
$(SRC_PATH)/docs/defs.rst.inc \
65
--
54
--
66
2.20.1
55
2.20.1
67
56
68
57
diff view generated by jsdifflib
1
The kernel-doc Sphinx plugin and associated script currently emit
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
'c:type' directives for "struct foo" documentation.
3
2
4
Sphinx 3.0 warns about this:
3
The MusicPal board code connects both of the IRQ outputs of the UART
5
/home/petmay01/linaro/qemu-from-laptop/qemu/docs/../include/exec/memory.h:3: WARNING: Type must be either just a name or a typedef-like declaration.
4
to the same INTC qemu_irq. Connecting two qemu_irqs outputs directly
6
If just a name:
5
to the same input is not valid as it produces subtly wrong behaviour
7
Error in declarator or parameters
6
(for instance if both the IRQ lines are high, and then one goes
8
Invalid C declaration: Expected identifier in nested name, got keyword: struct [error at 6]
7
low, the INTC input will see this as a high-to-low transition
9
struct MemoryListener
8
even though the second IRQ line should still be holding it high).
10
------^
11
If typedef-like declaration:
12
Error in declarator or parameters
13
Invalid C declaration: Expected identifier in nested name. [error at 21]
14
struct MemoryListener
15
---------------------^
16
9
17
because it wants us to use the new-in-3.0 'c:struct' instead.
10
This kind of wiring needs an explicitly created OR gate; add one.
18
11
19
Plumb the Sphinx version through to the kernel-doc script
12
Inspired-by: Peter Maydell <peter.maydell@linaro.org>
20
and use it to select 'c:struct' for newer versions than 3.0.
13
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
14
Message-id: 20201107193403.436146-5-f4bug@amsat.org
15
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
16
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
17
---
18
hw/arm/musicpal.c | 17 +++++++++++++----
19
hw/arm/Kconfig | 1 +
20
2 files changed, 14 insertions(+), 4 deletions(-)
21
21
22
Fixes: LP:1872113
22
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
23
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
24
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
25
---
26
docs/sphinx/kerneldoc.py | 1 +
27
scripts/kernel-doc | 16 +++++++++++++++-
28
2 files changed, 16 insertions(+), 1 deletion(-)
29
30
diff --git a/docs/sphinx/kerneldoc.py b/docs/sphinx/kerneldoc.py
31
index XXXXXXX..XXXXXXX 100644
23
index XXXXXXX..XXXXXXX 100644
32
--- a/docs/sphinx/kerneldoc.py
24
--- a/hw/arm/musicpal.c
33
+++ b/docs/sphinx/kerneldoc.py
25
+++ b/hw/arm/musicpal.c
34
@@ -XXX,XX +XXX,XX @@ class KernelDocDirective(Directive):
26
@@ -XXX,XX +XXX,XX @@
35
env.note_dependency(os.path.abspath(f))
27
#include "ui/console.h"
36
cmd += ['-export-file', f]
28
#include "hw/i2c/i2c.h"
37
29
#include "hw/irq.h"
38
+ cmd += ['-sphinx-version', sphinx.__version__]
30
+#include "hw/or-irq.h"
39
cmd += [filename]
31
#include "hw/audio/wm8750.h"
40
32
#include "sysemu/block-backend.h"
41
try:
33
#include "sysemu/runstate.h"
42
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
34
@@ -XXX,XX +XXX,XX @@
43
index XXXXXXX..XXXXXXX 100755
35
#define MP_TIMER4_IRQ 7
44
--- a/scripts/kernel-doc
36
#define MP_EHCI_IRQ 8
45
+++ b/scripts/kernel-doc
37
#define MP_ETH_IRQ 9
46
@@ -XXX,XX +XXX,XX @@ Output selection (mutually exclusive):
38
-#define MP_UART1_IRQ 11
47
            DOC: sections. May be specified multiple times.
39
-#define MP_UART2_IRQ 11
48
40
+#define MP_UART_SHARED_IRQ 11
49
Output selection modifiers:
41
#define MP_GPIO_IRQ 12
50
+ -sphinx-version VER Generate rST syntax for the specified Sphinx version.
42
#define MP_RTC_IRQ 28
51
+ Only works with reStructuredTextFormat.
43
#define MP_AUDIO_IRQ 30
52
-no-doc-sections    Do not output DOC: sections.
44
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
53
-enable-lineno Enable output of #define LINENO lines. Only works with
45
ARMCPU *cpu;
54
reStructuredText format.
46
qemu_irq pic[32];
55
@@ -XXX,XX +XXX,XX @@ use constant {
47
DeviceState *dev;
56
};
48
+ DeviceState *uart_orgate;
57
my $output_selection = OUTPUT_ALL;
49
DeviceState *i2c_dev;
58
my $show_not_found = 0;    # No longer used
50
DeviceState *lcd_dev;
59
+my $sphinx_version = "0.0"; # if not specified, assume old
51
DeviceState *key_dev;
60
52
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
61
my @export_file_list;
53
pic[MP_TIMER2_IRQ], pic[MP_TIMER3_IRQ],
62
54
pic[MP_TIMER4_IRQ], NULL);
63
@@ -XXX,XX +XXX,XX @@ while ($ARGV[0] =~ m/^--?(.*)/) {
55
64
     $enable_lineno = 1;
56
- serial_mm_init(address_space_mem, MP_UART1_BASE, 2, pic[MP_UART1_IRQ],
65
} elsif ($cmd eq 'show-not-found') {
57
+ /* Logically OR both UART IRQs together */
66
    $show_not_found = 1; # A no-op but don't fail
58
+ uart_orgate = DEVICE(object_new(TYPE_OR_IRQ));
67
+ } elsif ($cmd eq 'sphinx-version') {
59
+ object_property_set_int(OBJECT(uart_orgate), "num-lines", 2, &error_fatal);
68
+ $sphinx_version = shift @ARGV;
60
+ qdev_realize_and_unref(uart_orgate, NULL, &error_fatal);
69
} else {
61
+ qdev_connect_gpio_out(DEVICE(uart_orgate), 0, pic[MP_UART_SHARED_IRQ]);
70
    # Unknown argument
62
+
71
usage();
63
+ serial_mm_init(address_space_mem, MP_UART1_BASE, 2,
72
@@ -XXX,XX +XXX,XX @@ sub output_struct_rst(%) {
64
+ qdev_get_gpio_in(uart_orgate, 0),
73
my $oldprefix = $lineprefix;
65
1825000, serial_hd(0), DEVICE_NATIVE_ENDIAN);
74
my $name = $args{'type'} . " " . $args{'struct'};
66
- serial_mm_init(address_space_mem, MP_UART2_BASE, 2, pic[MP_UART2_IRQ],
75
67
+ serial_mm_init(address_space_mem, MP_UART2_BASE, 2,
76
- print "\n\n.. c:type:: " . $name . "\n\n";
68
+ qdev_get_gpio_in(uart_orgate, 1),
77
+ # Sphinx 3.0 and up will emit warnings for "c:type:: struct Foo".
69
1825000, serial_hd(1), DEVICE_NATIVE_ENDIAN);
78
+ # It wants to see "c:struct:: Foo" (and will add the word 'struct' in
70
79
+ # the rendered output).
71
/* Register flash */
80
+ if ((split(/\./, $sphinx_version))[0] >= 3) {
72
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
81
+ my $sname = $name;
73
index XXXXXXX..XXXXXXX 100644
82
+ $sname =~ s/^struct //;
74
--- a/hw/arm/Kconfig
83
+ print "\n\n.. c:struct:: " . $sname . "\n\n";
75
+++ b/hw/arm/Kconfig
84
+ } else {
76
@@ -XXX,XX +XXX,XX @@ config MUSCA
85
+ print "\n\n.. c:type:: " . $name . "\n\n";
77
86
+ }
78
config MUSICPAL
87
print_lineno($declaration_start_line);
79
bool
88
$lineprefix = " ";
80
+ select OR_IRQ
89
output_highlight_rst($args{'purpose'});
81
select BITBANG_I2C
82
select MARVELL_88W8618
83
select PTIMER
90
--
84
--
91
2.20.1
85
2.20.1
92
86
93
87
diff view generated by jsdifflib
1
Add a new script to automate the process of running the Coverity
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
Scan build tools and uploading the resulting tarball to the
3
website.
4
2
5
This is intended eventually to be driven from Travis,
3
We don't need to fill the full pic[] array if we only use
6
but it can be run locally, if you are a maintainer of the
4
few of the interrupt lines. Directly call qdev_get_gpio_in()
7
QEMU project on the Coverity Scan website and have the secret
5
when necessary.
8
upload token.
9
6
10
The script must be run on a Fedora 30 system. Support for using a
7
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
11
Docker container is added in a following commit.
8
Message-id: 20201107193403.436146-6-f4bug@amsat.org
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
12
hw/arm/musicpal.c | 25 +++++++++++++------------
13
1 file changed, 13 insertions(+), 12 deletions(-)
12
14
13
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
15
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
15
Message-id: 20200319193323.2038-6-peter.maydell@linaro.org
16
---
17
MAINTAINERS | 5 +
18
scripts/coverity-scan/run-coverity-scan | 311 ++++++++++++++++++++++++
19
2 files changed, 316 insertions(+)
20
create mode 100755 scripts/coverity-scan/run-coverity-scan
21
22
diff --git a/MAINTAINERS b/MAINTAINERS
23
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
24
--- a/MAINTAINERS
17
--- a/hw/arm/musicpal.c
25
+++ b/MAINTAINERS
18
+++ b/hw/arm/musicpal.c
26
@@ -XXX,XX +XXX,XX @@ M: Markus Armbruster <armbru@redhat.com>
19
@@ -XXX,XX +XXX,XX @@ static struct arm_boot_info musicpal_binfo = {
27
S: Supported
20
static void musicpal_init(MachineState *machine)
28
F: scripts/coverity-model.c
21
{
29
22
ARMCPU *cpu;
30
+Coverity Scan integration
23
- qemu_irq pic[32];
31
+M: Peter Maydell <peter.maydell@linaro.org>
24
DeviceState *dev;
32
+S: Maintained
25
+ DeviceState *pic;
33
+F: scripts/coverity-scan/
26
DeviceState *uart_orgate;
34
+
27
DeviceState *i2c_dev;
35
Device Tree
28
DeviceState *lcd_dev;
36
M: Alistair Francis <alistair.francis@wdc.com>
29
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
37
R: David Gibson <david@gibson.dropbear.id.au>
30
&error_fatal);
38
diff --git a/scripts/coverity-scan/run-coverity-scan b/scripts/coverity-scan/run-coverity-scan
31
memory_region_add_subregion(address_space_mem, MP_SRAM_BASE, sram);
39
new file mode 100755
32
40
index XXXXXXX..XXXXXXX
33
- dev = sysbus_create_simple(TYPE_MV88W8618_PIC, MP_PIC_BASE,
41
--- /dev/null
34
+ pic = sysbus_create_simple(TYPE_MV88W8618_PIC, MP_PIC_BASE,
42
+++ b/scripts/coverity-scan/run-coverity-scan
35
qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_IRQ));
43
@@ -XXX,XX +XXX,XX @@
36
- for (i = 0; i < 32; i++) {
44
+#!/bin/sh -e
37
- pic[i] = qdev_get_gpio_in(dev, i);
45
+
38
- }
46
+# Upload a created tarball to Coverity Scan, as per
39
- sysbus_create_varargs(TYPE_MV88W8618_PIT, MP_PIT_BASE, pic[MP_TIMER1_IRQ],
47
+# https://scan.coverity.com/projects/qemu/builds/new
40
- pic[MP_TIMER2_IRQ], pic[MP_TIMER3_IRQ],
48
+
41
- pic[MP_TIMER4_IRQ], NULL);
49
+# This work is licensed under the terms of the GNU GPL version 2,
42
+ sysbus_create_varargs(TYPE_MV88W8618_PIT, MP_PIT_BASE,
50
+# or (at your option) any later version.
43
+ qdev_get_gpio_in(pic, MP_TIMER1_IRQ),
51
+# See the COPYING file in the top-level directory.
44
+ qdev_get_gpio_in(pic, MP_TIMER2_IRQ),
52
+#
45
+ qdev_get_gpio_in(pic, MP_TIMER3_IRQ),
53
+# Copyright (c) 2017-2020 Linaro Limited
46
+ qdev_get_gpio_in(pic, MP_TIMER4_IRQ), NULL);
54
+# Written by Peter Maydell
47
55
+
48
/* Logically OR both UART IRQs together */
56
+# Note that this script will automatically download and
49
uart_orgate = DEVICE(object_new(TYPE_OR_IRQ));
57
+# run the (closed-source) coverity build tools, so don't
50
object_property_set_int(OBJECT(uart_orgate), "num-lines", 2, &error_fatal);
58
+# use it if you don't trust them!
51
qdev_realize_and_unref(uart_orgate, NULL, &error_fatal);
59
+
52
- qdev_connect_gpio_out(DEVICE(uart_orgate), 0, pic[MP_UART_SHARED_IRQ]);
60
+# This script assumes that you're running it from a QEMU source
53
+ qdev_connect_gpio_out(DEVICE(uart_orgate), 0,
61
+# tree, and that tree is a fresh clean one, because we do an in-tree
54
+ qdev_get_gpio_in(pic, MP_UART_SHARED_IRQ));
62
+# build. (This is necessary so that the filenames that the Coverity
55
63
+# Scan server sees are relative paths that match up with the component
56
serial_mm_init(address_space_mem, MP_UART1_BASE, 2,
64
+# regular expressions it uses; an out-of-tree build won't work for this.)
57
qdev_get_gpio_in(uart_orgate, 0),
65
+# The host machine should have as many of QEMU's dependencies
58
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
66
+# installed as possible, for maximum coverity coverage.
59
OBJECT(get_system_memory()), &error_fatal);
67
+
60
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
68
+# To do an upload you need to be a maintainer in the Coverity online
61
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, MP_ETH_BASE);
69
+# service, and you will need to know the "Coverity token", which is a
62
- sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[MP_ETH_IRQ]);
70
+# secret 8 digit hex string. You can find that from the web UI in the
63
+ sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0,
71
+# project settings, if you have maintainer access there.
64
+ qdev_get_gpio_in(pic, MP_ETH_IRQ));
72
+
65
73
+# Command line options:
66
sysbus_create_simple("mv88w8618_wlan", MP_WLAN_BASE, NULL);
74
+# --dry-run : run the tools, but don't actually do the upload
67
75
+# --update-tools-only : update the cached copy of the tools, but don't run them
68
sysbus_create_simple(TYPE_MUSICPAL_MISC, MP_MISC_BASE, NULL);
76
+# --tokenfile : file to read Coverity token from
69
77
+# --version ver : specify version being analyzed (default: ask git)
70
dev = sysbus_create_simple(TYPE_MUSICPAL_GPIO, MP_GPIO_BASE,
78
+# --description desc : specify description of this version (default: ask git)
71
- pic[MP_GPIO_IRQ]);
79
+# --srcdir : QEMU source tree to analyze (default: current working dir)
72
+ qdev_get_gpio_in(pic, MP_GPIO_IRQ));
80
+# --results-tarball : path to copy the results tarball to (default: don't
73
i2c_dev = sysbus_create_simple("gpio_i2c", -1, NULL);
81
+# copy it anywhere, just upload it)
74
i2c = (I2CBus *)qdev_get_child_bus(i2c_dev, "i2c");
82
+#
75
83
+# User-specifiable environment variables:
76
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
84
+# COVERITY_TOKEN -- Coverity token
77
NULL);
85
+# COVERITY_EMAIL -- the email address to use for uploads (default:
78
sysbus_realize_and_unref(s, &error_fatal);
86
+# looks at your git user.email config)
79
sysbus_mmio_map(s, 0, MP_AUDIO_BASE);
87
+# COVERITY_BUILD_CMD -- make command (default: 'make -jN' where N is
80
- sysbus_connect_irq(s, 0, pic[MP_AUDIO_IRQ]);
88
+# number of CPUs as determined by 'nproc')
81
+ sysbus_connect_irq(s, 0, qdev_get_gpio_in(pic, MP_AUDIO_IRQ));
89
+# COVERITY_TOOL_BASE -- set to directory to put coverity tools
82
90
+# (default: /tmp/coverity-tools)
83
musicpal_binfo.ram_size = MP_RAM_DEFAULT_SIZE;
91
+#
84
arm_load_kernel(cpu, machine, &musicpal_binfo);
92
+# You must specify the token, either by environment variable or by
93
+# putting it in a file and using --tokenfile. Everything else has
94
+# a reasonable default if this is run from a git tree.
95
+
96
+check_upload_permissions() {
97
+ # Check whether we can do an upload to the server; will exit the script
98
+ # with status 1 if the check failed (usually a bad token);
99
+ # will exit the script with status 0 if the check indicated that we
100
+ # can't upload yet (ie we are at quota)
101
+ # Assumes that PROJTOKEN, PROJNAME and DRYRUN have been initialized.
102
+
103
+ echo "Checking upload permissions..."
104
+
105
+ if ! up_perm="$(wget https://scan.coverity.com/api/upload_permitted --post-data "token=$PROJTOKEN&project=$PROJNAME" -q -O -)"; then
106
+ echo "Coverity Scan API access denied: bad token?"
107
+ exit 1
108
+ fi
109
+
110
+ # Really up_perm is a JSON response with either
111
+ # {upload_permitted:true} or {next_upload_permitted_at:<date>}
112
+ # We do some hacky string parsing instead of properly parsing it.
113
+ case "$up_perm" in
114
+ *upload_permitted*true*)
115
+ echo "Coverity Scan: upload permitted"
116
+ ;;
117
+ *next_upload_permitted_at*)
118
+ if [ "$DRYRUN" = yes ]; then
119
+ echo "Coverity Scan: upload quota reached, continuing dry run"
120
+ else
121
+ echo "Coverity Scan: upload quota reached; stopping here"
122
+ # Exit success as this isn't a build error.
123
+ exit 0
124
+ fi
125
+ ;;
126
+ *)
127
+ echo "Coverity Scan upload check: unexpected result $up_perm"
128
+ exit 1
129
+ ;;
130
+ esac
131
+}
132
+
133
+
134
+update_coverity_tools () {
135
+ # Check for whether we need to download the Coverity tools
136
+ # (either because we don't have a copy, or because it's out of date)
137
+ # Assumes that COVERITY_TOOL_BASE, PROJTOKEN and PROJNAME are set.
138
+
139
+ mkdir -p "$COVERITY_TOOL_BASE"
140
+ cd "$COVERITY_TOOL_BASE"
141
+
142
+ echo "Checking for new version of coverity build tools..."
143
+ wget https://scan.coverity.com/download/linux64 --post-data "token=$PROJTOKEN&project=$PROJNAME&md5=1" -O coverity_tool.md5.new
144
+
145
+ if ! cmp -s coverity_tool.md5 coverity_tool.md5.new; then
146
+ # out of date md5 or no md5: download new build tool
147
+ # blow away the old build tool
148
+ echo "Downloading coverity build tools..."
149
+ rm -rf coverity_tool coverity_tool.tgz
150
+ wget https://scan.coverity.com/download/linux64 --post-data "token=$PROJTOKEN&project=$PROJNAME" -O coverity_tool.tgz
151
+ if ! (cat coverity_tool.md5.new; echo " coverity_tool.tgz") | md5sum -c --status; then
152
+ echo "Downloaded tarball didn't match md5sum!"
153
+ exit 1
154
+ fi
155
+ # extract the new one, keeping it corralled in a 'coverity_tool' directory
156
+ echo "Unpacking coverity build tools..."
157
+ mkdir -p coverity_tool
158
+ cd coverity_tool
159
+ tar xf ../coverity_tool.tgz
160
+ cd ..
161
+ mv coverity_tool.md5.new coverity_tool.md5
162
+ fi
163
+
164
+ rm -f coverity_tool.md5.new
165
+}
166
+
167
+
168
+# Check user-provided environment variables and arguments
169
+DRYRUN=no
170
+UPDATE_ONLY=no
171
+
172
+while [ "$#" -ge 1 ]; do
173
+ case "$1" in
174
+ --dry-run)
175
+ shift
176
+ DRYRUN=yes
177
+ ;;
178
+ --update-tools-only)
179
+ shift
180
+ UPDATE_ONLY=yes
181
+ ;;
182
+ --version)
183
+ shift
184
+ if [ $# -eq 0 ]; then
185
+ echo "--version needs an argument"
186
+ exit 1
187
+ fi
188
+ VERSION="$1"
189
+ shift
190
+ ;;
191
+ --description)
192
+ shift
193
+ if [ $# -eq 0 ]; then
194
+ echo "--description needs an argument"
195
+ exit 1
196
+ fi
197
+ DESCRIPTION="$1"
198
+ shift
199
+ ;;
200
+ --tokenfile)
201
+ shift
202
+ if [ $# -eq 0 ]; then
203
+ echo "--tokenfile needs an argument"
204
+ exit 1
205
+ fi
206
+ COVERITY_TOKEN="$(cat "$1")"
207
+ shift
208
+ ;;
209
+ --srcdir)
210
+ shift
211
+ if [ $# -eq 0 ]; then
212
+ echo "--srcdir needs an argument"
213
+ exit 1
214
+ fi
215
+ SRCDIR="$1"
216
+ shift
217
+ ;;
218
+ --results-tarball)
219
+ shift
220
+ if [ $# -eq 0 ]; then
221
+ echo "--results-tarball needs an argument"
222
+ exit 1
223
+ fi
224
+ RESULTSTARBALL="$1"
225
+ shift
226
+ ;;
227
+ *)
228
+ echo "Unexpected argument '$1'"
229
+ exit 1
230
+ ;;
231
+ esac
232
+done
233
+
234
+if [ -z "$COVERITY_TOKEN" ]; then
235
+ echo "COVERITY_TOKEN environment variable not set"
236
+ exit 1
237
+fi
238
+
239
+if [ -z "$COVERITY_BUILD_CMD" ]; then
240
+ NPROC=$(nproc)
241
+ COVERITY_BUILD_CMD="make -j$NPROC"
242
+ echo "COVERITY_BUILD_CMD: using default '$COVERITY_BUILD_CMD'"
243
+fi
244
+
245
+if [ -z "$COVERITY_TOOL_BASE" ]; then
246
+ echo "COVERITY_TOOL_BASE: using default /tmp/coverity-tools"
247
+ COVERITY_TOOL_BASE=/tmp/coverity-tools
248
+fi
249
+
250
+if [ -z "$SRCDIR" ]; then
251
+ SRCDIR="$PWD"
252
+fi
253
+
254
+PROJTOKEN="$COVERITY_TOKEN"
255
+PROJNAME=QEMU
256
+TARBALL=cov-int.tar.xz
257
+
258
+
259
+if [ "$UPDATE_ONLY" = yes ]; then
260
+ # Just do the tools update; we don't need to check whether
261
+ # we are in a source tree or have upload rights for this,
262
+ # so do it before some of the command line and source tree checks.
263
+ update_coverity_tools
264
+ exit 0
265
+fi
266
+
267
+cd "$SRCDIR"
268
+
269
+echo "Checking this is a QEMU source tree..."
270
+if ! [ -e "$SRCDIR/VERSION" ]; then
271
+ echo "Not in a QEMU source tree?"
272
+ exit 1
273
+fi
274
+
275
+# Fill in defaults used by the non-update-only process
276
+if [ -z "$VERSION" ]; then
277
+ VERSION="$(git describe --always HEAD)"
278
+fi
279
+
280
+if [ -z "$DESCRIPTION" ]; then
281
+ DESCRIPTION="$(git rev-parse HEAD)"
282
+fi
283
+
284
+if [ -z "$COVERITY_EMAIL" ]; then
285
+ COVERITY_EMAIL="$(git config user.email)"
286
+fi
287
+
288
+check_upload_permissions
289
+
290
+update_coverity_tools
291
+
292
+TOOLBIN="$(cd "$COVERITY_TOOL_BASE" && echo $PWD/coverity_tool/cov-analysis-*/bin)"
293
+
294
+if ! test -x "$TOOLBIN/cov-build"; then
295
+ echo "Couldn't find cov-build in the coverity build-tool directory??"
296
+ exit 1
297
+fi
298
+
299
+export PATH="$TOOLBIN:$PATH"
300
+
301
+cd "$SRCDIR"
302
+
303
+echo "Doing make distclean..."
304
+make distclean
305
+
306
+echo "Configuring..."
307
+# We configure with a fixed set of enables here to ensure that we don't
308
+# accidentally reduce the scope of the analysis by doing the build on
309
+# the system that's missing a dependency that we need to build part of
310
+# the codebase.
311
+./configure --disable-modules --enable-sdl --enable-gtk \
312
+ --enable-opengl --enable-vte --enable-gnutls \
313
+ --enable-nettle --enable-curses --enable-curl \
314
+ --audio-drv-list=oss,alsa,sdl,pa --enable-virtfs \
315
+ --enable-vnc --enable-vnc-sasl --enable-vnc-jpeg --enable-vnc-png \
316
+ --enable-xen --enable-brlapi \
317
+ --enable-linux-aio --enable-attr \
318
+ --enable-cap-ng --enable-trace-backends=log --enable-spice --enable-rbd \
319
+ --enable-xfsctl --enable-libusb --enable-usb-redir \
320
+ --enable-libiscsi --enable-libnfs --enable-seccomp \
321
+ --enable-tpm --enable-libssh --enable-lzo --enable-snappy --enable-bzip2 \
322
+ --enable-numa --enable-rdma --enable-smartcard --enable-virglrenderer \
323
+ --enable-mpath --enable-libxml2 --enable-glusterfs \
324
+ --enable-virtfs --enable-zstd
325
+
326
+echo "Making libqemustub.a..."
327
+make libqemustub.a
328
+
329
+echo "Running cov-build..."
330
+rm -rf cov-int
331
+mkdir cov-int
332
+cov-build --dir cov-int $COVERITY_BUILD_CMD
333
+
334
+echo "Creating results tarball..."
335
+tar cvf - cov-int | xz > "$TARBALL"
336
+
337
+if [ ! -z "$RESULTSTARBALL" ]; then
338
+ echo "Copying results tarball to $RESULTSTARBALL..."
339
+ cp "$TARBALL" "$RESULTSTARBALL"
340
+fi
341
+
342
+echo "Uploading results tarball..."
343
+
344
+if [ "$DRYRUN" = yes ]; then
345
+ echo "Dry run only, not uploading $TARBALL"
346
+ exit 0
347
+fi
348
+
349
+curl --form token="$PROJTOKEN" --form email="$COVERITY_EMAIL" \
350
+ --form file=@"$TARBALL" --form version="$VERSION" \
351
+ --form description="$DESCRIPTION" \
352
+ https://scan.coverity.com/builds?project="$PROJNAME"
353
+
354
+echo "Done."
355
--
85
--
356
2.20.1
86
2.20.1
357
87
358
88
diff view generated by jsdifflib
1
In commit a1a98357e3fd in 2018 we added some workarounds for Coverity
1
The nseries machines have a codepath that allows them to load a
2
not being able to handle the _Float* types introduced by recent
2
secondary bootloader. This code wasn't checking that the
3
glibc. Newer versions of the Coverity scan tools have support for
3
load_image_targphys() succeeded. Check the return value and report
4
these types, and will fail with errors about duplicate typedefs if we
4
the error to the user.
5
have our workaround. Remove our copy of the typedefs.
6
5
6
While we're in the vicinity, fix the comment style of the
7
comment documenting what this image load is doing.
8
9
Fixes: Coverity CID 1192904
7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
11
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
9
Message-id: 20200319193323.2038-2-peter.maydell@linaro.org
12
Message-id: 20201103114918.11807-1-peter.maydell@linaro.org
10
---
13
---
11
include/qemu/osdep.h | 14 --------------
14
hw/arm/nseries.c | 15 +++++++++++----
12
1 file changed, 14 deletions(-)
15
1 file changed, 11 insertions(+), 4 deletions(-)
13
16
14
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
17
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
15
index XXXXXXX..XXXXXXX 100644
18
index XXXXXXX..XXXXXXX 100644
16
--- a/include/qemu/osdep.h
19
--- a/hw/arm/nseries.c
17
+++ b/include/qemu/osdep.h
20
+++ b/hw/arm/nseries.c
18
@@ -XXX,XX +XXX,XX @@
21
@@ -XXX,XX +XXX,XX @@ static void n8x0_init(MachineState *machine,
19
#else
22
/* No, wait, better start at the ROM. */
20
#include "exec/poison.h"
23
s->mpu->cpu->env.regs[15] = OMAP2_Q2_BASE + 0x400000;
21
#endif
24
22
-#ifdef __COVERITY__
25
- /* This is intended for loading the `secondary.bin' program from
23
-/* Coverity does not like the new _Float* types that are used by
26
+ /*
24
- * recent glibc, and croaks on every single file that includes
27
+ * This is intended for loading the `secondary.bin' program from
25
- * stdlib.h. These typedefs are enough to please it.
28
* Nokia images (the NOLO bootloader). The entry point seems
26
- *
29
* to be at OMAP2_Q2_BASE + 0x400000.
27
- * Note that these fix parse errors so they cannot be placed in
30
*
28
- * scripts/coverity-model.c.
31
@@ -XXX,XX +XXX,XX @@ static void n8x0_init(MachineState *machine,
29
- */
32
* for them the entry point needs to be set to OMAP2_SRAM_BASE.
30
-typedef float _Float32;
33
*
31
-typedef double _Float32x;
34
* The code above is for loading the `zImage' file from Nokia
32
-typedef double _Float64;
35
- * images. */
33
-typedef __float80 _Float64x;
36
- load_image_targphys(option_rom[0].name, OMAP2_Q2_BASE + 0x400000,
34
-typedef __float128 _Float128;
37
- machine->ram_size - 0x400000);
35
-#endif
38
+ * images.
36
39
+ */
37
#include "qemu/compiler.h"
40
+ if (load_image_targphys(option_rom[0].name,
38
41
+ OMAP2_Q2_BASE + 0x400000,
42
+ machine->ram_size - 0x400000) < 0) {
43
+ error_report("Failed to load secondary bootloader %s",
44
+ option_rom[0].name);
45
+ exit(EXIT_FAILURE);
46
+ }
47
48
n800_setup_nolo_tags(nolo_tags);
49
cpu_physical_memory_write(OMAP2_SRAM_BASE, nolo_tags, 0x10000);
39
--
50
--
40
2.20.1
51
2.20.1
41
52
42
53
diff view generated by jsdifflib
1
The target_flat.h file is a QEMU header, so we should include it using
1
From: Havard Skinnemoen <hskinnemoen@google.com>
2
quotes, not angle brackets.
3
2
4
Coverity otherwise is unable to find the header:
3
The number of runs is equal to the number of 0-1 and 1-0 transitions,
4
plus one. Currently, it's counting the number of times these transitions
5
do _not_ happen, plus one.
5
6
6
"../linux-user/flatload.c", line 40: error #1712: cannot open source file
7
Source:
7
"target_flat.h"
8
https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-22r1a.pdf
8
#include <target_flat.h>
9
section 2.3.4 point (3).
9
^
10
10
11
because the relevant directory is only on the -iquote path, not the -I path.
11
Signed-off-by: Havard Skinnemoen <hskinnemoen@google.com>
12
12
Message-id: 20201103011457.2959989-2-hskinnemoen@google.com
13
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
15
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
16
Message-id: 20200319193323.2038-5-peter.maydell@linaro.org
17
---
15
---
18
linux-user/flatload.c | 2 +-
16
tests/qtest/npcm7xx_rng-test.c | 2 +-
19
1 file changed, 1 insertion(+), 1 deletion(-)
17
1 file changed, 1 insertion(+), 1 deletion(-)
20
18
21
diff --git a/linux-user/flatload.c b/linux-user/flatload.c
19
diff --git a/tests/qtest/npcm7xx_rng-test.c b/tests/qtest/npcm7xx_rng-test.c
22
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
23
--- a/linux-user/flatload.c
21
--- a/tests/qtest/npcm7xx_rng-test.c
24
+++ b/linux-user/flatload.c
22
+++ b/tests/qtest/npcm7xx_rng-test.c
25
@@ -XXX,XX +XXX,XX @@
23
@@ -XXX,XX +XXX,XX @@ static double calc_runs_p(const unsigned long *buf, unsigned int nr_bits)
26
24
pi = (double)nr_ones / nr_bits;
27
#include "qemu.h"
25
28
#include "flat.h"
26
for (k = 0; k < nr_bits - 1; k++) {
29
-#include <target_flat.h>
27
- vn_obs += !(test_bit(k, buf) ^ test_bit(k + 1, buf));
30
+#include "target_flat.h"
28
+ vn_obs += (test_bit(k, buf) ^ test_bit(k + 1, buf));
31
29
}
32
//#define DEBUG
30
vn_obs += 1;
33
31
34
--
32
--
35
2.20.1
33
2.20.1
36
34
37
35
diff view generated by jsdifflib
1
All the Coverity-specific definitions of qemu_mutex_lock() and friends
1
Checks for UNDEF cases should go before the "is VFP enabled?" access
2
have a trailing semicolon. This works fine almost everywhere because
2
check, except in special cases. Move a stray UNDEF check in the VTBL
3
of QEMU's mandatory-braces coding style and because most callsites are
3
trans function up above the access check.
4
simple, but target/s390x/sigp.c has a use of qemu_mutex_trylock() as
5
an if() statement, which makes the ';' a syntax error:
6
"../target/s390x/sigp.c", line 461: warning #18: expected a ")"
7
if (qemu_mutex_trylock(&qemu_sigp_mutex)) {
8
^
9
10
Remove the bogus semicolons from the macro definitions.
11
4
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
14
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
7
Message-id: 20201109145324.2859-1-peter.maydell@linaro.org
15
Message-id: 20200319193323.2038-4-peter.maydell@linaro.org
16
---
8
---
17
include/qemu/thread.h | 12 ++++++------
9
target/arm/translate-neon.c.inc | 8 ++++----
18
1 file changed, 6 insertions(+), 6 deletions(-)
10
1 file changed, 4 insertions(+), 4 deletions(-)
19
11
20
diff --git a/include/qemu/thread.h b/include/qemu/thread.h
12
diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.inc
21
index XXXXXXX..XXXXXXX 100644
13
index XXXXXXX..XXXXXXX 100644
22
--- a/include/qemu/thread.h
14
--- a/target/arm/translate-neon.c.inc
23
+++ b/include/qemu/thread.h
15
+++ b/target/arm/translate-neon.c.inc
24
@@ -XXX,XX +XXX,XX @@ extern QemuCondTimedWaitFunc qemu_cond_timedwait_func;
16
@@ -XXX,XX +XXX,XX @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
25
* hide them.
17
return false;
26
*/
18
}
27
#define qemu_mutex_lock(m) \
19
28
- qemu_mutex_lock_impl(m, __FILE__, __LINE__);
20
- if (!vfp_access_check(s)) {
29
+ qemu_mutex_lock_impl(m, __FILE__, __LINE__)
21
- return true;
30
#define qemu_mutex_trylock(m) \
22
- }
31
- qemu_mutex_trylock_impl(m, __FILE__, __LINE__);
23
-
32
+ qemu_mutex_trylock_impl(m, __FILE__, __LINE__)
24
if ((a->vn + a->len + 1) > 32) {
33
#define qemu_rec_mutex_lock(m) \
25
/*
34
- qemu_rec_mutex_lock_impl(m, __FILE__, __LINE__);
26
* This is UNPREDICTABLE; we choose to UNDEF to avoid the
35
+ qemu_rec_mutex_lock_impl(m, __FILE__, __LINE__)
27
@@ -XXX,XX +XXX,XX @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
36
#define qemu_rec_mutex_trylock(m) \
28
return false;
37
- qemu_rec_mutex_trylock_impl(m, __FILE__, __LINE__);
29
}
38
+ qemu_rec_mutex_trylock_impl(m, __FILE__, __LINE__)
30
39
#define qemu_cond_wait(c, m) \
31
+ if (!vfp_access_check(s)) {
40
- qemu_cond_wait_impl(c, m, __FILE__, __LINE__);
32
+ return true;
41
+ qemu_cond_wait_impl(c, m, __FILE__, __LINE__)
33
+ }
42
#define qemu_cond_timedwait(c, m, ms) \
34
+
43
- qemu_cond_timedwait_impl(c, m, ms, __FILE__, __LINE__);
35
desc = tcg_const_i32((a->vn << 2) | a->len);
44
+ qemu_cond_timedwait_impl(c, m, ms, __FILE__, __LINE__)
36
def = tcg_temp_new_i64();
45
#else
37
if (a->op) {
46
#define qemu_mutex_lock(m) ({ \
47
QemuMutexLockFunc _f = atomic_read(&qemu_mutex_lock_func); \
48
--
38
--
49
2.20.1
39
2.20.1
50
40
51
41
diff view generated by jsdifflib