1 | target-arm queue for 3.1: mostly bug fixes, but the "turn on | 1 | Not very much here, but several people have fallen over |
---|---|---|---|
2 | EL2 support for Cortex-A7 and -A15" is technically enabling | 2 | the vector operation segfault bug, so let's get the fix |
3 | of a new feature... I think this is OK since we're only at rc1, | 3 | into master. |
4 | and it's easy to revert that feature bit flip if necessary. | ||
5 | 4 | ||
6 | thanks | 5 | thanks |
7 | -- PMM | 6 | -- PMM |
8 | 7 | ||
8 | The following changes since commit d418238dca7b4e0b124135827ead3076233052b1: | ||
9 | 9 | ||
10 | The following changes since commit 5704c36d25ee84e7129722cb0db53df9faefe943: | 10 | Merge remote-tracking branch 'remotes/rth/tags/pull-rng-20190522' into staging (2019-05-23 12:57:17 +0100) |
11 | |||
12 | Merge remote-tracking branch 'remotes/kraxel/tags/fixes-31-20181112-pull-request' into staging (2018-11-12 15:55:40 +0000) | ||
13 | 11 | ||
14 | are available in the Git repository at: | 12 | are available in the Git repository at: |
15 | 13 | ||
16 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20181112 | 14 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190523 |
17 | 15 | ||
18 | for you to fetch changes up to 1a4c1a6dbf60aebddd07753f1013ea896c06ad29: | 16 | for you to fetch changes up to 98e4f4fdb8ea05d840f51f47125924c2bb9df2df: |
19 | 17 | ||
20 | target/arm/cpu: Give Cortex-A15 and -A7 the EL2 feature (2018-11-12 16:52:29 +0000) | 18 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC (2019-05-23 14:47:44 +0100) |
21 | 19 | ||
22 | ---------------------------------------------------------------- | 20 | ---------------------------------------------------------------- |
23 | target/arm queue: | 21 | target-arm queue: |
24 | * Remove no-longer-needed workaround for small SAU regions for v8M | 22 | * exynos4210: QOM'ify the Exynos4210 SoC |
25 | * Remove antique TODO comment | 23 | * exynos4210: Add DMA support for the Exynos4210 |
26 | * MAINTAINERS: Add an entry for the 'collie' machine | 24 | * arm_gicv3: Fix writes to ICC_CTLR_EL3 |
27 | * hw/arm/sysbus-fdt: Only call match_fn callback if the type matches | 25 | * arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} |
28 | * Fix infinite recursion in tlbi_aa64_vmalle1_write() | 26 | * target/arm: Fix vector operation segfault |
29 | * ARM KVM: fix various bugs in handling of guest debugging | 27 | * target/arm: Minor improvements to BFXIL, EXTR |
30 | * Correctly implement handling of HCR_EL2.{VI, VF} | ||
31 | * Hyp mode R14 is shared with User and System | ||
32 | * Give Cortex-A15 and -A7 the EL2 feature | ||
33 | 28 | ||
34 | ---------------------------------------------------------------- | 29 | ---------------------------------------------------------------- |
35 | Alex Bennée (6): | 30 | Alistair Francis (1): |
36 | target/arm64: properly handle DBGVR RESS bits | 31 | target/arm: Fix vector operation segfault |
37 | target/arm64: hold BQL when calling do_interrupt() | ||
38 | target/arm64: kvm debug set target_el when passing exception to guest | ||
39 | tests/guest-debug: fix scoping of failcount | ||
40 | arm: use symbolic MDCR_TDE in arm_debug_target_el | ||
41 | arm: fix aa64_generate_debug_exceptions to work with EL2 | ||
42 | 32 | ||
43 | Eric Auger (1): | 33 | Guenter Roeck (1): |
44 | hw/arm/sysbus-fdt: Only call match_fn callback if the type matches | 34 | hw/arm/exynos4210: Add DMA support for the Exynos4210 |
45 | 35 | ||
46 | Peter Maydell (7): | 36 | Peter Maydell (5): |
47 | target/arm: Remove workaround for small SAU regions | 37 | arm: Move system_clock_scale to armv7m_systick.h |
48 | target/arm: Remove antique TODO comment | 38 | arm: Remove unnecessary includes of hw/arm/arm.h |
49 | Revert "target/arm: Implement HCR.VI and VF" | 39 | arm: Rename hw/arm/arm.h to hw/arm/boot.h |
50 | target/arm: Track the state of our irq lines from the GIC explicitly | 40 | hw/intc/arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} |
51 | target/arm: Correctly implement handling of HCR_EL2.{VI, VF} | 41 | hw/intc/arm_gicv3: Fix writes to ICC_CTLR_EL3 |
52 | target/arm: Hyp mode R14 is shared with User and System | ||
53 | target/arm/cpu: Give Cortex-A15 and -A7 the EL2 feature | ||
54 | 42 | ||
55 | Richard Henderson (1): | 43 | Philippe Mathieu-Daudé (3): |
56 | target/arm: Fix typo in tlbi_aa64_vmalle1_write | 44 | hw/arm/exynos4: Remove unuseful debug code |
45 | hw/arm/exynos4: Use the IEC binary prefix definitions | ||
46 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC | ||
57 | 47 | ||
58 | Thomas Huth (1): | 48 | Richard Henderson (2): |
59 | MAINTAINERS: Add an entry for the 'collie' machine | 49 | target/arm: Use extract2 for EXTR |
50 | target/arm: Simplify BFXIL expansion | ||
60 | 51 | ||
61 | target/arm/cpu.h | 44 +++++++++++------ | 52 | include/hw/arm/allwinner-a10.h | 2 +- |
62 | target/arm/internals.h | 34 +++++++++++++ | 53 | include/hw/arm/aspeed_soc.h | 1 - |
63 | hw/arm/sysbus-fdt.c | 12 +++-- | 54 | include/hw/arm/bcm2836.h | 1 - |
64 | target/arm/cpu.c | 66 ++++++++++++++++++++++++- | 55 | include/hw/arm/{arm.h => boot.h} | 12 +++------ |
65 | target/arm/helper.c | 101 +++++++++++++------------------------- | 56 | include/hw/arm/exynos4210.h | 9 +++++-- |
66 | target/arm/kvm32.c | 4 +- | 57 | include/hw/arm/fsl-imx25.h | 2 +- |
67 | target/arm/kvm64.c | 20 +++++++- | 58 | include/hw/arm/fsl-imx31.h | 2 +- |
68 | target/arm/machine.c | 51 +++++++++++++++++++ | 59 | include/hw/arm/fsl-imx6.h | 2 +- |
69 | target/arm/op_helper.c | 4 +- | 60 | include/hw/arm/fsl-imx6ul.h | 2 +- |
70 | MAINTAINERS | 7 +++ | 61 | include/hw/arm/fsl-imx7.h | 2 +- |
71 | tests/guest-debug/test-gdbstub.py | 1 + | 62 | include/hw/arm/virt.h | 2 +- |
72 | 11 files changed, 248 insertions(+), 96 deletions(-) | 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%) | ||
73 | 115 | diff view generated by jsdifflib |
1 | From: Eric Auger <eric.auger@redhat.com> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | Commit af7d64ede0b9 (hw/arm/sysbus-fdt: Allow device matching with DT | 3 | This is, after all, how we implement extract2 in tcg/aarch64. |
4 | compatible value) introduced a match_fn callback which gets called | ||
5 | for each registered combo to check whether a sysbus device can be | ||
6 | dynamically instantiated. However the callback gets called even if | ||
7 | the device type does not match the binding combo typename field. | ||
8 | This causes an assert when passing "-device ramfb" to the qemu | ||
9 | command line as vfio_platform_match() gets called on a non | ||
10 | vfio-platform device. | ||
11 | 4 | ||
12 | To fix this regression, let's change the add_fdt_node() logic so | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
13 | that we first check the type and if the match_fn callback is defined, | 6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
14 | then we also call it. | 7 | Message-id: 20190514011129.11330-2-richard.henderson@linaro.org |
15 | |||
16 | Binding combos only requesting a type check do not define the | ||
17 | match_fn callback. | ||
18 | |||
19 | Fixes: af7d64ede0b9 (hw/arm/sysbus-fdt: Allow device matching with | ||
20 | DT compatible value) | ||
21 | |||
22 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | ||
23 | Reported-by: Thomas Huth <thuth@redhat.com> | ||
24 | Reviewed-by: Alex Williamson <alex.williamson@redhat.com> | ||
25 | Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> | ||
26 | Message-id: 20181106184212.29377-1-eric.auger@redhat.com | ||
27 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
28 | --- | 9 | --- |
29 | hw/arm/sysbus-fdt.c | 12 +++++++----- | 10 | target/arm/translate-a64.c | 38 ++++++++++++++++++++------------------ |
30 | 1 file changed, 7 insertions(+), 5 deletions(-) | 11 | 1 file changed, 20 insertions(+), 18 deletions(-) |
31 | 12 | ||
32 | diff --git a/hw/arm/sysbus-fdt.c b/hw/arm/sysbus-fdt.c | 13 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
33 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
34 | --- a/hw/arm/sysbus-fdt.c | 15 | --- a/target/arm/translate-a64.c |
35 | +++ b/hw/arm/sysbus-fdt.c | 16 | +++ b/target/arm/translate-a64.c |
36 | @@ -XXX,XX +XXX,XX @@ static bool type_match(SysBusDevice *sbdev, const BindingEntry *entry) | 17 | @@ -XXX,XX +XXX,XX @@ static void disas_extract(DisasContext *s, uint32_t insn) |
37 | return !strcmp(object_get_typename(OBJECT(sbdev)), entry->typename); | 18 | } else { |
38 | } | 19 | tcg_gen_ext32u_i64(tcg_rd, cpu_reg(s, rm)); |
39 | 20 | } | |
40 | -#define TYPE_BINDING(type, add_fn) {(type), NULL, (add_fn), type_match} | 21 | - } else if (rm == rn) { /* ROR */ |
41 | +#define TYPE_BINDING(type, add_fn) {(type), NULL, (add_fn), NULL} | 22 | - tcg_rm = cpu_reg(s, rm); |
42 | 23 | - if (sf) { | |
43 | /* list of supported dynamic sysbus bindings */ | 24 | - tcg_gen_rotri_i64(tcg_rd, tcg_rm, imm); |
44 | static const BindingEntry bindings[] = { | 25 | - } else { |
45 | @@ -XXX,XX +XXX,XX @@ static void add_fdt_node(SysBusDevice *sbdev, void *opaque) | 26 | - TCGv_i32 tmp = tcg_temp_new_i32(); |
46 | for (i = 0; i < ARRAY_SIZE(bindings); i++) { | 27 | - tcg_gen_extrl_i64_i32(tmp, tcg_rm); |
47 | const BindingEntry *iter = &bindings[i]; | 28 | - tcg_gen_rotri_i32(tmp, tmp, imm); |
48 | 29 | - tcg_gen_extu_i32_i64(tcg_rd, tmp); | |
49 | - if (iter->match_fn(sbdev, iter)) { | 30 | - tcg_temp_free_i32(tmp); |
50 | - ret = iter->add_fn(sbdev, opaque); | 31 | - } |
51 | - assert(!ret); | 32 | } else { |
52 | - return; | 33 | - tcg_rm = read_cpu_reg(s, rm, sf); |
53 | + if (type_match(sbdev, iter)) { | 34 | - tcg_rn = read_cpu_reg(s, rn, sf); |
54 | + if (!iter->match_fn || iter->match_fn(sbdev, iter)) { | 35 | - tcg_gen_shri_i64(tcg_rm, tcg_rm, imm); |
55 | + ret = iter->add_fn(sbdev, opaque); | 36 | - tcg_gen_shli_i64(tcg_rn, tcg_rn, bitsize - imm); |
56 | + assert(!ret); | 37 | - tcg_gen_or_i64(tcg_rd, tcg_rm, tcg_rn); |
57 | + return; | 38 | - if (!sf) { |
58 | + } | 39 | - tcg_gen_ext32u_i64(tcg_rd, tcg_rd); |
40 | + tcg_rm = cpu_reg(s, rm); | ||
41 | + tcg_rn = cpu_reg(s, rn); | ||
42 | + | ||
43 | + if (sf) { | ||
44 | + /* Specialization to ROR happens in EXTRACT2. */ | ||
45 | + tcg_gen_extract2_i64(tcg_rd, tcg_rm, tcg_rn, imm); | ||
46 | + } else { | ||
47 | + TCGv_i32 t0 = tcg_temp_new_i32(); | ||
48 | + | ||
49 | + tcg_gen_extrl_i64_i32(t0, tcg_rm); | ||
50 | + if (rm == rn) { | ||
51 | + tcg_gen_rotri_i32(t0, t0, imm); | ||
52 | + } else { | ||
53 | + TCGv_i32 t1 = tcg_temp_new_i32(); | ||
54 | + tcg_gen_extrl_i64_i32(t1, tcg_rn); | ||
55 | + tcg_gen_extract2_i32(t0, t0, t1, imm); | ||
56 | + tcg_temp_free_i32(t1); | ||
57 | + } | ||
58 | + tcg_gen_extu_i32_i64(tcg_rd, t0); | ||
59 | + tcg_temp_free_i32(t0); | ||
60 | } | ||
59 | } | 61 | } |
60 | } | 62 | } |
61 | error_report("Device %s can not be dynamically instantiated", | ||
62 | -- | 63 | -- |
63 | 2.19.1 | 64 | 2.20.1 |
64 | 65 | ||
65 | 66 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | This would cause an infinite recursion or loop. | 3 | The mask implied by the extract is redundant with the one |
4 | implied by the deposit. Also, fix spelling of BFXIL. | ||
4 | 5 | ||
6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
5 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 8 | Message-id: 20190514011129.11330-3-richard.henderson@linaro.org |
7 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
8 | Message-id: 20181110121711.15257-1-richard.henderson@linaro.org | ||
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 10 | --- |
12 | target/arm/helper.c | 2 +- | 11 | target/arm/translate-a64.c | 6 +++--- |
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | 12 | 1 file changed, 3 insertions(+), 3 deletions(-) |
14 | 13 | ||
15 | diff --git a/target/arm/helper.c b/target/arm/helper.c | 14 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
16 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/helper.c | 16 | --- a/target/arm/translate-a64.c |
18 | +++ b/target/arm/helper.c | 17 | +++ b/target/arm/translate-a64.c |
19 | @@ -XXX,XX +XXX,XX @@ static void tlbi_aa64_vmalle1_write(CPUARMState *env, const ARMCPRegInfo *ri, | 18 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) |
20 | CPUState *cs = ENV_GET_CPU(env); | 19 | tcg_gen_extract_i64(tcg_rd, tcg_tmp, ri, len); |
21 | 20 | return; | |
22 | if (tlb_force_broadcast(env)) { | 21 | } |
23 | - tlbi_aa64_vmalle1_write(env, NULL, value); | 22 | - /* opc == 1, BXFIL fall through to deposit */ |
24 | + tlbi_aa64_vmalle1is_write(env, NULL, value); | 23 | - tcg_gen_extract_i64(tcg_tmp, tcg_tmp, ri, len); |
25 | return; | 24 | + /* opc == 1, BFXIL fall through to deposit */ |
25 | + tcg_gen_shri_i64(tcg_tmp, tcg_tmp, ri); | ||
26 | pos = 0; | ||
27 | } else { | ||
28 | /* Handle the ri > si case with a deposit | ||
29 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) | ||
30 | len = ri; | ||
26 | } | 31 | } |
27 | 32 | ||
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 | ||
28 | -- | 38 | -- |
29 | 2.19.1 | 39 | 2.20.1 |
30 | 40 | ||
31 | 41 | diff view generated by jsdifflib |
1 | From: Alex Bennée <alex.bennee@linaro.org> | 1 | From: Alistair Francis <alistair.francis@wdc.com> |
---|---|---|---|
2 | 2 | ||
3 | The test was incomplete and incorrectly caused debug exceptions to be | 3 | Commit 89e68b575 "target/arm: Use vector operations for saturation" |
4 | generated when returning to EL2 after a failed attempt to single-step | 4 | causes this abort() when booting QEMU ARM with a Cortex-A15: |
5 | an EL1 instruction. Fix this while cleaning up the function a little. | ||
6 | 5 | ||
7 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | 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> | ||
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 27 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
9 | Message-id: 20181109152119.9242-8-alex.bennee@linaro.org | 28 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
29 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
30 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
31 | Message-id: ad91b397f360b2fc7f4087e476f7df5b04d42ddb.1558021877.git.alistair.francis@wdc.com | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 32 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 33 | --- |
12 | target/arm/cpu.h | 39 ++++++++++++++++++++++++--------------- | 34 | target/arm/translate.c | 4 ++-- |
13 | 1 file changed, 24 insertions(+), 15 deletions(-) | 35 | 1 file changed, 2 insertions(+), 2 deletions(-) |
14 | 36 | ||
15 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | 37 | diff --git a/target/arm/translate.c b/target/arm/translate.c |
16 | index XXXXXXX..XXXXXXX 100644 | 38 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/cpu.h | 39 | --- a/target/arm/translate.c |
18 | +++ b/target/arm/cpu.h | 40 | +++ b/target/arm/translate.c |
19 | @@ -XXX,XX +XXX,XX @@ static inline bool arm_v7m_csselr_razwi(ARMCPU *cpu) | 41 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) |
20 | return (cpu->clidr & R_V7M_CLIDR_CTYPE_ALL_MASK) != 0; | 42 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), |
21 | } | 43 | rn_ofs, rm_ofs, vec_size, vec_size, |
22 | 44 | (u ? uqadd_op : sqadd_op) + size); | |
23 | +/* See AArch64.GenerateDebugExceptionsFrom() in ARM ARM pseudocode */ | 45 | - break; |
24 | static inline bool aa64_generate_debug_exceptions(CPUARMState *env) | 46 | + return 0; |
25 | { | 47 | |
26 | - if (arm_is_secure(env)) { | 48 | case NEON_3R_VQSUB: |
27 | - /* MDCR_EL3.SDD disables debug events from Secure state */ | 49 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), |
28 | - if (extract32(env->cp15.mdcr_el3, 16, 1) != 0 | 50 | rn_ofs, rm_ofs, vec_size, vec_size, |
29 | - || arm_current_el(env) == 3) { | 51 | (u ? uqsub_op : sqsub_op) + size); |
30 | - return false; | 52 | - break; |
31 | - } | 53 | + return 0; |
32 | + int cur_el = arm_current_el(env); | 54 | |
33 | + int debug_el; | 55 | case NEON_3R_VMUL: /* VMUL */ |
34 | + | 56 | if (u) { |
35 | + if (cur_el == 3) { | ||
36 | + return false; | ||
37 | } | ||
38 | |||
39 | - if (arm_current_el(env) == arm_debug_target_el(env)) { | ||
40 | - if ((extract32(env->cp15.mdscr_el1, 13, 1) == 0) | ||
41 | - || (env->daif & PSTATE_D)) { | ||
42 | - return false; | ||
43 | - } | ||
44 | + /* MDCR_EL3.SDD disables debug events from Secure state */ | ||
45 | + if (arm_is_secure_below_el3(env) | ||
46 | + && extract32(env->cp15.mdcr_el3, 16, 1)) { | ||
47 | + return false; | ||
48 | } | ||
49 | - return true; | ||
50 | + | ||
51 | + /* | ||
52 | + * Same EL to same EL debug exceptions need MDSCR_KDE enabled | ||
53 | + * while not masking the (D)ebug bit in DAIF. | ||
54 | + */ | ||
55 | + debug_el = arm_debug_target_el(env); | ||
56 | + | ||
57 | + if (cur_el == debug_el) { | ||
58 | + return extract32(env->cp15.mdscr_el1, 13, 1) | ||
59 | + && !(env->daif & PSTATE_D); | ||
60 | + } | ||
61 | + | ||
62 | + /* Otherwise the debug target needs to be a higher EL */ | ||
63 | + return debug_el > cur_el; | ||
64 | } | ||
65 | |||
66 | static inline bool aa32_generate_debug_exceptions(CPUARMState *env) | ||
67 | @@ -XXX,XX +XXX,XX @@ static inline bool aa32_generate_debug_exceptions(CPUARMState *env) | ||
68 | * since the pseudocode has it at all callsites except for the one in | ||
69 | * CheckSoftwareStep(), where it is elided because both branches would | ||
70 | * always return the same value. | ||
71 | - * | ||
72 | - * Parts of the pseudocode relating to EL2 and EL3 are omitted because we | ||
73 | - * don't yet implement those exception levels or their associated trap bits. | ||
74 | */ | ||
75 | static inline bool arm_generate_debug_exceptions(CPUARMState *env) | ||
76 | { | ||
77 | -- | 57 | -- |
78 | 2.19.1 | 58 | 2.20.1 |
79 | 59 | ||
80 | 60 | diff view generated by jsdifflib |
1 | The Cortex-A15 and Cortex-A7 both have EL2; now we've implemented | 1 | The system_clock_scale global is used only by the armv7m systick |
---|---|---|---|
2 | it properly we can enable the feature bit. | 2 | device; move the extern declaration to the armv7m_systick.h header, |
3 | and expand the comment to explain what it is and that it should | ||
4 | ideally be replaced with a different approach. | ||
3 | 5 | ||
4 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
5 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
6 | Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> | 8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
7 | Message-id: 20181109173553.22341-3-peter.maydell@linaro.org | 9 | Message-id: 20190516163857.6430-2-peter.maydell@linaro.org |
8 | --- | 10 | --- |
9 | target/arm/cpu.c | 2 ++ | 11 | include/hw/arm/arm.h | 4 ---- |
10 | 1 file changed, 2 insertions(+) | 12 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++++++++ |
13 | 2 files changed, 22 insertions(+), 4 deletions(-) | ||
11 | 14 | ||
12 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 15 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h |
13 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/target/arm/cpu.c | 17 | --- a/include/hw/arm/arm.h |
15 | +++ b/target/arm/cpu.c | 18 | +++ b/include/hw/arm/arm.h |
16 | @@ -XXX,XX +XXX,XX @@ static void cortex_a7_initfn(Object *obj) | 19 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, |
17 | set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); | 20 | const struct arm_boot_info *info, |
18 | set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); | 21 | hwaddr mvbar_addr); |
19 | set_feature(&cpu->env, ARM_FEATURE_CBAR_RO); | 22 | |
20 | + set_feature(&cpu->env, ARM_FEATURE_EL2); | 23 | -/* Multiplication factor to convert from system clock ticks to qemu timer |
21 | set_feature(&cpu->env, ARM_FEATURE_EL3); | 24 | - ticks. */ |
22 | cpu->kvm_target = QEMU_KVM_ARM_TARGET_CORTEX_A7; | 25 | -extern int system_clock_scale; |
23 | cpu->midr = 0x410fc075; | 26 | - |
24 | @@ -XXX,XX +XXX,XX @@ static void cortex_a15_initfn(Object *obj) | 27 | #endif /* HW_ARM_H */ |
25 | set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER); | 28 | diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_systick.h |
26 | set_feature(&cpu->env, ARM_FEATURE_DUMMY_C15_REGS); | 29 | index XXXXXXX..XXXXXXX 100644 |
27 | set_feature(&cpu->env, ARM_FEATURE_CBAR_RO); | 30 | --- a/include/hw/timer/armv7m_systick.h |
28 | + set_feature(&cpu->env, ARM_FEATURE_EL2); | 31 | +++ b/include/hw/timer/armv7m_systick.h |
29 | set_feature(&cpu->env, ARM_FEATURE_EL3); | 32 | @@ -XXX,XX +XXX,XX @@ typedef struct SysTickState { |
30 | cpu->kvm_target = QEMU_KVM_ARM_TARGET_CORTEX_A15; | 33 | qemu_irq irq; |
31 | cpu->midr = 0x412fc0f1; | 34 | } SysTickState; |
35 | |||
36 | +/* | ||
37 | + * Multiplication factor to convert from system clock ticks to qemu timer | ||
38 | + * ticks. This should be set (by board code, usually) to a value | ||
39 | + * equal to NANOSECONDS_PER_SECOND / frq, where frq is the clock frequency | ||
40 | + * in Hz of the CPU. | ||
41 | + * | ||
42 | + * This value is used by the systick device when it is running in | ||
43 | + * its "use the CPU clock" mode (ie when SYST_CSR.CLKSOURCE == 1) to | ||
44 | + * set how fast the timer should tick. | ||
45 | + * | ||
46 | + * TODO: we should refactor this so that rather than using a global | ||
47 | + * we use a device property or something similar. This is complicated | ||
48 | + * because (a) the property would need to be plumbed through from the | ||
49 | + * board code down through various layers to the systick device | ||
50 | + * and (b) the property needs to be modifiable after realize, because | ||
51 | + * the stellaris board uses this to implement the behaviour where the | ||
52 | + * guest can reprogram the PLL registers to downclock the CPU, and the | ||
53 | + * systick device needs to react accordingly. Possibly this should | ||
54 | + * be deferred until we have a good API for modelling clock trees. | ||
55 | + */ | ||
56 | +extern int system_clock_scale; | ||
57 | + | ||
58 | #endif | ||
32 | -- | 59 | -- |
33 | 2.19.1 | 60 | 2.20.1 |
34 | 61 | ||
35 | 62 | diff view generated by jsdifflib |
1 | Currently we track the state of the four irq lines from the GIC | 1 | The hw/arm/arm.h header now only includes declarations relating |
---|---|---|---|
2 | only via the cs->interrupt_request or KVM irq state. That means | 2 | to boot.c code, so it is only needed by Arm board or SoC code. |
3 | that we assume that an interrupt is asserted if and only if the | 3 | Remove some unnecessary inclusions of it from target/arm files |
4 | external line is set. This assumption is incorrect for VIRQ | 4 | and from hw/intc/armv7m_nvic.c. |
5 | and VFIQ, because the HCR_EL2.{VI,VF} bits allow assertion | ||
6 | of VIRQ and VFIQ separately from the state of the external line. | ||
7 | |||
8 | To handle this, start tracking the state of the external lines | ||
9 | explicitly in a CPU state struct field, as is common practice | ||
10 | for devices. | ||
11 | |||
12 | The complicated part of this is dealing with inbound migration | ||
13 | from an older QEMU which didn't have this state. We assume in | ||
14 | that case that the older QEMU did not implement the HCR_EL2.{VI,VF} | ||
15 | bits as generating interrupts, and so the line state matches | ||
16 | the current state in cs->interrupt_request. (This is not quite | ||
17 | true between commit 8a0fc3a29fc2315325400c7 and its revert, but | ||
18 | that commit is broken and never made it into any released QEMU | ||
19 | version.) | ||
20 | 5 | ||
21 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
22 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
23 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | 8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
24 | Message-id: 20181109134731.11605-3-peter.maydell@linaro.org | 9 | Message-id: 20190516163857.6430-3-peter.maydell@linaro.org |
25 | --- | 10 | --- |
26 | target/arm/cpu.h | 3 +++ | 11 | hw/intc/armv7m_nvic.c | 1 - |
27 | target/arm/cpu.c | 16 ++++++++++++++ | 12 | target/arm/arm-semi.c | 1 - |
28 | target/arm/machine.c | 51 ++++++++++++++++++++++++++++++++++++++++++++ | 13 | target/arm/cpu.c | 1 - |
29 | 3 files changed, 70 insertions(+) | 14 | target/arm/cpu64.c | 1 - |
15 | target/arm/kvm.c | 1 - | ||
16 | target/arm/kvm32.c | 1 - | ||
17 | target/arm/kvm64.c | 1 - | ||
18 | 7 files changed, 7 deletions(-) | ||
30 | 19 | ||
31 | 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 |
32 | index XXXXXXX..XXXXXXX 100644 | 21 | index XXXXXXX..XXXXXXX 100644 |
33 | --- a/target/arm/cpu.h | 22 | --- a/hw/intc/armv7m_nvic.c |
34 | +++ b/target/arm/cpu.h | 23 | +++ b/hw/intc/armv7m_nvic.c |
35 | @@ -XXX,XX +XXX,XX @@ typedef struct CPUARMState { | 24 | @@ -XXX,XX +XXX,XX @@ |
36 | uint64_t esr; | 25 | #include "cpu.h" |
37 | } serror; | 26 | #include "hw/sysbus.h" |
38 | 27 | #include "qemu/timer.h" | |
39 | + /* State of our input IRQ/FIQ/VIRQ/VFIQ lines */ | 28 | -#include "hw/arm/arm.h" |
40 | + uint32_t irq_line_state; | 29 | #include "hw/intc/armv7m_nvic.h" |
41 | + | 30 | #include "target/arm/cpu.h" |
42 | /* Thumb-2 EE state. */ | 31 | #include "exec/exec-all.h" |
43 | uint32_t teecr; | 32 | diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c |
44 | uint32_t teehbr; | 33 | index XXXXXXX..XXXXXXX 100644 |
34 | --- a/target/arm/arm-semi.c | ||
35 | +++ b/target/arm/arm-semi.c | ||
36 | @@ -XXX,XX +XXX,XX @@ | ||
37 | #else | ||
38 | #include "qemu-common.h" | ||
39 | #include "exec/gdbstub.h" | ||
40 | -#include "hw/arm/arm.h" | ||
41 | #include "qemu/cutils.h" | ||
42 | #endif | ||
43 | |||
45 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 44 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c |
46 | index XXXXXXX..XXXXXXX 100644 | 45 | index XXXXXXX..XXXXXXX 100644 |
47 | --- a/target/arm/cpu.c | 46 | --- a/target/arm/cpu.c |
48 | +++ b/target/arm/cpu.c | 47 | +++ b/target/arm/cpu.c |
49 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_set_irq(void *opaque, int irq, int level) | 48 | @@ -XXX,XX +XXX,XX @@ |
50 | [ARM_CPU_VFIQ] = CPU_INTERRUPT_VFIQ | 49 | #if !defined(CONFIG_USER_ONLY) |
51 | }; | 50 | #include "hw/loader.h" |
52 | |||
53 | + if (level) { | ||
54 | + env->irq_line_state |= mask[irq]; | ||
55 | + } else { | ||
56 | + env->irq_line_state &= ~mask[irq]; | ||
57 | + } | ||
58 | + | ||
59 | switch (irq) { | ||
60 | case ARM_CPU_VIRQ: | ||
61 | case ARM_CPU_VFIQ: | ||
62 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_kvm_set_irq(void *opaque, int irq, int level) | ||
63 | ARMCPU *cpu = opaque; | ||
64 | CPUState *cs = CPU(cpu); | ||
65 | int kvm_irq = KVM_ARM_IRQ_TYPE_CPU << KVM_ARM_IRQ_TYPE_SHIFT; | ||
66 | + uint32_t linestate_bit; | ||
67 | |||
68 | switch (irq) { | ||
69 | case ARM_CPU_IRQ: | ||
70 | kvm_irq |= KVM_ARM_IRQ_CPU_IRQ; | ||
71 | + linestate_bit = CPU_INTERRUPT_HARD; | ||
72 | break; | ||
73 | case ARM_CPU_FIQ: | ||
74 | kvm_irq |= KVM_ARM_IRQ_CPU_FIQ; | ||
75 | + linestate_bit = CPU_INTERRUPT_FIQ; | ||
76 | break; | ||
77 | default: | ||
78 | g_assert_not_reached(); | ||
79 | } | ||
80 | + | ||
81 | + if (level) { | ||
82 | + env->irq_line_state |= linestate_bit; | ||
83 | + } else { | ||
84 | + env->irq_line_state &= ~linestate_bit; | ||
85 | + } | ||
86 | + | ||
87 | kvm_irq |= cs->cpu_index << KVM_ARM_IRQ_VCPU_SHIFT; | ||
88 | kvm_set_irq(kvm_state, kvm_irq, level ? 1 : 0); | ||
89 | #endif | 51 | #endif |
90 | diff --git a/target/arm/machine.c b/target/arm/machine.c | 52 | -#include "hw/arm/arm.h" |
53 | #include "sysemu/sysemu.h" | ||
54 | #include "sysemu/hw_accel.h" | ||
55 | #include "kvm_arm.h" | ||
56 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | ||
91 | index XXXXXXX..XXXXXXX 100644 | 57 | index XXXXXXX..XXXXXXX 100644 |
92 | --- a/target/arm/machine.c | 58 | --- a/target/arm/cpu64.c |
93 | +++ b/target/arm/machine.c | 59 | +++ b/target/arm/cpu64.c |
94 | @@ -XXX,XX +XXX,XX @@ static const VMStateDescription vmstate_serror = { | 60 | @@ -XXX,XX +XXX,XX @@ |
95 | } | 61 | #if !defined(CONFIG_USER_ONLY) |
96 | }; | 62 | #include "hw/loader.h" |
97 | |||
98 | +static bool irq_line_state_needed(void *opaque) | ||
99 | +{ | ||
100 | + return true; | ||
101 | +} | ||
102 | + | ||
103 | +static const VMStateDescription vmstate_irq_line_state = { | ||
104 | + .name = "cpu/irq-line-state", | ||
105 | + .version_id = 1, | ||
106 | + .minimum_version_id = 1, | ||
107 | + .needed = irq_line_state_needed, | ||
108 | + .fields = (VMStateField[]) { | ||
109 | + VMSTATE_UINT32(env.irq_line_state, ARMCPU), | ||
110 | + VMSTATE_END_OF_LIST() | ||
111 | + } | ||
112 | +}; | ||
113 | + | ||
114 | static bool m_needed(void *opaque) | ||
115 | { | ||
116 | ARMCPU *cpu = opaque; | ||
117 | @@ -XXX,XX +XXX,XX @@ static int cpu_pre_save(void *opaque) | ||
118 | return 0; | ||
119 | } | ||
120 | |||
121 | +static int cpu_pre_load(void *opaque) | ||
122 | +{ | ||
123 | + ARMCPU *cpu = opaque; | ||
124 | + CPUARMState *env = &cpu->env; | ||
125 | + | ||
126 | + /* | ||
127 | + * Pre-initialize irq_line_state to a value that's never valid as | ||
128 | + * real data, so cpu_post_load() can tell whether we've seen the | ||
129 | + * irq-line-state subsection in the incoming migration state. | ||
130 | + */ | ||
131 | + env->irq_line_state = UINT32_MAX; | ||
132 | + | ||
133 | + return 0; | ||
134 | +} | ||
135 | + | ||
136 | static int cpu_post_load(void *opaque, int version_id) | ||
137 | { | ||
138 | ARMCPU *cpu = opaque; | ||
139 | + CPUARMState *env = &cpu->env; | ||
140 | int i, v; | ||
141 | |||
142 | + /* | ||
143 | + * Handle migration compatibility from old QEMU which didn't | ||
144 | + * send the irq-line-state subsection. A QEMU without it did not | ||
145 | + * implement the HCR_EL2.{VI,VF} bits as generating interrupts, | ||
146 | + * so for TCG the line state matches the bits set in cs->interrupt_request. | ||
147 | + * For KVM the line state is not stored in cs->interrupt_request | ||
148 | + * and so this will leave irq_line_state as 0, but this is OK because | ||
149 | + * we only need to care about it for TCG. | ||
150 | + */ | ||
151 | + if (env->irq_line_state == UINT32_MAX) { | ||
152 | + CPUState *cs = CPU(cpu); | ||
153 | + | ||
154 | + env->irq_line_state = cs->interrupt_request & | ||
155 | + (CPU_INTERRUPT_HARD | CPU_INTERRUPT_FIQ | | ||
156 | + CPU_INTERRUPT_VIRQ | CPU_INTERRUPT_VFIQ); | ||
157 | + } | ||
158 | + | ||
159 | /* Update the values list from the incoming migration data. | ||
160 | * Anything in the incoming data which we don't know about is | ||
161 | * a migration failure; anything we know about but the incoming | ||
162 | @@ -XXX,XX +XXX,XX @@ const VMStateDescription vmstate_arm_cpu = { | ||
163 | .version_id = 22, | ||
164 | .minimum_version_id = 22, | ||
165 | .pre_save = cpu_pre_save, | ||
166 | + .pre_load = cpu_pre_load, | ||
167 | .post_load = cpu_post_load, | ||
168 | .fields = (VMStateField[]) { | ||
169 | VMSTATE_UINT32_ARRAY(env.regs, ARMCPU, 16), | ||
170 | @@ -XXX,XX +XXX,XX @@ const VMStateDescription vmstate_arm_cpu = { | ||
171 | &vmstate_sve, | ||
172 | #endif | 63 | #endif |
173 | &vmstate_serror, | 64 | -#include "hw/arm/arm.h" |
174 | + &vmstate_irq_line_state, | 65 | #include "sysemu/sysemu.h" |
175 | NULL | 66 | #include "sysemu/kvm.h" |
176 | } | 67 | #include "kvm_arm.h" |
177 | }; | 68 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c |
69 | index XXXXXXX..XXXXXXX 100644 | ||
70 | --- a/target/arm/kvm.c | ||
71 | +++ b/target/arm/kvm.c | ||
72 | @@ -XXX,XX +XXX,XX @@ | ||
73 | #include "cpu.h" | ||
74 | #include "trace.h" | ||
75 | #include "internals.h" | ||
76 | -#include "hw/arm/arm.h" | ||
77 | #include "hw/pci/pci.h" | ||
78 | #include "exec/memattrs.h" | ||
79 | #include "exec/address-spaces.h" | ||
80 | diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c | ||
81 | index XXXXXXX..XXXXXXX 100644 | ||
82 | --- a/target/arm/kvm32.c | ||
83 | +++ b/target/arm/kvm32.c | ||
84 | @@ -XXX,XX +XXX,XX @@ | ||
85 | #include "sysemu/kvm.h" | ||
86 | #include "kvm_arm.h" | ||
87 | #include "internals.h" | ||
88 | -#include "hw/arm/arm.h" | ||
89 | #include "qemu/log.h" | ||
90 | |||
91 | static inline void set_feature(uint64_t *features, int feature) | ||
92 | diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c | ||
93 | index XXXXXXX..XXXXXXX 100644 | ||
94 | --- a/target/arm/kvm64.c | ||
95 | +++ b/target/arm/kvm64.c | ||
96 | @@ -XXX,XX +XXX,XX @@ | ||
97 | #include "sysemu/kvm.h" | ||
98 | #include "kvm_arm.h" | ||
99 | #include "internals.h" | ||
100 | -#include "hw/arm/arm.h" | ||
101 | |||
102 | static bool have_guest_debug; | ||
103 | |||
178 | -- | 104 | -- |
179 | 2.19.1 | 105 | 2.20.1 |
180 | 106 | ||
181 | 107 | diff view generated by jsdifflib |
1 | This reverts commit 8a0fc3a29fc2315325400c738f807d0d4ae0ab7f. | 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 implementation of HCR.VI and VF in that commit is not | 5 | The bulk of this commit was created via |
4 | correct -- they do not track the overall "is there a pending | 6 | perl -pi -e 's|hw/arm/arm.h|hw/arm/boot.h|' hw/arm/*.c include/hw/arm/*.h |
5 | VIRQ or VFIQ" status, but whether there is a pending interrupt | ||
6 | due to "this mechanism", ie the hypervisor having set the VI/VF | ||
7 | bits. The overall pending state for VIRQ and VFIQ is effectively | ||
8 | the logical OR of the inbound lines from the GIC with the | ||
9 | VI and VF bits. Commit 8a0fc3a29fc231 would result in pending | ||
10 | VIRQ/VFIQ possibly being lost when the hypervisor wrote to HCR. | ||
11 | 7 | ||
12 | As a preliminary to implementing the HCR.VI/VF feature properly, | 8 | In a few cases we can just delete the #include: |
13 | revert the broken one entirely. | 9 | hw/arm/msf2-soc.c, include/hw/arm/aspeed_soc.h and |
10 | include/hw/arm/bcm2836.h did not require it. | ||
14 | 11 | ||
15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
16 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 13 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
17 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | 14 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
18 | Message-id: 20181109134731.11605-2-peter.maydell@linaro.org | 15 | Message-id: 20190516163857.6430-4-peter.maydell@linaro.org |
19 | --- | 16 | --- |
20 | target/arm/helper.c | 47 ++++----------------------------------------- | 17 | include/hw/arm/allwinner-a10.h | 2 +- |
21 | 1 file changed, 4 insertions(+), 43 deletions(-) | 18 | include/hw/arm/aspeed_soc.h | 1 - |
19 | include/hw/arm/bcm2836.h | 1 - | ||
20 | include/hw/arm/{arm.h => boot.h} | 8 ++++---- | ||
21 | include/hw/arm/fsl-imx25.h | 2 +- | ||
22 | include/hw/arm/fsl-imx31.h | 2 +- | ||
23 | include/hw/arm/fsl-imx6.h | 2 +- | ||
24 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
25 | include/hw/arm/fsl-imx7.h | 2 +- | ||
26 | include/hw/arm/virt.h | 2 +- | ||
27 | include/hw/arm/xlnx-versal.h | 2 +- | ||
28 | include/hw/arm/xlnx-zynqmp.h | 2 +- | ||
29 | hw/arm/armsse.c | 2 +- | ||
30 | hw/arm/armv7m.c | 2 +- | ||
31 | hw/arm/aspeed.c | 2 +- | ||
32 | hw/arm/boot.c | 2 +- | ||
33 | hw/arm/collie.c | 2 +- | ||
34 | hw/arm/exynos4210.c | 2 +- | ||
35 | hw/arm/exynos4_boards.c | 2 +- | ||
36 | hw/arm/highbank.c | 2 +- | ||
37 | hw/arm/integratorcp.c | 2 +- | ||
38 | hw/arm/mainstone.c | 2 +- | ||
39 | hw/arm/microbit.c | 2 +- | ||
40 | hw/arm/mps2-tz.c | 2 +- | ||
41 | hw/arm/mps2.c | 2 +- | ||
42 | hw/arm/msf2-soc.c | 1 - | ||
43 | hw/arm/msf2-som.c | 2 +- | ||
44 | hw/arm/musca.c | 2 +- | ||
45 | hw/arm/musicpal.c | 2 +- | ||
46 | hw/arm/netduino2.c | 2 +- | ||
47 | hw/arm/nrf51_soc.c | 2 +- | ||
48 | hw/arm/nseries.c | 2 +- | ||
49 | hw/arm/omap1.c | 2 +- | ||
50 | hw/arm/omap2.c | 2 +- | ||
51 | hw/arm/omap_sx1.c | 2 +- | ||
52 | hw/arm/palm.c | 2 +- | ||
53 | hw/arm/raspi.c | 2 +- | ||
54 | hw/arm/realview.c | 2 +- | ||
55 | hw/arm/spitz.c | 2 +- | ||
56 | hw/arm/stellaris.c | 2 +- | ||
57 | hw/arm/stm32f205_soc.c | 2 +- | ||
58 | hw/arm/strongarm.c | 2 +- | ||
59 | hw/arm/tosa.c | 2 +- | ||
60 | hw/arm/versatilepb.c | 2 +- | ||
61 | hw/arm/vexpress.c | 2 +- | ||
62 | hw/arm/virt.c | 2 +- | ||
63 | hw/arm/xilinx_zynq.c | 2 +- | ||
64 | hw/arm/xlnx-versal.c | 2 +- | ||
65 | hw/arm/z2.c | 2 +- | ||
66 | 49 files changed, 49 insertions(+), 52 deletions(-) | ||
67 | rename include/hw/arm/{arm.h => boot.h} (98%) | ||
22 | 68 | ||
23 | diff --git a/target/arm/helper.c b/target/arm/helper.c | 69 | diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h |
24 | index XXXXXXX..XXXXXXX 100644 | 70 | index XXXXXXX..XXXXXXX 100644 |
25 | --- a/target/arm/helper.c | 71 | --- a/include/hw/arm/allwinner-a10.h |
26 | +++ b/target/arm/helper.c | 72 | +++ b/include/hw/arm/allwinner-a10.h |
27 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo el3_no_el2_v8_cp_reginfo[] = { | 73 | @@ -XXX,XX +XXX,XX @@ |
28 | static void hcr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) | 74 | #include "qemu-common.h" |
75 | #include "qemu/error-report.h" | ||
76 | #include "hw/char/serial.h" | ||
77 | -#include "hw/arm/arm.h" | ||
78 | +#include "hw/arm/boot.h" | ||
79 | #include "hw/timer/allwinner-a10-pit.h" | ||
80 | #include "hw/intc/allwinner-a10-pic.h" | ||
81 | #include "hw/net/allwinner_emac.h" | ||
82 | diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h | ||
83 | index XXXXXXX..XXXXXXX 100644 | ||
84 | --- a/include/hw/arm/aspeed_soc.h | ||
85 | +++ b/include/hw/arm/aspeed_soc.h | ||
86 | @@ -XXX,XX +XXX,XX @@ | ||
87 | #ifndef ASPEED_SOC_H | ||
88 | #define ASPEED_SOC_H | ||
89 | |||
90 | -#include "hw/arm/arm.h" | ||
91 | #include "hw/intc/aspeed_vic.h" | ||
92 | #include "hw/misc/aspeed_scu.h" | ||
93 | #include "hw/misc/aspeed_sdmc.h" | ||
94 | diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h | ||
95 | index XXXXXXX..XXXXXXX 100644 | ||
96 | --- a/include/hw/arm/bcm2836.h | ||
97 | +++ b/include/hw/arm/bcm2836.h | ||
98 | @@ -XXX,XX +XXX,XX @@ | ||
99 | #ifndef BCM2836_H | ||
100 | #define BCM2836_H | ||
101 | |||
102 | -#include "hw/arm/arm.h" | ||
103 | #include "hw/arm/bcm2835_peripherals.h" | ||
104 | #include "hw/intc/bcm2836_control.h" | ||
105 | |||
106 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/boot.h | ||
107 | similarity index 98% | ||
108 | rename from include/hw/arm/arm.h | ||
109 | rename to include/hw/arm/boot.h | ||
110 | index XXXXXXX..XXXXXXX 100644 | ||
111 | --- a/include/hw/arm/arm.h | ||
112 | +++ b/include/hw/arm/boot.h | ||
113 | @@ -XXX,XX +XXX,XX @@ | ||
114 | /* | ||
115 | - * Misc ARM declarations | ||
116 | + * ARM kernel loader. | ||
117 | * | ||
118 | * Copyright (c) 2006 CodeSourcery. | ||
119 | * Written by Paul Brook | ||
120 | @@ -XXX,XX +XXX,XX @@ | ||
121 | * | ||
122 | */ | ||
123 | |||
124 | -#ifndef HW_ARM_H | ||
125 | -#define HW_ARM_H | ||
126 | +#ifndef HW_ARM_BOOT_H | ||
127 | +#define HW_ARM_BOOT_H | ||
128 | |||
129 | #include "exec/memory.h" | ||
130 | #include "target/arm/cpu-qom.h" | ||
131 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, | ||
132 | const struct arm_boot_info *info, | ||
133 | hwaddr mvbar_addr); | ||
134 | |||
135 | -#endif /* HW_ARM_H */ | ||
136 | +#endif /* HW_ARM_BOOT_H */ | ||
137 | diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h | ||
138 | index XXXXXXX..XXXXXXX 100644 | ||
139 | --- a/include/hw/arm/fsl-imx25.h | ||
140 | +++ b/include/hw/arm/fsl-imx25.h | ||
141 | @@ -XXX,XX +XXX,XX @@ | ||
142 | #ifndef FSL_IMX25_H | ||
143 | #define FSL_IMX25_H | ||
144 | |||
145 | -#include "hw/arm/arm.h" | ||
146 | +#include "hw/arm/boot.h" | ||
147 | #include "hw/intc/imx_avic.h" | ||
148 | #include "hw/misc/imx25_ccm.h" | ||
149 | #include "hw/char/imx_serial.h" | ||
150 | diff --git a/include/hw/arm/fsl-imx31.h b/include/hw/arm/fsl-imx31.h | ||
151 | index XXXXXXX..XXXXXXX 100644 | ||
152 | --- a/include/hw/arm/fsl-imx31.h | ||
153 | +++ b/include/hw/arm/fsl-imx31.h | ||
154 | @@ -XXX,XX +XXX,XX @@ | ||
155 | #ifndef FSL_IMX31_H | ||
156 | #define FSL_IMX31_H | ||
157 | |||
158 | -#include "hw/arm/arm.h" | ||
159 | +#include "hw/arm/boot.h" | ||
160 | #include "hw/intc/imx_avic.h" | ||
161 | #include "hw/misc/imx31_ccm.h" | ||
162 | #include "hw/char/imx_serial.h" | ||
163 | diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h | ||
164 | index XXXXXXX..XXXXXXX 100644 | ||
165 | --- a/include/hw/arm/fsl-imx6.h | ||
166 | +++ b/include/hw/arm/fsl-imx6.h | ||
167 | @@ -XXX,XX +XXX,XX @@ | ||
168 | #ifndef FSL_IMX6_H | ||
169 | #define FSL_IMX6_H | ||
170 | |||
171 | -#include "hw/arm/arm.h" | ||
172 | +#include "hw/arm/boot.h" | ||
173 | #include "hw/cpu/a9mpcore.h" | ||
174 | #include "hw/misc/imx6_ccm.h" | ||
175 | #include "hw/misc/imx6_src.h" | ||
176 | diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h | ||
177 | index XXXXXXX..XXXXXXX 100644 | ||
178 | --- a/include/hw/arm/fsl-imx6ul.h | ||
179 | +++ b/include/hw/arm/fsl-imx6ul.h | ||
180 | @@ -XXX,XX +XXX,XX @@ | ||
181 | #ifndef FSL_IMX6UL_H | ||
182 | #define FSL_IMX6UL_H | ||
183 | |||
184 | -#include "hw/arm/arm.h" | ||
185 | +#include "hw/arm/boot.h" | ||
186 | #include "hw/cpu/a15mpcore.h" | ||
187 | #include "hw/misc/imx6ul_ccm.h" | ||
188 | #include "hw/misc/imx6_src.h" | ||
189 | diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h | ||
190 | index XXXXXXX..XXXXXXX 100644 | ||
191 | --- a/include/hw/arm/fsl-imx7.h | ||
192 | +++ b/include/hw/arm/fsl-imx7.h | ||
193 | @@ -XXX,XX +XXX,XX @@ | ||
194 | #ifndef FSL_IMX7_H | ||
195 | #define FSL_IMX7_H | ||
196 | |||
197 | -#include "hw/arm/arm.h" | ||
198 | +#include "hw/arm/boot.h" | ||
199 | #include "hw/cpu/a15mpcore.h" | ||
200 | #include "hw/intc/imx_gpcv2.h" | ||
201 | #include "hw/misc/imx7_ccm.h" | ||
202 | diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h | ||
203 | index XXXXXXX..XXXXXXX 100644 | ||
204 | --- a/include/hw/arm/virt.h | ||
205 | +++ b/include/hw/arm/virt.h | ||
206 | @@ -XXX,XX +XXX,XX @@ | ||
207 | #include "exec/hwaddr.h" | ||
208 | #include "qemu/notify.h" | ||
209 | #include "hw/boards.h" | ||
210 | -#include "hw/arm/arm.h" | ||
211 | +#include "hw/arm/boot.h" | ||
212 | #include "hw/block/flash.h" | ||
213 | #include "sysemu/kvm.h" | ||
214 | #include "hw/intc/arm_gicv3_common.h" | ||
215 | diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h | ||
216 | index XXXXXXX..XXXXXXX 100644 | ||
217 | --- a/include/hw/arm/xlnx-versal.h | ||
218 | +++ b/include/hw/arm/xlnx-versal.h | ||
219 | @@ -XXX,XX +XXX,XX @@ | ||
220 | #define XLNX_VERSAL_H | ||
221 | |||
222 | #include "hw/sysbus.h" | ||
223 | -#include "hw/arm/arm.h" | ||
224 | +#include "hw/arm/boot.h" | ||
225 | #include "hw/intc/arm_gicv3.h" | ||
226 | |||
227 | #define TYPE_XLNX_VERSAL "xlnx-versal" | ||
228 | diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h | ||
229 | index XXXXXXX..XXXXXXX 100644 | ||
230 | --- a/include/hw/arm/xlnx-zynqmp.h | ||
231 | +++ b/include/hw/arm/xlnx-zynqmp.h | ||
232 | @@ -XXX,XX +XXX,XX @@ | ||
233 | #ifndef XLNX_ZYNQMP_H | ||
234 | |||
235 | #include "qemu-common.h" | ||
236 | -#include "hw/arm/arm.h" | ||
237 | +#include "hw/arm/boot.h" | ||
238 | #include "hw/intc/arm_gic.h" | ||
239 | #include "hw/net/cadence_gem.h" | ||
240 | #include "hw/char/cadence_uart.h" | ||
241 | diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c | ||
242 | index XXXXXXX..XXXXXXX 100644 | ||
243 | --- a/hw/arm/armsse.c | ||
244 | +++ b/hw/arm/armsse.c | ||
245 | @@ -XXX,XX +XXX,XX @@ | ||
246 | #include "hw/sysbus.h" | ||
247 | #include "hw/registerfields.h" | ||
248 | #include "hw/arm/armsse.h" | ||
249 | -#include "hw/arm/arm.h" | ||
250 | +#include "hw/arm/boot.h" | ||
251 | |||
252 | /* Format of the System Information block SYS_CONFIG register */ | ||
253 | typedef enum SysConfigFormat { | ||
254 | diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c | ||
255 | index XXXXXXX..XXXXXXX 100644 | ||
256 | --- a/hw/arm/armv7m.c | ||
257 | +++ b/hw/arm/armv7m.c | ||
258 | @@ -XXX,XX +XXX,XX @@ | ||
259 | #include "qemu-common.h" | ||
260 | #include "cpu.h" | ||
261 | #include "hw/sysbus.h" | ||
262 | -#include "hw/arm/arm.h" | ||
263 | +#include "hw/arm/boot.h" | ||
264 | #include "hw/loader.h" | ||
265 | #include "elf.h" | ||
266 | #include "sysemu/qtest.h" | ||
267 | diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c | ||
268 | index XXXXXXX..XXXXXXX 100644 | ||
269 | --- a/hw/arm/aspeed.c | ||
270 | +++ b/hw/arm/aspeed.c | ||
271 | @@ -XXX,XX +XXX,XX @@ | ||
272 | #include "qemu-common.h" | ||
273 | #include "cpu.h" | ||
274 | #include "exec/address-spaces.h" | ||
275 | -#include "hw/arm/arm.h" | ||
276 | +#include "hw/arm/boot.h" | ||
277 | #include "hw/arm/aspeed.h" | ||
278 | #include "hw/arm/aspeed_soc.h" | ||
279 | #include "hw/boards.h" | ||
280 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | ||
281 | index XXXXXXX..XXXXXXX 100644 | ||
282 | --- a/hw/arm/boot.c | ||
283 | +++ b/hw/arm/boot.c | ||
284 | @@ -XXX,XX +XXX,XX @@ | ||
285 | #include "qapi/error.h" | ||
286 | #include <libfdt.h> | ||
287 | #include "hw/hw.h" | ||
288 | -#include "hw/arm/arm.h" | ||
289 | +#include "hw/arm/boot.h" | ||
290 | #include "hw/arm/linux-boot-if.h" | ||
291 | #include "sysemu/kvm.h" | ||
292 | #include "sysemu/sysemu.h" | ||
293 | diff --git a/hw/arm/collie.c b/hw/arm/collie.c | ||
294 | index XXXXXXX..XXXXXXX 100644 | ||
295 | --- a/hw/arm/collie.c | ||
296 | +++ b/hw/arm/collie.c | ||
297 | @@ -XXX,XX +XXX,XX @@ | ||
298 | #include "hw/sysbus.h" | ||
299 | #include "hw/boards.h" | ||
300 | #include "strongarm.h" | ||
301 | -#include "hw/arm/arm.h" | ||
302 | +#include "hw/arm/boot.h" | ||
303 | #include "hw/block/flash.h" | ||
304 | #include "exec/address-spaces.h" | ||
305 | #include "cpu.h" | ||
306 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | ||
307 | index XXXXXXX..XXXXXXX 100644 | ||
308 | --- a/hw/arm/exynos4210.c | ||
309 | +++ b/hw/arm/exynos4210.c | ||
310 | @@ -XXX,XX +XXX,XX @@ | ||
311 | #include "hw/boards.h" | ||
312 | #include "sysemu/sysemu.h" | ||
313 | #include "hw/sysbus.h" | ||
314 | -#include "hw/arm/arm.h" | ||
315 | +#include "hw/arm/boot.h" | ||
316 | #include "hw/loader.h" | ||
317 | #include "hw/arm/exynos4210.h" | ||
318 | #include "hw/sd/sdhci.h" | ||
319 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | ||
320 | index XXXXXXX..XXXXXXX 100644 | ||
321 | --- a/hw/arm/exynos4_boards.c | ||
322 | +++ b/hw/arm/exynos4_boards.c | ||
323 | @@ -XXX,XX +XXX,XX @@ | ||
324 | #include "sysemu/sysemu.h" | ||
325 | #include "hw/sysbus.h" | ||
326 | #include "net/net.h" | ||
327 | -#include "hw/arm/arm.h" | ||
328 | +#include "hw/arm/boot.h" | ||
329 | #include "exec/address-spaces.h" | ||
330 | #include "hw/arm/exynos4210.h" | ||
331 | #include "hw/net/lan9118.h" | ||
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) | ||
29 | { | 473 | { |
30 | ARMCPU *cpu = arm_env_get_cpu(env); | 474 | diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c |
31 | - CPUState *cs = ENV_GET_CPU(env); | 475 | index XXXXXXX..XXXXXXX 100644 |
32 | uint64_t valid_mask = HCR_MASK; | 476 | --- a/hw/arm/nrf51_soc.c |
33 | 477 | +++ b/hw/arm/nrf51_soc.c | |
34 | if (arm_feature(env, ARM_FEATURE_EL3)) { | 478 | @@ -XXX,XX +XXX,XX @@ |
35 | @@ -XXX,XX +XXX,XX @@ static void hcr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) | 479 | #include "qemu/osdep.h" |
36 | /* Clear RES0 bits. */ | 480 | #include "qapi/error.h" |
37 | value &= valid_mask; | 481 | #include "qemu-common.h" |
38 | 482 | -#include "hw/arm/arm.h" | |
39 | - /* | 483 | +#include "hw/arm/boot.h" |
40 | - * VI and VF are kept in cs->interrupt_request. Modifying that | 484 | #include "hw/sysbus.h" |
41 | - * requires that we have the iothread lock, which is done by | 485 | #include "hw/boards.h" |
42 | - * marking the reginfo structs as ARM_CP_IO. | 486 | #include "hw/misc/unimp.h" |
43 | - * Note that if a write to HCR pends a VIRQ or VFIQ it is never | 487 | diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c |
44 | - * possible for it to be taken immediately, because VIRQ and | 488 | index XXXXXXX..XXXXXXX 100644 |
45 | - * VFIQ are masked unless running at EL0 or EL1, and HCR | 489 | --- a/hw/arm/nseries.c |
46 | - * can only be written at EL2. | 490 | +++ b/hw/arm/nseries.c |
47 | - */ | 491 | @@ -XXX,XX +XXX,XX @@ |
48 | - g_assert(qemu_mutex_iothread_locked()); | 492 | #include "qemu/bswap.h" |
49 | - if (value & HCR_VI) { | 493 | #include "sysemu/sysemu.h" |
50 | - cs->interrupt_request |= CPU_INTERRUPT_VIRQ; | 494 | #include "hw/arm/omap.h" |
51 | - } else { | 495 | -#include "hw/arm/arm.h" |
52 | - cs->interrupt_request &= ~CPU_INTERRUPT_VIRQ; | 496 | +#include "hw/arm/boot.h" |
53 | - } | 497 | #include "hw/irq.h" |
54 | - if (value & HCR_VF) { | 498 | #include "ui/console.h" |
55 | - cs->interrupt_request |= CPU_INTERRUPT_VFIQ; | 499 | #include "hw/boards.h" |
56 | - } else { | 500 | diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c |
57 | - cs->interrupt_request &= ~CPU_INTERRUPT_VFIQ; | 501 | index XXXXXXX..XXXXXXX 100644 |
58 | - } | 502 | --- a/hw/arm/omap1.c |
59 | - value &= ~(HCR_VI | HCR_VF); | 503 | +++ b/hw/arm/omap1.c |
60 | - | 504 | @@ -XXX,XX +XXX,XX @@ |
61 | /* These bits change the MMU setup: | 505 | #include "cpu.h" |
62 | * HCR_VM enables stage 2 translation | 506 | #include "hw/boards.h" |
63 | * HCR_PTW forbids certain page-table setups | 507 | #include "hw/hw.h" |
64 | @@ -XXX,XX +XXX,XX @@ static void hcr_writelow(CPUARMState *env, const ARMCPRegInfo *ri, | 508 | -#include "hw/arm/arm.h" |
65 | hcr_write(env, NULL, value); | 509 | +#include "hw/arm/boot.h" |
66 | } | 510 | #include "hw/arm/omap.h" |
67 | 511 | #include "sysemu/sysemu.h" | |
68 | -static uint64_t hcr_read(CPUARMState *env, const ARMCPRegInfo *ri) | 512 | #include "hw/arm/soc_dma.h" |
69 | -{ | 513 | diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c |
70 | - /* The VI and VF bits live in cs->interrupt_request */ | 514 | index XXXXXXX..XXXXXXX 100644 |
71 | - uint64_t ret = env->cp15.hcr_el2 & ~(HCR_VI | HCR_VF); | 515 | --- a/hw/arm/omap2.c |
72 | - CPUState *cs = ENV_GET_CPU(env); | 516 | +++ b/hw/arm/omap2.c |
73 | - | 517 | @@ -XXX,XX +XXX,XX @@ |
74 | - if (cs->interrupt_request & CPU_INTERRUPT_VIRQ) { | 518 | #include "sysemu/qtest.h" |
75 | - ret |= HCR_VI; | 519 | #include "hw/boards.h" |
76 | - } | 520 | #include "hw/hw.h" |
77 | - if (cs->interrupt_request & CPU_INTERRUPT_VFIQ) { | 521 | -#include "hw/arm/arm.h" |
78 | - ret |= HCR_VF; | 522 | +#include "hw/arm/boot.h" |
79 | - } | 523 | #include "hw/arm/omap.h" |
80 | - return ret; | 524 | #include "sysemu/sysemu.h" |
81 | -} | 525 | #include "qemu/timer.h" |
82 | - | 526 | diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c |
83 | static const ARMCPRegInfo el2_cp_reginfo[] = { | 527 | index XXXXXXX..XXXXXXX 100644 |
84 | { .name = "HCR_EL2", .state = ARM_CP_STATE_AA64, | 528 | --- a/hw/arm/omap_sx1.c |
85 | - .type = ARM_CP_IO, | 529 | +++ b/hw/arm/omap_sx1.c |
86 | .opc0 = 3, .opc1 = 4, .crn = 1, .crm = 1, .opc2 = 0, | 530 | @@ -XXX,XX +XXX,XX @@ |
87 | .access = PL2_RW, .fieldoffset = offsetof(CPUARMState, cp15.hcr_el2), | 531 | #include "ui/console.h" |
88 | - .writefn = hcr_write, .readfn = hcr_read }, | 532 | #include "hw/arm/omap.h" |
89 | + .writefn = hcr_write }, | 533 | #include "hw/boards.h" |
90 | { .name = "HCR", .state = ARM_CP_STATE_AA32, | 534 | -#include "hw/arm/arm.h" |
91 | - .type = ARM_CP_ALIAS | ARM_CP_IO, | 535 | +#include "hw/arm/boot.h" |
92 | + .type = ARM_CP_ALIAS, | 536 | #include "hw/block/flash.h" |
93 | .cp = 15, .opc1 = 4, .crn = 1, .crm = 1, .opc2 = 0, | 537 | #include "sysemu/qtest.h" |
94 | .access = PL2_RW, .fieldoffset = offsetof(CPUARMState, cp15.hcr_el2), | 538 | #include "exec/address-spaces.h" |
95 | - .writefn = hcr_writelow, .readfn = hcr_read }, | 539 | diff --git a/hw/arm/palm.c b/hw/arm/palm.c |
96 | + .writefn = hcr_writelow }, | 540 | index XXXXXXX..XXXXXXX 100644 |
97 | { .name = "ELR_EL2", .state = ARM_CP_STATE_AA64, | 541 | --- a/hw/arm/palm.c |
98 | .type = ARM_CP_ALIAS, | 542 | +++ b/hw/arm/palm.c |
99 | .opc0 = 3, .opc1 = 4, .crn = 4, .crm = 0, .opc2 = 1, | 543 | @@ -XXX,XX +XXX,XX @@ |
100 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo el2_cp_reginfo[] = { | 544 | #include "ui/console.h" |
101 | 545 | #include "hw/arm/omap.h" | |
102 | static const ARMCPRegInfo el2_v8_cp_reginfo[] = { | 546 | #include "hw/boards.h" |
103 | { .name = "HCR2", .state = ARM_CP_STATE_AA32, | 547 | -#include "hw/arm/arm.h" |
104 | - .type = ARM_CP_ALIAS | ARM_CP_IO, | 548 | +#include "hw/arm/boot.h" |
105 | + .type = ARM_CP_ALIAS, | 549 | #include "hw/input/tsc2xxx.h" |
106 | .cp = 15, .opc1 = 4, .crn = 1, .crm = 1, .opc2 = 4, | 550 | #include "hw/loader.h" |
107 | .access = PL2_RW, | 551 | #include "exec/address-spaces.h" |
108 | .fieldoffset = offsetofhigh32(CPUARMState, cp15.hcr_el2), | 552 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c |
553 | index XXXXXXX..XXXXXXX 100644 | ||
554 | --- a/hw/arm/raspi.c | ||
555 | +++ b/hw/arm/raspi.c | ||
556 | @@ -XXX,XX +XXX,XX @@ | ||
557 | #include "qemu/error-report.h" | ||
558 | #include "hw/boards.h" | ||
559 | #include "hw/loader.h" | ||
560 | -#include "hw/arm/arm.h" | ||
561 | +#include "hw/arm/boot.h" | ||
562 | #include "sysemu/sysemu.h" | ||
563 | |||
564 | #define SMPBOOT_ADDR 0x300 /* this should leave enough space for ATAGS */ | ||
565 | diff --git a/hw/arm/realview.c b/hw/arm/realview.c | ||
566 | index XXXXXXX..XXXXXXX 100644 | ||
567 | --- a/hw/arm/realview.c | ||
568 | +++ b/hw/arm/realview.c | ||
569 | @@ -XXX,XX +XXX,XX @@ | ||
570 | #include "qemu-common.h" | ||
571 | #include "cpu.h" | ||
572 | #include "hw/sysbus.h" | ||
573 | -#include "hw/arm/arm.h" | ||
574 | +#include "hw/arm/boot.h" | ||
575 | #include "hw/arm/primecell.h" | ||
576 | #include "hw/net/lan9118.h" | ||
577 | #include "hw/net/smc91c111.h" | ||
578 | diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c | ||
579 | index XXXXXXX..XXXXXXX 100644 | ||
580 | --- a/hw/arm/spitz.c | ||
581 | +++ b/hw/arm/spitz.c | ||
582 | @@ -XXX,XX +XXX,XX @@ | ||
583 | #include "qapi/error.h" | ||
584 | #include "hw/hw.h" | ||
585 | #include "hw/arm/pxa.h" | ||
586 | -#include "hw/arm/arm.h" | ||
587 | +#include "hw/arm/boot.h" | ||
588 | #include "sysemu/sysemu.h" | ||
589 | #include "hw/pcmcia.h" | ||
590 | #include "hw/i2c/i2c.h" | ||
591 | diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c | ||
592 | index XXXXXXX..XXXXXXX 100644 | ||
593 | --- a/hw/arm/stellaris.c | ||
594 | +++ b/hw/arm/stellaris.c | ||
595 | @@ -XXX,XX +XXX,XX @@ | ||
596 | #include "qapi/error.h" | ||
597 | #include "hw/sysbus.h" | ||
598 | #include "hw/ssi/ssi.h" | ||
599 | -#include "hw/arm/arm.h" | ||
600 | +#include "hw/arm/boot.h" | ||
601 | #include "qemu/timer.h" | ||
602 | #include "hw/i2c/i2c.h" | ||
603 | #include "net/net.h" | ||
604 | diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c | ||
605 | index XXXXXXX..XXXXXXX 100644 | ||
606 | --- a/hw/arm/stm32f205_soc.c | ||
607 | +++ b/hw/arm/stm32f205_soc.c | ||
608 | @@ -XXX,XX +XXX,XX @@ | ||
609 | #include "qemu/osdep.h" | ||
610 | #include "qapi/error.h" | ||
611 | #include "qemu-common.h" | ||
612 | -#include "hw/arm/arm.h" | ||
613 | +#include "hw/arm/boot.h" | ||
614 | #include "exec/address-spaces.h" | ||
615 | #include "hw/arm/stm32f205_soc.h" | ||
616 | |||
617 | diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c | ||
618 | index XXXXXXX..XXXXXXX 100644 | ||
619 | --- a/hw/arm/strongarm.c | ||
620 | +++ b/hw/arm/strongarm.c | ||
621 | @@ -XXX,XX +XXX,XX @@ | ||
622 | #include "hw/sysbus.h" | ||
623 | #include "strongarm.h" | ||
624 | #include "qemu/error-report.h" | ||
625 | -#include "hw/arm/arm.h" | ||
626 | +#include "hw/arm/boot.h" | ||
627 | #include "chardev/char-fe.h" | ||
628 | #include "chardev/char-serial.h" | ||
629 | #include "sysemu/sysemu.h" | ||
630 | diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c | ||
631 | index XXXXXXX..XXXXXXX 100644 | ||
632 | --- a/hw/arm/tosa.c | ||
633 | +++ b/hw/arm/tosa.c | ||
634 | @@ -XXX,XX +XXX,XX @@ | ||
635 | #include "qapi/error.h" | ||
636 | #include "hw/hw.h" | ||
637 | #include "hw/arm/pxa.h" | ||
638 | -#include "hw/arm/arm.h" | ||
639 | +#include "hw/arm/boot.h" | ||
640 | #include "hw/arm/sharpsl.h" | ||
641 | #include "hw/pcmcia.h" | ||
642 | #include "hw/boards.h" | ||
643 | diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c | ||
644 | index XXXXXXX..XXXXXXX 100644 | ||
645 | --- a/hw/arm/versatilepb.c | ||
646 | +++ b/hw/arm/versatilepb.c | ||
647 | @@ -XXX,XX +XXX,XX @@ | ||
648 | #include "qemu-common.h" | ||
649 | #include "cpu.h" | ||
650 | #include "hw/sysbus.h" | ||
651 | -#include "hw/arm/arm.h" | ||
652 | +#include "hw/arm/boot.h" | ||
653 | #include "hw/net/smc91c111.h" | ||
654 | #include "net/net.h" | ||
655 | #include "sysemu/sysemu.h" | ||
656 | diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c | ||
657 | index XXXXXXX..XXXXXXX 100644 | ||
658 | --- a/hw/arm/vexpress.c | ||
659 | +++ b/hw/arm/vexpress.c | ||
660 | @@ -XXX,XX +XXX,XX @@ | ||
661 | #include "qemu-common.h" | ||
662 | #include "cpu.h" | ||
663 | #include "hw/sysbus.h" | ||
664 | -#include "hw/arm/arm.h" | ||
665 | +#include "hw/arm/boot.h" | ||
666 | #include "hw/arm/primecell.h" | ||
667 | #include "hw/net/lan9118.h" | ||
668 | #include "hw/i2c/i2c.h" | ||
669 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | ||
670 | index XXXXXXX..XXXXXXX 100644 | ||
671 | --- a/hw/arm/virt.c | ||
672 | +++ b/hw/arm/virt.c | ||
673 | @@ -XXX,XX +XXX,XX @@ | ||
674 | #include "qemu/option.h" | ||
675 | #include "qapi/error.h" | ||
676 | #include "hw/sysbus.h" | ||
677 | -#include "hw/arm/arm.h" | ||
678 | +#include "hw/arm/boot.h" | ||
679 | #include "hw/arm/primecell.h" | ||
680 | #include "hw/arm/virt.h" | ||
681 | #include "hw/block/flash.h" | ||
682 | diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c | ||
683 | index XXXXXXX..XXXXXXX 100644 | ||
684 | --- a/hw/arm/xilinx_zynq.c | ||
685 | +++ b/hw/arm/xilinx_zynq.c | ||
686 | @@ -XXX,XX +XXX,XX @@ | ||
687 | #include "qemu-common.h" | ||
688 | #include "cpu.h" | ||
689 | #include "hw/sysbus.h" | ||
690 | -#include "hw/arm/arm.h" | ||
691 | +#include "hw/arm/boot.h" | ||
692 | #include "net/net.h" | ||
693 | #include "exec/address-spaces.h" | ||
694 | #include "sysemu/sysemu.h" | ||
695 | diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c | ||
696 | index XXXXXXX..XXXXXXX 100644 | ||
697 | --- a/hw/arm/xlnx-versal.c | ||
698 | +++ b/hw/arm/xlnx-versal.c | ||
699 | @@ -XXX,XX +XXX,XX @@ | ||
700 | #include "net/net.h" | ||
701 | #include "sysemu/sysemu.h" | ||
702 | #include "sysemu/kvm.h" | ||
703 | -#include "hw/arm/arm.h" | ||
704 | +#include "hw/arm/boot.h" | ||
705 | #include "kvm_arm.h" | ||
706 | #include "hw/misc/unimp.h" | ||
707 | #include "hw/intc/arm_gicv3_common.h" | ||
708 | diff --git a/hw/arm/z2.c b/hw/arm/z2.c | ||
709 | index XXXXXXX..XXXXXXX 100644 | ||
710 | --- a/hw/arm/z2.c | ||
711 | +++ b/hw/arm/z2.c | ||
712 | @@ -XXX,XX +XXX,XX @@ | ||
713 | #include "qemu/osdep.h" | ||
714 | #include "hw/hw.h" | ||
715 | #include "hw/arm/pxa.h" | ||
716 | -#include "hw/arm/arm.h" | ||
717 | +#include "hw/arm/boot.h" | ||
718 | #include "hw/i2c/i2c.h" | ||
719 | #include "hw/ssi/ssi.h" | ||
720 | #include "hw/boards.h" | ||
109 | -- | 721 | -- |
110 | 2.19.1 | 722 | 2.20.1 |
111 | 723 | ||
112 | 724 | diff view generated by jsdifflib |
1 | Before we supported direct execution from MMIO regions, we | 1 | In ich_vmcr_write() we enforce "writes of BPR fields to less than |
---|---|---|---|
2 | implemented workarounds in commit 720424359917887c926a33d2 | 2 | their minimum sets them to the minimum" by doing a "read vbpr and |
3 | which let us avoid doing so, even if the SAU or MPU region | 3 | write it back" operation. A typo here meant that we weren't handling |
4 | was less than page-sized. | 4 | writes to these fields correctly, because we were reading from VBPR0 |
5 | 5 | but writing to VBPR1. | |
6 | Once we implemented execute-from-MMIO, we removed part | ||
7 | of those workarounds in commit d4b6275df320cee76; but | ||
8 | we forgot the one in get_phys_addr_pmsav8() which | ||
9 | suppressed use of small SAU regions in executable regions. | ||
10 | Remove that workaround now. | ||
11 | 6 | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
13 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
14 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 9 | Message-id: 20190520162809.2677-4-peter.maydell@linaro.org |
15 | Message-id: 20181106163801.14474-1-peter.maydell@linaro.org | ||
16 | --- | 10 | --- |
17 | target/arm/helper.c | 12 ------------ | 11 | hw/intc/arm_gicv3_cpuif.c | 2 +- |
18 | 1 file changed, 12 deletions(-) | 12 | 1 file changed, 1 insertion(+), 1 deletion(-) |
19 | 13 | ||
20 | diff --git a/target/arm/helper.c b/target/arm/helper.c | 14 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c |
21 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/target/arm/helper.c | 16 | --- a/hw/intc/arm_gicv3_cpuif.c |
23 | +++ b/target/arm/helper.c | 17 | +++ b/hw/intc/arm_gicv3_cpuif.c |
24 | @@ -XXX,XX +XXX,XX @@ static bool get_phys_addr_pmsav8(CPUARMState *env, uint32_t address, | 18 | @@ -XXX,XX +XXX,XX @@ static void ich_vmcr_write(CPUARMState *env, const ARMCPRegInfo *ri, |
25 | 19 | /* Enforce "writing BPRs to less than minimum sets them to the minimum" | |
26 | ret = pmsav8_mpu_lookup(env, address, access_type, mmu_idx, phys_ptr, | 20 | * by reading and writing back the fields. |
27 | txattrs, prot, &mpu_is_subpage, fi, NULL); | 21 | */ |
28 | - /* | 22 | - write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G0)); |
29 | - * TODO: this is a temporary hack to ignore the fact that the SAU region | 23 | + write_vbpr(cs, GICV3_G0, read_vbpr(cs, GICV3_G0)); |
30 | - * is smaller than a page if this is an executable region. We never | 24 | write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G1)); |
31 | - * supported small MPU regions, but we did (accidentally) allow small | 25 | |
32 | - * SAU regions, and if we now made small SAU regions not be executable | 26 | gicv3_cpuif_virt_update(cs); |
33 | - * then this would break previously working guest code. We can't | ||
34 | - * remove this until/unless we implement support for execution from | ||
35 | - * small regions. | ||
36 | - */ | ||
37 | - if (*prot & PAGE_EXEC) { | ||
38 | - sattrs.subpage = false; | ||
39 | - } | ||
40 | *page_size = sattrs.subpage || mpu_is_subpage ? 1 : TARGET_PAGE_SIZE; | ||
41 | return ret; | ||
42 | } | ||
43 | -- | 27 | -- |
44 | 2.19.1 | 28 | 2.20.1 |
45 | 29 | ||
46 | 30 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Remove a TODO comment about implementing the vectored interrupt | ||
2 | controller. We have had an implementation of that for a decade; | ||
3 | it's in hw/intc/pl190.c. | ||
4 | 1 | ||
5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20181106164118.16184-1-peter.maydell@linaro.org | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
9 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
10 | --- | ||
11 | target/arm/helper.c | 1 - | ||
12 | 1 file changed, 1 deletion(-) | ||
13 | |||
14 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/target/arm/helper.c | ||
17 | +++ b/target/arm/helper.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_do_interrupt_aarch32(CPUState *cs) | ||
19 | return; | ||
20 | } | ||
21 | |||
22 | - /* TODO: Vectored interrupt controller. */ | ||
23 | switch (cs->exception_index) { | ||
24 | case EXCP_UDEF: | ||
25 | new_mode = ARM_CPU_MODE_UND; | ||
26 | -- | ||
27 | 2.19.1 | ||
28 | |||
29 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Thomas Huth <thuth@redhat.com> | ||
2 | 1 | ||
3 | There is no active maintainer, but since Peter is picking up | ||
4 | patches via qemu-arm@nongnu.org, I think we could at least use | ||
5 | "Odd Fixes" as status here. | ||
6 | |||
7 | Signed-off-by: Thomas Huth <thuth@redhat.com> | ||
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 1541528230-31817-1-git-send-email-thuth@redhat.com | ||
10 | [PMM: Also add myself as an M: contact] | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | --- | ||
13 | MAINTAINERS | 7 +++++++ | ||
14 | 1 file changed, 7 insertions(+) | ||
15 | |||
16 | diff --git a/MAINTAINERS b/MAINTAINERS | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/MAINTAINERS | ||
19 | +++ b/MAINTAINERS | ||
20 | @@ -XXX,XX +XXX,XX @@ F: hw/*/pxa2xx* | ||
21 | F: hw/misc/mst_fpga.c | ||
22 | F: include/hw/arm/pxa.h | ||
23 | |||
24 | +Sharp SL-5500 (Collie) PDA | ||
25 | +M: Peter Maydell <peter.maydell@linaro.org> | ||
26 | +L: qemu-arm@nongnu.org | ||
27 | +S: Odd Fixes | ||
28 | +F: hw/arm/collie.c | ||
29 | +F: hw/arm/strongarm* | ||
30 | + | ||
31 | Stellaris | ||
32 | M: Peter Maydell <peter.maydell@linaro.org> | ||
33 | L: qemu-arm@nongnu.org | ||
34 | -- | ||
35 | 2.19.1 | ||
36 | |||
37 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Alex Bennée <alex.bennee@linaro.org> | ||
2 | 1 | ||
3 | This only fails with some (broken) versions of gdb but we should | ||
4 | treat the top bits of DBGBVR as RESS. Properly sign extend QEMU's | ||
5 | reference copy of dbgbvr and also update the register descriptions in | ||
6 | the comment. | ||
7 | |||
8 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | ||
9 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
10 | Message-id: 20181109152119.9242-2-alex.bennee@linaro.org | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | --- | ||
13 | target/arm/kvm64.c | 17 +++++++++++++++-- | ||
14 | 1 file changed, 15 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/target/arm/kvm64.c | ||
19 | +++ b/target/arm/kvm64.c | ||
20 | @@ -XXX,XX +XXX,XX @@ static void kvm_arm_init_debug(CPUState *cs) | ||
21 | * capable of fancier matching but that will require exposing that | ||
22 | * fanciness to GDB's interface | ||
23 | * | ||
24 | - * D7.3.2 DBGBCR<n>_EL1, Debug Breakpoint Control Registers | ||
25 | + * DBGBCR<n>_EL1, Debug Breakpoint Control Registers | ||
26 | * | ||
27 | * 31 24 23 20 19 16 15 14 13 12 9 8 5 4 3 2 1 0 | ||
28 | * +------+------+-------+-----+----+------+-----+------+-----+---+ | ||
29 | @@ -XXX,XX +XXX,XX @@ static void kvm_arm_init_debug(CPUState *cs) | ||
30 | * SSC/HMC/PMC: Security, Higher and Priv access control (Table D-12) | ||
31 | * BAS: Byte Address Select (RES1 for AArch64) | ||
32 | * E: Enable bit | ||
33 | + * | ||
34 | + * DBGBVR<n>_EL1, Debug Breakpoint Value Registers | ||
35 | + * | ||
36 | + * 63 53 52 49 48 2 1 0 | ||
37 | + * +------+-----------+----------+-----+ | ||
38 | + * | RESS | VA[52:49] | VA[48:2] | 0 0 | | ||
39 | + * +------+-----------+----------+-----+ | ||
40 | + * | ||
41 | + * Depending on the addressing mode bits the top bits of the register | ||
42 | + * are a sign extension of the highest applicable VA bit. Some | ||
43 | + * versions of GDB don't do it correctly so we ensure they are correct | ||
44 | + * here so future PC comparisons will work properly. | ||
45 | */ | ||
46 | + | ||
47 | static int insert_hw_breakpoint(target_ulong addr) | ||
48 | { | ||
49 | HWBreakpoint brk = { | ||
50 | .bcr = 0x1, /* BCR E=1, enable */ | ||
51 | - .bvr = addr | ||
52 | + .bvr = sextract64(addr, 0, 53) | ||
53 | }; | ||
54 | |||
55 | if (cur_hw_bps >= max_hw_bps) { | ||
56 | -- | ||
57 | 2.19.1 | ||
58 | |||
59 | diff view generated by jsdifflib |
1 | Hyp mode is an exception to the general rule that each AArch32 | 1 | The ICC_CTLR_EL3 register includes some bits which are aliases |
---|---|---|---|
2 | mode has its own r13, r14 and SPSR -- it has a banked r13 and | 2 | of bits in the ICC_CTLR_EL1(S) and (NS) registers. QEMU chooses |
3 | SPSR but shares its r14 with User and System mode. We were | 3 | to keep those bits in the cs->icc_ctlr_el1[] struct fields. |
4 | incorrectly implementing it as banked, which meant that on | 4 | Unfortunately a missing '~' in the code to update the bits |
5 | entry to Hyp mode r14 was 0 rather than the USR/SYS r14. | 5 | in those fields meant that writing to ICC_CTLR_EL3 would corrupt |
6 | 6 | the ICC_CLTR_EL1 register values. | |
7 | We provide a new function r14_bank_number() which is like | ||
8 | the existing bank_number() but provides the index into | ||
9 | env->banked_r14[]; bank_number() provides the index to use | ||
10 | for env->banked_r13[] and env->banked_cpsr[]. | ||
11 | |||
12 | All the points in the code that were using bank_number() | ||
13 | to index into env->banked_r14[] are updated for consintency: | ||
14 | * switch_mode() -- this is the only place where we fix | ||
15 | an actual bug | ||
16 | * aarch64_sync_32_to_64() and aarch64_sync_64_to_32(): | ||
17 | no behavioural change as we already special-cased Hyp R14 | ||
18 | * kvm32.c: no behavioural change since the guest can't ever | ||
19 | be in Hyp mode, but conceptually the right thing to do | ||
20 | * msr_banked()/mrs_banked(): we can never get to the case | ||
21 | that accesses banked_r14[] with tgtmode == ARM_CPU_MODE_HYP, | ||
22 | so no behavioural change | ||
23 | 7 | ||
24 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
25 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 9 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
26 | Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> | 10 | Message-id: 20190520162809.2677-5-peter.maydell@linaro.org |
27 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
28 | Message-id: 20181109173553.22341-2-peter.maydell@linaro.org | ||
29 | --- | 11 | --- |
30 | target/arm/internals.h | 16 ++++++++++++++++ | 12 | hw/intc/arm_gicv3_cpuif.c | 4 ++-- |
31 | target/arm/helper.c | 29 +++++++++++++++-------------- | 13 | 1 file changed, 2 insertions(+), 2 deletions(-) |
32 | target/arm/kvm32.c | 4 ++-- | ||
33 | target/arm/op_helper.c | 4 ++-- | ||
34 | 4 files changed, 35 insertions(+), 18 deletions(-) | ||
35 | 14 | ||
36 | diff --git a/target/arm/internals.h b/target/arm/internals.h | 15 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c |
37 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
38 | --- a/target/arm/internals.h | 17 | --- a/hw/intc/arm_gicv3_cpuif.c |
39 | +++ b/target/arm/internals.h | 18 | +++ b/hw/intc/arm_gicv3_cpuif.c |
40 | @@ -XXX,XX +XXX,XX @@ static inline int bank_number(int mode) | 19 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, |
41 | g_assert_not_reached(); | 20 | trace_gicv3_icc_ctlr_el3_write(gicv3_redist_affid(cs), value); |
42 | } | 21 | |
43 | 22 | /* *_EL1NS and *_EL1S bits are aliases into the ICC_CTLR_EL1 bits. */ | |
44 | +/** | 23 | - cs->icc_ctlr_el1[GICV3_NS] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); |
45 | + * r14_bank_number: Map CPU mode onto register bank for r14 | 24 | + cs->icc_ctlr_el1[GICV3_NS] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); |
46 | + * | 25 | if (value & ICC_CTLR_EL3_EOIMODE_EL1NS) { |
47 | + * Given an AArch32 CPU mode, return the index into the saved register | 26 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_EOIMODE; |
48 | + * banks to use for the R14 (LR) in that mode. This is the same as | ||
49 | + * bank_number(), except for the special case of Hyp mode, where | ||
50 | + * R14 is shared with USR and SYS, unlike its R13 and SPSR. | ||
51 | + * This should be used as the index into env->banked_r14[], and | ||
52 | + * bank_number() used for the index into env->banked_r13[] and | ||
53 | + * env->banked_spsr[]. | ||
54 | + */ | ||
55 | +static inline int r14_bank_number(int mode) | ||
56 | +{ | ||
57 | + return (mode == ARM_CPU_MODE_HYP) ? BANK_USRSYS : bank_number(mode); | ||
58 | +} | ||
59 | + | ||
60 | void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu); | ||
61 | void arm_translate_init(void); | ||
62 | |||
63 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
64 | index XXXXXXX..XXXXXXX 100644 | ||
65 | --- a/target/arm/helper.c | ||
66 | +++ b/target/arm/helper.c | ||
67 | @@ -XXX,XX +XXX,XX @@ static void switch_mode(CPUARMState *env, int mode) | ||
68 | |||
69 | i = bank_number(old_mode); | ||
70 | env->banked_r13[i] = env->regs[13]; | ||
71 | - env->banked_r14[i] = env->regs[14]; | ||
72 | env->banked_spsr[i] = env->spsr; | ||
73 | |||
74 | i = bank_number(mode); | ||
75 | env->regs[13] = env->banked_r13[i]; | ||
76 | - env->regs[14] = env->banked_r14[i]; | ||
77 | env->spsr = env->banked_spsr[i]; | ||
78 | + | ||
79 | + env->banked_r14[r14_bank_number(old_mode)] = env->regs[14]; | ||
80 | + env->regs[14] = env->banked_r14[r14_bank_number(mode)]; | ||
81 | } | ||
82 | |||
83 | /* Physical Interrupt Target EL Lookup Table | ||
84 | @@ -XXX,XX +XXX,XX @@ void aarch64_sync_32_to_64(CPUARMState *env) | ||
85 | if (mode == ARM_CPU_MODE_HYP) { | ||
86 | env->xregs[14] = env->regs[14]; | ||
87 | } else { | ||
88 | - env->xregs[14] = env->banked_r14[bank_number(ARM_CPU_MODE_USR)]; | ||
89 | + env->xregs[14] = env->banked_r14[r14_bank_number(ARM_CPU_MODE_USR)]; | ||
90 | } | ||
91 | } | 27 | } |
92 | 28 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, | |
93 | @@ -XXX,XX +XXX,XX @@ void aarch64_sync_32_to_64(CPUARMState *env) | 29 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_CBPR; |
94 | env->xregs[16] = env->regs[14]; | ||
95 | env->xregs[17] = env->regs[13]; | ||
96 | } else { | ||
97 | - env->xregs[16] = env->banked_r14[bank_number(ARM_CPU_MODE_IRQ)]; | ||
98 | + env->xregs[16] = env->banked_r14[r14_bank_number(ARM_CPU_MODE_IRQ)]; | ||
99 | env->xregs[17] = env->banked_r13[bank_number(ARM_CPU_MODE_IRQ)]; | ||
100 | } | 30 | } |
101 | 31 | ||
102 | @@ -XXX,XX +XXX,XX @@ void aarch64_sync_32_to_64(CPUARMState *env) | 32 | - cs->icc_ctlr_el1[GICV3_S] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); |
103 | env->xregs[18] = env->regs[14]; | 33 | + cs->icc_ctlr_el1[GICV3_S] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); |
104 | env->xregs[19] = env->regs[13]; | 34 | if (value & ICC_CTLR_EL3_EOIMODE_EL1S) { |
105 | } else { | 35 | cs->icc_ctlr_el1[GICV3_S] |= ICC_CTLR_EL1_EOIMODE; |
106 | - env->xregs[18] = env->banked_r14[bank_number(ARM_CPU_MODE_SVC)]; | ||
107 | + env->xregs[18] = env->banked_r14[r14_bank_number(ARM_CPU_MODE_SVC)]; | ||
108 | env->xregs[19] = env->banked_r13[bank_number(ARM_CPU_MODE_SVC)]; | ||
109 | } | 36 | } |
110 | |||
111 | @@ -XXX,XX +XXX,XX @@ void aarch64_sync_32_to_64(CPUARMState *env) | ||
112 | env->xregs[20] = env->regs[14]; | ||
113 | env->xregs[21] = env->regs[13]; | ||
114 | } else { | ||
115 | - env->xregs[20] = env->banked_r14[bank_number(ARM_CPU_MODE_ABT)]; | ||
116 | + env->xregs[20] = env->banked_r14[r14_bank_number(ARM_CPU_MODE_ABT)]; | ||
117 | env->xregs[21] = env->banked_r13[bank_number(ARM_CPU_MODE_ABT)]; | ||
118 | } | ||
119 | |||
120 | @@ -XXX,XX +XXX,XX @@ void aarch64_sync_32_to_64(CPUARMState *env) | ||
121 | env->xregs[22] = env->regs[14]; | ||
122 | env->xregs[23] = env->regs[13]; | ||
123 | } else { | ||
124 | - env->xregs[22] = env->banked_r14[bank_number(ARM_CPU_MODE_UND)]; | ||
125 | + env->xregs[22] = env->banked_r14[r14_bank_number(ARM_CPU_MODE_UND)]; | ||
126 | env->xregs[23] = env->banked_r13[bank_number(ARM_CPU_MODE_UND)]; | ||
127 | } | ||
128 | |||
129 | @@ -XXX,XX +XXX,XX @@ void aarch64_sync_32_to_64(CPUARMState *env) | ||
130 | env->xregs[i] = env->fiq_regs[i - 24]; | ||
131 | } | ||
132 | env->xregs[29] = env->banked_r13[bank_number(ARM_CPU_MODE_FIQ)]; | ||
133 | - env->xregs[30] = env->banked_r14[bank_number(ARM_CPU_MODE_FIQ)]; | ||
134 | + env->xregs[30] = env->banked_r14[r14_bank_number(ARM_CPU_MODE_FIQ)]; | ||
135 | } | ||
136 | |||
137 | env->pc = env->regs[15]; | ||
138 | @@ -XXX,XX +XXX,XX @@ void aarch64_sync_64_to_32(CPUARMState *env) | ||
139 | if (mode == ARM_CPU_MODE_HYP) { | ||
140 | env->regs[14] = env->xregs[14]; | ||
141 | } else { | ||
142 | - env->banked_r14[bank_number(ARM_CPU_MODE_USR)] = env->xregs[14]; | ||
143 | + env->banked_r14[r14_bank_number(ARM_CPU_MODE_USR)] = env->xregs[14]; | ||
144 | } | ||
145 | } | ||
146 | |||
147 | @@ -XXX,XX +XXX,XX @@ void aarch64_sync_64_to_32(CPUARMState *env) | ||
148 | env->regs[14] = env->xregs[16]; | ||
149 | env->regs[13] = env->xregs[17]; | ||
150 | } else { | ||
151 | - env->banked_r14[bank_number(ARM_CPU_MODE_IRQ)] = env->xregs[16]; | ||
152 | + env->banked_r14[r14_bank_number(ARM_CPU_MODE_IRQ)] = env->xregs[16]; | ||
153 | env->banked_r13[bank_number(ARM_CPU_MODE_IRQ)] = env->xregs[17]; | ||
154 | } | ||
155 | |||
156 | @@ -XXX,XX +XXX,XX @@ void aarch64_sync_64_to_32(CPUARMState *env) | ||
157 | env->regs[14] = env->xregs[18]; | ||
158 | env->regs[13] = env->xregs[19]; | ||
159 | } else { | ||
160 | - env->banked_r14[bank_number(ARM_CPU_MODE_SVC)] = env->xregs[18]; | ||
161 | + env->banked_r14[r14_bank_number(ARM_CPU_MODE_SVC)] = env->xregs[18]; | ||
162 | env->banked_r13[bank_number(ARM_CPU_MODE_SVC)] = env->xregs[19]; | ||
163 | } | ||
164 | |||
165 | @@ -XXX,XX +XXX,XX @@ void aarch64_sync_64_to_32(CPUARMState *env) | ||
166 | env->regs[14] = env->xregs[20]; | ||
167 | env->regs[13] = env->xregs[21]; | ||
168 | } else { | ||
169 | - env->banked_r14[bank_number(ARM_CPU_MODE_ABT)] = env->xregs[20]; | ||
170 | + env->banked_r14[r14_bank_number(ARM_CPU_MODE_ABT)] = env->xregs[20]; | ||
171 | env->banked_r13[bank_number(ARM_CPU_MODE_ABT)] = env->xregs[21]; | ||
172 | } | ||
173 | |||
174 | @@ -XXX,XX +XXX,XX @@ void aarch64_sync_64_to_32(CPUARMState *env) | ||
175 | env->regs[14] = env->xregs[22]; | ||
176 | env->regs[13] = env->xregs[23]; | ||
177 | } else { | ||
178 | - env->banked_r14[bank_number(ARM_CPU_MODE_UND)] = env->xregs[22]; | ||
179 | + env->banked_r14[r14_bank_number(ARM_CPU_MODE_UND)] = env->xregs[22]; | ||
180 | env->banked_r13[bank_number(ARM_CPU_MODE_UND)] = env->xregs[23]; | ||
181 | } | ||
182 | |||
183 | @@ -XXX,XX +XXX,XX @@ void aarch64_sync_64_to_32(CPUARMState *env) | ||
184 | env->fiq_regs[i - 24] = env->xregs[i]; | ||
185 | } | ||
186 | env->banked_r13[bank_number(ARM_CPU_MODE_FIQ)] = env->xregs[29]; | ||
187 | - env->banked_r14[bank_number(ARM_CPU_MODE_FIQ)] = env->xregs[30]; | ||
188 | + env->banked_r14[r14_bank_number(ARM_CPU_MODE_FIQ)] = env->xregs[30]; | ||
189 | } | ||
190 | |||
191 | env->regs[15] = env->pc; | ||
192 | diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c | ||
193 | index XXXXXXX..XXXXXXX 100644 | ||
194 | --- a/target/arm/kvm32.c | ||
195 | +++ b/target/arm/kvm32.c | ||
196 | @@ -XXX,XX +XXX,XX @@ int kvm_arch_put_registers(CPUState *cs, int level) | ||
197 | memcpy(env->usr_regs, env->regs + 8, 5 * sizeof(uint32_t)); | ||
198 | } | ||
199 | env->banked_r13[bn] = env->regs[13]; | ||
200 | - env->banked_r14[bn] = env->regs[14]; | ||
201 | env->banked_spsr[bn] = env->spsr; | ||
202 | + env->banked_r14[r14_bank_number(mode)] = env->regs[14]; | ||
203 | |||
204 | /* Now we can safely copy stuff down to the kernel */ | ||
205 | for (i = 0; i < ARRAY_SIZE(regs); i++) { | ||
206 | @@ -XXX,XX +XXX,XX @@ int kvm_arch_get_registers(CPUState *cs) | ||
207 | memcpy(env->regs + 8, env->usr_regs, 5 * sizeof(uint32_t)); | ||
208 | } | ||
209 | env->regs[13] = env->banked_r13[bn]; | ||
210 | - env->regs[14] = env->banked_r14[bn]; | ||
211 | env->spsr = env->banked_spsr[bn]; | ||
212 | + env->regs[14] = env->banked_r14[r14_bank_number(mode)]; | ||
213 | |||
214 | /* VFP registers */ | ||
215 | r.id = KVM_REG_ARM | KVM_REG_SIZE_U64 | KVM_REG_ARM_VFP; | ||
216 | diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c | ||
217 | index XXXXXXX..XXXXXXX 100644 | ||
218 | --- a/target/arm/op_helper.c | ||
219 | +++ b/target/arm/op_helper.c | ||
220 | @@ -XXX,XX +XXX,XX @@ void HELPER(msr_banked)(CPUARMState *env, uint32_t value, uint32_t tgtmode, | ||
221 | env->banked_r13[bank_number(tgtmode)] = value; | ||
222 | break; | ||
223 | case 14: | ||
224 | - env->banked_r14[bank_number(tgtmode)] = value; | ||
225 | + env->banked_r14[r14_bank_number(tgtmode)] = value; | ||
226 | break; | ||
227 | case 8 ... 12: | ||
228 | switch (tgtmode) { | ||
229 | @@ -XXX,XX +XXX,XX @@ uint32_t HELPER(mrs_banked)(CPUARMState *env, uint32_t tgtmode, uint32_t regno) | ||
230 | case 13: | ||
231 | return env->banked_r13[bank_number(tgtmode)]; | ||
232 | case 14: | ||
233 | - return env->banked_r14[bank_number(tgtmode)]; | ||
234 | + return env->banked_r14[r14_bank_number(tgtmode)]; | ||
235 | case 8 ... 12: | ||
236 | switch (tgtmode) { | ||
237 | case ARM_CPU_MODE_USR: | ||
238 | -- | 37 | -- |
239 | 2.19.1 | 38 | 2.20.1 |
240 | 39 | ||
241 | 40 | diff view generated by jsdifflib |
1 | From: Alex Bennée <alex.bennee@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | You should declare you are using a global version of a variable before | 3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
4 | you attempt to modify it in a function. | 4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> |
5 | 5 | Message-id: 20190520214342.13709-2-philmd@redhat.com | |
6 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | ||
7 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Message-id: 20181109152119.9242-5-alex.bennee@linaro.org | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
11 | --- | 7 | --- |
12 | tests/guest-debug/test-gdbstub.py | 1 + | 8 | hw/arm/exynos4_boards.c | 24 ------------------------ |
13 | 1 file changed, 1 insertion(+) | 9 | 1 file changed, 24 deletions(-) |
14 | 10 | ||
15 | diff --git a/tests/guest-debug/test-gdbstub.py b/tests/guest-debug/test-gdbstub.py | 11 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c |
16 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/tests/guest-debug/test-gdbstub.py | 13 | --- a/hw/arm/exynos4_boards.c |
18 | +++ b/tests/guest-debug/test-gdbstub.py | 14 | +++ b/hw/arm/exynos4_boards.c |
19 | @@ -XXX,XX +XXX,XX @@ def report(cond, msg): | 15 | @@ -XXX,XX +XXX,XX @@ |
20 | print ("PASS: %s" % (msg)) | 16 | #include "hw/net/lan9118.h" |
21 | else: | 17 | #include "hw/boards.h" |
22 | print ("FAIL: %s" % (msg)) | 18 | |
23 | + global failcount | 19 | -#undef DEBUG |
24 | failcount += 1 | 20 | - |
25 | 21 | -//#define DEBUG | |
22 | - | ||
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]); | ||
26 | 52 | ||
27 | -- | 53 | -- |
28 | 2.19.1 | 54 | 2.20.1 |
29 | 55 | ||
30 | 56 | diff view generated by jsdifflib |
1 | From: Alex Bennée <alex.bennee@linaro.org> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | We already have this symbol defined so lets use it. | 3 | It eases code review, unit is explicit. |
4 | 4 | ||
5 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | 5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 6 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> |
7 | Message-id: 20181109152119.9242-7-alex.bennee@linaro.org | 7 | Message-id: 20190520214342.13709-3-philmd@redhat.com |
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 9 | --- |
10 | target/arm/cpu.h | 2 +- | 10 | hw/arm/exynos4_boards.c | 5 +++-- |
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | 11 | 1 file changed, 3 insertions(+), 2 deletions(-) |
12 | 12 | ||
13 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | 13 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c |
14 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/target/arm/cpu.h | 15 | --- a/hw/arm/exynos4_boards.c |
16 | +++ b/target/arm/cpu.h | 16 | +++ b/hw/arm/exynos4_boards.c |
17 | @@ -XXX,XX +XXX,XX @@ static inline int arm_debug_target_el(CPUARMState *env) | 17 | @@ -XXX,XX +XXX,XX @@ |
18 | 18 | */ | |
19 | if (arm_feature(env, ARM_FEATURE_EL2) && !secure) { | 19 | |
20 | route_to_el2 = env->cp15.hcr_el2 & HCR_TGE || | 20 | #include "qemu/osdep.h" |
21 | - env->cp15.mdcr_el2 & (1 << 8); | 21 | +#include "qemu/units.h" |
22 | + env->cp15.mdcr_el2 & MDCR_TDE; | 22 | #include "qapi/error.h" |
23 | } | 23 | #include "qemu/error-report.h" |
24 | 24 | #include "qemu-common.h" | |
25 | if (route_to_el2) { | 25 | @@ -XXX,XX +XXX,XX @@ static int exynos4_board_smp_bootreg_addr[EXYNOS4_NUM_OF_BOARDS] = { |
26 | }; | ||
27 | |||
28 | static unsigned long exynos4_board_ram_size[EXYNOS4_NUM_OF_BOARDS] = { | ||
29 | - [EXYNOS4_BOARD_NURI] = 0x40000000, | ||
30 | - [EXYNOS4_BOARD_SMDKC210] = 0x40000000, | ||
31 | + [EXYNOS4_BOARD_NURI] = 1 * GiB, | ||
32 | + [EXYNOS4_BOARD_SMDKC210] = 1 * GiB, | ||
33 | }; | ||
34 | |||
35 | static struct arm_boot_info exynos4_board_binfo = { | ||
26 | -- | 36 | -- |
27 | 2.19.1 | 37 | 2.20.1 |
28 | 38 | ||
29 | 39 | diff view generated by jsdifflib |
1 | From: Alex Bennée <alex.bennee@linaro.org> | 1 | From: Guenter Roeck <linux@roeck-us.net> |
---|---|---|---|
2 | 2 | ||
3 | Fix the assertion failure when running interrupts. | 3 | QEMU already supports pl330. Instantiate it for Exynos4210. |
4 | 4 | ||
5 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | 5 | Relevant part of Linux arch/arm/boot/dts/exynos4.dtsi: |
6 | |||
7 | / { | ||
8 | soc: soc { | ||
9 | amba { | ||
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> | ||
45 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
46 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
6 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 47 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 48 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
8 | Message-id: 20181109152119.9242-3-alex.bennee@linaro.org | 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> | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 54 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 55 | --- |
11 | target/arm/kvm64.c | 2 ++ | 56 | hw/arm/exynos4210.c | 26 ++++++++++++++++++++++++++ |
12 | 1 file changed, 2 insertions(+) | 57 | 1 file changed, 26 insertions(+) |
13 | 58 | ||
14 | diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c | 59 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c |
15 | index XXXXXXX..XXXXXXX 100644 | 60 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/kvm64.c | 61 | --- a/hw/arm/exynos4210.c |
17 | +++ b/target/arm/kvm64.c | 62 | +++ b/hw/arm/exynos4210.c |
18 | @@ -XXX,XX +XXX,XX @@ bool kvm_arm_handle_debug(CPUState *cs, struct kvm_debug_exit_arch *debug_exit) | 63 | @@ -XXX,XX +XXX,XX @@ |
19 | cs->exception_index = EXCP_BKPT; | 64 | /* EHCI */ |
20 | env->exception.syndrome = debug_exit->hsr; | 65 | #define EXYNOS4210_EHCI_BASE_ADDR 0x12580000 |
21 | env->exception.vaddress = debug_exit->far; | 66 | |
22 | + qemu_mutex_lock_iothread(); | 67 | +/* DMA */ |
23 | cc->do_interrupt(cs); | 68 | +#define EXYNOS4210_PL330_BASE0_ADDR 0x12680000 |
24 | + qemu_mutex_unlock_iothread(); | 69 | +#define EXYNOS4210_PL330_BASE1_ADDR 0x12690000 |
25 | 70 | +#define EXYNOS4210_PL330_BASE2_ADDR 0x12850000 | |
26 | return false; | 71 | + |
72 | static uint8_t chipid_and_omr[] = { 0x11, 0x02, 0x21, 0x43, | ||
73 | 0x09, 0x00, 0x00, 0x00 }; | ||
74 | |||
75 | @@ -XXX,XX +XXX,XX @@ static uint64_t exynos4210_calc_affinity(int cpu) | ||
76 | return (0x9 << ARM_AFF1_SHIFT) | cpu; | ||
77 | } | ||
78 | |||
79 | +static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | ||
80 | +{ | ||
81 | + SysBusDevice *busdev; | ||
82 | + DeviceState *dev; | ||
83 | + | ||
84 | + dev = qdev_create(NULL, "pl330"); | ||
85 | + qdev_prop_set_uint8(dev, "num_periph_req", nreq); | ||
86 | + qdev_init_nofail(dev); | ||
87 | + busdev = SYS_BUS_DEVICE(dev); | ||
88 | + sysbus_mmio_map(busdev, 0, base); | ||
89 | + sysbus_connect_irq(busdev, 0, irq); | ||
90 | +} | ||
91 | + | ||
92 | Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | ||
93 | { | ||
94 | Exynos4210State *s = g_new0(Exynos4210State, 1); | ||
95 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | ||
96 | sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, | ||
97 | s->irq_table[exynos4210_get_irq(28, 3)]); | ||
98 | |||
99 | + /*** DMA controllers ***/ | ||
100 | + pl330_create(EXYNOS4210_PL330_BASE0_ADDR, | ||
101 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(35, 1)]), 32); | ||
102 | + pl330_create(EXYNOS4210_PL330_BASE1_ADDR, | ||
103 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); | ||
104 | + pl330_create(EXYNOS4210_PL330_BASE2_ADDR, | ||
105 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); | ||
106 | + | ||
107 | return s; | ||
27 | } | 108 | } |
28 | -- | 109 | -- |
29 | 2.19.1 | 110 | 2.20.1 |
30 | 111 | ||
31 | 112 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Alex Bennée <alex.bennee@linaro.org> | ||
2 | 1 | ||
3 | When we are debugging the guest all exceptions come our way but might | ||
4 | be for the guest's own debug exceptions. We use the ->do_interrupt() | ||
5 | infrastructure to inject the exception into the guest. However, we are | ||
6 | missing a full setup of the exception structure, causing an assert | ||
7 | later down the line. | ||
8 | |||
9 | Signed-off-by: Alex Bennée <alex.bennee@linaro.org> | ||
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
12 | Message-id: 20181109152119.9242-4-alex.bennee@linaro.org | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
14 | --- | ||
15 | target/arm/kvm64.c | 1 + | ||
16 | 1 file changed, 1 insertion(+) | ||
17 | |||
18 | diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c | ||
19 | index XXXXXXX..XXXXXXX 100644 | ||
20 | --- a/target/arm/kvm64.c | ||
21 | +++ b/target/arm/kvm64.c | ||
22 | @@ -XXX,XX +XXX,XX @@ bool kvm_arm_handle_debug(CPUState *cs, struct kvm_debug_exit_arch *debug_exit) | ||
23 | cs->exception_index = EXCP_BKPT; | ||
24 | env->exception.syndrome = debug_exit->hsr; | ||
25 | env->exception.vaddress = debug_exit->far; | ||
26 | + env->exception.target_el = 1; | ||
27 | qemu_mutex_lock_iothread(); | ||
28 | cc->do_interrupt(cs); | ||
29 | qemu_mutex_unlock_iothread(); | ||
30 | -- | ||
31 | 2.19.1 | ||
32 | |||
33 | diff view generated by jsdifflib |
1 | In commit 8a0fc3a29fc2315325400 we tried to implement HCR_EL2.{VI,VF}, | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | but we got it wrong and had to revert it. | ||
3 | 2 | ||
4 | In that commit we implemented them as simply tracking whether there | 3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
5 | is a pending virtual IRQ or virtual FIQ. This is not correct -- these | 4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> |
6 | bits cause a software-generated VIRQ/VFIQ, which is distinct from | 5 | Message-id: 20190520214342.13709-5-philmd@redhat.com |
7 | whether there is a hardware-generated VIRQ/VFIQ caused by the | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
8 | external interrupt controller. So we need to track separately | 7 | --- |
9 | the HCR_EL2 bit state and the external virq/vfiq line state, and | 8 | include/hw/arm/exynos4210.h | 9 +++++++-- |
10 | OR the two together to get the actual pending VIRQ/VFIQ state. | 9 | hw/arm/exynos4210.c | 28 ++++++++++++++++++++++++---- |
10 | hw/arm/exynos4_boards.c | 9 ++++++--- | ||
11 | 3 files changed, 37 insertions(+), 9 deletions(-) | ||
11 | 12 | ||
12 | Fixes: 8a0fc3a29fc2315325400c738f807d0d4ae0ab7f | 13 | diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h |
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
14 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
15 | Message-id: 20181109134731.11605-4-peter.maydell@linaro.org | ||
16 | --- | ||
17 | target/arm/internals.h | 18 ++++++++++++++++ | ||
18 | target/arm/cpu.c | 48 +++++++++++++++++++++++++++++++++++++++++- | ||
19 | target/arm/helper.c | 20 ++++++++++++++++-- | ||
20 | 3 files changed, 83 insertions(+), 3 deletions(-) | ||
21 | |||
22 | diff --git a/target/arm/internals.h b/target/arm/internals.h | ||
23 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
24 | --- a/target/arm/internals.h | 15 | --- a/include/hw/arm/exynos4210.h |
25 | +++ b/target/arm/internals.h | 16 | +++ b/include/hw/arm/exynos4210.h |
26 | @@ -XXX,XX +XXX,XX @@ static inline const char *aarch32_mode_name(uint32_t psr) | 17 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210Irq { |
27 | return cpu_mode_names[psr & 0xf]; | 18 | } Exynos4210Irq; |
19 | |||
20 | typedef struct Exynos4210State { | ||
21 | + /*< private >*/ | ||
22 | + SysBusDevice parent_obj; | ||
23 | + /*< public >*/ | ||
24 | ARMCPU *cpu[EXYNOS4210_NCPUS]; | ||
25 | Exynos4210Irq irqs; | ||
26 | qemu_irq *irq_table; | ||
27 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210State { | ||
28 | I2CBus *i2c_if[EXYNOS4210_I2C_NUMBER]; | ||
29 | } Exynos4210State; | ||
30 | |||
31 | +#define TYPE_EXYNOS4210_SOC "exynos4210" | ||
32 | +#define EXYNOS4210_SOC(obj) \ | ||
33 | + OBJECT_CHECK(Exynos4210State, obj, TYPE_EXYNOS4210_SOC) | ||
34 | + | ||
35 | void exynos4210_write_secondary(ARMCPU *cpu, | ||
36 | const struct arm_boot_info *info); | ||
37 | |||
38 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem); | ||
39 | - | ||
40 | /* Initialize exynos4210 IRQ subsystem stub */ | ||
41 | qemu_irq *exynos4210_init_irq(Exynos4210Irq *env); | ||
42 | |||
43 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | ||
44 | index XXXXXXX..XXXXXXX 100644 | ||
45 | --- a/hw/arm/exynos4210.c | ||
46 | +++ b/hw/arm/exynos4210.c | ||
47 | @@ -XXX,XX +XXX,XX @@ static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | ||
48 | sysbus_connect_irq(busdev, 0, irq); | ||
28 | } | 49 | } |
29 | 50 | ||
30 | +/** | 51 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem) |
31 | + * arm_cpu_update_virq: Update CPU_INTERRUPT_VIRQ bit in cs->interrupt_request | 52 | +static void exynos4210_realize(DeviceState *socdev, Error **errp) |
32 | + * | 53 | { |
33 | + * Update the CPU_INTERRUPT_VIRQ bit in cs->interrupt_request, following | 54 | - Exynos4210State *s = g_new0(Exynos4210State, 1); |
34 | + * a change to either the input VIRQ line from the GIC or the HCR_EL2.VI bit. | 55 | + Exynos4210State *s = EXYNOS4210_SOC(socdev); |
35 | + * Must be called with the iothread lock held. | 56 | + MemoryRegion *system_mem = get_system_memory(); |
36 | + */ | 57 | qemu_irq gate_irq[EXYNOS4210_NCPUS][EXYNOS4210_IRQ_GATE_NINPUTS]; |
37 | +void arm_cpu_update_virq(ARMCPU *cpu); | 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 | } | ||
38 | + | 67 | + |
39 | +/** | 68 | +static void exynos4210_class_init(ObjectClass *klass, void *data) |
40 | + * arm_cpu_update_vfiq: Update CPU_INTERRUPT_VFIQ bit in cs->interrupt_request | 69 | +{ |
41 | + * | 70 | + DeviceClass *dc = DEVICE_CLASS(klass); |
42 | + * Update the CPU_INTERRUPT_VFIQ bit in cs->interrupt_request, following | ||
43 | + * a change to either the input VFIQ line from the GIC or the HCR_EL2.VF bit. | ||
44 | + * Must be called with the iothread lock held. | ||
45 | + */ | ||
46 | +void arm_cpu_update_vfiq(ARMCPU *cpu); | ||
47 | + | 71 | + |
48 | #endif | 72 | + dc->realize = exynos4210_realize; |
49 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | ||
50 | index XXXXXXX..XXXXXXX 100644 | ||
51 | --- a/target/arm/cpu.c | ||
52 | +++ b/target/arm/cpu.c | ||
53 | @@ -XXX,XX +XXX,XX @@ static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request) | ||
54 | } | ||
55 | #endif | ||
56 | |||
57 | +void arm_cpu_update_virq(ARMCPU *cpu) | ||
58 | +{ | ||
59 | + /* | ||
60 | + * Update the interrupt level for VIRQ, which is the logical OR of | ||
61 | + * the HCR_EL2.VI bit and the input line level from the GIC. | ||
62 | + */ | ||
63 | + CPUARMState *env = &cpu->env; | ||
64 | + CPUState *cs = CPU(cpu); | ||
65 | + | ||
66 | + bool new_state = (env->cp15.hcr_el2 & HCR_VI) || | ||
67 | + (env->irq_line_state & CPU_INTERRUPT_VIRQ); | ||
68 | + | ||
69 | + if (new_state != ((cs->interrupt_request & CPU_INTERRUPT_VIRQ) != 0)) { | ||
70 | + if (new_state) { | ||
71 | + cpu_interrupt(cs, CPU_INTERRUPT_VIRQ); | ||
72 | + } else { | ||
73 | + cpu_reset_interrupt(cs, CPU_INTERRUPT_VIRQ); | ||
74 | + } | ||
75 | + } | ||
76 | +} | 73 | +} |
77 | + | 74 | + |
78 | +void arm_cpu_update_vfiq(ARMCPU *cpu) | 75 | +static const TypeInfo exynos4210_info = { |
76 | + .name = TYPE_EXYNOS4210_SOC, | ||
77 | + .parent = TYPE_SYS_BUS_DEVICE, | ||
78 | + .instance_size = sizeof(Exynos4210State), | ||
79 | + .class_init = exynos4210_class_init, | ||
80 | +}; | ||
81 | + | ||
82 | +static void exynos4210_register_types(void) | ||
79 | +{ | 83 | +{ |
80 | + /* | 84 | + type_register_static(&exynos4210_info); |
81 | + * Update the interrupt level for VFIQ, which is the logical OR of | ||
82 | + * the HCR_EL2.VF bit and the input line level from the GIC. | ||
83 | + */ | ||
84 | + CPUARMState *env = &cpu->env; | ||
85 | + CPUState *cs = CPU(cpu); | ||
86 | + | ||
87 | + bool new_state = (env->cp15.hcr_el2 & HCR_VF) || | ||
88 | + (env->irq_line_state & CPU_INTERRUPT_VFIQ); | ||
89 | + | ||
90 | + if (new_state != ((cs->interrupt_request & CPU_INTERRUPT_VFIQ) != 0)) { | ||
91 | + if (new_state) { | ||
92 | + cpu_interrupt(cs, CPU_INTERRUPT_VFIQ); | ||
93 | + } else { | ||
94 | + cpu_reset_interrupt(cs, CPU_INTERRUPT_VFIQ); | ||
95 | + } | ||
96 | + } | ||
97 | +} | 85 | +} |
98 | + | 86 | + |
99 | #ifndef CONFIG_USER_ONLY | 87 | +type_init(exynos4210_register_types) |
100 | static void arm_cpu_set_irq(void *opaque, int irq, int level) | 88 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c |
101 | { | ||
102 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_set_irq(void *opaque, int irq, int level) | ||
103 | |||
104 | switch (irq) { | ||
105 | case ARM_CPU_VIRQ: | ||
106 | + assert(arm_feature(env, ARM_FEATURE_EL2)); | ||
107 | + arm_cpu_update_virq(cpu); | ||
108 | + break; | ||
109 | case ARM_CPU_VFIQ: | ||
110 | assert(arm_feature(env, ARM_FEATURE_EL2)); | ||
111 | - /* fall through */ | ||
112 | + arm_cpu_update_vfiq(cpu); | ||
113 | + break; | ||
114 | case ARM_CPU_IRQ: | ||
115 | case ARM_CPU_FIQ: | ||
116 | if (level) { | ||
117 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
118 | index XXXXXXX..XXXXXXX 100644 | 89 | index XXXXXXX..XXXXXXX 100644 |
119 | --- a/target/arm/helper.c | 90 | --- a/hw/arm/exynos4_boards.c |
120 | +++ b/target/arm/helper.c | 91 | +++ b/hw/arm/exynos4_boards.c |
121 | @@ -XXX,XX +XXX,XX @@ static void hcr_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) | 92 | @@ -XXX,XX +XXX,XX @@ typedef enum Exynos4BoardType { |
122 | tlb_flush(CPU(cpu)); | 93 | } Exynos4BoardType; |
123 | } | 94 | |
124 | env->cp15.hcr_el2 = value; | 95 | typedef struct Exynos4BoardState { |
125 | + | 96 | - Exynos4210State *soc; |
126 | + /* | 97 | + Exynos4210State soc; |
127 | + * Updates to VI and VF require us to update the status of | 98 | MemoryRegion dram0_mem; |
128 | + * virtual interrupts, which are the logical OR of these bits | 99 | MemoryRegion dram1_mem; |
129 | + * and the state of the input lines from the GIC. (This requires | 100 | } Exynos4BoardState; |
130 | + * that we have the iothread lock, which is done by marking the | 101 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, |
131 | + * reginfo structs as ARM_CP_IO.) | 102 | exynos4_boards_init_ram(s, get_system_memory(), |
132 | + * Note that if a write to HCR pends a VIRQ or VFIQ it is never | 103 | exynos4_board_ram_size[board_type]); |
133 | + * possible for it to be taken immediately, because VIRQ and | 104 | |
134 | + * VFIQ are masked unless running at EL0 or EL1, and HCR | 105 | - s->soc = exynos4210_init(get_system_memory()); |
135 | + * can only be written at EL2. | 106 | + object_initialize(&s->soc, sizeof(s->soc), TYPE_EXYNOS4210_SOC); |
136 | + */ | 107 | + qdev_set_parent_bus(DEVICE(&s->soc), sysbus_get_default()); |
137 | + g_assert(qemu_mutex_iothread_locked()); | 108 | + object_property_set_bool(OBJECT(&s->soc), true, "realized", |
138 | + arm_cpu_update_virq(cpu); | 109 | + &error_fatal); |
139 | + arm_cpu_update_vfiq(cpu); | 110 | |
111 | return s; | ||
140 | } | 112 | } |
141 | 113 | @@ -XXX,XX +XXX,XX @@ static void smdkc210_init(MachineState *machine) | |
142 | static void hcr_writehigh(CPUARMState *env, const ARMCPRegInfo *ri, | 114 | EXYNOS4_BOARD_SMDKC210); |
143 | @@ -XXX,XX +XXX,XX @@ static void hcr_writelow(CPUARMState *env, const ARMCPRegInfo *ri, | 115 | |
144 | 116 | lan9215_init(SMDK_LAN9118_BASE_ADDR, | |
145 | static const ARMCPRegInfo el2_cp_reginfo[] = { | 117 | - qemu_irq_invert(s->soc->irq_table[exynos4210_get_irq(37, 1)])); |
146 | { .name = "HCR_EL2", .state = ARM_CP_STATE_AA64, | 118 | + qemu_irq_invert(s->soc.irq_table[exynos4210_get_irq(37, 1)])); |
147 | + .type = ARM_CP_IO, | 119 | arm_load_kernel(ARM_CPU(first_cpu), &exynos4_board_binfo); |
148 | .opc0 = 3, .opc1 = 4, .crn = 1, .crm = 1, .opc2 = 0, | 120 | } |
149 | .access = PL2_RW, .fieldoffset = offsetof(CPUARMState, cp15.hcr_el2), | 121 | |
150 | .writefn = hcr_write }, | ||
151 | { .name = "HCR", .state = ARM_CP_STATE_AA32, | ||
152 | - .type = ARM_CP_ALIAS, | ||
153 | + .type = ARM_CP_ALIAS | ARM_CP_IO, | ||
154 | .cp = 15, .opc1 = 4, .crn = 1, .crm = 1, .opc2 = 0, | ||
155 | .access = PL2_RW, .fieldoffset = offsetof(CPUARMState, cp15.hcr_el2), | ||
156 | .writefn = hcr_writelow }, | ||
157 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo el2_cp_reginfo[] = { | ||
158 | |||
159 | static const ARMCPRegInfo el2_v8_cp_reginfo[] = { | ||
160 | { .name = "HCR2", .state = ARM_CP_STATE_AA32, | ||
161 | - .type = ARM_CP_ALIAS, | ||
162 | + .type = ARM_CP_ALIAS | ARM_CP_IO, | ||
163 | .cp = 15, .opc1 = 4, .crn = 1, .crm = 1, .opc2 = 4, | ||
164 | .access = PL2_RW, | ||
165 | .fieldoffset = offsetofhigh32(CPUARMState, cp15.hcr_el2), | ||
166 | -- | 122 | -- |
167 | 2.19.1 | 123 | 2.20.1 |
168 | 124 | ||
169 | 125 | diff view generated by jsdifflib |