1
The following changes since commit 6eeea6725a70e6fcb5abba0764496bdab07ddfb3:
1
Patches for rc1: nothing major, just some minor bugfixes and
2
code cleanups.
2
3
3
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-10-06' into staging (2020-10-06 21:13:34 +0100)
4
-- PMM
5
6
The following changes since commit f7e1914adad8885a5d4c70239ab90d901ed97e9f:
7
8
Merge remote-tracking branch 'remotes/alistair/tags/pull-riscv-to-apply-20201109' into staging (2020-11-10 09:24:56 +0000)
4
9
5
are available in the Git repository at:
10
are available in the Git repository at:
6
11
7
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20201008
12
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20201110
8
13
9
for you to fetch changes up to ba118c26e16a97e6ff6de8184057d3420ce16a23:
14
for you to fetch changes up to b6c56c8a9a4064ea783f352f43c5df6231a110fa:
10
15
11
target/arm: Make '-cpu max' have a 48-bit PA (2020-10-08 15:24:32 +0100)
16
target/arm/translate-neon.c: Handle VTBL UNDEF case before VFP access check (2020-11-10 11:03:48 +0000)
12
17
13
----------------------------------------------------------------
18
----------------------------------------------------------------
14
target-arm queue:
19
target-arm queue:
15
* hw/ssi/npcm7xx_fiu: Fix handling of unsigned integer
20
* hw/arm/Kconfig: ARM_V7M depends on PTIMER
16
* hw/arm/fsl-imx25: Fix a typo
21
* Minor coding style fixes
17
* hw/arm/sbsa-ref : Fix SMMUv3 Initialisation
22
* docs: add some notes on the sbsa-ref machine
18
* hw/arm/sbsa-ref : allocate IRQs for SMMUv3
23
* hw/arm/virt: Remove dependency on Cortex-A15 MPCore peripherals
19
* hw/char/bcm2835_aux: Allow less than 32-bit accesses
24
* target/arm: Fix neon VTBL/VTBX for len > 1
20
* hw/arm/virt: Implement kvm-steal-time
25
* hw/arm/armsse: Correct expansion MPC interrupt lines
21
* target/arm: Make '-cpu max' have a 48-bit PA
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
22
33
23
----------------------------------------------------------------
34
----------------------------------------------------------------
24
Andrew Jones (6):
35
Alex Bennée (1):
25
linux headers: sync to 5.9-rc7
36
docs: add some notes on the sbsa-ref machine
26
target/arm/kvm: Make uncalled stubs explicitly unreachable
27
hw/arm/virt: Move post cpu realize check into its own function
28
hw/arm/virt: Move kvm pmu setup to virt_cpu_post_init
29
tests/qtest: Restore aarch64 arm-cpu-features test
30
hw/arm/virt: Implement kvm-steal-time
31
37
32
Graeme Gregory (2):
38
AlexChen (1):
33
hw/arm/sbsa-ref : Fix SMMUv3 Initialisation
39
ssi: Fix bad printf format specifiers
34
hw/arm/sbsa-ref : allocate IRQs for SMMUv3
35
40
36
Peter Maydell (1):
41
Andrew Jones (1):
37
target/arm: Make '-cpu max' have a 48-bit PA
42
hw/arm/Kconfig: ARM_V7M depends on PTIMER
38
43
39
Philippe Mathieu-Daudé (3):
44
Havard Skinnemoen (1):
40
hw/ssi/npcm7xx_fiu: Fix handling of unsigned integer
45
tests/qtest/npcm7xx_rng-test: count runs properly
41
hw/arm/fsl-imx25: Fix a typo
42
hw/char/bcm2835_aux: Allow less than 32-bit accesses
43
46
44
docs/system/arm/cpu-features.rst | 11 ++++
47
Peter Maydell (2):
45
include/hw/arm/fsl-imx25.h | 2 +-
48
hw/arm/nseries: Check return value from load_image_targphys()
46
include/hw/arm/virt.h | 5 ++
49
target/arm/translate-neon.c: Handle VTBL UNDEF case before VFP access check
47
linux-headers/linux/kvm.h | 6 ++-
48
target/arm/cpu.h | 4 ++
49
target/arm/kvm_arm.h | 94 ++++++++++++++++++++++++++-------
50
hw/arm/sbsa-ref.c | 3 +-
51
hw/arm/virt.c | 110 ++++++++++++++++++++++++++++-----------
52
hw/char/bcm2835_aux.c | 4 +-
53
hw/ssi/npcm7xx_fiu.c | 12 ++---
54
target/arm/cpu.c | 8 +++
55
target/arm/cpu64.c | 4 ++
56
target/arm/kvm.c | 16 ++++++
57
target/arm/kvm64.c | 64 +++++++++++++++++++++--
58
target/arm/monitor.c | 2 +-
59
tests/qtest/arm-cpu-features.c | 25 +++++++--
60
hw/ssi/trace-events | 2 +-
61
tests/qtest/meson.build | 3 +-
62
18 files changed, 303 insertions(+), 72 deletions(-)
63
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
From: Andrew Jones <drjones@redhat.com>
1
From: Andrew Jones <drjones@redhat.com>
2
2
3
Update against Linux 5.9-rc7.
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.
4
6
5
Cc: Paolo Bonzini <pbonzini@redhat.com>
6
Signed-off-by: Andrew Jones <drjones@redhat.com>
7
Signed-off-by: Andrew Jones <drjones@redhat.com>
7
Message-id: 20201001061718.101915-2-drjones@redhat.com
8
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
9
Message-id: 20201104103343.30392-1-drjones@redhat.com
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
---
11
---
10
linux-headers/linux/kvm.h | 6 ++++--
12
hw/arm/Kconfig | 1 +
11
1 file changed, 4 insertions(+), 2 deletions(-)
13
1 file changed, 1 insertion(+)
12
14
13
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
15
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
14
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
15
--- a/linux-headers/linux/kvm.h
17
--- a/hw/arm/Kconfig
16
+++ b/linux-headers/linux/kvm.h
18
+++ b/hw/arm/Kconfig
17
@@ -XXX,XX +XXX,XX @@ struct kvm_ppc_resize_hpt {
19
@@ -XXX,XX +XXX,XX @@ config ZYNQ
18
#define KVM_VM_PPC_HV 1
20
19
#define KVM_VM_PPC_PR 2
21
config ARM_V7M
20
22
bool
21
-/* on MIPS, 0 forces trap & emulate, 1 forces VZ ASE */
23
+ select PTIMER
22
-#define KVM_VM_MIPS_TE        0
24
23
+/* on MIPS, 0 indicates auto, 1 forces VZ ASE, 2 forces trap & emulate */
25
config ALLWINNER_A10
24
+#define KVM_VM_MIPS_AUTO    0
26
bool
25
#define KVM_VM_MIPS_VZ        1
26
+#define KVM_VM_MIPS_TE        2
27
28
#define KVM_S390_SIE_PAGE_OFFSET 1
29
30
@@ -XXX,XX +XXX,XX @@ struct kvm_ppc_resize_hpt {
31
#define KVM_CAP_LAST_CPU 184
32
#define KVM_CAP_SMALLER_MAXPHYADDR 185
33
#define KVM_CAP_S390_DIAG318 186
34
+#define KVM_CAP_STEAL_TIME 187
35
36
#ifdef KVM_CAP_IRQ_ROUTING
37
38
--
27
--
39
2.20.1
28
2.20.1
40
29
41
30
diff view generated by jsdifflib
1
From: Andrew Jones <drjones@redhat.com>
1
From: AlexChen <alex.chen@huawei.com>
2
2
3
We'll add more to this new function in coming patches so we also
3
We should use printf format specifier "%u" instead of "%d" for
4
state the gic must be created and call it below create_gic().
4
argument of type "unsigned int".
5
5
6
No functional change intended.
6
Reported-by: Euler Robot <euler.robot@huawei.com>
7
7
Signed-off-by: Alex Chen <alex.chen@huawei.com>
8
Reviewed-by: Eric Auger <eric.auger@redhat.com>
8
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
9
Message-id: 5FA280F5.8060902@huawei.com
10
Signed-off-by: Andrew Jones <drjones@redhat.com>
11
Message-id: 20201001061718.101915-4-drjones@redhat.com
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
---
11
---
14
hw/arm/virt.c | 43 +++++++++++++++++++++++++++----------------
12
hw/ssi/imx_spi.c | 2 +-
15
1 file changed, 27 insertions(+), 16 deletions(-)
13
hw/ssi/xilinx_spi.c | 2 +-
14
2 files changed, 2 insertions(+), 2 deletions(-)
16
15
17
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
16
diff --git a/hw/ssi/imx_spi.c b/hw/ssi/imx_spi.c
18
index XXXXXXX..XXXXXXX 100644
17
index XXXXXXX..XXXXXXX 100644
19
--- a/hw/arm/virt.c
18
--- a/hw/ssi/imx_spi.c
20
+++ b/hw/arm/virt.c
19
+++ b/hw/ssi/imx_spi.c
21
@@ -XXX,XX +XXX,XX @@ static void finalize_gic_version(VirtMachineState *vms)
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;
22
}
27
}
23
}
28
}
24
29
diff --git a/hw/ssi/xilinx_spi.c b/hw/ssi/xilinx_spi.c
25
+/*
30
index XXXXXXX..XXXXXXX 100644
26
+ * virt_cpu_post_init() must be called after the CPUs have
31
--- a/hw/ssi/xilinx_spi.c
27
+ * been realized and the GIC has been created.
32
+++ b/hw/ssi/xilinx_spi.c
28
+ */
33
@@ -XXX,XX +XXX,XX @@ static void xlx_spi_update_irq(XilinxSPI *s)
29
+static void virt_cpu_post_init(VirtMachineState *vms)
34
irq chain unless things really changed. */
30
+{
35
if (pending != s->irqline) {
31
+ bool aarch64;
36
s->irqline = pending;
32
+
37
- DB_PRINT("irq_change of state %d ISR:%x IER:%X\n",
33
+ aarch64 = object_property_get_bool(OBJECT(first_cpu), "aarch64", NULL);
38
+ DB_PRINT("irq_change of state %u ISR:%x IER:%X\n",
34
+
39
pending, s->regs[R_IPISR], s->regs[R_IPIER]);
35
+ if (!kvm_enabled()) {
40
qemu_set_irq(s->irq, pending);
36
+ if (aarch64 && vms->highmem) {
41
}
37
+ int requested_pa_size = 64 - clz64(vms->highest_gpa);
38
+ int pamax = arm_pamax(ARM_CPU(first_cpu));
39
+
40
+ if (pamax < requested_pa_size) {
41
+ error_report("VCPU supports less PA bits (%d) than "
42
+ "requested by the memory map (%d)",
43
+ pamax, requested_pa_size);
44
+ exit(1);
45
+ }
46
+ }
47
+ }
48
+}
49
+
50
static void machvirt_init(MachineState *machine)
51
{
52
VirtMachineState *vms = VIRT_MACHINE(machine);
53
@@ -XXX,XX +XXX,XX @@ static void machvirt_init(MachineState *machine)
54
fdt_add_timer_nodes(vms);
55
fdt_add_cpu_nodes(vms);
56
57
- if (!kvm_enabled()) {
58
- ARMCPU *cpu = ARM_CPU(first_cpu);
59
- bool aarch64 = object_property_get_bool(OBJECT(cpu), "aarch64", NULL);
60
-
61
- if (aarch64 && vms->highmem) {
62
- int requested_pa_size, pamax = arm_pamax(cpu);
63
-
64
- requested_pa_size = 64 - clz64(vms->highest_gpa);
65
- if (pamax < requested_pa_size) {
66
- error_report("VCPU supports less PA bits (%d) than requested "
67
- "by the memory map (%d)", pamax, requested_pa_size);
68
- exit(1);
69
- }
70
- }
71
- }
72
-
73
memory_region_add_subregion(sysmem, vms->memmap[VIRT_MEM].base,
74
machine->ram);
75
if (machine->device_memory) {
76
@@ -XXX,XX +XXX,XX @@ static void machvirt_init(MachineState *machine)
77
78
create_gic(vms);
79
80
+ virt_cpu_post_init(vms);
81
+
82
fdt_add_pmu_nodes(vms);
83
84
create_uart(vms, VIRT_UART, sysmem, serial_hd(0));
85
--
42
--
86
2.20.1
43
2.20.1
87
44
88
45
diff view generated by jsdifflib
1
From: Andrew Jones <drjones@redhat.com>
1
From: Xinhao Zhang <zhangxinhao1@huawei.com>
2
2
3
Move the KVM PMU setup part of fdt_add_pmu_nodes() to
3
Fix code style. Operator needs spaces both sides.
4
virt_cpu_post_init(), which is a more appropriate location. Now
5
fdt_add_pmu_nodes() is also named more appropriately, because it
6
no longer does anything but fdt node creation.
7
4
8
No functional change intended.
5
Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
9
6
Signed-off-by: Kai Deng <dengkai1@huawei.com>
7
Message-id: 20201103114529.638233-1-zhangxinhao1@huawei.com
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
8
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
11
Reviewed-by: Eric Auger <eric.auger@redhat.com>
12
Signed-off-by: Andrew Jones <drjones@redhat.com>
13
Message-id: 20201001061718.101915-5-drjones@redhat.com
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
15
---
10
---
16
hw/arm/virt.c | 34 ++++++++++++++++++----------------
11
target/arm/arch_dump.c | 8 ++++----
17
1 file changed, 18 insertions(+), 16 deletions(-)
12
target/arm/arm-semi.c | 8 ++++----
13
target/arm/helper.c | 2 +-
14
3 files changed, 9 insertions(+), 9 deletions(-)
18
15
19
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
16
diff --git a/target/arm/arch_dump.c b/target/arm/arch_dump.c
20
index XXXXXXX..XXXXXXX 100644
17
index XXXXXXX..XXXXXXX 100644
21
--- a/hw/arm/virt.c
18
--- a/target/arm/arch_dump.c
22
+++ b/hw/arm/virt.c
19
+++ b/target/arm/arch_dump.c
23
@@ -XXX,XX +XXX,XX @@ static void fdt_add_gic_node(VirtMachineState *vms)
20
@@ -XXX,XX +XXX,XX @@ static int aarch64_write_elf64_prfpreg(WriteCoreDumpFunction f,
24
21
25
static void fdt_add_pmu_nodes(const VirtMachineState *vms)
22
for (i = 0; i < 32; ++i) {
26
{
23
uint64_t *q = aa64_vfp_qreg(env, i);
27
- CPUState *cpu;
24
- note.vfp.vregs[2*i + 0] = cpu_to_dump64(s, q[0]);
28
- ARMCPU *armcpu;
25
- note.vfp.vregs[2*i + 1] = cpu_to_dump64(s, q[1]);
29
+ ARMCPU *armcpu = ARM_CPU(first_cpu);
26
+ note.vfp.vregs[2 * i + 0] = cpu_to_dump64(s, q[0]);
30
uint32_t irqflags = GIC_FDT_IRQ_FLAGS_LEVEL_HI;
27
+ note.vfp.vregs[2 * i + 1] = cpu_to_dump64(s, q[1]);
31
32
- CPU_FOREACH(cpu) {
33
- armcpu = ARM_CPU(cpu);
34
- if (!arm_feature(&armcpu->env, ARM_FEATURE_PMU)) {
35
- return;
36
- }
37
- if (kvm_enabled()) {
38
- if (kvm_irqchip_in_kernel()) {
39
- kvm_arm_pmu_set_irq(cpu, PPI(VIRTUAL_PMU_IRQ));
40
- }
41
- kvm_arm_pmu_init(cpu);
42
- }
43
+ if (!arm_feature(&armcpu->env, ARM_FEATURE_PMU)) {
44
+ assert(!object_property_get_bool(OBJECT(armcpu), "pmu", NULL));
45
+ return;
46
}
28
}
47
29
48
if (vms->gic_version == VIRT_GIC_VERSION_2) {
30
if (s->dump_info.d_endian == ELFDATA2MSB) {
49
@@ -XXX,XX +XXX,XX @@ static void fdt_add_pmu_nodes(const VirtMachineState *vms)
31
@@ -XXX,XX +XXX,XX @@ static int aarch64_write_elf64_prfpreg(WriteCoreDumpFunction f,
50
(1 << vms->smp_cpus) - 1);
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
}
51
}
40
}
52
41
53
- armcpu = ARM_CPU(qemu_get_cpu(0));
42
diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c
54
qemu_fdt_add_subnode(vms->fdt, "/pmu");
43
index XXXXXXX..XXXXXXX 100644
55
if (arm_feature(&armcpu->env, ARM_FEATURE_V8)) {
44
--- a/target/arm/arm-semi.c
56
const char compat[] = "arm,armv8-pmuv3";
45
+++ b/target/arm/arm-semi.c
57
@@ -XXX,XX +XXX,XX @@ static void finalize_gic_version(VirtMachineState *vms)
46
@@ -XXX,XX +XXX,XX @@ target_ulong do_arm_semihosting(CPUARMState *env)
58
*/
47
if (use_gdb_syscalls()) {
59
static void virt_cpu_post_init(VirtMachineState *vms)
48
arm_semi_open_guestfd = guestfd;
60
{
49
ret = arm_gdb_syscall(cpu, arm_semi_open_cb, "open,%s,%x,1a4", arg0,
61
- bool aarch64;
50
- (int)arg2+1, gdb_open_modeflags[arg1]);
62
+ bool aarch64, pmu;
51
+ (int)arg2 + 1, gdb_open_modeflags[arg1]);
63
+ CPUState *cpu;
52
} else {
64
53
ret = set_swi_errno(env, open(s, open_modeflags[arg1], 0644));
65
aarch64 = object_property_get_bool(OBJECT(first_cpu), "aarch64", NULL);
54
if (ret == (uint32_t)-1) {
66
+ pmu = object_property_get_bool(OBJECT(first_cpu), "pmu", NULL);
55
@@ -XXX,XX +XXX,XX @@ target_ulong do_arm_semihosting(CPUARMState *env)
67
56
GET_ARG(1);
68
- if (!kvm_enabled()) {
57
if (use_gdb_syscalls()) {
69
+ if (kvm_enabled()) {
58
ret = arm_gdb_syscall(cpu, arm_semi_cb, "unlink,%s",
70
+ CPU_FOREACH(cpu) {
59
- arg0, (int)arg1+1);
71
+ if (pmu) {
60
+ arg0, (int)arg1 + 1);
72
+ assert(arm_feature(&ARM_CPU(cpu)->env, ARM_FEATURE_PMU));
61
} else {
73
+ if (kvm_irqchip_in_kernel()) {
62
s = lock_user_string(arg0);
74
+ kvm_arm_pmu_set_irq(cpu, PPI(VIRTUAL_PMU_IRQ));
63
if (!s) {
75
+ }
64
@@ -XXX,XX +XXX,XX @@ target_ulong do_arm_semihosting(CPUARMState *env)
76
+ kvm_arm_pmu_init(cpu);
65
GET_ARG(3);
77
+ }
66
if (use_gdb_syscalls()) {
78
+ }
67
return arm_gdb_syscall(cpu, arm_semi_cb, "rename,%s,%s",
79
+ } else {
68
- arg0, (int)arg1+1, arg2, (int)arg3+1);
80
if (aarch64 && vms->highmem) {
69
+ arg0, (int)arg1 + 1, arg2, (int)arg3 + 1);
81
int requested_pa_size = 64 - clz64(vms->highest_gpa);
70
} else {
82
int pamax = arm_pamax(ARM_CPU(first_cpu));
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
}
83
--
95
--
84
2.20.1
96
2.20.1
85
97
86
98
diff view generated by jsdifflib
New patch
1
From: Xinhao Zhang <zhangxinhao1@huawei.com>
1
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>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
12
target/arm/translate-a64.c | 4 ++--
13
1 file changed, 2 insertions(+), 2 deletions(-)
14
15
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/target/arm/translate-a64.c
18
+++ b/target/arm/translate-a64.c
19
@@ -XXX,XX +XXX,XX @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn)
20
gen_helper_advsimd_acgt_f16(tcg_res, tcg_op1, tcg_op2, fpst);
21
break;
22
default:
23
- fprintf(stderr, "%s: insn %#04x, fpop %#2x @ %#" PRIx64 "\n",
24
+ fprintf(stderr, "%s: insn 0x%04x, fpop 0x%2x @ 0x%" PRIx64 "\n",
25
__func__, insn, fpopcode, s->pc_curr);
26
g_assert_not_reached();
27
}
28
@@ -XXX,XX +XXX,XX @@ static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn)
29
case 0x7f: /* FSQRT (vector) */
30
break;
31
default:
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
}
36
37
--
38
2.20.1
39
40
diff view generated by jsdifflib
New patch
1
From: Xinhao Zhang <zhangxinhao1@huawei.com>
1
2
3
Fix code style. Space required before the open parenthesis '('.
4
5
Signed-off-by: Xinhao Zhang <zhangxinhao1@huawei.com>
6
Signed-off-by: Kai Deng <dengkai1@huawei.com>
7
Message-id: 20201103114529.638233-3-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/translate.c | 2 +-
12
1 file changed, 1 insertion(+), 1 deletion(-)
13
14
diff --git a/target/arm/translate.c b/target/arm/translate.c
15
index XXXXXXX..XXXXXXX 100644
16
--- a/target/arm/translate.c
17
+++ b/target/arm/translate.c
18
@@ -XXX,XX +XXX,XX @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
19
- Hardware watchpoints.
20
Hardware breakpoints have already been handled and skip this code.
21
*/
22
- switch(dc->base.is_jmp) {
23
+ switch (dc->base.is_jmp) {
24
case DISAS_NEXT:
25
case DISAS_TOO_MANY:
26
gen_goto_tb(dc, 1, dc->base.pc_next);
27
--
28
2.20.1
29
30
diff view generated by jsdifflib
1
From: Graeme Gregory <graeme@nuviainc.com>
1
From: Alex Bennée <alex.bennee@linaro.org>
2
2
3
Original commit did not allocate IRQs for the SMMUv3 in the irqmap
3
We should at least document what this machine is about.
4
effectively using irq 0->3 (shared with other devices). Assuming
5
original intent was to allocate unique IRQs then add an allocation
6
to the irqmap.
7
4
8
Fixes: e9fdf453240 ("hw/arm: Add arm SBSA reference machine, devices part")
5
Reviewed-by: Graeme Gregory <graeme@nuviainc.com>
9
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
10
Signed-off-by: Graeme Gregory <graeme@nuviainc.com>
7
Message-id: 20201104165254.24822-1-alex.bennee@linaro.org
11
Reviewed-by: Eric Auger <eric.auger@redhat.com>
8
Cc: Leif Lindholm <leif@nuviainc.com>
12
Message-id: 20201007100732.4103790-3-graeme@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]
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
---
13
---
15
hw/arm/sbsa-ref.c | 1 +
14
docs/system/arm/sbsa.rst | 32 ++++++++++++++++++++++++++++++++
16
1 file changed, 1 insertion(+)
15
docs/system/target-arm.rst | 1 +
16
2 files changed, 33 insertions(+)
17
create mode 100644 docs/system/arm/sbsa.rst
17
18
18
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
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
19
index XXXXXXX..XXXXXXX 100644
58
index XXXXXXX..XXXXXXX 100644
20
--- a/hw/arm/sbsa-ref.c
59
--- a/docs/system/target-arm.rst
21
+++ b/hw/arm/sbsa-ref.c
60
+++ b/docs/system/target-arm.rst
22
@@ -XXX,XX +XXX,XX @@ static const int sbsa_ref_irqmap[] = {
61
@@ -XXX,XX +XXX,XX @@ undocumented; you can get a complete list by running
23
[SBSA_SECURE_UART_MM] = 9,
62
arm/mps2
24
[SBSA_AHCI] = 10,
63
arm/musca
25
[SBSA_EHCI] = 11,
64
arm/realview
26
+ [SBSA_SMMU] = 12, /* ... to 15 */
65
+ arm/sbsa
27
};
66
arm/versatile
28
67
arm/vexpress
29
static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx)
68
arm/aspeed
30
--
69
--
31
2.20.1
70
2.20.1
32
71
33
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: Andrew Jones <drjones@redhat.com>
1
From: Richard Henderson <richard.henderson@linaro.org>
2
2
3
We add the kvm-steal-time CPU property and implement it for machvirt.
3
The helper function did not get updated when we reorganized
4
A tiny bit of refactoring was also done to allow pmu and pvtime to
4
the vector register file for SVE. Since then, the neon dregs
5
use the same vcpu device helper functions.
5
are non-sequential and cannot be simply indexed.
6
6
7
Reviewed-by: Eric Auger <eric.auger@redhat.com>
7
At the same time, make the helper function operate on 64-bit
8
Signed-off-by: Andrew Jones <drjones@redhat.com>
8
quantities so that we do not have to call it twice.
9
Message-id: 20201001061718.101915-7-drjones@redhat.com
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>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
17
---
12
docs/system/arm/cpu-features.rst | 11 ++++++
18
target/arm/helper.h | 2 +-
13
include/hw/arm/virt.h | 5 +++
19
target/arm/op_helper.c | 23 +++++++++--------
14
target/arm/cpu.h | 4 ++
20
target/arm/translate-neon.c.inc | 44 +++++++++++----------------------
15
target/arm/kvm_arm.h | 43 +++++++++++++++++++++
21
3 files changed, 29 insertions(+), 40 deletions(-)
16
hw/arm/virt.c | 43 +++++++++++++++++++--
17
target/arm/cpu.c | 8 ++++
18
target/arm/kvm.c | 16 ++++++++
19
target/arm/kvm64.c | 64 +++++++++++++++++++++++++++++---
20
target/arm/monitor.c | 2 +-
21
tests/qtest/arm-cpu-features.c | 25 +++++++++++--
22
10 files changed, 208 insertions(+), 13 deletions(-)
23
22
24
diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-features.rst
23
diff --git a/target/arm/helper.h b/target/arm/helper.h
25
index XXXXXXX..XXXXXXX 100644
24
index XXXXXXX..XXXXXXX 100644
26
--- a/docs/system/arm/cpu-features.rst
25
--- a/target/arm/helper.h
27
+++ b/docs/system/arm/cpu-features.rst
26
+++ b/target/arm/helper.h
28
@@ -XXX,XX +XXX,XX @@ the list of KVM VCPU features and their descriptions.
27
@@ -XXX,XX +XXX,XX @@ DEF_HELPER_FLAGS_2(rsqrte_f32, TCG_CALL_NO_RWG, f32, f32, ptr)
29
adjustment, also restoring the legacy (pre-5.0)
28
DEF_HELPER_FLAGS_2(rsqrte_f64, TCG_CALL_NO_RWG, f64, f64, ptr)
30
behavior.
29
DEF_HELPER_FLAGS_1(recpe_u32, TCG_CALL_NO_RWG, i32, i32)
31
30
DEF_HELPER_FLAGS_1(rsqrte_u32, TCG_CALL_NO_RWG, i32, i32)
32
+ kvm-steal-time Since v5.2, kvm-steal-time is enabled by
31
-DEF_HELPER_FLAGS_4(neon_tbl, TCG_CALL_NO_RWG, i32, i32, i32, ptr, i32)
33
+ default when KVM is enabled, the feature is
32
+DEF_HELPER_FLAGS_4(neon_tbl, TCG_CALL_NO_RWG, i64, env, i32, i64, i64)
34
+ supported, and the guest is 64-bit.
33
35
+
34
DEF_HELPER_3(shl_cc, i32, env, i32, i32)
36
+ When kvm-steal-time is enabled a 64-bit guest
35
DEF_HELPER_3(shr_cc, i32, env, i32, i32)
37
+ can account for time its CPUs were not running
36
diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c
38
+ due to the host not scheduling the corresponding
39
+ VCPU threads. The accounting statistics may
40
+ influence the guest scheduler behavior and/or be
41
+ exposed to the guest userspace.
42
+
43
SVE CPU Properties
44
==================
45
46
diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
47
index XXXXXXX..XXXXXXX 100644
37
index XXXXXXX..XXXXXXX 100644
48
--- a/include/hw/arm/virt.h
38
--- a/target/arm/op_helper.c
49
+++ b/include/hw/arm/virt.h
39
+++ b/target/arm/op_helper.c
50
@@ -XXX,XX +XXX,XX @@
40
@@ -XXX,XX +XXX,XX @@ void raise_exception_ra(CPUARMState *env, uint32_t excp, uint32_t syndrome,
51
41
cpu_loop_exit_restore(cs, ra);
52
#define PPI(irq) ((irq) + 16)
42
}
53
43
54
+/* See Linux kernel arch/arm64/include/asm/pvclock-abi.h */
44
-uint32_t HELPER(neon_tbl)(uint32_t ireg, uint32_t def, void *vn,
55
+#define PVTIME_SIZE_PER_CPU 64
45
- uint32_t maxindex)
56
+
46
+uint64_t HELPER(neon_tbl)(CPUARMState *env, uint32_t desc,
57
enum {
47
+ uint64_t ireg, uint64_t def)
58
VIRT_FLASH,
48
{
59
VIRT_MEM,
49
- uint32_t val, shift;
60
@@ -XXX,XX +XXX,XX @@ enum {
50
- uint64_t *table = vn;
61
VIRT_PCDIMM_ACPI,
51
+ uint64_t tmp, val = 0;
62
VIRT_ACPI_GED,
52
+ uint32_t maxindex = ((desc & 3) + 1) * 8;
63
VIRT_NVDIMM_ACPI,
53
+ uint32_t base_reg = desc >> 2;
64
+ VIRT_PVTIME,
54
+ uint32_t shift, index, reg;
65
VIRT_LOWMEMMAP_LAST,
55
66
};
56
- val = 0;
67
57
- for (shift = 0; shift < 32; shift += 8) {
68
@@ -XXX,XX +XXX,XX @@ struct VirtMachineClass {
58
- uint32_t index = (ireg >> shift) & 0xff;
69
bool no_highmem_ecam;
59
+ for (shift = 0; shift < 64; shift += 8) {
70
bool no_ged; /* Machines < 4.2 has no support for ACPI GED device */
60
+ index = (ireg >> shift) & 0xff;
71
bool kvm_no_adjvtime;
61
if (index < maxindex) {
72
+ bool no_kvm_steal_time;
62
- uint32_t tmp = (table[index >> 3] >> ((index & 7) << 3)) & 0xff;
73
bool acpi_expose_flash;
63
- val |= tmp << shift;
74
};
64
+ reg = base_reg + (index >> 3);
75
65
+ tmp = *aa32_vfp_dreg(env, reg);
76
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
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
77
index XXXXXXX..XXXXXXX 100644
76
index XXXXXXX..XXXXXXX 100644
78
--- a/target/arm/cpu.h
77
--- a/target/arm/translate-neon.c.inc
79
+++ b/target/arm/cpu.h
78
+++ b/target/arm/translate-neon.c.inc
80
@@ -XXX,XX +XXX,XX @@
79
@@ -XXX,XX +XXX,XX @@ static bool trans_VEXT(DisasContext *s, arg_VEXT *a)
81
#include "hw/registerfields.h"
80
82
#include "cpu-qom.h"
81
static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
83
#include "exec/cpu-defs.h"
84
+#include "qapi/qapi-types-common.h"
85
86
/* ARM processors have a weak memory model */
87
#define TCG_GUEST_DEFAULT_MO (0)
88
@@ -XXX,XX +XXX,XX @@ struct ARMCPU {
89
bool kvm_vtime_dirty;
90
uint64_t kvm_vtime;
91
92
+ /* KVM steal time */
93
+ OnOffAuto kvm_steal_time;
94
+
95
/* Uniprocessor system with MP extensions */
96
bool mp_is_up;
97
98
diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h
99
index XXXXXXX..XXXXXXX 100644
100
--- a/target/arm/kvm_arm.h
101
+++ b/target/arm/kvm_arm.h
102
@@ -XXX,XX +XXX,XX @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu);
103
*/
104
void kvm_arm_add_vcpu_properties(Object *obj);
105
106
+/**
107
+ * kvm_arm_steal_time_finalize:
108
+ * @cpu: ARMCPU for which to finalize kvm-steal-time
109
+ * @errp: Pointer to Error* for error propagation
110
+ *
111
+ * Validate the kvm-steal-time property selection and set its default
112
+ * based on KVM support and guest configuration.
113
+ */
114
+void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp);
115
+
116
+/**
117
+ * kvm_arm_steal_time_supported:
118
+ *
119
+ * Returns: true if KVM can enable steal time reporting
120
+ * and false otherwise.
121
+ */
122
+bool kvm_arm_steal_time_supported(void);
123
+
124
/**
125
* kvm_arm_aarch32_supported:
126
*
127
@@ -XXX,XX +XXX,XX @@ int kvm_arm_vgic_probe(void);
128
129
void kvm_arm_pmu_set_irq(CPUState *cs, int irq);
130
void kvm_arm_pmu_init(CPUState *cs);
131
+
132
+/**
133
+ * kvm_arm_pvtime_init:
134
+ * @cs: CPUState
135
+ * @ipa: Per-vcpu guest physical base address of the pvtime structures
136
+ *
137
+ * Initializes PVTIME for the VCPU, setting the PVTIME IPA to @ipa.
138
+ */
139
+void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa);
140
+
141
int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level);
142
143
#else
144
@@ -XXX,XX +XXX,XX @@ static inline bool kvm_arm_sve_supported(void)
145
return false;
146
}
147
148
+static inline bool kvm_arm_steal_time_supported(void)
149
+{
150
+ return false;
151
+}
152
+
153
/*
154
* These functions should never actually be called without KVM support.
155
*/
156
@@ -XXX,XX +XXX,XX @@ static inline void kvm_arm_pmu_init(CPUState *cs)
157
g_assert_not_reached();
158
}
159
160
+static inline void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa)
161
+{
162
+ g_assert_not_reached();
163
+}
164
+
165
+static inline void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp)
166
+{
167
+ g_assert_not_reached();
168
+}
169
+
170
static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map)
171
{
82
{
172
g_assert_not_reached();
83
- int n;
173
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
84
- TCGv_i32 tmp, tmp2, tmp3, tmp4;
174
index XXXXXXX..XXXXXXX 100644
85
- TCGv_ptr ptr1;
175
--- a/hw/arm/virt.c
86
+ TCGv_i64 val, def;
176
+++ b/hw/arm/virt.c
87
+ TCGv_i32 desc;
177
@@ -XXX,XX +XXX,XX @@ static const MemMapEntry base_memmap[] = {
88
178
[VIRT_PCDIMM_ACPI] = { 0x09070000, MEMORY_HOTPLUG_IO_LEN },
89
if (!arm_dc_feature(s, ARM_FEATURE_NEON)) {
179
[VIRT_ACPI_GED] = { 0x09080000, ACPI_GED_EVT_SEL_LEN },
90
return false;
180
[VIRT_NVDIMM_ACPI] = { 0x09090000, NVDIMM_ACPI_IO_LEN},
91
@@ -XXX,XX +XXX,XX @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
181
+ [VIRT_PVTIME] = { 0x090a0000, 0x00010000 },
92
return true;
182
[VIRT_MMIO] = { 0x0a000000, 0x00000200 },
183
/* ...repeating for a total of NUM_VIRTIO_TRANSPORTS, each of that size */
184
[VIRT_PLATFORM_BUS] = { 0x0c000000, 0x02000000 },
185
@@ -XXX,XX +XXX,XX @@ static void finalize_gic_version(VirtMachineState *vms)
186
* virt_cpu_post_init() must be called after the CPUs have
187
* been realized and the GIC has been created.
188
*/
189
-static void virt_cpu_post_init(VirtMachineState *vms)
190
+static void virt_cpu_post_init(VirtMachineState *vms, int max_cpus,
191
+ MemoryRegion *sysmem)
192
{
193
- bool aarch64, pmu;
194
+ bool aarch64, pmu, steal_time;
195
CPUState *cpu;
196
197
aarch64 = object_property_get_bool(OBJECT(first_cpu), "aarch64", NULL);
198
pmu = object_property_get_bool(OBJECT(first_cpu), "pmu", NULL);
199
+ steal_time = object_property_get_bool(OBJECT(first_cpu),
200
+ "kvm-steal-time", NULL);
201
202
if (kvm_enabled()) {
203
+ hwaddr pvtime_reg_base = vms->memmap[VIRT_PVTIME].base;
204
+ hwaddr pvtime_reg_size = vms->memmap[VIRT_PVTIME].size;
205
+
206
+ if (steal_time) {
207
+ MemoryRegion *pvtime = g_new(MemoryRegion, 1);
208
+ hwaddr pvtime_size = max_cpus * PVTIME_SIZE_PER_CPU;
209
+
210
+ /* The memory region size must be a multiple of host page size. */
211
+ pvtime_size = REAL_HOST_PAGE_ALIGN(pvtime_size);
212
+
213
+ if (pvtime_size > pvtime_reg_size) {
214
+ error_report("pvtime requires a %ld byte memory region for "
215
+ "%d CPUs, but only %ld has been reserved",
216
+ pvtime_size, max_cpus, pvtime_reg_size);
217
+ exit(1);
218
+ }
219
+
220
+ memory_region_init_ram(pvtime, NULL, "pvtime", pvtime_size, NULL);
221
+ memory_region_add_subregion(sysmem, pvtime_reg_base, pvtime);
222
+ }
223
+
224
CPU_FOREACH(cpu) {
225
if (pmu) {
226
assert(arm_feature(&ARM_CPU(cpu)->env, ARM_FEATURE_PMU));
227
@@ -XXX,XX +XXX,XX @@ static void virt_cpu_post_init(VirtMachineState *vms)
228
}
229
kvm_arm_pmu_init(cpu);
230
}
231
+ if (steal_time) {
232
+ kvm_arm_pvtime_init(cpu, pvtime_reg_base +
233
+ cpu->cpu_index * PVTIME_SIZE_PER_CPU);
234
+ }
235
}
236
} else {
237
if (aarch64 && vms->highmem) {
238
@@ -XXX,XX +XXX,XX @@ static void machvirt_init(MachineState *machine)
239
object_property_set_bool(cpuobj, "kvm-no-adjvtime", true, NULL);
240
}
241
242
+ if (vmc->no_kvm_steal_time &&
243
+ object_property_find(cpuobj, "kvm-steal-time")) {
244
+ object_property_set_bool(cpuobj, "kvm-steal-time", false, NULL);
245
+ }
246
+
247
if (vmc->no_pmu && object_property_find(cpuobj, "pmu")) {
248
object_property_set_bool(cpuobj, "pmu", false, NULL);
249
}
250
@@ -XXX,XX +XXX,XX @@ static void machvirt_init(MachineState *machine)
251
252
create_gic(vms);
253
254
- virt_cpu_post_init(vms);
255
+ virt_cpu_post_init(vms, possible_cpus->len, sysmem);
256
257
fdt_add_pmu_nodes(vms);
258
259
@@ -XXX,XX +XXX,XX @@ DEFINE_VIRT_MACHINE_AS_LATEST(5, 2)
260
261
static void virt_machine_5_1_options(MachineClass *mc)
262
{
263
+ VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc));
264
+
265
virt_machine_5_2_options(mc);
266
compat_props_add(mc->compat_props, hw_compat_5_1, hw_compat_5_1_len);
267
+ vmc->no_kvm_steal_time = true;
268
}
269
DEFINE_VIRT_MACHINE(5, 1)
270
271
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
272
index XXXXXXX..XXXXXXX 100644
273
--- a/target/arm/cpu.c
274
+++ b/target/arm/cpu.c
275
@@ -XXX,XX +XXX,XX @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp)
276
return;
277
}
278
}
93
}
279
+
94
280
+ if (kvm_enabled()) {
95
- n = a->len + 1;
281
+ kvm_arm_steal_time_finalize(cpu, &local_err);
96
- if ((a->vn + n) > 32) {
282
+ if (local_err != NULL) {
97
+ if ((a->vn + a->len + 1) > 32) {
283
+ error_propagate(errp, local_err);
98
/*
284
+ return;
99
* This is UNPREDICTABLE; we choose to UNDEF to avoid the
285
+ }
100
* helper function running off the end of the register file.
286
+ }
101
*/
287
}
288
289
static void arm_cpu_realizefn(DeviceState *dev, Error **errp)
290
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
291
index XXXXXXX..XXXXXXX 100644
292
--- a/target/arm/kvm.c
293
+++ b/target/arm/kvm.c
294
@@ -XXX,XX +XXX,XX @@ static void kvm_no_adjvtime_set(Object *obj, bool value, Error **errp)
295
ARM_CPU(obj)->kvm_adjvtime = !value;
296
}
297
298
+static bool kvm_steal_time_get(Object *obj, Error **errp)
299
+{
300
+ return ARM_CPU(obj)->kvm_steal_time != ON_OFF_AUTO_OFF;
301
+}
302
+
303
+static void kvm_steal_time_set(Object *obj, bool value, Error **errp)
304
+{
305
+ ARM_CPU(obj)->kvm_steal_time = value ? ON_OFF_AUTO_ON : ON_OFF_AUTO_OFF;
306
+}
307
+
308
/* KVM VCPU properties should be prefixed with "kvm-". */
309
void kvm_arm_add_vcpu_properties(Object *obj)
310
{
311
@@ -XXX,XX +XXX,XX @@ void kvm_arm_add_vcpu_properties(Object *obj)
312
"the virtual counter. VM stopped time "
313
"will be counted.");
314
}
315
+
316
+ cpu->kvm_steal_time = ON_OFF_AUTO_AUTO;
317
+ object_property_add_bool(obj, "kvm-steal-time", kvm_steal_time_get,
318
+ kvm_steal_time_set);
319
+ object_property_set_description(obj, "kvm-steal-time",
320
+ "Set off to disable KVM steal time.");
321
}
322
323
bool kvm_arm_pmu_supported(void)
324
diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
325
index XXXXXXX..XXXXXXX 100644
326
--- a/target/arm/kvm64.c
327
+++ b/target/arm/kvm64.c
328
@@ -XXX,XX +XXX,XX @@
329
#include <linux/kvm.h>
330
331
#include "qemu-common.h"
332
+#include "qapi/error.h"
333
#include "cpu.h"
334
#include "qemu/timer.h"
335
#include "qemu/error-report.h"
336
@@ -XXX,XX +XXX,XX @@ static CPUWatchpoint *find_hw_watchpoint(CPUState *cpu, target_ulong addr)
337
return NULL;
338
}
339
340
-static bool kvm_arm_pmu_set_attr(CPUState *cs, struct kvm_device_attr *attr)
341
+static bool kvm_arm_set_device_attr(CPUState *cs, struct kvm_device_attr *attr,
342
+ const char *name)
343
{
344
int err;
345
346
err = kvm_vcpu_ioctl(cs, KVM_HAS_DEVICE_ATTR, attr);
347
if (err != 0) {
348
- error_report("PMU: KVM_HAS_DEVICE_ATTR: %s", strerror(-err));
349
+ error_report("%s: KVM_HAS_DEVICE_ATTR: %s", name, strerror(-err));
350
return false;
102
return false;
351
}
103
}
352
104
- n <<= 3;
353
err = kvm_vcpu_ioctl(cs, KVM_SET_DEVICE_ATTR, attr);
105
- tmp = tcg_temp_new_i32();
354
if (err != 0) {
106
- if (a->op) {
355
- error_report("PMU: KVM_SET_DEVICE_ATTR: %s", strerror(-err));
107
- read_neon_element32(tmp, a->vd, 0, MO_32);
356
+ error_report("%s: KVM_SET_DEVICE_ATTR: %s", name, strerror(-err));
108
- } else {
357
return false;
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);
358
}
125
}
359
126
- tmp3 = tcg_temp_new_i32();
360
@@ -XXX,XX +XXX,XX @@ void kvm_arm_pmu_init(CPUState *cs)
127
- read_neon_element32(tmp3, a->vm, 1, MO_32);
361
if (!ARM_CPU(cs)->has_pmu) {
128
- gen_helper_neon_tbl(tmp3, tmp3, tmp, ptr1, tmp4);
362
return;
129
- tcg_temp_free_i32(tmp);
363
}
130
- tcg_temp_free_i32(tmp4);
364
- if (!kvm_arm_pmu_set_attr(cs, &attr)) {
131
- tcg_temp_free_ptr(ptr1);
365
+ if (!kvm_arm_set_device_attr(cs, &attr, "PMU")) {
132
+ val = tcg_temp_new_i64();
366
error_report("failed to init PMU");
133
+ read_neon_element64(val, a->vm, 0, MO_64);
367
abort();
134
368
}
135
- write_neon_element32(tmp2, a->vd, 0, MO_32);
369
@@ -XXX,XX +XXX,XX @@ void kvm_arm_pmu_set_irq(CPUState *cs, int irq)
136
- write_neon_element32(tmp3, a->vd, 1, MO_32);
370
if (!ARM_CPU(cs)->has_pmu) {
137
- tcg_temp_free_i32(tmp2);
371
return;
138
- tcg_temp_free_i32(tmp3);
372
}
139
+ gen_helper_neon_tbl(val, cpu_env, desc, val, def);
373
- if (!kvm_arm_pmu_set_attr(cs, &attr)) {
140
+ write_neon_element64(val, a->vd, 0, MO_64);
374
+ if (!kvm_arm_set_device_attr(cs, &attr, "PMU")) {
375
error_report("failed to set irq for PMU");
376
abort();
377
}
378
}
379
380
+void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa)
381
+{
382
+ struct kvm_device_attr attr = {
383
+ .group = KVM_ARM_VCPU_PVTIME_CTRL,
384
+ .attr = KVM_ARM_VCPU_PVTIME_IPA,
385
+ .addr = (uint64_t)&ipa,
386
+ };
387
+
141
+
388
+ if (ARM_CPU(cs)->kvm_steal_time == ON_OFF_AUTO_OFF) {
142
+ tcg_temp_free_i64(def);
389
+ return;
143
+ tcg_temp_free_i64(val);
390
+ }
144
+ tcg_temp_free_i32(desc);
391
+ if (!kvm_arm_set_device_attr(cs, &attr, "PVTIME IPA")) {
392
+ error_report("failed to init PVTIME IPA");
393
+ abort();
394
+ }
395
+}
396
+
397
static int read_sys_reg32(int fd, uint32_t *pret, uint64_t id)
398
{
399
uint64_t ret;
400
@@ -XXX,XX +XXX,XX @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
401
return true;
145
return true;
402
}
146
}
403
147
404
+void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp)
405
+{
406
+ bool has_steal_time = kvm_arm_steal_time_supported();
407
+
408
+ if (cpu->kvm_steal_time == ON_OFF_AUTO_AUTO) {
409
+ if (!has_steal_time || !arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) {
410
+ cpu->kvm_steal_time = ON_OFF_AUTO_OFF;
411
+ } else {
412
+ cpu->kvm_steal_time = ON_OFF_AUTO_ON;
413
+ }
414
+ } else if (cpu->kvm_steal_time == ON_OFF_AUTO_ON) {
415
+ if (!has_steal_time) {
416
+ error_setg(errp, "'kvm-steal-time' cannot be enabled "
417
+ "on this host");
418
+ return;
419
+ } else if (!arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) {
420
+ /*
421
+ * DEN0057A chapter 2 says "This specification only covers
422
+ * systems in which the Execution state of the hypervisor
423
+ * as well as EL1 of virtual machines is AArch64.". And,
424
+ * to ensure that, the smc/hvc calls are only specified as
425
+ * smc64/hvc64.
426
+ */
427
+ error_setg(errp, "'kvm-steal-time' cannot be enabled "
428
+ "for AArch32 guests");
429
+ return;
430
+ }
431
+ }
432
+}
433
+
434
bool kvm_arm_aarch32_supported(void)
435
{
436
return kvm_check_extension(kvm_state, KVM_CAP_ARM_EL1_32BIT);
437
@@ -XXX,XX +XXX,XX @@ bool kvm_arm_sve_supported(void)
438
return kvm_check_extension(kvm_state, KVM_CAP_ARM_SVE);
439
}
440
441
+bool kvm_arm_steal_time_supported(void)
442
+{
443
+ return kvm_check_extension(kvm_state, KVM_CAP_STEAL_TIME);
444
+}
445
+
446
QEMU_BUILD_BUG_ON(KVM_ARM64_SVE_VQ_MIN != 1);
447
448
void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map)
449
diff --git a/target/arm/monitor.c b/target/arm/monitor.c
450
index XXXXXXX..XXXXXXX 100644
451
--- a/target/arm/monitor.c
452
+++ b/target/arm/monitor.c
453
@@ -XXX,XX +XXX,XX @@ static const char *cpu_model_advertised_features[] = {
454
"sve128", "sve256", "sve384", "sve512",
455
"sve640", "sve768", "sve896", "sve1024", "sve1152", "sve1280",
456
"sve1408", "sve1536", "sve1664", "sve1792", "sve1920", "sve2048",
457
- "kvm-no-adjvtime",
458
+ "kvm-no-adjvtime", "kvm-steal-time",
459
NULL
460
};
461
462
diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c
463
index XXXXXXX..XXXXXXX 100644
464
--- a/tests/qtest/arm-cpu-features.c
465
+++ b/tests/qtest/arm-cpu-features.c
466
@@ -XXX,XX +XXX,XX @@ static void test_query_cpu_model_expansion(const void *data)
467
assert_set_feature(qts, "max", "pmu", true);
468
469
assert_has_not_feature(qts, "max", "kvm-no-adjvtime");
470
+ assert_has_not_feature(qts, "max", "kvm-steal-time");
471
472
if (g_str_equal(qtest_get_arch(), "aarch64")) {
473
assert_has_feature_enabled(qts, "max", "aarch64");
474
@@ -XXX,XX +XXX,XX @@ static void test_query_cpu_model_expansion_kvm(const void *data)
475
assert_set_feature(qts, "host", "kvm-no-adjvtime", false);
476
477
if (g_str_equal(qtest_get_arch(), "aarch64")) {
478
+ bool kvm_supports_steal_time;
479
bool kvm_supports_sve;
480
char max_name[8], name[8];
481
uint32_t max_vq, vq;
482
@@ -XXX,XX +XXX,XX @@ static void test_query_cpu_model_expansion_kvm(const void *data)
483
QDict *resp;
484
char *error;
485
486
+ assert_error(qts, "cortex-a15",
487
+ "We cannot guarantee the CPU type 'cortex-a15' works "
488
+ "with KVM on this host", NULL);
489
+
490
assert_has_feature_enabled(qts, "host", "aarch64");
491
492
/* Enabling and disabling pmu should always work. */
493
@@ -XXX,XX +XXX,XX @@ static void test_query_cpu_model_expansion_kvm(const void *data)
494
assert_set_feature(qts, "host", "pmu", false);
495
assert_set_feature(qts, "host", "pmu", true);
496
497
- assert_error(qts, "cortex-a15",
498
- "We cannot guarantee the CPU type 'cortex-a15' works "
499
- "with KVM on this host", NULL);
500
-
501
+ /*
502
+ * Some features would be enabled by default, but they're disabled
503
+ * because this instance of KVM doesn't support them. Test that the
504
+ * features are present, and, when enabled, issue further tests.
505
+ */
506
+ assert_has_feature(qts, "host", "kvm-steal-time");
507
assert_has_feature(qts, "host", "sve");
508
+
509
resp = do_query_no_props(qts, "host");
510
+ kvm_supports_steal_time = resp_get_feature(resp, "kvm-steal-time");
511
kvm_supports_sve = resp_get_feature(resp, "sve");
512
vls = resp_get_sve_vls(resp);
513
qobject_unref(resp);
514
515
+ if (kvm_supports_steal_time) {
516
+ /* If we have steal-time then we should be able to toggle it. */
517
+ assert_set_feature(qts, "host", "kvm-steal-time", false);
518
+ assert_set_feature(qts, "host", "kvm-steal-time", true);
519
+ }
520
+
521
if (kvm_supports_sve) {
522
g_assert(vls != 0);
523
max_vq = 64 - __builtin_clzll(vls);
524
@@ -XXX,XX +XXX,XX @@ static void test_query_cpu_model_expansion_kvm(const void *data)
525
assert_has_not_feature(qts, "host", "aarch64");
526
assert_has_not_feature(qts, "host", "pmu");
527
assert_has_not_feature(qts, "host", "sve");
528
+ assert_has_not_feature(qts, "host", "kvm-steal-time");
529
}
530
531
qtest_quit(qts);
532
--
148
--
533
2.20.1
149
2.20.1
534
150
535
151
diff view generated by jsdifflib
1
From: Andrew Jones <drjones@redhat.com>
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
2
3
arm-cpu-features got dropped from the AArch64 tests during the meson
3
We can use one MPC per SRAM bank, but we currently only wire the
4
conversion shuffle.
4
IRQ from the first expansion MPC to the IRQ splitter. Fix that.
5
5
6
Signed-off-by: Andrew Jones <drjones@redhat.com>
6
Fixes: bb75e16d5e6 ("hw/arm/iotkit: Wire up MPC interrupt lines")
7
Message-id: 20201001061718.101915-6-drjones@redhat.com
7
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8
Message-id: 20201107193403.436146-2-f4bug@amsat.org
8
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
---
11
---
11
tests/qtest/meson.build | 3 ++-
12
hw/arm/armsse.c | 3 ++-
12
1 file changed, 2 insertions(+), 1 deletion(-)
13
1 file changed, 2 insertions(+), 1 deletion(-)
13
14
14
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
15
diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c
15
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
16
--- a/tests/qtest/meson.build
17
--- a/hw/arm/armsse.c
17
+++ b/tests/qtest/meson.build
18
+++ b/hw/arm/armsse.c
18
@@ -XXX,XX +XXX,XX @@ qtests_aarch64 = \
19
@@ -XXX,XX +XXX,XX @@ static void armsse_realize(DeviceState *dev, Error **errp)
19
(cpu != 'arm' ? ['bios-tables-test'] : []) + \
20
qdev_get_gpio_in(dev_splitter, 0));
20
(config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-test'] : []) + \
21
qdev_connect_gpio_out(dev_splitter, 0,
21
(config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-swtpm-test'] : []) + \
22
qdev_get_gpio_in_named(dev_secctl,
22
- ['numa-test',
23
- "mpc_status", 0));
23
+ ['arm-cpu-features',
24
+ "mpc_status",
24
+ 'numa-test',
25
+ i - IOTS_NUM_EXP_MPC));
25
'boot-serial-test',
26
}
26
'migration-test']
27
27
28
qdev_connect_gpio_out(dev_splitter, 1,
28
--
29
--
29
2.20.1
30
2.20.1
30
31
31
32
diff view generated by jsdifflib
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
2
3
The "BCM2835 ARM Peripherals" datasheet [*] chapter 2
3
The system configuration controller (SYSCFG) doesn't have
4
("Auxiliaries: UART1 & SPI1, SPI2"), list the register
4
any output IRQ (and the INTC input #71 belongs to the UART6).
5
sizes as 3/8/16/32 bits. We assume this means this
5
Remove the invalid code.
6
peripheral allows 8-bit accesses.
7
6
8
This was not an issue until commit 5d971f9e67 which reverted
7
Fixes: db635521a02 ("stm32f205: Add the stm32f205 SoC")
9
("memory: accept mismatching sizes in memory_region_access_valid").
10
11
The model is implemented as 32-bit accesses (see commit 97398d900c,
12
all registers are 32-bit) so replace MemoryRegionOps.valid as
13
MemoryRegionOps.impl, and re-introduce MemoryRegionOps.valid
14
with a 8/32-bit range.
15
16
[*] https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf
17
18
Fixes: 97398d900c ("bcm2835_aux: add emulation of BCM2835 AUX (aka UART1) block")
19
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
20
Message-id: 20201002181032.1899463-1-f4bug@amsat.org
9
Message-id: 20201107193403.436146-3-f4bug@amsat.org
21
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
22
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
23
---
12
---
24
hw/char/bcm2835_aux.c | 4 +++-
13
include/hw/misc/stm32f2xx_syscfg.h | 2 --
25
1 file changed, 3 insertions(+), 1 deletion(-)
14
hw/arm/stm32f205_soc.c | 1 -
15
hw/misc/stm32f2xx_syscfg.c | 2 --
16
3 files changed, 5 deletions(-)
26
17
27
diff --git a/hw/char/bcm2835_aux.c b/hw/char/bcm2835_aux.c
18
diff --git a/include/hw/misc/stm32f2xx_syscfg.h b/include/hw/misc/stm32f2xx_syscfg.h
28
index XXXXXXX..XXXXXXX 100644
19
index XXXXXXX..XXXXXXX 100644
29
--- a/hw/char/bcm2835_aux.c
20
--- a/include/hw/misc/stm32f2xx_syscfg.h
30
+++ b/hw/char/bcm2835_aux.c
21
+++ b/include/hw/misc/stm32f2xx_syscfg.h
31
@@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps bcm2835_aux_ops = {
22
@@ -XXX,XX +XXX,XX @@ struct STM32F2XXSyscfgState {
32
.read = bcm2835_aux_read,
23
uint32_t syscfg_exticr3;
33
.write = bcm2835_aux_write,
24
uint32_t syscfg_exticr4;
34
.endianness = DEVICE_NATIVE_ENDIAN,
25
uint32_t syscfg_cmpcr;
35
- .valid.min_access_size = 4,
26
-
36
+ .impl.min_access_size = 4,
27
- qemu_irq irq;
37
+ .impl.max_access_size = 4,
38
+ .valid.min_access_size = 1,
39
.valid.max_access_size = 4,
40
};
28
};
41
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);
42
--
56
--
43
2.20.1
57
2.20.1
44
58
45
59
diff view generated by jsdifflib
1
From: Andrew Jones <drjones@redhat.com>
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
2
3
When we compile without KVM support !defined(CONFIG_KVM) we generate
3
omap2420_mpu_init() introduced in commit 827df9f3c5f ("Add basic
4
stubs for functions that the linker will still encounter. Sometimes
4
OMAP2 chip support") takes care of creating the 3 UARTs.
5
these stubs can be executed safely and are placed in paths where they
6
get executed with or without KVM. Other functions should never be
7
called without KVM. Those functions should be guarded by kvm_enabled(),
8
but should also be robust to refactoring mistakes. Putting a
9
g_assert_not_reached() in the function should help. Additionally,
10
the g_assert_not_reached() calls may actually help the linker remove
11
some code.
12
5
13
We remove the stubs for kvm_arm_get/put_virtual_time(), as they aren't
6
Then commit 58a26b477e9 ("Emulate a serial bluetooth HCI with H4+
14
necessary at all - the only caller is in kvm.c
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.
15
11
16
Reviewed-by: Eric Auger <eric.auger@redhat.com>
12
Fortunately we don't need to fix this, because commit 6da68df7f9b
17
Signed-off-by: Andrew Jones <drjones@redhat.com>
13
("hw/arm/nseries: Replace the bluetooth chardev with a "null"
18
Message-id: 20201001061718.101915-3-drjones@redhat.com
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>
19
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
20
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
20
---
21
---
21
target/arm/kvm_arm.h | 51 +++++++++++++++++++++++++++-----------------
22
hw/arm/nseries.c | 11 -----------
22
1 file changed, 32 insertions(+), 19 deletions(-)
23
1 file changed, 11 deletions(-)
23
24
24
diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h
25
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
25
index XXXXXXX..XXXXXXX 100644
26
index XXXXXXX..XXXXXXX 100644
26
--- a/target/arm/kvm_arm.h
27
--- a/hw/arm/nseries.c
27
+++ b/target/arm/kvm_arm.h
28
+++ b/hw/arm/nseries.c
28
@@ -XXX,XX +XXX,XX @@ int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level);
29
@@ -XXX,XX +XXX,XX @@ static void n8x0_cbus_setup(struct n800_s *s)
29
30
cbus_attach(cbus, s->tahvo = tahvo_init(tahvo_irq, 1));
30
#else
31
}
31
32
32
-static inline void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu)
33
-static void n8x0_uart_setup(struct n800_s *s)
33
-{
34
-{
35
- Chardev *radio = qemu_chr_new("bt-dummy-uart", "null", NULL);
34
- /*
36
- /*
35
- * This should never actually be called in the "not KVM" case,
37
- * Note: We used to connect N8X0_BT_RESET_GPIO and N8X0_BT_WKUP_GPIO
36
- * but set up the fields to indicate an error anyway.
38
- * here, but this code has been removed with the bluetooth backend.
37
- */
39
- */
38
- cpu->kvm_target = QEMU_KVM_ARM_TARGET_NONE;
40
- omap_uart_attach(s->mpu->uart[BT_UART], radio);
39
- cpu->host_cpu_probe_failed = true;
40
-}
41
-}
41
-
42
-
42
-static inline void kvm_arm_add_vcpu_properties(Object *obj) {}
43
static void n8x0_usb_setup(struct n800_s *s)
43
-
44
+/*
45
+ * It's safe to call these functions without KVM support.
46
+ * They should either do nothing or return "not supported".
47
+ */
48
static inline bool kvm_arm_aarch32_supported(void)
49
{
44
{
50
return false;
45
SysBusDevice *dev;
51
@@ -XXX,XX +XXX,XX @@ static inline bool kvm_arm_sve_supported(void)
46
@@ -XXX,XX +XXX,XX @@ static void n8x0_init(MachineState *machine,
52
return false;
47
n8x0_spi_setup(s);
53
}
48
n8x0_dss_setup(s);
54
49
n8x0_cbus_setup(s);
55
+/*
50
- n8x0_uart_setup(s);
56
+ * These functions should never actually be called without KVM support.
51
if (machine_usb(machine)) {
57
+ */
52
n8x0_usb_setup(s);
58
+static inline void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu)
53
}
59
+{
60
+ g_assert_not_reached();
61
+}
62
+
63
+static inline void kvm_arm_add_vcpu_properties(Object *obj)
64
+{
65
+ g_assert_not_reached();
66
+}
67
+
68
static inline int kvm_arm_get_max_vm_ipa_size(MachineState *ms)
69
{
70
- return -ENOENT;
71
+ g_assert_not_reached();
72
}
73
74
static inline int kvm_arm_vgic_probe(void)
75
{
76
- return 0;
77
+ g_assert_not_reached();
78
}
79
80
-static inline void kvm_arm_pmu_set_irq(CPUState *cs, int irq) {}
81
-static inline void kvm_arm_pmu_init(CPUState *cs) {}
82
+static inline void kvm_arm_pmu_set_irq(CPUState *cs, int irq)
83
+{
84
+ g_assert_not_reached();
85
+}
86
87
-static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map) {}
88
+static inline void kvm_arm_pmu_init(CPUState *cs)
89
+{
90
+ g_assert_not_reached();
91
+}
92
+
93
+static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map)
94
+{
95
+ g_assert_not_reached();
96
+}
97
98
-static inline void kvm_arm_get_virtual_time(CPUState *cs) {}
99
-static inline void kvm_arm_put_virtual_time(CPUState *cs) {}
100
#endif
101
102
static inline const char *gic_class_name(void)
103
--
54
--
104
2.20.1
55
2.20.1
105
56
106
57
diff view generated by jsdifflib
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
2
3
The MusicPal board code connects both of the IRQ outputs of the UART
4
to the same INTC qemu_irq. Connecting two qemu_irqs outputs directly
5
to the same input is not valid as it produces subtly wrong behaviour
6
(for instance if both the IRQ lines are high, and then one goes
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).
9
10
This kind of wiring needs an explicitly created OR gate; add one.
11
12
Inspired-by: Peter Maydell <peter.maydell@linaro.org>
3
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
13
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
4
Message-id: 20201002080935.1660005-1-f4bug@amsat.org
14
Message-id: 20201107193403.436146-5-f4bug@amsat.org
5
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
15
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
16
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7
---
17
---
8
include/hw/arm/fsl-imx25.h | 2 +-
18
hw/arm/musicpal.c | 17 +++++++++++++----
9
1 file changed, 1 insertion(+), 1 deletion(-)
19
hw/arm/Kconfig | 1 +
20
2 files changed, 14 insertions(+), 4 deletions(-)
10
21
11
diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h
22
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
12
index XXXXXXX..XXXXXXX 100644
23
index XXXXXXX..XXXXXXX 100644
13
--- a/include/hw/arm/fsl-imx25.h
24
--- a/hw/arm/musicpal.c
14
+++ b/include/hw/arm/fsl-imx25.h
25
+++ b/hw/arm/musicpal.c
15
@@ -XXX,XX +XXX,XX @@ struct FslIMX25State {
26
@@ -XXX,XX +XXX,XX @@
16
* 0xBB00_0000 0xBB00_0FFF 4 Kbytes NAND flash main area buffer
27
#include "ui/console.h"
17
* 0xBB00_1000 0xBB00_11FF 512 B NAND flash spare area buffer
28
#include "hw/i2c/i2c.h"
18
* 0xBB00_1200 0xBB00_1DFF 3 Kbytes Reserved
29
#include "hw/irq.h"
19
- * 0xBB00_1E00 0xBB00_1FFF 512 B NAND flash control regisers
30
+#include "hw/or-irq.h"
20
+ * 0xBB00_1E00 0xBB00_1FFF 512 B NAND flash control registers
31
#include "hw/audio/wm8750.h"
21
* 0xBB01_2000 0xBFFF_FFFF 96 Mbytes (minus 8 Kbytes) Reserved
32
#include "sysemu/block-backend.h"
22
* 0xC000_0000 0xFFFF_FFFF 1024 Mbytes Reserved
33
#include "sysemu/runstate.h"
23
*/
34
@@ -XXX,XX +XXX,XX @@
35
#define MP_TIMER4_IRQ 7
36
#define MP_EHCI_IRQ 8
37
#define MP_ETH_IRQ 9
38
-#define MP_UART1_IRQ 11
39
-#define MP_UART2_IRQ 11
40
+#define MP_UART_SHARED_IRQ 11
41
#define MP_GPIO_IRQ 12
42
#define MP_RTC_IRQ 28
43
#define MP_AUDIO_IRQ 30
44
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
45
ARMCPU *cpu;
46
qemu_irq pic[32];
47
DeviceState *dev;
48
+ DeviceState *uart_orgate;
49
DeviceState *i2c_dev;
50
DeviceState *lcd_dev;
51
DeviceState *key_dev;
52
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
53
pic[MP_TIMER2_IRQ], pic[MP_TIMER3_IRQ],
54
pic[MP_TIMER4_IRQ], NULL);
55
56
- serial_mm_init(address_space_mem, MP_UART1_BASE, 2, pic[MP_UART1_IRQ],
57
+ /* Logically OR both UART IRQs together */
58
+ uart_orgate = DEVICE(object_new(TYPE_OR_IRQ));
59
+ object_property_set_int(OBJECT(uart_orgate), "num-lines", 2, &error_fatal);
60
+ qdev_realize_and_unref(uart_orgate, NULL, &error_fatal);
61
+ qdev_connect_gpio_out(DEVICE(uart_orgate), 0, pic[MP_UART_SHARED_IRQ]);
62
+
63
+ serial_mm_init(address_space_mem, MP_UART1_BASE, 2,
64
+ qdev_get_gpio_in(uart_orgate, 0),
65
1825000, serial_hd(0), DEVICE_NATIVE_ENDIAN);
66
- serial_mm_init(address_space_mem, MP_UART2_BASE, 2, pic[MP_UART2_IRQ],
67
+ serial_mm_init(address_space_mem, MP_UART2_BASE, 2,
68
+ qdev_get_gpio_in(uart_orgate, 1),
69
1825000, serial_hd(1), DEVICE_NATIVE_ENDIAN);
70
71
/* Register flash */
72
diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
73
index XXXXXXX..XXXXXXX 100644
74
--- a/hw/arm/Kconfig
75
+++ b/hw/arm/Kconfig
76
@@ -XXX,XX +XXX,XX @@ config MUSCA
77
78
config MUSICPAL
79
bool
80
+ select OR_IRQ
81
select BITBANG_I2C
82
select MARVELL_88W8618
83
select PTIMER
24
--
84
--
25
2.20.1
85
2.20.1
26
86
27
87
diff view generated by jsdifflib
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
1
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
2
2
3
Fix integer handling issues handling issue reported by Coverity:
3
We don't need to fill the full pic[] array if we only use
4
few of the interrupt lines. Directly call qdev_get_gpio_in()
5
when necessary.
4
6
5
hw/ssi/npcm7xx_fiu.c: 162 in npcm7xx_fiu_flash_read()
6
>>> CID 1432730: Integer handling issues (NEGATIVE_RETURNS)
7
>>> "npcm7xx_fiu_cs_index(fiu, f)" is passed to a parameter that cannot be negative.
8
162 npcm7xx_fiu_select(fiu, npcm7xx_fiu_cs_index(fiu, f));
9
10
hw/ssi/npcm7xx_fiu.c: 221 in npcm7xx_fiu_flash_write()
11
218 cs_id = npcm7xx_fiu_cs_index(fiu, f);
12
219 trace_npcm7xx_fiu_flash_write(DEVICE(fiu)->canonical_path, cs_id, addr,
13
220 size, v);
14
>>> CID 1432729: Integer handling issues (NEGATIVE_RETURNS)
15
>>> "cs_id" is passed to a parameter that cannot be negative.
16
221 npcm7xx_fiu_select(fiu, cs_id);
17
18
Since the index of the flash can not be negative, return an
19
unsigned type.
20
21
Reported-by: Coverity (CID 1432729 & 1432730: NEGATIVE_RETURNS)
22
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
7
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
23
Reviewed-by: Havard Skinnemoen <hskinnemoen@google.com>
8
Message-id: 20201107193403.436146-6-f4bug@amsat.org
24
Message-id: 20200919132435.310527-1-f4bug@amsat.org
9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
25
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
26
---
11
---
27
hw/ssi/npcm7xx_fiu.c | 12 ++++++------
12
hw/arm/musicpal.c | 25 +++++++++++++------------
28
hw/ssi/trace-events | 2 +-
13
1 file changed, 13 insertions(+), 12 deletions(-)
29
2 files changed, 7 insertions(+), 7 deletions(-)
30
14
31
diff --git a/hw/ssi/npcm7xx_fiu.c b/hw/ssi/npcm7xx_fiu.c
15
diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
32
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
33
--- a/hw/ssi/npcm7xx_fiu.c
17
--- a/hw/arm/musicpal.c
34
+++ b/hw/ssi/npcm7xx_fiu.c
18
+++ b/hw/arm/musicpal.c
35
@@ -XXX,XX +XXX,XX @@ enum NPCM7xxFIURegister {
19
@@ -XXX,XX +XXX,XX @@ static struct arm_boot_info musicpal_binfo = {
36
* Returns the index of flash in the fiu->flash array. This corresponds to the
20
static void musicpal_init(MachineState *machine)
37
* chip select ID of the flash.
38
*/
39
-static int npcm7xx_fiu_cs_index(NPCM7xxFIUState *fiu, NPCM7xxFIUFlash *flash)
40
+static unsigned npcm7xx_fiu_cs_index(NPCM7xxFIUState *fiu,
41
+ NPCM7xxFIUFlash *flash)
42
{
21
{
43
int index = flash - fiu->flash;
22
ARMCPU *cpu;
44
23
- qemu_irq pic[32];
45
@@ -XXX,XX +XXX,XX @@ static int npcm7xx_fiu_cs_index(NPCM7xxFIUState *fiu, NPCM7xxFIUFlash *flash)
24
DeviceState *dev;
46
}
25
+ DeviceState *pic;
47
26
DeviceState *uart_orgate;
48
/* Assert the chip select specified in the UMA Control/Status Register. */
27
DeviceState *i2c_dev;
49
-static void npcm7xx_fiu_select(NPCM7xxFIUState *s, int cs_id)
28
DeviceState *lcd_dev;
50
+static void npcm7xx_fiu_select(NPCM7xxFIUState *s, unsigned cs_id)
29
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
51
{
30
&error_fatal);
52
trace_npcm7xx_fiu_select(DEVICE(s)->canonical_path, cs_id);
31
memory_region_add_subregion(address_space_mem, MP_SRAM_BASE, sram);
53
32
54
if (cs_id < s->cs_count) {
33
- dev = sysbus_create_simple(TYPE_MV88W8618_PIC, MP_PIC_BASE,
55
qemu_irq_lower(s->cs_lines[cs_id]);
34
+ pic = sysbus_create_simple(TYPE_MV88W8618_PIC, MP_PIC_BASE,
56
+ s->active_cs = cs_id;
35
qdev_get_gpio_in(DEVICE(cpu), ARM_CPU_IRQ));
57
} else {
36
- for (i = 0; i < 32; i++) {
58
qemu_log_mask(LOG_GUEST_ERROR,
37
- pic[i] = qdev_get_gpio_in(dev, i);
59
"%s: UMA to CS%d; this module has only %d chip selects",
38
- }
60
DEVICE(s)->canonical_path, cs_id, s->cs_count);
39
- sysbus_create_varargs(TYPE_MV88W8618_PIT, MP_PIT_BASE, pic[MP_TIMER1_IRQ],
61
- cs_id = -1;
40
- pic[MP_TIMER2_IRQ], pic[MP_TIMER3_IRQ],
62
+ s->active_cs = -1;
41
- pic[MP_TIMER4_IRQ], NULL);
63
}
42
+ sysbus_create_varargs(TYPE_MV88W8618_PIT, MP_PIT_BASE,
64
-
43
+ qdev_get_gpio_in(pic, MP_TIMER1_IRQ),
65
- s->active_cs = cs_id;
44
+ qdev_get_gpio_in(pic, MP_TIMER2_IRQ),
66
}
45
+ qdev_get_gpio_in(pic, MP_TIMER3_IRQ),
67
46
+ qdev_get_gpio_in(pic, MP_TIMER4_IRQ), NULL);
68
/* Deassert the currently active chip select. */
47
69
@@ -XXX,XX +XXX,XX @@ static void npcm7xx_fiu_flash_write(void *opaque, hwaddr addr, uint64_t v,
48
/* Logically OR both UART IRQs together */
70
NPCM7xxFIUFlash *f = opaque;
49
uart_orgate = DEVICE(object_new(TYPE_OR_IRQ));
71
NPCM7xxFIUState *fiu = f->fiu;
50
object_property_set_int(OBJECT(uart_orgate), "num-lines", 2, &error_fatal);
72
uint32_t dwr_cfg;
51
qdev_realize_and_unref(uart_orgate, NULL, &error_fatal);
73
- int cs_id;
52
- qdev_connect_gpio_out(DEVICE(uart_orgate), 0, pic[MP_UART_SHARED_IRQ]);
74
+ unsigned cs_id;
53
+ qdev_connect_gpio_out(DEVICE(uart_orgate), 0,
75
int i;
54
+ qdev_get_gpio_in(pic, MP_UART_SHARED_IRQ));
76
55
77
if (fiu->active_cs != -1) {
56
serial_mm_init(address_space_mem, MP_UART1_BASE, 2,
78
diff --git a/hw/ssi/trace-events b/hw/ssi/trace-events
57
qdev_get_gpio_in(uart_orgate, 0),
79
index XXXXXXX..XXXXXXX 100644
58
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
80
--- a/hw/ssi/trace-events
59
OBJECT(get_system_memory()), &error_fatal);
81
+++ b/hw/ssi/trace-events
60
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
82
@@ -XXX,XX +XXX,XX @@ npcm7xx_fiu_deselect(const char *id, int cs) "%s deselect CS%d"
61
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, MP_ETH_BASE);
83
npcm7xx_fiu_ctrl_read(const char *id, uint64_t addr, uint32_t data) "%s offset: 0x%04" PRIx64 " value: 0x%08" PRIx32
62
- sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[MP_ETH_IRQ]);
84
npcm7xx_fiu_ctrl_write(const char *id, uint64_t addr, uint32_t data) "%s offset: 0x%04" PRIx64 " value: 0x%08" PRIx32
63
+ sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0,
85
npcm7xx_fiu_flash_read(const char *id, int cs, uint64_t addr, unsigned int size, uint64_t value) "%s[%d] offset: 0x%08" PRIx64 " size: %u value: 0x%" PRIx64
64
+ qdev_get_gpio_in(pic, MP_ETH_IRQ));
86
-npcm7xx_fiu_flash_write(const char *id, int cs, uint64_t addr, unsigned int size, uint64_t value) "%s[%d] offset: 0x%08" PRIx64 " size: %u value: 0x%" PRIx64
65
87
+npcm7xx_fiu_flash_write(const char *id, unsigned cs, uint64_t addr, unsigned int size, uint64_t value) "%s[%d] offset: 0x%08" PRIx64 " size: %u value: 0x%" PRIx64
66
sysbus_create_simple("mv88w8618_wlan", MP_WLAN_BASE, NULL);
67
68
sysbus_create_simple(TYPE_MUSICPAL_MISC, MP_MISC_BASE, NULL);
69
70
dev = sysbus_create_simple(TYPE_MUSICPAL_GPIO, MP_GPIO_BASE,
71
- pic[MP_GPIO_IRQ]);
72
+ qdev_get_gpio_in(pic, MP_GPIO_IRQ));
73
i2c_dev = sysbus_create_simple("gpio_i2c", -1, NULL);
74
i2c = (I2CBus *)qdev_get_child_bus(i2c_dev, "i2c");
75
76
@@ -XXX,XX +XXX,XX @@ static void musicpal_init(MachineState *machine)
77
NULL);
78
sysbus_realize_and_unref(s, &error_fatal);
79
sysbus_mmio_map(s, 0, MP_AUDIO_BASE);
80
- sysbus_connect_irq(s, 0, pic[MP_AUDIO_IRQ]);
81
+ sysbus_connect_irq(s, 0, qdev_get_gpio_in(pic, MP_AUDIO_IRQ));
82
83
musicpal_binfo.ram_size = MP_RAM_DEFAULT_SIZE;
84
arm_load_kernel(cpu, machine, &musicpal_binfo);
88
--
85
--
89
2.20.1
86
2.20.1
90
87
91
88
diff view generated by jsdifflib
New patch
1
The nseries machines have a codepath that allows them to load a
2
secondary bootloader. This code wasn't checking that the
3
load_image_targphys() succeeded. Check the return value and report
4
the error to the user.
1
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
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
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(-)
16
17
diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
18
index XXXXXXX..XXXXXXX 100644
19
--- a/hw/arm/nseries.c
20
+++ b/hw/arm/nseries.c
21
@@ -XXX,XX +XXX,XX @@ static void n8x0_init(MachineState *machine,
22
/* No, wait, better start at the ROM. */
23
s->mpu->cpu->env.regs[15] = OMAP2_Q2_BASE + 0x400000;
24
25
- /* This is intended for loading the `secondary.bin' program from
26
+ /*
27
+ * This is intended for loading the `secondary.bin' program from
28
* Nokia images (the NOLO bootloader). The entry point seems
29
* to be at OMAP2_Q2_BASE + 0x400000.
30
*
31
@@ -XXX,XX +XXX,XX @@ static void n8x0_init(MachineState *machine,
32
* for them the entry point needs to be set to OMAP2_SRAM_BASE.
33
*
34
* The code above is for loading the `zImage' file from Nokia
35
- * images. */
36
- load_image_targphys(option_rom[0].name, OMAP2_Q2_BASE + 0x400000,
37
- machine->ram_size - 0x400000);
38
+ * images.
39
+ */
40
+ if (load_image_targphys(option_rom[0].name,
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);
50
--
51
2.20.1
52
53
diff view generated by jsdifflib
1
From: Graeme Gregory <graeme@nuviainc.com>
1
From: Havard Skinnemoen <hskinnemoen@google.com>
2
2
3
SMMUv3 has an error in a previous patch where an i was transposed to a 1
3
The number of runs is equal to the number of 0-1 and 1-0 transitions,
4
meaning interrupts would not have been correctly assigned to the SMMUv3
4
plus one. Currently, it's counting the number of times these transitions
5
instance.
5
do _not_ happen, plus one.
6
6
7
Fixes: 48ba18e6d3f3 ("hw/arm/sbsa-ref: Simplify by moving the gic in the machine state")
7
Source:
8
Signed-off-by: Graeme Gregory <graeme@nuviainc.com>
8
https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-22r1a.pdf
9
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
9
section 2.3.4 point (3).
10
Reviewed-by: Eric Auger <eric.auger@redhat.com>
10
11
Message-id: 20201007100732.4103790-2-graeme@nuviainc.com
11
Signed-off-by: Havard Skinnemoen <hskinnemoen@google.com>
12
Message-id: 20201103011457.2959989-2-hskinnemoen@google.com
13
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
---
15
---
14
hw/arm/sbsa-ref.c | 2 +-
16
tests/qtest/npcm7xx_rng-test.c | 2 +-
15
1 file changed, 1 insertion(+), 1 deletion(-)
17
1 file changed, 1 insertion(+), 1 deletion(-)
16
18
17
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
19
diff --git a/tests/qtest/npcm7xx_rng-test.c b/tests/qtest/npcm7xx_rng-test.c
18
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
19
--- a/hw/arm/sbsa-ref.c
21
--- a/tests/qtest/npcm7xx_rng-test.c
20
+++ b/hw/arm/sbsa-ref.c
22
+++ b/tests/qtest/npcm7xx_rng-test.c
21
@@ -XXX,XX +XXX,XX @@ static void create_smmu(const SBSAMachineState *sms, PCIBus *bus)
23
@@ -XXX,XX +XXX,XX @@ static double calc_runs_p(const unsigned long *buf, unsigned int nr_bits)
22
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
24
pi = (double)nr_ones / nr_bits;
23
for (i = 0; i < NUM_SMMU_IRQS; i++) {
25
24
sysbus_connect_irq(SYS_BUS_DEVICE(dev), i,
26
for (k = 0; k < nr_bits - 1; k++) {
25
- qdev_get_gpio_in(sms->gic, irq + 1));
27
- vn_obs += !(test_bit(k, buf) ^ test_bit(k + 1, buf));
26
+ qdev_get_gpio_in(sms->gic, irq + i));
28
+ vn_obs += (test_bit(k, buf) ^ test_bit(k + 1, buf));
27
}
29
}
28
}
30
vn_obs += 1;
29
31
30
--
32
--
31
2.20.1
33
2.20.1
32
34
33
35
diff view generated by jsdifflib
1
QEMU supports a 48-bit physical address range, but we don't currently
1
Checks for UNDEF cases should go before the "is VFP enabled?" access
2
expose it in the '-cpu max' ID registers (you get the same range as
2
check, except in special cases. Move a stray UNDEF check in the VTBL
3
Cortex-A57, which is 44 bits).
3
trans function up above the access check.
4
5
Set the ID_AA64MMFR0.PARange field to indicate 48 bits.
6
4
7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
9
Message-id: 20201001160116.18095-1-peter.maydell@linaro.org
7
Message-id: 20201109145324.2859-1-peter.maydell@linaro.org
10
---
8
---
11
target/arm/cpu64.c | 4 ++++
9
target/arm/translate-neon.c.inc | 8 ++++----
12
1 file changed, 4 insertions(+)
10
1 file changed, 4 insertions(+), 4 deletions(-)
13
11
14
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
12
diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.inc
15
index XXXXXXX..XXXXXXX 100644
13
index XXXXXXX..XXXXXXX 100644
16
--- a/target/arm/cpu64.c
14
--- a/target/arm/translate-neon.c.inc
17
+++ b/target/arm/cpu64.c
15
+++ b/target/arm/translate-neon.c.inc
18
@@ -XXX,XX +XXX,XX @@ static void aarch64_max_initfn(Object *obj)
16
@@ -XXX,XX +XXX,XX @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
19
t = FIELD_DP64(t, ID_AA64PFR1, MTE, 2);
17
return false;
20
cpu->isar.id_aa64pfr1 = t;
18
}
21
19
22
+ t = cpu->isar.id_aa64mmfr0;
20
- if (!vfp_access_check(s)) {
23
+ t = FIELD_DP64(t, ID_AA64MMFR0, PARANGE, 5); /* PARange: 48 bits */
21
- return true;
24
+ cpu->isar.id_aa64mmfr0 = t;
22
- }
23
-
24
if ((a->vn + a->len + 1) > 32) {
25
/*
26
* This is UNPREDICTABLE; we choose to UNDEF to avoid the
27
@@ -XXX,XX +XXX,XX @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
28
return false;
29
}
30
31
+ if (!vfp_access_check(s)) {
32
+ return true;
33
+ }
25
+
34
+
26
t = cpu->isar.id_aa64mmfr1;
35
desc = tcg_const_i32((a->vn << 2) | a->len);
27
t = FIELD_DP64(t, ID_AA64MMFR1, HPDS, 1); /* HPD */
36
def = tcg_temp_new_i64();
28
t = FIELD_DP64(t, ID_AA64MMFR1, LO, 1);
37
if (a->op) {
29
--
38
--
30
2.20.1
39
2.20.1
31
40
32
41
diff view generated by jsdifflib