1 | A mixed bag, all bug fixes or similar small stuff. | 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 | ||
3 | thanks | 5 | thanks |
4 | -- PMM | 6 | -- PMM |
5 | 7 | ||
8 | The following changes since commit d418238dca7b4e0b124135827ead3076233052b1: | ||
6 | 9 | ||
7 | The following changes since commit 19eb2d4e736dc895f31fbd6b520e514f10cc08e0: | 10 | Merge remote-tracking branch 'remotes/rth/tags/pull-rng-20190522' into staging (2019-05-23 12:57:17 +0100) |
8 | |||
9 | Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging (2019-05-07 10:43:32 +0100) | ||
10 | 11 | ||
11 | are available in the Git repository at: | 12 | are available in the Git repository at: |
12 | 13 | ||
13 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190507 | 14 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190523 |
14 | 15 | ||
15 | for you to fetch changes up to 63159601fb3e396b28da14cbb71e50ed3f5a0331: | 16 | for you to fetch changes up to 98e4f4fdb8ea05d840f51f47125924c2bb9df2df: |
16 | 17 | ||
17 | target/arm: Stop using variable length array in dc_zva (2019-05-07 12:55:04 +0100) | 18 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC (2019-05-23 14:47:44 +0100) |
18 | 19 | ||
19 | ---------------------------------------------------------------- | 20 | ---------------------------------------------------------------- |
20 | target-arm queue: | 21 | target-arm queue: |
21 | * Stop using variable length array in dc_zva | 22 | * exynos4210: QOM'ify the Exynos4210 SoC |
22 | * Implement M-profile XPSR GE bits | 23 | * exynos4210: Add DMA support for the Exynos4210 |
23 | * Don't enable ARMV7M_EXCP_DEBUG from reset | 24 | * arm_gicv3: Fix writes to ICC_CTLR_EL3 |
24 | * armv7m_nvic: NS BFAR and BFSR are RAZ/WI if BFHFNMINS == 0 | 25 | * arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} |
25 | * armv7m_nvic: Check subpriority in nvic_recompute_state_secure() | 26 | * target/arm: Fix vector operation segfault |
26 | * fix various minor issues to allow building for Windows-on-ARM64 | 27 | * target/arm: Minor improvements to BFXIL, EXTR |
27 | * aspeed: Set SDRAM size | ||
28 | * Allow system registers for KVM guests to be changed by QEMU code | ||
29 | * raspi: Diagnose requests for too much RAM | ||
30 | * virt: Support firmware configuration with -blockdev | ||
31 | 28 | ||
32 | ---------------------------------------------------------------- | 29 | ---------------------------------------------------------------- |
33 | Cao Jiaxi (4): | 30 | Alistair Francis (1): |
34 | QEMU_PACKED: Remove gcc_struct attribute in Windows non x86 targets | 31 | target/arm: Fix vector operation segfault |
35 | qga: Fix mingw compilation warnings on enum conversion | ||
36 | util/cacheinfo: Use uint64_t on LLP64 model to satisfy Windows ARM64 | ||
37 | osdep: Fix mingw compilation regarding stdio formats | ||
38 | 32 | ||
39 | Joel Stanley (1): | 33 | Guenter Roeck (1): |
40 | arm: aspeed: Set SDRAM size | 34 | hw/arm/exynos4210: Add DMA support for the Exynos4210 |
41 | 35 | ||
42 | Markus Armbruster (3): | 36 | Peter Maydell (5): |
43 | pc: Rearrange pc_system_firmware_init()'s legacy -drive loop | 37 | arm: Move system_clock_scale to armv7m_systick.h |
44 | pflash_cfi01: New pflash_cfi01_legacy_drive() | 38 | arm: Remove unnecessary includes of hw/arm/arm.h |
45 | hw/arm/virt: Support firmware configuration with -blockdev | 39 | arm: Rename hw/arm/arm.h to hw/arm/boot.h |
40 | hw/intc/arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} | ||
41 | hw/intc/arm_gicv3: Fix writes to ICC_CTLR_EL3 | ||
46 | 42 | ||
47 | Peter Maydell (7): | 43 | Philippe Mathieu-Daudé (3): |
48 | hw/arm/raspi: Diagnose requests for too much RAM | 44 | hw/arm/exynos4: Remove unuseful debug code |
49 | arm: Allow system registers for KVM guests to be changed by QEMU code | 45 | hw/arm/exynos4: Use the IEC binary prefix definitions |
50 | hw/arm/armv7m_nvic: Check subpriority in nvic_recompute_state_secure() | 46 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC |
51 | hw/intc/armv7m_nvic: NS BFAR and BFSR are RAZ/WI if BFHFNMINS == 0 | ||
52 | hw/intc/armv7m_nvic: Don't enable ARMV7M_EXCP_DEBUG from reset | ||
53 | target/arm: Implement XPSR GE bits | ||
54 | target/arm: Stop using variable length array in dc_zva | ||
55 | 47 | ||
56 | contrib/libvhost-user/libvhost-user.h | 2 +- | 48 | Richard Henderson (2): |
57 | include/hw/arm/aspeed.h | 1 + | 49 | target/arm: Use extract2 for EXTR |
58 | include/hw/arm/virt.h | 2 + | 50 | target/arm: Simplify BFXIL expansion |
59 | include/hw/block/flash.h | 1 + | ||
60 | include/qemu/compiler.h | 2 +- | ||
61 | include/qemu/osdep.h | 10 +- | ||
62 | scripts/cocci-macro-file.h | 7 +- | ||
63 | target/arm/cpu.h | 13 ++- | ||
64 | hw/arm/aspeed.c | 8 ++ | ||
65 | hw/arm/raspi.c | 7 ++ | ||
66 | hw/arm/virt.c | 202 ++++++++++++++++++++++------------ | ||
67 | hw/block/pflash_cfi01.c | 28 +++++ | ||
68 | hw/i386/pc_sysfw.c | 18 +-- | ||
69 | hw/intc/armv7m_nvic.c | 40 ++++++- | ||
70 | qga/commands-win32.c | 2 +- | ||
71 | target/arm/helper.c | 47 +++++++- | ||
72 | target/arm/kvm.c | 8 ++ | ||
73 | target/arm/kvm32.c | 20 +--- | ||
74 | target/arm/kvm64.c | 2 + | ||
75 | target/arm/machine.c | 2 +- | ||
76 | util/cacheinfo.c | 2 +- | ||
77 | 21 files changed, 294 insertions(+), 130 deletions(-) | ||
78 | 51 | ||
52 | include/hw/arm/allwinner-a10.h | 2 +- | ||
53 | include/hw/arm/aspeed_soc.h | 1 - | ||
54 | include/hw/arm/bcm2836.h | 1 - | ||
55 | include/hw/arm/{arm.h => boot.h} | 12 +++------ | ||
56 | include/hw/arm/exynos4210.h | 9 +++++-- | ||
57 | include/hw/arm/fsl-imx25.h | 2 +- | ||
58 | include/hw/arm/fsl-imx31.h | 2 +- | ||
59 | include/hw/arm/fsl-imx6.h | 2 +- | ||
60 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
61 | include/hw/arm/fsl-imx7.h | 2 +- | ||
62 | include/hw/arm/virt.h | 2 +- | ||
63 | include/hw/arm/xlnx-versal.h | 2 +- | ||
64 | include/hw/arm/xlnx-zynqmp.h | 2 +- | ||
65 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++ | ||
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%) | ||
115 | diff view generated by jsdifflib |
1 | From: Cao Jiaxi <driver1998@foxmail.com> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | I encountered the following compilation error on mingw: | 3 | This is, after all, how we implement extract2 in tcg/aarch64. |
4 | 4 | ||
5 | /mnt/d/qemu/include/qemu/osdep.h:97:9: error: '__USE_MINGW_ANSI_STDIO' macro redefined [-Werror,-Wmacro-redefined] | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
6 | #define __USE_MINGW_ANSI_STDIO 1 | 6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
7 | ^ | 7 | Message-id: 20190514011129.11330-2-richard.henderson@linaro.org |
8 | /mnt/d/llvm-mingw/aarch64-w64-mingw32/include/_mingw.h:433:9: note: previous definition is here | ||
9 | #define __USE_MINGW_ANSI_STDIO 0 /* was not defined so it should be 0 */ | ||
10 | |||
11 | It turns out that __USE_MINGW_ANSI_STDIO must be set before any | ||
12 | system headers are included, not just before stdio.h. | ||
13 | |||
14 | Signed-off-by: Cao Jiaxi <driver1998@foxmail.com> | ||
15 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
16 | Reviewed-by: Stefan Weil <sw@weilnetz.de> | ||
17 | Message-id: 20190503003719.10233-1-driver1998@foxmail.com | ||
18 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
19 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
20 | --- | 9 | --- |
21 | include/qemu/osdep.h | 10 +++++----- | 10 | target/arm/translate-a64.c | 38 ++++++++++++++++++++------------------ |
22 | 1 file changed, 5 insertions(+), 5 deletions(-) | 11 | 1 file changed, 20 insertions(+), 18 deletions(-) |
23 | 12 | ||
24 | diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h | 13 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
25 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
26 | --- a/include/qemu/osdep.h | 15 | --- a/target/arm/translate-a64.c |
27 | +++ b/include/qemu/osdep.h | 16 | +++ b/target/arm/translate-a64.c |
28 | @@ -XXX,XX +XXX,XX @@ extern int daemon(int, int); | 17 | @@ -XXX,XX +XXX,XX @@ static void disas_extract(DisasContext *s, uint32_t insn) |
29 | #endif | 18 | } else { |
30 | #endif | 19 | tcg_gen_ext32u_i64(tcg_rd, cpu_reg(s, rm)); |
31 | 20 | } | |
32 | +/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */ | 21 | - } else if (rm == rn) { /* ROR */ |
33 | +#ifdef __MINGW32__ | 22 | - tcg_rm = cpu_reg(s, rm); |
34 | +#define __USE_MINGW_ANSI_STDIO 1 | 23 | - if (sf) { |
35 | +#endif | 24 | - tcg_gen_rotri_i64(tcg_rd, tcg_rm, imm); |
25 | - } else { | ||
26 | - TCGv_i32 tmp = tcg_temp_new_i32(); | ||
27 | - tcg_gen_extrl_i64_i32(tmp, tcg_rm); | ||
28 | - tcg_gen_rotri_i32(tmp, tmp, imm); | ||
29 | - tcg_gen_extu_i32_i64(tcg_rd, tmp); | ||
30 | - tcg_temp_free_i32(tmp); | ||
31 | - } | ||
32 | } else { | ||
33 | - tcg_rm = read_cpu_reg(s, rm, sf); | ||
34 | - tcg_rn = read_cpu_reg(s, rn, sf); | ||
35 | - tcg_gen_shri_i64(tcg_rm, tcg_rm, imm); | ||
36 | - tcg_gen_shli_i64(tcg_rn, tcg_rn, bitsize - imm); | ||
37 | - tcg_gen_or_i64(tcg_rd, tcg_rm, tcg_rn); | ||
38 | - if (!sf) { | ||
39 | - tcg_gen_ext32u_i64(tcg_rd, tcg_rd); | ||
40 | + tcg_rm = cpu_reg(s, rm); | ||
41 | + tcg_rn = cpu_reg(s, rn); | ||
36 | + | 42 | + |
37 | #include <stdarg.h> | 43 | + if (sf) { |
38 | #include <stddef.h> | 44 | + /* Specialization to ROR happens in EXTRACT2. */ |
39 | #include <stdbool.h> | 45 | + tcg_gen_extract2_i64(tcg_rd, tcg_rm, tcg_rn, imm); |
40 | #include <stdint.h> | 46 | + } else { |
41 | #include <sys/types.h> | 47 | + TCGv_i32 t0 = tcg_temp_new_i32(); |
42 | #include <stdlib.h> | 48 | + |
43 | - | 49 | + tcg_gen_extrl_i64_i32(t0, tcg_rm); |
44 | -/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */ | 50 | + if (rm == rn) { |
45 | -#ifdef __MINGW32__ | 51 | + tcg_gen_rotri_i32(t0, t0, imm); |
46 | -#define __USE_MINGW_ANSI_STDIO 1 | 52 | + } else { |
47 | -#endif | 53 | + TCGv_i32 t1 = tcg_temp_new_i32(); |
48 | #include <stdio.h> | 54 | + tcg_gen_extrl_i64_i32(t1, tcg_rn); |
49 | 55 | + tcg_gen_extract2_i32(t0, t0, t1, imm); | |
50 | #include <string.h> | 56 | + tcg_temp_free_i32(t1); |
57 | + } | ||
58 | + tcg_gen_extu_i32_i64(tcg_rd, t0); | ||
59 | + tcg_temp_free_i32(t0); | ||
60 | } | ||
61 | } | ||
62 | } | ||
51 | -- | 63 | -- |
52 | 2.20.1 | 64 | 2.20.1 |
53 | 65 | ||
54 | 66 | diff view generated by jsdifflib |
1 | From: Markus Armbruster <armbru@redhat.com> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | The loop does two things: map legacy -drive to properties, and collect | 3 | The mask implied by the extract is redundant with the one |
4 | all the backends for use after the loop. The next patch will factor | 4 | implied by the deposit. Also, fix spelling of BFXIL. |
5 | out the former for reuse in hw/arm/virt.c. To make that easier, | ||
6 | rearrange the loop so it does the first thing first, and the second | ||
7 | thing second. | ||
8 | 5 | ||
9 | Signed-off-by: Markus Armbruster <armbru@redhat.com> | 6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
10 | Reviewed-by: Laszlo Ersek <lersek@redhat.com> | 7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
11 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 8 | Message-id: 20190514011129.11330-3-richard.henderson@linaro.org |
12 | Message-id: 20190416091348.26075-2-armbru@redhat.com | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
14 | --- | 10 | --- |
15 | hw/i386/pc_sysfw.c | 24 +++++++++++------------- | 11 | target/arm/translate-a64.c | 6 +++--- |
16 | 1 file changed, 11 insertions(+), 13 deletions(-) | 12 | 1 file changed, 3 insertions(+), 3 deletions(-) |
17 | 13 | ||
18 | diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c | 14 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
19 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
20 | --- a/hw/i386/pc_sysfw.c | 16 | --- a/target/arm/translate-a64.c |
21 | +++ b/hw/i386/pc_sysfw.c | 17 | +++ b/target/arm/translate-a64.c |
22 | @@ -XXX,XX +XXX,XX @@ void pc_system_firmware_init(PCMachineState *pcms, | 18 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) |
23 | 19 | tcg_gen_extract_i64(tcg_rd, tcg_tmp, ri, len); | |
24 | /* Map legacy -drive if=pflash to machine properties */ | 20 | return; |
25 | for (i = 0; i < ARRAY_SIZE(pcms->flash); i++) { | ||
26 | - pflash_blk[i] = pflash_cfi01_get_blk(pcms->flash[i]); | ||
27 | pflash_drv = drive_get(IF_PFLASH, 0, i); | ||
28 | - if (!pflash_drv) { | ||
29 | - continue; | ||
30 | + if (pflash_drv) { | ||
31 | + loc_push_none(&loc); | ||
32 | + qemu_opts_loc_restore(pflash_drv->opts); | ||
33 | + if (pflash_cfi01_get_blk(pcms->flash[i])) { | ||
34 | + error_report("clashes with -machine"); | ||
35 | + exit(1); | ||
36 | + } | ||
37 | + qdev_prop_set_drive(DEVICE(pcms->flash[i]), "drive", | ||
38 | + blk_by_legacy_dinfo(pflash_drv), &error_fatal); | ||
39 | + loc_pop(&loc); | ||
40 | } | 21 | } |
41 | - loc_push_none(&loc); | 22 | - /* opc == 1, BXFIL fall through to deposit */ |
42 | - qemu_opts_loc_restore(pflash_drv->opts); | 23 | - tcg_gen_extract_i64(tcg_tmp, tcg_tmp, ri, len); |
43 | - if (pflash_blk[i]) { | 24 | + /* opc == 1, BFXIL fall through to deposit */ |
44 | - error_report("clashes with -machine"); | 25 | + tcg_gen_shri_i64(tcg_tmp, tcg_tmp, ri); |
45 | - exit(1); | 26 | pos = 0; |
46 | - } | 27 | } else { |
47 | - pflash_blk[i] = blk_by_legacy_dinfo(pflash_drv); | 28 | /* Handle the ri > si case with a deposit |
48 | - qdev_prop_set_drive(DEVICE(pcms->flash[i]), | 29 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) |
49 | - "drive", pflash_blk[i], &error_fatal); | 30 | len = ri; |
50 | - loc_pop(&loc); | ||
51 | + pflash_blk[i] = pflash_cfi01_get_blk(pcms->flash[i]); | ||
52 | } | 31 | } |
53 | 32 | ||
54 | /* Reject gaps */ | 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 | ||
55 | -- | 38 | -- |
56 | 2.20.1 | 39 | 2.20.1 |
57 | 40 | ||
58 | 41 | diff view generated by jsdifflib |
1 | From: Cao Jiaxi <driver1998@foxmail.com> | 1 | From: Alistair Francis <alistair.francis@wdc.com> |
---|---|---|---|
2 | 2 | ||
3 | Windows ARM64 uses LLP64 model, which breaks current assumptions. | 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: Cao Jiaxi <driver1998@foxmail.com> | 6 | 0 0x00007ffff4c2382f in raise () at /usr/lib/libc.so.6 |
7 | 1 0x00007ffff4c0e672 in abort () at /usr/lib/libc.so.6 | ||
8 | 2 0x00005555559c1839 in disas_neon_data_insn (insn=<optimized out>, s=<optimized out>) at ./target/arm/translate.c:6673 | ||
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> | ||
6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 27 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
7 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
8 | Message-id: 20190503003707.10185-1-driver1998@foxmail.com | ||
9 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 28 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
10 | Tested-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 | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 32 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
12 | --- | 33 | --- |
13 | util/cacheinfo.c | 2 +- | 34 | target/arm/translate.c | 4 ++-- |
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | 35 | 1 file changed, 2 insertions(+), 2 deletions(-) |
15 | 36 | ||
16 | diff --git a/util/cacheinfo.c b/util/cacheinfo.c | 37 | diff --git a/target/arm/translate.c b/target/arm/translate.c |
17 | index XXXXXXX..XXXXXXX 100644 | 38 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/util/cacheinfo.c | 39 | --- a/target/arm/translate.c |
19 | +++ b/util/cacheinfo.c | 40 | +++ b/target/arm/translate.c |
20 | @@ -XXX,XX +XXX,XX @@ static void sys_cache_info(int *isize, int *dsize) | 41 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) |
21 | static void arch_cache_info(int *isize, int *dsize) | 42 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), |
22 | { | 43 | rn_ofs, rm_ofs, vec_size, vec_size, |
23 | if (*isize == 0 || *dsize == 0) { | 44 | (u ? uqadd_op : sqadd_op) + size); |
24 | - unsigned long ctr; | 45 | - break; |
25 | + uint64_t ctr; | 46 | + return 0; |
26 | 47 | ||
27 | /* The real cache geometry is in CCSIDR_EL1/CLIDR_EL1/CSSELR_EL1, | 48 | case NEON_3R_VQSUB: |
28 | but (at least under Linux) these are marked protected by the | 49 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), |
50 | rn_ofs, rm_ofs, vec_size, vec_size, | ||
51 | (u ? uqsub_op : sqsub_op) + size); | ||
52 | - break; | ||
53 | + return 0; | ||
54 | |||
55 | case NEON_3R_VMUL: /* VMUL */ | ||
56 | if (u) { | ||
29 | -- | 57 | -- |
30 | 2.20.1 | 58 | 2.20.1 |
31 | 59 | ||
32 | 60 | diff view generated by jsdifflib |
1 | Currently the dc_zva helper function uses a variable length | 1 | The system_clock_scale global is used only by the armv7m systick |
---|---|---|---|
2 | array. In fact we know (as the comment above remarks) that | 2 | device; move the extern declaration to the armv7m_systick.h header, |
3 | the length of this array is bounded because the architecture | 3 | and expand the comment to explain what it is and that it should |
4 | limits the block size and QEMU limits the target page size. | 4 | ideally be replaced with a different approach. |
5 | Use a fixed array size and assert that we don't run off it. | ||
6 | 5 | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
10 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
11 | Message-id: 20190503120448.13385-1-peter.maydell@linaro.org | 9 | Message-id: 20190516163857.6430-2-peter.maydell@linaro.org |
12 | --- | 10 | --- |
13 | target/arm/helper.c | 8 ++++++-- | 11 | include/hw/arm/arm.h | 4 ---- |
14 | 1 file changed, 6 insertions(+), 2 deletions(-) | 12 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++++++++ |
13 | 2 files changed, 22 insertions(+), 4 deletions(-) | ||
15 | 14 | ||
16 | diff --git a/target/arm/helper.c b/target/arm/helper.c | 15 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h |
17 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/target/arm/helper.c | 17 | --- a/include/hw/arm/arm.h |
19 | +++ b/target/arm/helper.c | 18 | +++ b/include/hw/arm/arm.h |
20 | @@ -XXX,XX +XXX,XX @@ | 19 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, |
21 | #include "qemu/osdep.h" | 20 | const struct arm_boot_info *info, |
22 | +#include "qemu/units.h" | 21 | hwaddr mvbar_addr); |
23 | #include "target/arm/idau.h" | 22 | |
24 | #include "trace.h" | 23 | -/* Multiplication factor to convert from system clock ticks to qemu timer |
25 | #include "cpu.h" | 24 | - ticks. */ |
26 | @@ -XXX,XX +XXX,XX @@ void HELPER(dc_zva)(CPUARMState *env, uint64_t vaddr_in) | 25 | -extern int system_clock_scale; |
27 | * We know that in fact for any v8 CPU the page size is at least 4K | 26 | - |
28 | * and the block size must be 2K or less, but TARGET_PAGE_SIZE is only | 27 | #endif /* HW_ARM_H */ |
29 | * 1K as an artefact of legacy v5 subpage support being present in the | 28 | diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_systick.h |
30 | - * same QEMU executable. | 29 | index XXXXXXX..XXXXXXX 100644 |
31 | + * same QEMU executable. So in practice the hostaddr[] array has | 30 | --- a/include/hw/timer/armv7m_systick.h |
32 | + * two entries, given the current setting of TARGET_PAGE_BITS_MIN. | 31 | +++ b/include/hw/timer/armv7m_systick.h |
33 | */ | 32 | @@ -XXX,XX +XXX,XX @@ typedef struct SysTickState { |
34 | int maxidx = DIV_ROUND_UP(blocklen, TARGET_PAGE_SIZE); | 33 | qemu_irq irq; |
35 | - void *hostaddr[maxidx]; | 34 | } SysTickState; |
36 | + void *hostaddr[DIV_ROUND_UP(2 * KiB, 1 << TARGET_PAGE_BITS_MIN)]; | 35 | |
37 | int try, i; | 36 | +/* |
38 | unsigned mmu_idx = cpu_mmu_index(env, false); | 37 | + * Multiplication factor to convert from system clock ticks to qemu timer |
39 | TCGMemOpIdx oi = make_memop_idx(MO_UB, mmu_idx); | 38 | + * ticks. This should be set (by board code, usually) to a value |
40 | 39 | + * equal to NANOSECONDS_PER_SECOND / frq, where frq is the clock frequency | |
41 | + assert(maxidx <= ARRAY_SIZE(hostaddr)); | 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; | ||
42 | + | 57 | + |
43 | for (try = 0; try < 2; try++) { | 58 | #endif |
44 | |||
45 | for (i = 0; i < maxidx; i++) { | ||
46 | -- | 59 | -- |
47 | 2.20.1 | 60 | 2.20.1 |
48 | 61 | ||
49 | 62 | diff view generated by jsdifflib |
1 | At the moment the Arm implementations of kvm_arch_{get,put}_registers() | 1 | The hw/arm/arm.h header now only includes declarations relating |
---|---|---|---|
2 | don't support having QEMU change the values of system registers | 2 | to boot.c code, so it is only needed by Arm board or SoC code. |
3 | (aka coprocessor registers for AArch32). This is because although | 3 | Remove some unnecessary inclusions of it from target/arm files |
4 | kvm_arch_get_registers() calls write_list_to_cpustate() to | 4 | and from hw/intc/armv7m_nvic.c. |
5 | update the CPU state struct fields (so QEMU code can read the | ||
6 | values in the usual way), kvm_arch_put_registers() does not | ||
7 | call write_cpustate_to_list(), meaning that any changes to | ||
8 | the CPU state struct fields will not be passed back to KVM. | ||
9 | |||
10 | The rationale for this design is documented in a comment in the | ||
11 | AArch32 kvm_arch_put_registers() -- writing the values in the | ||
12 | cpregs list into the CPU state struct is "lossy" because the | ||
13 | write of a register might not succeed, and so if we blindly | ||
14 | copy the CPU state values back again we will incorrectly | ||
15 | change register values for the guest. The assumption was that | ||
16 | no QEMU code would need to write to the registers. | ||
17 | |||
18 | However, when we implemented debug support for KVM guests, we | ||
19 | broke that assumption: the code to handle "set the guest up | ||
20 | to take a breakpoint exception" does so by updating various | ||
21 | guest registers including ESR_EL1. | ||
22 | |||
23 | Support this by making kvm_arch_put_registers() synchronize | ||
24 | CPU state back into the list. We sync only those registers | ||
25 | where the initial write succeeds, which should be sufficient. | ||
26 | |||
27 | This commit is the same as commit 823e1b3818f9b10b824ddc which we | ||
28 | had to revert in commit 942f99c825fc94c8b1a4, except that the bug | ||
29 | which was preventing EDK2 guest firmware running has been fixed: | ||
30 | kvm_arm_reset_vcpu() now calls write_list_to_cpustate(). | ||
31 | 5 | ||
32 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
33 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
34 | Tested-by: Eric Auger <eric.auger@redhat.com> | 8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
9 | Message-id: 20190516163857.6430-3-peter.maydell@linaro.org | ||
35 | --- | 10 | --- |
36 | target/arm/cpu.h | 9 ++++++++- | 11 | hw/intc/armv7m_nvic.c | 1 - |
37 | target/arm/helper.c | 27 +++++++++++++++++++++++++-- | 12 | target/arm/arm-semi.c | 1 - |
38 | target/arm/kvm.c | 8 ++++++++ | 13 | target/arm/cpu.c | 1 - |
39 | target/arm/kvm32.c | 20 ++------------------ | 14 | target/arm/cpu64.c | 1 - |
40 | target/arm/kvm64.c | 2 ++ | 15 | target/arm/kvm.c | 1 - |
41 | target/arm/machine.c | 2 +- | 16 | target/arm/kvm32.c | 1 - |
42 | 6 files changed, 46 insertions(+), 22 deletions(-) | 17 | target/arm/kvm64.c | 1 - |
18 | 7 files changed, 7 deletions(-) | ||
43 | 19 | ||
44 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | 20 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c |
45 | index XXXXXXX..XXXXXXX 100644 | 21 | index XXXXXXX..XXXXXXX 100644 |
46 | --- a/target/arm/cpu.h | 22 | --- a/hw/intc/armv7m_nvic.c |
47 | +++ b/target/arm/cpu.h | 23 | +++ b/hw/intc/armv7m_nvic.c |
48 | @@ -XXX,XX +XXX,XX @@ bool write_list_to_cpustate(ARMCPU *cpu); | 24 | @@ -XXX,XX +XXX,XX @@ |
49 | /** | 25 | #include "cpu.h" |
50 | * write_cpustate_to_list: | 26 | #include "hw/sysbus.h" |
51 | * @cpu: ARMCPU | 27 | #include "qemu/timer.h" |
52 | + * @kvm_sync: true if this is for syncing back to KVM | 28 | -#include "hw/arm/arm.h" |
53 | * | 29 | #include "hw/intc/armv7m_nvic.h" |
54 | * For each register listed in the ARMCPU cpreg_indexes list, write | 30 | #include "target/arm/cpu.h" |
55 | * its value from the ARMCPUState structure into the cpreg_values list. | 31 | #include "exec/exec-all.h" |
56 | * This is used to copy info from TCG's working data structures into | 32 | diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c |
57 | * KVM or for outbound migration. | ||
58 | * | ||
59 | + * @kvm_sync is true if we are doing this in order to sync the | ||
60 | + * register state back to KVM. In this case we will only update | ||
61 | + * values in the list if the previous list->cpustate sync actually | ||
62 | + * successfully wrote the CPU state. Otherwise we will keep the value | ||
63 | + * that is in the list. | ||
64 | + * | ||
65 | * Returns: true if all register values were read correctly, | ||
66 | * false if some register was unknown or could not be read. | ||
67 | * Note that we do not stop early on failure -- we will attempt | ||
68 | * reading all registers in the list. | ||
69 | */ | ||
70 | -bool write_cpustate_to_list(ARMCPU *cpu); | ||
71 | +bool write_cpustate_to_list(ARMCPU *cpu, bool kvm_sync); | ||
72 | |||
73 | #define ARM_CPUID_TI915T 0x54029152 | ||
74 | #define ARM_CPUID_TI925T 0x54029252 | ||
75 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
76 | index XXXXXXX..XXXXXXX 100644 | 33 | index XXXXXXX..XXXXXXX 100644 |
77 | --- a/target/arm/helper.c | 34 | --- a/target/arm/arm-semi.c |
78 | +++ b/target/arm/helper.c | 35 | +++ b/target/arm/arm-semi.c |
79 | @@ -XXX,XX +XXX,XX @@ static bool raw_accessors_invalid(const ARMCPRegInfo *ri) | 36 | @@ -XXX,XX +XXX,XX @@ |
80 | return true; | 37 | #else |
81 | } | 38 | #include "qemu-common.h" |
82 | 39 | #include "exec/gdbstub.h" | |
83 | -bool write_cpustate_to_list(ARMCPU *cpu) | 40 | -#include "hw/arm/arm.h" |
84 | +bool write_cpustate_to_list(ARMCPU *cpu, bool kvm_sync) | 41 | #include "qemu/cutils.h" |
85 | { | 42 | #endif |
86 | /* Write the coprocessor state from cpu->env to the (index,value) list. */ | 43 | |
87 | int i; | 44 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c |
88 | @@ -XXX,XX +XXX,XX @@ bool write_cpustate_to_list(ARMCPU *cpu) | 45 | index XXXXXXX..XXXXXXX 100644 |
89 | for (i = 0; i < cpu->cpreg_array_len; i++) { | 46 | --- a/target/arm/cpu.c |
90 | uint32_t regidx = kvm_to_cpreg_id(cpu->cpreg_indexes[i]); | 47 | +++ b/target/arm/cpu.c |
91 | const ARMCPRegInfo *ri; | 48 | @@ -XXX,XX +XXX,XX @@ |
92 | + uint64_t newval; | 49 | #if !defined(CONFIG_USER_ONLY) |
93 | 50 | #include "hw/loader.h" | |
94 | ri = get_arm_cp_reginfo(cpu->cp_regs, regidx); | 51 | #endif |
95 | if (!ri) { | 52 | -#include "hw/arm/arm.h" |
96 | @@ -XXX,XX +XXX,XX @@ bool write_cpustate_to_list(ARMCPU *cpu) | 53 | #include "sysemu/sysemu.h" |
97 | if (ri->type & ARM_CP_NO_RAW) { | 54 | #include "sysemu/hw_accel.h" |
98 | continue; | 55 | #include "kvm_arm.h" |
99 | } | 56 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c |
100 | - cpu->cpreg_values[i] = read_raw_cp_reg(&cpu->env, ri); | 57 | index XXXXXXX..XXXXXXX 100644 |
101 | + | 58 | --- a/target/arm/cpu64.c |
102 | + newval = read_raw_cp_reg(&cpu->env, ri); | 59 | +++ b/target/arm/cpu64.c |
103 | + if (kvm_sync) { | 60 | @@ -XXX,XX +XXX,XX @@ |
104 | + /* | 61 | #if !defined(CONFIG_USER_ONLY) |
105 | + * Only sync if the previous list->cpustate sync succeeded. | 62 | #include "hw/loader.h" |
106 | + * Rather than tracking the success/failure state for every | 63 | #endif |
107 | + * item in the list, we just recheck "does the raw write we must | 64 | -#include "hw/arm/arm.h" |
108 | + * have made in write_list_to_cpustate() read back OK" here. | 65 | #include "sysemu/sysemu.h" |
109 | + */ | 66 | #include "sysemu/kvm.h" |
110 | + uint64_t oldval = cpu->cpreg_values[i]; | 67 | #include "kvm_arm.h" |
111 | + | ||
112 | + if (oldval == newval) { | ||
113 | + continue; | ||
114 | + } | ||
115 | + | ||
116 | + write_raw_cp_reg(&cpu->env, ri, oldval); | ||
117 | + if (read_raw_cp_reg(&cpu->env, ri) != oldval) { | ||
118 | + continue; | ||
119 | + } | ||
120 | + | ||
121 | + write_raw_cp_reg(&cpu->env, ri, newval); | ||
122 | + } | ||
123 | + cpu->cpreg_values[i] = newval; | ||
124 | } | ||
125 | return ok; | ||
126 | } | ||
127 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c | 68 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c |
128 | index XXXXXXX..XXXXXXX 100644 | 69 | index XXXXXXX..XXXXXXX 100644 |
129 | --- a/target/arm/kvm.c | 70 | --- a/target/arm/kvm.c |
130 | +++ b/target/arm/kvm.c | 71 | +++ b/target/arm/kvm.c |
131 | @@ -XXX,XX +XXX,XX @@ void kvm_arm_reset_vcpu(ARMCPU *cpu) | 72 | @@ -XXX,XX +XXX,XX @@ |
132 | fprintf(stderr, "write_kvmstate_to_list failed\n"); | 73 | #include "cpu.h" |
133 | abort(); | 74 | #include "trace.h" |
134 | } | 75 | #include "internals.h" |
135 | + /* | 76 | -#include "hw/arm/arm.h" |
136 | + * Sync the reset values also into the CPUState. This is necessary | 77 | #include "hw/pci/pci.h" |
137 | + * because the next thing we do will be a kvm_arch_put_registers() | 78 | #include "exec/memattrs.h" |
138 | + * which will update the list values from the CPUState before copying | 79 | #include "exec/address-spaces.h" |
139 | + * the list values back to KVM. It's OK to ignore failure returns here | ||
140 | + * for the same reason we do so in kvm_arch_get_registers(). | ||
141 | + */ | ||
142 | + write_list_to_cpustate(cpu); | ||
143 | } | ||
144 | |||
145 | /* | ||
146 | diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c | 80 | diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c |
147 | index XXXXXXX..XXXXXXX 100644 | 81 | index XXXXXXX..XXXXXXX 100644 |
148 | --- a/target/arm/kvm32.c | 82 | --- a/target/arm/kvm32.c |
149 | +++ b/target/arm/kvm32.c | 83 | +++ b/target/arm/kvm32.c |
150 | @@ -XXX,XX +XXX,XX @@ int kvm_arch_put_registers(CPUState *cs, int level) | 84 | @@ -XXX,XX +XXX,XX @@ |
151 | return ret; | 85 | #include "sysemu/kvm.h" |
152 | } | 86 | #include "kvm_arm.h" |
153 | 87 | #include "internals.h" | |
154 | - /* Note that we do not call write_cpustate_to_list() | 88 | -#include "hw/arm/arm.h" |
155 | - * here, so we are only writing the tuple list back to | 89 | #include "qemu/log.h" |
156 | - * KVM. This is safe because nothing can change the | 90 | |
157 | - * CPUARMState cp15 fields (in particular gdb accesses cannot) | 91 | static inline void set_feature(uint64_t *features, int feature) |
158 | - * and so there are no changes to sync. In fact syncing would | ||
159 | - * be wrong at this point: for a constant register where TCG and | ||
160 | - * KVM disagree about its value, the preceding write_list_to_cpustate() | ||
161 | - * would not have had any effect on the CPUARMState value (since the | ||
162 | - * register is read-only), and a write_cpustate_to_list() here would | ||
163 | - * then try to write the TCG value back into KVM -- this would either | ||
164 | - * fail or incorrectly change the value the guest sees. | ||
165 | - * | ||
166 | - * If we ever want to allow the user to modify cp15 registers via | ||
167 | - * the gdb stub, we would need to be more clever here (for instance | ||
168 | - * tracking the set of registers kvm_arch_get_registers() successfully | ||
169 | - * managed to update the CPUARMState with, and only allowing those | ||
170 | - * to be written back up into the kernel). | ||
171 | - */ | ||
172 | + write_cpustate_to_list(cpu, true); | ||
173 | + | ||
174 | if (!write_list_to_kvmstate(cpu, level)) { | ||
175 | return EINVAL; | ||
176 | } | ||
177 | diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c | 92 | diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c |
178 | index XXXXXXX..XXXXXXX 100644 | 93 | index XXXXXXX..XXXXXXX 100644 |
179 | --- a/target/arm/kvm64.c | 94 | --- a/target/arm/kvm64.c |
180 | +++ b/target/arm/kvm64.c | 95 | +++ b/target/arm/kvm64.c |
181 | @@ -XXX,XX +XXX,XX @@ int kvm_arch_put_registers(CPUState *cs, int level) | 96 | @@ -XXX,XX +XXX,XX @@ |
182 | return ret; | 97 | #include "sysemu/kvm.h" |
183 | } | 98 | #include "kvm_arm.h" |
184 | 99 | #include "internals.h" | |
185 | + write_cpustate_to_list(cpu, true); | 100 | -#include "hw/arm/arm.h" |
186 | + | 101 | |
187 | if (!write_list_to_kvmstate(cpu, level)) { | 102 | static bool have_guest_debug; |
188 | return EINVAL; | 103 | |
189 | } | ||
190 | diff --git a/target/arm/machine.c b/target/arm/machine.c | ||
191 | index XXXXXXX..XXXXXXX 100644 | ||
192 | --- a/target/arm/machine.c | ||
193 | +++ b/target/arm/machine.c | ||
194 | @@ -XXX,XX +XXX,XX @@ static int cpu_pre_save(void *opaque) | ||
195 | abort(); | ||
196 | } | ||
197 | } else { | ||
198 | - if (!write_cpustate_to_list(cpu)) { | ||
199 | + if (!write_cpustate_to_list(cpu, false)) { | ||
200 | /* This should never fail. */ | ||
201 | abort(); | ||
202 | } | ||
203 | -- | 104 | -- |
204 | 2.20.1 | 105 | 2.20.1 |
205 | 106 | ||
206 | 107 | diff view generated by jsdifflib |
1 | From: Markus Armbruster <armbru@redhat.com> | 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 | The ARM virt machines put firmware in flash memory. To configure it, | 5 | The bulk of this commit was created via |
4 | you use -drive if=pflash,unit=0,... and optionally -drive | 6 | perl -pi -e 's|hw/arm/arm.h|hw/arm/boot.h|' hw/arm/*.c include/hw/arm/*.h |
5 | if=pflash,unit=1,... | ||
6 | 7 | ||
7 | Why two -drive? This permits setting up one part of the flash memory | 8 | In a few cases we can just delete the #include: |
8 | read-only, and the other part read/write. It also makes upgrading | 9 | hw/arm/msf2-soc.c, include/hw/arm/aspeed_soc.h and |
9 | firmware on the host easier. Below the hood, we get two separate | 10 | include/hw/arm/bcm2836.h did not require it. |
10 | flash devices, because we were too lazy to improve our flash device | ||
11 | models to support sector protection. | ||
12 | 11 | ||
13 | The problem at hand is to do the same with -blockdev somehow, as one | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
14 | more step towards deprecating -drive. | 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 | ||
16 | --- | ||
17 | include/hw/arm/allwinner-a10.h | 2 +- | ||
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 | ||
16 | We recently solved this problem for x86 PC machines, in commit | 69 | diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h |
17 | ebc29e1beab. See the commit message for design rationale. | 70 | index XXXXXXX..XXXXXXX 100644 |
18 | 71 | --- a/include/hw/arm/allwinner-a10.h | |
19 | This commit solves it for ARM virt basically the same way: new machine | 72 | +++ b/include/hw/arm/allwinner-a10.h |
20 | properties pflash0, pflash1 forward to the onboard flash devices' | 73 | @@ -XXX,XX +XXX,XX @@ |
21 | properties. Requires creating the onboard devices in the | 74 | #include "qemu-common.h" |
22 | .instance_init() method virt_instance_init(). The existing code to | 75 | #include "qemu/error-report.h" |
23 | pick up drives defined with -drive if=pflash is replaced by code to | 76 | #include "hw/char/serial.h" |
24 | desugar into the machine properties. | 77 | -#include "hw/arm/arm.h" |
25 | 78 | +#include "hw/arm/boot.h" | |
26 | There are a few behavioral differences, though: | 79 | #include "hw/timer/allwinner-a10-pit.h" |
27 | 80 | #include "hw/intc/allwinner-a10-pic.h" | |
28 | * The flash devices are always present (x86: only present if | 81 | #include "hw/net/allwinner_emac.h" |
29 | configured) | 82 | diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h |
30 | 83 | index XXXXXXX..XXXXXXX 100644 | |
31 | * Flash base addresses and sizes are fixed (x86: sizes depend on | 84 | --- a/include/hw/arm/aspeed_soc.h |
32 | images, mapped back to back below a fixed address) | 85 | +++ b/include/hw/arm/aspeed_soc.h |
33 | 86 | @@ -XXX,XX +XXX,XX @@ | |
34 | * -bios configures contents of first pflash (x86: -bios configures ROM | 87 | #ifndef ASPEED_SOC_H |
35 | contents) | 88 | #define ASPEED_SOC_H |
36 | 89 | ||
37 | * -bios is rejected when first pflash is also configured with -machine | 90 | -#include "hw/arm/arm.h" |
38 | pflash0=... (x86: bios is silently ignored then) | 91 | #include "hw/intc/aspeed_vic.h" |
39 | 92 | #include "hw/misc/aspeed_scu.h" | |
40 | * -machine pflash1=... does not require -machine pflash0=... (x86: it | 93 | #include "hw/misc/aspeed_sdmc.h" |
41 | does). | 94 | diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h |
42 | 95 | index XXXXXXX..XXXXXXX 100644 | |
43 | The actual code is a bit simpler than for x86 mostly due to the first | 96 | --- a/include/hw/arm/bcm2836.h |
44 | two differences. | 97 | +++ b/include/hw/arm/bcm2836.h |
45 | 98 | @@ -XXX,XX +XXX,XX @@ | |
46 | Before the patch, all the action is in create_flash(), called from the | 99 | #ifndef BCM2836_H |
47 | machine's .init() method machvirt_init(): | 100 | #define BCM2836_H |
48 | 101 | ||
49 | main() | 102 | -#include "hw/arm/arm.h" |
50 | machine_run_board_init() | 103 | #include "hw/arm/bcm2835_peripherals.h" |
51 | machvirt_init() | 104 | #include "hw/intc/bcm2836_control.h" |
52 | create_flash() | 105 | |
53 | create_one_flash() for flash[0] | 106 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/boot.h |
54 | create | 107 | similarity index 98% |
55 | configure | 108 | rename from include/hw/arm/arm.h |
56 | includes obeying -drive if=pflash,unit=0 | 109 | rename to include/hw/arm/boot.h |
57 | realize | 110 | index XXXXXXX..XXXXXXX 100644 |
58 | map | 111 | --- a/include/hw/arm/arm.h |
59 | fall back to -bios | 112 | +++ b/include/hw/arm/boot.h |
60 | create_one_flash() for flash[1] | 113 | @@ -XXX,XX +XXX,XX @@ |
61 | create | 114 | /* |
62 | configure | 115 | - * Misc ARM declarations |
63 | includes obeying -drive if=pflash,unit=1 | 116 | + * ARM kernel loader. |
64 | realize | 117 | * |
65 | map | 118 | * Copyright (c) 2006 CodeSourcery. |
66 | update FDT | 119 | * Written by Paul Brook |
67 | 120 | @@ -XXX,XX +XXX,XX @@ | |
68 | To make the machine properties work, we need to move device creation | 121 | * |
69 | to its .instance_init() method virt_instance_init(). | 122 | */ |
70 | 123 | ||
71 | Another complication is machvirt_init()'s computation of | 124 | -#ifndef HW_ARM_H |
72 | @firmware_loaded: it predicts what create_flash() will do. Instead of | 125 | -#define HW_ARM_H |
73 | predicting what create_flash()'s replacement virt_firmware_init() will | 126 | +#ifndef HW_ARM_BOOT_H |
74 | do, I decided to have virt_firmware_init() return what it did. | 127 | +#define HW_ARM_BOOT_H |
75 | Requires calling it a bit earlier. | 128 | |
76 | 129 | #include "exec/memory.h" | |
77 | Resulting call tree: | 130 | #include "target/arm/cpu-qom.h" |
78 | 131 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, | |
79 | main() | 132 | const struct arm_boot_info *info, |
80 | current_machine = object_new() | 133 | hwaddr mvbar_addr); |
81 | ... | 134 | |
82 | virt_instance_init() | 135 | -#endif /* HW_ARM_H */ |
83 | virt_flash_create() | 136 | +#endif /* HW_ARM_BOOT_H */ |
84 | virt_flash_create1() for flash[0] | 137 | diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h |
85 | create | 138 | index XXXXXXX..XXXXXXX 100644 |
86 | configure: set defaults | 139 | --- a/include/hw/arm/fsl-imx25.h |
87 | become child of machine [NEW] | 140 | +++ b/include/hw/arm/fsl-imx25.h |
88 | add machine prop pflash0 as alias for drive [NEW] | 141 | @@ -XXX,XX +XXX,XX @@ |
89 | virt_flash_create1() for flash[1] | 142 | #ifndef FSL_IMX25_H |
90 | create | 143 | #define FSL_IMX25_H |
91 | configure: set defaults | 144 | |
92 | become child of machine [NEW] | 145 | -#include "hw/arm/arm.h" |
93 | add machine prop pflash1 as alias for drive [NEW] | 146 | +#include "hw/arm/boot.h" |
94 | for all machine props from the command line: machine_set_property() | 147 | #include "hw/intc/imx_avic.h" |
95 | ... | 148 | #include "hw/misc/imx25_ccm.h" |
96 | property_set_alias() for machine props pflash0, pflash1 | 149 | #include "hw/char/imx_serial.h" |
97 | ... | 150 | diff --git a/include/hw/arm/fsl-imx31.h b/include/hw/arm/fsl-imx31.h |
98 | set_drive() for cfi.pflash01 prop drive | 151 | index XXXXXXX..XXXXXXX 100644 |
99 | this is how -machine pflash0=... etc set | 152 | --- a/include/hw/arm/fsl-imx31.h |
100 | machine_run_board_init(current_machine); | 153 | +++ b/include/hw/arm/fsl-imx31.h |
101 | virt_firmware_init() | 154 | @@ -XXX,XX +XXX,XX @@ |
102 | pflash_cfi01_legacy_drive() | 155 | #ifndef FSL_IMX31_H |
103 | legacy -drive if=pflash,unit=0 and =1 [NEW] | 156 | #define FSL_IMX31_H |
104 | virt_flash_map() | 157 | |
105 | virt_flash_map1() for flash[0] | 158 | -#include "hw/arm/arm.h" |
106 | configure: num-blocks | 159 | +#include "hw/arm/boot.h" |
107 | realize | 160 | #include "hw/intc/imx_avic.h" |
108 | map | 161 | #include "hw/misc/imx31_ccm.h" |
109 | virt_flash_map1() for flash[1] | 162 | #include "hw/char/imx_serial.h" |
110 | configure: num-blocks | 163 | diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h |
111 | realize | 164 | index XXXXXXX..XXXXXXX 100644 |
112 | map | 165 | --- a/include/hw/arm/fsl-imx6.h |
113 | fall back to -bios | 166 | +++ b/include/hw/arm/fsl-imx6.h |
114 | virt_flash_fdt() | 167 | @@ -XXX,XX +XXX,XX @@ |
115 | update FDT | 168 | #ifndef FSL_IMX6_H |
116 | 169 | #define FSL_IMX6_H | |
117 | You have László to thank for making me explain this in detail. | 170 | |
118 | 171 | -#include "hw/arm/arm.h" | |
119 | Signed-off-by: Markus Armbruster <armbru@redhat.com> | 172 | +#include "hw/arm/boot.h" |
120 | Acked-by: Laszlo Ersek <lersek@redhat.com> | 173 | #include "hw/cpu/a9mpcore.h" |
121 | Message-id: 20190416091348.26075-4-armbru@redhat.com | 174 | #include "hw/misc/imx6_ccm.h" |
122 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 175 | #include "hw/misc/imx6_src.h" |
123 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 176 | diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h |
124 | --- | 177 | index XXXXXXX..XXXXXXX 100644 |
125 | include/hw/arm/virt.h | 2 + | 178 | --- a/include/hw/arm/fsl-imx6ul.h |
126 | hw/arm/virt.c | 202 +++++++++++++++++++++++++++--------------- | 179 | +++ b/include/hw/arm/fsl-imx6ul.h |
127 | 2 files changed, 132 insertions(+), 72 deletions(-) | 180 | @@ -XXX,XX +XXX,XX @@ |
128 | 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" | ||
129 | diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h | 202 | diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h |
130 | index XXXXXXX..XXXXXXX 100644 | 203 | index XXXXXXX..XXXXXXX 100644 |
131 | --- a/include/hw/arm/virt.h | 204 | --- a/include/hw/arm/virt.h |
132 | +++ b/include/hw/arm/virt.h | 205 | +++ b/include/hw/arm/virt.h |
133 | @@ -XXX,XX +XXX,XX @@ | 206 | @@ -XXX,XX +XXX,XX @@ |
207 | #include "exec/hwaddr.h" | ||
134 | #include "qemu/notify.h" | 208 | #include "qemu/notify.h" |
135 | #include "hw/boards.h" | 209 | #include "hw/boards.h" |
136 | #include "hw/arm/arm.h" | 210 | -#include "hw/arm/arm.h" |
137 | +#include "hw/block/flash.h" | 211 | +#include "hw/arm/boot.h" |
212 | #include "hw/block/flash.h" | ||
138 | #include "sysemu/kvm.h" | 213 | #include "sysemu/kvm.h" |
139 | #include "hw/intc/arm_gicv3_common.h" | 214 | #include "hw/intc/arm_gicv3_common.h" |
140 | 215 | diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h | |
141 | @@ -XXX,XX +XXX,XX @@ typedef struct { | 216 | index XXXXXXX..XXXXXXX 100644 |
142 | Notifier machine_done; | 217 | --- a/include/hw/arm/xlnx-versal.h |
143 | DeviceState *platform_bus_dev; | 218 | +++ b/include/hw/arm/xlnx-versal.h |
144 | FWCfgState *fw_cfg; | 219 | @@ -XXX,XX +XXX,XX @@ |
145 | + PFlashCFI01 *flash[2]; | 220 | #define XLNX_VERSAL_H |
146 | bool secure; | 221 | |
147 | bool highmem; | 222 | #include "hw/sysbus.h" |
148 | bool highmem_ecam; | 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" | ||
332 | diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c | ||
333 | index XXXXXXX..XXXXXXX 100644 | ||
334 | --- a/hw/arm/highbank.c | ||
335 | +++ b/hw/arm/highbank.c | ||
336 | @@ -XXX,XX +XXX,XX @@ | ||
337 | #include "qemu/osdep.h" | ||
338 | #include "qapi/error.h" | ||
339 | #include "hw/sysbus.h" | ||
340 | -#include "hw/arm/arm.h" | ||
341 | +#include "hw/arm/boot.h" | ||
342 | #include "hw/loader.h" | ||
343 | #include "net/net.h" | ||
344 | #include "sysemu/kvm.h" | ||
345 | diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c | ||
346 | index XXXXXXX..XXXXXXX 100644 | ||
347 | --- a/hw/arm/integratorcp.c | ||
348 | +++ b/hw/arm/integratorcp.c | ||
349 | @@ -XXX,XX +XXX,XX @@ | ||
350 | #include "cpu.h" | ||
351 | #include "hw/sysbus.h" | ||
352 | #include "hw/boards.h" | ||
353 | -#include "hw/arm/arm.h" | ||
354 | +#include "hw/arm/boot.h" | ||
355 | #include "hw/misc/arm_integrator_debug.h" | ||
356 | #include "hw/net/smc91c111.h" | ||
357 | #include "net/net.h" | ||
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) | ||
473 | { | ||
474 | diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c | ||
475 | index XXXXXXX..XXXXXXX 100644 | ||
476 | --- a/hw/arm/nrf51_soc.c | ||
477 | +++ b/hw/arm/nrf51_soc.c | ||
478 | @@ -XXX,XX +XXX,XX @@ | ||
479 | #include "qemu/osdep.h" | ||
480 | #include "qapi/error.h" | ||
481 | #include "qemu-common.h" | ||
482 | -#include "hw/arm/arm.h" | ||
483 | +#include "hw/arm/boot.h" | ||
484 | #include "hw/sysbus.h" | ||
485 | #include "hw/boards.h" | ||
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" | ||
149 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | 669 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c |
150 | index XXXXXXX..XXXXXXX 100644 | 670 | index XXXXXXX..XXXXXXX 100644 |
151 | --- a/hw/arm/virt.c | 671 | --- a/hw/arm/virt.c |
152 | +++ b/hw/arm/virt.c | 672 | +++ b/hw/arm/virt.c |
153 | @@ -XXX,XX +XXX,XX @@ | 673 | @@ -XXX,XX +XXX,XX @@ |
154 | 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 @@ | ||
155 | #include "qemu/osdep.h" | 713 | #include "qemu/osdep.h" |
156 | #include "qemu/units.h" | 714 | #include "hw/hw.h" |
157 | +#include "qemu/option.h" | 715 | #include "hw/arm/pxa.h" |
158 | #include "qapi/error.h" | 716 | -#include "hw/arm/arm.h" |
159 | #include "hw/sysbus.h" | 717 | +#include "hw/arm/boot.h" |
160 | #include "hw/arm/arm.h" | 718 | #include "hw/i2c/i2c.h" |
161 | @@ -XXX,XX +XXX,XX @@ static void create_virtio_devices(const VirtMachineState *vms, qemu_irq *pic) | 719 | #include "hw/ssi/ssi.h" |
162 | } | 720 | #include "hw/boards.h" |
163 | } | ||
164 | |||
165 | -static void create_one_flash(const char *name, hwaddr flashbase, | ||
166 | - hwaddr flashsize, const char *file, | ||
167 | - MemoryRegion *sysmem) | ||
168 | +#define VIRT_FLASH_SECTOR_SIZE (256 * KiB) | ||
169 | + | ||
170 | +static PFlashCFI01 *virt_flash_create1(VirtMachineState *vms, | ||
171 | + const char *name, | ||
172 | + const char *alias_prop_name) | ||
173 | { | ||
174 | - /* Create and map a single flash device. We use the same | ||
175 | - * parameters as the flash devices on the Versatile Express board. | ||
176 | + /* | ||
177 | + * Create a single flash device. We use the same parameters as | ||
178 | + * the flash devices on the Versatile Express board. | ||
179 | */ | ||
180 | - DriveInfo *dinfo = drive_get_next(IF_PFLASH); | ||
181 | DeviceState *dev = qdev_create(NULL, TYPE_PFLASH_CFI01); | ||
182 | - SysBusDevice *sbd = SYS_BUS_DEVICE(dev); | ||
183 | - const uint64_t sectorlength = 256 * 1024; | ||
184 | |||
185 | - if (dinfo) { | ||
186 | - qdev_prop_set_drive(dev, "drive", blk_by_legacy_dinfo(dinfo), | ||
187 | - &error_abort); | ||
188 | - } | ||
189 | - | ||
190 | - qdev_prop_set_uint32(dev, "num-blocks", flashsize / sectorlength); | ||
191 | - qdev_prop_set_uint64(dev, "sector-length", sectorlength); | ||
192 | + qdev_prop_set_uint64(dev, "sector-length", VIRT_FLASH_SECTOR_SIZE); | ||
193 | qdev_prop_set_uint8(dev, "width", 4); | ||
194 | qdev_prop_set_uint8(dev, "device-width", 2); | ||
195 | qdev_prop_set_bit(dev, "big-endian", false); | ||
196 | @@ -XXX,XX +XXX,XX @@ static void create_one_flash(const char *name, hwaddr flashbase, | ||
197 | qdev_prop_set_uint16(dev, "id2", 0x00); | ||
198 | qdev_prop_set_uint16(dev, "id3", 0x00); | ||
199 | qdev_prop_set_string(dev, "name", name); | ||
200 | - qdev_init_nofail(dev); | ||
201 | - | ||
202 | - memory_region_add_subregion(sysmem, flashbase, | ||
203 | - sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0)); | ||
204 | - | ||
205 | - if (file) { | ||
206 | - char *fn; | ||
207 | - int image_size; | ||
208 | - | ||
209 | - if (drive_get(IF_PFLASH, 0, 0)) { | ||
210 | - error_report("The contents of the first flash device may be " | ||
211 | - "specified with -bios or with -drive if=pflash... " | ||
212 | - "but you cannot use both options at once"); | ||
213 | - exit(1); | ||
214 | - } | ||
215 | - fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, file); | ||
216 | - if (!fn) { | ||
217 | - error_report("Could not find ROM image '%s'", file); | ||
218 | - exit(1); | ||
219 | - } | ||
220 | - image_size = load_image_mr(fn, sysbus_mmio_get_region(sbd, 0)); | ||
221 | - g_free(fn); | ||
222 | - if (image_size < 0) { | ||
223 | - error_report("Could not load ROM image '%s'", file); | ||
224 | - exit(1); | ||
225 | - } | ||
226 | - } | ||
227 | + object_property_add_child(OBJECT(vms), name, OBJECT(dev), | ||
228 | + &error_abort); | ||
229 | + object_property_add_alias(OBJECT(vms), alias_prop_name, | ||
230 | + OBJECT(dev), "drive", &error_abort); | ||
231 | + return PFLASH_CFI01(dev); | ||
232 | } | ||
233 | |||
234 | -static void create_flash(const VirtMachineState *vms, | ||
235 | - MemoryRegion *sysmem, | ||
236 | - MemoryRegion *secure_sysmem) | ||
237 | +static void virt_flash_create(VirtMachineState *vms) | ||
238 | { | ||
239 | - /* Create two flash devices to fill the VIRT_FLASH space in the memmap. | ||
240 | - * Any file passed via -bios goes in the first of these. | ||
241 | + vms->flash[0] = virt_flash_create1(vms, "virt.flash0", "pflash0"); | ||
242 | + vms->flash[1] = virt_flash_create1(vms, "virt.flash1", "pflash1"); | ||
243 | +} | ||
244 | + | ||
245 | +static void virt_flash_map1(PFlashCFI01 *flash, | ||
246 | + hwaddr base, hwaddr size, | ||
247 | + MemoryRegion *sysmem) | ||
248 | +{ | ||
249 | + DeviceState *dev = DEVICE(flash); | ||
250 | + | ||
251 | + assert(size % VIRT_FLASH_SECTOR_SIZE == 0); | ||
252 | + assert(size / VIRT_FLASH_SECTOR_SIZE <= UINT32_MAX); | ||
253 | + qdev_prop_set_uint32(dev, "num-blocks", size / VIRT_FLASH_SECTOR_SIZE); | ||
254 | + qdev_init_nofail(dev); | ||
255 | + | ||
256 | + memory_region_add_subregion(sysmem, base, | ||
257 | + sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), | ||
258 | + 0)); | ||
259 | +} | ||
260 | + | ||
261 | +static void virt_flash_map(VirtMachineState *vms, | ||
262 | + MemoryRegion *sysmem, | ||
263 | + MemoryRegion *secure_sysmem) | ||
264 | +{ | ||
265 | + /* | ||
266 | + * Map two flash devices to fill the VIRT_FLASH space in the memmap. | ||
267 | * sysmem is the system memory space. secure_sysmem is the secure view | ||
268 | * of the system, and the first flash device should be made visible only | ||
269 | * there. The second flash device is visible to both secure and nonsecure. | ||
270 | @@ -XXX,XX +XXX,XX @@ static void create_flash(const VirtMachineState *vms, | ||
271 | */ | ||
272 | hwaddr flashsize = vms->memmap[VIRT_FLASH].size / 2; | ||
273 | hwaddr flashbase = vms->memmap[VIRT_FLASH].base; | ||
274 | - char *nodename; | ||
275 | |||
276 | - create_one_flash("virt.flash0", flashbase, flashsize, | ||
277 | - bios_name, secure_sysmem); | ||
278 | - create_one_flash("virt.flash1", flashbase + flashsize, flashsize, | ||
279 | - NULL, sysmem); | ||
280 | + virt_flash_map1(vms->flash[0], flashbase, flashsize, | ||
281 | + secure_sysmem); | ||
282 | + virt_flash_map1(vms->flash[1], flashbase + flashsize, flashsize, | ||
283 | + sysmem); | ||
284 | +} | ||
285 | + | ||
286 | +static void virt_flash_fdt(VirtMachineState *vms, | ||
287 | + MemoryRegion *sysmem, | ||
288 | + MemoryRegion *secure_sysmem) | ||
289 | +{ | ||
290 | + hwaddr flashsize = vms->memmap[VIRT_FLASH].size / 2; | ||
291 | + hwaddr flashbase = vms->memmap[VIRT_FLASH].base; | ||
292 | + char *nodename; | ||
293 | |||
294 | if (sysmem == secure_sysmem) { | ||
295 | /* Report both flash devices as a single node in the DT */ | ||
296 | @@ -XXX,XX +XXX,XX @@ static void create_flash(const VirtMachineState *vms, | ||
297 | qemu_fdt_setprop_cell(vms->fdt, nodename, "bank-width", 4); | ||
298 | g_free(nodename); | ||
299 | } else { | ||
300 | - /* Report the devices as separate nodes so we can mark one as | ||
301 | + /* | ||
302 | + * Report the devices as separate nodes so we can mark one as | ||
303 | * only visible to the secure world. | ||
304 | */ | ||
305 | nodename = g_strdup_printf("/secflash@%" PRIx64, flashbase); | ||
306 | @@ -XXX,XX +XXX,XX @@ static void create_flash(const VirtMachineState *vms, | ||
307 | } | ||
308 | } | ||
309 | |||
310 | +static bool virt_firmware_init(VirtMachineState *vms, | ||
311 | + MemoryRegion *sysmem, | ||
312 | + MemoryRegion *secure_sysmem) | ||
313 | +{ | ||
314 | + int i; | ||
315 | + BlockBackend *pflash_blk0; | ||
316 | + | ||
317 | + /* Map legacy -drive if=pflash to machine properties */ | ||
318 | + for (i = 0; i < ARRAY_SIZE(vms->flash); i++) { | ||
319 | + pflash_cfi01_legacy_drive(vms->flash[i], | ||
320 | + drive_get(IF_PFLASH, 0, i)); | ||
321 | + } | ||
322 | + | ||
323 | + virt_flash_map(vms, sysmem, secure_sysmem); | ||
324 | + | ||
325 | + pflash_blk0 = pflash_cfi01_get_blk(vms->flash[0]); | ||
326 | + | ||
327 | + if (bios_name) { | ||
328 | + char *fname; | ||
329 | + MemoryRegion *mr; | ||
330 | + int image_size; | ||
331 | + | ||
332 | + if (pflash_blk0) { | ||
333 | + error_report("The contents of the first flash device may be " | ||
334 | + "specified with -bios or with -drive if=pflash... " | ||
335 | + "but you cannot use both options at once"); | ||
336 | + exit(1); | ||
337 | + } | ||
338 | + | ||
339 | + /* Fall back to -bios */ | ||
340 | + | ||
341 | + fname = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); | ||
342 | + if (!fname) { | ||
343 | + error_report("Could not find ROM image '%s'", bios_name); | ||
344 | + exit(1); | ||
345 | + } | ||
346 | + mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(vms->flash[0]), 0); | ||
347 | + image_size = load_image_mr(fname, mr); | ||
348 | + g_free(fname); | ||
349 | + if (image_size < 0) { | ||
350 | + error_report("Could not load ROM image '%s'", bios_name); | ||
351 | + exit(1); | ||
352 | + } | ||
353 | + } | ||
354 | + | ||
355 | + return pflash_blk0 || bios_name; | ||
356 | +} | ||
357 | + | ||
358 | static FWCfgState *create_fw_cfg(const VirtMachineState *vms, AddressSpace *as) | ||
359 | { | ||
360 | hwaddr base = vms->memmap[VIRT_FW_CFG].base; | ||
361 | @@ -XXX,XX +XXX,XX @@ static void machvirt_init(MachineState *machine) | ||
362 | MemoryRegion *secure_sysmem = NULL; | ||
363 | int n, virt_max_cpus; | ||
364 | MemoryRegion *ram = g_new(MemoryRegion, 1); | ||
365 | - bool firmware_loaded = bios_name || drive_get(IF_PFLASH, 0, 0); | ||
366 | + bool firmware_loaded; | ||
367 | bool aarch64 = true; | ||
368 | |||
369 | /* | ||
370 | @@ -XXX,XX +XXX,XX @@ static void machvirt_init(MachineState *machine) | ||
371 | exit(1); | ||
372 | } | ||
373 | |||
374 | + if (vms->secure) { | ||
375 | + if (kvm_enabled()) { | ||
376 | + error_report("mach-virt: KVM does not support Security extensions"); | ||
377 | + exit(1); | ||
378 | + } | ||
379 | + | ||
380 | + /* | ||
381 | + * The Secure view of the world is the same as the NonSecure, | ||
382 | + * but with a few extra devices. Create it as a container region | ||
383 | + * containing the system memory at low priority; any secure-only | ||
384 | + * devices go in at higher priority and take precedence. | ||
385 | + */ | ||
386 | + secure_sysmem = g_new(MemoryRegion, 1); | ||
387 | + memory_region_init(secure_sysmem, OBJECT(machine), "secure-memory", | ||
388 | + UINT64_MAX); | ||
389 | + memory_region_add_subregion_overlap(secure_sysmem, 0, sysmem, -1); | ||
390 | + } | ||
391 | + | ||
392 | + firmware_loaded = virt_firmware_init(vms, sysmem, | ||
393 | + secure_sysmem ?: sysmem); | ||
394 | + | ||
395 | /* If we have an EL3 boot ROM then the assumption is that it will | ||
396 | * implement PSCI itself, so disable QEMU's internal implementation | ||
397 | * so it doesn't get in the way. Instead of starting secondary | ||
398 | @@ -XXX,XX +XXX,XX @@ static void machvirt_init(MachineState *machine) | ||
399 | exit(1); | ||
400 | } | ||
401 | |||
402 | - if (vms->secure) { | ||
403 | - if (kvm_enabled()) { | ||
404 | - error_report("mach-virt: KVM does not support Security extensions"); | ||
405 | - exit(1); | ||
406 | - } | ||
407 | - | ||
408 | - /* The Secure view of the world is the same as the NonSecure, | ||
409 | - * but with a few extra devices. Create it as a container region | ||
410 | - * containing the system memory at low priority; any secure-only | ||
411 | - * devices go in at higher priority and take precedence. | ||
412 | - */ | ||
413 | - secure_sysmem = g_new(MemoryRegion, 1); | ||
414 | - memory_region_init(secure_sysmem, OBJECT(machine), "secure-memory", | ||
415 | - UINT64_MAX); | ||
416 | - memory_region_add_subregion_overlap(secure_sysmem, 0, sysmem, -1); | ||
417 | - } | ||
418 | - | ||
419 | create_fdt(vms); | ||
420 | |||
421 | possible_cpus = mc->possible_cpu_arch_ids(machine); | ||
422 | @@ -XXX,XX +XXX,XX @@ static void machvirt_init(MachineState *machine) | ||
423 | &machine->device_memory->mr); | ||
424 | } | ||
425 | |||
426 | - create_flash(vms, sysmem, secure_sysmem ? secure_sysmem : sysmem); | ||
427 | + virt_flash_fdt(vms, sysmem, secure_sysmem); | ||
428 | |||
429 | create_gic(vms, pic); | ||
430 | |||
431 | @@ -XXX,XX +XXX,XX @@ static void virt_instance_init(Object *obj) | ||
432 | NULL); | ||
433 | |||
434 | vms->irqmap = a15irqmap; | ||
435 | + | ||
436 | + virt_flash_create(vms); | ||
437 | } | ||
438 | |||
439 | static const TypeInfo virt_machine_info = { | ||
440 | -- | 721 | -- |
441 | 2.20.1 | 722 | 2.20.1 |
442 | 723 | ||
443 | 724 | diff view generated by jsdifflib |
1 | In the M-profile architecture, if the CPU implements the DSP extension | 1 | In ich_vmcr_write() we enforce "writes of BPR fields to less than |
---|---|---|---|
2 | then the XPSR has GE bits, in the same way as the A-profile CPSR. When | 2 | their minimum sets them to the minimum" by doing a "read vbpr and |
3 | we added DSP extension support we forgot to add support for reading | 3 | write it back" operation. A typo here meant that we weren't handling |
4 | and writing the GE bits, which are stored in env->GE. We did put in | 4 | writes to these fields correctly, because we were reading from VBPR0 |
5 | the code to add XPSR_GE to the mask of bits to update in the v7m_msr | 5 | but writing to VBPR1. |
6 | helper, but forgot it in v7m_mrs. We also must not allow the XPSR we | ||
7 | pull off the stack on exception return to set the nonexistent GE bits. | ||
8 | Correct these errors: | ||
9 | * read and write env->GE in xpsr_read() and xpsr_write() | ||
10 | * only set GE bits on exception return if DSP present | ||
11 | * read GE bits for MRS if DSP present | ||
12 | 6 | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
14 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
15 | Message-id: 20190430131439.25251-5-peter.maydell@linaro.org | 9 | Message-id: 20190520162809.2677-4-peter.maydell@linaro.org |
16 | --- | 10 | --- |
17 | target/arm/cpu.h | 4 ++++ | 11 | hw/intc/arm_gicv3_cpuif.c | 2 +- |
18 | target/arm/helper.c | 12 ++++++++++-- | 12 | 1 file changed, 1 insertion(+), 1 deletion(-) |
19 | 2 files changed, 14 insertions(+), 2 deletions(-) | ||
20 | 13 | ||
21 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | 14 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c |
22 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
23 | --- a/target/arm/cpu.h | 16 | --- a/hw/intc/arm_gicv3_cpuif.c |
24 | +++ b/target/arm/cpu.h | 17 | +++ b/hw/intc/arm_gicv3_cpuif.c |
25 | @@ -XXX,XX +XXX,XX @@ static inline uint32_t xpsr_read(CPUARMState *env) | 18 | @@ -XXX,XX +XXX,XX @@ static void ich_vmcr_write(CPUARMState *env, const ARMCPRegInfo *ri, |
26 | | (env->CF << 29) | ((env->VF & 0x80000000) >> 3) | (env->QF << 27) | 19 | /* Enforce "writing BPRs to less than minimum sets them to the minimum" |
27 | | (env->thumb << 24) | ((env->condexec_bits & 3) << 25) | 20 | * by reading and writing back the fields. |
28 | | ((env->condexec_bits & 0xfc) << 8) | 21 | */ |
29 | + | (env->GE << 16) | 22 | - write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G0)); |
30 | | env->v7m.exception; | 23 | + write_vbpr(cs, GICV3_G0, read_vbpr(cs, GICV3_G0)); |
31 | } | 24 | write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G1)); |
32 | 25 | ||
33 | @@ -XXX,XX +XXX,XX @@ static inline void xpsr_write(CPUARMState *env, uint32_t val, uint32_t mask) | 26 | gicv3_cpuif_virt_update(cs); |
34 | if (mask & XPSR_Q) { | ||
35 | env->QF = ((val & XPSR_Q) != 0); | ||
36 | } | ||
37 | + if (mask & XPSR_GE) { | ||
38 | + env->GE = (val & XPSR_GE) >> 16; | ||
39 | + } | ||
40 | if (mask & XPSR_T) { | ||
41 | env->thumb = ((val & XPSR_T) != 0); | ||
42 | } | ||
43 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
44 | index XXXXXXX..XXXXXXX 100644 | ||
45 | --- a/target/arm/helper.c | ||
46 | +++ b/target/arm/helper.c | ||
47 | @@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu) | ||
48 | { | ||
49 | CPUARMState *env = &cpu->env; | ||
50 | uint32_t excret; | ||
51 | - uint32_t xpsr; | ||
52 | + uint32_t xpsr, xpsr_mask; | ||
53 | bool ufault = false; | ||
54 | bool sfault = false; | ||
55 | bool return_to_sp_process; | ||
56 | @@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu) | ||
57 | } | ||
58 | *frame_sp_p = frameptr; | ||
59 | } | ||
60 | + | ||
61 | + xpsr_mask = ~(XPSR_SPREALIGN | XPSR_SFPA); | ||
62 | + if (!arm_feature(env, ARM_FEATURE_THUMB_DSP)) { | ||
63 | + xpsr_mask &= ~XPSR_GE; | ||
64 | + } | ||
65 | /* This xpsr_write() will invalidate frame_sp_p as it may switch stack */ | ||
66 | - xpsr_write(env, xpsr, ~(XPSR_SPREALIGN | XPSR_SFPA)); | ||
67 | + xpsr_write(env, xpsr, xpsr_mask); | ||
68 | |||
69 | if (env->v7m.secure) { | ||
70 | bool sfpa = xpsr & XPSR_SFPA; | ||
71 | @@ -XXX,XX +XXX,XX @@ uint32_t HELPER(v7m_mrs)(CPUARMState *env, uint32_t reg) | ||
72 | } | ||
73 | if (!(reg & 4)) { | ||
74 | mask |= XPSR_NZCV | XPSR_Q; /* APSR */ | ||
75 | + if (arm_feature(env, ARM_FEATURE_THUMB_DSP)) { | ||
76 | + mask |= XPSR_GE; | ||
77 | + } | ||
78 | } | ||
79 | /* EPSR reads as zero */ | ||
80 | return xpsr_read(env) & mask; | ||
81 | -- | 27 | -- |
82 | 2.20.1 | 28 | 2.20.1 |
83 | 29 | ||
84 | 30 | diff view generated by jsdifflib |
1 | The M-profile architecture specifies that the DebugMonitor exception | 1 | The ICC_CTLR_EL3 register includes some bits which are aliases |
---|---|---|---|
2 | should be initially disabled, not enabled. It should be controlled | 2 | of bits in the ICC_CTLR_EL1(S) and (NS) registers. QEMU chooses |
3 | by the DEMCR register's MON_EN bit, but we don't implement that | 3 | to keep those bits in the cs->icc_ctlr_el1[] struct fields. |
4 | register yet (like most of the debug architecture for M-profile). | 4 | Unfortunately a missing '~' in the code to update the bits |
5 | 5 | in those fields meant that writing to ICC_CTLR_EL3 would corrupt | |
6 | Note that BKPT instructions will still work, because they | 6 | the ICC_CLTR_EL1 register values. |
7 | will be escalated to HardFault. | ||
8 | 7 | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 9 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
11 | Message-id: 20190430131439.25251-4-peter.maydell@linaro.org | 10 | Message-id: 20190520162809.2677-5-peter.maydell@linaro.org |
12 | --- | 11 | --- |
13 | hw/intc/armv7m_nvic.c | 4 +++- | 12 | hw/intc/arm_gicv3_cpuif.c | 4 ++-- |
14 | 1 file changed, 3 insertions(+), 1 deletion(-) | 13 | 1 file changed, 2 insertions(+), 2 deletions(-) |
15 | 14 | ||
16 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c | 15 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c |
17 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
18 | --- a/hw/intc/armv7m_nvic.c | 17 | --- a/hw/intc/arm_gicv3_cpuif.c |
19 | +++ b/hw/intc/armv7m_nvic.c | 18 | +++ b/hw/intc/arm_gicv3_cpuif.c |
20 | @@ -XXX,XX +XXX,XX @@ static void armv7m_nvic_reset(DeviceState *dev) | 19 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, |
21 | * the System Handler Control register | 20 | trace_gicv3_icc_ctlr_el3_write(gicv3_redist_affid(cs), value); |
22 | */ | 21 | |
23 | s->vectors[ARMV7M_EXCP_SVC].enabled = 1; | 22 | /* *_EL1NS and *_EL1S bits are aliases into the ICC_CTLR_EL1 bits. */ |
24 | - s->vectors[ARMV7M_EXCP_DEBUG].enabled = 1; | 23 | - cs->icc_ctlr_el1[GICV3_NS] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); |
25 | s->vectors[ARMV7M_EXCP_PENDSV].enabled = 1; | 24 | + cs->icc_ctlr_el1[GICV3_NS] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); |
26 | s->vectors[ARMV7M_EXCP_SYSTICK].enabled = 1; | 25 | if (value & ICC_CTLR_EL3_EOIMODE_EL1NS) { |
27 | 26 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_EOIMODE; | |
28 | + /* DebugMonitor is enabled via DEMCR.MON_EN */ | 27 | } |
29 | + s->vectors[ARMV7M_EXCP_DEBUG].enabled = 0; | 28 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, |
30 | + | 29 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_CBPR; |
31 | resetprio = arm_feature(&s->cpu->env, ARM_FEATURE_V8) ? -4 : -3; | 30 | } |
32 | s->vectors[ARMV7M_EXCP_RESET].prio = resetprio; | 31 | |
33 | s->vectors[ARMV7M_EXCP_NMI].prio = -2; | 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 | } | ||
34 | -- | 37 | -- |
35 | 2.20.1 | 38 | 2.20.1 |
36 | 39 | ||
37 | 40 | diff view generated by jsdifflib |
1 | From: Cao Jiaxi <driver1998@foxmail.com> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | The win2qemu[] is supposed to be the conversion table to convert between | 3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
4 | STORAGE_BUS_TYPE in Windows SDK and GuestDiskBusType in qga. | 4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> |
5 | 5 | Message-id: 20190520214342.13709-2-philmd@redhat.com | |
6 | But it was incorrectly written that it forces to set a GuestDiskBusType | ||
7 | value to STORAGE_BUS_TYPE, which generates an enum conversion warning in clang. | ||
8 | |||
9 | Suggested-by: Eric Blake <eblake@redhat.com> | ||
10 | Signed-off-by: Cao Jiaxi <driver1998@foxmail.com> | ||
11 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
12 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
13 | Message-id: 20190503003650.10137-1-driver1998@foxmail.com | ||
14 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
15 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
16 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
17 | --- | 7 | --- |
18 | qga/commands-win32.c | 2 +- | 8 | hw/arm/exynos4_boards.c | 24 ------------------------ |
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | 9 | 1 file changed, 24 deletions(-) |
20 | 10 | ||
21 | diff --git a/qga/commands-win32.c b/qga/commands-win32.c | 11 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c |
22 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
23 | --- a/qga/commands-win32.c | 13 | --- a/hw/arm/exynos4_boards.c |
24 | +++ b/qga/commands-win32.c | 14 | +++ b/hw/arm/exynos4_boards.c |
25 | @@ -XXX,XX +XXX,XX @@ void qmp_guest_file_flush(int64_t handle, Error **errp) | 15 | @@ -XXX,XX +XXX,XX @@ |
26 | 16 | #include "hw/net/lan9118.h" | |
27 | #ifdef CONFIG_QGA_NTDDSCSI | 17 | #include "hw/boards.h" |
28 | 18 | ||
29 | -static STORAGE_BUS_TYPE win2qemu[] = { | 19 | -#undef DEBUG |
30 | +static GuestDiskBusType win2qemu[] = { | 20 | - |
31 | [BusTypeUnknown] = GUEST_DISK_BUS_TYPE_UNKNOWN, | 21 | -//#define DEBUG |
32 | [BusTypeScsi] = GUEST_DISK_BUS_TYPE_SCSI, | 22 | - |
33 | [BusTypeAtapi] = GUEST_DISK_BUS_TYPE_IDE, | 23 | -#ifdef DEBUG |
24 | - #undef PRINT_DEBUG | ||
25 | - #define PRINT_DEBUG(fmt, args...) \ | ||
26 | - do { \ | ||
27 | - fprintf(stderr, " [%s:%d] "fmt, __func__, __LINE__, ##args); \ | ||
28 | - } while (0) | ||
29 | -#else | ||
30 | - #define PRINT_DEBUG(fmt, args...) do {} while (0) | ||
31 | -#endif | ||
32 | - | ||
33 | #define SMDK_LAN9118_BASE_ADDR 0x05000000 | ||
34 | |||
35 | typedef enum Exynos4BoardType { | ||
36 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | ||
37 | exynos4_board_binfo.gic_cpu_if_addr = | ||
38 | EXYNOS4210_SMP_PRIVATE_BASE_ADDR + 0x100; | ||
39 | |||
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]); | ||
52 | |||
34 | -- | 53 | -- |
35 | 2.20.1 | 54 | 2.20.1 |
36 | 55 | ||
37 | 56 | diff view generated by jsdifflib |
1 | The Raspberry Pi boards have a physical memory map which does | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | not allow for more than 1GB of RAM. Currently if the user tries | ||
3 | to ask for more then we fail in a confusing way: | ||
4 | 2 | ||
5 | $ qemu-system-aarch64 --machine raspi3 -m 8G | 3 | It eases code review, unit is explicit. |
6 | Unexpected error in visit_type_uintN() at qapi/qapi-visit-core.c:164: | ||
7 | qemu-system-aarch64: Parameter 'vcram-base' expects uint32_t | ||
8 | Aborted (core dumped) | ||
9 | 4 | ||
10 | Catch this earlier and diagnose it with a more friendly message: | 5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
11 | $ qemu-system-aarch64 --machine raspi3 -m 8G | 6 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> |
12 | qemu-system-aarch64: Requested ram size is too large for this machine: maximum is 1GB | 7 | Message-id: 20190520214342.13709-3-philmd@redhat.com |
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | ||
10 | hw/arm/exynos4_boards.c | 5 +++-- | ||
11 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
13 | 12 | ||
14 | Fixes: https://bugs.launchpad.net/qemu/+bug/1794187 | 13 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c |
15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
16 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
17 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
18 | Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> | ||
19 | --- | ||
20 | hw/arm/raspi.c | 7 +++++++ | ||
21 | 1 file changed, 7 insertions(+) | ||
22 | |||
23 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c | ||
24 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
25 | --- a/hw/arm/raspi.c | 15 | --- a/hw/arm/exynos4_boards.c |
26 | +++ b/hw/arm/raspi.c | 16 | +++ b/hw/arm/exynos4_boards.c |
27 | @@ -XXX,XX +XXX,XX @@ | 17 | @@ -XXX,XX +XXX,XX @@ |
28 | */ | 18 | */ |
29 | 19 | ||
30 | #include "qemu/osdep.h" | 20 | #include "qemu/osdep.h" |
31 | +#include "qemu/units.h" | 21 | +#include "qemu/units.h" |
32 | #include "qapi/error.h" | 22 | #include "qapi/error.h" |
23 | #include "qemu/error-report.h" | ||
33 | #include "qemu-common.h" | 24 | #include "qemu-common.h" |
34 | #include "cpu.h" | 25 | @@ -XXX,XX +XXX,XX @@ static int exynos4_board_smp_bootreg_addr[EXYNOS4_NUM_OF_BOARDS] = { |
35 | @@ -XXX,XX +XXX,XX @@ static void raspi_init(MachineState *machine, int version) | 26 | }; |
36 | BusState *bus; | 27 | |
37 | DeviceState *carddev; | 28 | static unsigned long exynos4_board_ram_size[EXYNOS4_NUM_OF_BOARDS] = { |
38 | 29 | - [EXYNOS4_BOARD_NURI] = 0x40000000, | |
39 | + if (machine->ram_size > 1 * GiB) { | 30 | - [EXYNOS4_BOARD_SMDKC210] = 0x40000000, |
40 | + error_report("Requested ram size is too large for this machine: " | 31 | + [EXYNOS4_BOARD_NURI] = 1 * GiB, |
41 | + "maximum is 1GB"); | 32 | + [EXYNOS4_BOARD_SMDKC210] = 1 * GiB, |
42 | + exit(1); | 33 | }; |
43 | + } | 34 | |
44 | + | 35 | static struct arm_boot_info exynos4_board_binfo = { |
45 | object_initialize(&s->soc, sizeof(s->soc), | ||
46 | version == 3 ? TYPE_BCM2837 : TYPE_BCM2836); | ||
47 | object_property_add_child(OBJECT(machine), "soc", OBJECT(&s->soc), | ||
48 | -- | 36 | -- |
49 | 2.20.1 | 37 | 2.20.1 |
50 | 38 | ||
51 | 39 | diff view generated by jsdifflib |
1 | From: Joel Stanley <joel@jms.id.au> | 1 | From: Guenter Roeck <linux@roeck-us.net> |
---|---|---|---|
2 | 2 | ||
3 | We currently use Qemu's default of 128MB. As we know how much ram each | 3 | QEMU already supports pl330. Instantiate it for Exynos4210. |
4 | machine ships with, make it easier on users by setting a default. | ||
5 | 4 | ||
6 | It can still be overridden with -m on the command line. | 5 | Relevant part of Linux arch/arm/boot/dts/exynos4.dtsi: |
7 | 6 | ||
8 | Signed-off-by: Joel Stanley <joel@jms.id.au> | 7 | / { |
9 | Reviewed-by: Andrew Jeffery <andrew@aj.id.au> | 8 | soc: soc { |
10 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 9 | amba { |
11 | Message-id: 20190503022958.1394-1-joel@jms.id.au | 10 | pdma0: pdma@12680000 { |
11 | compatible = "arm,pl330", "arm,primecell"; | ||
12 | reg = <0x12680000 0x1000>; | ||
13 | interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; | ||
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> | ||
12 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 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> | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 54 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
14 | --- | 55 | --- |
15 | include/hw/arm/aspeed.h | 1 + | 56 | hw/arm/exynos4210.c | 26 ++++++++++++++++++++++++++ |
16 | hw/arm/aspeed.c | 8 ++++++++ | 57 | 1 file changed, 26 insertions(+) |
17 | 2 files changed, 9 insertions(+) | ||
18 | 58 | ||
19 | diff --git a/include/hw/arm/aspeed.h b/include/hw/arm/aspeed.h | 59 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c |
20 | index XXXXXXX..XXXXXXX 100644 | 60 | index XXXXXXX..XXXXXXX 100644 |
21 | --- a/include/hw/arm/aspeed.h | 61 | --- a/hw/arm/exynos4210.c |
22 | +++ b/include/hw/arm/aspeed.h | 62 | +++ b/hw/arm/exynos4210.c |
23 | @@ -XXX,XX +XXX,XX @@ typedef struct AspeedBoardConfig { | ||
24 | const char *spi_model; | ||
25 | uint32_t num_cs; | ||
26 | void (*i2c_init)(AspeedBoardState *bmc); | ||
27 | + uint32_t ram; | ||
28 | } AspeedBoardConfig; | ||
29 | |||
30 | #define TYPE_ASPEED_MACHINE MACHINE_TYPE_NAME("aspeed") | ||
31 | diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c | ||
32 | index XXXXXXX..XXXXXXX 100644 | ||
33 | --- a/hw/arm/aspeed.c | ||
34 | +++ b/hw/arm/aspeed.c | ||
35 | @@ -XXX,XX +XXX,XX @@ | 63 | @@ -XXX,XX +XXX,XX @@ |
36 | #include "sysemu/block-backend.h" | 64 | /* EHCI */ |
37 | #include "hw/loader.h" | 65 | #define EXYNOS4210_EHCI_BASE_ADDR 0x12580000 |
38 | #include "qemu/error-report.h" | 66 | |
39 | +#include "qemu/units.h" | 67 | +/* DMA */ |
40 | 68 | +#define EXYNOS4210_PL330_BASE0_ADDR 0x12680000 | |
41 | static struct arm_boot_info aspeed_board_binfo = { | 69 | +#define EXYNOS4210_PL330_BASE1_ADDR 0x12690000 |
42 | .board_id = -1, /* device-tree-only board */ | 70 | +#define EXYNOS4210_PL330_BASE2_ADDR 0x12850000 |
43 | @@ -XXX,XX +XXX,XX @@ static void aspeed_machine_class_init(ObjectClass *oc, void *data) | 71 | + |
44 | mc->no_floppy = 1; | 72 | static uint8_t chipid_and_omr[] = { 0x11, 0x02, 0x21, 0x43, |
45 | mc->no_cdrom = 1; | 73 | 0x09, 0x00, 0x00, 0x00 }; |
46 | mc->no_parallel = 1; | 74 | |
47 | + if (board->ram) { | 75 | @@ -XXX,XX +XXX,XX @@ static uint64_t exynos4210_calc_affinity(int cpu) |
48 | + mc->default_ram_size = board->ram; | 76 | return (0x9 << ARM_AFF1_SHIFT) | cpu; |
49 | + } | ||
50 | amc->board = board; | ||
51 | } | 77 | } |
52 | 78 | ||
53 | @@ -XXX,XX +XXX,XX @@ static const AspeedBoardConfig aspeed_boards[] = { | 79 | +static void pl330_create(uint32_t base, qemu_irq irq, int nreq) |
54 | .spi_model = "mx25l25635e", | 80 | +{ |
55 | .num_cs = 1, | 81 | + SysBusDevice *busdev; |
56 | .i2c_init = palmetto_bmc_i2c_init, | 82 | + DeviceState *dev; |
57 | + .ram = 256 * MiB, | 83 | + |
58 | }, { | 84 | + dev = qdev_create(NULL, "pl330"); |
59 | .name = MACHINE_TYPE_NAME("ast2500-evb"), | 85 | + qdev_prop_set_uint8(dev, "num_periph_req", nreq); |
60 | .desc = "Aspeed AST2500 EVB (ARM1176)", | 86 | + qdev_init_nofail(dev); |
61 | @@ -XXX,XX +XXX,XX @@ static const AspeedBoardConfig aspeed_boards[] = { | 87 | + busdev = SYS_BUS_DEVICE(dev); |
62 | .spi_model = "mx25l25635e", | 88 | + sysbus_mmio_map(busdev, 0, base); |
63 | .num_cs = 1, | 89 | + sysbus_connect_irq(busdev, 0, irq); |
64 | .i2c_init = ast2500_evb_i2c_init, | 90 | +} |
65 | + .ram = 512 * MiB, | 91 | + |
66 | }, { | 92 | Exynos4210State *exynos4210_init(MemoryRegion *system_mem) |
67 | .name = MACHINE_TYPE_NAME("romulus-bmc"), | 93 | { |
68 | .desc = "OpenPOWER Romulus BMC (ARM1176)", | 94 | Exynos4210State *s = g_new0(Exynos4210State, 1); |
69 | @@ -XXX,XX +XXX,XX @@ static const AspeedBoardConfig aspeed_boards[] = { | 95 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) |
70 | .spi_model = "mx66l1g45g", | 96 | sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, |
71 | .num_cs = 2, | 97 | s->irq_table[exynos4210_get_irq(28, 3)]); |
72 | .i2c_init = romulus_bmc_i2c_init, | 98 | |
73 | + .ram = 512 * MiB, | 99 | + /*** DMA controllers ***/ |
74 | }, { | 100 | + pl330_create(EXYNOS4210_PL330_BASE0_ADDR, |
75 | .name = MACHINE_TYPE_NAME("witherspoon-bmc"), | 101 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(35, 1)]), 32); |
76 | .desc = "OpenPOWER Witherspoon BMC (ARM1176)", | 102 | + pl330_create(EXYNOS4210_PL330_BASE1_ADDR, |
77 | @@ -XXX,XX +XXX,XX @@ static const AspeedBoardConfig aspeed_boards[] = { | 103 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); |
78 | .spi_model = "mx66l1g45g", | 104 | + pl330_create(EXYNOS4210_PL330_BASE2_ADDR, |
79 | .num_cs = 2, | 105 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); |
80 | .i2c_init = witherspoon_bmc_i2c_init, | 106 | + |
81 | + .ram = 512 * MiB, | 107 | return s; |
82 | }, | 108 | } |
83 | }; | ||
84 | |||
85 | -- | 109 | -- |
86 | 2.20.1 | 110 | 2.20.1 |
87 | 111 | ||
88 | 112 | diff view generated by jsdifflib |
1 | From: Markus Armbruster <armbru@redhat.com> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Factored out of pc_system_firmware_init() so the next commit can reuse | 3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
4 | it in hw/arm/virt.c. | 4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> |
5 | 5 | Message-id: 20190520214342.13709-5-philmd@redhat.com | |
6 | Signed-off-by: Markus Armbruster <armbru@redhat.com> | ||
7 | Reviewed-by: Laszlo Ersek <lersek@redhat.com> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20190416091348.26075-3-armbru@redhat.com | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 7 | --- |
12 | include/hw/block/flash.h | 1 + | 8 | include/hw/arm/exynos4210.h | 9 +++++++-- |
13 | hw/block/pflash_cfi01.c | 28 ++++++++++++++++++++++++++++ | 9 | hw/arm/exynos4210.c | 28 ++++++++++++++++++++++++---- |
14 | hw/i386/pc_sysfw.c | 16 ++-------------- | 10 | hw/arm/exynos4_boards.c | 9 ++++++--- |
15 | 3 files changed, 31 insertions(+), 14 deletions(-) | 11 | 3 files changed, 37 insertions(+), 9 deletions(-) |
16 | 12 | ||
17 | diff --git a/include/hw/block/flash.h b/include/hw/block/flash.h | 13 | diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h |
18 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/include/hw/block/flash.h | 15 | --- a/include/hw/arm/exynos4210.h |
20 | +++ b/include/hw/block/flash.h | 16 | +++ b/include/hw/arm/exynos4210.h |
21 | @@ -XXX,XX +XXX,XX @@ PFlashCFI01 *pflash_cfi01_register(hwaddr base, | 17 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210Irq { |
22 | int be); | 18 | } Exynos4210Irq; |
23 | BlockBackend *pflash_cfi01_get_blk(PFlashCFI01 *fl); | 19 | |
24 | MemoryRegion *pflash_cfi01_get_memory(PFlashCFI01 *fl); | 20 | typedef struct Exynos4210State { |
25 | +void pflash_cfi01_legacy_drive(PFlashCFI01 *dev, DriveInfo *dinfo); | 21 | + /*< private >*/ |
26 | 22 | + SysBusDevice parent_obj; | |
27 | /* pflash_cfi02.c */ | 23 | + /*< public >*/ |
28 | 24 | ARMCPU *cpu[EXYNOS4210_NCPUS]; | |
29 | diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c | 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 | ||
30 | index XXXXXXX..XXXXXXX 100644 | 44 | index XXXXXXX..XXXXXXX 100644 |
31 | --- a/hw/block/pflash_cfi01.c | 45 | --- a/hw/arm/exynos4210.c |
32 | +++ b/hw/block/pflash_cfi01.c | 46 | +++ b/hw/arm/exynos4210.c |
33 | @@ -XXX,XX +XXX,XX @@ | 47 | @@ -XXX,XX +XXX,XX @@ static void pl330_create(uint32_t base, qemu_irq irq, int nreq) |
34 | #include "qapi/error.h" | 48 | sysbus_connect_irq(busdev, 0, irq); |
35 | #include "qemu/timer.h" | ||
36 | #include "qemu/bitops.h" | ||
37 | +#include "qemu/error-report.h" | ||
38 | #include "qemu/host-utils.h" | ||
39 | #include "qemu/log.h" | ||
40 | +#include "qemu/option.h" | ||
41 | #include "hw/sysbus.h" | ||
42 | +#include "sysemu/blockdev.h" | ||
43 | #include "sysemu/sysemu.h" | ||
44 | #include "trace.h" | ||
45 | |||
46 | @@ -XXX,XX +XXX,XX @@ MemoryRegion *pflash_cfi01_get_memory(PFlashCFI01 *fl) | ||
47 | return &fl->mem; | ||
48 | } | 49 | } |
49 | 50 | ||
50 | +/* | 51 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem) |
51 | + * Handle -drive if=pflash for machines that use properties. | 52 | +static void exynos4210_realize(DeviceState *socdev, Error **errp) |
52 | + * If @dinfo is null, do nothing. | 53 | { |
53 | + * Else if @fl's property "drive" is already set, fatal error. | 54 | - Exynos4210State *s = g_new0(Exynos4210State, 1); |
54 | + * Else set it to the BlockBackend with @dinfo. | 55 | + Exynos4210State *s = EXYNOS4210_SOC(socdev); |
55 | + */ | 56 | + MemoryRegion *system_mem = get_system_memory(); |
56 | +void pflash_cfi01_legacy_drive(PFlashCFI01 *fl, DriveInfo *dinfo) | 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) | ||
57 | +{ | 69 | +{ |
58 | + Location loc; | 70 | + DeviceClass *dc = DEVICE_CLASS(klass); |
59 | + | 71 | + |
60 | + if (!dinfo) { | 72 | + dc->realize = exynos4210_realize; |
61 | + return; | ||
62 | + } | ||
63 | + | ||
64 | + loc_push_none(&loc); | ||
65 | + qemu_opts_loc_restore(dinfo->opts); | ||
66 | + if (fl->blk) { | ||
67 | + error_report("clashes with -machine"); | ||
68 | + exit(1); | ||
69 | + } | ||
70 | + qdev_prop_set_drive(DEVICE(fl), "drive", | ||
71 | + blk_by_legacy_dinfo(dinfo), &error_fatal); | ||
72 | + loc_pop(&loc); | ||
73 | +} | 73 | +} |
74 | + | 74 | + |
75 | static void postload_update_cb(void *opaque, int running, RunState state) | 75 | +static const TypeInfo exynos4210_info = { |
76 | { | 76 | + .name = TYPE_EXYNOS4210_SOC, |
77 | PFlashCFI01 *pfl = opaque; | 77 | + .parent = TYPE_SYS_BUS_DEVICE, |
78 | diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c | 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 | ||
79 | index XXXXXXX..XXXXXXX 100644 | 89 | index XXXXXXX..XXXXXXX 100644 |
80 | --- a/hw/i386/pc_sysfw.c | 90 | --- a/hw/arm/exynos4_boards.c |
81 | +++ b/hw/i386/pc_sysfw.c | 91 | +++ b/hw/arm/exynos4_boards.c |
82 | @@ -XXX,XX +XXX,XX @@ void pc_system_firmware_init(PCMachineState *pcms, | 92 | @@ -XXX,XX +XXX,XX @@ typedef enum Exynos4BoardType { |
83 | { | 93 | } Exynos4BoardType; |
84 | PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); | 94 | |
85 | int i; | 95 | typedef struct Exynos4BoardState { |
86 | - DriveInfo *pflash_drv; | 96 | - Exynos4210State *soc; |
87 | BlockBackend *pflash_blk[ARRAY_SIZE(pcms->flash)]; | 97 | + Exynos4210State soc; |
88 | - Location loc; | 98 | MemoryRegion dram0_mem; |
89 | 99 | MemoryRegion dram1_mem; | |
90 | if (!pcmc->pci_enabled) { | 100 | } Exynos4BoardState; |
91 | old_pc_system_rom_init(rom_memory, true); | 101 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, |
92 | @@ -XXX,XX +XXX,XX @@ void pc_system_firmware_init(PCMachineState *pcms, | 102 | exynos4_boards_init_ram(s, get_system_memory(), |
93 | 103 | exynos4_board_ram_size[board_type]); | |
94 | /* Map legacy -drive if=pflash to machine properties */ | 104 | |
95 | for (i = 0; i < ARRAY_SIZE(pcms->flash); i++) { | 105 | - s->soc = exynos4210_init(get_system_memory()); |
96 | - pflash_drv = drive_get(IF_PFLASH, 0, i); | 106 | + object_initialize(&s->soc, sizeof(s->soc), TYPE_EXYNOS4210_SOC); |
97 | - if (pflash_drv) { | 107 | + qdev_set_parent_bus(DEVICE(&s->soc), sysbus_get_default()); |
98 | - loc_push_none(&loc); | 108 | + object_property_set_bool(OBJECT(&s->soc), true, "realized", |
99 | - qemu_opts_loc_restore(pflash_drv->opts); | 109 | + &error_fatal); |
100 | - if (pflash_cfi01_get_blk(pcms->flash[i])) { | 110 | |
101 | - error_report("clashes with -machine"); | 111 | return s; |
102 | - exit(1); | 112 | } |
103 | - } | 113 | @@ -XXX,XX +XXX,XX @@ static void smdkc210_init(MachineState *machine) |
104 | - qdev_prop_set_drive(DEVICE(pcms->flash[i]), "drive", | 114 | EXYNOS4_BOARD_SMDKC210); |
105 | - blk_by_legacy_dinfo(pflash_drv), &error_fatal); | 115 | |
106 | - loc_pop(&loc); | 116 | lan9215_init(SMDK_LAN9118_BASE_ADDR, |
107 | - } | 117 | - qemu_irq_invert(s->soc->irq_table[exynos4210_get_irq(37, 1)])); |
108 | + pflash_cfi01_legacy_drive(pcms->flash[i], | 118 | + qemu_irq_invert(s->soc.irq_table[exynos4210_get_irq(37, 1)])); |
109 | + drive_get(IF_PFLASH, 0, i)); | 119 | arm_load_kernel(ARM_CPU(first_cpu), &exynos4_board_binfo); |
110 | pflash_blk[i] = pflash_cfi01_get_blk(pcms->flash[i]); | 120 | } |
111 | } | ||
112 | 121 | ||
113 | -- | 122 | -- |
114 | 2.20.1 | 123 | 2.20.1 |
115 | 124 | ||
116 | 125 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Cao Jiaxi <driver1998@foxmail.com> | ||
2 | 1 | ||
3 | gcc_struct is for x86 only, and it generates an warning on ARM64 Clang/MinGW targets. | ||
4 | |||
5 | Signed-off-by: Cao Jiaxi <driver1998@foxmail.com> | ||
6 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
7 | Message-id: 20190503003618.10089-1-driver1998@foxmail.com | ||
8 | [PMM: dropped the slirp change as slirp is now a submodule] | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | contrib/libvhost-user/libvhost-user.h | 2 +- | ||
12 | include/qemu/compiler.h | 2 +- | ||
13 | scripts/cocci-macro-file.h | 7 ++++++- | ||
14 | 3 files changed, 8 insertions(+), 3 deletions(-) | ||
15 | |||
16 | diff --git a/contrib/libvhost-user/libvhost-user.h b/contrib/libvhost-user/libvhost-user.h | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/contrib/libvhost-user/libvhost-user.h | ||
19 | +++ b/contrib/libvhost-user/libvhost-user.h | ||
20 | @@ -XXX,XX +XXX,XX @@ typedef struct VhostUserInflight { | ||
21 | uint16_t queue_size; | ||
22 | } VhostUserInflight; | ||
23 | |||
24 | -#if defined(_WIN32) | ||
25 | +#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) | ||
26 | # define VU_PACKED __attribute__((gcc_struct, packed)) | ||
27 | #else | ||
28 | # define VU_PACKED __attribute__((packed)) | ||
29 | diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h | ||
30 | index XXXXXXX..XXXXXXX 100644 | ||
31 | --- a/include/qemu/compiler.h | ||
32 | +++ b/include/qemu/compiler.h | ||
33 | @@ -XXX,XX +XXX,XX @@ | ||
34 | |||
35 | #define QEMU_SENTINEL __attribute__((sentinel)) | ||
36 | |||
37 | -#if defined(_WIN32) | ||
38 | +#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) | ||
39 | # define QEMU_PACKED __attribute__((gcc_struct, packed)) | ||
40 | #else | ||
41 | # define QEMU_PACKED __attribute__((packed)) | ||
42 | diff --git a/scripts/cocci-macro-file.h b/scripts/cocci-macro-file.h | ||
43 | index XXXXXXX..XXXXXXX 100644 | ||
44 | --- a/scripts/cocci-macro-file.h | ||
45 | +++ b/scripts/cocci-macro-file.h | ||
46 | @@ -XXX,XX +XXX,XX @@ | ||
47 | #define QEMU_NORETURN __attribute__ ((__noreturn__)) | ||
48 | #define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) | ||
49 | #define QEMU_SENTINEL __attribute__((sentinel)) | ||
50 | -#define QEMU_PACKED __attribute__((gcc_struct, packed)) | ||
51 | + | ||
52 | +#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) | ||
53 | +# define QEMU_PACKED __attribute__((gcc_struct, packed)) | ||
54 | +#else | ||
55 | +# define QEMU_PACKED __attribute__((packed)) | ||
56 | +#endif | ||
57 | |||
58 | #define cat(x,y) x ## y | ||
59 | #define cat2(x,y) cat(x,y) | ||
60 | -- | ||
61 | 2.20.1 | ||
62 | |||
63 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Rule R_CQRV says that if two pending interrupts have the same | ||
2 | group priority then ties are broken by looking at the subpriority. | ||
3 | We had a comment describing this but had forgotten to actually | ||
4 | implement the subpriority comparison. Correct the omission. | ||
5 | 1 | ||
6 | (The further tie break rules of "lowest exception number" and | ||
7 | "secure before non-secure" are handled implicitly by the order | ||
8 | in which we iterate through the exceptions in the loops.) | ||
9 | |||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
12 | Message-id: 20190430131439.25251-2-peter.maydell@linaro.org | ||
13 | --- | ||
14 | hw/intc/armv7m_nvic.c | 9 +++++++-- | ||
15 | 1 file changed, 7 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c | ||
18 | index XXXXXXX..XXXXXXX 100644 | ||
19 | --- a/hw/intc/armv7m_nvic.c | ||
20 | +++ b/hw/intc/armv7m_nvic.c | ||
21 | @@ -XXX,XX +XXX,XX @@ static void nvic_recompute_state_secure(NVICState *s) | ||
22 | int active_prio = NVIC_NOEXC_PRIO; | ||
23 | int pend_irq = 0; | ||
24 | bool pending_is_s_banked = false; | ||
25 | + int pend_subprio = 0; | ||
26 | |||
27 | /* R_CQRV: precedence is by: | ||
28 | * - lowest group priority; if both the same then | ||
29 | @@ -XXX,XX +XXX,XX @@ static void nvic_recompute_state_secure(NVICState *s) | ||
30 | for (i = 1; i < s->num_irq; i++) { | ||
31 | for (bank = M_REG_S; bank >= M_REG_NS; bank--) { | ||
32 | VecInfo *vec; | ||
33 | - int prio; | ||
34 | + int prio, subprio; | ||
35 | bool targets_secure; | ||
36 | |||
37 | if (bank == M_REG_S) { | ||
38 | @@ -XXX,XX +XXX,XX @@ static void nvic_recompute_state_secure(NVICState *s) | ||
39 | } | ||
40 | |||
41 | prio = exc_group_prio(s, vec->prio, targets_secure); | ||
42 | - if (vec->enabled && vec->pending && prio < pend_prio) { | ||
43 | + subprio = vec->prio & ~nvic_gprio_mask(s, targets_secure); | ||
44 | + if (vec->enabled && vec->pending && | ||
45 | + ((prio < pend_prio) || | ||
46 | + (prio == pend_prio && prio >= 0 && subprio < pend_subprio))) { | ||
47 | pend_prio = prio; | ||
48 | + pend_subprio = subprio; | ||
49 | pend_irq = i; | ||
50 | pending_is_s_banked = (bank == M_REG_S); | ||
51 | } | ||
52 | -- | ||
53 | 2.20.1 | ||
54 | |||
55 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | The non-secure versions of the BFAR and BFSR registers are | ||
2 | supposed to be RAZ/WI if AICR.BFHFNMINS == 0; we were | ||
3 | incorrectly allowing NS code to access the real values. | ||
4 | 1 | ||
5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20190430131439.25251-3-peter.maydell@linaro.org | ||
8 | --- | ||
9 | hw/intc/armv7m_nvic.c | 27 ++++++++++++++++++++++++--- | ||
10 | 1 file changed, 24 insertions(+), 3 deletions(-) | ||
11 | |||
12 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c | ||
13 | index XXXXXXX..XXXXXXX 100644 | ||
14 | --- a/hw/intc/armv7m_nvic.c | ||
15 | +++ b/hw/intc/armv7m_nvic.c | ||
16 | @@ -XXX,XX +XXX,XX @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs) | ||
17 | if (!arm_feature(&cpu->env, ARM_FEATURE_M_MAIN)) { | ||
18 | goto bad_offset; | ||
19 | } | ||
20 | + if (!attrs.secure && | ||
21 | + !(s->cpu->env.v7m.aircr & R_V7M_AIRCR_BFHFNMINS_MASK)) { | ||
22 | + return 0; | ||
23 | + } | ||
24 | return cpu->env.v7m.bfar; | ||
25 | case 0xd3c: /* Aux Fault Status. */ | ||
26 | /* TODO: Implement fault status registers. */ | ||
27 | @@ -XXX,XX +XXX,XX @@ static void nvic_writel(NVICState *s, uint32_t offset, uint32_t value, | ||
28 | if (!arm_feature(&cpu->env, ARM_FEATURE_M_MAIN)) { | ||
29 | goto bad_offset; | ||
30 | } | ||
31 | + if (!attrs.secure && | ||
32 | + !(s->cpu->env.v7m.aircr & R_V7M_AIRCR_BFHFNMINS_MASK)) { | ||
33 | + return; | ||
34 | + } | ||
35 | cpu->env.v7m.bfar = value; | ||
36 | return; | ||
37 | case 0xd3c: /* Aux Fault Status. */ | ||
38 | @@ -XXX,XX +XXX,XX @@ static MemTxResult nvic_sysreg_read(void *opaque, hwaddr addr, | ||
39 | val = 0; | ||
40 | break; | ||
41 | }; | ||
42 | - /* The BFSR bits [15:8] are shared between security states | ||
43 | - * and we store them in the NS copy | ||
44 | + /* | ||
45 | + * The BFSR bits [15:8] are shared between security states | ||
46 | + * and we store them in the NS copy. They are RAZ/WI for | ||
47 | + * NS code if AIRCR.BFHFNMINS is 0. | ||
48 | */ | ||
49 | val = s->cpu->env.v7m.cfsr[attrs.secure]; | ||
50 | - val |= s->cpu->env.v7m.cfsr[M_REG_NS] & R_V7M_CFSR_BFSR_MASK; | ||
51 | + if (!attrs.secure && | ||
52 | + !(s->cpu->env.v7m.aircr & R_V7M_AIRCR_BFHFNMINS_MASK)) { | ||
53 | + val &= ~R_V7M_CFSR_BFSR_MASK; | ||
54 | + } else { | ||
55 | + val |= s->cpu->env.v7m.cfsr[M_REG_NS] & R_V7M_CFSR_BFSR_MASK; | ||
56 | + } | ||
57 | val = extract32(val, (offset - 0xd28) * 8, size * 8); | ||
58 | break; | ||
59 | case 0xfe0 ... 0xfff: /* ID. */ | ||
60 | @@ -XXX,XX +XXX,XX @@ static MemTxResult nvic_sysreg_write(void *opaque, hwaddr addr, | ||
61 | */ | ||
62 | value <<= ((offset - 0xd28) * 8); | ||
63 | |||
64 | + if (!attrs.secure && | ||
65 | + !(s->cpu->env.v7m.aircr & R_V7M_AIRCR_BFHFNMINS_MASK)) { | ||
66 | + /* BFSR bits are RAZ/WI for NS if BFHFNMINS is set */ | ||
67 | + value &= ~R_V7M_CFSR_BFSR_MASK; | ||
68 | + } | ||
69 | + | ||
70 | s->cpu->env.v7m.cfsr[attrs.secure] &= ~value; | ||
71 | if (attrs.secure) { | ||
72 | /* The BFSR bits [15:8] are shared between security states | ||
73 | -- | ||
74 | 2.20.1 | ||
75 | |||
76 | diff view generated by jsdifflib |