1
Some Arm bugfixes for rc2...
1
Patches for rc1: nothing major, just some minor bugfixes and
2
code cleanups.
2
3
3
thanks
4
-- PMM
4
-- PMM
5
5
6
The following changes since commit e6ebbd46b6e539f3613136111977721d212c2812:
6
The following changes since commit f7e1914adad8885a5d4c70239ab90d901ed97e9f:
7
7
8
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2018-11-19 14:31:48 +0000)
8
Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20201109' into staging (2020-11-10 09:24:56 +0000)
9
9
10
are available in the Git repository at:
10
are available in the Git repository at:
11
11
12
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20181119
12
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20201110
13
13
14
for you to fetch changes up to a00d7f2048c2a1a6a4487ac195c804c78adcf60e:
14
for you to fetch changes up to b6c56c8a9a4064ea783f352f43c5df6231a110fa:
15
15
16
MAINTAINERS: list myself as maintainer for various Arm boards (2018-11-19 15:55:11 +0000)
16
target/arm/translate-neon.c: Handle VTBL UNDEF case before VFP access check (2020-11-10 11:03:48 +0000)
17
17
18
----------------------------------------------------------------
18
----------------------------------------------------------------
19
target-arm queue:
19
target-arm queue:
20
* various MAINTAINERS file updates
20
* hw/arm/Kconfig: ARM_V7M depends on PTIMER
21
* hw/block/onenand: use qemu_log_mask() for reporting
21
* Minor coding style fixes
22
* hw/block/onenand: Fix off-by-one error allowing out-of-bounds read
22
* docs: add some notes on the sbsa-ref machine
23
on the n800 and n810 machine models
23
* hw/arm/virt: Remove dependency on Cortex-A15 MPCore peripherals
24
* target/arm: fix smc incorrectly trapping to EL3 when secure is off
24
* target/arm: Fix neon VTBL/VTBX for len > 1
25
* hw/arm/stm32f205: Fix the UART and Timer region size
25
* hw/arm/armsse: Correct expansion MPC interrupt lines
26
* target/arm: read ID registers for KVM guests so they can be
26
* hw/misc/stm32f2xx_syscfg: Remove extraneous IRQ
27
used to gate "is feature X present" checks
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
28
33
29
----------------------------------------------------------------
34
----------------------------------------------------------------
30
Luc Michel (1):
35
Alex Bennée (1):
31
target/arm: fix smc incorrectly trapping to EL3 when secure is off
36
docs: add some notes on the sbsa-ref machine
32
37
33
Peter Maydell (3):
38
AlexChen (1):
34
hw/block/onenand: Fix off-by-one error allowing out-of-bounds read
39
ssi: Fix bad printf format specifiers
35
hw/block/onenand: use qemu_log_mask() for reporting
36
MAINTAINERS: list myself as maintainer for various Arm boards
37
40
38
Richard Henderson (4):
41
Andrew Jones (1):
39
target/arm: Install ARMISARegisters from kvm host
42
hw/arm/Kconfig: ARM_V7M depends on PTIMER
40
target/arm: Fill in ARMISARegisters for kvm64
41
target/arm: Introduce read_sys_reg32 for kvm32
42
target/arm: Fill in ARMISARegisters for kvm32
43
43
44
Seth Kintigh (1):
44
Havard Skinnemoen (1):
45
hw/arm/stm32f205: Fix the UART and Timer region size
45
tests/qtest/npcm7xx_rng-test: count runs properly
46
46
47
Thomas Huth (1):
47
Peter Maydell (2):
48
MAINTAINERS: Add entries for missing ARM boards
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
49
50
50
target/arm/kvm_arm.h | 1 +
51
Philippe Mathieu-Daudé (6):
51
hw/block/onenand.c | 24 +++++-----
52
hw/arm/virt: Remove dependency on Cortex-A15 MPCore peripherals
52
hw/char/stm32f2xx_usart.c | 2 +-
53
hw/arm/armsse: Correct expansion MPC interrupt lines
53
hw/timer/stm32f2xx_timer.c | 2 +-
54
hw/misc/stm32f2xx_syscfg: Remove extraneous IRQ
54
target/arm/kvm.c | 1 +
55
hw/arm/nseries: Remove invalid/unnecessary n8x0_uart_setup()
55
target/arm/kvm32.c | 77 ++++++++++++++++++++------------
56
hw/arm/musicpal: Don't connect two qemu_irqs directly to the same input
56
target/arm/kvm64.c | 90 +++++++++++++++++++++++++++++++++++++-
57
hw/arm/musicpal: Only use qdev_get_gpio_in() when necessary
57
target/arm/op_helper.c | 54 +++++++++++++++++++----
58
MAINTAINERS | 106 +++++++++++++++++++++++++++++++++++++++------
59
9 files changed, 293 insertions(+), 64 deletions(-)
60
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
New patch
1
From: Andrew Jones <drjones@redhat.com>
1
2
3
commit 32bd322a0134 ("hw/timer/armv7m_systick: Rewrite to use ptimers")
4
changed armv7m_systick to build on ptimers. Make sure we have ptimers
5
in the build when building armv7m_systick.
6
7
Signed-off-by: Andrew Jones <drjones@redhat.com>
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(+)
14
15
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
16
index XXXXXXX..XXXXXXX 100644
17
--- a/hw/arm/Kconfig
18
+++ b/hw/arm/Kconfig
19
@@ -XXX,XX +XXX,XX @@ config ZYNQ
20
21
config ARM_V7M
22
bool
23
+ select PTIMER
24
25
config ALLWINNER_A10
26
bool
27
--
28
2.20.1
29
30
diff view generated by jsdifflib
1
From: Seth Kintigh <skintigh@gmail.com>
1
From: AlexChen <alex.chen@huawei.com>
2
2
3
The UART and timer devices for the stm32f205 were being created
3
We should use printf format specifier "%u" instead of "%d" for
4
with memory regions that were too large. Use the size specified
4
argument of type "unsigned int".
5
in the chip datasheet.
6
5
7
The old sizes were so large that the devices would overlap with
6
Reported-by: Euler Robot <euler.robot@huawei.com>
8
each other in the SoC memory map, so this fixes a bug that
7
Signed-off-by: Alex Chen <alex.chen@huawei.com>
9
caused odd behavior and/or crashes when trying to set up multiple
8
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
10
UARTs.
9
Message-id: 5FA280F5.8060902@huawei.com
11
12
Signed-off-by: Seth Kintigh <skintigh@gmail.com>
13
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
14
[PMM: rephrased commit message to follow our usual standard]
15
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
16
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
17
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
18
---
11
---
19
hw/char/stm32f2xx_usart.c | 2 +-
12
hw/ssi/imx_spi.c | 2 +-
20
hw/timer/stm32f2xx_timer.c | 2 +-
13
hw/ssi/xilinx_spi.c | 2 +-
21
2 files changed, 2 insertions(+), 2 deletions(-)
14
2 files changed, 2 insertions(+), 2 deletions(-)
22
15
23
diff --git a/hw/char/stm32f2xx_usart.c b/hw/char/stm32f2xx_usart.c
16
diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c
24
index XXXXXXX..XXXXXXX 100644
17
index XXXXXXX..XXXXXXX 100644
25
--- a/hw/char/stm32f2xx_usart.c
18
--- a/hw/ssi/imx_spi.c
26
+++ b/hw/char/stm32f2xx_usart.c
19
+++ b/hw/ssi/imx_spi.c
27
@@ -XXX,XX +XXX,XX @@ static void stm32f2xx_usart_init(Object *obj)
20
@@ -XXX,XX +XXX,XX @@ static const char *imx_spi_reg_name(uint32_t reg)
28
sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq);
21
case ECSPI_MSGDATA:
29
22
return "ECSPI_MSGDATA";
30
memory_region_init_io(&s->mmio, obj, &stm32f2xx_usart_ops, s,
23
default:
31
- TYPE_STM32F2XX_USART, 0x2000);
24
- sprintf(unknown, "%d ?", reg);
32
+ TYPE_STM32F2XX_USART, 0x400);
25
+ sprintf(unknown, "%u ?", reg);
33
sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mmio);
26
return unknown;
27
}
34
}
28
}
35
29
diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c
36
diff --git a/hw/timer/stm32f2xx_timer.c b/hw/timer/stm32f2xx_timer.c
37
index XXXXXXX..XXXXXXX 100644
30
index XXXXXXX..XXXXXXX 100644
38
--- a/hw/timer/stm32f2xx_timer.c
31
--- a/hw/ssi/xilinx_spi.c
39
+++ b/hw/timer/stm32f2xx_timer.c
32
+++ b/hw/ssi/xilinx_spi.c
40
@@ -XXX,XX +XXX,XX @@ static void stm32f2xx_timer_init(Object *obj)
33
@@ -XXX,XX +XXX,XX @@ static void xlx_spi_update_irq(XilinxSPI *s)
41
sysbus_init_irq(SYS_BUS_DEVICE(obj), &s->irq);
34
irq chain unless things really changed. */
42
35
if (pending != s->irqline) {
43
memory_region_init_io(&s->iomem, obj, &stm32f2xx_timer_ops, s,
36
s->irqline = pending;
44
- "stm32f2xx_timer", 0x4000);
37
- DB_PRINT("irq_change of state %d ISR:%x IER:%X\n",
45
+ "stm32f2xx_timer", 0x400);
38
+ DB_PRINT("irq_change of state %u ISR:%x IER:%X\n",
46
sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->iomem);
39
pending, s->regs[R_IPISR], s->regs[R_IPIER]);
47
40
qemu_set_irq(s->irq, pending);
48
s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, stm32f2xx_timer_interrupt, s);
41
}
49
--
42
--
50
2.19.1
43
2.20.1
51
44
52
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
From: Luc Michel <luc.michel@greensocs.com>
1
From: Xinhao Zhang <zhangxinhao1@huawei.com>
2
2
3
This commit fixes a case where the CPU would try to go to EL3 when
3
Fix code style. Don't use '#' flag of printf format ('%#') in
4
executing an smc instruction, even though ARM_FEATURE_EL3 is false. This
4
format strings, use '0x' prefix instead
5
case is raised when the PSCI conduit is set to smc, but the smc
6
instruction does not lead to a valid PSCI call.
7
5
8
QEMU crashes with an assertion failure latter on because of incoherent
6
Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
9
mmu_idx.
7
Signed-off-by: Kai Deng <dengkai1@huawei.com>
10
8
Message-id: 20201103114529.638233-2-zhangxinhao1@huawei.com
11
This commit refactors the pre_smc helper by enumerating all the possible
12
way of handling an scm instruction, and covering the previously missing
13
case leading to the crash.
14
15
The following minimal test would crash before this commit:
16
17
.global _start
18
.text
19
_start:
20
ldr x0, =0xdeadbeef ; invalid PSCI call
21
smc #0
22
23
run with the following command line:
24
25
aarch64-linux-gnu-gcc -nostdinc -nostdlib -Wl,-Ttext=40000000 \
26
-o test test.s
27
28
qemu-system-aarch64 -M virt,virtualization=on,secure=off \
29
-cpu cortex-a57 -kernel test
30
31
Signed-off-by: Luc Michel <luc.michel@greensocs.com>
32
Message-id: 20181117160213.18995-1-luc.michel@greensocs.com
33
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
34
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
35
---
11
---
36
target/arm/op_helper.c | 54 +++++++++++++++++++++++++++++++++++-------
12
target/arm/translate-a64.c | 4 ++--
37
1 file changed, 46 insertions(+), 8 deletions(-)
13
1 file changed, 2 insertions(+), 2 deletions(-)
38
14
39
diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c
15
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
40
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
41
--- a/target/arm/op_helper.c
17
--- a/target/arm/translate-a64.c
42
+++ b/target/arm/op_helper.c
18
+++ b/target/arm/translate-a64.c
43
@@ -XXX,XX +XXX,XX @@ void HELPER(pre_smc)(CPUARMState *env, uint32_t syndrome)
19
@@ -XXX,XX +XXX,XX @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)
44
ARMCPU *cpu = arm_env_get_cpu(env);
20
gen_helper_advsimd_acgt_f16(tcg_res, tcg_op1, tcg_op2, fpst);
45
int cur_el = arm_current_el(env);
21
break;
46
bool secure = arm_is_secure(env);
22
default:
47
- bool smd = env->cp15.scr_el3 & SCR_SMD;
23
- fprintf(stderr, "%s: insn %#04x, fpop %#2x @ %#" PRIx64 "\n",
48
+ bool smd_flag = env->cp15.scr_el3 & SCR_SMD;
24
+ fprintf(stderr, "%s: insn 0x%04x, fpop 0x%2x @ 0x%" PRIx64 "\n",
49
+
25
__func__, insn, fpopcode, s->pc_curr);
50
+ /*
26
g_assert_not_reached();
51
+ * SMC behaviour is summarized in the following table.
27
}
52
+ * This helper handles the "Trap to EL2" and "Undef insn" cases.
28
@@ -XXX,XX +XXX,XX @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)
53
+ * The "Trap to EL3" and "PSCI call" cases are handled in the exception
29
case 0x7f: /* FSQRT (vector) */
54
+ * helper.
30
break;
55
+ *
31
default:
56
+ * -> ARM_FEATURE_EL3 and !SMD
32
- fprintf(stderr, "%s: insn %#04x fpop %#2x\n", __func__, insn, fpop);
57
+ * HCR_TSC && NS EL1 !HCR_TSC || !NS EL1
33
+ fprintf(stderr, "%s: insn 0x%04x fpop 0x%2x\n", __func__, insn, fpop);
58
+ *
34
g_assert_not_reached();
59
+ * Conduit SMC, valid call Trap to EL2 PSCI Call
60
+ * Conduit SMC, inval call Trap to EL2 Trap to EL3
61
+ * Conduit not SMC Trap to EL2 Trap to EL3
62
+ *
63
+ *
64
+ * -> ARM_FEATURE_EL3 and SMD
65
+ * HCR_TSC && NS EL1 !HCR_TSC || !NS EL1
66
+ *
67
+ * Conduit SMC, valid call Trap to EL2 PSCI Call
68
+ * Conduit SMC, inval call Trap to EL2 Undef insn
69
+ * Conduit not SMC Trap to EL2 Undef insn
70
+ *
71
+ *
72
+ * -> !ARM_FEATURE_EL3
73
+ * HCR_TSC && NS EL1 !HCR_TSC || !NS EL1
74
+ *
75
+ * Conduit SMC, valid call Trap to EL2 PSCI Call
76
+ * Conduit SMC, inval call Trap to EL2 Undef insn
77
+ * Conduit not SMC Undef insn Undef insn
78
+ */
79
+
80
/* On ARMv8 with EL3 AArch64, SMD applies to both S and NS state.
81
* On ARMv8 with EL3 AArch32, or ARMv7 with the Virtualization
82
* extensions, SMD only applies to NS state.
83
@@ -XXX,XX +XXX,XX @@ void HELPER(pre_smc)(CPUARMState *env, uint32_t syndrome)
84
* doesn't exist, but we forbid the guest to set it to 1 in scr_write(),
85
* so we need not special case this here.
86
*/
87
- bool undef = arm_feature(env, ARM_FEATURE_AARCH64) ? smd : smd && !secure;
88
+ bool smd = arm_feature(env, ARM_FEATURE_AARCH64) ? smd_flag
89
+ : smd_flag && !secure;
90
91
if (!arm_feature(env, ARM_FEATURE_EL3) &&
92
cpu->psci_conduit != QEMU_PSCI_CONDUIT_SMC) {
93
@@ -XXX,XX +XXX,XX @@ void HELPER(pre_smc)(CPUARMState *env, uint32_t syndrome)
94
* to forbid its EL1 from making PSCI calls into QEMU's
95
* "firmware" via HCR.TSC, so for these purposes treat
96
* PSCI-via-SMC as implying an EL3.
97
+ * This handles the very last line of the previous table.
98
*/
99
- undef = true;
100
- } else if (!secure && cur_el == 1 && (env->cp15.hcr_el2 & HCR_TSC)) {
101
+ raise_exception(env, EXCP_UDEF, syn_uncategorized(),
102
+ exception_target_el(env));
103
+ }
104
+
105
+ if (!secure && cur_el == 1 && (env->cp15.hcr_el2 & HCR_TSC)) {
106
/* In NS EL1, HCR controlled routing to EL2 has priority over SMD.
107
* We also want an EL2 guest to be able to forbid its EL1 from
108
* making PSCI calls into QEMU's "firmware" via HCR.TSC.
109
+ * This handles all the "Trap to EL2" cases of the previous table.
110
*/
111
raise_exception(env, EXCP_HYP_TRAP, syndrome, 2);
112
}
35
}
113
36
114
- /* If PSCI is enabled and this looks like a valid PSCI call then
115
- * suppress the UNDEF -- we'll catch the SMC exception and
116
- * implement the PSCI call behaviour there.
117
+ /* Catch the two remaining "Undef insn" cases of the previous table:
118
+ * - PSCI conduit is SMC but we don't have a valid PCSI call,
119
+ * - We don't have EL3 or SMD is set.
120
*/
121
- if (undef && !arm_is_psci_call(cpu, EXCP_SMC)) {
122
+ if (!arm_is_psci_call(cpu, EXCP_SMC) &&
123
+ (smd || !arm_feature(env, ARM_FEATURE_EL3))) {
124
raise_exception(env, EXCP_UDEF, syn_uncategorized(),
125
exception_target_el(env));
126
}
127
--
37
--
128
2.19.1
38
2.20.1
129
39
130
40
diff view generated by jsdifflib
1
An off-by-one error in a switch case in onenand_read() allowed
1
From: Xinhao Zhang <zhangxinhao1@huawei.com>
2
a misbehaving guest to read off the end of a block of memory.
3
2
4
NB: the onenand device is used only by the "n800" and "n810"
3
Fix code style. Space required before the open parenthesis '('.
5
machines, which are usable only with TCG, not KVM, so this is
6
not a security issue.
7
4
8
Reported-by: Thomas Huth <thuth@redhat.com>
5
Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
9
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
6
Signed-off-by: Kai Deng <dengkai1@huawei.com>
10
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
7
Message-id: 20201103114529.638233-3-zhangxinhao1@huawei.com
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
12
Message-id: 20181115143535.5885-2-peter.maydell@linaro.org
13
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
15
---
10
---
16
hw/block/onenand.c | 2 +-
11
target/arm/translate.c | 2 +-
17
1 file changed, 1 insertion(+), 1 deletion(-)
12
1 file changed, 1 insertion(+), 1 deletion(-)
18
13
19
diff --git a/hw/block/onenand.c b/hw/block/onenand.c
14
diff --git a/target/arm/translate.c b/target/arm/translate.c
20
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
21
--- a/hw/block/onenand.c
16
--- a/target/arm/translate.c
22
+++ b/hw/block/onenand.c
17
+++ b/target/arm/translate.c
23
@@ -XXX,XX +XXX,XX @@ static uint64_t onenand_read(void *opaque, hwaddr addr,
18
@@ -XXX,XX +XXX,XX @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
24
int offset = addr >> s->shift;
19
- Hardware watchpoints.
25
20
Hardware breakpoints have already been handled and skip this code.
26
switch (offset) {
21
*/
27
- case 0x0000 ... 0xc000:
22
- switch(dc->base.is_jmp) {
28
+ case 0x0000 ... 0xbffe:
23
+ switch (dc->base.is_jmp) {
29
return lduw_le_p(s->boot[0] + addr);
24
case DISAS_NEXT:
30
25
case DISAS_TOO_MANY:
31
case 0xf000:    /* Manufacturer ID */
26
gen_goto_tb(dc, 1, dc->base.pc_next);
32
--
27
--
33
2.19.1
28
2.20.1
34
29
35
30
diff view generated by jsdifflib
New patch
1
From: Alex Bennée <alex.bennee@linaro.org>
1
2
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]
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
---
14
docs/system/arm/sbsa.rst | 32 ++++++++++++++++++++++++++++++++
15
docs/system/target-arm.rst | 1 +
16
2 files changed, 33 insertions(+)
17
create mode 100644 docs/system/arm/sbsa.rst
18
19
diff --git a/docs/system/arm/sbsa.rst b/docs/system/arm/sbsa.rst
20
new file mode 100644
21
index XXXXXXX..XXXXXXX
22
--- /dev/null
23
+++ b/docs/system/arm/sbsa.rst
24
@@ -XXX,XX +XXX,XX @@
25
+Arm Server Base System Architecture Reference board (``sbsa-ref``)
26
+==================================================================
27
+
28
+While the `virt` board is a generic board platform that doesn't match
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).
39
+
40
+It is intended to be a machine for developing firmware and testing
41
+standards compliance with operating systems.
42
+
43
+Supported devices
44
+"""""""""""""""""
45
+
46
+The sbsa-ref board supports:
47
+
48
+ - A configurable number of AArch64 CPUs
49
+ - GIC version 3
50
+ - System bus AHCI controller
51
+ - System bus EHCI controller
52
+ - CDROM and hard disc on AHCI bus
53
+ - E1000E ethernet card on PCIe bus
54
+ - VGA display adaptor on PCIe bus
55
+ - A generic SBSA watchdog device
56
+
57
diff --git a/docs/system/target-arm.rst b/docs/system/target-arm.rst
58
index XXXXXXX..XXXXXXX 100644
59
--- a/docs/system/target-arm.rst
60
+++ b/docs/system/target-arm.rst
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
69
--
70
2.20.1
71
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
From: Richard Henderson <richard.henderson@linaro.org>
1
From: Richard Henderson <richard.henderson@linaro.org>
2
2
3
Assert that the value to be written is the correct size.
3
The helper function did not get updated when we reorganized
4
No change in functionality here, just mirroring the same
4
the vector register file for SVE. Since then, the neon dregs
5
function from kvm64.
5
are non-sequential and cannot be simply indexed.
6
6
7
At the same time, make the helper function operate on 64-bit
8
quantities so that we do not have to call it twice.
9
10
Fixes: c39c2b9043e
11
Reported-by: Ard Biesheuvel <ardb@kernel.org>
7
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
12
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
8
Message-id: 20181113180154.17903-4-richard.henderson@linaro.org
13
[PMM: use aa32_vfp_dreg() rather than opencoding]
14
Message-id: 20201105171126.88014-1-richard.henderson@linaro.org
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
15
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
17
---
12
target/arm/kvm32.c | 41 ++++++++++++++++-------------------------
18
target/arm/helper.h | 2 +-
13
1 file changed, 16 insertions(+), 25 deletions(-)
19
target/arm/op_helper.c | 23 +++++++++--------
20
target/arm/translate-neon.c.inc | 44 +++++++++++----------------------
21
3 files changed, 29 insertions(+), 40 deletions(-)
14
22
15
diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c
23
diff --git a/target/arm/helper.h b/target/arm/helper.h
16
index XXXXXXX..XXXXXXX 100644
24
index XXXXXXX..XXXXXXX 100644
17
--- a/target/arm/kvm32.c
25
--- a/target/arm/helper.h
18
+++ b/target/arm/kvm32.c
26
+++ b/target/arm/helper.h
19
@@ -XXX,XX +XXX,XX @@ static inline void set_feature(uint64_t *features, int feature)
27
@@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_2(rsqrte_f32, TCG_CALL_NO_RWG, f32, f32, ptr)
20
*features |= 1ULL << feature;
28
DEF_HELPER_FLAGS_2(rsqrte_f64, TCG_CALL_NO_RWG, f64, f64, ptr)
29
DEF_HELPER_FLAGS_1(recpe_u32, TCG_CALL_NO_RWG, i32, i32)
30
DEF_HELPER_FLAGS_1(rsqrte_u32, TCG_CALL_NO_RWG, i32, i32)
31
-DEF_HELPER_FLAGS_4(neon_tbl, TCG_CALL_NO_RWG, i32, i32, i32, ptr, i32)
32
+DEF_HELPER_FLAGS_4(neon_tbl, TCG_CALL_NO_RWG, i64, env, i32, i64, i64)
33
34
DEF_HELPER_3(shl_cc, i32, env, i32, i32)
35
DEF_HELPER_3(shr_cc, i32, env, i32, i32)
36
diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c
37
index XXXXXXX..XXXXXXX 100644
38
--- a/target/arm/op_helper.c
39
+++ b/target/arm/op_helper.c
40
@@ -XXX,XX +XXX,XX @@ void raise_exception_ra(CPUARMState *env, uint32_t excp, uint32_t syndrome,
41
cpu_loop_exit_restore(cs, ra);
21
}
42
}
22
43
23
+static int read_sys_reg32(int fd, uint32_t *pret, uint64_t id)
44
-uint32_t HELPER(neon_tbl)(uint32_t ireg, uint32_t def, void *vn,
24
+{
45
- uint32_t maxindex)
25
+ struct kvm_one_reg idreg = { .id = id, .addr = (uintptr_t)pret };
46
+uint64_t HELPER(neon_tbl)(CPUARMState *env, uint32_t desc,
26
+
47
+ uint64_t ireg, uint64_t def)
27
+ assert((id & KVM_REG_SIZE_MASK) == KVM_REG_SIZE_U32);
28
+ return ioctl(fd, KVM_GET_ONE_REG, &idreg);
29
+}
30
+
31
bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
32
{
48
{
33
/* Identify the feature bits corresponding to the host CPU, and
49
- uint32_t val, shift;
34
@@ -XXX,XX +XXX,XX @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
50
- uint64_t *table = vn;
35
* we have to create a scratch VM, create a single CPU inside it,
51
+ uint64_t tmp, val = 0;
36
* and then query that CPU for the relevant ID registers.
52
+ uint32_t maxindex = ((desc & 3) + 1) * 8;
37
*/
53
+ uint32_t base_reg = desc >> 2;
38
- int i, ret, fdarray[3];
54
+ uint32_t shift, index, reg;
39
+ int err = 0, fdarray[3];
55
40
uint32_t midr, id_pfr0, mvfr1;
56
- val = 0;
41
uint64_t features = 0;
57
- for (shift = 0; shift < 32; shift += 8) {
42
+
58
- uint32_t index = (ireg >> shift) & 0xff;
43
/* Old kernels may not know about the PREFERRED_TARGET ioctl: however
59
+ for (shift = 0; shift < 64; shift += 8) {
44
* we know these will only support creating one kind of guest CPU,
60
+ index = (ireg >> shift) & 0xff;
45
* which is its preferred CPU type.
61
if (index < maxindex) {
46
@@ -XXX,XX +XXX,XX @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
62
- uint32_t tmp = (table[index >> 3] >> ((index & 7) << 3)) & 0xff;
47
QEMU_KVM_ARM_TARGET_NONE
63
- val |= tmp << shift;
48
};
64
+ reg = base_reg + (index >> 3);
49
struct kvm_vcpu_init init;
65
+ tmp = *aa32_vfp_dreg(env, reg);
50
- struct kvm_one_reg idregs[] = {
66
+ tmp = ((tmp >> ((index & 7) << 3)) & 0xff) << shift;
51
- {
67
} else {
52
- .id = KVM_REG_ARM | KVM_REG_SIZE_U32
68
- val |= def & (0xff << shift);
53
- | ENCODE_CP_REG(15, 0, 0, 0, 0, 0, 0),
69
+ tmp = def & (0xffull << shift);
54
- .addr = (uintptr_t)&midr,
70
}
55
- },
71
+ val |= tmp;
56
- {
72
}
57
- .id = KVM_REG_ARM | KVM_REG_SIZE_U32
73
return val;
58
- | ENCODE_CP_REG(15, 0, 0, 0, 1, 0, 0),
74
}
59
- .addr = (uintptr_t)&id_pfr0,
75
diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.inc
60
- },
76
index XXXXXXX..XXXXXXX 100644
61
- {
77
--- a/target/arm/translate-neon.c.inc
62
- .id = KVM_REG_ARM | KVM_REG_SIZE_U32
78
+++ b/target/arm/translate-neon.c.inc
63
- | KVM_REG_ARM_VFP | KVM_REG_ARM_VFP_MVFR1,
79
@@ -XXX,XX +XXX,XX @@ static bool trans_VEXT(DisasContext *s, arg_VEXT *a)
64
- .addr = (uintptr_t)&mvfr1,
80
65
- },
81
static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
66
- };
82
{
67
83
- int n;
68
if (!kvm_arm_create_scratch_host_vcpu(cpus_to_try, fdarray, &init)) {
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)) {
69
return false;
90
return false;
70
@@ -XXX,XX +XXX,XX @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
91
@@ -XXX,XX +XXX,XX @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
71
*/
92
return true;
72
ahcf->dtb_compatible = "arm,arm-v7";
93
}
73
94
74
- for (i = 0; i < ARRAY_SIZE(idregs); i++) {
95
- n = a->len + 1;
75
- ret = ioctl(fdarray[2], KVM_GET_ONE_REG, &idregs[i]);
96
- if ((a->vn + n) > 32) {
76
- if (ret) {
97
+ if ((a->vn + a->len + 1) > 32) {
77
- break;
98
/*
78
- }
99
* This is UNPREDICTABLE; we choose to UNDEF to avoid the
79
- }
100
* helper function running off the end of the register file.
80
+ err |= read_sys_reg32(fdarray[2], &midr, ARM_CP15_REG32(0, 0, 0, 0));
101
*/
81
+ err |= read_sys_reg32(fdarray[2], &id_pfr0, ARM_CP15_REG32(0, 0, 1, 0));
82
+ err |= read_sys_reg32(fdarray[2], &mvfr1,
83
+ KVM_REG_ARM | KVM_REG_SIZE_U32 |
84
+ KVM_REG_ARM_VFP | KVM_REG_ARM_VFP_MVFR1);
85
86
kvm_arm_destroy_scratch_host_vcpu(fdarray);
87
88
- if (ret) {
89
+ if (err < 0) {
90
return false;
102
return false;
91
}
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);
141
+
142
+ tcg_temp_free_i64(def);
143
+ tcg_temp_free_i64(val);
144
+ tcg_temp_free_i32(desc);
145
return true;
146
}
92
147
93
--
148
--
94
2.19.1
149
2.20.1
95
150
96
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
New patch
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
1
2
3
The system configuration controller (SYSCFG) doesn't have
4
any output IRQ (and the INTC input #71 belongs to the UART6).
5
Remove the invalid code.
6
7
Fixes: db635521a02 ("stm32f205: Add the stm32f205 SoC")
8
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
9
Message-id: 20201107193403.436146-3-f4bug@amsat.org
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
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(-)
17
18
diff --git a/include/hw/misc/stm32f2xx_syscfg.h b/include/hw/misc/stm32f2xx_syscfg.h
19
index XXXXXXX..XXXXXXX 100644
20
--- a/include/hw/misc/stm32f2xx_syscfg.h
21
+++ b/include/hw/misc/stm32f2xx_syscfg.h
22
@@ -XXX,XX +XXX,XX @@ struct STM32F2XXSyscfgState {
23
uint32_t syscfg_exticr3;
24
uint32_t syscfg_exticr4;
25
uint32_t syscfg_cmpcr;
26
-
27
- qemu_irq irq;
28
};
29
30
#endif /* HW_STM32F2XX_SYSCFG_H */
31
diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c
32
index XXXXXXX..XXXXXXX 100644
33
--- a/hw/arm/stm32f205_soc.c
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);
56
--
57
2.20.1
58
59
diff view generated by jsdifflib
1
From: Richard Henderson <richard.henderson@linaro.org>
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
2
3
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3
omap2420_mpu_init() introduced in commit 827df9f3c5f ("Add basic
4
Message-id: 20181113180154.17903-5-richard.henderson@linaro.org
4
OMAP2 chip support") takes care of creating the 3 UARTs.
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
5
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
19
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
20
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7
---
21
---
8
target/arm/kvm32.c | 40 +++++++++++++++++++++++++++++++++++-----
22
hw/arm/nseries.c | 11 -----------
9
1 file changed, 35 insertions(+), 5 deletions(-)
23
1 file changed, 11 deletions(-)
10
24
11
diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c
25
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
12
index XXXXXXX..XXXXXXX 100644
26
index XXXXXXX..XXXXXXX 100644
13
--- a/target/arm/kvm32.c
27
--- a/hw/arm/nseries.c
14
+++ b/target/arm/kvm32.c
28
+++ b/hw/arm/nseries.c
15
@@ -XXX,XX +XXX,XX @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
29
@@ -XXX,XX +XXX,XX @@ static void n8x0_cbus_setup(struct n800_s *s)
16
* and then query that CPU for the relevant ID registers.
30
cbus_attach(cbus, s->tahvo = tahvo_init(tahvo_irq, 1));
17
*/
31
}
18
int err = 0, fdarray[3];
32
19
- uint32_t midr, id_pfr0, mvfr1;
33
-static void n8x0_uart_setup(struct n800_s *s)
20
+ uint32_t midr, id_pfr0;
34
-{
21
uint64_t features = 0;
35
- Chardev *radio = qemu_chr_new("bt-dummy-uart", "null", NULL);
22
36
- /*
23
/* Old kernels may not know about the PREFERRED_TARGET ioctl: however
37
- * Note: We used to connect N8X0_BT_RESET_GPIO and N8X0_BT_WKUP_GPIO
24
@@ -XXX,XX +XXX,XX @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
38
- * here, but this code has been removed with the bluetooth backend.
25
39
- */
26
err |= read_sys_reg32(fdarray[2], &midr, ARM_CP15_REG32(0, 0, 0, 0));
40
- omap_uart_attach(s->mpu->uart[BT_UART], radio);
27
err |= read_sys_reg32(fdarray[2], &id_pfr0, ARM_CP15_REG32(0, 0, 1, 0));
41
-}
28
- err |= read_sys_reg32(fdarray[2], &mvfr1,
42
-
29
+
43
static void n8x0_usb_setup(struct n800_s *s)
30
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_isar0,
44
{
31
+ ARM_CP15_REG32(0, 0, 2, 0));
45
SysBusDevice *dev;
32
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_isar1,
46
@@ -XXX,XX +XXX,XX @@ static void n8x0_init(MachineState *machine,
33
+ ARM_CP15_REG32(0, 0, 2, 1));
47
n8x0_spi_setup(s);
34
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_isar2,
48
n8x0_dss_setup(s);
35
+ ARM_CP15_REG32(0, 0, 2, 2));
49
n8x0_cbus_setup(s);
36
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_isar3,
50
- n8x0_uart_setup(s);
37
+ ARM_CP15_REG32(0, 0, 2, 3));
51
if (machine_usb(machine)) {
38
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_isar4,
52
n8x0_usb_setup(s);
39
+ ARM_CP15_REG32(0, 0, 2, 4));
40
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_isar5,
41
+ ARM_CP15_REG32(0, 0, 2, 5));
42
+ if (read_sys_reg32(fdarray[2], &ahcf->isar.id_isar6,
43
+ ARM_CP15_REG32(0, 0, 2, 7))) {
44
+ /*
45
+ * Older kernels don't support reading ID_ISAR6. This register was
46
+ * only introduced in ARMv8, so we can assume that it is zero on a
47
+ * CPU that a kernel this old is running on.
48
+ */
49
+ ahcf->isar.id_isar6 = 0;
50
+ }
51
+
52
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.mvfr0,
53
+ KVM_REG_ARM | KVM_REG_SIZE_U32 |
54
+ KVM_REG_ARM_VFP | KVM_REG_ARM_VFP_MVFR0);
55
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.mvfr1,
56
KVM_REG_ARM | KVM_REG_SIZE_U32 |
57
KVM_REG_ARM_VFP | KVM_REG_ARM_VFP_MVFR1);
58
+ /*
59
+ * FIXME: There is not yet a way to read MVFR2.
60
+ * Fortunately there is not yet anything in there that affects migration.
61
+ */
62
63
kvm_arm_destroy_scratch_host_vcpu(fdarray);
64
65
@@ -XXX,XX +XXX,XX @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
66
if (extract32(id_pfr0, 12, 4) == 1) {
67
set_feature(&features, ARM_FEATURE_THUMB2EE);
68
}
69
- if (extract32(mvfr1, 20, 4) == 1) {
70
+ if (extract32(ahcf->isar.mvfr1, 20, 4) == 1) {
71
set_feature(&features, ARM_FEATURE_VFP_FP16);
72
}
73
- if (extract32(mvfr1, 12, 4) == 1) {
74
+ if (extract32(ahcf->isar.mvfr1, 12, 4) == 1) {
75
set_feature(&features, ARM_FEATURE_NEON);
76
}
77
- if (extract32(mvfr1, 28, 4) == 1) {
78
+ if (extract32(ahcf->isar.mvfr1, 28, 4) == 1) {
79
/* FMAC support implies VFPv4 */
80
set_feature(&features, ARM_FEATURE_VFP4);
81
}
53
}
82
--
54
--
83
2.19.1
55
2.20.1
84
56
85
57
diff view generated by jsdifflib
1
From: Thomas Huth <thuth@redhat.com>
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
2
3
Add entries for the boards "mcimx6ul-evk", "mcimx7d-sabre", "raspi2",
3
The MusicPal board code connects both of the IRQ outputs of the UART
4
"raspi3", "sabrelite", "vexpress-a15", "vexpress-a9" and "virt".
4
to the same INTC qemu_irq. Connecting two qemu_irqs outputs directly
5
While we're at it, also adjust the "i.MX31" section a little bit,
5
to the same input is not valid as it produces subtly wrong behaviour
6
so that the wildcards there do not match anymore for unrelated files
6
(for instance if both the IRQ lines are high, and then one goes
7
(e.g. the new hw/misc/imx6ul_ccm.c file).
7
low, the INTC input will see this as a high-to-low transition
8
even though the second IRQ line should still be holding it high).
8
9
9
Signed-off-by: Thomas Huth <thuth@redhat.com>
10
This kind of wiring needs an explicitly created OR gate; add one.
10
Message-id: 1542184999-11145-1-git-send-email-thuth@redhat.com
11
12
Inspired-by: Peter Maydell <peter.maydell@linaro.org>
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>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
---
17
---
13
MAINTAINERS | 70 +++++++++++++++++++++++++++++++++++++++++++++++++----
18
hw/arm/musicpal.c | 17 +++++++++++++----
14
1 file changed, 65 insertions(+), 5 deletions(-)
19
hw/arm/Kconfig | 1 +
20
2 files changed, 14 insertions(+), 4 deletions(-)
15
21
16
diff --git a/MAINTAINERS b/MAINTAINERS
22
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
17
index XXXXXXX..XXXXXXX 100644
23
index XXXXXXX..XXXXXXX 100644
18
--- a/MAINTAINERS
24
--- a/hw/arm/musicpal.c
19
+++ b/MAINTAINERS
25
+++ b/hw/arm/musicpal.c
20
@@ -XXX,XX +XXX,XX @@ L: qemu-arm@nongnu.org
26
@@ -XXX,XX +XXX,XX @@
21
S: Odd Fixes
27
#include "ui/console.h"
22
F: hw/arm/gumstix.c
28
#include "hw/i2c/i2c.h"
23
29
#include "hw/irq.h"
24
-i.MX31
30
+#include "hw/or-irq.h"
25
+i.MX31 (kzm)
31
#include "hw/audio/wm8750.h"
26
M: Peter Chubb <peter.chubb@nicta.com.au>
32
#include "sysemu/block-backend.h"
27
L: qemu-arm@nongnu.org
33
#include "sysemu/runstate.h"
28
-S: Odd fixes
34
@@ -XXX,XX +XXX,XX @@
29
-F: hw/*/imx*
35
#define MP_TIMER4_IRQ 7
30
-F: include/hw/*/imx*
36
#define MP_EHCI_IRQ 8
31
+S: Odd Fixes
37
#define MP_ETH_IRQ 9
32
F: hw/arm/kzm.c
38
-#define MP_UART1_IRQ 11
33
-F: include/hw/arm/fsl-imx31.h
39
-#define MP_UART2_IRQ 11
34
+F: hw/*/imx_*
40
+#define MP_UART_SHARED_IRQ 11
35
+F: hw/*/*imx31*
41
#define MP_GPIO_IRQ 12
36
+F: include/hw/*/imx_*
42
#define MP_RTC_IRQ 28
37
+F: include/hw/*/*imx31*
43
#define MP_AUDIO_IRQ 30
38
44
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
39
Integrator CP
45
ARMCPU *cpu;
40
M: Peter Maydell <peter.maydell@linaro.org>
46
qemu_irq pic[32];
41
@@ -XXX,XX +XXX,XX @@ S: Maintained
47
DeviceState *dev;
42
F: hw/arm/integratorcp.c
48
+ DeviceState *uart_orgate;
43
F: hw/misc/arm_integrator_debug.c
49
DeviceState *i2c_dev;
44
50
DeviceState *lcd_dev;
45
+MCIMX6UL EVK / i.MX6ul
51
DeviceState *key_dev;
46
+M: Peter Maydell <peter.maydell@linaro.org>
52
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
47
+R: Jean-Christophe Dubois <jcd@tribudubois.net>
53
pic[MP_TIMER2_IRQ], pic[MP_TIMER3_IRQ],
48
+L: qemu-arm@nongnu.org
54
pic[MP_TIMER4_IRQ], NULL);
49
+S: Odd Fixes
55
50
+F: hw/arm/mcimx6ul-evk.c
56
- serial_mm_init(address_space_mem, MP_UART1_BASE, 2, pic[MP_UART1_IRQ],
51
+F: hw/arm/fsl-imx6ul.c
57
+ /* Logically OR both UART IRQs together */
52
+F: hw/misc/imx6ul_ccm.c
58
+ uart_orgate = DEVICE(object_new(TYPE_OR_IRQ));
53
+F: include/hw/arm/fsl-imx6ul.h
59
+ object_property_set_int(OBJECT(uart_orgate), "num-lines", 2, &error_fatal);
54
+F: include/hw/misc/imx6ul_ccm.h
60
+ qdev_realize_and_unref(uart_orgate, NULL, &error_fatal);
61
+ qdev_connect_gpio_out(DEVICE(uart_orgate), 0, pic[MP_UART_SHARED_IRQ]);
55
+
62
+
56
+MCIMX7D SABRE / i.MX7
63
+ serial_mm_init(address_space_mem, MP_UART1_BASE, 2,
57
+M: Peter Maydell <peter.maydell@linaro.org>
64
+ qdev_get_gpio_in(uart_orgate, 0),
58
+R: Andrey Smirnov <andrew.smirnov@gmail.com>
65
1825000, serial_hd(0), DEVICE_NATIVE_ENDIAN);
59
+L: qemu-arm@nongnu.org
66
- serial_mm_init(address_space_mem, MP_UART2_BASE, 2, pic[MP_UART2_IRQ],
60
+S: Odd Fixes
67
+ serial_mm_init(address_space_mem, MP_UART2_BASE, 2,
61
+F: hw/arm/mcimx7d-sabre.c
68
+ qdev_get_gpio_in(uart_orgate, 1),
62
+F: hw/arm/fsl-imx7.c
69
1825000, serial_hd(1), DEVICE_NATIVE_ENDIAN);
63
+F: include/hw/arm/fsl-imx7.h
70
64
+F: hw/pci-host/designware.c
71
/* Register flash */
65
+F: include/hw/pci-host/designware.h
72
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
66
+
73
index XXXXXXX..XXXXXXX 100644
67
MPS2
74
--- a/hw/arm/Kconfig
68
M: Peter Maydell <peter.maydell@linaro.org>
75
+++ b/hw/arm/Kconfig
69
L: qemu-arm@nongnu.org
76
@@ -XXX,XX +XXX,XX @@ config MUSCA
70
@@ -XXX,XX +XXX,XX @@ L: qemu-arm@nongnu.org
77
71
S: Maintained
78
config MUSICPAL
72
F: hw/arm/palm.c
79
bool
73
80
+ select OR_IRQ
74
+Raspberry Pi
81
select BITBANG_I2C
75
+M: Peter Maydell <peter.maydell@linaro.org>
82
select MARVELL_88W8618
76
+R: Andrew Baumann <Andrew.Baumann@microsoft.com>
83
select PTIMER
77
+R: Philippe Mathieu-Daudé <f4bug@amsat.org>
78
+L: qemu-arm@nongnu.org
79
+S: Odd Fixes
80
+F: hw/arm/raspi_platform.h
81
+F: hw/*/bcm283*
82
+F: include/hw/arm/raspi*
83
+F: include/hw/*/bcm283*
84
+
85
Real View
86
M: Peter Maydell <peter.maydell@linaro.org>
87
L: qemu-arm@nongnu.org
88
@@ -XXX,XX +XXX,XX @@ F: hw/*/pxa2xx*
89
F: hw/misc/mst_fpga.c
90
F: include/hw/arm/pxa.h
91
92
+SABRELITE / i.MX6
93
+M: Peter Maydell <peter.maydell@linaro.org>
94
+R: Jean-Christophe Dubois <jcd@tribudubois.net>
95
+L: qemu-arm@nongnu.org
96
+S: Odd Fixes
97
+F: hw/arm/sabrelite.c
98
+F: hw/arm/fsl-imx6.c
99
+F: hw/misc/imx6_src.c
100
+F: hw/ssi/imx_spi.c
101
+F: include/hw/arm/fsl-imx6.h
102
+F: include/hw/misc/imx6_src.h
103
+F: include/hw/ssi/imx_spi.h
104
+
105
Sharp SL-5500 (Collie) PDA
106
M: Peter Maydell <peter.maydell@linaro.org>
107
L: qemu-arm@nongnu.org
108
@@ -XXX,XX +XXX,XX @@ L: qemu-arm@nongnu.org
109
S: Maintained
110
F: hw/*/stellaris*
111
112
+Versatile Express
113
+M: Peter Maydell <peter.maydell@linaro.org>
114
+L: qemu-arm@nongnu.org
115
+S: Maintained
116
+F: hw/arm/vexpress.c
117
+
118
Versatile PB
119
M: Peter Maydell <peter.maydell@linaro.org>
120
L: qemu-arm@nongnu.org
121
@@ -XXX,XX +XXX,XX @@ S: Maintained
122
F: hw/*/versatile*
123
F: hw/misc/arm_sysctl.c
124
125
+Virt
126
+M: Peter Maydell <peter.maydell@linaro.org>
127
+L: qemu-arm@nongnu.org
128
+S: Maintained
129
+F: hw/arm/virt*
130
+F: include/hw/arm/virt.h
131
+
132
Xilinx Zynq
133
M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
134
M: Alistair Francis <alistair@alistair23.me>
135
--
84
--
136
2.19.1
85
2.20.1
137
86
138
87
diff view generated by jsdifflib
1
From: Richard Henderson <richard.henderson@linaro.org>
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
2
3
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3
We don't need to fill the full pic[] array if we only use
4
Message-id: 20181113180154.17903-3-richard.henderson@linaro.org
4
few of the interrupt lines. Directly call qdev_get_gpio_in()
5
when necessary.
6
7
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8
Message-id: 20201107193403.436146-6-f4bug@amsat.org
5
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7
---
11
---
8
target/arm/kvm64.c | 90 ++++++++++++++++++++++++++++++++++++++++++++--
12
hw/arm/musicpal.c | 25 +++++++++++++------------
9
1 file changed, 88 insertions(+), 2 deletions(-)
13
1 file changed, 13 insertions(+), 12 deletions(-)
10
14
11
diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
15
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
12
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
13
--- a/target/arm/kvm64.c
17
--- a/hw/arm/musicpal.c
14
+++ b/target/arm/kvm64.c
18
+++ b/hw/arm/musicpal.c
15
@@ -XXX,XX +XXX,XX @@ static inline void unset_feature(uint64_t *features, int feature)
19
@@ -XXX,XX +XXX,XX @@ static struct arm_boot_info musicpal_binfo = {
16
*features &= ~(1ULL << feature);
20
static void musicpal_init(MachineState *machine)
17
}
18
19
+static int read_sys_reg32(int fd, uint32_t *pret, uint64_t id)
20
+{
21
+ uint64_t ret;
22
+ struct kvm_one_reg idreg = { .id = id, .addr = (uintptr_t)&ret };
23
+ int err;
24
+
25
+ assert((id & KVM_REG_SIZE_MASK) == KVM_REG_SIZE_U64);
26
+ err = ioctl(fd, KVM_GET_ONE_REG, &idreg);
27
+ if (err < 0) {
28
+ return -1;
29
+ }
30
+ *pret = ret;
31
+ return 0;
32
+}
33
+
34
+static int read_sys_reg64(int fd, uint64_t *pret, uint64_t id)
35
+{
36
+ struct kvm_one_reg idreg = { .id = id, .addr = (uintptr_t)pret };
37
+
38
+ assert((id & KVM_REG_SIZE_MASK) == KVM_REG_SIZE_U64);
39
+ return ioctl(fd, KVM_GET_ONE_REG, &idreg);
40
+}
41
+
42
bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
43
{
21
{
44
/* Identify the feature bits corresponding to the host CPU, and
22
ARMCPU *cpu;
45
* fill out the ARMHostCPUClass fields accordingly. To do this
23
- qemu_irq pic[32];
46
* we have to create a scratch VM, create a single CPU inside it,
24
DeviceState *dev;
47
* and then query that CPU for the relevant ID registers.
25
+ DeviceState *pic;
48
- * For AArch64 we currently don't care about ID registers at
26
DeviceState *uart_orgate;
49
- * all; we just want to know the CPU type.
27
DeviceState *i2c_dev;
50
*/
28
DeviceState *lcd_dev;
51
int fdarray[3];
29
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
52
uint64_t features = 0;
30
&error_fatal);
53
+ int err;
31
memory_region_add_subregion(address_space_mem, MP_SRAM_BASE, sram);
54
+
32
55
/* Old kernels may not know about the PREFERRED_TARGET ioctl: however
33
- dev = sysbus_create_simple(TYPE_MV88W8618_PIC, MP_PIC_BASE,
56
* we know these will only support creating one kind of guest CPU,
34
+ pic = sysbus_create_simple(TYPE_MV88W8618_PIC, MP_PIC_BASE,
57
* which is its preferred CPU type. Fortunately these old kernels
35
qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_IRQ));
58
@@ -XXX,XX +XXX,XX @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
36
- for (i = 0; i < 32; i++) {
59
ahcf->target = init.target;
37
- pic[i] = qdev_get_gpio_in(dev, i);
60
ahcf->dtb_compatible = "arm,arm-v8";
38
- }
61
39
- sysbus_create_varargs(TYPE_MV88W8618_PIT, MP_PIT_BASE, pic[MP_TIMER1_IRQ],
62
+ err = read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64pfr0,
40
- pic[MP_TIMER2_IRQ], pic[MP_TIMER3_IRQ],
63
+ ARM64_SYS_REG(3, 0, 0, 4, 0));
41
- pic[MP_TIMER4_IRQ], NULL);
64
+ if (unlikely(err < 0)) {
42
+ sysbus_create_varargs(TYPE_MV88W8618_PIT, MP_PIT_BASE,
65
+ /*
43
+ qdev_get_gpio_in(pic, MP_TIMER1_IRQ),
66
+ * Before v4.15, the kernel only exposed a limited number of system
44
+ qdev_get_gpio_in(pic, MP_TIMER2_IRQ),
67
+ * registers, not including any of the interesting AArch64 ID regs.
45
+ qdev_get_gpio_in(pic, MP_TIMER3_IRQ),
68
+ * For the most part we could leave these fields as zero with minimal
46
+ qdev_get_gpio_in(pic, MP_TIMER4_IRQ), NULL);
69
+ * effect, since this does not affect the values seen by the guest.
47
70
+ *
48
/* Logically OR both UART IRQs together */
71
+ * However, it could cause problems down the line for QEMU,
49
uart_orgate = DEVICE(object_new(TYPE_OR_IRQ));
72
+ * so provide a minimal v8.0 default.
50
object_property_set_int(OBJECT(uart_orgate), "num-lines", 2, &error_fatal);
73
+ *
51
qdev_realize_and_unref(uart_orgate, NULL, &error_fatal);
74
+ * ??? Could read MIDR and use knowledge from cpu64.c.
52
- qdev_connect_gpio_out(DEVICE(uart_orgate), 0, pic[MP_UART_SHARED_IRQ]);
75
+ * ??? Could map a page of memory into our temp guest and
53
+ qdev_connect_gpio_out(DEVICE(uart_orgate), 0,
76
+ * run the tiniest of hand-crafted kernels to extract
54
+ qdev_get_gpio_in(pic, MP_UART_SHARED_IRQ));
77
+ * the values seen by the guest.
55
78
+ * ??? Either of these sounds like too much effort just
56
serial_mm_init(address_space_mem, MP_UART1_BASE, 2,
79
+ * to work around running a modern host kernel.
57
qdev_get_gpio_in(uart_orgate, 0),
80
+ */
58
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
81
+ ahcf->isar.id_aa64pfr0 = 0x00000011; /* EL1&0, AArch64 only */
59
OBJECT(get_system_memory()), &error_fatal);
82
+ err = 0;
60
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
83
+ } else {
61
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, MP_ETH_BASE);
84
+ err |= read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64pfr1,
62
- sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[MP_ETH_IRQ]);
85
+ ARM64_SYS_REG(3, 0, 0, 4, 1));
63
+ sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0,
86
+ err |= read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64isar0,
64
+ qdev_get_gpio_in(pic, MP_ETH_IRQ));
87
+ ARM64_SYS_REG(3, 0, 0, 6, 0));
65
88
+ err |= read_sys_reg64(fdarray[2], &ahcf->isar.id_aa64isar1,
66
sysbus_create_simple("mv88w8618_wlan", MP_WLAN_BASE, NULL);
89
+ ARM64_SYS_REG(3, 0, 0, 6, 1));
67
90
+
68
sysbus_create_simple(TYPE_MUSICPAL_MISC, MP_MISC_BASE, NULL);
91
+ /*
69
92
+ * Note that if AArch32 support is not present in the host,
70
dev = sysbus_create_simple(TYPE_MUSICPAL_GPIO, MP_GPIO_BASE,
93
+ * the AArch32 sysregs are present to be read, but will
71
- pic[MP_GPIO_IRQ]);
94
+ * return UNKNOWN values. This is neither better nor worse
72
+ qdev_get_gpio_in(pic, MP_GPIO_IRQ));
95
+ * than skipping the reads and leaving 0, as we must avoid
73
i2c_dev = sysbus_create_simple("gpio_i2c", -1, NULL);
96
+ * considering the values in every case.
74
i2c = (I2CBus *)qdev_get_child_bus(i2c_dev, "i2c");
97
+ */
75
98
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_isar0,
76
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
99
+ ARM64_SYS_REG(3, 0, 0, 2, 0));
77
NULL);
100
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_isar1,
78
sysbus_realize_and_unref(s, &error_fatal);
101
+ ARM64_SYS_REG(3, 0, 0, 2, 1));
79
sysbus_mmio_map(s, 0, MP_AUDIO_BASE);
102
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_isar2,
80
- sysbus_connect_irq(s, 0, pic[MP_AUDIO_IRQ]);
103
+ ARM64_SYS_REG(3, 0, 0, 2, 2));
81
+ sysbus_connect_irq(s, 0, qdev_get_gpio_in(pic, MP_AUDIO_IRQ));
104
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_isar3,
82
105
+ ARM64_SYS_REG(3, 0, 0, 2, 3));
83
musicpal_binfo.ram_size = MP_RAM_DEFAULT_SIZE;
106
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_isar4,
84
arm_load_kernel(cpu, machine, &musicpal_binfo);
107
+ ARM64_SYS_REG(3, 0, 0, 2, 4));
108
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_isar5,
109
+ ARM64_SYS_REG(3, 0, 0, 2, 5));
110
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.id_isar6,
111
+ ARM64_SYS_REG(3, 0, 0, 2, 7));
112
+
113
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.mvfr0,
114
+ ARM64_SYS_REG(3, 0, 0, 3, 0));
115
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.mvfr1,
116
+ ARM64_SYS_REG(3, 0, 0, 3, 1));
117
+ err |= read_sys_reg32(fdarray[2], &ahcf->isar.mvfr2,
118
+ ARM64_SYS_REG(3, 0, 0, 3, 2));
119
+ }
120
+
121
kvm_arm_destroy_scratch_host_vcpu(fdarray);
122
123
+ if (err < 0) {
124
+ return false;
125
+ }
126
+
127
/* We can assume any KVM supporting CPU is at least a v8
128
* with VFPv4+Neon; this in turn implies most of the other
129
* feature bits.
130
--
85
--
131
2.19.1
86
2.20.1
132
87
133
88
diff view generated by jsdifflib
1
In practice for most of the more-or-less orphan Arm board models,
1
The nseries machines have a codepath that allows them to load a
2
I will review patches and put them in via the target-arm tree.
2
secondary bootloader. This code wasn't checking that the
3
So list myself as an "Odd Fixes" status maintainer for them.
3
load_image_targphys() succeeded. Check the return value and report
4
the error to the user.
4
5
5
This commit downgrades these boards to "Odd Fixes":
6
While we're in the vicinity, fix the comment style of the
6
* Allwinner-A10
7
comment documenting what this image load is doing.
7
* Exynos
8
* Calxeda Highbank
9
* Canon DIGIC
10
* Musicpal
11
* nSeries
12
* Palm
13
* PXA2xx
14
8
15
These boards were already "Odd Fixes":
9
Fixes: Coverity CID 1192904
16
* Gumstix
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
17
* i.MX31 (kzm)
11
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
12
Message-id: 20201103114918.11807-1-peter.maydell@linaro.org
13
---
14
hw/arm/nseries.c | 15 +++++++++++----
15
1 file changed, 11 insertions(+), 4 deletions(-)
18
16
19
Philippe Mathieu-Daudé has requested to be moved to R:
17
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
20
status for Gumstix now that I am listed as the M: contact.
21
22
Some boards are maintained, but their patches still go
23
via the target-arm tree, so add myself as a secondary
24
maintainer contact for those:
25
* Xilinx Zynq
26
* Xilinx ZynqMP
27
* STM32F205
28
* Netduino 2
29
* SmartFusion2
30
* Mecraft M2S-FG484
31
* ASPEED BMCs
32
* NRF51
33
34
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
35
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
36
Reviewed-by: Thomas Huth <thuth@redhat.com>
37
Message-id: 20181108134139.31666-1-peter.maydell@linaro.org
38
---
39
MAINTAINERS | 36 +++++++++++++++++++++++++++---------
40
1 file changed, 27 insertions(+), 9 deletions(-)
41
42
diff --git a/MAINTAINERS b/MAINTAINERS
43
index XXXXXXX..XXXXXXX 100644
18
index XXXXXXX..XXXXXXX 100644
44
--- a/MAINTAINERS
19
--- a/hw/arm/nseries.c
45
+++ b/MAINTAINERS
20
+++ b/hw/arm/nseries.c
46
@@ -XXX,XX +XXX,XX @@ ARM Machines
21
@@ -XXX,XX +XXX,XX @@ static void n8x0_init(MachineState *machine,
47
------------
22
/* No, wait, better start at the ROM. */
48
Allwinner-a10
23
s->mpu->cpu->env.regs[15] = OMAP2_Q2_BASE + 0x400000;
49
M: Beniamino Galvani <b.galvani@gmail.com>
24
50
+M: Peter Maydell <peter.maydell@linaro.org>
25
- /* This is intended for loading the `secondary.bin' program from
51
L: qemu-arm@nongnu.org
26
+ /*
52
-S: Maintained
27
+ * This is intended for loading the `secondary.bin' program from
53
+S: Odd Fixes
28
* Nokia images (the NOLO bootloader). The entry point seems
54
F: hw/*/allwinner*
29
* to be at OMAP2_Q2_BASE + 0x400000.
55
F: include/hw/*/allwinner*
30
*
56
F: hw/arm/cubieboard.c
31
@@ -XXX,XX +XXX,XX @@ static void n8x0_init(MachineState *machine,
57
@@ -XXX,XX +XXX,XX @@ F: tests/test-arm-mptimer.c
32
* for them the entry point needs to be set to OMAP2_SRAM_BASE.
58
33
*
59
Exynos
34
* The code above is for loading the `zImage' file from Nokia
60
M: Igor Mitsyanko <i.mitsyanko@gmail.com>
35
- * images. */
61
+M: Peter Maydell <peter.maydell@linaro.org>
36
- load_image_targphys(option_rom[0].name, OMAP2_Q2_BASE + 0x400000,
62
L: qemu-arm@nongnu.org
37
- machine->ram_size - 0x400000);
63
-S: Maintained
38
+ * images.
64
+S: Odd Fixes
39
+ */
65
F: hw/*/exynos*
40
+ if (load_image_targphys(option_rom[0].name,
66
F: include/hw/arm/exynos4210.h
41
+ OMAP2_Q2_BASE + 0x400000,
67
42
+ machine->ram_size - 0x400000) < 0) {
68
Calxeda Highbank
43
+ error_report("Failed to load secondary bootloader %s",
69
M: Rob Herring <robh@kernel.org>
44
+ option_rom[0].name);
70
+M: Peter Maydell <peter.maydell@linaro.org>
45
+ exit(EXIT_FAILURE);
71
L: qemu-arm@nongnu.org
46
+ }
72
-S: Maintained
47
73
+S: Odd Fixes
48
n800_setup_nolo_tags(nolo_tags);
74
F: hw/arm/highbank.c
49
cpu_physical_memory_write(OMAP2_SRAM_BASE, nolo_tags, 0x10000);
75
F: hw/net/xgmac.c
76
77
Canon DIGIC
78
M: Antony Pavlov <antonynpavlov@gmail.com>
79
+M: Peter Maydell <peter.maydell@linaro.org>
80
L: qemu-arm@nongnu.org
81
-S: Maintained
82
+S: Odd Fixes
83
F: include/hw/arm/digic.h
84
F: hw/*/digic*
85
86
Gumstix
87
-M: Philippe Mathieu-Daudé <f4bug@amsat.org>
88
+M: Peter Maydell <peter.maydell@linaro.org>
89
+R: Philippe Mathieu-Daudé <f4bug@amsat.org>
90
L: qemu-devel@nongnu.org
91
L: qemu-arm@nongnu.org
92
S: Odd Fixes
93
@@ -XXX,XX +XXX,XX @@ F: hw/arm/gumstix.c
94
95
i.MX31 (kzm)
96
M: Peter Chubb <peter.chubb@nicta.com.au>
97
+M: Peter Maydell <peter.maydell@linaro.org>
98
L: qemu-arm@nongnu.org
99
S: Odd Fixes
100
F: hw/arm/kzm.c
101
@@ -XXX,XX +XXX,XX @@ F: include/hw/misc/iotkit-sysinfo.h
102
103
Musicpal
104
M: Jan Kiszka <jan.kiszka@web.de>
105
+M: Peter Maydell <peter.maydell@linaro.org>
106
L: qemu-arm@nongnu.org
107
-S: Maintained
108
+S: Odd Fixes
109
F: hw/arm/musicpal.c
110
111
nSeries
112
M: Andrzej Zaborowski <balrogg@gmail.com>
113
+M: Peter Maydell <peter.maydell@linaro.org>
114
L: qemu-arm@nongnu.org
115
-S: Maintained
116
+S: Odd Fixes
117
F: hw/arm/nseries.c
118
119
Palm
120
M: Andrzej Zaborowski <balrogg@gmail.com>
121
+M: Peter Maydell <peter.maydell@linaro.org>
122
L: qemu-arm@nongnu.org
123
-S: Maintained
124
+S: Odd Fixes
125
F: hw/arm/palm.c
126
127
Raspberry Pi
128
@@ -XXX,XX +XXX,XX @@ F: include/hw/intc/realview_gic.h
129
130
PXA2XX
131
M: Andrzej Zaborowski <balrogg@gmail.com>
132
+M: Peter Maydell <peter.maydell@linaro.org>
133
L: qemu-arm@nongnu.org
134
-S: Maintained
135
+S: Odd Fixes
136
F: hw/arm/mainstone.c
137
F: hw/arm/spitz.c
138
F: hw/arm/tosa.c
139
@@ -XXX,XX +XXX,XX @@ F: include/hw/arm/virt.h
140
Xilinx Zynq
141
M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
142
M: Alistair Francis <alistair@alistair23.me>
143
+M: Peter Maydell <peter.maydell@linaro.org>
144
L: qemu-arm@nongnu.org
145
S: Maintained
146
F: hw/*/xilinx_*
147
@@ -XXX,XX +XXX,XX @@ X: hw/ssi/xilinx_*
148
Xilinx ZynqMP
149
M: Alistair Francis <alistair@alistair23.me>
150
M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
151
+M: Peter Maydell <peter.maydell@linaro.org>
152
L: qemu-arm@nongnu.org
153
S: Maintained
154
F: hw/*/xlnx*.c
155
@@ -XXX,XX +XXX,XX @@ F: hw/arm/virt-acpi-build.c
156
157
STM32F205
158
M: Alistair Francis <alistair@alistair23.me>
159
+M: Peter Maydell <peter.maydell@linaro.org>
160
S: Maintained
161
F: hw/arm/stm32f205_soc.c
162
F: hw/misc/stm32f2xx_syscfg.c
163
@@ -XXX,XX +XXX,XX @@ F: include/hw/*/stm32*.h
164
165
Netduino 2
166
M: Alistair Francis <alistair@alistair23.me>
167
+M: Peter Maydell <peter.maydell@linaro.org>
168
S: Maintained
169
F: hw/arm/netduino2.c
170
171
SmartFusion2
172
M: Subbaraya Sundeep <sundeep.lkml@gmail.com>
173
+M: Peter Maydell <peter.maydell@linaro.org>
174
S: Maintained
175
F: hw/arm/msf2-soc.c
176
F: hw/misc/msf2-sysreg.c
177
@@ -XXX,XX +XXX,XX @@ F: include/hw/ssi/mss-spi.h
178
179
Emcraft M2S-FG484
180
M: Subbaraya Sundeep <sundeep.lkml@gmail.com>
181
+M: Peter Maydell <peter.maydell@linaro.org>
182
S: Maintained
183
F: hw/arm/msf2-som.c
184
185
ASPEED BMCs
186
M: Cédric Le Goater <clg@kaod.org>
187
+M: Peter Maydell <peter.maydell@linaro.org>
188
R: Andrew Jeffery <andrew@aj.id.au>
189
R: Joel Stanley <joel@jms.id.au>
190
L: qemu-arm@nongnu.org
191
@@ -XXX,XX +XXX,XX @@ F: include/hw/net/ftgmac100.h
192
193
NRF51
194
M: Joel Stanley <joel@jms.id.au>
195
+M: Peter Maydell <peter.maydell@linaro.org>
196
L: qemu-arm@nongnu.org
197
S: Maintained
198
F: hw/arm/nrf51_soc.c
199
--
50
--
200
2.19.1
51
2.20.1
201
52
202
53
diff view generated by jsdifflib
1
From: Richard Henderson <richard.henderson@linaro.org>
1
From: Havard Skinnemoen <hskinnemoen@google.com>
2
2
3
The ID registers are replacing (some of) the feature bits.
3
The number of runs is equal to the number of 0-1 and 1-0 transitions,
4
We need (some of) these values to determine the set of data
4
plus one. Currently, it's counting the number of times these transitions
5
to be handled during migration.
5
do _not_ happen, plus one.
6
6
7
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
7
Source:
8
Message-id: 20181113180154.17903-2-richard.henderson@linaro.org
8
https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-22r1a.pdf
9
section 2.3.4 point (3).
10
11
Signed-off-by: Havard Skinnemoen <hskinnemoen@google.com>
12
Message-id: 20201103011457.2959989-2-hskinnemoen@google.com
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
13
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
15
---
12
target/arm/kvm_arm.h | 1 +
16
tests/qtest/npcm7xx_rng-test.c | 2 +-
13
target/arm/kvm.c | 1 +
17
1 file changed, 1 insertion(+), 1 deletion(-)
14
2 files changed, 2 insertions(+)
15
18
16
diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h
19
diff --git a/tests/qtest/npcm7xx_rng-test.c b/tests/qtest/npcm7xx_rng-test.c
17
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
18
--- a/target/arm/kvm_arm.h
21
--- a/tests/qtest/npcm7xx_rng-test.c
19
+++ b/target/arm/kvm_arm.h
22
+++ b/tests/qtest/npcm7xx_rng-test.c
20
@@ -XXX,XX +XXX,XX @@ void kvm_arm_destroy_scratch_host_vcpu(int *fdarray);
23
@@ -XXX,XX +XXX,XX @@ static double calc_runs_p(const unsigned long *buf, unsigned int nr_bits)
21
* by asking the host kernel)
24
pi = (double)nr_ones / nr_bits;
22
*/
25
23
typedef struct ARMHostCPUFeatures {
26
for (k = 0; k < nr_bits - 1; k++) {
24
+ ARMISARegisters isar;
27
- vn_obs += !(test_bit(k, buf) ^ test_bit(k + 1, buf));
25
uint64_t features;
28
+ vn_obs += (test_bit(k, buf) ^ test_bit(k + 1, buf));
26
uint32_t target;
29
}
27
const char *dtb_compatible;
30
vn_obs += 1;
28
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
29
index XXXXXXX..XXXXXXX 100644
30
--- a/target/arm/kvm.c
31
+++ b/target/arm/kvm.c
32
@@ -XXX,XX +XXX,XX @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu)
33
34
cpu->kvm_target = arm_host_cpu_features.target;
35
cpu->dtb_compatible = arm_host_cpu_features.dtb_compatible;
36
+ cpu->isar = arm_host_cpu_features.isar;
37
env->features = arm_host_cpu_features.features;
38
}
39
31
40
--
32
--
41
2.19.1
33
2.20.1
42
34
43
35
diff view generated by jsdifflib
1
Update the onenand device to use qemu_log_mask() for reporting
1
Checks for UNDEF cases should go before the "is VFP enabled?" access
2
guest errors and unimplemented features, rather than plain
2
check, except in special cases. Move a stray UNDEF check in the VTBL
3
fprintf() and hw_error().
3
trans function up above the access check.
4
5
(We leave the hw_error() in onenand_reset(), as that is
6
triggered by a failure to read the underlying block device
7
for the bootRAM, not by guest action.)
8
4
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
11
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
12
Reviewed-by: Thomas Huth <thuth@redhat.com>
7
Message-id: 20201109145324.2859-1-peter.maydell@linaro.org
13
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
14
Message-id: 20181115143535.5885-3-peter.maydell@linaro.org
15
---
8
---
16
hw/block/onenand.c | 22 +++++++++++++---------
9
target/arm/translate-neon.c.inc | 8 ++++----
17
1 file changed, 13 insertions(+), 9 deletions(-)
10
1 file changed, 4 insertions(+), 4 deletions(-)
18
11
19
diff --git a/hw/block/onenand.c b/hw/block/onenand.c
12
diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.inc
20
index XXXXXXX..XXXXXXX 100644
13
index XXXXXXX..XXXXXXX 100644
21
--- a/hw/block/onenand.c
14
--- a/target/arm/translate-neon.c.inc
22
+++ b/hw/block/onenand.c
15
+++ b/target/arm/translate-neon.c.inc
23
@@ -XXX,XX +XXX,XX @@
16
@@ -XXX,XX +XXX,XX @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
24
#include "exec/memory.h"
17
return false;
25
#include "hw/sysbus.h"
26
#include "qemu/error-report.h"
27
+#include "qemu/log.h"
28
29
/* 11 for 2kB-page OneNAND ("2nd generation") and 10 for 1kB-page chips */
30
#define PAGE_SHIFT    11
31
@@ -XXX,XX +XXX,XX @@ static void onenand_command(OneNANDState *s)
32
default:
33
s->status |= ONEN_ERR_CMD;
34
s->intstatus |= ONEN_INT;
35
- fprintf(stderr, "%s: unknown OneNAND command %x\n",
36
- __func__, s->command);
37
+ qemu_log_mask(LOG_GUEST_ERROR, "unknown OneNAND command %x\n",
38
+ s->command);
39
}
18
}
40
19
41
onenand_intr_update(s);
20
- if (!vfp_access_check(s)) {
42
@@ -XXX,XX +XXX,XX @@ static uint64_t onenand_read(void *opaque, hwaddr addr,
21
- return true;
43
case 0xff02:    /* ECC Result of spare area data */
22
- }
44
case 0xff03:    /* ECC Result of main area data */
23
-
45
case 0xff04:    /* ECC Result of spare area data */
24
if ((a->vn + a->len + 1) > 32) {
46
- hw_error("%s: implement ECC\n", __func__);
25
/*
47
+ qemu_log_mask(LOG_UNIMP,
26
* This is UNPREDICTABLE; we choose to UNDEF to avoid the
48
+ "onenand: ECC result registers unimplemented\n");
27
@@ -XXX,XX +XXX,XX @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
49
return 0x0000;
28
return false;
50
}
29
}
51
30
52
- fprintf(stderr, "%s: unknown OneNAND register %x\n",
31
+ if (!vfp_access_check(s)) {
53
- __func__, offset);
32
+ return true;
54
+ qemu_log_mask(LOG_GUEST_ERROR, "read of unknown OneNAND register 0x%x\n",
33
+ }
55
+ offset);
34
+
56
return 0;
35
desc = tcg_const_i32((a->vn << 2) | a->len);
57
}
36
def = tcg_temp_new_i64();
58
37
if (a->op) {
59
@@ -XXX,XX +XXX,XX @@ static void onenand_write(void *opaque, hwaddr addr,
60
break;
61
62
default:
63
- fprintf(stderr, "%s: unknown OneNAND boot command %"PRIx64"\n",
64
- __func__, value);
65
+ qemu_log_mask(LOG_GUEST_ERROR,
66
+ "unknown OneNAND boot command %" PRIx64 "\n",
67
+ value);
68
}
69
break;
70
71
@@ -XXX,XX +XXX,XX @@ static void onenand_write(void *opaque, hwaddr addr,
72
break;
73
74
default:
75
- fprintf(stderr, "%s: unknown OneNAND register %x\n",
76
- __func__, offset);
77
+ qemu_log_mask(LOG_GUEST_ERROR,
78
+ "write to unknown OneNAND register 0x%x\n",
79
+ offset);
80
}
81
}
82
83
--
38
--
84
2.19.1
39
2.20.1
85
40
86
41
diff view generated by jsdifflib