1 | ARM bugfixes for rc1... | 1 | Not very much here, but several people have fallen over |
---|---|---|---|
2 | the vector operation segfault bug, so let's get the fix | ||
3 | into master. | ||
2 | 4 | ||
5 | thanks | ||
6 | -- PMM | ||
3 | 7 | ||
4 | The following changes since commit f291910db61b5812e68f1e76afb3ade41d567bea: | 8 | The following changes since commit d418238dca7b4e0b124135827ead3076233052b1: |
5 | 9 | ||
6 | Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-11-09' into staging (2017-11-13 13:13:12 +0000) | 10 | Merge remote-tracking branch 'remotes/rth/tags/pull-rng-20190522' into staging (2019-05-23 12:57:17 +0100) |
7 | 11 | ||
8 | are available in the git repository at: | 12 | are available in the Git repository at: |
9 | 13 | ||
10 | git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20171113 | 14 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190523 |
11 | 15 | ||
12 | for you to fetch changes up to d25f2a72272b9ffe0d06710d6217d1169bc2cc7d: | 16 | for you to fetch changes up to 98e4f4fdb8ea05d840f51f47125924c2bb9df2df: |
13 | 17 | ||
14 | accel/tcg/translate-all: expand cpu_restore_state addr check (2017-11-13 13:55:27 +0000) | 18 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC (2019-05-23 14:47:44 +0100) |
15 | 19 | ||
16 | ---------------------------------------------------------------- | 20 | ---------------------------------------------------------------- |
17 | target-arm queue: | 21 | target-arm queue: |
18 | * translate-a64.c: silence gcc5 warning | 22 | * exynos4210: QOM'ify the Exynos4210 SoC |
19 | * highbank: validate register offset before access | 23 | * exynos4210: Add DMA support for the Exynos4210 |
20 | * MAINTAINERS: Add entries for Smartfusion2 | 24 | * arm_gicv3: Fix writes to ICC_CTLR_EL3 |
21 | * accel/tcg/translate-all: expand cpu_restore_state addr check | 25 | * arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} |
22 | (so usermode insn aborts don't crash with an assertion failure) | 26 | * target/arm: Fix vector operation segfault |
23 | * fix TCG initialization of some Arm boards by allowing them | 27 | * target/arm: Minor improvements to BFXIL, EXTR |
24 | to specify min/default number of CPUs to create | ||
25 | 28 | ||
26 | ---------------------------------------------------------------- | 29 | ---------------------------------------------------------------- |
27 | Alex Bennée (1): | 30 | Alistair Francis (1): |
28 | accel/tcg/translate-all: expand cpu_restore_state addr check | 31 | target/arm: Fix vector operation segfault |
29 | 32 | ||
30 | Alistair Francis (2): | 33 | Guenter Roeck (1): |
31 | xlnx-zynqmp: Properly support the smp command line option | 34 | hw/arm/exynos4210: Add DMA support for the Exynos4210 |
32 | xlnx-zcu102: Add an info message deprecating the EP108 | ||
33 | 35 | ||
34 | Emilio G. Cota (4): | 36 | Peter Maydell (5): |
35 | arm/translate-a64: mark path as unreachable to eliminate warning | 37 | arm: Move system_clock_scale to armv7m_systick.h |
36 | qom: move CPUClass.tcg_initialize to a global | 38 | arm: Remove unnecessary includes of hw/arm/arm.h |
37 | xlnx-zcu102: Specify the max number of CPUs for the EP108 | 39 | arm: Rename hw/arm/arm.h to hw/arm/boot.h |
38 | hw: add .min_cpus and .default_cpus fields to machine_class | 40 | hw/intc/arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} |
41 | hw/intc/arm_gicv3: Fix writes to ICC_CTLR_EL3 | ||
39 | 42 | ||
40 | Prasad J Pandit (1): | 43 | Philippe Mathieu-Daudé (3): |
41 | highbank: validate register offset before access | 44 | hw/arm/exynos4: Remove unuseful debug code |
45 | hw/arm/exynos4: Use the IEC binary prefix definitions | ||
46 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC | ||
42 | 47 | ||
43 | Subbaraya Sundeep (1): | 48 | Richard Henderson (2): |
44 | MAINTAINERS: Add entries for Smartfusion2 | 49 | target/arm: Use extract2 for EXTR |
50 | target/arm: Simplify BFXIL expansion | ||
45 | 51 | ||
46 | include/exec/exec-all.h | 11 ++++++++++ | 52 | include/hw/arm/allwinner-a10.h | 2 +- |
47 | include/hw/boards.h | 5 +++++ | 53 | include/hw/arm/aspeed_soc.h | 1 - |
48 | include/qom/cpu.h | 1 - | 54 | include/hw/arm/bcm2836.h | 1 - |
49 | accel/tcg/translate-all.c | 52 ++++++++++++++++++++++++++-------------------- | 55 | include/hw/arm/{arm.h => boot.h} | 12 +++------ |
50 | exec.c | 5 +++-- | 56 | include/hw/arm/exynos4210.h | 9 +++++-- |
51 | hw/arm/exynos4_boards.c | 12 ++++------- | 57 | include/hw/arm/fsl-imx25.h | 2 +- |
52 | hw/arm/highbank.c | 17 +++++++++++++-- | 58 | include/hw/arm/fsl-imx31.h | 2 +- |
53 | hw/arm/raspi.c | 2 ++ | 59 | include/hw/arm/fsl-imx6.h | 2 +- |
54 | hw/arm/xlnx-zcu102.c | 9 +++++++- | 60 | include/hw/arm/fsl-imx6ul.h | 2 +- |
55 | hw/arm/xlnx-zynqmp.c | 26 ++++++++++++++--------- | 61 | include/hw/arm/fsl-imx7.h | 2 +- |
56 | target/arm/translate-a64.c | 2 ++ | 62 | include/hw/arm/virt.h | 2 +- |
57 | vl.c | 21 ++++++++++++++++--- | 63 | include/hw/arm/xlnx-versal.h | 2 +- |
58 | MAINTAINERS | 17 +++++++++++++++ | 64 | include/hw/arm/xlnx-zynqmp.h | 2 +- |
59 | qemu-doc.texi | 7 +++++++ | 65 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++ |
60 | 14 files changed, 137 insertions(+), 50 deletions(-) | 66 | hw/arm/armsse.c | 2 +- |
67 | hw/arm/armv7m.c | 2 +- | ||
68 | hw/arm/aspeed.c | 2 +- | ||
69 | hw/arm/boot.c | 2 +- | ||
70 | hw/arm/collie.c | 2 +- | ||
71 | hw/arm/exynos4210.c | 54 ++++++++++++++++++++++++++++++++++++--- | ||
72 | hw/arm/exynos4_boards.c | 40 ++++++++--------------------- | ||
73 | hw/arm/highbank.c | 2 +- | ||
74 | hw/arm/integratorcp.c | 2 +- | ||
75 | hw/arm/mainstone.c | 2 +- | ||
76 | hw/arm/microbit.c | 2 +- | ||
77 | hw/arm/mps2-tz.c | 2 +- | ||
78 | hw/arm/mps2.c | 2 +- | ||
79 | hw/arm/msf2-soc.c | 1 - | ||
80 | hw/arm/msf2-som.c | 2 +- | ||
81 | hw/arm/musca.c | 2 +- | ||
82 | hw/arm/musicpal.c | 2 +- | ||
83 | hw/arm/netduino2.c | 2 +- | ||
84 | hw/arm/nrf51_soc.c | 2 +- | ||
85 | hw/arm/nseries.c | 2 +- | ||
86 | hw/arm/omap1.c | 2 +- | ||
87 | hw/arm/omap2.c | 2 +- | ||
88 | hw/arm/omap_sx1.c | 2 +- | ||
89 | hw/arm/palm.c | 2 +- | ||
90 | hw/arm/raspi.c | 2 +- | ||
91 | hw/arm/realview.c | 2 +- | ||
92 | hw/arm/spitz.c | 2 +- | ||
93 | hw/arm/stellaris.c | 2 +- | ||
94 | hw/arm/stm32f205_soc.c | 2 +- | ||
95 | hw/arm/strongarm.c | 2 +- | ||
96 | hw/arm/tosa.c | 2 +- | ||
97 | hw/arm/versatilepb.c | 2 +- | ||
98 | hw/arm/vexpress.c | 2 +- | ||
99 | hw/arm/virt.c | 2 +- | ||
100 | hw/arm/xilinx_zynq.c | 2 +- | ||
101 | hw/arm/xlnx-versal.c | 2 +- | ||
102 | hw/arm/z2.c | 2 +- | ||
103 | hw/intc/arm_gicv3_cpuif.c | 6 ++--- | ||
104 | hw/intc/armv7m_nvic.c | 1 - | ||
105 | target/arm/arm-semi.c | 1 - | ||
106 | target/arm/cpu.c | 1 - | ||
107 | target/arm/cpu64.c | 1 - | ||
108 | target/arm/kvm.c | 1 - | ||
109 | target/arm/kvm32.c | 1 - | ||
110 | target/arm/kvm64.c | 1 - | ||
111 | target/arm/translate-a64.c | 44 ++++++++++++++++--------------- | ||
112 | target/arm/translate.c | 4 +-- | ||
113 | 61 files changed, 164 insertions(+), 123 deletions(-) | ||
114 | rename include/hw/arm/{arm.h => boot.h} (96%) | ||
61 | 115 | diff view generated by jsdifflib |
1 | From: Alistair Francis <alistair.francis@xilinx.com> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Allow the -smp command line option to control the number of CPUs we | 3 | This is, after all, how we implement extract2 in tcg/aarch64. |
4 | create. | ||
5 | 4 | ||
6 | Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> | 6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
8 | Reviewed-by: Emilio G. Cota <cota@braap.org> | 7 | Message-id: 20190514011129.11330-2-richard.henderson@linaro.org |
9 | Tested-by: Emilio G. Cota <cota@braap.org> | ||
10 | Message-id: 1510343626-25861-3-git-send-email-cota@braap.org | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
12 | --- | 9 | --- |
13 | hw/arm/xlnx-zcu102.c | 3 ++- | 10 | target/arm/translate-a64.c | 38 ++++++++++++++++++++------------------ |
14 | hw/arm/xlnx-zynqmp.c | 26 ++++++++++++++++---------- | 11 | 1 file changed, 20 insertions(+), 18 deletions(-) |
15 | 2 files changed, 18 insertions(+), 11 deletions(-) | ||
16 | 12 | ||
17 | diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c | 13 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
18 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/hw/arm/xlnx-zcu102.c | 15 | --- a/target/arm/translate-a64.c |
20 | +++ b/hw/arm/xlnx-zcu102.c | 16 | +++ b/target/arm/translate-a64.c |
21 | @@ -XXX,XX +XXX,XX @@ static void xlnx_zcu102_machine_class_init(ObjectClass *oc, void *data) | 17 | @@ -XXX,XX +XXX,XX @@ static void disas_extract(DisasContext *s, uint32_t insn) |
22 | { | 18 | } else { |
23 | MachineClass *mc = MACHINE_CLASS(oc); | 19 | tcg_gen_ext32u_i64(tcg_rd, cpu_reg(s, rm)); |
24 | 20 | } | |
25 | - mc->desc = "Xilinx ZynqMP ZCU102 board"; | 21 | - } else if (rm == rn) { /* ROR */ |
26 | + mc->desc = "Xilinx ZynqMP ZCU102 board with 4xA53s and 2xR5s based on " \ | 22 | - tcg_rm = cpu_reg(s, rm); |
27 | + "the value of smp"; | 23 | - if (sf) { |
28 | mc->init = xlnx_zcu102_init; | 24 | - tcg_gen_rotri_i64(tcg_rd, tcg_rm, imm); |
29 | mc->block_default_type = IF_IDE; | 25 | - } else { |
30 | mc->units_per_default_bus = 1; | 26 | - TCGv_i32 tmp = tcg_temp_new_i32(); |
31 | diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c | 27 | - tcg_gen_extrl_i64_i32(tmp, tcg_rm); |
32 | index XXXXXXX..XXXXXXX 100644 | 28 | - tcg_gen_rotri_i32(tmp, tmp, imm); |
33 | --- a/hw/arm/xlnx-zynqmp.c | 29 | - tcg_gen_extu_i32_i64(tcg_rd, tmp); |
34 | +++ b/hw/arm/xlnx-zynqmp.c | 30 | - tcg_temp_free_i32(tmp); |
35 | @@ -XXX,XX +XXX,XX @@ static void xlnx_zynqmp_create_rpu(XlnxZynqMPState *s, const char *boot_cpu, | 31 | - } |
36 | { | 32 | } else { |
37 | Error *err = NULL; | 33 | - tcg_rm = read_cpu_reg(s, rm, sf); |
38 | int i; | 34 | - tcg_rn = read_cpu_reg(s, rn, sf); |
39 | + int num_rpus = MIN(smp_cpus - XLNX_ZYNQMP_NUM_APU_CPUS, XLNX_ZYNQMP_NUM_RPU_CPUS); | 35 | - tcg_gen_shri_i64(tcg_rm, tcg_rm, imm); |
40 | 36 | - tcg_gen_shli_i64(tcg_rn, tcg_rn, bitsize - imm); | |
41 | - for (i = 0; i < XLNX_ZYNQMP_NUM_RPU_CPUS; i++) { | 37 | - tcg_gen_or_i64(tcg_rd, tcg_rm, tcg_rn); |
42 | + for (i = 0; i < num_rpus; i++) { | 38 | - if (!sf) { |
43 | char *name; | 39 | - tcg_gen_ext32u_i64(tcg_rd, tcg_rd); |
44 | 40 | + tcg_rm = cpu_reg(s, rm); | |
45 | object_initialize(&s->rpu_cpu[i], sizeof(s->rpu_cpu[i]), | 41 | + tcg_rn = cpu_reg(s, rn); |
46 | @@ -XXX,XX +XXX,XX @@ static void xlnx_zynqmp_init(Object *obj) | 42 | + |
47 | { | 43 | + if (sf) { |
48 | XlnxZynqMPState *s = XLNX_ZYNQMP(obj); | 44 | + /* Specialization to ROR happens in EXTRACT2. */ |
49 | int i; | 45 | + tcg_gen_extract2_i64(tcg_rd, tcg_rm, tcg_rn, imm); |
50 | + int num_apus = MIN(smp_cpus, XLNX_ZYNQMP_NUM_APU_CPUS); | 46 | + } else { |
51 | 47 | + TCGv_i32 t0 = tcg_temp_new_i32(); | |
52 | - for (i = 0; i < XLNX_ZYNQMP_NUM_APU_CPUS; i++) { | 48 | + |
53 | + for (i = 0; i < num_apus; i++) { | 49 | + tcg_gen_extrl_i64_i32(t0, tcg_rm); |
54 | object_initialize(&s->apu_cpu[i], sizeof(s->apu_cpu[i]), | 50 | + if (rm == rn) { |
55 | "cortex-a53-" TYPE_ARM_CPU); | 51 | + tcg_gen_rotri_i32(t0, t0, imm); |
56 | object_property_add_child(obj, "apu-cpu[*]", OBJECT(&s->apu_cpu[i]), | 52 | + } else { |
57 | @@ -XXX,XX +XXX,XX @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) | 53 | + TCGv_i32 t1 = tcg_temp_new_i32(); |
58 | MemoryRegion *system_memory = get_system_memory(); | 54 | + tcg_gen_extrl_i64_i32(t1, tcg_rn); |
59 | uint8_t i; | 55 | + tcg_gen_extract2_i32(t0, t0, t1, imm); |
60 | uint64_t ram_size; | 56 | + tcg_temp_free_i32(t1); |
61 | + int num_apus = MIN(smp_cpus, XLNX_ZYNQMP_NUM_APU_CPUS); | 57 | + } |
62 | const char *boot_cpu = s->boot_cpu ? s->boot_cpu : "apu-cpu[0]"; | 58 | + tcg_gen_extu_i32_i64(tcg_rd, t0); |
63 | ram_addr_t ddr_low_size, ddr_high_size; | 59 | + tcg_temp_free_i32(t0); |
64 | qemu_irq gic_spi[GIC_NUM_SPI_INTR]; | 60 | } |
65 | @@ -XXX,XX +XXX,XX @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) | ||
66 | |||
67 | qdev_prop_set_uint32(DEVICE(&s->gic), "num-irq", GIC_NUM_SPI_INTR + 32); | ||
68 | qdev_prop_set_uint32(DEVICE(&s->gic), "revision", 2); | ||
69 | - qdev_prop_set_uint32(DEVICE(&s->gic), "num-cpu", XLNX_ZYNQMP_NUM_APU_CPUS); | ||
70 | + qdev_prop_set_uint32(DEVICE(&s->gic), "num-cpu", num_apus); | ||
71 | |||
72 | /* Realize APUs before realizing the GIC. KVM requires this. */ | ||
73 | - for (i = 0; i < XLNX_ZYNQMP_NUM_APU_CPUS; i++) { | ||
74 | + for (i = 0; i < num_apus; i++) { | ||
75 | char *name; | ||
76 | |||
77 | object_property_set_int(OBJECT(&s->apu_cpu[i]), QEMU_PSCI_CONDUIT_SMC, | ||
78 | @@ -XXX,XX +XXX,XX @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) | ||
79 | } | 61 | } |
80 | } | 62 | } |
81 | |||
82 | - for (i = 0; i < XLNX_ZYNQMP_NUM_APU_CPUS; i++) { | ||
83 | + for (i = 0; i < num_apus; i++) { | ||
84 | qemu_irq irq; | ||
85 | |||
86 | sysbus_connect_irq(SYS_BUS_DEVICE(&s->gic), i, | ||
87 | @@ -XXX,XX +XXX,XX @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) | ||
88 | } | ||
89 | |||
90 | if (s->has_rpu) { | ||
91 | - xlnx_zynqmp_create_rpu(s, boot_cpu, &err); | ||
92 | - if (err) { | ||
93 | - error_propagate(errp, err); | ||
94 | - return; | ||
95 | - } | ||
96 | + info_report("The 'has_rpu' property is no longer required, to use the " | ||
97 | + "RPUs just use -smp 6."); | ||
98 | + } | ||
99 | + | ||
100 | + xlnx_zynqmp_create_rpu(s, boot_cpu, &err); | ||
101 | + if (err) { | ||
102 | + error_propagate(errp, err); | ||
103 | + return; | ||
104 | } | ||
105 | |||
106 | if (!s->boot_cpu_ptr) { | ||
107 | -- | 63 | -- |
108 | 2.7.4 | 64 | 2.20.1 |
109 | 65 | ||
110 | 66 | diff view generated by jsdifflib |
1 | From: "Emilio G. Cota" <cota@braap.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Fixes the following warning when compiling with gcc 5.4.0 with -O1 | 3 | The mask implied by the extract is redundant with the one |
4 | optimizations and --enable-debug: | 4 | implied by the deposit. Also, fix spelling of BFXIL. |
5 | 5 | ||
6 | target/arm/translate-a64.c: In function ‘aarch64_tr_translate_insn’: | 6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
7 | target/arm/translate-a64.c:2361:8: error: ‘post_index’ may be used uninitialized in this function [-Werror=maybe-uninitialized] | 7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
8 | if (!post_index) { | 8 | Message-id: 20190514011129.11330-3-richard.henderson@linaro.org |
9 | ^ | ||
10 | target/arm/translate-a64.c:2307:10: note: ‘post_index’ was declared here | ||
11 | bool post_index; | ||
12 | ^ | ||
13 | target/arm/translate-a64.c:2386:8: error: ‘writeback’ may be used uninitialized in this function [-Werror=maybe-uninitialized] | ||
14 | if (writeback) { | ||
15 | ^ | ||
16 | target/arm/translate-a64.c:2308:10: note: ‘writeback’ was declared here | ||
17 | bool writeback; | ||
18 | ^ | ||
19 | |||
20 | Note that idx comes from selecting 2 bits, and therefore its value | ||
21 | can be at most 3. | ||
22 | |||
23 | Signed-off-by: Emilio G. Cota <cota@braap.org> | ||
24 | Acked-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
25 | Message-id: 1510087611-1851-1-git-send-email-cota@braap.org | ||
26 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
27 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
28 | --- | 10 | --- |
29 | target/arm/translate-a64.c | 2 ++ | 11 | target/arm/translate-a64.c | 6 +++--- |
30 | 1 file changed, 2 insertions(+) | 12 | 1 file changed, 3 insertions(+), 3 deletions(-) |
31 | 13 | ||
32 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 14 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
33 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
34 | --- a/target/arm/translate-a64.c | 16 | --- a/target/arm/translate-a64.c |
35 | +++ b/target/arm/translate-a64.c | 17 | +++ b/target/arm/translate-a64.c |
36 | @@ -XXX,XX +XXX,XX @@ static void disas_ldst_reg_imm9(DisasContext *s, uint32_t insn, | 18 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) |
37 | post_index = false; | 19 | tcg_gen_extract_i64(tcg_rd, tcg_tmp, ri, len); |
38 | writeback = true; | 20 | return; |
39 | break; | 21 | } |
40 | + default: | 22 | - /* opc == 1, BXFIL fall through to deposit */ |
41 | + g_assert_not_reached(); | 23 | - tcg_gen_extract_i64(tcg_tmp, tcg_tmp, ri, len); |
24 | + /* opc == 1, BFXIL fall through to deposit */ | ||
25 | + tcg_gen_shri_i64(tcg_tmp, tcg_tmp, ri); | ||
26 | pos = 0; | ||
27 | } else { | ||
28 | /* Handle the ri > si case with a deposit | ||
29 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) | ||
30 | len = ri; | ||
42 | } | 31 | } |
43 | 32 | ||
44 | if (rn == 31) { | 33 | - if (opc == 1) { /* BFM, BXFIL */ |
34 | + if (opc == 1) { /* BFM, BFXIL */ | ||
35 | tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_tmp, pos, len); | ||
36 | } else { | ||
37 | /* SBFM or UBFM: We start with zero, and we haven't modified | ||
45 | -- | 38 | -- |
46 | 2.7.4 | 39 | 2.20.1 |
47 | 40 | ||
48 | 41 | diff view generated by jsdifflib |
1 | From: Subbaraya Sundeep <sundeep.lkml@gmail.com> | 1 | From: Alistair Francis <alistair.francis@wdc.com> |
---|---|---|---|
2 | 2 | ||
3 | Voluntarily add myself as maintainer for Smartfusion2 | 3 | Commit 89e68b575 "target/arm: Use vector operations for saturation" |
4 | causes this abort() when booting QEMU ARM with a Cortex-A15: | ||
4 | 5 | ||
5 | Signed-off-by: Subbaraya Sundeep <sundeep.lkml@gmail.com> | 6 | 0 0x00007ffff4c2382f in raise () at /usr/lib/libc.so.6 |
6 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | 7 | 1 0x00007ffff4c0e672 in abort () at /usr/lib/libc.so.6 |
7 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 8 | 2 0x00005555559c1839 in disas_neon_data_insn (insn=<optimized out>, s=<optimized out>) at ./target/arm/translate.c:6673 |
8 | Message-id: 1510552520-3566-1-git-send-email-sundeep.lkml@gmail.com | 9 | 3 0x00005555559c1839 in disas_neon_data_insn (s=<optimized out>, insn=<optimized out>) at ./target/arm/translate.c:6386 |
10 | 4 0x00005555559cd8a4 in disas_arm_insn (insn=4081107068, s=0x7fffe59a9510) at ./target/arm/translate.c:9289 | ||
11 | 5 0x00005555559cd8a4 in arm_tr_translate_insn (dcbase=0x7fffe59a9510, cpu=<optimized out>) at ./target/arm/translate.c:13612 | ||
12 | 6 0x00005555558d1d39 in translator_loop (ops=0x5555561cc580 <arm_translator_ops>, db=0x7fffe59a9510, cpu=0x55555686a2f0, tb=<optimized out>, max_insns=<optimized out>) at ./accel/tcg/translator.c:96 | ||
13 | 7 0x00005555559d10d4 in gen_intermediate_code (cpu=cpu@entry=0x55555686a2f0, tb=tb@entry=0x7fffd7840080 <code_gen_buffer+126091347>, max_insns=max_insns@entry=512) at ./target/arm/translate.c:13901 | ||
14 | 8 0x00005555558d06b9 in tb_gen_code (cpu=cpu@entry=0x55555686a2f0, pc=3067096216, cs_base=0, flags=192, cflags=-16252928, cflags@entry=524288) at ./accel/tcg/translate-all.c:1736 | ||
15 | 9 0x00005555558ce467 in tb_find (cf_mask=524288, tb_exit=1, last_tb=0x7fffd783e640 <code_gen_buffer+126084627>, cpu=0x1) at ./accel/tcg/cpu-exec.c:407 | ||
16 | 10 0x00005555558ce467 in cpu_exec (cpu=cpu@entry=0x55555686a2f0) at ./accel/tcg/cpu-exec.c:728 | ||
17 | 11 0x000055555588b0cf in tcg_cpu_exec (cpu=0x55555686a2f0) at ./cpus.c:1431 | ||
18 | 12 0x000055555588d223 in qemu_tcg_cpu_thread_fn (arg=0x55555686a2f0) at ./cpus.c:1735 | ||
19 | 13 0x000055555588d223 in qemu_tcg_cpu_thread_fn (arg=arg@entry=0x55555686a2f0) at ./cpus.c:1709 | ||
20 | 14 0x0000555555d2629a in qemu_thread_start (args=<optimized out>) at ./util/qemu-thread-posix.c:502 | ||
21 | 15 0x00007ffff4db8a92 in start_thread () at /usr/lib/libpthread. | ||
22 | |||
23 | This patch ensures that we don't hit the abort() in the second switch | ||
24 | case in disas_neon_data_insn() as we will return from the first case. | ||
25 | |||
26 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
27 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
28 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
29 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
30 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
31 | Message-id: ad91b397f360b2fc7f4087e476f7df5b04d42ddb.1558021877.git.alistair.francis@wdc.com | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 32 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 33 | --- |
11 | MAINTAINERS | 17 +++++++++++++++++ | 34 | target/arm/translate.c | 4 ++-- |
12 | 1 file changed, 17 insertions(+) | 35 | 1 file changed, 2 insertions(+), 2 deletions(-) |
13 | 36 | ||
14 | diff --git a/MAINTAINERS b/MAINTAINERS | 37 | diff --git a/target/arm/translate.c b/target/arm/translate.c |
15 | index XXXXXXX..XXXXXXX 100644 | 38 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/MAINTAINERS | 39 | --- a/target/arm/translate.c |
17 | +++ b/MAINTAINERS | 40 | +++ b/target/arm/translate.c |
18 | @@ -XXX,XX +XXX,XX @@ M: Alistair Francis <alistair@alistair23.me> | 41 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) |
19 | S: Maintained | 42 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), |
20 | F: hw/arm/netduino2.c | 43 | rn_ofs, rm_ofs, vec_size, vec_size, |
21 | 44 | (u ? uqadd_op : sqadd_op) + size); | |
22 | +SmartFusion2 | 45 | - break; |
23 | +M: Subbaraya Sundeep <sundeep.lkml@gmail.com> | 46 | + return 0; |
24 | +S: Maintained | 47 | |
25 | +F: hw/arm/msf2-soc.c | 48 | case NEON_3R_VQSUB: |
26 | +F: hw/misc/msf2-sysreg.c | 49 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), |
27 | +F: hw/timer/mss-timer.c | 50 | rn_ofs, rm_ofs, vec_size, vec_size, |
28 | +F: hw/ssi/mss-spi.c | 51 | (u ? uqsub_op : sqsub_op) + size); |
29 | +F: include/hw/arm/msf2-soc.h | 52 | - break; |
30 | +F: include/hw/misc/msf2-sysreg.h | 53 | + return 0; |
31 | +F: include/hw/timer/mss-timer.h | 54 | |
32 | +F: include/hw/ssi/mss-spi.h | 55 | case NEON_3R_VMUL: /* VMUL */ |
33 | + | 56 | if (u) { |
34 | +Emcraft M2S-FG484 | ||
35 | +M: Subbaraya Sundeep <sundeep.lkml@gmail.com> | ||
36 | +S: Maintained | ||
37 | +F: hw/arm/msf2-som.c | ||
38 | + | ||
39 | CRIS Machines | ||
40 | ------------- | ||
41 | Axis Dev88 | ||
42 | -- | 57 | -- |
43 | 2.7.4 | 58 | 2.20.1 |
44 | 59 | ||
45 | 60 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | The system_clock_scale global is used only by the armv7m systick | ||
2 | device; move the extern declaration to the armv7m_systick.h header, | ||
3 | and expand the comment to explain what it is and that it should | ||
4 | ideally be replaced with a different approach. | ||
1 | 5 | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20190516163857.6430-2-peter.maydell@linaro.org | ||
10 | --- | ||
11 | include/hw/arm/arm.h | 4 ---- | ||
12 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++++++++ | ||
13 | 2 files changed, 22 insertions(+), 4 deletions(-) | ||
14 | |||
15 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/include/hw/arm/arm.h | ||
18 | +++ b/include/hw/arm/arm.h | ||
19 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, | ||
20 | const struct arm_boot_info *info, | ||
21 | hwaddr mvbar_addr); | ||
22 | |||
23 | -/* Multiplication factor to convert from system clock ticks to qemu timer | ||
24 | - ticks. */ | ||
25 | -extern int system_clock_scale; | ||
26 | - | ||
27 | #endif /* HW_ARM_H */ | ||
28 | diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_systick.h | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/include/hw/timer/armv7m_systick.h | ||
31 | +++ b/include/hw/timer/armv7m_systick.h | ||
32 | @@ -XXX,XX +XXX,XX @@ typedef struct SysTickState { | ||
33 | qemu_irq irq; | ||
34 | } SysTickState; | ||
35 | |||
36 | +/* | ||
37 | + * Multiplication factor to convert from system clock ticks to qemu timer | ||
38 | + * ticks. This should be set (by board code, usually) to a value | ||
39 | + * equal to NANOSECONDS_PER_SECOND / frq, where frq is the clock frequency | ||
40 | + * in Hz of the CPU. | ||
41 | + * | ||
42 | + * This value is used by the systick device when it is running in | ||
43 | + * its "use the CPU clock" mode (ie when SYST_CSR.CLKSOURCE == 1) to | ||
44 | + * set how fast the timer should tick. | ||
45 | + * | ||
46 | + * TODO: we should refactor this so that rather than using a global | ||
47 | + * we use a device property or something similar. This is complicated | ||
48 | + * because (a) the property would need to be plumbed through from the | ||
49 | + * board code down through various layers to the systick device | ||
50 | + * and (b) the property needs to be modifiable after realize, because | ||
51 | + * the stellaris board uses this to implement the behaviour where the | ||
52 | + * guest can reprogram the PLL registers to downclock the CPU, and the | ||
53 | + * systick device needs to react accordingly. Possibly this should | ||
54 | + * be deferred until we have a good API for modelling clock trees. | ||
55 | + */ | ||
56 | +extern int system_clock_scale; | ||
57 | + | ||
58 | #endif | ||
59 | -- | ||
60 | 2.20.1 | ||
61 | |||
62 | diff view generated by jsdifflib |
1 | From: Alistair Francis <alistair.francis@xilinx.com> | 1 | The hw/arm/arm.h header now only includes declarations relating |
---|---|---|---|
2 | to boot.c code, so it is only needed by Arm board or SoC code. | ||
3 | Remove some unnecessary inclusions of it from target/arm files | ||
4 | and from hw/intc/armv7m_nvic.c. | ||
2 | 5 | ||
3 | The EP108 was an early access development board that is no longer used. | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
4 | Add an info message to convert any users to the ZCU102 instead. On QEMU | 7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
5 | they are both identical. | 8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
9 | Message-id: 20190516163857.6430-3-peter.maydell@linaro.org | ||
10 | --- | ||
11 | hw/intc/armv7m_nvic.c | 1 - | ||
12 | target/arm/arm-semi.c | 1 - | ||
13 | target/arm/cpu.c | 1 - | ||
14 | target/arm/cpu64.c | 1 - | ||
15 | target/arm/kvm.c | 1 - | ||
16 | target/arm/kvm32.c | 1 - | ||
17 | target/arm/kvm64.c | 1 - | ||
18 | 7 files changed, 7 deletions(-) | ||
6 | 19 | ||
7 | This patch also updated the qemu-doc.texi file to indicate that the | 20 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c |
8 | EP108 has been deprecated. | ||
9 | |||
10 | Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> | ||
11 | Reviewed-by: Emilio G. Cota <cota@braap.org> | ||
12 | Message-id: 1510343626-25861-4-git-send-email-cota@braap.org | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
14 | --- | ||
15 | hw/arm/xlnx-zcu102.c | 3 +++ | ||
16 | qemu-doc.texi | 7 +++++++ | ||
17 | 2 files changed, 10 insertions(+) | ||
18 | |||
19 | diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c | ||
20 | index XXXXXXX..XXXXXXX 100644 | 21 | index XXXXXXX..XXXXXXX 100644 |
21 | --- a/hw/arm/xlnx-zcu102.c | 22 | --- a/hw/intc/armv7m_nvic.c |
22 | +++ b/hw/arm/xlnx-zcu102.c | 23 | +++ b/hw/intc/armv7m_nvic.c |
23 | @@ -XXX,XX +XXX,XX @@ static void xlnx_ep108_init(MachineState *machine) | 24 | @@ -XXX,XX +XXX,XX @@ |
24 | { | 25 | #include "cpu.h" |
25 | XlnxZCU102 *s = EP108_MACHINE(machine); | 26 | #include "hw/sysbus.h" |
26 | 27 | #include "qemu/timer.h" | |
27 | + info_report("The Xilinx EP108 machine is deprecated, please use the " | 28 | -#include "hw/arm/arm.h" |
28 | + "ZCU102 machine instead. It has the same features supported."); | 29 | #include "hw/intc/armv7m_nvic.h" |
29 | + | 30 | #include "target/arm/cpu.h" |
30 | xlnx_zynqmp_init(s, machine); | 31 | #include "exec/exec-all.h" |
31 | } | 32 | diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c |
32 | |||
33 | diff --git a/qemu-doc.texi b/qemu-doc.texi | ||
34 | index XXXXXXX..XXXXXXX 100644 | 33 | index XXXXXXX..XXXXXXX 100644 |
35 | --- a/qemu-doc.texi | 34 | --- a/target/arm/arm-semi.c |
36 | +++ b/qemu-doc.texi | 35 | +++ b/target/arm/arm-semi.c |
37 | @@ -XXX,XX +XXX,XX @@ or ``ivshmem-doorbell`` device types. | 36 | @@ -XXX,XX +XXX,XX @@ |
38 | The ``spapr-pci-vfio-host-bridge'' device type is replaced by | 37 | #else |
39 | the ``spapr-pci-host-bridge'' device type. | 38 | #include "qemu-common.h" |
40 | 39 | #include "exec/gdbstub.h" | |
41 | +@section System emulator machines | 40 | -#include "hw/arm/arm.h" |
42 | + | 41 | #include "qemu/cutils.h" |
43 | +@subsection Xilinx EP108 (since 2.11.0) | 42 | #endif |
44 | + | 43 | |
45 | +The ``xlnx-ep108'' machine has been replaced by the ``xlnx-zcu102'' machine. | 44 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c |
46 | +The ``xlnx-zcu102'' machine has the same features and capabilites in QEMU. | 45 | index XXXXXXX..XXXXXXX 100644 |
47 | + | 46 | --- a/target/arm/cpu.c |
48 | @node License | 47 | +++ b/target/arm/cpu.c |
49 | @appendix License | 48 | @@ -XXX,XX +XXX,XX @@ |
49 | #if !defined(CONFIG_USER_ONLY) | ||
50 | #include "hw/loader.h" | ||
51 | #endif | ||
52 | -#include "hw/arm/arm.h" | ||
53 | #include "sysemu/sysemu.h" | ||
54 | #include "sysemu/hw_accel.h" | ||
55 | #include "kvm_arm.h" | ||
56 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | ||
57 | index XXXXXXX..XXXXXXX 100644 | ||
58 | --- a/target/arm/cpu64.c | ||
59 | +++ b/target/arm/cpu64.c | ||
60 | @@ -XXX,XX +XXX,XX @@ | ||
61 | #if !defined(CONFIG_USER_ONLY) | ||
62 | #include "hw/loader.h" | ||
63 | #endif | ||
64 | -#include "hw/arm/arm.h" | ||
65 | #include "sysemu/sysemu.h" | ||
66 | #include "sysemu/kvm.h" | ||
67 | #include "kvm_arm.h" | ||
68 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c | ||
69 | index XXXXXXX..XXXXXXX 100644 | ||
70 | --- a/target/arm/kvm.c | ||
71 | +++ b/target/arm/kvm.c | ||
72 | @@ -XXX,XX +XXX,XX @@ | ||
73 | #include "cpu.h" | ||
74 | #include "trace.h" | ||
75 | #include "internals.h" | ||
76 | -#include "hw/arm/arm.h" | ||
77 | #include "hw/pci/pci.h" | ||
78 | #include "exec/memattrs.h" | ||
79 | #include "exec/address-spaces.h" | ||
80 | diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c | ||
81 | index XXXXXXX..XXXXXXX 100644 | ||
82 | --- a/target/arm/kvm32.c | ||
83 | +++ b/target/arm/kvm32.c | ||
84 | @@ -XXX,XX +XXX,XX @@ | ||
85 | #include "sysemu/kvm.h" | ||
86 | #include "kvm_arm.h" | ||
87 | #include "internals.h" | ||
88 | -#include "hw/arm/arm.h" | ||
89 | #include "qemu/log.h" | ||
90 | |||
91 | static inline void set_feature(uint64_t *features, int feature) | ||
92 | diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c | ||
93 | index XXXXXXX..XXXXXXX 100644 | ||
94 | --- a/target/arm/kvm64.c | ||
95 | +++ b/target/arm/kvm64.c | ||
96 | @@ -XXX,XX +XXX,XX @@ | ||
97 | #include "sysemu/kvm.h" | ||
98 | #include "kvm_arm.h" | ||
99 | #include "internals.h" | ||
100 | -#include "hw/arm/arm.h" | ||
101 | |||
102 | static bool have_guest_debug; | ||
50 | 103 | ||
51 | -- | 104 | -- |
52 | 2.7.4 | 105 | 2.20.1 |
53 | 106 | ||
54 | 107 | diff view generated by jsdifflib |
1 | From: Prasad J Pandit <pjp@fedoraproject.org> | 1 | The header file hw/arm/arm.h now includes only declarations |
---|---|---|---|
2 | relating to hw/arm/boot.c functionality. Rename it accordingly, | ||
3 | and adjust its header comment. | ||
2 | 4 | ||
3 | An 'offset' parameter sent to highbank register r/w functions | 5 | The bulk of this commit was created via |
4 | could be greater than number(NUM_REGS=0x200) of hb registers, | 6 | perl -pi -e 's|hw/arm/arm.h|hw/arm/boot.h|' hw/arm/*.c include/hw/arm/*.h |
5 | leading to an OOB access issue. Add check to avoid it. | ||
6 | 7 | ||
7 | Reported-by: Moguofang (Dennis mo) <moguofang@huawei.com> | 8 | In a few cases we can just delete the #include: |
8 | Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> | 9 | hw/arm/msf2-soc.c, include/hw/arm/aspeed_soc.h and |
9 | Message-id: 20171113062658.9697-1-ppandit@redhat.com | 10 | include/hw/arm/bcm2836.h did not require it. |
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 11 | |
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
13 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
14 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
15 | Message-id: 20190516163857.6430-4-peter.maydell@linaro.org | ||
12 | --- | 16 | --- |
13 | hw/arm/highbank.c | 17 +++++++++++++++-- | 17 | include/hw/arm/allwinner-a10.h | 2 +- |
14 | 1 file changed, 15 insertions(+), 2 deletions(-) | 18 | include/hw/arm/aspeed_soc.h | 1 - |
19 | include/hw/arm/bcm2836.h | 1 - | ||
20 | include/hw/arm/{arm.h => boot.h} | 8 ++++---- | ||
21 | include/hw/arm/fsl-imx25.h | 2 +- | ||
22 | include/hw/arm/fsl-imx31.h | 2 +- | ||
23 | include/hw/arm/fsl-imx6.h | 2 +- | ||
24 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
25 | include/hw/arm/fsl-imx7.h | 2 +- | ||
26 | include/hw/arm/virt.h | 2 +- | ||
27 | include/hw/arm/xlnx-versal.h | 2 +- | ||
28 | include/hw/arm/xlnx-zynqmp.h | 2 +- | ||
29 | hw/arm/armsse.c | 2 +- | ||
30 | hw/arm/armv7m.c | 2 +- | ||
31 | hw/arm/aspeed.c | 2 +- | ||
32 | hw/arm/boot.c | 2 +- | ||
33 | hw/arm/collie.c | 2 +- | ||
34 | hw/arm/exynos4210.c | 2 +- | ||
35 | hw/arm/exynos4_boards.c | 2 +- | ||
36 | hw/arm/highbank.c | 2 +- | ||
37 | hw/arm/integratorcp.c | 2 +- | ||
38 | hw/arm/mainstone.c | 2 +- | ||
39 | hw/arm/microbit.c | 2 +- | ||
40 | hw/arm/mps2-tz.c | 2 +- | ||
41 | hw/arm/mps2.c | 2 +- | ||
42 | hw/arm/msf2-soc.c | 1 - | ||
43 | hw/arm/msf2-som.c | 2 +- | ||
44 | hw/arm/musca.c | 2 +- | ||
45 | hw/arm/musicpal.c | 2 +- | ||
46 | hw/arm/netduino2.c | 2 +- | ||
47 | hw/arm/nrf51_soc.c | 2 +- | ||
48 | hw/arm/nseries.c | 2 +- | ||
49 | hw/arm/omap1.c | 2 +- | ||
50 | hw/arm/omap2.c | 2 +- | ||
51 | hw/arm/omap_sx1.c | 2 +- | ||
52 | hw/arm/palm.c | 2 +- | ||
53 | hw/arm/raspi.c | 2 +- | ||
54 | hw/arm/realview.c | 2 +- | ||
55 | hw/arm/spitz.c | 2 +- | ||
56 | hw/arm/stellaris.c | 2 +- | ||
57 | hw/arm/stm32f205_soc.c | 2 +- | ||
58 | hw/arm/strongarm.c | 2 +- | ||
59 | hw/arm/tosa.c | 2 +- | ||
60 | hw/arm/versatilepb.c | 2 +- | ||
61 | hw/arm/vexpress.c | 2 +- | ||
62 | hw/arm/virt.c | 2 +- | ||
63 | hw/arm/xilinx_zynq.c | 2 +- | ||
64 | hw/arm/xlnx-versal.c | 2 +- | ||
65 | hw/arm/z2.c | 2 +- | ||
66 | 49 files changed, 49 insertions(+), 52 deletions(-) | ||
67 | rename include/hw/arm/{arm.h => boot.h} (98%) | ||
15 | 68 | ||
69 | diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h | ||
70 | index XXXXXXX..XXXXXXX 100644 | ||
71 | --- a/include/hw/arm/allwinner-a10.h | ||
72 | +++ b/include/hw/arm/allwinner-a10.h | ||
73 | @@ -XXX,XX +XXX,XX @@ | ||
74 | #include "qemu-common.h" | ||
75 | #include "qemu/error-report.h" | ||
76 | #include "hw/char/serial.h" | ||
77 | -#include "hw/arm/arm.h" | ||
78 | +#include "hw/arm/boot.h" | ||
79 | #include "hw/timer/allwinner-a10-pit.h" | ||
80 | #include "hw/intc/allwinner-a10-pic.h" | ||
81 | #include "hw/net/allwinner_emac.h" | ||
82 | diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h | ||
83 | index XXXXXXX..XXXXXXX 100644 | ||
84 | --- a/include/hw/arm/aspeed_soc.h | ||
85 | +++ b/include/hw/arm/aspeed_soc.h | ||
86 | @@ -XXX,XX +XXX,XX @@ | ||
87 | #ifndef ASPEED_SOC_H | ||
88 | #define ASPEED_SOC_H | ||
89 | |||
90 | -#include "hw/arm/arm.h" | ||
91 | #include "hw/intc/aspeed_vic.h" | ||
92 | #include "hw/misc/aspeed_scu.h" | ||
93 | #include "hw/misc/aspeed_sdmc.h" | ||
94 | diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h | ||
95 | index XXXXXXX..XXXXXXX 100644 | ||
96 | --- a/include/hw/arm/bcm2836.h | ||
97 | +++ b/include/hw/arm/bcm2836.h | ||
98 | @@ -XXX,XX +XXX,XX @@ | ||
99 | #ifndef BCM2836_H | ||
100 | #define BCM2836_H | ||
101 | |||
102 | -#include "hw/arm/arm.h" | ||
103 | #include "hw/arm/bcm2835_peripherals.h" | ||
104 | #include "hw/intc/bcm2836_control.h" | ||
105 | |||
106 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/boot.h | ||
107 | similarity index 98% | ||
108 | rename from include/hw/arm/arm.h | ||
109 | rename to include/hw/arm/boot.h | ||
110 | index XXXXXXX..XXXXXXX 100644 | ||
111 | --- a/include/hw/arm/arm.h | ||
112 | +++ b/include/hw/arm/boot.h | ||
113 | @@ -XXX,XX +XXX,XX @@ | ||
114 | /* | ||
115 | - * Misc ARM declarations | ||
116 | + * ARM kernel loader. | ||
117 | * | ||
118 | * Copyright (c) 2006 CodeSourcery. | ||
119 | * Written by Paul Brook | ||
120 | @@ -XXX,XX +XXX,XX @@ | ||
121 | * | ||
122 | */ | ||
123 | |||
124 | -#ifndef HW_ARM_H | ||
125 | -#define HW_ARM_H | ||
126 | +#ifndef HW_ARM_BOOT_H | ||
127 | +#define HW_ARM_BOOT_H | ||
128 | |||
129 | #include "exec/memory.h" | ||
130 | #include "target/arm/cpu-qom.h" | ||
131 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, | ||
132 | const struct arm_boot_info *info, | ||
133 | hwaddr mvbar_addr); | ||
134 | |||
135 | -#endif /* HW_ARM_H */ | ||
136 | +#endif /* HW_ARM_BOOT_H */ | ||
137 | diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h | ||
138 | index XXXXXXX..XXXXXXX 100644 | ||
139 | --- a/include/hw/arm/fsl-imx25.h | ||
140 | +++ b/include/hw/arm/fsl-imx25.h | ||
141 | @@ -XXX,XX +XXX,XX @@ | ||
142 | #ifndef FSL_IMX25_H | ||
143 | #define FSL_IMX25_H | ||
144 | |||
145 | -#include "hw/arm/arm.h" | ||
146 | +#include "hw/arm/boot.h" | ||
147 | #include "hw/intc/imx_avic.h" | ||
148 | #include "hw/misc/imx25_ccm.h" | ||
149 | #include "hw/char/imx_serial.h" | ||
150 | diff --git a/include/hw/arm/fsl-imx31.h b/include/hw/arm/fsl-imx31.h | ||
151 | index XXXXXXX..XXXXXXX 100644 | ||
152 | --- a/include/hw/arm/fsl-imx31.h | ||
153 | +++ b/include/hw/arm/fsl-imx31.h | ||
154 | @@ -XXX,XX +XXX,XX @@ | ||
155 | #ifndef FSL_IMX31_H | ||
156 | #define FSL_IMX31_H | ||
157 | |||
158 | -#include "hw/arm/arm.h" | ||
159 | +#include "hw/arm/boot.h" | ||
160 | #include "hw/intc/imx_avic.h" | ||
161 | #include "hw/misc/imx31_ccm.h" | ||
162 | #include "hw/char/imx_serial.h" | ||
163 | diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h | ||
164 | index XXXXXXX..XXXXXXX 100644 | ||
165 | --- a/include/hw/arm/fsl-imx6.h | ||
166 | +++ b/include/hw/arm/fsl-imx6.h | ||
167 | @@ -XXX,XX +XXX,XX @@ | ||
168 | #ifndef FSL_IMX6_H | ||
169 | #define FSL_IMX6_H | ||
170 | |||
171 | -#include "hw/arm/arm.h" | ||
172 | +#include "hw/arm/boot.h" | ||
173 | #include "hw/cpu/a9mpcore.h" | ||
174 | #include "hw/misc/imx6_ccm.h" | ||
175 | #include "hw/misc/imx6_src.h" | ||
176 | diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h | ||
177 | index XXXXXXX..XXXXXXX 100644 | ||
178 | --- a/include/hw/arm/fsl-imx6ul.h | ||
179 | +++ b/include/hw/arm/fsl-imx6ul.h | ||
180 | @@ -XXX,XX +XXX,XX @@ | ||
181 | #ifndef FSL_IMX6UL_H | ||
182 | #define FSL_IMX6UL_H | ||
183 | |||
184 | -#include "hw/arm/arm.h" | ||
185 | +#include "hw/arm/boot.h" | ||
186 | #include "hw/cpu/a15mpcore.h" | ||
187 | #include "hw/misc/imx6ul_ccm.h" | ||
188 | #include "hw/misc/imx6_src.h" | ||
189 | diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h | ||
190 | index XXXXXXX..XXXXXXX 100644 | ||
191 | --- a/include/hw/arm/fsl-imx7.h | ||
192 | +++ b/include/hw/arm/fsl-imx7.h | ||
193 | @@ -XXX,XX +XXX,XX @@ | ||
194 | #ifndef FSL_IMX7_H | ||
195 | #define FSL_IMX7_H | ||
196 | |||
197 | -#include "hw/arm/arm.h" | ||
198 | +#include "hw/arm/boot.h" | ||
199 | #include "hw/cpu/a15mpcore.h" | ||
200 | #include "hw/intc/imx_gpcv2.h" | ||
201 | #include "hw/misc/imx7_ccm.h" | ||
202 | diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h | ||
203 | index XXXXXXX..XXXXXXX 100644 | ||
204 | --- a/include/hw/arm/virt.h | ||
205 | +++ b/include/hw/arm/virt.h | ||
206 | @@ -XXX,XX +XXX,XX @@ | ||
207 | #include "exec/hwaddr.h" | ||
208 | #include "qemu/notify.h" | ||
209 | #include "hw/boards.h" | ||
210 | -#include "hw/arm/arm.h" | ||
211 | +#include "hw/arm/boot.h" | ||
212 | #include "hw/block/flash.h" | ||
213 | #include "sysemu/kvm.h" | ||
214 | #include "hw/intc/arm_gicv3_common.h" | ||
215 | diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h | ||
216 | index XXXXXXX..XXXXXXX 100644 | ||
217 | --- a/include/hw/arm/xlnx-versal.h | ||
218 | +++ b/include/hw/arm/xlnx-versal.h | ||
219 | @@ -XXX,XX +XXX,XX @@ | ||
220 | #define XLNX_VERSAL_H | ||
221 | |||
222 | #include "hw/sysbus.h" | ||
223 | -#include "hw/arm/arm.h" | ||
224 | +#include "hw/arm/boot.h" | ||
225 | #include "hw/intc/arm_gicv3.h" | ||
226 | |||
227 | #define TYPE_XLNX_VERSAL "xlnx-versal" | ||
228 | diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h | ||
229 | index XXXXXXX..XXXXXXX 100644 | ||
230 | --- a/include/hw/arm/xlnx-zynqmp.h | ||
231 | +++ b/include/hw/arm/xlnx-zynqmp.h | ||
232 | @@ -XXX,XX +XXX,XX @@ | ||
233 | #ifndef XLNX_ZYNQMP_H | ||
234 | |||
235 | #include "qemu-common.h" | ||
236 | -#include "hw/arm/arm.h" | ||
237 | +#include "hw/arm/boot.h" | ||
238 | #include "hw/intc/arm_gic.h" | ||
239 | #include "hw/net/cadence_gem.h" | ||
240 | #include "hw/char/cadence_uart.h" | ||
241 | diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c | ||
242 | index XXXXXXX..XXXXXXX 100644 | ||
243 | --- a/hw/arm/armsse.c | ||
244 | +++ b/hw/arm/armsse.c | ||
245 | @@ -XXX,XX +XXX,XX @@ | ||
246 | #include "hw/sysbus.h" | ||
247 | #include "hw/registerfields.h" | ||
248 | #include "hw/arm/armsse.h" | ||
249 | -#include "hw/arm/arm.h" | ||
250 | +#include "hw/arm/boot.h" | ||
251 | |||
252 | /* Format of the System Information block SYS_CONFIG register */ | ||
253 | typedef enum SysConfigFormat { | ||
254 | diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c | ||
255 | index XXXXXXX..XXXXXXX 100644 | ||
256 | --- a/hw/arm/armv7m.c | ||
257 | +++ b/hw/arm/armv7m.c | ||
258 | @@ -XXX,XX +XXX,XX @@ | ||
259 | #include "qemu-common.h" | ||
260 | #include "cpu.h" | ||
261 | #include "hw/sysbus.h" | ||
262 | -#include "hw/arm/arm.h" | ||
263 | +#include "hw/arm/boot.h" | ||
264 | #include "hw/loader.h" | ||
265 | #include "elf.h" | ||
266 | #include "sysemu/qtest.h" | ||
267 | diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c | ||
268 | index XXXXXXX..XXXXXXX 100644 | ||
269 | --- a/hw/arm/aspeed.c | ||
270 | +++ b/hw/arm/aspeed.c | ||
271 | @@ -XXX,XX +XXX,XX @@ | ||
272 | #include "qemu-common.h" | ||
273 | #include "cpu.h" | ||
274 | #include "exec/address-spaces.h" | ||
275 | -#include "hw/arm/arm.h" | ||
276 | +#include "hw/arm/boot.h" | ||
277 | #include "hw/arm/aspeed.h" | ||
278 | #include "hw/arm/aspeed_soc.h" | ||
279 | #include "hw/boards.h" | ||
280 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | ||
281 | index XXXXXXX..XXXXXXX 100644 | ||
282 | --- a/hw/arm/boot.c | ||
283 | +++ b/hw/arm/boot.c | ||
284 | @@ -XXX,XX +XXX,XX @@ | ||
285 | #include "qapi/error.h" | ||
286 | #include <libfdt.h> | ||
287 | #include "hw/hw.h" | ||
288 | -#include "hw/arm/arm.h" | ||
289 | +#include "hw/arm/boot.h" | ||
290 | #include "hw/arm/linux-boot-if.h" | ||
291 | #include "sysemu/kvm.h" | ||
292 | #include "sysemu/sysemu.h" | ||
293 | diff --git a/hw/arm/collie.c b/hw/arm/collie.c | ||
294 | index XXXXXXX..XXXXXXX 100644 | ||
295 | --- a/hw/arm/collie.c | ||
296 | +++ b/hw/arm/collie.c | ||
297 | @@ -XXX,XX +XXX,XX @@ | ||
298 | #include "hw/sysbus.h" | ||
299 | #include "hw/boards.h" | ||
300 | #include "strongarm.h" | ||
301 | -#include "hw/arm/arm.h" | ||
302 | +#include "hw/arm/boot.h" | ||
303 | #include "hw/block/flash.h" | ||
304 | #include "exec/address-spaces.h" | ||
305 | #include "cpu.h" | ||
306 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | ||
307 | index XXXXXXX..XXXXXXX 100644 | ||
308 | --- a/hw/arm/exynos4210.c | ||
309 | +++ b/hw/arm/exynos4210.c | ||
310 | @@ -XXX,XX +XXX,XX @@ | ||
311 | #include "hw/boards.h" | ||
312 | #include "sysemu/sysemu.h" | ||
313 | #include "hw/sysbus.h" | ||
314 | -#include "hw/arm/arm.h" | ||
315 | +#include "hw/arm/boot.h" | ||
316 | #include "hw/loader.h" | ||
317 | #include "hw/arm/exynos4210.h" | ||
318 | #include "hw/sd/sdhci.h" | ||
319 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | ||
320 | index XXXXXXX..XXXXXXX 100644 | ||
321 | --- a/hw/arm/exynos4_boards.c | ||
322 | +++ b/hw/arm/exynos4_boards.c | ||
323 | @@ -XXX,XX +XXX,XX @@ | ||
324 | #include "sysemu/sysemu.h" | ||
325 | #include "hw/sysbus.h" | ||
326 | #include "net/net.h" | ||
327 | -#include "hw/arm/arm.h" | ||
328 | +#include "hw/arm/boot.h" | ||
329 | #include "exec/address-spaces.h" | ||
330 | #include "hw/arm/exynos4210.h" | ||
331 | #include "hw/net/lan9118.h" | ||
16 | diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c | 332 | diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c |
17 | index XXXXXXX..XXXXXXX 100644 | 333 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/hw/arm/highbank.c | 334 | --- a/hw/arm/highbank.c |
19 | +++ b/hw/arm/highbank.c | 335 | +++ b/hw/arm/highbank.c |
20 | @@ -XXX,XX +XXX,XX @@ | 336 | @@ -XXX,XX +XXX,XX @@ |
21 | #include "hw/ide/ahci.h" | 337 | #include "qemu/osdep.h" |
22 | #include "hw/cpu/a9mpcore.h" | 338 | #include "qapi/error.h" |
23 | #include "hw/cpu/a15mpcore.h" | 339 | #include "hw/sysbus.h" |
24 | +#include "qemu/log.h" | 340 | -#include "hw/arm/arm.h" |
25 | 341 | +#include "hw/arm/boot.h" | |
26 | #define SMP_BOOT_ADDR 0x100 | 342 | #include "hw/loader.h" |
27 | #define SMP_BOOT_REG 0x40 | 343 | #include "net/net.h" |
28 | @@ -XXX,XX +XXX,XX @@ static void hb_regs_write(void *opaque, hwaddr offset, | 344 | #include "sysemu/kvm.h" |
29 | } | 345 | diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c |
30 | } | 346 | index XXXXXXX..XXXXXXX 100644 |
31 | 347 | --- a/hw/arm/integratorcp.c | |
32 | - regs[offset/4] = value; | 348 | +++ b/hw/arm/integratorcp.c |
33 | + if (offset / 4 >= NUM_REGS) { | 349 | @@ -XXX,XX +XXX,XX @@ |
34 | + qemu_log_mask(LOG_GUEST_ERROR, | 350 | #include "cpu.h" |
35 | + "highbank: bad write offset 0x%" HWADDR_PRIx "\n", offset); | 351 | #include "hw/sysbus.h" |
36 | + return; | 352 | #include "hw/boards.h" |
37 | + } | 353 | -#include "hw/arm/arm.h" |
38 | + regs[offset / 4] = value; | 354 | +#include "hw/arm/boot.h" |
39 | } | 355 | #include "hw/misc/arm_integrator_debug.h" |
40 | 356 | #include "hw/net/smc91c111.h" | |
41 | static uint64_t hb_regs_read(void *opaque, hwaddr offset, | 357 | #include "net/net.h" |
42 | unsigned size) | 358 | diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c |
359 | index XXXXXXX..XXXXXXX 100644 | ||
360 | --- a/hw/arm/mainstone.c | ||
361 | +++ b/hw/arm/mainstone.c | ||
362 | @@ -XXX,XX +XXX,XX @@ | ||
363 | #include "qapi/error.h" | ||
364 | #include "hw/hw.h" | ||
365 | #include "hw/arm/pxa.h" | ||
366 | -#include "hw/arm/arm.h" | ||
367 | +#include "hw/arm/boot.h" | ||
368 | #include "net/net.h" | ||
369 | #include "hw/net/smc91c111.h" | ||
370 | #include "hw/boards.h" | ||
371 | diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c | ||
372 | index XXXXXXX..XXXXXXX 100644 | ||
373 | --- a/hw/arm/microbit.c | ||
374 | +++ b/hw/arm/microbit.c | ||
375 | @@ -XXX,XX +XXX,XX @@ | ||
376 | #include "qemu/osdep.h" | ||
377 | #include "qapi/error.h" | ||
378 | #include "hw/boards.h" | ||
379 | -#include "hw/arm/arm.h" | ||
380 | +#include "hw/arm/boot.h" | ||
381 | #include "sysemu/sysemu.h" | ||
382 | #include "exec/address-spaces.h" | ||
383 | |||
384 | diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c | ||
385 | index XXXXXXX..XXXXXXX 100644 | ||
386 | --- a/hw/arm/mps2-tz.c | ||
387 | +++ b/hw/arm/mps2-tz.c | ||
388 | @@ -XXX,XX +XXX,XX @@ | ||
389 | #include "qemu/osdep.h" | ||
390 | #include "qapi/error.h" | ||
391 | #include "qemu/error-report.h" | ||
392 | -#include "hw/arm/arm.h" | ||
393 | +#include "hw/arm/boot.h" | ||
394 | #include "hw/arm/armv7m.h" | ||
395 | #include "hw/or-irq.h" | ||
396 | #include "hw/boards.h" | ||
397 | diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c | ||
398 | index XXXXXXX..XXXXXXX 100644 | ||
399 | --- a/hw/arm/mps2.c | ||
400 | +++ b/hw/arm/mps2.c | ||
401 | @@ -XXX,XX +XXX,XX @@ | ||
402 | #include "qemu/osdep.h" | ||
403 | #include "qapi/error.h" | ||
404 | #include "qemu/error-report.h" | ||
405 | -#include "hw/arm/arm.h" | ||
406 | +#include "hw/arm/boot.h" | ||
407 | #include "hw/arm/armv7m.h" | ||
408 | #include "hw/or-irq.h" | ||
409 | #include "hw/boards.h" | ||
410 | diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c | ||
411 | index XXXXXXX..XXXXXXX 100644 | ||
412 | --- a/hw/arm/msf2-soc.c | ||
413 | +++ b/hw/arm/msf2-soc.c | ||
414 | @@ -XXX,XX +XXX,XX @@ | ||
415 | #include "qemu/units.h" | ||
416 | #include "qapi/error.h" | ||
417 | #include "qemu-common.h" | ||
418 | -#include "hw/arm/arm.h" | ||
419 | #include "exec/address-spaces.h" | ||
420 | #include "hw/char/serial.h" | ||
421 | #include "hw/boards.h" | ||
422 | diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c | ||
423 | index XXXXXXX..XXXXXXX 100644 | ||
424 | --- a/hw/arm/msf2-som.c | ||
425 | +++ b/hw/arm/msf2-som.c | ||
426 | @@ -XXX,XX +XXX,XX @@ | ||
427 | #include "qapi/error.h" | ||
428 | #include "qemu/error-report.h" | ||
429 | #include "hw/boards.h" | ||
430 | -#include "hw/arm/arm.h" | ||
431 | +#include "hw/arm/boot.h" | ||
432 | #include "exec/address-spaces.h" | ||
433 | #include "hw/arm/msf2-soc.h" | ||
434 | #include "cpu.h" | ||
435 | diff --git a/hw/arm/musca.c b/hw/arm/musca.c | ||
436 | index XXXXXXX..XXXXXXX 100644 | ||
437 | --- a/hw/arm/musca.c | ||
438 | +++ b/hw/arm/musca.c | ||
439 | @@ -XXX,XX +XXX,XX @@ | ||
440 | #include "qapi/error.h" | ||
441 | #include "exec/address-spaces.h" | ||
442 | #include "sysemu/sysemu.h" | ||
443 | -#include "hw/arm/arm.h" | ||
444 | +#include "hw/arm/boot.h" | ||
445 | #include "hw/arm/armsse.h" | ||
446 | #include "hw/boards.h" | ||
447 | #include "hw/char/pl011.h" | ||
448 | diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c | ||
449 | index XXXXXXX..XXXXXXX 100644 | ||
450 | --- a/hw/arm/musicpal.c | ||
451 | +++ b/hw/arm/musicpal.c | ||
452 | @@ -XXX,XX +XXX,XX @@ | ||
453 | #include "qemu-common.h" | ||
454 | #include "cpu.h" | ||
455 | #include "hw/sysbus.h" | ||
456 | -#include "hw/arm/arm.h" | ||
457 | +#include "hw/arm/boot.h" | ||
458 | #include "net/net.h" | ||
459 | #include "sysemu/sysemu.h" | ||
460 | #include "hw/boards.h" | ||
461 | diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c | ||
462 | index XXXXXXX..XXXXXXX 100644 | ||
463 | --- a/hw/arm/netduino2.c | ||
464 | +++ b/hw/arm/netduino2.c | ||
465 | @@ -XXX,XX +XXX,XX @@ | ||
466 | #include "hw/boards.h" | ||
467 | #include "qemu/error-report.h" | ||
468 | #include "hw/arm/stm32f205_soc.h" | ||
469 | -#include "hw/arm/arm.h" | ||
470 | +#include "hw/arm/boot.h" | ||
471 | |||
472 | static void netduino2_init(MachineState *machine) | ||
43 | { | 473 | { |
44 | + uint32_t value; | 474 | diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c |
45 | uint32_t *regs = opaque; | 475 | index XXXXXXX..XXXXXXX 100644 |
46 | - uint32_t value = regs[offset/4]; | 476 | --- a/hw/arm/nrf51_soc.c |
47 | + | 477 | +++ b/hw/arm/nrf51_soc.c |
48 | + if (offset / 4 >= NUM_REGS) { | 478 | @@ -XXX,XX +XXX,XX @@ |
49 | + qemu_log_mask(LOG_GUEST_ERROR, | 479 | #include "qemu/osdep.h" |
50 | + "highbank: bad read offset 0x%" HWADDR_PRIx "\n", offset); | 480 | #include "qapi/error.h" |
51 | + return 0; | 481 | #include "qemu-common.h" |
52 | + } | 482 | -#include "hw/arm/arm.h" |
53 | + value = regs[offset / 4]; | 483 | +#include "hw/arm/boot.h" |
54 | 484 | #include "hw/sysbus.h" | |
55 | if ((offset == 0x100) || (offset == 0x108) || (offset == 0x10C)) { | 485 | #include "hw/boards.h" |
56 | value |= 0x30000000; | 486 | #include "hw/misc/unimp.h" |
487 | diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c | ||
488 | index XXXXXXX..XXXXXXX 100644 | ||
489 | --- a/hw/arm/nseries.c | ||
490 | +++ b/hw/arm/nseries.c | ||
491 | @@ -XXX,XX +XXX,XX @@ | ||
492 | #include "qemu/bswap.h" | ||
493 | #include "sysemu/sysemu.h" | ||
494 | #include "hw/arm/omap.h" | ||
495 | -#include "hw/arm/arm.h" | ||
496 | +#include "hw/arm/boot.h" | ||
497 | #include "hw/irq.h" | ||
498 | #include "ui/console.h" | ||
499 | #include "hw/boards.h" | ||
500 | diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c | ||
501 | index XXXXXXX..XXXXXXX 100644 | ||
502 | --- a/hw/arm/omap1.c | ||
503 | +++ b/hw/arm/omap1.c | ||
504 | @@ -XXX,XX +XXX,XX @@ | ||
505 | #include "cpu.h" | ||
506 | #include "hw/boards.h" | ||
507 | #include "hw/hw.h" | ||
508 | -#include "hw/arm/arm.h" | ||
509 | +#include "hw/arm/boot.h" | ||
510 | #include "hw/arm/omap.h" | ||
511 | #include "sysemu/sysemu.h" | ||
512 | #include "hw/arm/soc_dma.h" | ||
513 | diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c | ||
514 | index XXXXXXX..XXXXXXX 100644 | ||
515 | --- a/hw/arm/omap2.c | ||
516 | +++ b/hw/arm/omap2.c | ||
517 | @@ -XXX,XX +XXX,XX @@ | ||
518 | #include "sysemu/qtest.h" | ||
519 | #include "hw/boards.h" | ||
520 | #include "hw/hw.h" | ||
521 | -#include "hw/arm/arm.h" | ||
522 | +#include "hw/arm/boot.h" | ||
523 | #include "hw/arm/omap.h" | ||
524 | #include "sysemu/sysemu.h" | ||
525 | #include "qemu/timer.h" | ||
526 | diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c | ||
527 | index XXXXXXX..XXXXXXX 100644 | ||
528 | --- a/hw/arm/omap_sx1.c | ||
529 | +++ b/hw/arm/omap_sx1.c | ||
530 | @@ -XXX,XX +XXX,XX @@ | ||
531 | #include "ui/console.h" | ||
532 | #include "hw/arm/omap.h" | ||
533 | #include "hw/boards.h" | ||
534 | -#include "hw/arm/arm.h" | ||
535 | +#include "hw/arm/boot.h" | ||
536 | #include "hw/block/flash.h" | ||
537 | #include "sysemu/qtest.h" | ||
538 | #include "exec/address-spaces.h" | ||
539 | diff --git a/hw/arm/palm.c b/hw/arm/palm.c | ||
540 | index XXXXXXX..XXXXXXX 100644 | ||
541 | --- a/hw/arm/palm.c | ||
542 | +++ b/hw/arm/palm.c | ||
543 | @@ -XXX,XX +XXX,XX @@ | ||
544 | #include "ui/console.h" | ||
545 | #include "hw/arm/omap.h" | ||
546 | #include "hw/boards.h" | ||
547 | -#include "hw/arm/arm.h" | ||
548 | +#include "hw/arm/boot.h" | ||
549 | #include "hw/input/tsc2xxx.h" | ||
550 | #include "hw/loader.h" | ||
551 | #include "exec/address-spaces.h" | ||
552 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c | ||
553 | index XXXXXXX..XXXXXXX 100644 | ||
554 | --- a/hw/arm/raspi.c | ||
555 | +++ b/hw/arm/raspi.c | ||
556 | @@ -XXX,XX +XXX,XX @@ | ||
557 | #include "qemu/error-report.h" | ||
558 | #include "hw/boards.h" | ||
559 | #include "hw/loader.h" | ||
560 | -#include "hw/arm/arm.h" | ||
561 | +#include "hw/arm/boot.h" | ||
562 | #include "sysemu/sysemu.h" | ||
563 | |||
564 | #define SMPBOOT_ADDR 0x300 /* this should leave enough space for ATAGS */ | ||
565 | diff --git a/hw/arm/realview.c b/hw/arm/realview.c | ||
566 | index XXXXXXX..XXXXXXX 100644 | ||
567 | --- a/hw/arm/realview.c | ||
568 | +++ b/hw/arm/realview.c | ||
569 | @@ -XXX,XX +XXX,XX @@ | ||
570 | #include "qemu-common.h" | ||
571 | #include "cpu.h" | ||
572 | #include "hw/sysbus.h" | ||
573 | -#include "hw/arm/arm.h" | ||
574 | +#include "hw/arm/boot.h" | ||
575 | #include "hw/arm/primecell.h" | ||
576 | #include "hw/net/lan9118.h" | ||
577 | #include "hw/net/smc91c111.h" | ||
578 | diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c | ||
579 | index XXXXXXX..XXXXXXX 100644 | ||
580 | --- a/hw/arm/spitz.c | ||
581 | +++ b/hw/arm/spitz.c | ||
582 | @@ -XXX,XX +XXX,XX @@ | ||
583 | #include "qapi/error.h" | ||
584 | #include "hw/hw.h" | ||
585 | #include "hw/arm/pxa.h" | ||
586 | -#include "hw/arm/arm.h" | ||
587 | +#include "hw/arm/boot.h" | ||
588 | #include "sysemu/sysemu.h" | ||
589 | #include "hw/pcmcia.h" | ||
590 | #include "hw/i2c/i2c.h" | ||
591 | diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c | ||
592 | index XXXXXXX..XXXXXXX 100644 | ||
593 | --- a/hw/arm/stellaris.c | ||
594 | +++ b/hw/arm/stellaris.c | ||
595 | @@ -XXX,XX +XXX,XX @@ | ||
596 | #include "qapi/error.h" | ||
597 | #include "hw/sysbus.h" | ||
598 | #include "hw/ssi/ssi.h" | ||
599 | -#include "hw/arm/arm.h" | ||
600 | +#include "hw/arm/boot.h" | ||
601 | #include "qemu/timer.h" | ||
602 | #include "hw/i2c/i2c.h" | ||
603 | #include "net/net.h" | ||
604 | diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c | ||
605 | index XXXXXXX..XXXXXXX 100644 | ||
606 | --- a/hw/arm/stm32f205_soc.c | ||
607 | +++ b/hw/arm/stm32f205_soc.c | ||
608 | @@ -XXX,XX +XXX,XX @@ | ||
609 | #include "qemu/osdep.h" | ||
610 | #include "qapi/error.h" | ||
611 | #include "qemu-common.h" | ||
612 | -#include "hw/arm/arm.h" | ||
613 | +#include "hw/arm/boot.h" | ||
614 | #include "exec/address-spaces.h" | ||
615 | #include "hw/arm/stm32f205_soc.h" | ||
616 | |||
617 | diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c | ||
618 | index XXXXXXX..XXXXXXX 100644 | ||
619 | --- a/hw/arm/strongarm.c | ||
620 | +++ b/hw/arm/strongarm.c | ||
621 | @@ -XXX,XX +XXX,XX @@ | ||
622 | #include "hw/sysbus.h" | ||
623 | #include "strongarm.h" | ||
624 | #include "qemu/error-report.h" | ||
625 | -#include "hw/arm/arm.h" | ||
626 | +#include "hw/arm/boot.h" | ||
627 | #include "chardev/char-fe.h" | ||
628 | #include "chardev/char-serial.h" | ||
629 | #include "sysemu/sysemu.h" | ||
630 | diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c | ||
631 | index XXXXXXX..XXXXXXX 100644 | ||
632 | --- a/hw/arm/tosa.c | ||
633 | +++ b/hw/arm/tosa.c | ||
634 | @@ -XXX,XX +XXX,XX @@ | ||
635 | #include "qapi/error.h" | ||
636 | #include "hw/hw.h" | ||
637 | #include "hw/arm/pxa.h" | ||
638 | -#include "hw/arm/arm.h" | ||
639 | +#include "hw/arm/boot.h" | ||
640 | #include "hw/arm/sharpsl.h" | ||
641 | #include "hw/pcmcia.h" | ||
642 | #include "hw/boards.h" | ||
643 | diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c | ||
644 | index XXXXXXX..XXXXXXX 100644 | ||
645 | --- a/hw/arm/versatilepb.c | ||
646 | +++ b/hw/arm/versatilepb.c | ||
647 | @@ -XXX,XX +XXX,XX @@ | ||
648 | #include "qemu-common.h" | ||
649 | #include "cpu.h" | ||
650 | #include "hw/sysbus.h" | ||
651 | -#include "hw/arm/arm.h" | ||
652 | +#include "hw/arm/boot.h" | ||
653 | #include "hw/net/smc91c111.h" | ||
654 | #include "net/net.h" | ||
655 | #include "sysemu/sysemu.h" | ||
656 | diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c | ||
657 | index XXXXXXX..XXXXXXX 100644 | ||
658 | --- a/hw/arm/vexpress.c | ||
659 | +++ b/hw/arm/vexpress.c | ||
660 | @@ -XXX,XX +XXX,XX @@ | ||
661 | #include "qemu-common.h" | ||
662 | #include "cpu.h" | ||
663 | #include "hw/sysbus.h" | ||
664 | -#include "hw/arm/arm.h" | ||
665 | +#include "hw/arm/boot.h" | ||
666 | #include "hw/arm/primecell.h" | ||
667 | #include "hw/net/lan9118.h" | ||
668 | #include "hw/i2c/i2c.h" | ||
669 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | ||
670 | index XXXXXXX..XXXXXXX 100644 | ||
671 | --- a/hw/arm/virt.c | ||
672 | +++ b/hw/arm/virt.c | ||
673 | @@ -XXX,XX +XXX,XX @@ | ||
674 | #include "qemu/option.h" | ||
675 | #include "qapi/error.h" | ||
676 | #include "hw/sysbus.h" | ||
677 | -#include "hw/arm/arm.h" | ||
678 | +#include "hw/arm/boot.h" | ||
679 | #include "hw/arm/primecell.h" | ||
680 | #include "hw/arm/virt.h" | ||
681 | #include "hw/block/flash.h" | ||
682 | diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c | ||
683 | index XXXXXXX..XXXXXXX 100644 | ||
684 | --- a/hw/arm/xilinx_zynq.c | ||
685 | +++ b/hw/arm/xilinx_zynq.c | ||
686 | @@ -XXX,XX +XXX,XX @@ | ||
687 | #include "qemu-common.h" | ||
688 | #include "cpu.h" | ||
689 | #include "hw/sysbus.h" | ||
690 | -#include "hw/arm/arm.h" | ||
691 | +#include "hw/arm/boot.h" | ||
692 | #include "net/net.h" | ||
693 | #include "exec/address-spaces.h" | ||
694 | #include "sysemu/sysemu.h" | ||
695 | diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c | ||
696 | index XXXXXXX..XXXXXXX 100644 | ||
697 | --- a/hw/arm/xlnx-versal.c | ||
698 | +++ b/hw/arm/xlnx-versal.c | ||
699 | @@ -XXX,XX +XXX,XX @@ | ||
700 | #include "net/net.h" | ||
701 | #include "sysemu/sysemu.h" | ||
702 | #include "sysemu/kvm.h" | ||
703 | -#include "hw/arm/arm.h" | ||
704 | +#include "hw/arm/boot.h" | ||
705 | #include "kvm_arm.h" | ||
706 | #include "hw/misc/unimp.h" | ||
707 | #include "hw/intc/arm_gicv3_common.h" | ||
708 | diff --git a/hw/arm/z2.c b/hw/arm/z2.c | ||
709 | index XXXXXXX..XXXXXXX 100644 | ||
710 | --- a/hw/arm/z2.c | ||
711 | +++ b/hw/arm/z2.c | ||
712 | @@ -XXX,XX +XXX,XX @@ | ||
713 | #include "qemu/osdep.h" | ||
714 | #include "hw/hw.h" | ||
715 | #include "hw/arm/pxa.h" | ||
716 | -#include "hw/arm/arm.h" | ||
717 | +#include "hw/arm/boot.h" | ||
718 | #include "hw/i2c/i2c.h" | ||
719 | #include "hw/ssi/ssi.h" | ||
720 | #include "hw/boards.h" | ||
57 | -- | 721 | -- |
58 | 2.7.4 | 722 | 2.20.1 |
59 | 723 | ||
60 | 724 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | In ich_vmcr_write() we enforce "writes of BPR fields to less than | ||
2 | their minimum sets them to the minimum" by doing a "read vbpr and | ||
3 | write it back" operation. A typo here meant that we weren't handling | ||
4 | writes to these fields correctly, because we were reading from VBPR0 | ||
5 | but writing to VBPR1. | ||
1 | 6 | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20190520162809.2677-4-peter.maydell@linaro.org | ||
10 | --- | ||
11 | hw/intc/arm_gicv3_cpuif.c | 2 +- | ||
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/hw/intc/arm_gicv3_cpuif.c | ||
17 | +++ b/hw/intc/arm_gicv3_cpuif.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static void ich_vmcr_write(CPUARMState *env, const ARMCPRegInfo *ri, | ||
19 | /* Enforce "writing BPRs to less than minimum sets them to the minimum" | ||
20 | * by reading and writing back the fields. | ||
21 | */ | ||
22 | - write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G0)); | ||
23 | + write_vbpr(cs, GICV3_G0, read_vbpr(cs, GICV3_G0)); | ||
24 | write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G1)); | ||
25 | |||
26 | gicv3_cpuif_virt_update(cs); | ||
27 | -- | ||
28 | 2.20.1 | ||
29 | |||
30 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | The ICC_CTLR_EL3 register includes some bits which are aliases | ||
2 | of bits in the ICC_CTLR_EL1(S) and (NS) registers. QEMU chooses | ||
3 | to keep those bits in the cs->icc_ctlr_el1[] struct fields. | ||
4 | Unfortunately a missing '~' in the code to update the bits | ||
5 | in those fields meant that writing to ICC_CTLR_EL3 would corrupt | ||
6 | the ICC_CLTR_EL1 register values. | ||
1 | 7 | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
10 | Message-id: 20190520162809.2677-5-peter.maydell@linaro.org | ||
11 | --- | ||
12 | hw/intc/arm_gicv3_cpuif.c | 4 ++-- | ||
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/hw/intc/arm_gicv3_cpuif.c | ||
18 | +++ b/hw/intc/arm_gicv3_cpuif.c | ||
19 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, | ||
20 | trace_gicv3_icc_ctlr_el3_write(gicv3_redist_affid(cs), value); | ||
21 | |||
22 | /* *_EL1NS and *_EL1S bits are aliases into the ICC_CTLR_EL1 bits. */ | ||
23 | - cs->icc_ctlr_el1[GICV3_NS] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | ||
24 | + cs->icc_ctlr_el1[GICV3_NS] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | ||
25 | if (value & ICC_CTLR_EL3_EOIMODE_EL1NS) { | ||
26 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_EOIMODE; | ||
27 | } | ||
28 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, | ||
29 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_CBPR; | ||
30 | } | ||
31 | |||
32 | - cs->icc_ctlr_el1[GICV3_S] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | ||
33 | + cs->icc_ctlr_el1[GICV3_S] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | ||
34 | if (value & ICC_CTLR_EL3_EOIMODE_EL1S) { | ||
35 | cs->icc_ctlr_el1[GICV3_S] |= ICC_CTLR_EL1_EOIMODE; | ||
36 | } | ||
37 | -- | ||
38 | 2.20.1 | ||
39 | |||
40 | diff view generated by jsdifflib |
1 | From: "Emilio G. Cota" <cota@braap.org> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | 55c3cee ("qom: Introduce CPUClass.tcg_initialize", 2017-10-24) | 3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
4 | introduces a per-CPUClass bool that we check so that the target CPU | 4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> |
5 | is initialized for TCG only once. This works well except when | 5 | Message-id: 20190520214342.13709-2-philmd@redhat.com |
6 | we end up creating more than one CPUClass, in which case we end | ||
7 | up incorrectly initializing TCG more than once, i.e. once for | ||
8 | each CPUClass. | ||
9 | |||
10 | This can be replicated with: | ||
11 | $ aarch64-softmmu/qemu-system-aarch64 -machine xlnx-zcu102 -smp 6 \ | ||
12 | -global driver=xlnx,,zynqmp,property=has_rpu,value=on | ||
13 | In this case the class name of the "RPUs" is prefixed by "cortex-r5-", | ||
14 | whereas the "regular" CPUs are prefixed by "cortex-a53-". This | ||
15 | results in two CPUClass instances being created. | ||
16 | |||
17 | Fix it by introducing a static variable, so that only the first | ||
18 | target CPU being initialized will initialize the target-dependent | ||
19 | part of TCG, regardless of CPUClass instances. | ||
20 | |||
21 | Fixes: 55c3ceef61fcf06fc98ddc752b7cce788ce7680b | ||
22 | Signed-off-by: Emilio G. Cota <cota@braap.org> | ||
23 | Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> | ||
24 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | ||
25 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
26 | Tested-by: Alistair Francis <alistair.francis@xilinx.com> | ||
27 | Message-id: 1510343626-25861-2-git-send-email-cota@braap.org | ||
28 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
29 | --- | 7 | --- |
30 | include/qom/cpu.h | 1 - | 8 | hw/arm/exynos4_boards.c | 24 ------------------------ |
31 | exec.c | 5 +++-- | 9 | 1 file changed, 24 deletions(-) |
32 | 2 files changed, 3 insertions(+), 3 deletions(-) | ||
33 | 10 | ||
34 | diff --git a/include/qom/cpu.h b/include/qom/cpu.h | 11 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c |
35 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
36 | --- a/include/qom/cpu.h | 13 | --- a/hw/arm/exynos4_boards.c |
37 | +++ b/include/qom/cpu.h | 14 | +++ b/hw/arm/exynos4_boards.c |
38 | @@ -XXX,XX +XXX,XX @@ typedef struct CPUClass { | 15 | @@ -XXX,XX +XXX,XX @@ |
39 | /* Keep non-pointer data at the end to minimize holes. */ | 16 | #include "hw/net/lan9118.h" |
40 | int gdb_num_core_regs; | 17 | #include "hw/boards.h" |
41 | bool gdb_stop_before_watchpoint; | 18 | |
42 | - bool tcg_initialized; | 19 | -#undef DEBUG |
43 | } CPUClass; | 20 | - |
44 | 21 | -//#define DEBUG | |
45 | #ifdef HOST_WORDS_BIGENDIAN | 22 | - |
46 | diff --git a/exec.c b/exec.c | 23 | -#ifdef DEBUG |
47 | index XXXXXXX..XXXXXXX 100644 | 24 | - #undef PRINT_DEBUG |
48 | --- a/exec.c | 25 | - #define PRINT_DEBUG(fmt, args...) \ |
49 | +++ b/exec.c | 26 | - do { \ |
50 | @@ -XXX,XX +XXX,XX @@ void cpu_exec_initfn(CPUState *cpu) | 27 | - fprintf(stderr, " [%s:%d] "fmt, __func__, __LINE__, ##args); \ |
51 | void cpu_exec_realizefn(CPUState *cpu, Error **errp) | 28 | - } while (0) |
52 | { | 29 | -#else |
53 | CPUClass *cc = CPU_GET_CLASS(cpu); | 30 | - #define PRINT_DEBUG(fmt, args...) do {} while (0) |
54 | + static bool tcg_target_initialized; | 31 | -#endif |
55 | 32 | - | |
56 | cpu_list_add(cpu); | 33 | #define SMDK_LAN9118_BASE_ADDR 0x05000000 |
57 | 34 | ||
58 | - if (tcg_enabled() && !cc->tcg_initialized) { | 35 | typedef enum Exynos4BoardType { |
59 | - cc->tcg_initialized = true; | 36 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, |
60 | + if (tcg_enabled() && !tcg_target_initialized) { | 37 | exynos4_board_binfo.gic_cpu_if_addr = |
61 | + tcg_target_initialized = true; | 38 | EXYNOS4210_SMP_PRIVATE_BASE_ADDR + 0x100; |
62 | cc->tcg_initialize(); | 39 | |
63 | } | 40 | - PRINT_DEBUG("\n ram_size: %luMiB [0x%08lx]\n" |
41 | - " kernel_filename: %s\n" | ||
42 | - " kernel_cmdline: %s\n" | ||
43 | - " initrd_filename: %s\n", | ||
44 | - exynos4_board_ram_size[board_type] / 1048576, | ||
45 | - exynos4_board_ram_size[board_type], | ||
46 | - machine->kernel_filename, | ||
47 | - machine->kernel_cmdline, | ||
48 | - machine->initrd_filename); | ||
49 | - | ||
50 | exynos4_boards_init_ram(s, get_system_memory(), | ||
51 | exynos4_board_ram_size[board_type]); | ||
64 | 52 | ||
65 | -- | 53 | -- |
66 | 2.7.4 | 54 | 2.20.1 |
67 | 55 | ||
68 | 56 | diff view generated by jsdifflib |
1 | From: "Emilio G. Cota" <cota@braap.org> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | max_cpus needs to be an upper bound on the number of vCPUs | 3 | It eases code review, unit is explicit. |
4 | initialized; otherwise TCG region initialization breaks. | ||
5 | 4 | ||
6 | Some boards initialize a hard-coded number of vCPUs, which is not | 5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
7 | captured by the global max_cpus and therefore breaks TCG initialization. | 6 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> |
8 | Fix it by adding the .min_cpus field to machine_class. | 7 | Message-id: 20190520214342.13709-3-philmd@redhat.com |
9 | |||
10 | This commit also changes some user-facing behaviour: we now die if | ||
11 | -smp is below this hard-coded vCPU minimum instead of silently | ||
12 | ignoring the passed -smp value (sometimes announcing this by printing | ||
13 | a warning). However, the introduction of .default_cpus lessens the | ||
14 | likelihood that users will notice this: if -smp isn't set, we now | ||
15 | assign the value in .default_cpus to both smp_cpus and max_cpus. IOW, | ||
16 | if a user does not set -smp, they always get a correct number of vCPUs. | ||
17 | |||
18 | This change fixes 3468b59 ("tcg: enable multiple TCG contexts in | ||
19 | softmmu", 2017-10-24), which broke TCG initialization for some | ||
20 | ARM boards. | ||
21 | |||
22 | Fixes: 3468b59e18b179bc63c7ce934de912dfa9596122 | ||
23 | Reported-by: Thomas Huth <thuth@redhat.com> | ||
24 | Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> | ||
25 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | ||
26 | Signed-off-by: Emilio G. Cota <cota@braap.org> | ||
27 | Message-id: 1510343626-25861-6-git-send-email-cota@braap.org | ||
28 | Suggested-by: Peter Maydell <peter.maydell@linaro.org> | ||
29 | Signed-off-by: Emilio G. Cota <cota@braap.org> | ||
30 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
31 | --- | 9 | --- |
32 | include/hw/boards.h | 5 +++++ | 10 | hw/arm/exynos4_boards.c | 5 +++-- |
33 | hw/arm/exynos4_boards.c | 12 ++++-------- | 11 | 1 file changed, 3 insertions(+), 2 deletions(-) |
34 | hw/arm/raspi.c | 2 ++ | ||
35 | hw/arm/xlnx-zcu102.c | 2 ++ | ||
36 | vl.c | 21 ++++++++++++++++++--- | ||
37 | 5 files changed, 31 insertions(+), 11 deletions(-) | ||
38 | 12 | ||
39 | diff --git a/include/hw/boards.h b/include/hw/boards.h | ||
40 | index XXXXXXX..XXXXXXX 100644 | ||
41 | --- a/include/hw/boards.h | ||
42 | +++ b/include/hw/boards.h | ||
43 | @@ -XXX,XX +XXX,XX @@ typedef struct { | ||
44 | |||
45 | /** | ||
46 | * MachineClass: | ||
47 | + * @max_cpus: maximum number of CPUs supported. Default: 1 | ||
48 | + * @min_cpus: minimum number of CPUs supported. Default: 1 | ||
49 | + * @default_cpus: number of CPUs instantiated if none are specified. Default: 1 | ||
50 | * @get_hotplug_handler: this function is called during bus-less | ||
51 | * device hotplug. If defined it returns pointer to an instance | ||
52 | * of HotplugHandler object, which handles hotplug operation | ||
53 | @@ -XXX,XX +XXX,XX @@ struct MachineClass { | ||
54 | BlockInterfaceType block_default_type; | ||
55 | int units_per_default_bus; | ||
56 | int max_cpus; | ||
57 | + int min_cpus; | ||
58 | + int default_cpus; | ||
59 | unsigned int no_serial:1, | ||
60 | no_parallel:1, | ||
61 | use_virtcon:1, | ||
62 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 13 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c |
63 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
64 | --- a/hw/arm/exynos4_boards.c | 15 | --- a/hw/arm/exynos4_boards.c |
65 | +++ b/hw/arm/exynos4_boards.c | 16 | +++ b/hw/arm/exynos4_boards.c |
66 | @@ -XXX,XX +XXX,XX @@ | 17 | @@ -XXX,XX +XXX,XX @@ |
18 | */ | ||
19 | |||
20 | #include "qemu/osdep.h" | ||
21 | +#include "qemu/units.h" | ||
22 | #include "qapi/error.h" | ||
23 | #include "qemu/error-report.h" | ||
67 | #include "qemu-common.h" | 24 | #include "qemu-common.h" |
68 | #include "cpu.h" | 25 | @@ -XXX,XX +XXX,XX @@ static int exynos4_board_smp_bootreg_addr[EXYNOS4_NUM_OF_BOARDS] = { |
69 | #include "sysemu/sysemu.h" | ||
70 | -#include "sysemu/qtest.h" | ||
71 | #include "hw/sysbus.h" | ||
72 | #include "net/net.h" | ||
73 | #include "hw/arm/arm.h" | ||
74 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | ||
75 | Exynos4BoardType board_type) | ||
76 | { | ||
77 | Exynos4BoardState *s = g_new(Exynos4BoardState, 1); | ||
78 | - MachineClass *mc = MACHINE_GET_CLASS(machine); | ||
79 | - | ||
80 | - if (smp_cpus != EXYNOS4210_NCPUS && !qtest_enabled()) { | ||
81 | - error_report("%s board supports only %d CPU cores, ignoring smp_cpus" | ||
82 | - " value", | ||
83 | - mc->name, EXYNOS4210_NCPUS); | ||
84 | - } | ||
85 | |||
86 | exynos4_board_binfo.ram_size = exynos4_board_ram_size[board_type]; | ||
87 | exynos4_board_binfo.board_id = exynos4_board_id[board_type]; | ||
88 | @@ -XXX,XX +XXX,XX @@ static void nuri_class_init(ObjectClass *oc, void *data) | ||
89 | mc->desc = "Samsung NURI board (Exynos4210)"; | ||
90 | mc->init = nuri_init; | ||
91 | mc->max_cpus = EXYNOS4210_NCPUS; | ||
92 | + mc->min_cpus = EXYNOS4210_NCPUS; | ||
93 | + mc->default_cpus = EXYNOS4210_NCPUS; | ||
94 | mc->ignore_memory_transaction_failures = true; | ||
95 | } | ||
96 | |||
97 | @@ -XXX,XX +XXX,XX @@ static void smdkc210_class_init(ObjectClass *oc, void *data) | ||
98 | mc->desc = "Samsung SMDKC210 board (Exynos4210)"; | ||
99 | mc->init = smdkc210_init; | ||
100 | mc->max_cpus = EXYNOS4210_NCPUS; | ||
101 | + mc->min_cpus = EXYNOS4210_NCPUS; | ||
102 | + mc->default_cpus = EXYNOS4210_NCPUS; | ||
103 | mc->ignore_memory_transaction_failures = true; | ||
104 | } | ||
105 | |||
106 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c | ||
107 | index XXXXXXX..XXXXXXX 100644 | ||
108 | --- a/hw/arm/raspi.c | ||
109 | +++ b/hw/arm/raspi.c | ||
110 | @@ -XXX,XX +XXX,XX @@ static void raspi2_machine_init(MachineClass *mc) | ||
111 | mc->no_floppy = 1; | ||
112 | mc->no_cdrom = 1; | ||
113 | mc->max_cpus = BCM2836_NCPUS; | ||
114 | + mc->min_cpus = BCM2836_NCPUS; | ||
115 | + mc->default_cpus = BCM2836_NCPUS; | ||
116 | mc->default_ram_size = 1024 * 1024 * 1024; | ||
117 | mc->ignore_memory_transaction_failures = true; | ||
118 | }; | 26 | }; |
119 | diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c | 27 | |
120 | index XXXXXXX..XXXXXXX 100644 | 28 | static unsigned long exynos4_board_ram_size[EXYNOS4_NUM_OF_BOARDS] = { |
121 | --- a/hw/arm/xlnx-zcu102.c | 29 | - [EXYNOS4_BOARD_NURI] = 0x40000000, |
122 | +++ b/hw/arm/xlnx-zcu102.c | 30 | - [EXYNOS4_BOARD_SMDKC210] = 0x40000000, |
123 | @@ -XXX,XX +XXX,XX @@ static void xlnx_ep108_machine_class_init(ObjectClass *oc, void *data) | 31 | + [EXYNOS4_BOARD_NURI] = 1 * GiB, |
124 | mc->units_per_default_bus = 1; | 32 | + [EXYNOS4_BOARD_SMDKC210] = 1 * GiB, |
125 | mc->ignore_memory_transaction_failures = true; | 33 | }; |
126 | mc->max_cpus = XLNX_ZYNQMP_NUM_APU_CPUS + XLNX_ZYNQMP_NUM_RPU_CPUS; | 34 | |
127 | + mc->default_cpus = XLNX_ZYNQMP_NUM_APU_CPUS; | 35 | static struct arm_boot_info exynos4_board_binfo = { |
128 | } | ||
129 | |||
130 | static const TypeInfo xlnx_ep108_machine_init_typeinfo = { | ||
131 | @@ -XXX,XX +XXX,XX @@ static void xlnx_zcu102_machine_class_init(ObjectClass *oc, void *data) | ||
132 | mc->units_per_default_bus = 1; | ||
133 | mc->ignore_memory_transaction_failures = true; | ||
134 | mc->max_cpus = XLNX_ZYNQMP_NUM_APU_CPUS + XLNX_ZYNQMP_NUM_RPU_CPUS; | ||
135 | + mc->default_cpus = XLNX_ZYNQMP_NUM_APU_CPUS; | ||
136 | } | ||
137 | |||
138 | static const TypeInfo xlnx_zcu102_machine_init_typeinfo = { | ||
139 | diff --git a/vl.c b/vl.c | ||
140 | index XXXXXXX..XXXXXXX 100644 | ||
141 | --- a/vl.c | ||
142 | +++ b/vl.c | ||
143 | @@ -XXX,XX +XXX,XX @@ Chardev *virtcon_hds[MAX_VIRTIO_CONSOLES]; | ||
144 | Chardev *sclp_hds[MAX_SCLP_CONSOLES]; | ||
145 | int win2k_install_hack = 0; | ||
146 | int singlestep = 0; | ||
147 | -int smp_cpus = 1; | ||
148 | -unsigned int max_cpus = 1; | ||
149 | +int smp_cpus; | ||
150 | +unsigned int max_cpus; | ||
151 | int smp_cores = 1; | ||
152 | int smp_threads = 1; | ||
153 | int acpi_enabled = 1; | ||
154 | @@ -XXX,XX +XXX,XX @@ int main(int argc, char **argv, char **envp) | ||
155 | exit(0); | ||
156 | } | ||
157 | |||
158 | + /* machine_class: default to UP */ | ||
159 | + machine_class->max_cpus = machine_class->max_cpus ?: 1; | ||
160 | + machine_class->min_cpus = machine_class->min_cpus ?: 1; | ||
161 | + machine_class->default_cpus = machine_class->default_cpus ?: 1; | ||
162 | + | ||
163 | + /* default to machine_class->default_cpus */ | ||
164 | + smp_cpus = machine_class->default_cpus; | ||
165 | + max_cpus = machine_class->default_cpus; | ||
166 | + | ||
167 | smp_parse(qemu_opts_find(qemu_find_opts("smp-opts"), NULL)); | ||
168 | |||
169 | - machine_class->max_cpus = machine_class->max_cpus ?: 1; /* Default to UP */ | ||
170 | + /* sanity-check smp_cpus and max_cpus against machine_class */ | ||
171 | + if (smp_cpus < machine_class->min_cpus) { | ||
172 | + error_report("Invalid SMP CPUs %d. The min CPUs " | ||
173 | + "supported by machine '%s' is %d", smp_cpus, | ||
174 | + machine_class->name, machine_class->min_cpus); | ||
175 | + exit(1); | ||
176 | + } | ||
177 | if (max_cpus > machine_class->max_cpus) { | ||
178 | error_report("Invalid SMP CPUs %d. The max CPUs " | ||
179 | "supported by machine '%s' is %d", max_cpus, | ||
180 | -- | 36 | -- |
181 | 2.7.4 | 37 | 2.20.1 |
182 | 38 | ||
183 | 39 | diff view generated by jsdifflib |
1 | From: Alex Bennée <alex.bennee@linaro.org> | 1 | From: Guenter Roeck <linux@roeck-us.net> |
---|---|---|---|
2 | 2 | ||
3 | We are still seeing signals during translation time when we walk over | 3 | QEMU already supports pl330. Instantiate it for Exynos4210. |
4 | a page protection boundary. This expands the check to ensure the host | ||
5 | PC is inside the code generation buffer. The original suggestion was | ||
6 | to check versus tcg_ctx.code_gen_ptr but as we now segment the | ||
7 | translation buffer we have to settle for just a general check for | ||
8 | being inside. | ||
9 | 4 | ||
10 | I've also fixed up the declaration to make it clear it can deal with | 5 | Relevant part of Linux arch/arm/boot/dts/exynos4.dtsi: |
11 | invalid addresses. A later patch will fix up the call sites. | ||
12 | 6 | ||
13 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | 7 | / { |
14 | Reported-by: Peter Maydell <peter.maydell@linaro.org> | 8 | soc: soc { |
15 | Reviewed-by: Laurent Vivier <laurent@vivier.eu> | 9 | amba { |
16 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 10 | pdma0: pdma@12680000 { |
17 | Message-id: 20171108153245.20740-2-alex.bennee@linaro.org | 11 | compatible = "arm,pl330", "arm,primecell"; |
18 | Suggested-by: Paolo Bonzini <pbonzini@redhat.com> | 12 | reg = <0x12680000 0x1000>; |
19 | Cc: Richard Henderson <rth@twiddle.net> | 13 | interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; |
20 | Tested-by: Peter Maydell <peter.maydell@linaro.org> | 14 | clocks = <&clock CLK_PDMA0>; |
15 | clock-names = "apb_pclk"; | ||
16 | #dma-cells = <1>; | ||
17 | #dma-channels = <8>; | ||
18 | #dma-requests = <32>; | ||
19 | }; | ||
20 | pdma1: pdma@12690000 { | ||
21 | compatible = "arm,pl330", "arm,primecell"; | ||
22 | reg = <0x12690000 0x1000>; | ||
23 | interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; | ||
24 | clocks = <&clock CLK_PDMA1>; | ||
25 | clock-names = "apb_pclk"; | ||
26 | #dma-cells = <1>; | ||
27 | #dma-channels = <8>; | ||
28 | #dma-requests = <32>; | ||
29 | }; | ||
30 | mdma1: mdma@12850000 { | ||
31 | compatible = "arm,pl330", "arm,primecell"; | ||
32 | reg = <0x12850000 0x1000>; | ||
33 | interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>; | ||
34 | clocks = <&clock CLK_MDMA>; | ||
35 | clock-names = "apb_pclk"; | ||
36 | #dma-cells = <1>; | ||
37 | #dma-channels = <8>; | ||
38 | #dma-requests = <1>; | ||
39 | }; | ||
40 | }; | ||
41 | }; | ||
42 | }; | ||
43 | |||
44 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | ||
45 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
46 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
47 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
48 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
49 | Message-id: 20190520214342.13709-4-philmd@redhat.com | ||
50 | [PMD: Do not set default qdev properties, create the controllers in the SoC | ||
51 | rather than the board (Peter Maydell), add dtsi in commit message] | ||
52 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
53 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
21 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 54 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
22 | --- | 55 | --- |
23 | include/exec/exec-all.h | 11 ++++++++++ | 56 | hw/arm/exynos4210.c | 26 ++++++++++++++++++++++++++ |
24 | accel/tcg/translate-all.c | 52 ++++++++++++++++++++++++++--------------------- | 57 | 1 file changed, 26 insertions(+) |
25 | 2 files changed, 40 insertions(+), 23 deletions(-) | ||
26 | 58 | ||
27 | diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h | 59 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c |
28 | index XXXXXXX..XXXXXXX 100644 | 60 | index XXXXXXX..XXXXXXX 100644 |
29 | --- a/include/exec/exec-all.h | 61 | --- a/hw/arm/exynos4210.c |
30 | +++ b/include/exec/exec-all.h | 62 | +++ b/hw/arm/exynos4210.c |
31 | @@ -XXX,XX +XXX,XX @@ void restore_state_to_opc(CPUArchState *env, struct TranslationBlock *tb, | 63 | @@ -XXX,XX +XXX,XX @@ |
32 | target_ulong *data); | 64 | /* EHCI */ |
33 | 65 | #define EXYNOS4210_EHCI_BASE_ADDR 0x12580000 | |
34 | void cpu_gen_init(void); | 66 | |
67 | +/* DMA */ | ||
68 | +#define EXYNOS4210_PL330_BASE0_ADDR 0x12680000 | ||
69 | +#define EXYNOS4210_PL330_BASE1_ADDR 0x12690000 | ||
70 | +#define EXYNOS4210_PL330_BASE2_ADDR 0x12850000 | ||
35 | + | 71 | + |
36 | +/** | 72 | static uint8_t chipid_and_omr[] = { 0x11, 0x02, 0x21, 0x43, |
37 | + * cpu_restore_state: | 73 | 0x09, 0x00, 0x00, 0x00 }; |
38 | + * @cpu: the vCPU state is to be restore to | 74 | |
39 | + * @searched_pc: the host PC the fault occurred at | 75 | @@ -XXX,XX +XXX,XX @@ static uint64_t exynos4210_calc_affinity(int cpu) |
40 | + * @return: true if state was restored, false otherwise | 76 | return (0x9 << ARM_AFF1_SHIFT) | cpu; |
41 | + * | ||
42 | + * Attempt to restore the state for a fault occurring in translated | ||
43 | + * code. If the searched_pc is not in translated code no state is | ||
44 | + * restored and the function returns false. | ||
45 | + */ | ||
46 | bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc); | ||
47 | |||
48 | void QEMU_NORETURN cpu_loop_exit_noexc(CPUState *cpu); | ||
49 | diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c | ||
50 | index XXXXXXX..XXXXXXX 100644 | ||
51 | --- a/accel/tcg/translate-all.c | ||
52 | +++ b/accel/tcg/translate-all.c | ||
53 | @@ -XXX,XX +XXX,XX @@ static int cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, | ||
54 | return 0; | ||
55 | } | 77 | } |
56 | 78 | ||
57 | -bool cpu_restore_state(CPUState *cpu, uintptr_t retaddr) | 79 | +static void pl330_create(uint32_t base, qemu_irq irq, int nreq) |
58 | +bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc) | 80 | +{ |
81 | + SysBusDevice *busdev; | ||
82 | + DeviceState *dev; | ||
83 | + | ||
84 | + dev = qdev_create(NULL, "pl330"); | ||
85 | + qdev_prop_set_uint8(dev, "num_periph_req", nreq); | ||
86 | + qdev_init_nofail(dev); | ||
87 | + busdev = SYS_BUS_DEVICE(dev); | ||
88 | + sysbus_mmio_map(busdev, 0, base); | ||
89 | + sysbus_connect_irq(busdev, 0, irq); | ||
90 | +} | ||
91 | + | ||
92 | Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | ||
59 | { | 93 | { |
60 | TranslationBlock *tb; | 94 | Exynos4210State *s = g_new0(Exynos4210State, 1); |
61 | bool r = false; | 95 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) |
62 | + uintptr_t check_offset; | 96 | sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, |
63 | 97 | s->irq_table[exynos4210_get_irq(28, 3)]); | |
64 | - /* A retaddr of zero is invalid so we really shouldn't have ended | 98 | |
65 | - * up here. The target code has likely forgotten to check retaddr | 99 | + /*** DMA controllers ***/ |
66 | - * != 0 before attempting to restore state. We return early to | 100 | + pl330_create(EXYNOS4210_PL330_BASE0_ADDR, |
67 | - * avoid blowing up on a recursive tb_lock(). The target must have | 101 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(35, 1)]), 32); |
68 | - * previously survived a failed cpu_restore_state because | 102 | + pl330_create(EXYNOS4210_PL330_BASE1_ADDR, |
69 | - * tb_find_pc(0) would have failed anyway. It still should be | 103 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); |
70 | - * fixed though. | 104 | + pl330_create(EXYNOS4210_PL330_BASE2_ADDR, |
71 | + /* The host_pc has to be in the region of current code buffer. If | 105 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); |
72 | + * it is not we will not be able to resolve it here. The two cases | ||
73 | + * where host_pc will not be correct are: | ||
74 | + * | ||
75 | + * - fault during translation (instruction fetch) | ||
76 | + * - fault from helper (not using GETPC() macro) | ||
77 | + * | ||
78 | + * Either way we need return early to avoid blowing up on a | ||
79 | + * recursive tb_lock() as we can't resolve it here. | ||
80 | + * | ||
81 | + * We are using unsigned arithmetic so if host_pc < | ||
82 | + * tcg_init_ctx.code_gen_buffer check_offset will wrap to way | ||
83 | + * above the code_gen_buffer_size | ||
84 | */ | ||
85 | - | ||
86 | - if (!retaddr) { | ||
87 | - return r; | ||
88 | - } | ||
89 | - | ||
90 | - tb_lock(); | ||
91 | - tb = tb_find_pc(retaddr); | ||
92 | - if (tb) { | ||
93 | - cpu_restore_state_from_tb(cpu, tb, retaddr); | ||
94 | - if (tb->cflags & CF_NOCACHE) { | ||
95 | - /* one-shot translation, invalidate it immediately */ | ||
96 | - tb_phys_invalidate(tb, -1); | ||
97 | - tb_remove(tb); | ||
98 | + check_offset = host_pc - (uintptr_t) tcg_init_ctx.code_gen_buffer; | ||
99 | + | 106 | + |
100 | + if (check_offset < tcg_init_ctx.code_gen_buffer_size) { | 107 | return s; |
101 | + tb_lock(); | ||
102 | + tb = tb_find_pc(host_pc); | ||
103 | + if (tb) { | ||
104 | + cpu_restore_state_from_tb(cpu, tb, host_pc); | ||
105 | + if (tb->cflags & CF_NOCACHE) { | ||
106 | + /* one-shot translation, invalidate it immediately */ | ||
107 | + tb_phys_invalidate(tb, -1); | ||
108 | + tb_remove(tb); | ||
109 | + } | ||
110 | + r = true; | ||
111 | } | ||
112 | - r = true; | ||
113 | + tb_unlock(); | ||
114 | } | ||
115 | - tb_unlock(); | ||
116 | |||
117 | return r; | ||
118 | } | 108 | } |
119 | -- | 109 | -- |
120 | 2.7.4 | 110 | 2.20.1 |
121 | 111 | ||
122 | 112 | diff view generated by jsdifflib |
1 | From: "Emilio G. Cota" <cota@braap.org> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Just like the zcu102, the ep108 can instantiate several CPUs. | 3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
4 | 4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | |
5 | Signed-off-by: Emilio G. Cota <cota@braap.org> | 5 | Message-id: 20190520214342.13709-5-philmd@redhat.com |
6 | Reviewed-by: Alistair Francis <alistair.francis@xilinx.com> | ||
7 | Message-id: 1510343626-25861-5-git-send-email-cota@braap.org | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 7 | --- |
10 | hw/arm/xlnx-zcu102.c | 1 + | 8 | include/hw/arm/exynos4210.h | 9 +++++++-- |
11 | 1 file changed, 1 insertion(+) | 9 | hw/arm/exynos4210.c | 28 ++++++++++++++++++++++++---- |
10 | hw/arm/exynos4_boards.c | 9 ++++++--- | ||
11 | 3 files changed, 37 insertions(+), 9 deletions(-) | ||
12 | 12 | ||
13 | diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c | 13 | diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h |
14 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/hw/arm/xlnx-zcu102.c | 15 | --- a/include/hw/arm/exynos4210.h |
16 | +++ b/hw/arm/xlnx-zcu102.c | 16 | +++ b/include/hw/arm/exynos4210.h |
17 | @@ -XXX,XX +XXX,XX @@ static void xlnx_ep108_machine_class_init(ObjectClass *oc, void *data) | 17 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210Irq { |
18 | mc->block_default_type = IF_IDE; | 18 | } Exynos4210Irq; |
19 | mc->units_per_default_bus = 1; | 19 | |
20 | mc->ignore_memory_transaction_failures = true; | 20 | typedef struct Exynos4210State { |
21 | + mc->max_cpus = XLNX_ZYNQMP_NUM_APU_CPUS + XLNX_ZYNQMP_NUM_RPU_CPUS; | 21 | + /*< private >*/ |
22 | + SysBusDevice parent_obj; | ||
23 | + /*< public >*/ | ||
24 | ARMCPU *cpu[EXYNOS4210_NCPUS]; | ||
25 | Exynos4210Irq irqs; | ||
26 | qemu_irq *irq_table; | ||
27 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210State { | ||
28 | I2CBus *i2c_if[EXYNOS4210_I2C_NUMBER]; | ||
29 | } Exynos4210State; | ||
30 | |||
31 | +#define TYPE_EXYNOS4210_SOC "exynos4210" | ||
32 | +#define EXYNOS4210_SOC(obj) \ | ||
33 | + OBJECT_CHECK(Exynos4210State, obj, TYPE_EXYNOS4210_SOC) | ||
34 | + | ||
35 | void exynos4210_write_secondary(ARMCPU *cpu, | ||
36 | const struct arm_boot_info *info); | ||
37 | |||
38 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem); | ||
39 | - | ||
40 | /* Initialize exynos4210 IRQ subsystem stub */ | ||
41 | qemu_irq *exynos4210_init_irq(Exynos4210Irq *env); | ||
42 | |||
43 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | ||
44 | index XXXXXXX..XXXXXXX 100644 | ||
45 | --- a/hw/arm/exynos4210.c | ||
46 | +++ b/hw/arm/exynos4210.c | ||
47 | @@ -XXX,XX +XXX,XX @@ static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | ||
48 | sysbus_connect_irq(busdev, 0, irq); | ||
22 | } | 49 | } |
23 | 50 | ||
24 | static const TypeInfo xlnx_ep108_machine_init_typeinfo = { | 51 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem) |
52 | +static void exynos4210_realize(DeviceState *socdev, Error **errp) | ||
53 | { | ||
54 | - Exynos4210State *s = g_new0(Exynos4210State, 1); | ||
55 | + Exynos4210State *s = EXYNOS4210_SOC(socdev); | ||
56 | + MemoryRegion *system_mem = get_system_memory(); | ||
57 | qemu_irq gate_irq[EXYNOS4210_NCPUS][EXYNOS4210_IRQ_GATE_NINPUTS]; | ||
58 | SysBusDevice *busdev; | ||
59 | DeviceState *dev; | ||
60 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | ||
61 | qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); | ||
62 | pl330_create(EXYNOS4210_PL330_BASE2_ADDR, | ||
63 | qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); | ||
64 | - | ||
65 | - return s; | ||
66 | } | ||
67 | + | ||
68 | +static void exynos4210_class_init(ObjectClass *klass, void *data) | ||
69 | +{ | ||
70 | + DeviceClass *dc = DEVICE_CLASS(klass); | ||
71 | + | ||
72 | + dc->realize = exynos4210_realize; | ||
73 | +} | ||
74 | + | ||
75 | +static const TypeInfo exynos4210_info = { | ||
76 | + .name = TYPE_EXYNOS4210_SOC, | ||
77 | + .parent = TYPE_SYS_BUS_DEVICE, | ||
78 | + .instance_size = sizeof(Exynos4210State), | ||
79 | + .class_init = exynos4210_class_init, | ||
80 | +}; | ||
81 | + | ||
82 | +static void exynos4210_register_types(void) | ||
83 | +{ | ||
84 | + type_register_static(&exynos4210_info); | ||
85 | +} | ||
86 | + | ||
87 | +type_init(exynos4210_register_types) | ||
88 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | ||
89 | index XXXXXXX..XXXXXXX 100644 | ||
90 | --- a/hw/arm/exynos4_boards.c | ||
91 | +++ b/hw/arm/exynos4_boards.c | ||
92 | @@ -XXX,XX +XXX,XX @@ typedef enum Exynos4BoardType { | ||
93 | } Exynos4BoardType; | ||
94 | |||
95 | typedef struct Exynos4BoardState { | ||
96 | - Exynos4210State *soc; | ||
97 | + Exynos4210State soc; | ||
98 | MemoryRegion dram0_mem; | ||
99 | MemoryRegion dram1_mem; | ||
100 | } Exynos4BoardState; | ||
101 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | ||
102 | exynos4_boards_init_ram(s, get_system_memory(), | ||
103 | exynos4_board_ram_size[board_type]); | ||
104 | |||
105 | - s->soc = exynos4210_init(get_system_memory()); | ||
106 | + object_initialize(&s->soc, sizeof(s->soc), TYPE_EXYNOS4210_SOC); | ||
107 | + qdev_set_parent_bus(DEVICE(&s->soc), sysbus_get_default()); | ||
108 | + object_property_set_bool(OBJECT(&s->soc), true, "realized", | ||
109 | + &error_fatal); | ||
110 | |||
111 | return s; | ||
112 | } | ||
113 | @@ -XXX,XX +XXX,XX @@ static void smdkc210_init(MachineState *machine) | ||
114 | EXYNOS4_BOARD_SMDKC210); | ||
115 | |||
116 | lan9215_init(SMDK_LAN9118_BASE_ADDR, | ||
117 | - qemu_irq_invert(s->soc->irq_table[exynos4210_get_irq(37, 1)])); | ||
118 | + qemu_irq_invert(s->soc.irq_table[exynos4210_get_irq(37, 1)])); | ||
119 | arm_load_kernel(ARM_CPU(first_cpu), &exynos4_board_binfo); | ||
120 | } | ||
121 | |||
25 | -- | 122 | -- |
26 | 2.7.4 | 123 | 2.20.1 |
27 | 124 | ||
28 | 125 | diff view generated by jsdifflib |