1 | First arm pullreq of the 2.13 cycle! | 1 | Not very much here, but several people have fallen over |
---|---|---|---|
2 | the vector operation segfault bug, so let's get the fix | ||
3 | into master. | ||
2 | 4 | ||
5 | thanks | ||
3 | -- PMM | 6 | -- PMM |
4 | 7 | ||
5 | The following changes since commit 4743c23509a51bd4ee85cc272287a41917d1be35: | 8 | The following changes since commit d418238dca7b4e0b124135827ead3076233052b1: |
6 | 9 | ||
7 | Update version for v2.12.0 release (2018-04-24 16:44:55 +0100) | 10 | Merge remote-tracking branch 'remotes/rth/tags/pull-rng-20190522' into staging (2019-05-23 12:57:17 +0100) |
8 | 11 | ||
9 | are available in the Git repository at: | 12 | are available in the Git repository at: |
10 | 13 | ||
11 | git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20180426 | 14 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190523 |
12 | 15 | ||
13 | for you to fetch changes up to fbf32752663878947de455ff57cb5b9318f14bec: | 16 | for you to fetch changes up to 98e4f4fdb8ea05d840f51f47125924c2bb9df2df: |
14 | 17 | ||
15 | xilinx_spips: Correct SNOOP_NONE state when flushing the txfifo (2018-04-26 11:04:40 +0100) | 18 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC (2019-05-23 14:47:44 +0100) |
16 | 19 | ||
17 | ---------------------------------------------------------------- | 20 | ---------------------------------------------------------------- |
18 | target-arm queue: | 21 | target-arm queue: |
19 | * xilinx_spips: Correct SNOOP_NONE state when flushing the txfifo | 22 | * exynos4210: QOM'ify the Exynos4210 SoC |
20 | * timer/aspeed: fix vmstate version id | 23 | * exynos4210: Add DMA support for the Exynos4210 |
21 | * hw/arm/aspeed_soc: don't use vmstate_register_ram_global for SRAM | 24 | * arm_gicv3: Fix writes to ICC_CTLR_EL3 |
22 | * hw/arm/aspeed: don't make 'boot_rom' region 'nomigrate' | 25 | * arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} |
23 | * hw/arm/highbank: don't make sysram 'nomigrate' | 26 | * target/arm: Fix vector operation segfault |
24 | * hw/arm/raspi: Don't bother setting default_cpu_type | 27 | * target/arm: Minor improvements to BFXIL, EXTR |
25 | * PMU emulation: some minor bugfixes and preparation for | ||
26 | support of other events than just the cycle counter | ||
27 | * target/arm: Use v7m_stack_read() for reading the frame signature | ||
28 | * target/arm: Remove stale TODO comment | ||
29 | * arm: always start from first_cpu when registering loader cpu reset callback | ||
30 | * device_tree: Increase FDT_MAX_SIZE to 1 MiB | ||
31 | 28 | ||
32 | ---------------------------------------------------------------- | 29 | ---------------------------------------------------------------- |
33 | Aaron Lindsay (9): | 30 | Alistair Francis (1): |
34 | target/arm: Check PMCNTEN for whether PMCCNTR is enabled | 31 | target/arm: Fix vector operation segfault |
35 | target/arm: Treat PMCCNTR as alias of PMCCNTR_EL0 | ||
36 | target/arm: Mask PMU register writes based on PMCR_EL0.N | ||
37 | target/arm: Fetch GICv3 state directly from CPUARMState | ||
38 | target/arm: Support multiple EL change hooks | ||
39 | target/arm: Add pre-EL change hooks | ||
40 | target/arm: Allow EL change hooks to do IO | ||
41 | target/arm: Fix bitmask for PMCCFILTR writes | ||
42 | target/arm: Make PMOVSCLR and PMUSERENR 64 bits wide | ||
43 | 32 | ||
44 | Cédric Le Goater (1): | 33 | Guenter Roeck (1): |
45 | timer/aspeed: fix vmstate version id | 34 | hw/arm/exynos4210: Add DMA support for the Exynos4210 |
46 | 35 | ||
47 | Geert Uytterhoeven (1): | 36 | Peter Maydell (5): |
48 | device_tree: Increase FDT_MAX_SIZE to 1 MiB | 37 | arm: Move system_clock_scale to armv7m_systick.h |
38 | arm: Remove unnecessary includes of hw/arm/arm.h | ||
39 | arm: Rename hw/arm/arm.h to hw/arm/boot.h | ||
40 | hw/intc/arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} | ||
41 | hw/intc/arm_gicv3: Fix writes to ICC_CTLR_EL3 | ||
49 | 42 | ||
50 | Igor Mammedov (1): | 43 | Philippe Mathieu-Daudé (3): |
51 | arm: always start from first_cpu when registering loader cpu reset callback | 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 | ||
52 | 47 | ||
53 | Peter Maydell (6): | 48 | Richard Henderson (2): |
54 | target/arm: Remove stale TODO comment | 49 | target/arm: Use extract2 for EXTR |
55 | target/arm: Use v7m_stack_read() for reading the frame signature | 50 | target/arm: Simplify BFXIL expansion |
56 | hw/arm/raspi: Don't bother setting default_cpu_type | ||
57 | hw/arm/highbank: don't make sysram 'nomigrate' | ||
58 | hw/arm/aspeed: don't make 'boot_rom' region 'nomigrate' | ||
59 | hw/arm/aspeed_soc: don't use vmstate_register_ram_global for SRAM | ||
60 | 51 | ||
61 | Sai Pavan Boddu (1): | 52 | include/hw/arm/allwinner-a10.h | 2 +- |
62 | xilinx_spips: Correct SNOOP_NONE state when flushing the txfifo | 53 | include/hw/arm/aspeed_soc.h | 1 - |
54 | include/hw/arm/bcm2836.h | 1 - | ||
55 | include/hw/arm/{arm.h => boot.h} | 12 +++------ | ||
56 | include/hw/arm/exynos4210.h | 9 +++++-- | ||
57 | include/hw/arm/fsl-imx25.h | 2 +- | ||
58 | include/hw/arm/fsl-imx31.h | 2 +- | ||
59 | include/hw/arm/fsl-imx6.h | 2 +- | ||
60 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
61 | include/hw/arm/fsl-imx7.h | 2 +- | ||
62 | include/hw/arm/virt.h | 2 +- | ||
63 | include/hw/arm/xlnx-versal.h | 2 +- | ||
64 | include/hw/arm/xlnx-zynqmp.h | 2 +- | ||
65 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++ | ||
66 | hw/arm/armsse.c | 2 +- | ||
67 | hw/arm/armv7m.c | 2 +- | ||
68 | hw/arm/aspeed.c | 2 +- | ||
69 | hw/arm/boot.c | 2 +- | ||
70 | hw/arm/collie.c | 2 +- | ||
71 | hw/arm/exynos4210.c | 54 ++++++++++++++++++++++++++++++++++++--- | ||
72 | hw/arm/exynos4_boards.c | 40 ++++++++--------------------- | ||
73 | hw/arm/highbank.c | 2 +- | ||
74 | hw/arm/integratorcp.c | 2 +- | ||
75 | hw/arm/mainstone.c | 2 +- | ||
76 | hw/arm/microbit.c | 2 +- | ||
77 | hw/arm/mps2-tz.c | 2 +- | ||
78 | hw/arm/mps2.c | 2 +- | ||
79 | hw/arm/msf2-soc.c | 1 - | ||
80 | hw/arm/msf2-som.c | 2 +- | ||
81 | hw/arm/musca.c | 2 +- | ||
82 | hw/arm/musicpal.c | 2 +- | ||
83 | hw/arm/netduino2.c | 2 +- | ||
84 | hw/arm/nrf51_soc.c | 2 +- | ||
85 | hw/arm/nseries.c | 2 +- | ||
86 | hw/arm/omap1.c | 2 +- | ||
87 | hw/arm/omap2.c | 2 +- | ||
88 | hw/arm/omap_sx1.c | 2 +- | ||
89 | hw/arm/palm.c | 2 +- | ||
90 | hw/arm/raspi.c | 2 +- | ||
91 | hw/arm/realview.c | 2 +- | ||
92 | hw/arm/spitz.c | 2 +- | ||
93 | hw/arm/stellaris.c | 2 +- | ||
94 | hw/arm/stm32f205_soc.c | 2 +- | ||
95 | hw/arm/strongarm.c | 2 +- | ||
96 | hw/arm/tosa.c | 2 +- | ||
97 | hw/arm/versatilepb.c | 2 +- | ||
98 | hw/arm/vexpress.c | 2 +- | ||
99 | hw/arm/virt.c | 2 +- | ||
100 | hw/arm/xilinx_zynq.c | 2 +- | ||
101 | hw/arm/xlnx-versal.c | 2 +- | ||
102 | hw/arm/z2.c | 2 +- | ||
103 | hw/intc/arm_gicv3_cpuif.c | 6 ++--- | ||
104 | hw/intc/armv7m_nvic.c | 1 - | ||
105 | target/arm/arm-semi.c | 1 - | ||
106 | target/arm/cpu.c | 1 - | ||
107 | target/arm/cpu64.c | 1 - | ||
108 | target/arm/kvm.c | 1 - | ||
109 | target/arm/kvm32.c | 1 - | ||
110 | target/arm/kvm64.c | 1 - | ||
111 | target/arm/translate-a64.c | 44 ++++++++++++++++--------------- | ||
112 | target/arm/translate.c | 4 +-- | ||
113 | 61 files changed, 164 insertions(+), 123 deletions(-) | ||
114 | rename include/hw/arm/{arm.h => boot.h} (96%) | ||
63 | 115 | ||
64 | target/arm/cpu.h | 48 +++++++++++++++++------------- | ||
65 | target/arm/internals.h | 14 +++++++-- | ||
66 | device_tree.c | 2 +- | ||
67 | hw/arm/aspeed.c | 2 +- | ||
68 | hw/arm/aspeed_soc.c | 3 +- | ||
69 | hw/arm/boot.c | 2 +- | ||
70 | hw/arm/highbank.c | 2 +- | ||
71 | hw/arm/raspi.c | 2 -- | ||
72 | hw/intc/arm_gicv3_cpuif.c | 10 ++----- | ||
73 | hw/ssi/xilinx_spips.c | 3 +- | ||
74 | hw/timer/aspeed_timer.c | 2 +- | ||
75 | target/arm/cpu.c | 37 +++++++++++++++++++---- | ||
76 | target/arm/helper.c | 73 ++++++++++++++++++++++++++-------------------- | ||
77 | target/arm/op_helper.c | 8 +++++ | ||
78 | target/arm/translate-a64.c | 6 ++++ | ||
79 | target/arm/translate.c | 12 ++++++++ | ||
80 | 16 files changed, 148 insertions(+), 78 deletions(-) | ||
81 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Geert Uytterhoeven <geert+renesas@glider.be> | ||
2 | 1 | ||
3 | It is not uncommon for a contemporary FDT to be larger than 64 KiB, | ||
4 | leading to failures loading the device tree from sysfs: | ||
5 | |||
6 | qemu-system-aarch64: qemu_fdt_setprop: Couldn't set ...: FDT_ERR_NOSPACE | ||
7 | |||
8 | Hence increase the limit to 1 MiB, like on PPC. | ||
9 | |||
10 | For reference, the largest arm64 DTB created from the Linux sources is | ||
11 | ca. 75 KiB large (100 KiB when built with symbols/fixup support). | ||
12 | |||
13 | Cc: qemu-stable@nongnu.org | ||
14 | Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> | ||
15 | Message-id: 1523541337-23919-1-git-send-email-geert+renesas@glider.be | ||
16 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
17 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
18 | --- | ||
19 | device_tree.c | 2 +- | ||
20 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/device_tree.c b/device_tree.c | ||
23 | index XXXXXXX..XXXXXXX 100644 | ||
24 | --- a/device_tree.c | ||
25 | +++ b/device_tree.c | ||
26 | @@ -XXX,XX +XXX,XX @@ | ||
27 | |||
28 | #include <libfdt.h> | ||
29 | |||
30 | -#define FDT_MAX_SIZE 0x10000 | ||
31 | +#define FDT_MAX_SIZE 0x100000 | ||
32 | |||
33 | void *create_device_tree(int *sizep) | ||
34 | { | ||
35 | -- | ||
36 | 2.17.0 | ||
37 | |||
38 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Igor Mammedov <imammedo@redhat.com> | ||
2 | 1 | ||
3 | if arm_load_kernel() were passed non first_cpu, QEMU would end up | ||
4 | with partially set do_cpu_reset() callback leaving some CPUs without it. | ||
5 | |||
6 | Make sure that do_cpu_reset() is registered for all CPUs by enumerating | ||
7 | CPUs from first_cpu. | ||
8 | |||
9 | (In practice every board that we have was passing us the first CPU | ||
10 | as the boot CPU, either directly or indirectly, so this wasn't | ||
11 | causing incorrect behaviour.) | ||
12 | |||
13 | Signed-off-by: Igor Mammedov <imammedo@redhat.com> | ||
14 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
15 | [PMM: added a note that this isn't a behaviour change] | ||
16 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
17 | --- | ||
18 | hw/arm/boot.c | 2 +- | ||
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | ||
22 | index XXXXXXX..XXXXXXX 100644 | ||
23 | --- a/hw/arm/boot.c | ||
24 | +++ b/hw/arm/boot.c | ||
25 | @@ -XXX,XX +XXX,XX @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) | ||
26 | * actually loading a kernel, the handler is also responsible for | ||
27 | * arranging that we start it correctly. | ||
28 | */ | ||
29 | - for (cs = CPU(cpu); cs; cs = CPU_NEXT(cs)) { | ||
30 | + for (cs = first_cpu; cs; cs = CPU_NEXT(cs)) { | ||
31 | qemu_register_reset(do_cpu_reset, ARM_CPU(cs)); | ||
32 | } | ||
33 | } | ||
34 | -- | ||
35 | 2.17.0 | ||
36 | |||
37 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Remove a stale TODO comment -- we have now made the arm_ldl_ptw() | ||
2 | and arm_ldq_ptw() functions propagate physical memory read errors | ||
3 | out to their callers. | ||
4 | 1 | ||
5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
7 | Message-id: 20180419142151.9862-1-peter.maydell@linaro.org | ||
8 | --- | ||
9 | target/arm/helper.c | 8 +------- | ||
10 | 1 file changed, 1 insertion(+), 7 deletions(-) | ||
11 | |||
12 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
13 | index XXXXXXX..XXXXXXX 100644 | ||
14 | --- a/target/arm/helper.c | ||
15 | +++ b/target/arm/helper.c | ||
16 | @@ -XXX,XX +XXX,XX @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMUIdx mmu_idx, | ||
17 | return addr; | ||
18 | } | ||
19 | |||
20 | -/* All loads done in the course of a page table walk go through here. | ||
21 | - * TODO: rather than ignoring errors from physical memory reads (which | ||
22 | - * are external aborts in ARM terminology) we should propagate this | ||
23 | - * error out so that we can turn it into a Data Abort if this walk | ||
24 | - * was being done for a CPU load/store or an address translation instruction | ||
25 | - * (but not if it was for a debug access). | ||
26 | - */ | ||
27 | +/* All loads done in the course of a page table walk go through here. */ | ||
28 | static uint32_t arm_ldl_ptw(CPUState *cs, hwaddr addr, bool is_secure, | ||
29 | ARMMMUIdx mmu_idx, ARMMMUFaultInfo *fi) | ||
30 | { | ||
31 | -- | ||
32 | 2.17.0 | ||
33 | |||
34 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | In commit 95695effe8caa552b8f2 we changed the v7M/v8M stack | ||
2 | pop code to use a new v7m_stack_read() function that checks | ||
3 | whether the read should fail due to an MPU or bus abort. | ||
4 | We missed one call though, the one which reads the signature | ||
5 | word for the callee-saved register part of the frame. | ||
6 | 1 | ||
7 | Correct the omission. | ||
8 | |||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
11 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
12 | Message-id: 20180419142106.9694-1-peter.maydell@linaro.org | ||
13 | --- | ||
14 | target/arm/helper.c | 9 +++++---- | ||
15 | 1 file changed, 5 insertions(+), 4 deletions(-) | ||
16 | |||
17 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
18 | index XXXXXXX..XXXXXXX 100644 | ||
19 | --- a/target/arm/helper.c | ||
20 | +++ b/target/arm/helper.c | ||
21 | @@ -XXX,XX +XXX,XX @@ static bool v7m_push_stack(ARMCPU *cpu) | ||
22 | static void do_v7m_exception_exit(ARMCPU *cpu) | ||
23 | { | ||
24 | CPUARMState *env = &cpu->env; | ||
25 | - CPUState *cs = CPU(cpu); | ||
26 | uint32_t excret; | ||
27 | uint32_t xpsr; | ||
28 | bool ufault = false; | ||
29 | @@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu) | ||
30 | ((excret & R_V7M_EXCRET_ES_MASK) == 0 || | ||
31 | (excret & R_V7M_EXCRET_DCRS_MASK) == 0)) { | ||
32 | uint32_t expected_sig = 0xfefa125b; | ||
33 | - uint32_t actual_sig = ldl_phys(cs->as, frameptr); | ||
34 | + uint32_t actual_sig; | ||
35 | |||
36 | - if (expected_sig != actual_sig) { | ||
37 | + pop_ok = v7m_stack_read(cpu, &actual_sig, frameptr, mmu_idx); | ||
38 | + | ||
39 | + if (pop_ok && expected_sig != actual_sig) { | ||
40 | /* Take a SecureFault on the current stack */ | ||
41 | env->v7m.sfsr |= R_V7M_SFSR_INVIS_MASK; | ||
42 | armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_SECURE, false); | ||
43 | @@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu) | ||
44 | return; | ||
45 | } | ||
46 | |||
47 | - pop_ok = | ||
48 | + pop_ok = pop_ok && | ||
49 | v7m_stack_read(cpu, &env->regs[4], frameptr + 0x8, mmu_idx) && | ||
50 | v7m_stack_read(cpu, &env->regs[4], frameptr + 0x8, mmu_idx) && | ||
51 | v7m_stack_read(cpu, &env->regs[5], frameptr + 0xc, mmu_idx) && | ||
52 | -- | ||
53 | 2.17.0 | ||
54 | |||
55 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Aaron Lindsay <alindsay@codeaurora.org> | ||
2 | 1 | ||
3 | Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> | ||
4 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
5 | Message-id: 1523997485-1905-2-git-send-email-alindsay@codeaurora.org | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | --- | ||
8 | target/arm/helper.c | 2 +- | ||
9 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/helper.c | ||
14 | +++ b/target/arm/helper.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static inline bool arm_ccnt_enabled(CPUARMState *env) | ||
16 | { | ||
17 | /* This does not support checking PMCCFILTR_EL0 register */ | ||
18 | |||
19 | - if (!(env->cp15.c9_pmcr & PMCRE)) { | ||
20 | + if (!(env->cp15.c9_pmcr & PMCRE) || !(env->cp15.c9_pmcnten & (1 << 31))) { | ||
21 | return false; | ||
22 | } | ||
23 | |||
24 | -- | ||
25 | 2.17.0 | ||
26 | |||
27 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Aaron Lindsay <alindsay@codeaurora.org> | ||
2 | 1 | ||
3 | They share the same underlying state | ||
4 | |||
5 | Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> | ||
6 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | Message-id: 1523997485-1905-3-git-send-email-alindsay@codeaurora.org | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | ||
10 | target/arm/helper.c | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/target/arm/helper.c | ||
16 | +++ b/target/arm/helper.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo v7_cp_reginfo[] = { | ||
18 | .fieldoffset = offsetof(CPUARMState, cp15.c9_pmselr), | ||
19 | .writefn = pmselr_write, .raw_writefn = raw_write, }, | ||
20 | { .name = "PMCCNTR", .cp = 15, .crn = 9, .crm = 13, .opc1 = 0, .opc2 = 0, | ||
21 | - .access = PL0_RW, .resetvalue = 0, .type = ARM_CP_IO, | ||
22 | + .access = PL0_RW, .resetvalue = 0, .type = ARM_CP_ALIAS | ARM_CP_IO, | ||
23 | .readfn = pmccntr_read, .writefn = pmccntr_write32, | ||
24 | .accessfn = pmreg_access_ccntr }, | ||
25 | { .name = "PMCCNTR_EL0", .state = ARM_CP_STATE_AA64, | ||
26 | -- | ||
27 | 2.17.0 | ||
28 | |||
29 | diff view generated by jsdifflib |
1 | From: Cédric Le Goater <clg@kaod.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | commit 1d3e65aa7ac5 ("hw/timer: Add value matching support to | 3 | This is, after all, how we implement extract2 in tcg/aarch64. |
4 | aspeed_timer") increased the vmstate version of aspeed.timer because | ||
5 | the state had changed, but it also bumped the version of the | ||
6 | VMSTATE_STRUCT_ARRAY under the aspeed.timerctrl which did not need to. | ||
7 | 4 | ||
8 | Change back this version to fix migration. | ||
9 | |||
10 | Signed-off-by: Cédric Le Goater <clg@kaod.org> | ||
11 | Message-id: 20180423101433.17759-1-clg@kaod.org | ||
12 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Message-id: 20190514011129.11330-2-richard.henderson@linaro.org | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
14 | --- | 9 | --- |
15 | hw/timer/aspeed_timer.c | 2 +- | 10 | target/arm/translate-a64.c | 38 ++++++++++++++++++++------------------ |
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | 11 | 1 file changed, 20 insertions(+), 18 deletions(-) |
17 | 12 | ||
18 | diff --git a/hw/timer/aspeed_timer.c b/hw/timer/aspeed_timer.c | 13 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
19 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
20 | --- a/hw/timer/aspeed_timer.c | 15 | --- a/target/arm/translate-a64.c |
21 | +++ b/hw/timer/aspeed_timer.c | 16 | +++ b/target/arm/translate-a64.c |
22 | @@ -XXX,XX +XXX,XX @@ static const VMStateDescription vmstate_aspeed_timer_state = { | 17 | @@ -XXX,XX +XXX,XX @@ static void disas_extract(DisasContext *s, uint32_t insn) |
23 | VMSTATE_UINT32(ctrl, AspeedTimerCtrlState), | 18 | } else { |
24 | VMSTATE_UINT32(ctrl2, AspeedTimerCtrlState), | 19 | tcg_gen_ext32u_i64(tcg_rd, cpu_reg(s, rm)); |
25 | VMSTATE_STRUCT_ARRAY(timers, AspeedTimerCtrlState, | 20 | } |
26 | - ASPEED_TIMER_NR_TIMERS, 2, vmstate_aspeed_timer, | 21 | - } else if (rm == rn) { /* ROR */ |
27 | + ASPEED_TIMER_NR_TIMERS, 1, vmstate_aspeed_timer, | 22 | - tcg_rm = cpu_reg(s, rm); |
28 | AspeedTimer), | 23 | - if (sf) { |
29 | VMSTATE_END_OF_LIST() | 24 | - tcg_gen_rotri_i64(tcg_rd, tcg_rm, imm); |
25 | - } else { | ||
26 | - TCGv_i32 tmp = tcg_temp_new_i32(); | ||
27 | - tcg_gen_extrl_i64_i32(tmp, tcg_rm); | ||
28 | - tcg_gen_rotri_i32(tmp, tmp, imm); | ||
29 | - tcg_gen_extu_i32_i64(tcg_rd, tmp); | ||
30 | - tcg_temp_free_i32(tmp); | ||
31 | - } | ||
32 | } else { | ||
33 | - tcg_rm = read_cpu_reg(s, rm, sf); | ||
34 | - tcg_rn = read_cpu_reg(s, rn, sf); | ||
35 | - tcg_gen_shri_i64(tcg_rm, tcg_rm, imm); | ||
36 | - tcg_gen_shli_i64(tcg_rn, tcg_rn, bitsize - imm); | ||
37 | - tcg_gen_or_i64(tcg_rd, tcg_rm, tcg_rn); | ||
38 | - if (!sf) { | ||
39 | - tcg_gen_ext32u_i64(tcg_rd, tcg_rd); | ||
40 | + tcg_rm = cpu_reg(s, rm); | ||
41 | + tcg_rn = cpu_reg(s, rn); | ||
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 | } | ||
61 | } | ||
30 | } | 62 | } |
31 | -- | 63 | -- |
32 | 2.17.0 | 64 | 2.20.1 |
33 | 65 | ||
34 | 66 | diff view generated by jsdifflib |
1 | From: Aaron Lindsay <alindsay@codeaurora.org> | 1 | From: Richard Henderson <richard.henderson@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | During code generation, surround CPSR writes and exception returns which | 3 | The mask implied by the extract is redundant with the one |
4 | call the EL change hooks with gen_io_start/end. The immediate need is | 4 | implied by the deposit. Also, fix spelling of BFXIL. |
5 | for the PMU to access the clock and icount during EL change to support | ||
6 | mode filtering. | ||
7 | 5 | ||
8 | Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> | 6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
9 | Message-id: 1523997485-1905-9-git-send-email-alindsay@codeaurora.org | 7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> |
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Message-id: 20190514011129.11330-3-richard.henderson@linaro.org |
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
12 | --- | 10 | --- |
13 | target/arm/translate-a64.c | 6 ++++++ | 11 | target/arm/translate-a64.c | 6 +++--- |
14 | target/arm/translate.c | 12 ++++++++++++ | 12 | 1 file changed, 3 insertions(+), 3 deletions(-) |
15 | 2 files changed, 18 insertions(+) | ||
16 | 13 | ||
17 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 14 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
18 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
19 | --- a/target/arm/translate-a64.c | 16 | --- a/target/arm/translate-a64.c |
20 | +++ b/target/arm/translate-a64.c | 17 | +++ b/target/arm/translate-a64.c |
21 | @@ -XXX,XX +XXX,XX @@ static void disas_uncond_b_reg(DisasContext *s, uint32_t insn) | 18 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) |
22 | unallocated_encoding(s); | 19 | tcg_gen_extract_i64(tcg_rd, tcg_tmp, ri, len); |
23 | return; | 20 | return; |
24 | } | 21 | } |
25 | + if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { | 22 | - /* opc == 1, BXFIL fall through to deposit */ |
26 | + gen_io_start(); | 23 | - tcg_gen_extract_i64(tcg_tmp, tcg_tmp, ri, len); |
27 | + } | 24 | + /* opc == 1, BFXIL fall through to deposit */ |
28 | gen_helper_exception_return(cpu_env); | 25 | + tcg_gen_shri_i64(tcg_tmp, tcg_tmp, ri); |
29 | + if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { | 26 | pos = 0; |
30 | + gen_io_end(); | 27 | } else { |
31 | + } | 28 | /* Handle the ri > si case with a deposit |
32 | /* Must exit loop to check un-masked IRQs */ | 29 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) |
33 | s->base.is_jmp = DISAS_EXIT; | 30 | len = ri; |
34 | return; | 31 | } |
35 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 32 | |
36 | index XXXXXXX..XXXXXXX 100644 | 33 | - if (opc == 1) { /* BFM, BXFIL */ |
37 | --- a/target/arm/translate.c | 34 | + if (opc == 1) { /* BFM, BFXIL */ |
38 | +++ b/target/arm/translate.c | 35 | tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_tmp, pos, len); |
39 | @@ -XXX,XX +XXX,XX @@ static void gen_rfe(DisasContext *s, TCGv_i32 pc, TCGv_i32 cpsr) | 36 | } else { |
40 | * appropriately depending on the new Thumb bit, so it must | 37 | /* SBFM or UBFM: We start with zero, and we haven't modified |
41 | * be called after storing the new PC. | ||
42 | */ | ||
43 | + if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { | ||
44 | + gen_io_start(); | ||
45 | + } | ||
46 | gen_helper_cpsr_write_eret(cpu_env, cpsr); | ||
47 | + if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { | ||
48 | + gen_io_end(); | ||
49 | + } | ||
50 | tcg_temp_free_i32(cpsr); | ||
51 | /* Must exit loop to check un-masked IRQs */ | ||
52 | s->base.is_jmp = DISAS_EXIT; | ||
53 | @@ -XXX,XX +XXX,XX @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) | ||
54 | if (exc_return) { | ||
55 | /* Restore CPSR from SPSR. */ | ||
56 | tmp = load_cpu_field(spsr); | ||
57 | + if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { | ||
58 | + gen_io_start(); | ||
59 | + } | ||
60 | gen_helper_cpsr_write_eret(cpu_env, tmp); | ||
61 | + if (tb_cflags(s->base.tb) & CF_USE_ICOUNT) { | ||
62 | + gen_io_end(); | ||
63 | + } | ||
64 | tcg_temp_free_i32(tmp); | ||
65 | /* Must exit loop to check un-masked IRQs */ | ||
66 | s->base.is_jmp = DISAS_EXIT; | ||
67 | -- | 38 | -- |
68 | 2.17.0 | 39 | 2.20.1 |
69 | 40 | ||
70 | 41 | diff view generated by jsdifflib |
1 | From: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com> | 1 | From: Alistair Francis <alistair.francis@wdc.com> |
---|---|---|---|
2 | 2 | ||
3 | SNOOP_NONE state handle is moved above in the if ladder, as it's same | 3 | Commit 89e68b575 "target/arm: Use vector operations for saturation" |
4 | as SNOOP_STRIPPING during data cycles. | 4 | causes this abort() when booting QEMU ARM with a Cortex-A15: |
5 | 5 | ||
6 | Signed-off-by: Sai Pavan Boddu <saipava@xilinx.com> | 6 | 0 0x00007ffff4c2382f in raise () at /usr/lib/libc.so.6 |
7 | Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com> | 7 | 1 0x00007ffff4c0e672 in abort () at /usr/lib/libc.so.6 |
8 | Message-id: 1524119244-1240-1-git-send-email-saipava@xilinx.com | 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> | ||
27 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
28 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
29 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
30 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
31 | Message-id: ad91b397f360b2fc7f4087e476f7df5b04d42ddb.1558021877.git.alistair.francis@wdc.com | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 32 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 33 | --- |
11 | hw/ssi/xilinx_spips.c | 3 ++- | 34 | target/arm/translate.c | 4 ++-- |
12 | 1 file changed, 2 insertions(+), 1 deletion(-) | 35 | 1 file changed, 2 insertions(+), 2 deletions(-) |
13 | 36 | ||
14 | diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c | 37 | diff --git a/target/arm/translate.c b/target/arm/translate.c |
15 | index XXXXXXX..XXXXXXX 100644 | 38 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/hw/ssi/xilinx_spips.c | 39 | --- a/target/arm/translate.c |
17 | +++ b/hw/ssi/xilinx_spips.c | 40 | +++ b/target/arm/translate.c |
18 | @@ -XXX,XX +XXX,XX @@ static void xilinx_spips_flush_txfifo(XilinxSPIPS *s) | 41 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) |
19 | if (fifo8_is_empty(&s->tx_fifo)) { | 42 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), |
20 | xilinx_spips_update_ixr(s); | 43 | rn_ofs, rm_ofs, vec_size, vec_size, |
21 | return; | 44 | (u ? uqadd_op : sqadd_op) + size); |
22 | - } else if (s->snoop_state == SNOOP_STRIPING) { | 45 | - break; |
23 | + } else if (s->snoop_state == SNOOP_STRIPING || | 46 | + return 0; |
24 | + s->snoop_state == SNOOP_NONE) { | 47 | |
25 | for (i = 0; i < num_effective_busses(s); ++i) { | 48 | case NEON_3R_VQSUB: |
26 | tx_rx[i] = fifo8_pop(&s->tx_fifo); | 49 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), |
27 | } | 50 | rn_ofs, rm_ofs, vec_size, vec_size, |
51 | (u ? uqsub_op : sqsub_op) + size); | ||
52 | - break; | ||
53 | + return 0; | ||
54 | |||
55 | case NEON_3R_VMUL: /* VMUL */ | ||
56 | if (u) { | ||
28 | -- | 57 | -- |
29 | 2.17.0 | 58 | 2.20.1 |
30 | 59 | ||
31 | 60 | diff view generated by jsdifflib |
1 | Currently we use vmstate_register_ram_global() for the SRAM; | 1 | The system_clock_scale global is used only by the armv7m systick |
---|---|---|---|
2 | this is not a good idea for devices, because it means that | 2 | device; move the extern declaration to the armv7m_systick.h header, |
3 | you can only ever create one instance of the device, as | 3 | and expand the comment to explain what it is and that it should |
4 | the second instance would get a RAM block name clash. | 4 | ideally be replaced with a different approach. |
5 | Instead, use memory_region_init_ram(), which automatically | ||
6 | registers the RAM block with a local-to-the-device name. | ||
7 | |||
8 | Note that this would be a cross-version migration compatibility break | ||
9 | for the "palmetto-bmc", "ast2500-evb" and "romulus-bmc" machines, | ||
10 | but migration is currently broken for them. | ||
11 | 5 | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
13 | Reviewed-by: Cédric Le Goater <clg@kaod.org> | 7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
14 | Tested-by: Cédric Le Goater <clg@kaod.org> | 8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
15 | Message-id: 20180420124835.7268-4-peter.maydell@linaro.org | 9 | Message-id: 20190516163857.6430-2-peter.maydell@linaro.org |
16 | --- | 10 | --- |
17 | hw/arm/aspeed_soc.c | 3 +-- | 11 | include/hw/arm/arm.h | 4 ---- |
18 | 1 file changed, 1 insertion(+), 2 deletions(-) | 12 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++++++++ |
13 | 2 files changed, 22 insertions(+), 4 deletions(-) | ||
19 | 14 | ||
20 | diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c | 15 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h |
21 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/hw/arm/aspeed_soc.c | 17 | --- a/include/hw/arm/arm.h |
23 | +++ b/hw/arm/aspeed_soc.c | 18 | +++ b/include/hw/arm/arm.h |
24 | @@ -XXX,XX +XXX,XX @@ static void aspeed_soc_realize(DeviceState *dev, Error **errp) | 19 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, |
25 | } | 20 | const struct arm_boot_info *info, |
26 | 21 | hwaddr mvbar_addr); | |
27 | /* SRAM */ | 22 | |
28 | - memory_region_init_ram_nomigrate(&s->sram, OBJECT(dev), "aspeed.sram", | 23 | -/* Multiplication factor to convert from system clock ticks to qemu timer |
29 | + memory_region_init_ram(&s->sram, OBJECT(dev), "aspeed.sram", | 24 | - ticks. */ |
30 | sc->info->sram_size, &err); | 25 | -extern int system_clock_scale; |
31 | if (err) { | 26 | - |
32 | error_propagate(errp, err); | 27 | #endif /* HW_ARM_H */ |
33 | return; | 28 | diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_systick.h |
34 | } | 29 | index XXXXXXX..XXXXXXX 100644 |
35 | - vmstate_register_ram_global(&s->sram); | 30 | --- a/include/hw/timer/armv7m_systick.h |
36 | memory_region_add_subregion(get_system_memory(), ASPEED_SOC_SRAM_BASE, | 31 | +++ b/include/hw/timer/armv7m_systick.h |
37 | &s->sram); | 32 | @@ -XXX,XX +XXX,XX @@ typedef struct SysTickState { |
38 | 33 | qemu_irq irq; | |
34 | } SysTickState; | ||
35 | |||
36 | +/* | ||
37 | + * Multiplication factor to convert from system clock ticks to qemu timer | ||
38 | + * ticks. This should be set (by board code, usually) to a value | ||
39 | + * equal to NANOSECONDS_PER_SECOND / frq, where frq is the clock frequency | ||
40 | + * in Hz of the CPU. | ||
41 | + * | ||
42 | + * This value is used by the systick device when it is running in | ||
43 | + * its "use the CPU clock" mode (ie when SYST_CSR.CLKSOURCE == 1) to | ||
44 | + * set how fast the timer should tick. | ||
45 | + * | ||
46 | + * TODO: we should refactor this so that rather than using a global | ||
47 | + * we use a device property or something similar. This is complicated | ||
48 | + * because (a) the property would need to be plumbed through from the | ||
49 | + * board code down through various layers to the systick device | ||
50 | + * and (b) the property needs to be modifiable after realize, because | ||
51 | + * the stellaris board uses this to implement the behaviour where the | ||
52 | + * guest can reprogram the PLL registers to downclock the CPU, and the | ||
53 | + * systick device needs to react accordingly. Possibly this should | ||
54 | + * be deferred until we have a good API for modelling clock trees. | ||
55 | + */ | ||
56 | +extern int system_clock_scale; | ||
57 | + | ||
58 | #endif | ||
39 | -- | 59 | -- |
40 | 2.17.0 | 60 | 2.20.1 |
41 | 61 | ||
42 | 62 | diff view generated by jsdifflib |
1 | From: Aaron Lindsay <alindsay@codeaurora.org> | 1 | The hw/arm/arm.h header now only includes declarations relating |
---|---|---|---|
2 | to boot.c code, so it is only needed by Arm board or SoC code. | ||
3 | Remove some unnecessary inclusions of it from target/arm files | ||
4 | and from hw/intc/armv7m_nvic.c. | ||
2 | 5 | ||
3 | Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> | ||
4 | Message-id: 1523997485-1905-7-git-send-email-alindsay@codeaurora.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20190516163857.6430-3-peter.maydell@linaro.org | ||
7 | --- | 10 | --- |
8 | target/arm/cpu.h | 20 ++++++++++---------- | 11 | hw/intc/armv7m_nvic.c | 1 - |
9 | target/arm/internals.h | 7 ++++--- | 12 | target/arm/arm-semi.c | 1 - |
10 | target/arm/cpu.c | 21 ++++++++++++++++----- | 13 | target/arm/cpu.c | 1 - |
11 | 3 files changed, 30 insertions(+), 18 deletions(-) | 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(-) | ||
12 | 19 | ||
13 | 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 |
14 | index XXXXXXX..XXXXXXX 100644 | 21 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/target/arm/cpu.h | 22 | --- a/hw/intc/armv7m_nvic.c |
16 | +++ b/target/arm/cpu.h | 23 | +++ b/hw/intc/armv7m_nvic.c |
17 | @@ -XXX,XX +XXX,XX @@ typedef struct CPUARMState { | 24 | @@ -XXX,XX +XXX,XX @@ |
18 | } CPUARMState; | 25 | #include "cpu.h" |
19 | 26 | #include "hw/sysbus.h" | |
20 | /** | 27 | #include "qemu/timer.h" |
21 | - * ARMELChangeHook: | 28 | -#include "hw/arm/arm.h" |
22 | + * ARMELChangeHookFn: | 29 | #include "hw/intc/armv7m_nvic.h" |
23 | * type of a function which can be registered via arm_register_el_change_hook() | 30 | #include "target/arm/cpu.h" |
24 | * to get callbacks when the CPU changes its exception level or mode. | 31 | #include "exec/exec-all.h" |
25 | */ | 32 | diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c |
26 | -typedef void ARMELChangeHook(ARMCPU *cpu, void *opaque); | ||
27 | - | ||
28 | +typedef void ARMELChangeHookFn(ARMCPU *cpu, void *opaque); | ||
29 | +typedef struct ARMELChangeHook ARMELChangeHook; | ||
30 | +struct ARMELChangeHook { | ||
31 | + ARMELChangeHookFn *hook; | ||
32 | + void *opaque; | ||
33 | + QLIST_ENTRY(ARMELChangeHook) node; | ||
34 | +}; | ||
35 | |||
36 | /* These values map onto the return values for | ||
37 | * QEMU_PSCI_0_2_FN_AFFINITY_INFO */ | ||
38 | @@ -XXX,XX +XXX,XX @@ struct ARMCPU { | ||
39 | */ | ||
40 | bool cfgend; | ||
41 | |||
42 | - ARMELChangeHook *el_change_hook; | ||
43 | - void *el_change_hook_opaque; | ||
44 | + QLIST_HEAD(, ARMELChangeHook) el_change_hooks; | ||
45 | |||
46 | int32_t node_id; /* NUMA node this CPU belongs to */ | ||
47 | |||
48 | @@ -XXX,XX +XXX,XX @@ static inline AddressSpace *arm_addressspace(CPUState *cs, MemTxAttrs attrs) | ||
49 | * CPU changes exception level or mode. The hook function will be | ||
50 | * passed a pointer to the ARMCPU and the opaque data pointer passed | ||
51 | * to this function when the hook was registered. | ||
52 | - * | ||
53 | - * Note that we currently only support registering a single hook function, | ||
54 | - * and will assert if this function is called twice. | ||
55 | - * This facility is intended for the use of the GICv3 emulation. | ||
56 | */ | ||
57 | -void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHook *hook, | ||
58 | +void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, | ||
59 | void *opaque); | ||
60 | |||
61 | /** | ||
62 | diff --git a/target/arm/internals.h b/target/arm/internals.h | ||
63 | index XXXXXXX..XXXXXXX 100644 | 33 | index XXXXXXX..XXXXXXX 100644 |
64 | --- a/target/arm/internals.h | 34 | --- a/target/arm/arm-semi.c |
65 | +++ b/target/arm/internals.h | 35 | +++ b/target/arm/arm-semi.c |
66 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, | 36 | @@ -XXX,XX +XXX,XX @@ |
67 | int mmu_idx, MemTxAttrs attrs, | 37 | #else |
68 | MemTxResult response, uintptr_t retaddr); | 38 | #include "qemu-common.h" |
69 | 39 | #include "exec/gdbstub.h" | |
70 | -/* Call the EL change hook if one has been registered */ | 40 | -#include "hw/arm/arm.h" |
71 | +/* Call any registered EL change hooks */ | 41 | #include "qemu/cutils.h" |
72 | static inline void arm_call_el_change_hook(ARMCPU *cpu) | 42 | #endif |
73 | { | ||
74 | - if (cpu->el_change_hook) { | ||
75 | - cpu->el_change_hook(cpu, cpu->el_change_hook_opaque); | ||
76 | + ARMELChangeHook *hook, *next; | ||
77 | + QLIST_FOREACH_SAFE(hook, &cpu->el_change_hooks, node, next) { | ||
78 | + hook->hook(cpu, hook->opaque); | ||
79 | } | ||
80 | } | ||
81 | 43 | ||
82 | 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 |
83 | index XXXXXXX..XXXXXXX 100644 | 45 | index XXXXXXX..XXXXXXX 100644 |
84 | --- a/target/arm/cpu.c | 46 | --- a/target/arm/cpu.c |
85 | +++ b/target/arm/cpu.c | 47 | +++ b/target/arm/cpu.c |
86 | @@ -XXX,XX +XXX,XX @@ static bool arm_cpu_has_work(CPUState *cs) | 48 | @@ -XXX,XX +XXX,XX @@ |
87 | | CPU_INTERRUPT_EXITTB); | 49 | #if !defined(CONFIG_USER_ONLY) |
88 | } | 50 | #include "hw/loader.h" |
89 | 51 | #endif | |
90 | -void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHook *hook, | 52 | -#include "hw/arm/arm.h" |
91 | +void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, | 53 | #include "sysemu/sysemu.h" |
92 | void *opaque) | 54 | #include "sysemu/hw_accel.h" |
93 | { | 55 | #include "kvm_arm.h" |
94 | - /* We currently only support registering a single hook function */ | 56 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c |
95 | - assert(!cpu->el_change_hook); | 57 | index XXXXXXX..XXXXXXX 100644 |
96 | - cpu->el_change_hook = hook; | 58 | --- a/target/arm/cpu64.c |
97 | - cpu->el_change_hook_opaque = opaque; | 59 | +++ b/target/arm/cpu64.c |
98 | + ARMELChangeHook *entry = g_new0(ARMELChangeHook, 1); | 60 | @@ -XXX,XX +XXX,XX @@ |
99 | + | 61 | #if !defined(CONFIG_USER_ONLY) |
100 | + entry->hook = hook; | 62 | #include "hw/loader.h" |
101 | + entry->opaque = opaque; | 63 | #endif |
102 | + | 64 | -#include "hw/arm/arm.h" |
103 | + QLIST_INSERT_HEAD(&cpu->el_change_hooks, entry, node); | 65 | #include "sysemu/sysemu.h" |
104 | } | 66 | #include "sysemu/kvm.h" |
105 | 67 | #include "kvm_arm.h" | |
106 | static void cp_reg_reset(gpointer key, gpointer value, gpointer opaque) | 68 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c |
107 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_initfn(Object *obj) | 69 | index XXXXXXX..XXXXXXX 100644 |
108 | cpu->cp_regs = g_hash_table_new_full(g_int_hash, g_int_equal, | 70 | --- a/target/arm/kvm.c |
109 | g_free, g_free); | 71 | +++ b/target/arm/kvm.c |
110 | 72 | @@ -XXX,XX +XXX,XX @@ | |
111 | + QLIST_INIT(&cpu->el_change_hooks); | 73 | #include "cpu.h" |
112 | + | 74 | #include "trace.h" |
113 | #ifndef CONFIG_USER_ONLY | 75 | #include "internals.h" |
114 | /* Our inbound IRQ and FIQ lines */ | 76 | -#include "hw/arm/arm.h" |
115 | if (kvm_enabled()) { | 77 | #include "hw/pci/pci.h" |
116 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_post_init(Object *obj) | 78 | #include "exec/memattrs.h" |
117 | static void arm_cpu_finalizefn(Object *obj) | 79 | #include "exec/address-spaces.h" |
118 | { | 80 | diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c |
119 | ARMCPU *cpu = ARM_CPU(obj); | 81 | index XXXXXXX..XXXXXXX 100644 |
120 | + ARMELChangeHook *hook, *next; | 82 | --- a/target/arm/kvm32.c |
121 | + | 83 | +++ b/target/arm/kvm32.c |
122 | g_hash_table_destroy(cpu->cp_regs); | 84 | @@ -XXX,XX +XXX,XX @@ |
123 | + | 85 | #include "sysemu/kvm.h" |
124 | + QLIST_FOREACH_SAFE(hook, &cpu->el_change_hooks, node, next) { | 86 | #include "kvm_arm.h" |
125 | + QLIST_REMOVE(hook, node); | 87 | #include "internals.h" |
126 | + g_free(hook); | 88 | -#include "hw/arm/arm.h" |
127 | + } | 89 | #include "qemu/log.h" |
128 | } | 90 | |
129 | 91 | static inline void set_feature(uint64_t *features, int feature) | |
130 | static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | 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 | |||
131 | -- | 104 | -- |
132 | 2.17.0 | 105 | 2.20.1 |
133 | 106 | ||
134 | 107 | diff view generated by jsdifflib |
1 | In commit 210f47840dd62, we changed the bcm2836 SoC object to | 1 | The header file hw/arm/arm.h now includes only declarations |
---|---|---|---|
2 | always create a CPU of the correct type for that SoC model. This | 2 | relating to hw/arm/boot.c functionality. Rename it accordingly, |
3 | makes the default_cpu_type settings in the MachineClass structs | 3 | and adjust its header comment. |
4 | for the raspi2 and raspi3 boards redundant. We didn't change | 4 | |
5 | those at the time because it would have meant a temporary | 5 | The bulk of this commit was created via |
6 | regression in a corner case of error handling if the user | 6 | perl -pi -e 's|hw/arm/arm.h|hw/arm/boot.h|' hw/arm/*.c include/hw/arm/*.h |
7 | requested a non-existing CPU type. The -cpu parse handling | 7 | |
8 | changes in 2278b93941d42c3 mean that it no longer implicitly | 8 | In a few cases we can just delete the #include: |
9 | depends on default_cpu_type for this to work, so we can now | 9 | hw/arm/msf2-soc.c, include/hw/arm/aspeed_soc.h and |
10 | delete the redundant default_cpu_type fields. | 10 | include/hw/arm/bcm2836.h did not require it. |
11 | 11 | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
13 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 13 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
14 | Message-id: 20180420155547.9497-1-peter.maydell@linaro.org | 14 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
15 | Message-id: 20190516163857.6430-4-peter.maydell@linaro.org | ||
15 | --- | 16 | --- |
16 | hw/arm/raspi.c | 2 -- | 17 | include/hw/arm/allwinner-a10.h | 2 +- |
17 | 1 file changed, 2 deletions(-) | 18 | include/hw/arm/aspeed_soc.h | 1 - |
19 | include/hw/arm/bcm2836.h | 1 - | ||
20 | include/hw/arm/{arm.h => boot.h} | 8 ++++---- | ||
21 | include/hw/arm/fsl-imx25.h | 2 +- | ||
22 | include/hw/arm/fsl-imx31.h | 2 +- | ||
23 | include/hw/arm/fsl-imx6.h | 2 +- | ||
24 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
25 | include/hw/arm/fsl-imx7.h | 2 +- | ||
26 | include/hw/arm/virt.h | 2 +- | ||
27 | include/hw/arm/xlnx-versal.h | 2 +- | ||
28 | include/hw/arm/xlnx-zynqmp.h | 2 +- | ||
29 | hw/arm/armsse.c | 2 +- | ||
30 | hw/arm/armv7m.c | 2 +- | ||
31 | hw/arm/aspeed.c | 2 +- | ||
32 | hw/arm/boot.c | 2 +- | ||
33 | hw/arm/collie.c | 2 +- | ||
34 | hw/arm/exynos4210.c | 2 +- | ||
35 | hw/arm/exynos4_boards.c | 2 +- | ||
36 | hw/arm/highbank.c | 2 +- | ||
37 | hw/arm/integratorcp.c | 2 +- | ||
38 | hw/arm/mainstone.c | 2 +- | ||
39 | hw/arm/microbit.c | 2 +- | ||
40 | hw/arm/mps2-tz.c | 2 +- | ||
41 | hw/arm/mps2.c | 2 +- | ||
42 | hw/arm/msf2-soc.c | 1 - | ||
43 | hw/arm/msf2-som.c | 2 +- | ||
44 | hw/arm/musca.c | 2 +- | ||
45 | hw/arm/musicpal.c | 2 +- | ||
46 | hw/arm/netduino2.c | 2 +- | ||
47 | hw/arm/nrf51_soc.c | 2 +- | ||
48 | hw/arm/nseries.c | 2 +- | ||
49 | hw/arm/omap1.c | 2 +- | ||
50 | hw/arm/omap2.c | 2 +- | ||
51 | hw/arm/omap_sx1.c | 2 +- | ||
52 | hw/arm/palm.c | 2 +- | ||
53 | hw/arm/raspi.c | 2 +- | ||
54 | hw/arm/realview.c | 2 +- | ||
55 | hw/arm/spitz.c | 2 +- | ||
56 | hw/arm/stellaris.c | 2 +- | ||
57 | hw/arm/stm32f205_soc.c | 2 +- | ||
58 | hw/arm/strongarm.c | 2 +- | ||
59 | hw/arm/tosa.c | 2 +- | ||
60 | hw/arm/versatilepb.c | 2 +- | ||
61 | hw/arm/vexpress.c | 2 +- | ||
62 | hw/arm/virt.c | 2 +- | ||
63 | hw/arm/xilinx_zynq.c | 2 +- | ||
64 | hw/arm/xlnx-versal.c | 2 +- | ||
65 | hw/arm/z2.c | 2 +- | ||
66 | 49 files changed, 49 insertions(+), 52 deletions(-) | ||
67 | rename include/hw/arm/{arm.h => boot.h} (98%) | ||
18 | 68 | ||
69 | diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h | ||
70 | index XXXXXXX..XXXXXXX 100644 | ||
71 | --- a/include/hw/arm/allwinner-a10.h | ||
72 | +++ b/include/hw/arm/allwinner-a10.h | ||
73 | @@ -XXX,XX +XXX,XX @@ | ||
74 | #include "qemu-common.h" | ||
75 | #include "qemu/error-report.h" | ||
76 | #include "hw/char/serial.h" | ||
77 | -#include "hw/arm/arm.h" | ||
78 | +#include "hw/arm/boot.h" | ||
79 | #include "hw/timer/allwinner-a10-pit.h" | ||
80 | #include "hw/intc/allwinner-a10-pic.h" | ||
81 | #include "hw/net/allwinner_emac.h" | ||
82 | diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h | ||
83 | index XXXXXXX..XXXXXXX 100644 | ||
84 | --- a/include/hw/arm/aspeed_soc.h | ||
85 | +++ b/include/hw/arm/aspeed_soc.h | ||
86 | @@ -XXX,XX +XXX,XX @@ | ||
87 | #ifndef ASPEED_SOC_H | ||
88 | #define ASPEED_SOC_H | ||
89 | |||
90 | -#include "hw/arm/arm.h" | ||
91 | #include "hw/intc/aspeed_vic.h" | ||
92 | #include "hw/misc/aspeed_scu.h" | ||
93 | #include "hw/misc/aspeed_sdmc.h" | ||
94 | diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h | ||
95 | index XXXXXXX..XXXXXXX 100644 | ||
96 | --- a/include/hw/arm/bcm2836.h | ||
97 | +++ b/include/hw/arm/bcm2836.h | ||
98 | @@ -XXX,XX +XXX,XX @@ | ||
99 | #ifndef BCM2836_H | ||
100 | #define BCM2836_H | ||
101 | |||
102 | -#include "hw/arm/arm.h" | ||
103 | #include "hw/arm/bcm2835_peripherals.h" | ||
104 | #include "hw/intc/bcm2836_control.h" | ||
105 | |||
106 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/boot.h | ||
107 | similarity index 98% | ||
108 | rename from include/hw/arm/arm.h | ||
109 | rename to include/hw/arm/boot.h | ||
110 | index XXXXXXX..XXXXXXX 100644 | ||
111 | --- a/include/hw/arm/arm.h | ||
112 | +++ b/include/hw/arm/boot.h | ||
113 | @@ -XXX,XX +XXX,XX @@ | ||
114 | /* | ||
115 | - * Misc ARM declarations | ||
116 | + * ARM kernel loader. | ||
117 | * | ||
118 | * Copyright (c) 2006 CodeSourcery. | ||
119 | * Written by Paul Brook | ||
120 | @@ -XXX,XX +XXX,XX @@ | ||
121 | * | ||
122 | */ | ||
123 | |||
124 | -#ifndef HW_ARM_H | ||
125 | -#define HW_ARM_H | ||
126 | +#ifndef HW_ARM_BOOT_H | ||
127 | +#define HW_ARM_BOOT_H | ||
128 | |||
129 | #include "exec/memory.h" | ||
130 | #include "target/arm/cpu-qom.h" | ||
131 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, | ||
132 | const struct arm_boot_info *info, | ||
133 | hwaddr mvbar_addr); | ||
134 | |||
135 | -#endif /* HW_ARM_H */ | ||
136 | +#endif /* HW_ARM_BOOT_H */ | ||
137 | diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h | ||
138 | index XXXXXXX..XXXXXXX 100644 | ||
139 | --- a/include/hw/arm/fsl-imx25.h | ||
140 | +++ b/include/hw/arm/fsl-imx25.h | ||
141 | @@ -XXX,XX +XXX,XX @@ | ||
142 | #ifndef FSL_IMX25_H | ||
143 | #define FSL_IMX25_H | ||
144 | |||
145 | -#include "hw/arm/arm.h" | ||
146 | +#include "hw/arm/boot.h" | ||
147 | #include "hw/intc/imx_avic.h" | ||
148 | #include "hw/misc/imx25_ccm.h" | ||
149 | #include "hw/char/imx_serial.h" | ||
150 | diff --git a/include/hw/arm/fsl-imx31.h b/include/hw/arm/fsl-imx31.h | ||
151 | index XXXXXXX..XXXXXXX 100644 | ||
152 | --- a/include/hw/arm/fsl-imx31.h | ||
153 | +++ b/include/hw/arm/fsl-imx31.h | ||
154 | @@ -XXX,XX +XXX,XX @@ | ||
155 | #ifndef FSL_IMX31_H | ||
156 | #define FSL_IMX31_H | ||
157 | |||
158 | -#include "hw/arm/arm.h" | ||
159 | +#include "hw/arm/boot.h" | ||
160 | #include "hw/intc/imx_avic.h" | ||
161 | #include "hw/misc/imx31_ccm.h" | ||
162 | #include "hw/char/imx_serial.h" | ||
163 | diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h | ||
164 | index XXXXXXX..XXXXXXX 100644 | ||
165 | --- a/include/hw/arm/fsl-imx6.h | ||
166 | +++ b/include/hw/arm/fsl-imx6.h | ||
167 | @@ -XXX,XX +XXX,XX @@ | ||
168 | #ifndef FSL_IMX6_H | ||
169 | #define FSL_IMX6_H | ||
170 | |||
171 | -#include "hw/arm/arm.h" | ||
172 | +#include "hw/arm/boot.h" | ||
173 | #include "hw/cpu/a9mpcore.h" | ||
174 | #include "hw/misc/imx6_ccm.h" | ||
175 | #include "hw/misc/imx6_src.h" | ||
176 | diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h | ||
177 | index XXXXXXX..XXXXXXX 100644 | ||
178 | --- a/include/hw/arm/fsl-imx6ul.h | ||
179 | +++ b/include/hw/arm/fsl-imx6ul.h | ||
180 | @@ -XXX,XX +XXX,XX @@ | ||
181 | #ifndef FSL_IMX6UL_H | ||
182 | #define FSL_IMX6UL_H | ||
183 | |||
184 | -#include "hw/arm/arm.h" | ||
185 | +#include "hw/arm/boot.h" | ||
186 | #include "hw/cpu/a15mpcore.h" | ||
187 | #include "hw/misc/imx6ul_ccm.h" | ||
188 | #include "hw/misc/imx6_src.h" | ||
189 | diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h | ||
190 | index XXXXXXX..XXXXXXX 100644 | ||
191 | --- a/include/hw/arm/fsl-imx7.h | ||
192 | +++ b/include/hw/arm/fsl-imx7.h | ||
193 | @@ -XXX,XX +XXX,XX @@ | ||
194 | #ifndef FSL_IMX7_H | ||
195 | #define FSL_IMX7_H | ||
196 | |||
197 | -#include "hw/arm/arm.h" | ||
198 | +#include "hw/arm/boot.h" | ||
199 | #include "hw/cpu/a15mpcore.h" | ||
200 | #include "hw/intc/imx_gpcv2.h" | ||
201 | #include "hw/misc/imx7_ccm.h" | ||
202 | diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h | ||
203 | index XXXXXXX..XXXXXXX 100644 | ||
204 | --- a/include/hw/arm/virt.h | ||
205 | +++ b/include/hw/arm/virt.h | ||
206 | @@ -XXX,XX +XXX,XX @@ | ||
207 | #include "exec/hwaddr.h" | ||
208 | #include "qemu/notify.h" | ||
209 | #include "hw/boards.h" | ||
210 | -#include "hw/arm/arm.h" | ||
211 | +#include "hw/arm/boot.h" | ||
212 | #include "hw/block/flash.h" | ||
213 | #include "sysemu/kvm.h" | ||
214 | #include "hw/intc/arm_gicv3_common.h" | ||
215 | diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h | ||
216 | index XXXXXXX..XXXXXXX 100644 | ||
217 | --- a/include/hw/arm/xlnx-versal.h | ||
218 | +++ b/include/hw/arm/xlnx-versal.h | ||
219 | @@ -XXX,XX +XXX,XX @@ | ||
220 | #define XLNX_VERSAL_H | ||
221 | |||
222 | #include "hw/sysbus.h" | ||
223 | -#include "hw/arm/arm.h" | ||
224 | +#include "hw/arm/boot.h" | ||
225 | #include "hw/intc/arm_gicv3.h" | ||
226 | |||
227 | #define TYPE_XLNX_VERSAL "xlnx-versal" | ||
228 | diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h | ||
229 | index XXXXXXX..XXXXXXX 100644 | ||
230 | --- a/include/hw/arm/xlnx-zynqmp.h | ||
231 | +++ b/include/hw/arm/xlnx-zynqmp.h | ||
232 | @@ -XXX,XX +XXX,XX @@ | ||
233 | #ifndef XLNX_ZYNQMP_H | ||
234 | |||
235 | #include "qemu-common.h" | ||
236 | -#include "hw/arm/arm.h" | ||
237 | +#include "hw/arm/boot.h" | ||
238 | #include "hw/intc/arm_gic.h" | ||
239 | #include "hw/net/cadence_gem.h" | ||
240 | #include "hw/char/cadence_uart.h" | ||
241 | diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c | ||
242 | index XXXXXXX..XXXXXXX 100644 | ||
243 | --- a/hw/arm/armsse.c | ||
244 | +++ b/hw/arm/armsse.c | ||
245 | @@ -XXX,XX +XXX,XX @@ | ||
246 | #include "hw/sysbus.h" | ||
247 | #include "hw/registerfields.h" | ||
248 | #include "hw/arm/armsse.h" | ||
249 | -#include "hw/arm/arm.h" | ||
250 | +#include "hw/arm/boot.h" | ||
251 | |||
252 | /* Format of the System Information block SYS_CONFIG register */ | ||
253 | typedef enum SysConfigFormat { | ||
254 | diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c | ||
255 | index XXXXXXX..XXXXXXX 100644 | ||
256 | --- a/hw/arm/armv7m.c | ||
257 | +++ b/hw/arm/armv7m.c | ||
258 | @@ -XXX,XX +XXX,XX @@ | ||
259 | #include "qemu-common.h" | ||
260 | #include "cpu.h" | ||
261 | #include "hw/sysbus.h" | ||
262 | -#include "hw/arm/arm.h" | ||
263 | +#include "hw/arm/boot.h" | ||
264 | #include "hw/loader.h" | ||
265 | #include "elf.h" | ||
266 | #include "sysemu/qtest.h" | ||
267 | diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c | ||
268 | index XXXXXXX..XXXXXXX 100644 | ||
269 | --- a/hw/arm/aspeed.c | ||
270 | +++ b/hw/arm/aspeed.c | ||
271 | @@ -XXX,XX +XXX,XX @@ | ||
272 | #include "qemu-common.h" | ||
273 | #include "cpu.h" | ||
274 | #include "exec/address-spaces.h" | ||
275 | -#include "hw/arm/arm.h" | ||
276 | +#include "hw/arm/boot.h" | ||
277 | #include "hw/arm/aspeed.h" | ||
278 | #include "hw/arm/aspeed_soc.h" | ||
279 | #include "hw/boards.h" | ||
280 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | ||
281 | index XXXXXXX..XXXXXXX 100644 | ||
282 | --- a/hw/arm/boot.c | ||
283 | +++ b/hw/arm/boot.c | ||
284 | @@ -XXX,XX +XXX,XX @@ | ||
285 | #include "qapi/error.h" | ||
286 | #include <libfdt.h> | ||
287 | #include "hw/hw.h" | ||
288 | -#include "hw/arm/arm.h" | ||
289 | +#include "hw/arm/boot.h" | ||
290 | #include "hw/arm/linux-boot-if.h" | ||
291 | #include "sysemu/kvm.h" | ||
292 | #include "sysemu/sysemu.h" | ||
293 | diff --git a/hw/arm/collie.c b/hw/arm/collie.c | ||
294 | index XXXXXXX..XXXXXXX 100644 | ||
295 | --- a/hw/arm/collie.c | ||
296 | +++ b/hw/arm/collie.c | ||
297 | @@ -XXX,XX +XXX,XX @@ | ||
298 | #include "hw/sysbus.h" | ||
299 | #include "hw/boards.h" | ||
300 | #include "strongarm.h" | ||
301 | -#include "hw/arm/arm.h" | ||
302 | +#include "hw/arm/boot.h" | ||
303 | #include "hw/block/flash.h" | ||
304 | #include "exec/address-spaces.h" | ||
305 | #include "cpu.h" | ||
306 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | ||
307 | index XXXXXXX..XXXXXXX 100644 | ||
308 | --- a/hw/arm/exynos4210.c | ||
309 | +++ b/hw/arm/exynos4210.c | ||
310 | @@ -XXX,XX +XXX,XX @@ | ||
311 | #include "hw/boards.h" | ||
312 | #include "sysemu/sysemu.h" | ||
313 | #include "hw/sysbus.h" | ||
314 | -#include "hw/arm/arm.h" | ||
315 | +#include "hw/arm/boot.h" | ||
316 | #include "hw/loader.h" | ||
317 | #include "hw/arm/exynos4210.h" | ||
318 | #include "hw/sd/sdhci.h" | ||
319 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | ||
320 | index XXXXXXX..XXXXXXX 100644 | ||
321 | --- a/hw/arm/exynos4_boards.c | ||
322 | +++ b/hw/arm/exynos4_boards.c | ||
323 | @@ -XXX,XX +XXX,XX @@ | ||
324 | #include "sysemu/sysemu.h" | ||
325 | #include "hw/sysbus.h" | ||
326 | #include "net/net.h" | ||
327 | -#include "hw/arm/arm.h" | ||
328 | +#include "hw/arm/boot.h" | ||
329 | #include "exec/address-spaces.h" | ||
330 | #include "hw/arm/exynos4210.h" | ||
331 | #include "hw/net/lan9118.h" | ||
332 | diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c | ||
333 | index XXXXXXX..XXXXXXX 100644 | ||
334 | --- a/hw/arm/highbank.c | ||
335 | +++ b/hw/arm/highbank.c | ||
336 | @@ -XXX,XX +XXX,XX @@ | ||
337 | #include "qemu/osdep.h" | ||
338 | #include "qapi/error.h" | ||
339 | #include "hw/sysbus.h" | ||
340 | -#include "hw/arm/arm.h" | ||
341 | +#include "hw/arm/boot.h" | ||
342 | #include "hw/loader.h" | ||
343 | #include "net/net.h" | ||
344 | #include "sysemu/kvm.h" | ||
345 | diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c | ||
346 | index XXXXXXX..XXXXXXX 100644 | ||
347 | --- a/hw/arm/integratorcp.c | ||
348 | +++ b/hw/arm/integratorcp.c | ||
349 | @@ -XXX,XX +XXX,XX @@ | ||
350 | #include "cpu.h" | ||
351 | #include "hw/sysbus.h" | ||
352 | #include "hw/boards.h" | ||
353 | -#include "hw/arm/arm.h" | ||
354 | +#include "hw/arm/boot.h" | ||
355 | #include "hw/misc/arm_integrator_debug.h" | ||
356 | #include "hw/net/smc91c111.h" | ||
357 | #include "net/net.h" | ||
358 | diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c | ||
359 | index XXXXXXX..XXXXXXX 100644 | ||
360 | --- a/hw/arm/mainstone.c | ||
361 | +++ b/hw/arm/mainstone.c | ||
362 | @@ -XXX,XX +XXX,XX @@ | ||
363 | #include "qapi/error.h" | ||
364 | #include "hw/hw.h" | ||
365 | #include "hw/arm/pxa.h" | ||
366 | -#include "hw/arm/arm.h" | ||
367 | +#include "hw/arm/boot.h" | ||
368 | #include "net/net.h" | ||
369 | #include "hw/net/smc91c111.h" | ||
370 | #include "hw/boards.h" | ||
371 | diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c | ||
372 | index XXXXXXX..XXXXXXX 100644 | ||
373 | --- a/hw/arm/microbit.c | ||
374 | +++ b/hw/arm/microbit.c | ||
375 | @@ -XXX,XX +XXX,XX @@ | ||
376 | #include "qemu/osdep.h" | ||
377 | #include "qapi/error.h" | ||
378 | #include "hw/boards.h" | ||
379 | -#include "hw/arm/arm.h" | ||
380 | +#include "hw/arm/boot.h" | ||
381 | #include "sysemu/sysemu.h" | ||
382 | #include "exec/address-spaces.h" | ||
383 | |||
384 | diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c | ||
385 | index XXXXXXX..XXXXXXX 100644 | ||
386 | --- a/hw/arm/mps2-tz.c | ||
387 | +++ b/hw/arm/mps2-tz.c | ||
388 | @@ -XXX,XX +XXX,XX @@ | ||
389 | #include "qemu/osdep.h" | ||
390 | #include "qapi/error.h" | ||
391 | #include "qemu/error-report.h" | ||
392 | -#include "hw/arm/arm.h" | ||
393 | +#include "hw/arm/boot.h" | ||
394 | #include "hw/arm/armv7m.h" | ||
395 | #include "hw/or-irq.h" | ||
396 | #include "hw/boards.h" | ||
397 | diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c | ||
398 | index XXXXXXX..XXXXXXX 100644 | ||
399 | --- a/hw/arm/mps2.c | ||
400 | +++ b/hw/arm/mps2.c | ||
401 | @@ -XXX,XX +XXX,XX @@ | ||
402 | #include "qemu/osdep.h" | ||
403 | #include "qapi/error.h" | ||
404 | #include "qemu/error-report.h" | ||
405 | -#include "hw/arm/arm.h" | ||
406 | +#include "hw/arm/boot.h" | ||
407 | #include "hw/arm/armv7m.h" | ||
408 | #include "hw/or-irq.h" | ||
409 | #include "hw/boards.h" | ||
410 | diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c | ||
411 | index XXXXXXX..XXXXXXX 100644 | ||
412 | --- a/hw/arm/msf2-soc.c | ||
413 | +++ b/hw/arm/msf2-soc.c | ||
414 | @@ -XXX,XX +XXX,XX @@ | ||
415 | #include "qemu/units.h" | ||
416 | #include "qapi/error.h" | ||
417 | #include "qemu-common.h" | ||
418 | -#include "hw/arm/arm.h" | ||
419 | #include "exec/address-spaces.h" | ||
420 | #include "hw/char/serial.h" | ||
421 | #include "hw/boards.h" | ||
422 | diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c | ||
423 | index XXXXXXX..XXXXXXX 100644 | ||
424 | --- a/hw/arm/msf2-som.c | ||
425 | +++ b/hw/arm/msf2-som.c | ||
426 | @@ -XXX,XX +XXX,XX @@ | ||
427 | #include "qapi/error.h" | ||
428 | #include "qemu/error-report.h" | ||
429 | #include "hw/boards.h" | ||
430 | -#include "hw/arm/arm.h" | ||
431 | +#include "hw/arm/boot.h" | ||
432 | #include "exec/address-spaces.h" | ||
433 | #include "hw/arm/msf2-soc.h" | ||
434 | #include "cpu.h" | ||
435 | diff --git a/hw/arm/musca.c b/hw/arm/musca.c | ||
436 | index XXXXXXX..XXXXXXX 100644 | ||
437 | --- a/hw/arm/musca.c | ||
438 | +++ b/hw/arm/musca.c | ||
439 | @@ -XXX,XX +XXX,XX @@ | ||
440 | #include "qapi/error.h" | ||
441 | #include "exec/address-spaces.h" | ||
442 | #include "sysemu/sysemu.h" | ||
443 | -#include "hw/arm/arm.h" | ||
444 | +#include "hw/arm/boot.h" | ||
445 | #include "hw/arm/armsse.h" | ||
446 | #include "hw/boards.h" | ||
447 | #include "hw/char/pl011.h" | ||
448 | diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c | ||
449 | index XXXXXXX..XXXXXXX 100644 | ||
450 | --- a/hw/arm/musicpal.c | ||
451 | +++ b/hw/arm/musicpal.c | ||
452 | @@ -XXX,XX +XXX,XX @@ | ||
453 | #include "qemu-common.h" | ||
454 | #include "cpu.h" | ||
455 | #include "hw/sysbus.h" | ||
456 | -#include "hw/arm/arm.h" | ||
457 | +#include "hw/arm/boot.h" | ||
458 | #include "net/net.h" | ||
459 | #include "sysemu/sysemu.h" | ||
460 | #include "hw/boards.h" | ||
461 | diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c | ||
462 | index XXXXXXX..XXXXXXX 100644 | ||
463 | --- a/hw/arm/netduino2.c | ||
464 | +++ b/hw/arm/netduino2.c | ||
465 | @@ -XXX,XX +XXX,XX @@ | ||
466 | #include "hw/boards.h" | ||
467 | #include "qemu/error-report.h" | ||
468 | #include "hw/arm/stm32f205_soc.h" | ||
469 | -#include "hw/arm/arm.h" | ||
470 | +#include "hw/arm/boot.h" | ||
471 | |||
472 | static void netduino2_init(MachineState *machine) | ||
473 | { | ||
474 | diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c | ||
475 | index XXXXXXX..XXXXXXX 100644 | ||
476 | --- a/hw/arm/nrf51_soc.c | ||
477 | +++ b/hw/arm/nrf51_soc.c | ||
478 | @@ -XXX,XX +XXX,XX @@ | ||
479 | #include "qemu/osdep.h" | ||
480 | #include "qapi/error.h" | ||
481 | #include "qemu-common.h" | ||
482 | -#include "hw/arm/arm.h" | ||
483 | +#include "hw/arm/boot.h" | ||
484 | #include "hw/sysbus.h" | ||
485 | #include "hw/boards.h" | ||
486 | #include "hw/misc/unimp.h" | ||
487 | diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c | ||
488 | index XXXXXXX..XXXXXXX 100644 | ||
489 | --- a/hw/arm/nseries.c | ||
490 | +++ b/hw/arm/nseries.c | ||
491 | @@ -XXX,XX +XXX,XX @@ | ||
492 | #include "qemu/bswap.h" | ||
493 | #include "sysemu/sysemu.h" | ||
494 | #include "hw/arm/omap.h" | ||
495 | -#include "hw/arm/arm.h" | ||
496 | +#include "hw/arm/boot.h" | ||
497 | #include "hw/irq.h" | ||
498 | #include "ui/console.h" | ||
499 | #include "hw/boards.h" | ||
500 | diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c | ||
501 | index XXXXXXX..XXXXXXX 100644 | ||
502 | --- a/hw/arm/omap1.c | ||
503 | +++ b/hw/arm/omap1.c | ||
504 | @@ -XXX,XX +XXX,XX @@ | ||
505 | #include "cpu.h" | ||
506 | #include "hw/boards.h" | ||
507 | #include "hw/hw.h" | ||
508 | -#include "hw/arm/arm.h" | ||
509 | +#include "hw/arm/boot.h" | ||
510 | #include "hw/arm/omap.h" | ||
511 | #include "sysemu/sysemu.h" | ||
512 | #include "hw/arm/soc_dma.h" | ||
513 | diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c | ||
514 | index XXXXXXX..XXXXXXX 100644 | ||
515 | --- a/hw/arm/omap2.c | ||
516 | +++ b/hw/arm/omap2.c | ||
517 | @@ -XXX,XX +XXX,XX @@ | ||
518 | #include "sysemu/qtest.h" | ||
519 | #include "hw/boards.h" | ||
520 | #include "hw/hw.h" | ||
521 | -#include "hw/arm/arm.h" | ||
522 | +#include "hw/arm/boot.h" | ||
523 | #include "hw/arm/omap.h" | ||
524 | #include "sysemu/sysemu.h" | ||
525 | #include "qemu/timer.h" | ||
526 | diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c | ||
527 | index XXXXXXX..XXXXXXX 100644 | ||
528 | --- a/hw/arm/omap_sx1.c | ||
529 | +++ b/hw/arm/omap_sx1.c | ||
530 | @@ -XXX,XX +XXX,XX @@ | ||
531 | #include "ui/console.h" | ||
532 | #include "hw/arm/omap.h" | ||
533 | #include "hw/boards.h" | ||
534 | -#include "hw/arm/arm.h" | ||
535 | +#include "hw/arm/boot.h" | ||
536 | #include "hw/block/flash.h" | ||
537 | #include "sysemu/qtest.h" | ||
538 | #include "exec/address-spaces.h" | ||
539 | diff --git a/hw/arm/palm.c b/hw/arm/palm.c | ||
540 | index XXXXXXX..XXXXXXX 100644 | ||
541 | --- a/hw/arm/palm.c | ||
542 | +++ b/hw/arm/palm.c | ||
543 | @@ -XXX,XX +XXX,XX @@ | ||
544 | #include "ui/console.h" | ||
545 | #include "hw/arm/omap.h" | ||
546 | #include "hw/boards.h" | ||
547 | -#include "hw/arm/arm.h" | ||
548 | +#include "hw/arm/boot.h" | ||
549 | #include "hw/input/tsc2xxx.h" | ||
550 | #include "hw/loader.h" | ||
551 | #include "exec/address-spaces.h" | ||
19 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c | 552 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c |
20 | index XXXXXXX..XXXXXXX 100644 | 553 | index XXXXXXX..XXXXXXX 100644 |
21 | --- a/hw/arm/raspi.c | 554 | --- a/hw/arm/raspi.c |
22 | +++ b/hw/arm/raspi.c | 555 | +++ b/hw/arm/raspi.c |
23 | @@ -XXX,XX +XXX,XX @@ static void raspi2_machine_init(MachineClass *mc) | 556 | @@ -XXX,XX +XXX,XX @@ |
24 | mc->no_parallel = 1; | 557 | #include "qemu/error-report.h" |
25 | mc->no_floppy = 1; | 558 | #include "hw/boards.h" |
26 | mc->no_cdrom = 1; | 559 | #include "hw/loader.h" |
27 | - mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a7"); | 560 | -#include "hw/arm/arm.h" |
28 | mc->max_cpus = BCM283X_NCPUS; | 561 | +#include "hw/arm/boot.h" |
29 | mc->min_cpus = BCM283X_NCPUS; | 562 | #include "sysemu/sysemu.h" |
30 | mc->default_cpus = BCM283X_NCPUS; | 563 | |
31 | @@ -XXX,XX +XXX,XX @@ static void raspi3_machine_init(MachineClass *mc) | 564 | #define SMPBOOT_ADDR 0x300 /* this should leave enough space for ATAGS */ |
32 | mc->no_parallel = 1; | 565 | diff --git a/hw/arm/realview.c b/hw/arm/realview.c |
33 | mc->no_floppy = 1; | 566 | index XXXXXXX..XXXXXXX 100644 |
34 | mc->no_cdrom = 1; | 567 | --- a/hw/arm/realview.c |
35 | - mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a53"); | 568 | +++ b/hw/arm/realview.c |
36 | mc->max_cpus = BCM283X_NCPUS; | 569 | @@ -XXX,XX +XXX,XX @@ |
37 | mc->min_cpus = BCM283X_NCPUS; | 570 | #include "qemu-common.h" |
38 | mc->default_cpus = BCM283X_NCPUS; | 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" | ||
39 | -- | 721 | -- |
40 | 2.17.0 | 722 | 2.20.1 |
41 | 723 | ||
42 | 724 | diff view generated by jsdifflib |
1 | Currently we use memory_region_init_ram_nomigrate() to create | 1 | In ich_vmcr_write() we enforce "writes of BPR fields to less than |
---|---|---|---|
2 | the "aspeed.boot_rom" memory region, and we don't manually | 2 | their minimum sets them to the minimum" by doing a "read vbpr and |
3 | register it with vmstate_register_ram(). This currently | 3 | write it back" operation. A typo here meant that we weren't handling |
4 | means that its contents are migrated but as a ram block | 4 | writes to these fields correctly, because we were reading from VBPR0 |
5 | whose name is the empty string; in future it may mean they | 5 | but writing to VBPR1. |
6 | are not migrated at all. Use memory_region_init_ram() instead. | ||
7 | |||
8 | Note that would be a cross-version migration compatibility break | ||
9 | for the "palmetto-bmc", "ast2500-evb" and "romulus-bmc" machines, | ||
10 | but migration is currently broken for them. | ||
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: Cédric Le Goater <clg@kaod.org> | 8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
14 | Tested-by: Cédric Le Goater <clg@kaod.org> | 9 | Message-id: 20190520162809.2677-4-peter.maydell@linaro.org |
15 | Message-id: 20180420124835.7268-3-peter.maydell@linaro.org | ||
16 | --- | 10 | --- |
17 | hw/arm/aspeed.c | 2 +- | 11 | hw/intc/arm_gicv3_cpuif.c | 2 +- |
18 | 1 file changed, 1 insertion(+), 1 deletion(-) | 12 | 1 file changed, 1 insertion(+), 1 deletion(-) |
19 | 13 | ||
20 | diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.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/hw/arm/aspeed.c | 16 | --- a/hw/intc/arm_gicv3_cpuif.c |
23 | +++ b/hw/arm/aspeed.c | 17 | +++ b/hw/intc/arm_gicv3_cpuif.c |
24 | @@ -XXX,XX +XXX,XX @@ static void aspeed_board_init(MachineState *machine, | 18 | @@ -XXX,XX +XXX,XX @@ static void ich_vmcr_write(CPUARMState *env, const ARMCPRegInfo *ri, |
25 | * SoC and 128MB for the AST2500 SoC, which is twice as big as | 19 | /* Enforce "writing BPRs to less than minimum sets them to the minimum" |
26 | * needed by the flash modules of the Aspeed machines. | 20 | * by reading and writing back the fields. |
27 | */ | 21 | */ |
28 | - memory_region_init_rom_nomigrate(boot_rom, OBJECT(bmc), "aspeed.boot_rom", | 22 | - write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G0)); |
29 | + memory_region_init_rom(boot_rom, OBJECT(bmc), "aspeed.boot_rom", | 23 | + write_vbpr(cs, GICV3_G0, read_vbpr(cs, GICV3_G0)); |
30 | fl->size, &error_abort); | 24 | write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G1)); |
31 | memory_region_add_subregion(get_system_memory(), FIRMWARE_ADDR, | 25 | |
32 | boot_rom); | 26 | gicv3_cpuif_virt_update(cs); |
33 | -- | 27 | -- |
34 | 2.17.0 | 28 | 2.20.1 |
35 | 29 | ||
36 | 30 | diff view generated by jsdifflib |
1 | From: Aaron Lindsay <alindsay@codeaurora.org> | 1 | The ICC_CTLR_EL3 register includes some bits which are aliases |
---|---|---|---|
2 | of bits in the ICC_CTLR_EL1(S) and (NS) registers. QEMU chooses | ||
3 | to keep those bits in the cs->icc_ctlr_el1[] struct fields. | ||
4 | Unfortunately a missing '~' in the code to update the bits | ||
5 | in those fields meant that writing to ICC_CTLR_EL3 would corrupt | ||
6 | the ICC_CLTR_EL1 register values. | ||
2 | 7 | ||
3 | This eliminates the need for fetching it from el_change_hook_opaque, and | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
4 | allows for supporting multiple el_change_hooks without having to hack | 9 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
5 | something together to find the registered opaque belonging to GICv3. | 10 | Message-id: 20190520162809.2677-5-peter.maydell@linaro.org |
11 | --- | ||
12 | hw/intc/arm_gicv3_cpuif.c | 4 ++-- | ||
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
6 | 14 | ||
7 | Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Message-id: 1523997485-1905-6-git-send-email-alindsay@codeaurora.org | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | --- | ||
12 | target/arm/cpu.h | 10 ---------- | ||
13 | hw/intc/arm_gicv3_cpuif.c | 10 ++-------- | ||
14 | 2 files changed, 2 insertions(+), 18 deletions(-) | ||
15 | |||
16 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/target/arm/cpu.h | ||
19 | +++ b/target/arm/cpu.h | ||
20 | @@ -XXX,XX +XXX,XX @@ static inline AddressSpace *arm_addressspace(CPUState *cs, MemTxAttrs attrs) | ||
21 | void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHook *hook, | ||
22 | void *opaque); | ||
23 | |||
24 | -/** | ||
25 | - * arm_get_el_change_hook_opaque: | ||
26 | - * Return the opaque data that will be used by the el_change_hook | ||
27 | - * for this CPU. | ||
28 | - */ | ||
29 | -static inline void *arm_get_el_change_hook_opaque(ARMCPU *cpu) | ||
30 | -{ | ||
31 | - return cpu->el_change_hook_opaque; | ||
32 | -} | ||
33 | - | ||
34 | /** | ||
35 | * aa32_vfp_dreg: | ||
36 | * Return a pointer to the Dn register within env in 32-bit mode. | ||
37 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | 15 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c |
38 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
39 | --- a/hw/intc/arm_gicv3_cpuif.c | 17 | --- a/hw/intc/arm_gicv3_cpuif.c |
40 | +++ b/hw/intc/arm_gicv3_cpuif.c | 18 | +++ b/hw/intc/arm_gicv3_cpuif.c |
41 | @@ -XXX,XX +XXX,XX @@ void gicv3_set_gicv3state(CPUState *cpu, GICv3CPUState *s) | 19 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, |
42 | 20 | trace_gicv3_icc_ctlr_el3_write(gicv3_redist_affid(cs), value); | |
43 | static GICv3CPUState *icc_cs_from_env(CPUARMState *env) | 21 | |
44 | { | 22 | /* *_EL1NS and *_EL1S bits are aliases into the ICC_CTLR_EL1 bits. */ |
45 | - /* Given the CPU, find the right GICv3CPUState struct. | 23 | - cs->icc_ctlr_el1[GICV3_NS] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); |
46 | - * Since we registered the CPU interface with the EL change hook as | 24 | + cs->icc_ctlr_el1[GICV3_NS] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); |
47 | - * the opaque pointer, we can just directly get from the CPU to it. | 25 | if (value & ICC_CTLR_EL3_EOIMODE_EL1NS) { |
48 | - */ | 26 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_EOIMODE; |
49 | - return arm_get_el_change_hook_opaque(arm_env_get_cpu(env)); | 27 | } |
50 | + return env->gicv3state; | 28 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, |
51 | } | 29 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_CBPR; |
52 | 30 | } | |
53 | static bool gicv3_use_ns_bank(CPUARMState *env) | 31 | |
54 | @@ -XXX,XX +XXX,XX @@ void gicv3_init_cpuif(GICv3State *s) | 32 | - cs->icc_ctlr_el1[GICV3_S] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); |
55 | * it might be with code translated by CPU 0 but run by CPU 1, in | 33 | + cs->icc_ctlr_el1[GICV3_S] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); |
56 | * which case we'd get the wrong value. | 34 | if (value & ICC_CTLR_EL3_EOIMODE_EL1S) { |
57 | * So instead we define the regs with no ri->opaque info, and | 35 | cs->icc_ctlr_el1[GICV3_S] |= ICC_CTLR_EL1_EOIMODE; |
58 | - * get back to the GICv3CPUState from the ARMCPU by reading back | 36 | } |
59 | - * the opaque pointer from the el_change_hook, which we're going | ||
60 | - * to need to register anyway. | ||
61 | + * get back to the GICv3CPUState from the CPUARMState. | ||
62 | */ | ||
63 | define_arm_cp_regs(cpu, gicv3_cpuif_reginfo); | ||
64 | if (arm_feature(&cpu->env, ARM_FEATURE_EL2) | ||
65 | -- | 37 | -- |
66 | 2.17.0 | 38 | 2.20.1 |
67 | 39 | ||
68 | 40 | diff view generated by jsdifflib |
1 | From: Aaron Lindsay <alindsay@codeaurora.org> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | It was shifted to the left one bit too few. | 3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
4 | 4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | |
5 | Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> | 5 | Message-id: 20190520214342.13709-2-philmd@redhat.com |
6 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | Message-id: 1523997485-1905-10-git-send-email-alindsay@codeaurora.org | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 7 | --- |
10 | target/arm/helper.c | 2 +- | 8 | hw/arm/exynos4_boards.c | 24 ------------------------ |
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | 9 | 1 file changed, 24 deletions(-) |
12 | 10 | ||
13 | diff --git a/target/arm/helper.c b/target/arm/helper.c | 11 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c |
14 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/target/arm/helper.c | 13 | --- a/hw/arm/exynos4_boards.c |
16 | +++ b/target/arm/helper.c | 14 | +++ b/hw/arm/exynos4_boards.c |
17 | @@ -XXX,XX +XXX,XX @@ static void pmccfiltr_write(CPUARMState *env, const ARMCPRegInfo *ri, | 15 | @@ -XXX,XX +XXX,XX @@ |
18 | uint64_t value) | 16 | #include "hw/net/lan9118.h" |
19 | { | 17 | #include "hw/boards.h" |
20 | pmccntr_sync(env); | 18 | |
21 | - env->cp15.pmccfiltr_el0 = value & 0x7E000000; | 19 | -#undef DEBUG |
22 | + env->cp15.pmccfiltr_el0 = value & 0xfc000000; | 20 | - |
23 | pmccntr_sync(env); | 21 | -//#define DEBUG |
24 | } | 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]); | ||
25 | 52 | ||
26 | -- | 53 | -- |
27 | 2.17.0 | 54 | 2.20.1 |
28 | 55 | ||
29 | 56 | diff view generated by jsdifflib |
1 | From: Aaron Lindsay <alindsay@codeaurora.org> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | This is a bug fix to ensure 64-bit reads of these registers don't read | 3 | It eases code review, unit is explicit. |
4 | adjacent data. | ||
5 | 4 | ||
6 | Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> | 5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
7 | Message-id: 1523997485-1905-13-git-send-email-alindsay@codeaurora.org | 6 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> |
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 7 | Message-id: 20190520214342.13709-3-philmd@redhat.com |
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 9 | --- |
11 | target/arm/cpu.h | 4 ++-- | 10 | hw/arm/exynos4_boards.c | 5 +++-- |
12 | target/arm/helper.c | 5 +++-- | 11 | 1 file changed, 3 insertions(+), 2 deletions(-) |
13 | 2 files changed, 5 insertions(+), 4 deletions(-) | ||
14 | 12 | ||
15 | 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 |
16 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/target/arm/cpu.h | 15 | --- a/hw/arm/exynos4_boards.c |
18 | +++ b/target/arm/cpu.h | 16 | +++ b/hw/arm/exynos4_boards.c |
19 | @@ -XXX,XX +XXX,XX @@ typedef struct CPUARMState { | 17 | @@ -XXX,XX +XXX,XX @@ |
20 | uint32_t c9_data; | 18 | */ |
21 | uint64_t c9_pmcr; /* performance monitor control register */ | 19 | |
22 | uint64_t c9_pmcnten; /* perf monitor counter enables */ | 20 | #include "qemu/osdep.h" |
23 | - uint32_t c9_pmovsr; /* perf monitor overflow status */ | 21 | +#include "qemu/units.h" |
24 | - uint32_t c9_pmuserenr; /* perf monitor user enable */ | 22 | #include "qapi/error.h" |
25 | + uint64_t c9_pmovsr; /* perf monitor overflow status */ | 23 | #include "qemu/error-report.h" |
26 | + uint64_t c9_pmuserenr; /* perf monitor user enable */ | 24 | #include "qemu-common.h" |
27 | uint64_t c9_pmselr; /* perf monitor counter selection register */ | 25 | @@ -XXX,XX +XXX,XX @@ static int exynos4_board_smp_bootreg_addr[EXYNOS4_NUM_OF_BOARDS] = { |
28 | uint64_t c9_pminten; /* perf monitor interrupt enables */ | 26 | }; |
29 | union { /* Memory attribute redirection */ | 27 | |
30 | diff --git a/target/arm/helper.c b/target/arm/helper.c | 28 | static unsigned long exynos4_board_ram_size[EXYNOS4_NUM_OF_BOARDS] = { |
31 | index XXXXXXX..XXXXXXX 100644 | 29 | - [EXYNOS4_BOARD_NURI] = 0x40000000, |
32 | --- a/target/arm/helper.c | 30 | - [EXYNOS4_BOARD_SMDKC210] = 0x40000000, |
33 | +++ b/target/arm/helper.c | 31 | + [EXYNOS4_BOARD_NURI] = 1 * GiB, |
34 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo v7_cp_reginfo[] = { | 32 | + [EXYNOS4_BOARD_SMDKC210] = 1 * GiB, |
35 | .fieldoffset = offsetof(CPUARMState, cp15.c9_pmcnten), | 33 | }; |
36 | .writefn = pmcntenclr_write }, | 34 | |
37 | { .name = "PMOVSR", .cp = 15, .crn = 9, .crm = 12, .opc1 = 0, .opc2 = 3, | 35 | static struct arm_boot_info exynos4_board_binfo = { |
38 | - .access = PL0_RW, .fieldoffset = offsetof(CPUARMState, cp15.c9_pmovsr), | ||
39 | + .access = PL0_RW, | ||
40 | + .fieldoffset = offsetoflow32(CPUARMState, cp15.c9_pmovsr), | ||
41 | .accessfn = pmreg_access, | ||
42 | .writefn = pmovsr_write, | ||
43 | .raw_writefn = raw_write }, | ||
44 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo v7_cp_reginfo[] = { | ||
45 | .accessfn = pmreg_access_xevcntr }, | ||
46 | { .name = "PMUSERENR", .cp = 15, .crn = 9, .crm = 14, .opc1 = 0, .opc2 = 0, | ||
47 | .access = PL0_R | PL1_RW, .accessfn = access_tpm, | ||
48 | - .fieldoffset = offsetof(CPUARMState, cp15.c9_pmuserenr), | ||
49 | + .fieldoffset = offsetoflow32(CPUARMState, cp15.c9_pmuserenr), | ||
50 | .resetvalue = 0, | ||
51 | .writefn = pmuserenr_write, .raw_writefn = raw_write }, | ||
52 | { .name = "PMUSERENR_EL0", .state = ARM_CP_STATE_AA64, | ||
53 | -- | 36 | -- |
54 | 2.17.0 | 37 | 2.20.1 |
55 | 38 | ||
56 | 39 | diff view generated by jsdifflib |
1 | From: Aaron Lindsay <alindsay@codeaurora.org> | 1 | From: Guenter Roeck <linux@roeck-us.net> |
---|---|---|---|
2 | 2 | ||
3 | Because the design of the PMU requires that the counter values be | 3 | QEMU already supports pl330. Instantiate it for Exynos4210. |
4 | converted between their delta and guest-visible forms for mode | ||
5 | filtering, an additional hook which occurs before the EL is changed is | ||
6 | necessary. | ||
7 | 4 | ||
8 | Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> | 5 | Relevant part of Linux arch/arm/boot/dts/exynos4.dtsi: |
9 | Message-id: 1523997485-1905-8-git-send-email-alindsay@codeaurora.org | 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> | ||
47 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
48 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
49 | Message-id: 20190520214342.13709-4-philmd@redhat.com | ||
50 | [PMD: Do not set default qdev properties, create the controllers in the SoC | ||
51 | rather than the board (Peter Maydell), add dtsi in commit message] | ||
52 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 53 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 54 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
12 | --- | 55 | --- |
13 | target/arm/cpu.h | 22 +++++++++++++++++++--- | 56 | hw/arm/exynos4210.c | 26 ++++++++++++++++++++++++++ |
14 | target/arm/internals.h | 7 +++++++ | 57 | 1 file changed, 26 insertions(+) |
15 | target/arm/cpu.c | 16 ++++++++++++++++ | ||
16 | target/arm/helper.c | 14 ++++++++------ | ||
17 | target/arm/op_helper.c | 8 ++++++++ | ||
18 | 5 files changed, 58 insertions(+), 9 deletions(-) | ||
19 | 58 | ||
20 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | 59 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c |
21 | index XXXXXXX..XXXXXXX 100644 | 60 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/target/arm/cpu.h | 61 | --- a/hw/arm/exynos4210.c |
23 | +++ b/target/arm/cpu.h | 62 | +++ b/hw/arm/exynos4210.c |
24 | @@ -XXX,XX +XXX,XX @@ struct ARMCPU { | 63 | @@ -XXX,XX +XXX,XX @@ |
25 | */ | 64 | /* EHCI */ |
26 | bool cfgend; | 65 | #define EXYNOS4210_EHCI_BASE_ADDR 0x12580000 |
27 | 66 | ||
28 | + QLIST_HEAD(, ARMELChangeHook) pre_el_change_hooks; | 67 | +/* DMA */ |
29 | QLIST_HEAD(, ARMELChangeHook) el_change_hooks; | 68 | +#define EXYNOS4210_PL330_BASE0_ADDR 0x12680000 |
30 | 69 | +#define EXYNOS4210_PL330_BASE1_ADDR 0x12690000 | |
31 | int32_t node_id; /* NUMA node this CPU belongs to */ | 70 | +#define EXYNOS4210_PL330_BASE2_ADDR 0x12850000 |
32 | @@ -XXX,XX +XXX,XX @@ static inline AddressSpace *arm_addressspace(CPUState *cs, MemTxAttrs attrs) | 71 | + |
33 | #endif | 72 | static uint8_t chipid_and_omr[] = { 0x11, 0x02, 0x21, 0x43, |
34 | 73 | 0x09, 0x00, 0x00, 0x00 }; | |
35 | /** | 74 | |
36 | - * arm_register_el_change_hook: | 75 | @@ -XXX,XX +XXX,XX @@ static uint64_t exynos4210_calc_affinity(int cpu) |
37 | - * Register a hook function which will be called back whenever this | 76 | return (0x9 << ARM_AFF1_SHIFT) | cpu; |
38 | + * arm_register_pre_el_change_hook: | 77 | } |
39 | + * Register a hook function which will be called immediately before this | 78 | |
40 | * CPU changes exception level or mode. The hook function will be | 79 | +static void pl330_create(uint32_t base, qemu_irq irq, int nreq) |
41 | * passed a pointer to the ARMCPU and the opaque data pointer passed | ||
42 | * to this function when the hook was registered. | ||
43 | + * | ||
44 | + * Note that if a pre-change hook is called, any registered post-change hooks | ||
45 | + * are guaranteed to subsequently be called. | ||
46 | */ | ||
47 | -void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, | ||
48 | +void arm_register_pre_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, | ||
49 | void *opaque); | ||
50 | +/** | ||
51 | + * arm_register_el_change_hook: | ||
52 | + * Register a hook function which will be called immediately after this | ||
53 | + * CPU changes exception level or mode. The hook function will be | ||
54 | + * passed a pointer to the ARMCPU and the opaque data pointer passed | ||
55 | + * to this function when the hook was registered. | ||
56 | + * | ||
57 | + * Note that any registered hooks registered here are guaranteed to be called | ||
58 | + * if pre-change hooks have been. | ||
59 | + */ | ||
60 | +void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, void | ||
61 | + *opaque); | ||
62 | |||
63 | /** | ||
64 | * aa32_vfp_dreg: | ||
65 | diff --git a/target/arm/internals.h b/target/arm/internals.h | ||
66 | index XXXXXXX..XXXXXXX 100644 | ||
67 | --- a/target/arm/internals.h | ||
68 | +++ b/target/arm/internals.h | ||
69 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, | ||
70 | MemTxResult response, uintptr_t retaddr); | ||
71 | |||
72 | /* Call any registered EL change hooks */ | ||
73 | +static inline void arm_call_pre_el_change_hook(ARMCPU *cpu) | ||
74 | +{ | 80 | +{ |
75 | + ARMELChangeHook *hook, *next; | 81 | + SysBusDevice *busdev; |
76 | + QLIST_FOREACH_SAFE(hook, &cpu->pre_el_change_hooks, node, next) { | 82 | + DeviceState *dev; |
77 | + hook->hook(cpu, hook->opaque); | ||
78 | + } | ||
79 | +} | ||
80 | static inline void arm_call_el_change_hook(ARMCPU *cpu) | ||
81 | { | ||
82 | ARMELChangeHook *hook, *next; | ||
83 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | ||
84 | index XXXXXXX..XXXXXXX 100644 | ||
85 | --- a/target/arm/cpu.c | ||
86 | +++ b/target/arm/cpu.c | ||
87 | @@ -XXX,XX +XXX,XX @@ static bool arm_cpu_has_work(CPUState *cs) | ||
88 | | CPU_INTERRUPT_EXITTB); | ||
89 | } | ||
90 | |||
91 | +void arm_register_pre_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, | ||
92 | + void *opaque) | ||
93 | +{ | ||
94 | + ARMELChangeHook *entry = g_new0(ARMELChangeHook, 1); | ||
95 | + | 83 | + |
96 | + entry->hook = hook; | 84 | + dev = qdev_create(NULL, "pl330"); |
97 | + entry->opaque = opaque; | 85 | + qdev_prop_set_uint8(dev, "num_periph_req", nreq); |
98 | + | 86 | + qdev_init_nofail(dev); |
99 | + QLIST_INSERT_HEAD(&cpu->pre_el_change_hooks, entry, node); | 87 | + busdev = SYS_BUS_DEVICE(dev); |
88 | + sysbus_mmio_map(busdev, 0, base); | ||
89 | + sysbus_connect_irq(busdev, 0, irq); | ||
100 | +} | 90 | +} |
101 | + | 91 | + |
102 | void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, | 92 | Exynos4210State *exynos4210_init(MemoryRegion *system_mem) |
103 | void *opaque) | ||
104 | { | 93 | { |
105 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_initfn(Object *obj) | 94 | Exynos4210State *s = g_new0(Exynos4210State, 1); |
106 | cpu->cp_regs = g_hash_table_new_full(g_int_hash, g_int_equal, | 95 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) |
107 | g_free, g_free); | 96 | sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, |
108 | 97 | s->irq_table[exynos4210_get_irq(28, 3)]); | |
109 | + QLIST_INIT(&cpu->pre_el_change_hooks); | 98 | |
110 | QLIST_INIT(&cpu->el_change_hooks); | 99 | + /*** DMA controllers ***/ |
111 | 100 | + pl330_create(EXYNOS4210_PL330_BASE0_ADDR, | |
112 | #ifndef CONFIG_USER_ONLY | 101 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(35, 1)]), 32); |
113 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_finalizefn(Object *obj) | 102 | + pl330_create(EXYNOS4210_PL330_BASE1_ADDR, |
114 | 103 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); | |
115 | g_hash_table_destroy(cpu->cp_regs); | 104 | + pl330_create(EXYNOS4210_PL330_BASE2_ADDR, |
116 | 105 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); | |
117 | + QLIST_FOREACH_SAFE(hook, &cpu->pre_el_change_hooks, node, next) { | ||
118 | + QLIST_REMOVE(hook, node); | ||
119 | + g_free(hook); | ||
120 | + } | ||
121 | QLIST_FOREACH_SAFE(hook, &cpu->el_change_hooks, node, next) { | ||
122 | QLIST_REMOVE(hook, node); | ||
123 | g_free(hook); | ||
124 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
125 | index XXXXXXX..XXXXXXX 100644 | ||
126 | --- a/target/arm/helper.c | ||
127 | +++ b/target/arm/helper.c | ||
128 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_do_interrupt(CPUState *cs) | ||
129 | return; | ||
130 | } | ||
131 | |||
132 | + /* Hooks may change global state so BQL should be held, also the | ||
133 | + * BQL needs to be held for any modification of | ||
134 | + * cs->interrupt_request. | ||
135 | + */ | ||
136 | + g_assert(qemu_mutex_iothread_locked()); | ||
137 | + | 106 | + |
138 | + arm_call_pre_el_change_hook(cpu); | 107 | return s; |
139 | + | 108 | } |
140 | assert(!excp_is_internal(cs->exception_index)); | ||
141 | if (arm_el_is_aa64(env, new_el)) { | ||
142 | arm_cpu_do_interrupt_aarch64(cs); | ||
143 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_do_interrupt(CPUState *cs) | ||
144 | arm_cpu_do_interrupt_aarch32(cs); | ||
145 | } | ||
146 | |||
147 | - /* Hooks may change global state so BQL should be held, also the | ||
148 | - * BQL needs to be held for any modification of | ||
149 | - * cs->interrupt_request. | ||
150 | - */ | ||
151 | - g_assert(qemu_mutex_iothread_locked()); | ||
152 | - | ||
153 | arm_call_el_change_hook(cpu); | ||
154 | |||
155 | if (!kvm_enabled()) { | ||
156 | diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c | ||
157 | index XXXXXXX..XXXXXXX 100644 | ||
158 | --- a/target/arm/op_helper.c | ||
159 | +++ b/target/arm/op_helper.c | ||
160 | @@ -XXX,XX +XXX,XX @@ void HELPER(cpsr_write)(CPUARMState *env, uint32_t val, uint32_t mask) | ||
161 | /* Write the CPSR for a 32-bit exception return */ | ||
162 | void HELPER(cpsr_write_eret)(CPUARMState *env, uint32_t val) | ||
163 | { | ||
164 | + qemu_mutex_lock_iothread(); | ||
165 | + arm_call_pre_el_change_hook(arm_env_get_cpu(env)); | ||
166 | + qemu_mutex_unlock_iothread(); | ||
167 | + | ||
168 | cpsr_write(env, val, CPSR_ERET_MASK, CPSRWriteExceptionReturn); | ||
169 | |||
170 | /* Generated code has already stored the new PC value, but | ||
171 | @@ -XXX,XX +XXX,XX @@ void HELPER(exception_return)(CPUARMState *env) | ||
172 | goto illegal_return; | ||
173 | } | ||
174 | |||
175 | + qemu_mutex_lock_iothread(); | ||
176 | + arm_call_pre_el_change_hook(arm_env_get_cpu(env)); | ||
177 | + qemu_mutex_unlock_iothread(); | ||
178 | + | ||
179 | if (!return_to_aa64) { | ||
180 | env->aarch64 = 0; | ||
181 | /* We do a raw CPSR write because aarch64_sync_64_to_32() | ||
182 | -- | 109 | -- |
183 | 2.17.0 | 110 | 2.20.1 |
184 | 111 | ||
185 | 112 | diff view generated by jsdifflib |
1 | From: Aaron Lindsay <alindsay@codeaurora.org> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | This is in preparation for enabling counters other than PMCCNTR | 3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
4 | 4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | |
5 | Signed-off-by: Aaron Lindsay <alindsay@codeaurora.org> | 5 | Message-id: 20190520214342.13709-5-philmd@redhat.com |
6 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | Message-id: 1523997485-1905-5-git-send-email-alindsay@codeaurora.org | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 7 | --- |
10 | target/arm/helper.c | 31 ++++++++++++++++++++++--------- | 8 | include/hw/arm/exynos4210.h | 9 +++++++-- |
11 | 1 file changed, 22 insertions(+), 9 deletions(-) | 9 | hw/arm/exynos4210.c | 28 ++++++++++++++++++++++++---- |
10 | hw/arm/exynos4_boards.c | 9 ++++++--- | ||
11 | 3 files changed, 37 insertions(+), 9 deletions(-) | ||
12 | 12 | ||
13 | diff --git a/target/arm/helper.c b/target/arm/helper.c | 13 | diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h |
14 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/target/arm/helper.c | 15 | --- a/include/hw/arm/exynos4210.h |
16 | +++ b/target/arm/helper.c | 16 | +++ b/include/hw/arm/exynos4210.h |
17 | @@ -XXX,XX +XXX,XX @@ typedef struct V8M_SAttributes { | 17 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210Irq { |
18 | static void v8m_security_lookup(CPUARMState *env, uint32_t address, | 18 | } Exynos4210Irq; |
19 | MMUAccessType access_type, ARMMMUIdx mmu_idx, | 19 | |
20 | V8M_SAttributes *sattrs); | 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); | ||
21 | - | 39 | - |
22 | -/* Definitions for the PMCCNTR and PMCR registers */ | 40 | /* Initialize exynos4210 IRQ subsystem stub */ |
23 | -#define PMCRD 0x8 | 41 | qemu_irq *exynos4210_init_irq(Exynos4210Irq *env); |
24 | -#define PMCRC 0x4 | 42 | |
25 | -#define PMCRE 0x1 | 43 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c |
26 | #endif | 44 | index XXXXXXX..XXXXXXX 100644 |
27 | 45 | --- a/hw/arm/exynos4210.c | |
28 | static int vfp_gdb_get_reg(CPUARMState *env, uint8_t *buf, int reg) | 46 | +++ b/hw/arm/exynos4210.c |
29 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo v6_cp_reginfo[] = { | 47 | @@ -XXX,XX +XXX,XX @@ static void pl330_create(uint32_t base, qemu_irq irq, int nreq) |
30 | REGINFO_SENTINEL | 48 | sysbus_connect_irq(busdev, 0, irq); |
31 | }; | 49 | } |
32 | 50 | ||
33 | +/* Definitions for the PMU registers */ | 51 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem) |
34 | +#define PMCRN_MASK 0xf800 | 52 | +static void exynos4210_realize(DeviceState *socdev, Error **errp) |
35 | +#define PMCRN_SHIFT 11 | 53 | { |
36 | +#define PMCRD 0x8 | 54 | - Exynos4210State *s = g_new0(Exynos4210State, 1); |
37 | +#define PMCRC 0x4 | 55 | + Exynos4210State *s = EXYNOS4210_SOC(socdev); |
38 | +#define PMCRE 0x1 | 56 | + MemoryRegion *system_mem = get_system_memory(); |
57 | qemu_irq gate_irq[EXYNOS4210_NCPUS][EXYNOS4210_IRQ_GATE_NINPUTS]; | ||
58 | SysBusDevice *busdev; | ||
59 | DeviceState *dev; | ||
60 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | ||
61 | qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); | ||
62 | pl330_create(EXYNOS4210_PL330_BASE2_ADDR, | ||
63 | qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); | ||
64 | - | ||
65 | - return s; | ||
66 | } | ||
39 | + | 67 | + |
40 | +static inline uint32_t pmu_num_counters(CPUARMState *env) | 68 | +static void exynos4210_class_init(ObjectClass *klass, void *data) |
41 | +{ | 69 | +{ |
42 | + return (env->cp15.c9_pmcr & PMCRN_MASK) >> PMCRN_SHIFT; | 70 | + DeviceClass *dc = DEVICE_CLASS(klass); |
71 | + | ||
72 | + dc->realize = exynos4210_realize; | ||
43 | +} | 73 | +} |
44 | + | 74 | + |
45 | +/* Bits allowed to be set/cleared for PMCNTEN* and PMINTEN* */ | 75 | +static const TypeInfo exynos4210_info = { |
46 | +static inline uint64_t pmu_counter_mask(CPUARMState *env) | 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) | ||
47 | +{ | 83 | +{ |
48 | + return (1 << 31) | ((1 << pmu_num_counters(env)) - 1); | 84 | + type_register_static(&exynos4210_info); |
49 | +} | 85 | +} |
50 | + | 86 | + |
51 | static CPAccessResult pmreg_access(CPUARMState *env, const ARMCPRegInfo *ri, | 87 | +type_init(exynos4210_register_types) |
52 | bool isread) | 88 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c |
53 | { | 89 | index XXXXXXX..XXXXXXX 100644 |
54 | @@ -XXX,XX +XXX,XX @@ static void pmccfiltr_write(CPUARMState *env, const ARMCPRegInfo *ri, | 90 | --- a/hw/arm/exynos4_boards.c |
55 | static void pmcntenset_write(CPUARMState *env, const ARMCPRegInfo *ri, | 91 | +++ b/hw/arm/exynos4_boards.c |
56 | uint64_t value) | 92 | @@ -XXX,XX +XXX,XX @@ typedef enum Exynos4BoardType { |
57 | { | 93 | } Exynos4BoardType; |
58 | - value &= (1 << 31); | 94 | |
59 | + value &= pmu_counter_mask(env); | 95 | typedef struct Exynos4BoardState { |
60 | env->cp15.c9_pmcnten |= value; | 96 | - Exynos4210State *soc; |
97 | + Exynos4210State soc; | ||
98 | MemoryRegion dram0_mem; | ||
99 | MemoryRegion dram1_mem; | ||
100 | } Exynos4BoardState; | ||
101 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | ||
102 | exynos4_boards_init_ram(s, get_system_memory(), | ||
103 | exynos4_board_ram_size[board_type]); | ||
104 | |||
105 | - s->soc = exynos4210_init(get_system_memory()); | ||
106 | + object_initialize(&s->soc, sizeof(s->soc), TYPE_EXYNOS4210_SOC); | ||
107 | + qdev_set_parent_bus(DEVICE(&s->soc), sysbus_get_default()); | ||
108 | + object_property_set_bool(OBJECT(&s->soc), true, "realized", | ||
109 | + &error_fatal); | ||
110 | |||
111 | return s; | ||
61 | } | 112 | } |
62 | 113 | @@ -XXX,XX +XXX,XX @@ static void smdkc210_init(MachineState *machine) | |
63 | static void pmcntenclr_write(CPUARMState *env, const ARMCPRegInfo *ri, | 114 | EXYNOS4_BOARD_SMDKC210); |
64 | uint64_t value) | 115 | |
65 | { | 116 | lan9215_init(SMDK_LAN9118_BASE_ADDR, |
66 | - value &= (1 << 31); | 117 | - qemu_irq_invert(s->soc->irq_table[exynos4210_get_irq(37, 1)])); |
67 | + value &= pmu_counter_mask(env); | 118 | + qemu_irq_invert(s->soc.irq_table[exynos4210_get_irq(37, 1)])); |
68 | env->cp15.c9_pmcnten &= ~value; | 119 | arm_load_kernel(ARM_CPU(first_cpu), &exynos4_board_binfo); |
69 | } | 120 | } |
70 | 121 | ||
71 | @@ -XXX,XX +XXX,XX @@ static void pmintenset_write(CPUARMState *env, const ARMCPRegInfo *ri, | ||
72 | uint64_t value) | ||
73 | { | ||
74 | /* We have no event counters so only the C bit can be changed */ | ||
75 | - value &= (1 << 31); | ||
76 | + value &= pmu_counter_mask(env); | ||
77 | env->cp15.c9_pminten |= value; | ||
78 | } | ||
79 | |||
80 | static void pmintenclr_write(CPUARMState *env, const ARMCPRegInfo *ri, | ||
81 | uint64_t value) | ||
82 | { | ||
83 | - value &= (1 << 31); | ||
84 | + value &= pmu_counter_mask(env); | ||
85 | env->cp15.c9_pminten &= ~value; | ||
86 | } | ||
87 | |||
88 | -- | 122 | -- |
89 | 2.17.0 | 123 | 2.20.1 |
90 | 124 | ||
91 | 125 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Currently we use memory_region_init_ram_nomigrate() to create | ||
2 | the "highbank.sysram" memory region, and we don't manually | ||
3 | register it with vmstate_register_ram(). This currently | ||
4 | means that its contents are migrated but as a ram block | ||
5 | whose name is the empty string; in future it may mean they | ||
6 | are not migrated at all. Use memory_region_init_ram() instead. | ||
7 | 1 | ||
8 | Note that this is a cross-version migration compatibility | ||
9 | break for the "highbank" and "midway" machines. | ||
10 | |||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | Message-id: 20180420124835.7268-2-peter.maydell@linaro.org | ||
13 | --- | ||
14 | hw/arm/highbank.c | 2 +- | ||
15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c | ||
18 | index XXXXXXX..XXXXXXX 100644 | ||
19 | --- a/hw/arm/highbank.c | ||
20 | +++ b/hw/arm/highbank.c | ||
21 | @@ -XXX,XX +XXX,XX @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id) | ||
22 | memory_region_add_subregion(sysmem, 0, dram); | ||
23 | |||
24 | sysram = g_new(MemoryRegion, 1); | ||
25 | - memory_region_init_ram_nomigrate(sysram, NULL, "highbank.sysram", 0x8000, | ||
26 | + memory_region_init_ram(sysram, NULL, "highbank.sysram", 0x8000, | ||
27 | &error_fatal); | ||
28 | memory_region_add_subregion(sysmem, 0xfff88000, sysram); | ||
29 | if (bios_name != NULL) { | ||
30 | -- | ||
31 | 2.17.0 | ||
32 | |||
33 | diff view generated by jsdifflib |