1 | Not very much here, but several people have fallen over | 1 | Hi; here's the latest batch of arm changes. The big thing |
---|---|---|---|
2 | the vector operation segfault bug, so let's get the fix | 2 | in here is the SMMUv3 changes to add stage-2 translation support. |
3 | into master. | ||
4 | 3 | ||
5 | thanks | 4 | thanks |
6 | -- PMM | 5 | -- PMM |
7 | 6 | ||
8 | The following changes since commit d418238dca7b4e0b124135827ead3076233052b1: | 7 | The following changes since commit aa9bbd865502ed517624ab6fe7d4b5d89ca95e43: |
9 | 8 | ||
10 | Merge remote-tracking branch 'remotes/rth/tags/pull-rng-20190522' into staging (2019-05-23 12:57:17 +0100) | 9 | Merge tag 'pull-ppc-20230528' of https://gitlab.com/danielhb/qemu into staging (2023-05-29 14:31:52 -0700) |
11 | 10 | ||
12 | are available in the Git repository at: | 11 | are available in the Git repository at: |
13 | 12 | ||
14 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190523 | 13 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20230530 |
15 | 14 | ||
16 | for you to fetch changes up to 98e4f4fdb8ea05d840f51f47125924c2bb9df2df: | 15 | for you to fetch changes up to b03d0d4f531a8b867e0aac1fab0b876903015680: |
17 | 16 | ||
18 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC (2019-05-23 14:47:44 +0100) | 17 | docs: sbsa: correct graphics card name (2023-05-30 13:32:46 +0100) |
19 | 18 | ||
20 | ---------------------------------------------------------------- | 19 | ---------------------------------------------------------------- |
21 | target-arm queue: | 20 | target-arm queue: |
22 | * exynos4210: QOM'ify the Exynos4210 SoC | 21 | * fsl-imx6: Add SNVS support for i.MX6 boards |
23 | * exynos4210: Add DMA support for the Exynos4210 | 22 | * smmuv3: Add support for stage 2 translations |
24 | * arm_gicv3: Fix writes to ICC_CTLR_EL3 | 23 | * hw/dma/xilinx_axidma: Check DMASR.HALTED to prevent infinite loop |
25 | * arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} | 24 | * hw/arm/xlnx-zynqmp: fix unsigned error when checking the RPUs number |
26 | * target/arm: Fix vector operation segfault | 25 | * cleanups for recent Kconfig changes |
27 | * target/arm: Minor improvements to BFXIL, EXTR | 26 | * target/arm: Explicitly select short-format FSR for M-profile |
27 | * tests/qtest: Run arm-specific tests only if the required machine is available | ||
28 | * hw/arm/sbsa-ref: add GIC node into DT | ||
29 | * docs: sbsa: correct graphics card name | ||
30 | * Update copyright dates to 2023 | ||
28 | 31 | ||
29 | ---------------------------------------------------------------- | 32 | ---------------------------------------------------------------- |
30 | Alistair Francis (1): | 33 | Clément Chigot (1): |
31 | target/arm: Fix vector operation segfault | 34 | hw/arm/xlnx-zynqmp: fix unsigned error when checking the RPUs number |
32 | 35 | ||
33 | Guenter Roeck (1): | 36 | Enze Li (1): |
34 | hw/arm/exynos4210: Add DMA support for the Exynos4210 | 37 | Update copyright dates to 2023 |
35 | 38 | ||
36 | Peter Maydell (5): | 39 | Fabiano Rosas (3): |
37 | arm: Move system_clock_scale to armv7m_systick.h | 40 | target/arm: Explain why we need to select ARM_V7M |
38 | arm: Remove unnecessary includes of hw/arm/arm.h | 41 | arm/Kconfig: Keep Kconfig default entries in default.mak as documentation |
39 | arm: Rename hw/arm/arm.h to hw/arm/boot.h | 42 | arm/Kconfig: Make TCG dependence explicit |
40 | hw/intc/arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} | ||
41 | hw/intc/arm_gicv3: Fix writes to ICC_CTLR_EL3 | ||
42 | 43 | ||
43 | Philippe Mathieu-Daudé (3): | 44 | Marcin Juszkiewicz (2): |
44 | hw/arm/exynos4: Remove unuseful debug code | 45 | hw/arm/sbsa-ref: add GIC node into DT |
45 | hw/arm/exynos4: Use the IEC binary prefix definitions | 46 | docs: sbsa: correct graphics card name |
46 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC | ||
47 | 47 | ||
48 | Richard Henderson (2): | 48 | Mostafa Saleh (10): |
49 | target/arm: Use extract2 for EXTR | 49 | hw/arm/smmuv3: Add missing fields for IDR0 |
50 | target/arm: Simplify BFXIL expansion | 50 | hw/arm/smmuv3: Update translation config to hold stage-2 |
51 | hw/arm/smmuv3: Refactor stage-1 PTW | ||
52 | hw/arm/smmuv3: Add page table walk for stage-2 | ||
53 | hw/arm/smmuv3: Parse STE config for stage-2 | ||
54 | hw/arm/smmuv3: Make TLB lookup work for stage-2 | ||
55 | hw/arm/smmuv3: Add VMID to TLB tagging | ||
56 | hw/arm/smmuv3: Add CMDs related to stage-2 | ||
57 | hw/arm/smmuv3: Add stage-2 support in iova notifier | ||
58 | hw/arm/smmuv3: Add knob to choose translation stage and enable stage-2 | ||
51 | 59 | ||
52 | include/hw/arm/allwinner-a10.h | 2 +- | 60 | Peter Maydell (1): |
53 | include/hw/arm/aspeed_soc.h | 1 - | 61 | target/arm: Explicitly select short-format FSR for M-profile |
54 | include/hw/arm/bcm2836.h | 1 - | ||
55 | include/hw/arm/{arm.h => boot.h} | 12 +++------ | ||
56 | include/hw/arm/exynos4210.h | 9 +++++-- | ||
57 | include/hw/arm/fsl-imx25.h | 2 +- | ||
58 | include/hw/arm/fsl-imx31.h | 2 +- | ||
59 | include/hw/arm/fsl-imx6.h | 2 +- | ||
60 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
61 | include/hw/arm/fsl-imx7.h | 2 +- | ||
62 | include/hw/arm/virt.h | 2 +- | ||
63 | include/hw/arm/xlnx-versal.h | 2 +- | ||
64 | include/hw/arm/xlnx-zynqmp.h | 2 +- | ||
65 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++ | ||
66 | hw/arm/armsse.c | 2 +- | ||
67 | hw/arm/armv7m.c | 2 +- | ||
68 | hw/arm/aspeed.c | 2 +- | ||
69 | hw/arm/boot.c | 2 +- | ||
70 | hw/arm/collie.c | 2 +- | ||
71 | hw/arm/exynos4210.c | 54 ++++++++++++++++++++++++++++++++++++--- | ||
72 | hw/arm/exynos4_boards.c | 40 ++++++++--------------------- | ||
73 | hw/arm/highbank.c | 2 +- | ||
74 | hw/arm/integratorcp.c | 2 +- | ||
75 | hw/arm/mainstone.c | 2 +- | ||
76 | hw/arm/microbit.c | 2 +- | ||
77 | hw/arm/mps2-tz.c | 2 +- | ||
78 | hw/arm/mps2.c | 2 +- | ||
79 | hw/arm/msf2-soc.c | 1 - | ||
80 | hw/arm/msf2-som.c | 2 +- | ||
81 | hw/arm/musca.c | 2 +- | ||
82 | hw/arm/musicpal.c | 2 +- | ||
83 | hw/arm/netduino2.c | 2 +- | ||
84 | hw/arm/nrf51_soc.c | 2 +- | ||
85 | hw/arm/nseries.c | 2 +- | ||
86 | hw/arm/omap1.c | 2 +- | ||
87 | hw/arm/omap2.c | 2 +- | ||
88 | hw/arm/omap_sx1.c | 2 +- | ||
89 | hw/arm/palm.c | 2 +- | ||
90 | hw/arm/raspi.c | 2 +- | ||
91 | hw/arm/realview.c | 2 +- | ||
92 | hw/arm/spitz.c | 2 +- | ||
93 | hw/arm/stellaris.c | 2 +- | ||
94 | hw/arm/stm32f205_soc.c | 2 +- | ||
95 | hw/arm/strongarm.c | 2 +- | ||
96 | hw/arm/tosa.c | 2 +- | ||
97 | hw/arm/versatilepb.c | 2 +- | ||
98 | hw/arm/vexpress.c | 2 +- | ||
99 | hw/arm/virt.c | 2 +- | ||
100 | hw/arm/xilinx_zynq.c | 2 +- | ||
101 | hw/arm/xlnx-versal.c | 2 +- | ||
102 | hw/arm/z2.c | 2 +- | ||
103 | hw/intc/arm_gicv3_cpuif.c | 6 ++--- | ||
104 | hw/intc/armv7m_nvic.c | 1 - | ||
105 | target/arm/arm-semi.c | 1 - | ||
106 | target/arm/cpu.c | 1 - | ||
107 | target/arm/cpu64.c | 1 - | ||
108 | target/arm/kvm.c | 1 - | ||
109 | target/arm/kvm32.c | 1 - | ||
110 | target/arm/kvm64.c | 1 - | ||
111 | target/arm/translate-a64.c | 44 ++++++++++++++++--------------- | ||
112 | target/arm/translate.c | 4 +-- | ||
113 | 61 files changed, 164 insertions(+), 123 deletions(-) | ||
114 | rename include/hw/arm/{arm.h => boot.h} (96%) | ||
115 | 62 | ||
63 | Thomas Huth (1): | ||
64 | tests/qtest: Run arm-specific tests only if the required machine is available | ||
65 | |||
66 | Tommy Wu (1): | ||
67 | hw/dma/xilinx_axidma: Check DMASR.HALTED to prevent infinite loop. | ||
68 | |||
69 | Vitaly Cheptsov (1): | ||
70 | fsl-imx6: Add SNVS support for i.MX6 boards | ||
71 | |||
72 | docs/conf.py | 2 +- | ||
73 | docs/system/arm/sbsa.rst | 2 +- | ||
74 | configs/devices/aarch64-softmmu/default.mak | 6 + | ||
75 | configs/devices/arm-softmmu/default.mak | 40 ++++ | ||
76 | hw/arm/smmu-internal.h | 37 +++ | ||
77 | hw/arm/smmuv3-internal.h | 12 +- | ||
78 | include/hw/arm/fsl-imx6.h | 2 + | ||
79 | include/hw/arm/smmu-common.h | 45 +++- | ||
80 | include/hw/arm/smmuv3.h | 4 + | ||
81 | include/qemu/help-texts.h | 2 +- | ||
82 | hw/arm/fsl-imx6.c | 8 + | ||
83 | hw/arm/sbsa-ref.c | 19 +- | ||
84 | hw/arm/smmu-common.c | 209 ++++++++++++++-- | ||
85 | hw/arm/smmuv3.c | 357 ++++++++++++++++++++++++---- | ||
86 | hw/arm/xlnx-zynqmp.c | 2 +- | ||
87 | hw/dma/xilinx_axidma.c | 11 +- | ||
88 | target/arm/tcg/tlb_helper.c | 13 +- | ||
89 | hw/arm/Kconfig | 123 ++++++---- | ||
90 | hw/arm/trace-events | 14 +- | ||
91 | target/arm/Kconfig | 3 + | ||
92 | tests/qtest/meson.build | 7 +- | ||
93 | 21 files changed, 773 insertions(+), 145 deletions(-) | ||
94 | diff view generated by jsdifflib |
1 | The header file hw/arm/arm.h now includes only declarations | 1 | From: Vitaly Cheptsov <cheptsov@ispras.ru> |
---|---|---|---|
2 | relating to hw/arm/boot.c functionality. Rename it accordingly, | ||
3 | and adjust its header comment. | ||
4 | 2 | ||
5 | The bulk of this commit was created via | 3 | SNVS is supported on both i.MX6 and i.MX6UL and is needed |
6 | perl -pi -e 's|hw/arm/arm.h|hw/arm/boot.h|' hw/arm/*.c include/hw/arm/*.h | 4 | to support shutdown on the board. |
7 | 5 | ||
8 | In a few cases we can just delete the #include: | 6 | Cc: Peter Maydell <peter.maydell@linaro.org> (odd fixer:SABRELITE / i.MX6) |
9 | hw/arm/msf2-soc.c, include/hw/arm/aspeed_soc.h and | 7 | Cc: Jean-Christophe Dubois <jcd@tribudubois.net> (reviewer:SABRELITE / i.MX6) |
10 | include/hw/arm/bcm2836.h did not require it. | 8 | Cc: qemu-arm@nongnu.org (open list:SABRELITE / i.MX6) |
9 | Cc: qemu-devel@nongnu.org (open list:All patches CC here) | ||
10 | Signed-off-by: Vitaly Cheptsov <cheptsov@ispras.ru> | ||
11 | Message-id: 20230515095015.66860-1-cheptsov@ispras.ru | ||
12 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
14 | --- | ||
15 | include/hw/arm/fsl-imx6.h | 2 ++ | ||
16 | hw/arm/fsl-imx6.c | 8 ++++++++ | ||
17 | 2 files changed, 10 insertions(+) | ||
11 | 18 | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
14 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
15 | Message-id: 20190516163857.6430-4-peter.maydell@linaro.org | ||
16 | --- | ||
17 | include/hw/arm/allwinner-a10.h | 2 +- | ||
18 | include/hw/arm/aspeed_soc.h | 1 - | ||
19 | include/hw/arm/bcm2836.h | 1 - | ||
20 | include/hw/arm/{arm.h => boot.h} | 8 ++++---- | ||
21 | include/hw/arm/fsl-imx25.h | 2 +- | ||
22 | include/hw/arm/fsl-imx31.h | 2 +- | ||
23 | include/hw/arm/fsl-imx6.h | 2 +- | ||
24 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
25 | include/hw/arm/fsl-imx7.h | 2 +- | ||
26 | include/hw/arm/virt.h | 2 +- | ||
27 | include/hw/arm/xlnx-versal.h | 2 +- | ||
28 | include/hw/arm/xlnx-zynqmp.h | 2 +- | ||
29 | hw/arm/armsse.c | 2 +- | ||
30 | hw/arm/armv7m.c | 2 +- | ||
31 | hw/arm/aspeed.c | 2 +- | ||
32 | hw/arm/boot.c | 2 +- | ||
33 | hw/arm/collie.c | 2 +- | ||
34 | hw/arm/exynos4210.c | 2 +- | ||
35 | hw/arm/exynos4_boards.c | 2 +- | ||
36 | hw/arm/highbank.c | 2 +- | ||
37 | hw/arm/integratorcp.c | 2 +- | ||
38 | hw/arm/mainstone.c | 2 +- | ||
39 | hw/arm/microbit.c | 2 +- | ||
40 | hw/arm/mps2-tz.c | 2 +- | ||
41 | hw/arm/mps2.c | 2 +- | ||
42 | hw/arm/msf2-soc.c | 1 - | ||
43 | hw/arm/msf2-som.c | 2 +- | ||
44 | hw/arm/musca.c | 2 +- | ||
45 | hw/arm/musicpal.c | 2 +- | ||
46 | hw/arm/netduino2.c | 2 +- | ||
47 | hw/arm/nrf51_soc.c | 2 +- | ||
48 | hw/arm/nseries.c | 2 +- | ||
49 | hw/arm/omap1.c | 2 +- | ||
50 | hw/arm/omap2.c | 2 +- | ||
51 | hw/arm/omap_sx1.c | 2 +- | ||
52 | hw/arm/palm.c | 2 +- | ||
53 | hw/arm/raspi.c | 2 +- | ||
54 | hw/arm/realview.c | 2 +- | ||
55 | hw/arm/spitz.c | 2 +- | ||
56 | hw/arm/stellaris.c | 2 +- | ||
57 | hw/arm/stm32f205_soc.c | 2 +- | ||
58 | hw/arm/strongarm.c | 2 +- | ||
59 | hw/arm/tosa.c | 2 +- | ||
60 | hw/arm/versatilepb.c | 2 +- | ||
61 | hw/arm/vexpress.c | 2 +- | ||
62 | hw/arm/virt.c | 2 +- | ||
63 | hw/arm/xilinx_zynq.c | 2 +- | ||
64 | hw/arm/xlnx-versal.c | 2 +- | ||
65 | hw/arm/z2.c | 2 +- | ||
66 | 49 files changed, 49 insertions(+), 52 deletions(-) | ||
67 | rename include/hw/arm/{arm.h => boot.h} (98%) | ||
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 | 19 | diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h |
164 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
165 | --- a/include/hw/arm/fsl-imx6.h | 21 | --- a/include/hw/arm/fsl-imx6.h |
166 | +++ b/include/hw/arm/fsl-imx6.h | 22 | +++ b/include/hw/arm/fsl-imx6.h |
167 | @@ -XXX,XX +XXX,XX @@ | 23 | @@ -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" | 24 | #include "hw/cpu/a9mpcore.h" |
174 | #include "hw/misc/imx6_ccm.h" | 25 | #include "hw/misc/imx6_ccm.h" |
175 | #include "hw/misc/imx6_src.h" | 26 | #include "hw/misc/imx6_src.h" |
176 | diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h | 27 | +#include "hw/misc/imx7_snvs.h" |
28 | #include "hw/watchdog/wdt_imx2.h" | ||
29 | #include "hw/char/imx_serial.h" | ||
30 | #include "hw/timer/imx_gpt.h" | ||
31 | @@ -XXX,XX +XXX,XX @@ struct FslIMX6State { | ||
32 | A9MPPrivState a9mpcore; | ||
33 | IMX6CCMState ccm; | ||
34 | IMX6SRCState src; | ||
35 | + IMX7SNVSState snvs; | ||
36 | IMXSerialState uart[FSL_IMX6_NUM_UARTS]; | ||
37 | IMXGPTState gpt; | ||
38 | IMXEPITState epit[FSL_IMX6_NUM_EPITS]; | ||
39 | diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c | ||
177 | index XXXXXXX..XXXXXXX 100644 | 40 | index XXXXXXX..XXXXXXX 100644 |
178 | --- a/include/hw/arm/fsl-imx6ul.h | 41 | --- a/hw/arm/fsl-imx6.c |
179 | +++ b/include/hw/arm/fsl-imx6ul.h | 42 | +++ b/hw/arm/fsl-imx6.c |
180 | @@ -XXX,XX +XXX,XX @@ | 43 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx6_init(Object *obj) |
181 | #ifndef FSL_IMX6UL_H | 44 | |
182 | #define FSL_IMX6UL_H | 45 | object_initialize_child(obj, "src", &s->src, TYPE_IMX6_SRC); |
183 | 46 | ||
184 | -#include "hw/arm/arm.h" | 47 | + object_initialize_child(obj, "snvs", &s->snvs, TYPE_IMX7_SNVS); |
185 | +#include "hw/arm/boot.h" | 48 | + |
186 | #include "hw/cpu/a15mpcore.h" | 49 | for (i = 0; i < FSL_IMX6_NUM_UARTS; i++) { |
187 | #include "hw/misc/imx6ul_ccm.h" | 50 | snprintf(name, NAME_SIZE, "uart%d", i + 1); |
188 | #include "hw/misc/imx6_src.h" | 51 | object_initialize_child(obj, name, &s->uart[i], TYPE_IMX_SERIAL); |
189 | diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h | 52 | @@ -XXX,XX +XXX,XX @@ static void fsl_imx6_realize(DeviceState *dev, Error **errp) |
190 | index XXXXXXX..XXXXXXX 100644 | 53 | qdev_get_gpio_in(DEVICE(&s->a9mpcore), |
191 | --- a/include/hw/arm/fsl-imx7.h | 54 | FSL_IMX6_ENET_MAC_1588_IRQ)); |
192 | +++ b/include/hw/arm/fsl-imx7.h | 55 | |
193 | @@ -XXX,XX +XXX,XX @@ | 56 | + /* |
194 | #ifndef FSL_IMX7_H | 57 | + * SNVS |
195 | #define FSL_IMX7_H | 58 | + */ |
196 | 59 | + sysbus_realize(SYS_BUS_DEVICE(&s->snvs), &error_abort); | |
197 | -#include "hw/arm/arm.h" | 60 | + sysbus_mmio_map(SYS_BUS_DEVICE(&s->snvs), 0, FSL_IMX6_SNVSHP_ADDR); |
198 | +#include "hw/arm/boot.h" | 61 | + |
199 | #include "hw/cpu/a15mpcore.h" | 62 | /* |
200 | #include "hw/intc/imx_gpcv2.h" | 63 | * Watchdog |
201 | #include "hw/misc/imx7_ccm.h" | 64 | */ |
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" | ||
552 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c | ||
553 | index XXXXXXX..XXXXXXX 100644 | ||
554 | --- a/hw/arm/raspi.c | ||
555 | +++ b/hw/arm/raspi.c | ||
556 | @@ -XXX,XX +XXX,XX @@ | ||
557 | #include "qemu/error-report.h" | ||
558 | #include "hw/boards.h" | ||
559 | #include "hw/loader.h" | ||
560 | -#include "hw/arm/arm.h" | ||
561 | +#include "hw/arm/boot.h" | ||
562 | #include "sysemu/sysemu.h" | ||
563 | |||
564 | #define SMPBOOT_ADDR 0x300 /* this should leave enough space for ATAGS */ | ||
565 | diff --git a/hw/arm/realview.c b/hw/arm/realview.c | ||
566 | index XXXXXXX..XXXXXXX 100644 | ||
567 | --- a/hw/arm/realview.c | ||
568 | +++ b/hw/arm/realview.c | ||
569 | @@ -XXX,XX +XXX,XX @@ | ||
570 | #include "qemu-common.h" | ||
571 | #include "cpu.h" | ||
572 | #include "hw/sysbus.h" | ||
573 | -#include "hw/arm/arm.h" | ||
574 | +#include "hw/arm/boot.h" | ||
575 | #include "hw/arm/primecell.h" | ||
576 | #include "hw/net/lan9118.h" | ||
577 | #include "hw/net/smc91c111.h" | ||
578 | diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c | ||
579 | index XXXXXXX..XXXXXXX 100644 | ||
580 | --- a/hw/arm/spitz.c | ||
581 | +++ b/hw/arm/spitz.c | ||
582 | @@ -XXX,XX +XXX,XX @@ | ||
583 | #include "qapi/error.h" | ||
584 | #include "hw/hw.h" | ||
585 | #include "hw/arm/pxa.h" | ||
586 | -#include "hw/arm/arm.h" | ||
587 | +#include "hw/arm/boot.h" | ||
588 | #include "sysemu/sysemu.h" | ||
589 | #include "hw/pcmcia.h" | ||
590 | #include "hw/i2c/i2c.h" | ||
591 | diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c | ||
592 | index XXXXXXX..XXXXXXX 100644 | ||
593 | --- a/hw/arm/stellaris.c | ||
594 | +++ b/hw/arm/stellaris.c | ||
595 | @@ -XXX,XX +XXX,XX @@ | ||
596 | #include "qapi/error.h" | ||
597 | #include "hw/sysbus.h" | ||
598 | #include "hw/ssi/ssi.h" | ||
599 | -#include "hw/arm/arm.h" | ||
600 | +#include "hw/arm/boot.h" | ||
601 | #include "qemu/timer.h" | ||
602 | #include "hw/i2c/i2c.h" | ||
603 | #include "net/net.h" | ||
604 | diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c | ||
605 | index XXXXXXX..XXXXXXX 100644 | ||
606 | --- a/hw/arm/stm32f205_soc.c | ||
607 | +++ b/hw/arm/stm32f205_soc.c | ||
608 | @@ -XXX,XX +XXX,XX @@ | ||
609 | #include "qemu/osdep.h" | ||
610 | #include "qapi/error.h" | ||
611 | #include "qemu-common.h" | ||
612 | -#include "hw/arm/arm.h" | ||
613 | +#include "hw/arm/boot.h" | ||
614 | #include "exec/address-spaces.h" | ||
615 | #include "hw/arm/stm32f205_soc.h" | ||
616 | |||
617 | diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c | ||
618 | index XXXXXXX..XXXXXXX 100644 | ||
619 | --- a/hw/arm/strongarm.c | ||
620 | +++ b/hw/arm/strongarm.c | ||
621 | @@ -XXX,XX +XXX,XX @@ | ||
622 | #include "hw/sysbus.h" | ||
623 | #include "strongarm.h" | ||
624 | #include "qemu/error-report.h" | ||
625 | -#include "hw/arm/arm.h" | ||
626 | +#include "hw/arm/boot.h" | ||
627 | #include "chardev/char-fe.h" | ||
628 | #include "chardev/char-serial.h" | ||
629 | #include "sysemu/sysemu.h" | ||
630 | diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c | ||
631 | index XXXXXXX..XXXXXXX 100644 | ||
632 | --- a/hw/arm/tosa.c | ||
633 | +++ b/hw/arm/tosa.c | ||
634 | @@ -XXX,XX +XXX,XX @@ | ||
635 | #include "qapi/error.h" | ||
636 | #include "hw/hw.h" | ||
637 | #include "hw/arm/pxa.h" | ||
638 | -#include "hw/arm/arm.h" | ||
639 | +#include "hw/arm/boot.h" | ||
640 | #include "hw/arm/sharpsl.h" | ||
641 | #include "hw/pcmcia.h" | ||
642 | #include "hw/boards.h" | ||
643 | diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c | ||
644 | index XXXXXXX..XXXXXXX 100644 | ||
645 | --- a/hw/arm/versatilepb.c | ||
646 | +++ b/hw/arm/versatilepb.c | ||
647 | @@ -XXX,XX +XXX,XX @@ | ||
648 | #include "qemu-common.h" | ||
649 | #include "cpu.h" | ||
650 | #include "hw/sysbus.h" | ||
651 | -#include "hw/arm/arm.h" | ||
652 | +#include "hw/arm/boot.h" | ||
653 | #include "hw/net/smc91c111.h" | ||
654 | #include "net/net.h" | ||
655 | #include "sysemu/sysemu.h" | ||
656 | diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c | ||
657 | index XXXXXXX..XXXXXXX 100644 | ||
658 | --- a/hw/arm/vexpress.c | ||
659 | +++ b/hw/arm/vexpress.c | ||
660 | @@ -XXX,XX +XXX,XX @@ | ||
661 | #include "qemu-common.h" | ||
662 | #include "cpu.h" | ||
663 | #include "hw/sysbus.h" | ||
664 | -#include "hw/arm/arm.h" | ||
665 | +#include "hw/arm/boot.h" | ||
666 | #include "hw/arm/primecell.h" | ||
667 | #include "hw/net/lan9118.h" | ||
668 | #include "hw/i2c/i2c.h" | ||
669 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | ||
670 | index XXXXXXX..XXXXXXX 100644 | ||
671 | --- a/hw/arm/virt.c | ||
672 | +++ b/hw/arm/virt.c | ||
673 | @@ -XXX,XX +XXX,XX @@ | ||
674 | #include "qemu/option.h" | ||
675 | #include "qapi/error.h" | ||
676 | #include "hw/sysbus.h" | ||
677 | -#include "hw/arm/arm.h" | ||
678 | +#include "hw/arm/boot.h" | ||
679 | #include "hw/arm/primecell.h" | ||
680 | #include "hw/arm/virt.h" | ||
681 | #include "hw/block/flash.h" | ||
682 | diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c | ||
683 | index XXXXXXX..XXXXXXX 100644 | ||
684 | --- a/hw/arm/xilinx_zynq.c | ||
685 | +++ b/hw/arm/xilinx_zynq.c | ||
686 | @@ -XXX,XX +XXX,XX @@ | ||
687 | #include "qemu-common.h" | ||
688 | #include "cpu.h" | ||
689 | #include "hw/sysbus.h" | ||
690 | -#include "hw/arm/arm.h" | ||
691 | +#include "hw/arm/boot.h" | ||
692 | #include "net/net.h" | ||
693 | #include "exec/address-spaces.h" | ||
694 | #include "sysemu/sysemu.h" | ||
695 | diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c | ||
696 | index XXXXXXX..XXXXXXX 100644 | ||
697 | --- a/hw/arm/xlnx-versal.c | ||
698 | +++ b/hw/arm/xlnx-versal.c | ||
699 | @@ -XXX,XX +XXX,XX @@ | ||
700 | #include "net/net.h" | ||
701 | #include "sysemu/sysemu.h" | ||
702 | #include "sysemu/kvm.h" | ||
703 | -#include "hw/arm/arm.h" | ||
704 | +#include "hw/arm/boot.h" | ||
705 | #include "kvm_arm.h" | ||
706 | #include "hw/misc/unimp.h" | ||
707 | #include "hw/intc/arm_gicv3_common.h" | ||
708 | diff --git a/hw/arm/z2.c b/hw/arm/z2.c | ||
709 | index XXXXXXX..XXXXXXX 100644 | ||
710 | --- a/hw/arm/z2.c | ||
711 | +++ b/hw/arm/z2.c | ||
712 | @@ -XXX,XX +XXX,XX @@ | ||
713 | #include "qemu/osdep.h" | ||
714 | #include "hw/hw.h" | ||
715 | #include "hw/arm/pxa.h" | ||
716 | -#include "hw/arm/arm.h" | ||
717 | +#include "hw/arm/boot.h" | ||
718 | #include "hw/i2c/i2c.h" | ||
719 | #include "hw/ssi/ssi.h" | ||
720 | #include "hw/boards.h" | ||
721 | -- | 65 | -- |
722 | 2.20.1 | 66 | 2.34.1 |
723 | |||
724 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Mostafa Saleh <smostafa@google.com> | ||
1 | 2 | ||
3 | In preparation for adding stage-2 support. | ||
4 | Add IDR0 fields related to stage-2. | ||
5 | |||
6 | VMID16: 16-bit VMID supported. | ||
7 | S2P: Stage-2 translation supported. | ||
8 | |||
9 | They are described in 6.3.1 SMMU_IDR0. | ||
10 | |||
11 | No functional change intended. | ||
12 | |||
13 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
14 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
15 | Signed-off-by: Mostafa Saleh <smostafa@google.com> | ||
16 | Tested-by: Eric Auger <eric.auger@redhat.com> | ||
17 | Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
18 | Message-id: 20230516203327.2051088-2-smostafa@google.com | ||
19 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
20 | --- | ||
21 | hw/arm/smmuv3-internal.h | 2 ++ | ||
22 | 1 file changed, 2 insertions(+) | ||
23 | |||
24 | diff --git a/hw/arm/smmuv3-internal.h b/hw/arm/smmuv3-internal.h | ||
25 | index XXXXXXX..XXXXXXX 100644 | ||
26 | --- a/hw/arm/smmuv3-internal.h | ||
27 | +++ b/hw/arm/smmuv3-internal.h | ||
28 | @@ -XXX,XX +XXX,XX @@ typedef enum SMMUTranslationStatus { | ||
29 | /* MMIO Registers */ | ||
30 | |||
31 | REG32(IDR0, 0x0) | ||
32 | + FIELD(IDR0, S2P, 0 , 1) | ||
33 | FIELD(IDR0, S1P, 1 , 1) | ||
34 | FIELD(IDR0, TTF, 2 , 2) | ||
35 | FIELD(IDR0, COHACC, 4 , 1) | ||
36 | FIELD(IDR0, ASID16, 12, 1) | ||
37 | + FIELD(IDR0, VMID16, 18, 1) | ||
38 | FIELD(IDR0, TTENDIAN, 21, 2) | ||
39 | FIELD(IDR0, STALL_MODEL, 24, 2) | ||
40 | FIELD(IDR0, TERM_MODEL, 26, 1) | ||
41 | -- | ||
42 | 2.34.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Mostafa Saleh <smostafa@google.com> | ||
1 | 2 | ||
3 | In preparation for adding stage-2 support, add a S2 config | ||
4 | struct(SMMUS2Cfg), composed of the following fields and embedded in | ||
5 | the main SMMUTransCfg: | ||
6 | -tsz: Size of IPA input region (S2T0SZ) | ||
7 | -sl0: Start level of translation (S2SL0) | ||
8 | -affd: AF Fault Disable (S2AFFD) | ||
9 | -record_faults: Record fault events (S2R) | ||
10 | -granule_sz: Granule page shift (based on S2TG) | ||
11 | -vmid: Virtual Machine ID (S2VMID) | ||
12 | -vttb: Address of translation table base (S2TTB) | ||
13 | -eff_ps: Effective PA output range (based on S2PS) | ||
14 | |||
15 | They will be used in the next patches in stage-2 address translation. | ||
16 | |||
17 | The fields in SMMUS2Cfg, are reordered to make the shared and stage-1 | ||
18 | fields next to each other, this reordering didn't change the struct | ||
19 | size (104 bytes before and after). | ||
20 | |||
21 | Stage-1 only fields: aa64, asid, tt, ttb, tbi, record_faults, oas. | ||
22 | oas is stage-1 output address size. However, it is used to check | ||
23 | input address in case stage-1 is unimplemented or bypassed according | ||
24 | to SMMUv3 manual IHI0070.E "3.4. Address sizes" | ||
25 | |||
26 | Shared fields: stage, disabled, bypassed, aborted, iotlb_*. | ||
27 | |||
28 | No functional change intended. | ||
29 | |||
30 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
31 | Signed-off-by: Mostafa Saleh <smostafa@google.com> | ||
32 | Tested-by: Eric Auger <eric.auger@redhat.com> | ||
33 | Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
34 | Message-id: 20230516203327.2051088-3-smostafa@google.com | ||
35 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
36 | --- | ||
37 | include/hw/arm/smmu-common.h | 22 +++++++++++++++++++--- | ||
38 | 1 file changed, 19 insertions(+), 3 deletions(-) | ||
39 | |||
40 | diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h | ||
41 | index XXXXXXX..XXXXXXX 100644 | ||
42 | --- a/include/hw/arm/smmu-common.h | ||
43 | +++ b/include/hw/arm/smmu-common.h | ||
44 | @@ -XXX,XX +XXX,XX @@ typedef struct SMMUTLBEntry { | ||
45 | uint8_t granule; | ||
46 | } SMMUTLBEntry; | ||
47 | |||
48 | +/* Stage-2 configuration. */ | ||
49 | +typedef struct SMMUS2Cfg { | ||
50 | + uint8_t tsz; /* Size of IPA input region (S2T0SZ) */ | ||
51 | + uint8_t sl0; /* Start level of translation (S2SL0) */ | ||
52 | + bool affd; /* AF Fault Disable (S2AFFD) */ | ||
53 | + bool record_faults; /* Record fault events (S2R) */ | ||
54 | + uint8_t granule_sz; /* Granule page shift (based on S2TG) */ | ||
55 | + uint8_t eff_ps; /* Effective PA output range (based on S2PS) */ | ||
56 | + uint16_t vmid; /* Virtual Machine ID (S2VMID) */ | ||
57 | + uint64_t vttb; /* Address of translation table base (S2TTB) */ | ||
58 | +} SMMUS2Cfg; | ||
59 | + | ||
60 | /* | ||
61 | * Generic structure populated by derived SMMU devices | ||
62 | * after decoding the configuration information and used as | ||
63 | * input to the page table walk | ||
64 | */ | ||
65 | typedef struct SMMUTransCfg { | ||
66 | + /* Shared fields between stage-1 and stage-2. */ | ||
67 | int stage; /* translation stage */ | ||
68 | - bool aa64; /* arch64 or aarch32 translation table */ | ||
69 | bool disabled; /* smmu is disabled */ | ||
70 | bool bypassed; /* translation is bypassed */ | ||
71 | bool aborted; /* translation is aborted */ | ||
72 | + uint32_t iotlb_hits; /* counts IOTLB hits */ | ||
73 | + uint32_t iotlb_misses; /* counts IOTLB misses*/ | ||
74 | + /* Used by stage-1 only. */ | ||
75 | + bool aa64; /* arch64 or aarch32 translation table */ | ||
76 | bool record_faults; /* record fault events */ | ||
77 | uint64_t ttb; /* TT base address */ | ||
78 | uint8_t oas; /* output address width */ | ||
79 | uint8_t tbi; /* Top Byte Ignore */ | ||
80 | uint16_t asid; | ||
81 | SMMUTransTableInfo tt[2]; | ||
82 | - uint32_t iotlb_hits; /* counts IOTLB hits for this asid */ | ||
83 | - uint32_t iotlb_misses; /* counts IOTLB misses for this asid */ | ||
84 | + /* Used by stage-2 only. */ | ||
85 | + struct SMMUS2Cfg s2cfg; | ||
86 | } SMMUTransCfg; | ||
87 | |||
88 | typedef struct SMMUDevice { | ||
89 | -- | ||
90 | 2.34.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Mostafa Saleh <smostafa@google.com> | ||
1 | 2 | ||
3 | In preparation for adding stage-2 support, rename smmu_ptw_64 to | ||
4 | smmu_ptw_64_s1 and refactor some of the code so it can be reused in | ||
5 | stage-2 page table walk. | ||
6 | |||
7 | Remove AA64 check from PTW as decode_cd already ensures that AA64 is | ||
8 | used, otherwise it faults with C_BAD_CD. | ||
9 | |||
10 | A stage member is added to SMMUPTWEventInfo to differentiate | ||
11 | between stage-1 and stage-2 ptw faults. | ||
12 | |||
13 | Add stage argument to trace_smmu_ptw_level be consistent with other | ||
14 | trace events. | ||
15 | |||
16 | Signed-off-by: Mostafa Saleh <smostafa@google.com> | ||
17 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
18 | Tested-by: Eric Auger <eric.auger@redhat.com> | ||
19 | Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
20 | Message-id: 20230516203327.2051088-4-smostafa@google.com | ||
21 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
22 | --- | ||
23 | include/hw/arm/smmu-common.h | 16 +++++++++++++--- | ||
24 | hw/arm/smmu-common.c | 27 ++++++++++----------------- | ||
25 | hw/arm/smmuv3.c | 2 ++ | ||
26 | hw/arm/trace-events | 2 +- | ||
27 | 4 files changed, 26 insertions(+), 21 deletions(-) | ||
28 | |||
29 | diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h | ||
30 | index XXXXXXX..XXXXXXX 100644 | ||
31 | --- a/include/hw/arm/smmu-common.h | ||
32 | +++ b/include/hw/arm/smmu-common.h | ||
33 | @@ -XXX,XX +XXX,XX @@ | ||
34 | #include "hw/pci/pci.h" | ||
35 | #include "qom/object.h" | ||
36 | |||
37 | -#define SMMU_PCI_BUS_MAX 256 | ||
38 | -#define SMMU_PCI_DEVFN_MAX 256 | ||
39 | -#define SMMU_PCI_DEVFN(sid) (sid & 0xFF) | ||
40 | +#define SMMU_PCI_BUS_MAX 256 | ||
41 | +#define SMMU_PCI_DEVFN_MAX 256 | ||
42 | +#define SMMU_PCI_DEVFN(sid) (sid & 0xFF) | ||
43 | + | ||
44 | +/* VMSAv8-64 Translation constants and functions */ | ||
45 | +#define VMSA_LEVELS 4 | ||
46 | + | ||
47 | +#define VMSA_STRIDE(gran) ((gran) - VMSA_LEVELS + 1) | ||
48 | +#define VMSA_BIT_LVL(isz, strd, lvl) ((isz) - (strd) * \ | ||
49 | + (VMSA_LEVELS - (lvl))) | ||
50 | +#define VMSA_IDXMSK(isz, strd, lvl) ((1ULL << \ | ||
51 | + VMSA_BIT_LVL(isz, strd, lvl)) - 1) | ||
52 | |||
53 | /* | ||
54 | * Page table walk error types | ||
55 | @@ -XXX,XX +XXX,XX @@ typedef enum { | ||
56 | } SMMUPTWEventType; | ||
57 | |||
58 | typedef struct SMMUPTWEventInfo { | ||
59 | + int stage; | ||
60 | SMMUPTWEventType type; | ||
61 | dma_addr_t addr; /* fetched address that induced an abort, if any */ | ||
62 | } SMMUPTWEventInfo; | ||
63 | diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c | ||
64 | index XXXXXXX..XXXXXXX 100644 | ||
65 | --- a/hw/arm/smmu-common.c | ||
66 | +++ b/hw/arm/smmu-common.c | ||
67 | @@ -XXX,XX +XXX,XX @@ SMMUTransTableInfo *select_tt(SMMUTransCfg *cfg, dma_addr_t iova) | ||
68 | } | ||
69 | |||
70 | /** | ||
71 | - * smmu_ptw_64 - VMSAv8-64 Walk of the page tables for a given IOVA | ||
72 | + * smmu_ptw_64_s1 - VMSAv8-64 Walk of the page tables for a given IOVA | ||
73 | * @cfg: translation config | ||
74 | * @iova: iova to translate | ||
75 | * @perm: access type | ||
76 | @@ -XXX,XX +XXX,XX @@ SMMUTransTableInfo *select_tt(SMMUTransCfg *cfg, dma_addr_t iova) | ||
77 | * Upon success, @tlbe is filled with translated_addr and entry | ||
78 | * permission rights. | ||
79 | */ | ||
80 | -static int smmu_ptw_64(SMMUTransCfg *cfg, | ||
81 | - dma_addr_t iova, IOMMUAccessFlags perm, | ||
82 | - SMMUTLBEntry *tlbe, SMMUPTWEventInfo *info) | ||
83 | +static int smmu_ptw_64_s1(SMMUTransCfg *cfg, | ||
84 | + dma_addr_t iova, IOMMUAccessFlags perm, | ||
85 | + SMMUTLBEntry *tlbe, SMMUPTWEventInfo *info) | ||
86 | { | ||
87 | dma_addr_t baseaddr, indexmask; | ||
88 | int stage = cfg->stage; | ||
89 | @@ -XXX,XX +XXX,XX @@ static int smmu_ptw_64(SMMUTransCfg *cfg, | ||
90 | } | ||
91 | |||
92 | granule_sz = tt->granule_sz; | ||
93 | - stride = granule_sz - 3; | ||
94 | + stride = VMSA_STRIDE(granule_sz); | ||
95 | inputsize = 64 - tt->tsz; | ||
96 | level = 4 - (inputsize - 4) / stride; | ||
97 | - indexmask = (1ULL << (inputsize - (stride * (4 - level)))) - 1; | ||
98 | + indexmask = VMSA_IDXMSK(inputsize, stride, level); | ||
99 | baseaddr = extract64(tt->ttb, 0, 48); | ||
100 | baseaddr &= ~indexmask; | ||
101 | |||
102 | - while (level <= 3) { | ||
103 | + while (level < VMSA_LEVELS) { | ||
104 | uint64_t subpage_size = 1ULL << level_shift(level, granule_sz); | ||
105 | uint64_t mask = subpage_size - 1; | ||
106 | uint32_t offset = iova_level_offset(iova, inputsize, level, granule_sz); | ||
107 | @@ -XXX,XX +XXX,XX @@ static int smmu_ptw_64(SMMUTransCfg *cfg, | ||
108 | if (get_pte(baseaddr, offset, &pte, info)) { | ||
109 | goto error; | ||
110 | } | ||
111 | - trace_smmu_ptw_level(level, iova, subpage_size, | ||
112 | + trace_smmu_ptw_level(stage, level, iova, subpage_size, | ||
113 | baseaddr, offset, pte); | ||
114 | |||
115 | if (is_invalid_pte(pte) || is_reserved_pte(pte, level)) { | ||
116 | @@ -XXX,XX +XXX,XX @@ static int smmu_ptw_64(SMMUTransCfg *cfg, | ||
117 | info->type = SMMU_PTW_ERR_TRANSLATION; | ||
118 | |||
119 | error: | ||
120 | + info->stage = 1; | ||
121 | tlbe->entry.perm = IOMMU_NONE; | ||
122 | return -EINVAL; | ||
123 | } | ||
124 | @@ -XXX,XX +XXX,XX @@ error: | ||
125 | int smmu_ptw(SMMUTransCfg *cfg, dma_addr_t iova, IOMMUAccessFlags perm, | ||
126 | SMMUTLBEntry *tlbe, SMMUPTWEventInfo *info) | ||
127 | { | ||
128 | - if (!cfg->aa64) { | ||
129 | - /* | ||
130 | - * This code path is not entered as we check this while decoding | ||
131 | - * the configuration data in the derived SMMU model. | ||
132 | - */ | ||
133 | - g_assert_not_reached(); | ||
134 | - } | ||
135 | - | ||
136 | - return smmu_ptw_64(cfg, iova, perm, tlbe, info); | ||
137 | + return smmu_ptw_64_s1(cfg, iova, perm, tlbe, info); | ||
138 | } | ||
139 | |||
140 | /** | ||
141 | diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c | ||
142 | index XXXXXXX..XXXXXXX 100644 | ||
143 | --- a/hw/arm/smmuv3.c | ||
144 | +++ b/hw/arm/smmuv3.c | ||
145 | @@ -XXX,XX +XXX,XX @@ static IOMMUTLBEntry smmuv3_translate(IOMMUMemoryRegion *mr, hwaddr addr, | ||
146 | cached_entry = g_new0(SMMUTLBEntry, 1); | ||
147 | |||
148 | if (smmu_ptw(cfg, aligned_addr, flag, cached_entry, &ptw_info)) { | ||
149 | + /* All faults from PTW has S2 field. */ | ||
150 | + event.u.f_walk_eabt.s2 = (ptw_info.stage == 2); | ||
151 | g_free(cached_entry); | ||
152 | switch (ptw_info.type) { | ||
153 | case SMMU_PTW_ERR_WALK_EABT: | ||
154 | diff --git a/hw/arm/trace-events b/hw/arm/trace-events | ||
155 | index XXXXXXX..XXXXXXX 100644 | ||
156 | --- a/hw/arm/trace-events | ||
157 | +++ b/hw/arm/trace-events | ||
158 | @@ -XXX,XX +XXX,XX @@ virt_acpi_setup(void) "No fw cfg or ACPI disabled. Bailing out." | ||
159 | |||
160 | # smmu-common.c | ||
161 | smmu_add_mr(const char *name) "%s" | ||
162 | -smmu_ptw_level(int level, uint64_t iova, size_t subpage_size, uint64_t baseaddr, uint32_t offset, uint64_t pte) "level=%d iova=0x%"PRIx64" subpage_sz=0x%zx baseaddr=0x%"PRIx64" offset=%d => pte=0x%"PRIx64 | ||
163 | +smmu_ptw_level(int stage, int level, uint64_t iova, size_t subpage_size, uint64_t baseaddr, uint32_t offset, uint64_t pte) "stage=%d level=%d iova=0x%"PRIx64" subpage_sz=0x%zx baseaddr=0x%"PRIx64" offset=%d => pte=0x%"PRIx64 | ||
164 | smmu_ptw_invalid_pte(int stage, int level, uint64_t baseaddr, uint64_t pteaddr, uint32_t offset, uint64_t pte) "stage=%d level=%d base@=0x%"PRIx64" pte@=0x%"PRIx64" offset=%d pte=0x%"PRIx64 | ||
165 | smmu_ptw_page_pte(int stage, int level, uint64_t iova, uint64_t baseaddr, uint64_t pteaddr, uint64_t pte, uint64_t address) "stage=%d level=%d iova=0x%"PRIx64" base@=0x%"PRIx64" pte@=0x%"PRIx64" pte=0x%"PRIx64" page address = 0x%"PRIx64 | ||
166 | smmu_ptw_block_pte(int stage, int level, uint64_t baseaddr, uint64_t pteaddr, uint64_t pte, uint64_t iova, uint64_t gpa, int bsize_mb) "stage=%d level=%d base@=0x%"PRIx64" pte@=0x%"PRIx64" pte=0x%"PRIx64" iova=0x%"PRIx64" block address = 0x%"PRIx64" block size = %d MiB" | ||
167 | -- | ||
168 | 2.34.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | 1 | From: Mostafa Saleh <smostafa@google.com> | |
2 | |||
3 | In preparation for adding stage-2 support, add Stage-2 PTW code. | ||
4 | Only Aarch64 format is supported as stage-1. | ||
5 | |||
6 | Nesting stage-1 and stage-2 is not supported right now. | ||
7 | |||
8 | HTTU is not supported, SW is expected to maintain the Access flag. | ||
9 | This is described in the SMMUv3 manual(IHI 0070.E.a) | ||
10 | "5.2. Stream Table Entry" in "[181] S2AFFD". | ||
11 | This flag determines the behavior on access of a stage-2 page whose | ||
12 | descriptor has AF == 0: | ||
13 | - 0b0: An Access flag fault occurs (stall not supported). | ||
14 | - 0b1: An Access flag fault never occurs. | ||
15 | An Access fault takes priority over a Permission fault. | ||
16 | |||
17 | There are 3 address size checks for stage-2 according to | ||
18 | (IHI 0070.E.a) in "3.4. Address sizes". | ||
19 | - As nesting is not supported, input address is passed directly to | ||
20 | stage-2, and is checked against IAS. | ||
21 | We use cfg->oas to hold the OAS when stage-1 is not used, this is set | ||
22 | in the next patch. | ||
23 | This check is done outside of smmu_ptw_64_s2 as it is not part of | ||
24 | stage-2(it throws stage-1 fault), and the stage-2 function shouldn't | ||
25 | change it's behavior when nesting is supported. | ||
26 | When nesting is supported and we figure out how to combine TLB for | ||
27 | stage-1 and stage-2 we can move this check into the stage-1 function | ||
28 | as described in ARM DDI0487I.a in pseudocode | ||
29 | aarch64/translation/vmsa_translation/AArch64.S1Translate | ||
30 | aarch64/translation/vmsa_translation/AArch64.S1DisabledOutput | ||
31 | |||
32 | - Input to stage-2 is checked against s2t0sz, and throws stage-2 | ||
33 | transaltion fault if exceeds it. | ||
34 | |||
35 | - Output of stage-2 is checked against effective PA output range. | ||
36 | |||
37 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
38 | Signed-off-by: Mostafa Saleh <smostafa@google.com> | ||
39 | Tested-by: Eric Auger <eric.auger@redhat.com> | ||
40 | Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
41 | Message-id: 20230516203327.2051088-5-smostafa@google.com | ||
42 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
43 | --- | ||
44 | hw/arm/smmu-internal.h | 35 ++++++++++ | ||
45 | hw/arm/smmu-common.c | 142 ++++++++++++++++++++++++++++++++++++++++- | ||
46 | 2 files changed, 176 insertions(+), 1 deletion(-) | ||
47 | |||
48 | diff --git a/hw/arm/smmu-internal.h b/hw/arm/smmu-internal.h | ||
49 | index XXXXXXX..XXXXXXX 100644 | ||
50 | --- a/hw/arm/smmu-internal.h | ||
51 | +++ b/hw/arm/smmu-internal.h | ||
52 | @@ -XXX,XX +XXX,XX @@ | ||
53 | #define PTE_APTABLE(pte) \ | ||
54 | (extract64(pte, 61, 2)) | ||
55 | |||
56 | +#define PTE_AF(pte) \ | ||
57 | + (extract64(pte, 10, 1)) | ||
58 | /* | ||
59 | * TODO: At the moment all transactions are considered as privileged (EL1) | ||
60 | * as IOMMU translation callback does not pass user/priv attributes. | ||
61 | @@ -XXX,XX +XXX,XX @@ | ||
62 | #define is_permission_fault(ap, perm) \ | ||
63 | (((perm) & IOMMU_WO) && ((ap) & 0x2)) | ||
64 | |||
65 | +#define is_permission_fault_s2(s2ap, perm) \ | ||
66 | + (!(((s2ap) & (perm)) == (perm))) | ||
67 | + | ||
68 | #define PTE_AP_TO_PERM(ap) \ | ||
69 | (IOMMU_ACCESS_FLAG(true, !((ap) & 0x2))) | ||
70 | |||
71 | @@ -XXX,XX +XXX,XX @@ uint64_t iova_level_offset(uint64_t iova, int inputsize, | ||
72 | MAKE_64BIT_MASK(0, gsz - 3); | ||
73 | } | ||
74 | |||
75 | +/* FEAT_LPA2 and FEAT_TTST are not implemented. */ | ||
76 | +static inline int get_start_level(int sl0 , int granule_sz) | ||
77 | +{ | ||
78 | + /* ARM DDI0487I.a: Table D8-12. */ | ||
79 | + if (granule_sz == 12) { | ||
80 | + return 2 - sl0; | ||
81 | + } | ||
82 | + /* ARM DDI0487I.a: Table D8-22 and Table D8-31. */ | ||
83 | + return 3 - sl0; | ||
84 | +} | ||
85 | + | ||
86 | +/* | ||
87 | + * Index in a concatenated first level stage-2 page table. | ||
88 | + * ARM DDI0487I.a: D8.2.2 Concatenated translation tables. | ||
89 | + */ | ||
90 | +static inline int pgd_concat_idx(int start_level, int granule_sz, | ||
91 | + dma_addr_t ipa) | ||
92 | +{ | ||
93 | + uint64_t ret; | ||
94 | + /* | ||
95 | + * Get the number of bits handled by next levels, then any extra bits in | ||
96 | + * the address should index the concatenated tables. This relation can be | ||
97 | + * deduced from tables in ARM DDI0487I.a: D8.2.7-9 | ||
98 | + */ | ||
99 | + int shift = level_shift(start_level - 1, granule_sz); | ||
100 | + | ||
101 | + ret = ipa >> shift; | ||
102 | + return ret; | ||
103 | +} | ||
104 | + | ||
105 | #define SMMU_IOTLB_ASID(key) ((key).asid) | ||
106 | |||
107 | typedef struct SMMUIOTLBPageInvInfo { | ||
108 | diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c | ||
109 | index XXXXXXX..XXXXXXX 100644 | ||
110 | --- a/hw/arm/smmu-common.c | ||
111 | +++ b/hw/arm/smmu-common.c | ||
112 | @@ -XXX,XX +XXX,XX @@ error: | ||
113 | return -EINVAL; | ||
114 | } | ||
115 | |||
116 | +/** | ||
117 | + * smmu_ptw_64_s2 - VMSAv8-64 Walk of the page tables for a given ipa | ||
118 | + * for stage-2. | ||
119 | + * @cfg: translation config | ||
120 | + * @ipa: ipa to translate | ||
121 | + * @perm: access type | ||
122 | + * @tlbe: SMMUTLBEntry (out) | ||
123 | + * @info: handle to an error info | ||
124 | + * | ||
125 | + * Return 0 on success, < 0 on error. In case of error, @info is filled | ||
126 | + * and tlbe->perm is set to IOMMU_NONE. | ||
127 | + * Upon success, @tlbe is filled with translated_addr and entry | ||
128 | + * permission rights. | ||
129 | + */ | ||
130 | +static int smmu_ptw_64_s2(SMMUTransCfg *cfg, | ||
131 | + dma_addr_t ipa, IOMMUAccessFlags perm, | ||
132 | + SMMUTLBEntry *tlbe, SMMUPTWEventInfo *info) | ||
133 | +{ | ||
134 | + const int stage = 2; | ||
135 | + int granule_sz = cfg->s2cfg.granule_sz; | ||
136 | + /* ARM DDI0487I.a: Table D8-7. */ | ||
137 | + int inputsize = 64 - cfg->s2cfg.tsz; | ||
138 | + int level = get_start_level(cfg->s2cfg.sl0, granule_sz); | ||
139 | + int stride = VMSA_STRIDE(granule_sz); | ||
140 | + int idx = pgd_concat_idx(level, granule_sz, ipa); | ||
141 | + /* | ||
142 | + * Get the ttb from concatenated structure. | ||
143 | + * The offset is the idx * size of each ttb(number of ptes * (sizeof(pte)) | ||
144 | + */ | ||
145 | + uint64_t baseaddr = extract64(cfg->s2cfg.vttb, 0, 48) + (1 << stride) * | ||
146 | + idx * sizeof(uint64_t); | ||
147 | + dma_addr_t indexmask = VMSA_IDXMSK(inputsize, stride, level); | ||
148 | + | ||
149 | + baseaddr &= ~indexmask; | ||
150 | + | ||
151 | + /* | ||
152 | + * On input, a stage 2 Translation fault occurs if the IPA is outside the | ||
153 | + * range configured by the relevant S2T0SZ field of the STE. | ||
154 | + */ | ||
155 | + if (ipa >= (1ULL << inputsize)) { | ||
156 | + info->type = SMMU_PTW_ERR_TRANSLATION; | ||
157 | + goto error; | ||
158 | + } | ||
159 | + | ||
160 | + while (level < VMSA_LEVELS) { | ||
161 | + uint64_t subpage_size = 1ULL << level_shift(level, granule_sz); | ||
162 | + uint64_t mask = subpage_size - 1; | ||
163 | + uint32_t offset = iova_level_offset(ipa, inputsize, level, granule_sz); | ||
164 | + uint64_t pte, gpa; | ||
165 | + dma_addr_t pte_addr = baseaddr + offset * sizeof(pte); | ||
166 | + uint8_t s2ap; | ||
167 | + | ||
168 | + if (get_pte(baseaddr, offset, &pte, info)) { | ||
169 | + goto error; | ||
170 | + } | ||
171 | + trace_smmu_ptw_level(stage, level, ipa, subpage_size, | ||
172 | + baseaddr, offset, pte); | ||
173 | + if (is_invalid_pte(pte) || is_reserved_pte(pte, level)) { | ||
174 | + trace_smmu_ptw_invalid_pte(stage, level, baseaddr, | ||
175 | + pte_addr, offset, pte); | ||
176 | + break; | ||
177 | + } | ||
178 | + | ||
179 | + if (is_table_pte(pte, level)) { | ||
180 | + baseaddr = get_table_pte_address(pte, granule_sz); | ||
181 | + level++; | ||
182 | + continue; | ||
183 | + } else if (is_page_pte(pte, level)) { | ||
184 | + gpa = get_page_pte_address(pte, granule_sz); | ||
185 | + trace_smmu_ptw_page_pte(stage, level, ipa, | ||
186 | + baseaddr, pte_addr, pte, gpa); | ||
187 | + } else { | ||
188 | + uint64_t block_size; | ||
189 | + | ||
190 | + gpa = get_block_pte_address(pte, level, granule_sz, | ||
191 | + &block_size); | ||
192 | + trace_smmu_ptw_block_pte(stage, level, baseaddr, | ||
193 | + pte_addr, pte, ipa, gpa, | ||
194 | + block_size >> 20); | ||
195 | + } | ||
196 | + | ||
197 | + /* | ||
198 | + * If S2AFFD and PTE.AF are 0 => fault. (5.2. Stream Table Entry) | ||
199 | + * An Access fault takes priority over a Permission fault. | ||
200 | + */ | ||
201 | + if (!PTE_AF(pte) && !cfg->s2cfg.affd) { | ||
202 | + info->type = SMMU_PTW_ERR_ACCESS; | ||
203 | + goto error; | ||
204 | + } | ||
205 | + | ||
206 | + s2ap = PTE_AP(pte); | ||
207 | + if (is_permission_fault_s2(s2ap, perm)) { | ||
208 | + info->type = SMMU_PTW_ERR_PERMISSION; | ||
209 | + goto error; | ||
210 | + } | ||
211 | + | ||
212 | + /* | ||
213 | + * The address output from the translation causes a stage 2 Address | ||
214 | + * Size fault if it exceeds the effective PA output range. | ||
215 | + */ | ||
216 | + if (gpa >= (1ULL << cfg->s2cfg.eff_ps)) { | ||
217 | + info->type = SMMU_PTW_ERR_ADDR_SIZE; | ||
218 | + goto error; | ||
219 | + } | ||
220 | + | ||
221 | + tlbe->entry.translated_addr = gpa; | ||
222 | + tlbe->entry.iova = ipa & ~mask; | ||
223 | + tlbe->entry.addr_mask = mask; | ||
224 | + tlbe->entry.perm = s2ap; | ||
225 | + tlbe->level = level; | ||
226 | + tlbe->granule = granule_sz; | ||
227 | + return 0; | ||
228 | + } | ||
229 | + info->type = SMMU_PTW_ERR_TRANSLATION; | ||
230 | + | ||
231 | +error: | ||
232 | + info->stage = 2; | ||
233 | + tlbe->entry.perm = IOMMU_NONE; | ||
234 | + return -EINVAL; | ||
235 | +} | ||
236 | + | ||
237 | /** | ||
238 | * smmu_ptw - Walk the page tables for an IOVA, according to @cfg | ||
239 | * | ||
240 | @@ -XXX,XX +XXX,XX @@ error: | ||
241 | int smmu_ptw(SMMUTransCfg *cfg, dma_addr_t iova, IOMMUAccessFlags perm, | ||
242 | SMMUTLBEntry *tlbe, SMMUPTWEventInfo *info) | ||
243 | { | ||
244 | - return smmu_ptw_64_s1(cfg, iova, perm, tlbe, info); | ||
245 | + if (cfg->stage == 1) { | ||
246 | + return smmu_ptw_64_s1(cfg, iova, perm, tlbe, info); | ||
247 | + } else if (cfg->stage == 2) { | ||
248 | + /* | ||
249 | + * If bypassing stage 1(or unimplemented), the input address is passed | ||
250 | + * directly to stage 2 as IPA. If the input address of a transaction | ||
251 | + * exceeds the size of the IAS, a stage 1 Address Size fault occurs. | ||
252 | + * For AA64, IAS = OAS according to (IHI 0070.E.a) "3.4 Address sizes" | ||
253 | + */ | ||
254 | + if (iova >= (1ULL << cfg->oas)) { | ||
255 | + info->type = SMMU_PTW_ERR_ADDR_SIZE; | ||
256 | + info->stage = 1; | ||
257 | + tlbe->entry.perm = IOMMU_NONE; | ||
258 | + return -EINVAL; | ||
259 | + } | ||
260 | + | ||
261 | + return smmu_ptw_64_s2(cfg, iova, perm, tlbe, info); | ||
262 | + } | ||
263 | + | ||
264 | + g_assert_not_reached(); | ||
265 | } | ||
266 | |||
267 | /** | ||
268 | -- | ||
269 | 2.34.1 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Mostafa Saleh <smostafa@google.com> |
---|---|---|---|
2 | 2 | ||
3 | The mask implied by the extract is redundant with the one | 3 | Parse stage-2 configuration from STE and populate it in SMMUS2Cfg. |
4 | implied by the deposit. Also, fix spelling of BFXIL. | 4 | Validity of field values are checked when possible. |
5 | 5 | ||
6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 6 | Only AA64 tables are supported and Small Translation Tables (STT) are |
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 7 | not supported. |
8 | Message-id: 20190514011129.11330-3-richard.henderson@linaro.org | 8 | |
9 | According to SMMUv3 UM(IHI0070E) "5.2 Stream Table Entry": All fields | ||
10 | with an S2 prefix (with the exception of S2VMID) are IGNORED when | ||
11 | stage-2 bypasses translation (Config[1] == 0). | ||
12 | |||
13 | Which means that VMID can be used(for TLB tagging) even if stage-2 is | ||
14 | bypassed, so we parse it unconditionally when S2P exists. Otherwise | ||
15 | it is set to -1.(only S1P) | ||
16 | |||
17 | As stall is not supported, if S2S is set the translation would abort. | ||
18 | For S2R, we reuse the same code used for stage-1 with flag | ||
19 | record_faults. However when nested translation is supported we would | ||
20 | need to separate stage-1 and stage-2 faults. | ||
21 | |||
22 | Fix wrong shift in STE_S2HD, STE_S2HA, STE_S2S. | ||
23 | |||
24 | Signed-off-by: Mostafa Saleh <smostafa@google.com> | ||
25 | Tested-by: Eric Auger <eric.auger@redhat.com> | ||
26 | Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
27 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
28 | Message-id: 20230516203327.2051088-6-smostafa@google.com | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 29 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 30 | --- |
11 | target/arm/translate-a64.c | 6 +++--- | 31 | hw/arm/smmuv3-internal.h | 10 +- |
12 | 1 file changed, 3 insertions(+), 3 deletions(-) | 32 | include/hw/arm/smmu-common.h | 1 + |
13 | 33 | include/hw/arm/smmuv3.h | 3 + | |
14 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 34 | hw/arm/smmuv3.c | 181 +++++++++++++++++++++++++++++++++-- |
35 | 4 files changed, 185 insertions(+), 10 deletions(-) | ||
36 | |||
37 | diff --git a/hw/arm/smmuv3-internal.h b/hw/arm/smmuv3-internal.h | ||
15 | index XXXXXXX..XXXXXXX 100644 | 38 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-a64.c | 39 | --- a/hw/arm/smmuv3-internal.h |
17 | +++ b/target/arm/translate-a64.c | 40 | +++ b/hw/arm/smmuv3-internal.h |
18 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) | 41 | @@ -XXX,XX +XXX,XX @@ typedef struct CD { |
19 | tcg_gen_extract_i64(tcg_rd, tcg_tmp, ri, len); | 42 | #define STE_S2TG(x) extract32((x)->word[5], 14, 2) |
20 | return; | 43 | #define STE_S2PS(x) extract32((x)->word[5], 16, 3) |
21 | } | 44 | #define STE_S2AA64(x) extract32((x)->word[5], 19, 1) |
22 | - /* opc == 1, BXFIL fall through to deposit */ | 45 | -#define STE_S2HD(x) extract32((x)->word[5], 24, 1) |
23 | - tcg_gen_extract_i64(tcg_tmp, tcg_tmp, ri, len); | 46 | -#define STE_S2HA(x) extract32((x)->word[5], 25, 1) |
24 | + /* opc == 1, BFXIL fall through to deposit */ | 47 | -#define STE_S2S(x) extract32((x)->word[5], 26, 1) |
25 | + tcg_gen_shri_i64(tcg_tmp, tcg_tmp, ri); | 48 | +#define STE_S2ENDI(x) extract32((x)->word[5], 20, 1) |
26 | pos = 0; | 49 | +#define STE_S2AFFD(x) extract32((x)->word[5], 21, 1) |
27 | } else { | 50 | +#define STE_S2HD(x) extract32((x)->word[5], 23, 1) |
28 | /* Handle the ri > si case with a deposit | 51 | +#define STE_S2HA(x) extract32((x)->word[5], 24, 1) |
29 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) | 52 | +#define STE_S2S(x) extract32((x)->word[5], 25, 1) |
30 | len = ri; | 53 | +#define STE_S2R(x) extract32((x)->word[5], 26, 1) |
54 | + | ||
55 | #define STE_CTXPTR(x) \ | ||
56 | ({ \ | ||
57 | unsigned long addr; \ | ||
58 | diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h | ||
59 | index XXXXXXX..XXXXXXX 100644 | ||
60 | --- a/include/hw/arm/smmu-common.h | ||
61 | +++ b/include/hw/arm/smmu-common.h | ||
62 | @@ -XXX,XX +XXX,XX @@ | ||
63 | |||
64 | /* VMSAv8-64 Translation constants and functions */ | ||
65 | #define VMSA_LEVELS 4 | ||
66 | +#define VMSA_MAX_S2_CONCAT 16 | ||
67 | |||
68 | #define VMSA_STRIDE(gran) ((gran) - VMSA_LEVELS + 1) | ||
69 | #define VMSA_BIT_LVL(isz, strd, lvl) ((isz) - (strd) * \ | ||
70 | diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h | ||
71 | index XXXXXXX..XXXXXXX 100644 | ||
72 | --- a/include/hw/arm/smmuv3.h | ||
73 | +++ b/include/hw/arm/smmuv3.h | ||
74 | @@ -XXX,XX +XXX,XX @@ struct SMMUv3Class { | ||
75 | #define TYPE_ARM_SMMUV3 "arm-smmuv3" | ||
76 | OBJECT_DECLARE_TYPE(SMMUv3State, SMMUv3Class, ARM_SMMUV3) | ||
77 | |||
78 | +#define STAGE1_SUPPORTED(s) FIELD_EX32(s->idr[0], IDR0, S1P) | ||
79 | +#define STAGE2_SUPPORTED(s) FIELD_EX32(s->idr[0], IDR0, S2P) | ||
80 | + | ||
81 | #endif | ||
82 | diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c | ||
83 | index XXXXXXX..XXXXXXX 100644 | ||
84 | --- a/hw/arm/smmuv3.c | ||
85 | +++ b/hw/arm/smmuv3.c | ||
86 | @@ -XXX,XX +XXX,XX @@ | ||
87 | #include "smmuv3-internal.h" | ||
88 | #include "smmu-internal.h" | ||
89 | |||
90 | +#define PTW_RECORD_FAULT(cfg) (((cfg)->stage == 1) ? (cfg)->record_faults : \ | ||
91 | + (cfg)->s2cfg.record_faults) | ||
92 | + | ||
93 | /** | ||
94 | * smmuv3_trigger_irq - pulse @irq if enabled and update | ||
95 | * GERROR register in case of GERROR interrupt | ||
96 | @@ -XXX,XX +XXX,XX @@ static int smmu_get_cd(SMMUv3State *s, STE *ste, uint32_t ssid, | ||
97 | return 0; | ||
98 | } | ||
99 | |||
100 | +/* | ||
101 | + * Max valid value is 39 when SMMU_IDR3.STT == 0. | ||
102 | + * In architectures after SMMUv3.0: | ||
103 | + * - If STE.S2TG selects a 4KB or 16KB granule, the minimum valid value for this | ||
104 | + * field is MAX(16, 64-IAS) | ||
105 | + * - If STE.S2TG selects a 64KB granule, the minimum valid value for this field | ||
106 | + * is (64-IAS). | ||
107 | + * As we only support AA64, IAS = OAS. | ||
108 | + */ | ||
109 | +static bool s2t0sz_valid(SMMUTransCfg *cfg) | ||
110 | +{ | ||
111 | + if (cfg->s2cfg.tsz > 39) { | ||
112 | + return false; | ||
113 | + } | ||
114 | + | ||
115 | + if (cfg->s2cfg.granule_sz == 16) { | ||
116 | + return (cfg->s2cfg.tsz >= 64 - oas2bits(SMMU_IDR5_OAS)); | ||
117 | + } | ||
118 | + | ||
119 | + return (cfg->s2cfg.tsz >= MAX(64 - oas2bits(SMMU_IDR5_OAS), 16)); | ||
120 | +} | ||
121 | + | ||
122 | +/* | ||
123 | + * Return true if s2 page table config is valid. | ||
124 | + * This checks with the configured start level, ias_bits and granularity we can | ||
125 | + * have a valid page table as described in ARM ARM D8.2 Translation process. | ||
126 | + * The idea here is to see for the highest possible number of IPA bits, how | ||
127 | + * many concatenated tables we would need, if it is more than 16, then this is | ||
128 | + * not possible. | ||
129 | + */ | ||
130 | +static bool s2_pgtable_config_valid(uint8_t sl0, uint8_t t0sz, uint8_t gran) | ||
131 | +{ | ||
132 | + int level = get_start_level(sl0, gran); | ||
133 | + uint64_t ipa_bits = 64 - t0sz; | ||
134 | + uint64_t max_ipa = (1ULL << ipa_bits) - 1; | ||
135 | + int nr_concat = pgd_concat_idx(level, gran, max_ipa) + 1; | ||
136 | + | ||
137 | + return nr_concat <= VMSA_MAX_S2_CONCAT; | ||
138 | +} | ||
139 | + | ||
140 | +static int decode_ste_s2_cfg(SMMUTransCfg *cfg, STE *ste) | ||
141 | +{ | ||
142 | + cfg->stage = 2; | ||
143 | + | ||
144 | + if (STE_S2AA64(ste) == 0x0) { | ||
145 | + qemu_log_mask(LOG_UNIMP, | ||
146 | + "SMMUv3 AArch32 tables not supported\n"); | ||
147 | + g_assert_not_reached(); | ||
148 | + } | ||
149 | + | ||
150 | + switch (STE_S2TG(ste)) { | ||
151 | + case 0x0: /* 4KB */ | ||
152 | + cfg->s2cfg.granule_sz = 12; | ||
153 | + break; | ||
154 | + case 0x1: /* 64KB */ | ||
155 | + cfg->s2cfg.granule_sz = 16; | ||
156 | + break; | ||
157 | + case 0x2: /* 16KB */ | ||
158 | + cfg->s2cfg.granule_sz = 14; | ||
159 | + break; | ||
160 | + default: | ||
161 | + qemu_log_mask(LOG_GUEST_ERROR, | ||
162 | + "SMMUv3 bad STE S2TG: %x\n", STE_S2TG(ste)); | ||
163 | + goto bad_ste; | ||
164 | + } | ||
165 | + | ||
166 | + cfg->s2cfg.vttb = STE_S2TTB(ste); | ||
167 | + | ||
168 | + cfg->s2cfg.sl0 = STE_S2SL0(ste); | ||
169 | + /* FEAT_TTST not supported. */ | ||
170 | + if (cfg->s2cfg.sl0 == 0x3) { | ||
171 | + qemu_log_mask(LOG_UNIMP, "SMMUv3 S2SL0 = 0x3 has no meaning!\n"); | ||
172 | + goto bad_ste; | ||
173 | + } | ||
174 | + | ||
175 | + /* For AA64, The effective S2PS size is capped to the OAS. */ | ||
176 | + cfg->s2cfg.eff_ps = oas2bits(MIN(STE_S2PS(ste), SMMU_IDR5_OAS)); | ||
177 | + /* | ||
178 | + * It is ILLEGAL for the address in S2TTB to be outside the range | ||
179 | + * described by the effective S2PS value. | ||
180 | + */ | ||
181 | + if (cfg->s2cfg.vttb & ~(MAKE_64BIT_MASK(0, cfg->s2cfg.eff_ps))) { | ||
182 | + qemu_log_mask(LOG_GUEST_ERROR, | ||
183 | + "SMMUv3 S2TTB too large 0x%lx, effective PS %d bits\n", | ||
184 | + cfg->s2cfg.vttb, cfg->s2cfg.eff_ps); | ||
185 | + goto bad_ste; | ||
186 | + } | ||
187 | + | ||
188 | + cfg->s2cfg.tsz = STE_S2T0SZ(ste); | ||
189 | + | ||
190 | + if (!s2t0sz_valid(cfg)) { | ||
191 | + qemu_log_mask(LOG_GUEST_ERROR, "SMMUv3 bad STE S2T0SZ = %d\n", | ||
192 | + cfg->s2cfg.tsz); | ||
193 | + goto bad_ste; | ||
194 | + } | ||
195 | + | ||
196 | + if (!s2_pgtable_config_valid(cfg->s2cfg.sl0, cfg->s2cfg.tsz, | ||
197 | + cfg->s2cfg.granule_sz)) { | ||
198 | + qemu_log_mask(LOG_GUEST_ERROR, | ||
199 | + "SMMUv3 STE stage 2 config not valid!\n"); | ||
200 | + goto bad_ste; | ||
201 | + } | ||
202 | + | ||
203 | + /* Only LE supported(IDR0.TTENDIAN). */ | ||
204 | + if (STE_S2ENDI(ste)) { | ||
205 | + qemu_log_mask(LOG_GUEST_ERROR, | ||
206 | + "SMMUv3 STE_S2ENDI only supports LE!\n"); | ||
207 | + goto bad_ste; | ||
208 | + } | ||
209 | + | ||
210 | + cfg->s2cfg.affd = STE_S2AFFD(ste); | ||
211 | + | ||
212 | + cfg->s2cfg.record_faults = STE_S2R(ste); | ||
213 | + /* As stall is not supported. */ | ||
214 | + if (STE_S2S(ste)) { | ||
215 | + qemu_log_mask(LOG_UNIMP, "SMMUv3 Stall not implemented!\n"); | ||
216 | + goto bad_ste; | ||
217 | + } | ||
218 | + | ||
219 | + /* This is still here as stage 2 has not been fully enabled yet. */ | ||
220 | + qemu_log_mask(LOG_UNIMP, "SMMUv3 does not support stage 2 yet\n"); | ||
221 | + goto bad_ste; | ||
222 | + | ||
223 | + return 0; | ||
224 | + | ||
225 | +bad_ste: | ||
226 | + return -EINVAL; | ||
227 | +} | ||
228 | + | ||
229 | /* Returns < 0 in case of invalid STE, 0 otherwise */ | ||
230 | static int decode_ste(SMMUv3State *s, SMMUTransCfg *cfg, | ||
231 | STE *ste, SMMUEventInfo *event) | ||
232 | { | ||
233 | uint32_t config; | ||
234 | + int ret; | ||
235 | |||
236 | if (!STE_VALID(ste)) { | ||
237 | if (!event->inval_ste_allowed) { | ||
238 | @@ -XXX,XX +XXX,XX @@ static int decode_ste(SMMUv3State *s, SMMUTransCfg *cfg, | ||
239 | return 0; | ||
31 | } | 240 | } |
32 | 241 | ||
33 | - if (opc == 1) { /* BFM, BXFIL */ | 242 | - if (STE_CFG_S2_ENABLED(config)) { |
34 | + if (opc == 1) { /* BFM, BFXIL */ | 243 | - qemu_log_mask(LOG_UNIMP, "SMMUv3 does not support stage 2 yet\n"); |
35 | tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_tmp, pos, len); | 244 | + /* |
36 | } else { | 245 | + * If a stage is enabled in SW while not advertised, throw bad ste |
37 | /* SBFM or UBFM: We start with zero, and we haven't modified | 246 | + * according to user manual(IHI0070E) "5.2 Stream Table Entry". |
247 | + */ | ||
248 | + if (!STAGE1_SUPPORTED(s) && STE_CFG_S1_ENABLED(config)) { | ||
249 | + qemu_log_mask(LOG_GUEST_ERROR, "SMMUv3 S1 used but not supported.\n"); | ||
250 | goto bad_ste; | ||
251 | } | ||
252 | + if (!STAGE2_SUPPORTED(s) && STE_CFG_S2_ENABLED(config)) { | ||
253 | + qemu_log_mask(LOG_GUEST_ERROR, "SMMUv3 S2 used but not supported.\n"); | ||
254 | + goto bad_ste; | ||
255 | + } | ||
256 | + | ||
257 | + if (STAGE2_SUPPORTED(s)) { | ||
258 | + /* VMID is considered even if s2 is disabled. */ | ||
259 | + cfg->s2cfg.vmid = STE_S2VMID(ste); | ||
260 | + } else { | ||
261 | + /* Default to -1 */ | ||
262 | + cfg->s2cfg.vmid = -1; | ||
263 | + } | ||
264 | + | ||
265 | + if (STE_CFG_S2_ENABLED(config)) { | ||
266 | + /* | ||
267 | + * Stage-1 OAS defaults to OAS even if not enabled as it would be used | ||
268 | + * in input address check for stage-2. | ||
269 | + */ | ||
270 | + cfg->oas = oas2bits(SMMU_IDR5_OAS); | ||
271 | + ret = decode_ste_s2_cfg(cfg, ste); | ||
272 | + if (ret) { | ||
273 | + goto bad_ste; | ||
274 | + } | ||
275 | + } | ||
276 | |||
277 | if (STE_S1CDMAX(ste) != 0) { | ||
278 | qemu_log_mask(LOG_UNIMP, | ||
279 | @@ -XXX,XX +XXX,XX @@ static IOMMUTLBEntry smmuv3_translate(IOMMUMemoryRegion *mr, hwaddr addr, | ||
280 | if (cached_entry) { | ||
281 | if ((flag & IOMMU_WO) && !(cached_entry->entry.perm & IOMMU_WO)) { | ||
282 | status = SMMU_TRANS_ERROR; | ||
283 | - if (cfg->record_faults) { | ||
284 | + /* | ||
285 | + * We know that the TLB only contains either stage-1 or stage-2 as | ||
286 | + * nesting is not supported. So it is sufficient to check the | ||
287 | + * translation stage to know the TLB stage for now. | ||
288 | + */ | ||
289 | + event.u.f_walk_eabt.s2 = (cfg->stage == 2); | ||
290 | + if (PTW_RECORD_FAULT(cfg)) { | ||
291 | event.type = SMMU_EVT_F_PERMISSION; | ||
292 | event.u.f_permission.addr = addr; | ||
293 | event.u.f_permission.rnw = flag & 0x1; | ||
294 | @@ -XXX,XX +XXX,XX @@ static IOMMUTLBEntry smmuv3_translate(IOMMUMemoryRegion *mr, hwaddr addr, | ||
295 | event.u.f_walk_eabt.addr2 = ptw_info.addr; | ||
296 | break; | ||
297 | case SMMU_PTW_ERR_TRANSLATION: | ||
298 | - if (cfg->record_faults) { | ||
299 | + if (PTW_RECORD_FAULT(cfg)) { | ||
300 | event.type = SMMU_EVT_F_TRANSLATION; | ||
301 | event.u.f_translation.addr = addr; | ||
302 | event.u.f_translation.rnw = flag & 0x1; | ||
303 | } | ||
304 | break; | ||
305 | case SMMU_PTW_ERR_ADDR_SIZE: | ||
306 | - if (cfg->record_faults) { | ||
307 | + if (PTW_RECORD_FAULT(cfg)) { | ||
308 | event.type = SMMU_EVT_F_ADDR_SIZE; | ||
309 | event.u.f_addr_size.addr = addr; | ||
310 | event.u.f_addr_size.rnw = flag & 0x1; | ||
311 | } | ||
312 | break; | ||
313 | case SMMU_PTW_ERR_ACCESS: | ||
314 | - if (cfg->record_faults) { | ||
315 | + if (PTW_RECORD_FAULT(cfg)) { | ||
316 | event.type = SMMU_EVT_F_ACCESS; | ||
317 | event.u.f_access.addr = addr; | ||
318 | event.u.f_access.rnw = flag & 0x1; | ||
319 | } | ||
320 | break; | ||
321 | case SMMU_PTW_ERR_PERMISSION: | ||
322 | - if (cfg->record_faults) { | ||
323 | + if (PTW_RECORD_FAULT(cfg)) { | ||
324 | event.type = SMMU_EVT_F_PERMISSION; | ||
325 | event.u.f_permission.addr = addr; | ||
326 | event.u.f_permission.rnw = flag & 0x1; | ||
38 | -- | 327 | -- |
39 | 2.20.1 | 328 | 2.34.1 |
40 | |||
41 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Mostafa Saleh <smostafa@google.com> | ||
1 | 2 | ||
3 | Right now, either stage-1 or stage-2 are supported, this simplifies | ||
4 | how we can deal with TLBs. | ||
5 | This patch makes TLB lookup work if stage-2 is enabled instead of | ||
6 | stage-1. | ||
7 | TLB lookup is done before a PTW, if a valid entry is found we won't | ||
8 | do the PTW. | ||
9 | To be able to do TLB lookup, we need the correct tagging info, as | ||
10 | granularity and input size, so we get this based on the supported | ||
11 | translation stage. The TLB entries are added correctly from each | ||
12 | stage PTW. | ||
13 | |||
14 | When nested translation is supported, this would need to change, for | ||
15 | example if we go with a combined TLB implementation, we would need to | ||
16 | use the min of the granularities in TLB. | ||
17 | |||
18 | As stage-2 shouldn't be tagged by ASID, it will be set to -1 if S1P | ||
19 | is not enabled. | ||
20 | |||
21 | Signed-off-by: Mostafa Saleh <smostafa@google.com> | ||
22 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
23 | Tested-by: Eric Auger <eric.auger@redhat.com> | ||
24 | Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
25 | Message-id: 20230516203327.2051088-7-smostafa@google.com | ||
26 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
27 | --- | ||
28 | hw/arm/smmuv3.c | 44 +++++++++++++++++++++++++++++++++----------- | ||
29 | 1 file changed, 33 insertions(+), 11 deletions(-) | ||
30 | |||
31 | diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c | ||
32 | index XXXXXXX..XXXXXXX 100644 | ||
33 | --- a/hw/arm/smmuv3.c | ||
34 | +++ b/hw/arm/smmuv3.c | ||
35 | @@ -XXX,XX +XXX,XX @@ static int smmuv3_decode_config(IOMMUMemoryRegion *mr, SMMUTransCfg *cfg, | ||
36 | STE ste; | ||
37 | CD cd; | ||
38 | |||
39 | + /* ASID defaults to -1 (if s1 is not supported). */ | ||
40 | + cfg->asid = -1; | ||
41 | + | ||
42 | ret = smmu_find_ste(s, sid, &ste, event); | ||
43 | if (ret) { | ||
44 | return ret; | ||
45 | @@ -XXX,XX +XXX,XX @@ static IOMMUTLBEntry smmuv3_translate(IOMMUMemoryRegion *mr, hwaddr addr, | ||
46 | .addr_mask = ~(hwaddr)0, | ||
47 | .perm = IOMMU_NONE, | ||
48 | }; | ||
49 | + /* | ||
50 | + * Combined attributes used for TLB lookup, as only one stage is supported, | ||
51 | + * it will hold attributes based on the enabled stage. | ||
52 | + */ | ||
53 | + SMMUTransTableInfo tt_combined; | ||
54 | |||
55 | qemu_mutex_lock(&s->mutex); | ||
56 | |||
57 | @@ -XXX,XX +XXX,XX @@ static IOMMUTLBEntry smmuv3_translate(IOMMUMemoryRegion *mr, hwaddr addr, | ||
58 | goto epilogue; | ||
59 | } | ||
60 | |||
61 | - tt = select_tt(cfg, addr); | ||
62 | - if (!tt) { | ||
63 | - if (cfg->record_faults) { | ||
64 | - event.type = SMMU_EVT_F_TRANSLATION; | ||
65 | - event.u.f_translation.addr = addr; | ||
66 | - event.u.f_translation.rnw = flag & 0x1; | ||
67 | + if (cfg->stage == 1) { | ||
68 | + /* Select stage1 translation table. */ | ||
69 | + tt = select_tt(cfg, addr); | ||
70 | + if (!tt) { | ||
71 | + if (cfg->record_faults) { | ||
72 | + event.type = SMMU_EVT_F_TRANSLATION; | ||
73 | + event.u.f_translation.addr = addr; | ||
74 | + event.u.f_translation.rnw = flag & 0x1; | ||
75 | + } | ||
76 | + status = SMMU_TRANS_ERROR; | ||
77 | + goto epilogue; | ||
78 | } | ||
79 | - status = SMMU_TRANS_ERROR; | ||
80 | - goto epilogue; | ||
81 | - } | ||
82 | + tt_combined.granule_sz = tt->granule_sz; | ||
83 | + tt_combined.tsz = tt->tsz; | ||
84 | |||
85 | - page_mask = (1ULL << (tt->granule_sz)) - 1; | ||
86 | + } else { | ||
87 | + /* Stage2. */ | ||
88 | + tt_combined.granule_sz = cfg->s2cfg.granule_sz; | ||
89 | + tt_combined.tsz = cfg->s2cfg.tsz; | ||
90 | + } | ||
91 | + /* | ||
92 | + * TLB lookup looks for granule and input size for a translation stage, | ||
93 | + * as only one stage is supported right now, choose the right values | ||
94 | + * from the configuration. | ||
95 | + */ | ||
96 | + page_mask = (1ULL << tt_combined.granule_sz) - 1; | ||
97 | aligned_addr = addr & ~page_mask; | ||
98 | |||
99 | - cached_entry = smmu_iotlb_lookup(bs, cfg, tt, aligned_addr); | ||
100 | + cached_entry = smmu_iotlb_lookup(bs, cfg, &tt_combined, aligned_addr); | ||
101 | if (cached_entry) { | ||
102 | if ((flag & IOMMU_WO) && !(cached_entry->entry.perm & IOMMU_WO)) { | ||
103 | status = SMMU_TRANS_ERROR; | ||
104 | -- | ||
105 | 2.34.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | 1 | From: Mostafa Saleh <smostafa@google.com> | |
2 | |||
3 | Allow TLB to be tagged with VMID. | ||
4 | |||
5 | If stage-1 is only supported, VMID is set to -1 and ignored from STE | ||
6 | and CMD_TLBI_NH* cmds. | ||
7 | |||
8 | Update smmu_iotlb_insert trace event to have vmid. | ||
9 | |||
10 | Signed-off-by: Mostafa Saleh <smostafa@google.com> | ||
11 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
12 | Tested-by: Eric Auger <eric.auger@redhat.com> | ||
13 | Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
14 | Message-id: 20230516203327.2051088-8-smostafa@google.com | ||
15 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
16 | --- | ||
17 | hw/arm/smmu-internal.h | 2 ++ | ||
18 | include/hw/arm/smmu-common.h | 5 +++-- | ||
19 | hw/arm/smmu-common.c | 36 ++++++++++++++++++++++-------------- | ||
20 | hw/arm/smmuv3.c | 12 +++++++++--- | ||
21 | hw/arm/trace-events | 6 +++--- | ||
22 | 5 files changed, 39 insertions(+), 22 deletions(-) | ||
23 | |||
24 | diff --git a/hw/arm/smmu-internal.h b/hw/arm/smmu-internal.h | ||
25 | index XXXXXXX..XXXXXXX 100644 | ||
26 | --- a/hw/arm/smmu-internal.h | ||
27 | +++ b/hw/arm/smmu-internal.h | ||
28 | @@ -XXX,XX +XXX,XX @@ static inline int pgd_concat_idx(int start_level, int granule_sz, | ||
29 | } | ||
30 | |||
31 | #define SMMU_IOTLB_ASID(key) ((key).asid) | ||
32 | +#define SMMU_IOTLB_VMID(key) ((key).vmid) | ||
33 | |||
34 | typedef struct SMMUIOTLBPageInvInfo { | ||
35 | int asid; | ||
36 | + int vmid; | ||
37 | uint64_t iova; | ||
38 | uint64_t mask; | ||
39 | } SMMUIOTLBPageInvInfo; | ||
40 | diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h | ||
41 | index XXXXXXX..XXXXXXX 100644 | ||
42 | --- a/include/hw/arm/smmu-common.h | ||
43 | +++ b/include/hw/arm/smmu-common.h | ||
44 | @@ -XXX,XX +XXX,XX @@ typedef struct SMMUPciBus { | ||
45 | typedef struct SMMUIOTLBKey { | ||
46 | uint64_t iova; | ||
47 | uint16_t asid; | ||
48 | + uint16_t vmid; | ||
49 | uint8_t tg; | ||
50 | uint8_t level; | ||
51 | } SMMUIOTLBKey; | ||
52 | @@ -XXX,XX +XXX,XX @@ IOMMUMemoryRegion *smmu_iommu_mr(SMMUState *s, uint32_t sid); | ||
53 | SMMUTLBEntry *smmu_iotlb_lookup(SMMUState *bs, SMMUTransCfg *cfg, | ||
54 | SMMUTransTableInfo *tt, hwaddr iova); | ||
55 | void smmu_iotlb_insert(SMMUState *bs, SMMUTransCfg *cfg, SMMUTLBEntry *entry); | ||
56 | -SMMUIOTLBKey smmu_get_iotlb_key(uint16_t asid, uint64_t iova, | ||
57 | +SMMUIOTLBKey smmu_get_iotlb_key(uint16_t asid, uint16_t vmid, uint64_t iova, | ||
58 | uint8_t tg, uint8_t level); | ||
59 | void smmu_iotlb_inv_all(SMMUState *s); | ||
60 | void smmu_iotlb_inv_asid(SMMUState *s, uint16_t asid); | ||
61 | -void smmu_iotlb_inv_iova(SMMUState *s, int asid, dma_addr_t iova, | ||
62 | +void smmu_iotlb_inv_iova(SMMUState *s, int asid, int vmid, dma_addr_t iova, | ||
63 | uint8_t tg, uint64_t num_pages, uint8_t ttl); | ||
64 | |||
65 | /* Unmap the range of all the notifiers registered to any IOMMU mr */ | ||
66 | diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c | ||
67 | index XXXXXXX..XXXXXXX 100644 | ||
68 | --- a/hw/arm/smmu-common.c | ||
69 | +++ b/hw/arm/smmu-common.c | ||
70 | @@ -XXX,XX +XXX,XX @@ static guint smmu_iotlb_key_hash(gconstpointer v) | ||
71 | |||
72 | /* Jenkins hash */ | ||
73 | a = b = c = JHASH_INITVAL + sizeof(*key); | ||
74 | - a += key->asid + key->level + key->tg; | ||
75 | + a += key->asid + key->vmid + key->level + key->tg; | ||
76 | b += extract64(key->iova, 0, 32); | ||
77 | c += extract64(key->iova, 32, 32); | ||
78 | |||
79 | @@ -XXX,XX +XXX,XX @@ static gboolean smmu_iotlb_key_equal(gconstpointer v1, gconstpointer v2) | ||
80 | SMMUIOTLBKey *k1 = (SMMUIOTLBKey *)v1, *k2 = (SMMUIOTLBKey *)v2; | ||
81 | |||
82 | return (k1->asid == k2->asid) && (k1->iova == k2->iova) && | ||
83 | - (k1->level == k2->level) && (k1->tg == k2->tg); | ||
84 | + (k1->level == k2->level) && (k1->tg == k2->tg) && | ||
85 | + (k1->vmid == k2->vmid); | ||
86 | } | ||
87 | |||
88 | -SMMUIOTLBKey smmu_get_iotlb_key(uint16_t asid, uint64_t iova, | ||
89 | +SMMUIOTLBKey smmu_get_iotlb_key(uint16_t asid, uint16_t vmid, uint64_t iova, | ||
90 | uint8_t tg, uint8_t level) | ||
91 | { | ||
92 | - SMMUIOTLBKey key = {.asid = asid, .iova = iova, .tg = tg, .level = level}; | ||
93 | + SMMUIOTLBKey key = {.asid = asid, .vmid = vmid, .iova = iova, | ||
94 | + .tg = tg, .level = level}; | ||
95 | |||
96 | return key; | ||
97 | } | ||
98 | @@ -XXX,XX +XXX,XX @@ SMMUTLBEntry *smmu_iotlb_lookup(SMMUState *bs, SMMUTransCfg *cfg, | ||
99 | uint64_t mask = subpage_size - 1; | ||
100 | SMMUIOTLBKey key; | ||
101 | |||
102 | - key = smmu_get_iotlb_key(cfg->asid, iova & ~mask, tg, level); | ||
103 | + key = smmu_get_iotlb_key(cfg->asid, cfg->s2cfg.vmid, | ||
104 | + iova & ~mask, tg, level); | ||
105 | entry = g_hash_table_lookup(bs->iotlb, &key); | ||
106 | if (entry) { | ||
107 | break; | ||
108 | @@ -XXX,XX +XXX,XX @@ SMMUTLBEntry *smmu_iotlb_lookup(SMMUState *bs, SMMUTransCfg *cfg, | ||
109 | |||
110 | if (entry) { | ||
111 | cfg->iotlb_hits++; | ||
112 | - trace_smmu_iotlb_lookup_hit(cfg->asid, iova, | ||
113 | + trace_smmu_iotlb_lookup_hit(cfg->asid, cfg->s2cfg.vmid, iova, | ||
114 | cfg->iotlb_hits, cfg->iotlb_misses, | ||
115 | 100 * cfg->iotlb_hits / | ||
116 | (cfg->iotlb_hits + cfg->iotlb_misses)); | ||
117 | } else { | ||
118 | cfg->iotlb_misses++; | ||
119 | - trace_smmu_iotlb_lookup_miss(cfg->asid, iova, | ||
120 | + trace_smmu_iotlb_lookup_miss(cfg->asid, cfg->s2cfg.vmid, iova, | ||
121 | cfg->iotlb_hits, cfg->iotlb_misses, | ||
122 | 100 * cfg->iotlb_hits / | ||
123 | (cfg->iotlb_hits + cfg->iotlb_misses)); | ||
124 | @@ -XXX,XX +XXX,XX @@ void smmu_iotlb_insert(SMMUState *bs, SMMUTransCfg *cfg, SMMUTLBEntry *new) | ||
125 | smmu_iotlb_inv_all(bs); | ||
126 | } | ||
127 | |||
128 | - *key = smmu_get_iotlb_key(cfg->asid, new->entry.iova, tg, new->level); | ||
129 | - trace_smmu_iotlb_insert(cfg->asid, new->entry.iova, tg, new->level); | ||
130 | + *key = smmu_get_iotlb_key(cfg->asid, cfg->s2cfg.vmid, new->entry.iova, | ||
131 | + tg, new->level); | ||
132 | + trace_smmu_iotlb_insert(cfg->asid, cfg->s2cfg.vmid, new->entry.iova, | ||
133 | + tg, new->level); | ||
134 | g_hash_table_insert(bs->iotlb, key, new); | ||
135 | } | ||
136 | |||
137 | @@ -XXX,XX +XXX,XX @@ static gboolean smmu_hash_remove_by_asid(gpointer key, gpointer value, | ||
138 | |||
139 | return SMMU_IOTLB_ASID(*iotlb_key) == asid; | ||
140 | } | ||
141 | - | ||
142 | -static gboolean smmu_hash_remove_by_asid_iova(gpointer key, gpointer value, | ||
143 | +static gboolean smmu_hash_remove_by_asid_vmid_iova(gpointer key, gpointer value, | ||
144 | gpointer user_data) | ||
145 | { | ||
146 | SMMUTLBEntry *iter = (SMMUTLBEntry *)value; | ||
147 | @@ -XXX,XX +XXX,XX @@ static gboolean smmu_hash_remove_by_asid_iova(gpointer key, gpointer value, | ||
148 | if (info->asid >= 0 && info->asid != SMMU_IOTLB_ASID(iotlb_key)) { | ||
149 | return false; | ||
150 | } | ||
151 | + if (info->vmid >= 0 && info->vmid != SMMU_IOTLB_VMID(iotlb_key)) { | ||
152 | + return false; | ||
153 | + } | ||
154 | return ((info->iova & ~entry->addr_mask) == entry->iova) || | ||
155 | ((entry->iova & ~info->mask) == info->iova); | ||
156 | } | ||
157 | |||
158 | -void smmu_iotlb_inv_iova(SMMUState *s, int asid, dma_addr_t iova, | ||
159 | +void smmu_iotlb_inv_iova(SMMUState *s, int asid, int vmid, dma_addr_t iova, | ||
160 | uint8_t tg, uint64_t num_pages, uint8_t ttl) | ||
161 | { | ||
162 | /* if tg is not set we use 4KB range invalidation */ | ||
163 | uint8_t granule = tg ? tg * 2 + 10 : 12; | ||
164 | |||
165 | if (ttl && (num_pages == 1) && (asid >= 0)) { | ||
166 | - SMMUIOTLBKey key = smmu_get_iotlb_key(asid, iova, tg, ttl); | ||
167 | + SMMUIOTLBKey key = smmu_get_iotlb_key(asid, vmid, iova, tg, ttl); | ||
168 | |||
169 | if (g_hash_table_remove(s->iotlb, &key)) { | ||
170 | return; | ||
171 | @@ -XXX,XX +XXX,XX @@ void smmu_iotlb_inv_iova(SMMUState *s, int asid, dma_addr_t iova, | ||
172 | |||
173 | SMMUIOTLBPageInvInfo info = { | ||
174 | .asid = asid, .iova = iova, | ||
175 | + .vmid = vmid, | ||
176 | .mask = (num_pages * 1 << granule) - 1}; | ||
177 | |||
178 | g_hash_table_foreach_remove(s->iotlb, | ||
179 | - smmu_hash_remove_by_asid_iova, | ||
180 | + smmu_hash_remove_by_asid_vmid_iova, | ||
181 | &info); | ||
182 | } | ||
183 | |||
184 | diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c | ||
185 | index XXXXXXX..XXXXXXX 100644 | ||
186 | --- a/hw/arm/smmuv3.c | ||
187 | +++ b/hw/arm/smmuv3.c | ||
188 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_s1_range_inval(SMMUState *s, Cmd *cmd) | ||
189 | { | ||
190 | dma_addr_t end, addr = CMD_ADDR(cmd); | ||
191 | uint8_t type = CMD_TYPE(cmd); | ||
192 | - uint16_t vmid = CMD_VMID(cmd); | ||
193 | + int vmid = -1; | ||
194 | uint8_t scale = CMD_SCALE(cmd); | ||
195 | uint8_t num = CMD_NUM(cmd); | ||
196 | uint8_t ttl = CMD_TTL(cmd); | ||
197 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_s1_range_inval(SMMUState *s, Cmd *cmd) | ||
198 | uint64_t num_pages; | ||
199 | uint8_t granule; | ||
200 | int asid = -1; | ||
201 | + SMMUv3State *smmuv3 = ARM_SMMUV3(s); | ||
202 | + | ||
203 | + /* Only consider VMID if stage-2 is supported. */ | ||
204 | + if (STAGE2_SUPPORTED(smmuv3)) { | ||
205 | + vmid = CMD_VMID(cmd); | ||
206 | + } | ||
207 | |||
208 | if (type == SMMU_CMD_TLBI_NH_VA) { | ||
209 | asid = CMD_ASID(cmd); | ||
210 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_s1_range_inval(SMMUState *s, Cmd *cmd) | ||
211 | if (!tg) { | ||
212 | trace_smmuv3_s1_range_inval(vmid, asid, addr, tg, 1, ttl, leaf); | ||
213 | smmuv3_inv_notifiers_iova(s, asid, addr, tg, 1); | ||
214 | - smmu_iotlb_inv_iova(s, asid, addr, tg, 1, ttl); | ||
215 | + smmu_iotlb_inv_iova(s, asid, vmid, addr, tg, 1, ttl); | ||
216 | return; | ||
217 | } | ||
218 | |||
219 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_s1_range_inval(SMMUState *s, Cmd *cmd) | ||
220 | num_pages = (mask + 1) >> granule; | ||
221 | trace_smmuv3_s1_range_inval(vmid, asid, addr, tg, num_pages, ttl, leaf); | ||
222 | smmuv3_inv_notifiers_iova(s, asid, addr, tg, num_pages); | ||
223 | - smmu_iotlb_inv_iova(s, asid, addr, tg, num_pages, ttl); | ||
224 | + smmu_iotlb_inv_iova(s, asid, vmid, addr, tg, num_pages, ttl); | ||
225 | addr += mask + 1; | ||
226 | } | ||
227 | } | ||
228 | diff --git a/hw/arm/trace-events b/hw/arm/trace-events | ||
229 | index XXXXXXX..XXXXXXX 100644 | ||
230 | --- a/hw/arm/trace-events | ||
231 | +++ b/hw/arm/trace-events | ||
232 | @@ -XXX,XX +XXX,XX @@ smmu_iotlb_inv_all(void) "IOTLB invalidate all" | ||
233 | smmu_iotlb_inv_asid(uint16_t asid) "IOTLB invalidate asid=%d" | ||
234 | smmu_iotlb_inv_iova(uint16_t asid, uint64_t addr) "IOTLB invalidate asid=%d addr=0x%"PRIx64 | ||
235 | smmu_inv_notifiers_mr(const char *name) "iommu mr=%s" | ||
236 | -smmu_iotlb_lookup_hit(uint16_t asid, uint64_t addr, uint32_t hit, uint32_t miss, uint32_t p) "IOTLB cache HIT asid=%d addr=0x%"PRIx64" hit=%d miss=%d hit rate=%d" | ||
237 | -smmu_iotlb_lookup_miss(uint16_t asid, uint64_t addr, uint32_t hit, uint32_t miss, uint32_t p) "IOTLB cache MISS asid=%d addr=0x%"PRIx64" hit=%d miss=%d hit rate=%d" | ||
238 | -smmu_iotlb_insert(uint16_t asid, uint64_t addr, uint8_t tg, uint8_t level) "IOTLB ++ asid=%d addr=0x%"PRIx64" tg=%d level=%d" | ||
239 | +smmu_iotlb_lookup_hit(uint16_t asid, uint16_t vmid, uint64_t addr, uint32_t hit, uint32_t miss, uint32_t p) "IOTLB cache HIT asid=%d vmid=%d addr=0x%"PRIx64" hit=%d miss=%d hit rate=%d" | ||
240 | +smmu_iotlb_lookup_miss(uint16_t asid, uint16_t vmid, uint64_t addr, uint32_t hit, uint32_t miss, uint32_t p) "IOTLB cache MISS asid=%d vmid=%d addr=0x%"PRIx64" hit=%d miss=%d hit rate=%d" | ||
241 | +smmu_iotlb_insert(uint16_t asid, uint16_t vmid, uint64_t addr, uint8_t tg, uint8_t level) "IOTLB ++ asid=%d vmid=%d addr=0x%"PRIx64" tg=%d level=%d" | ||
242 | |||
243 | # smmuv3.c | ||
244 | smmuv3_read_mmio(uint64_t addr, uint64_t val, unsigned size, uint32_t r) "addr: 0x%"PRIx64" val:0x%"PRIx64" size: 0x%x(%d)" | ||
245 | -- | ||
246 | 2.34.1 | diff view generated by jsdifflib |
1 | The ICC_CTLR_EL3 register includes some bits which are aliases | 1 | From: Mostafa Saleh <smostafa@google.com> |
---|---|---|---|
2 | of bits in the ICC_CTLR_EL1(S) and (NS) registers. QEMU chooses | 2 | |
3 | to keep those bits in the cs->icc_ctlr_el1[] struct fields. | 3 | CMD_TLBI_S2_IPA: As S1+S2 is not enabled, for now this can be the |
4 | Unfortunately a missing '~' in the code to update the bits | 4 | same as CMD_TLBI_NH_VAA. |
5 | in those fields meant that writing to ICC_CTLR_EL3 would corrupt | 5 | |
6 | the ICC_CLTR_EL1 register values. | 6 | CMD_TLBI_S12_VMALL: Added new function to invalidate TLB by VMID. |
7 | 7 | ||
8 | For stage-1 only commands, add a check to throw CERROR_ILL if used | ||
9 | when stage-1 is not supported. | ||
10 | |||
11 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
12 | Signed-off-by: Mostafa Saleh <smostafa@google.com> | ||
13 | Tested-by: Eric Auger <eric.auger@redhat.com> | ||
14 | Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
15 | Message-id: 20230516203327.2051088-9-smostafa@google.com | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 16 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
10 | Message-id: 20190520162809.2677-5-peter.maydell@linaro.org | ||
11 | --- | 17 | --- |
12 | hw/intc/arm_gicv3_cpuif.c | 4 ++-- | 18 | include/hw/arm/smmu-common.h | 1 + |
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | 19 | hw/arm/smmu-common.c | 16 +++++++++++ |
14 | 20 | hw/arm/smmuv3.c | 55 ++++++++++++++++++++++++++++++------ | |
15 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | 21 | hw/arm/trace-events | 4 ++- |
16 | index XXXXXXX..XXXXXXX 100644 | 22 | 4 files changed, 67 insertions(+), 9 deletions(-) |
17 | --- a/hw/intc/arm_gicv3_cpuif.c | 23 | |
18 | +++ b/hw/intc/arm_gicv3_cpuif.c | 24 | diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h |
19 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, | 25 | index XXXXXXX..XXXXXXX 100644 |
20 | trace_gicv3_icc_ctlr_el3_write(gicv3_redist_affid(cs), value); | 26 | --- a/include/hw/arm/smmu-common.h |
21 | 27 | +++ b/include/hw/arm/smmu-common.h | |
22 | /* *_EL1NS and *_EL1S bits are aliases into the ICC_CTLR_EL1 bits. */ | 28 | @@ -XXX,XX +XXX,XX @@ SMMUIOTLBKey smmu_get_iotlb_key(uint16_t asid, uint16_t vmid, uint64_t iova, |
23 | - cs->icc_ctlr_el1[GICV3_NS] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 29 | uint8_t tg, uint8_t level); |
24 | + cs->icc_ctlr_el1[GICV3_NS] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 30 | void smmu_iotlb_inv_all(SMMUState *s); |
25 | if (value & ICC_CTLR_EL3_EOIMODE_EL1NS) { | 31 | void smmu_iotlb_inv_asid(SMMUState *s, uint16_t asid); |
26 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_EOIMODE; | 32 | +void smmu_iotlb_inv_vmid(SMMUState *s, uint16_t vmid); |
33 | void smmu_iotlb_inv_iova(SMMUState *s, int asid, int vmid, dma_addr_t iova, | ||
34 | uint8_t tg, uint64_t num_pages, uint8_t ttl); | ||
35 | |||
36 | diff --git a/hw/arm/smmu-common.c b/hw/arm/smmu-common.c | ||
37 | index XXXXXXX..XXXXXXX 100644 | ||
38 | --- a/hw/arm/smmu-common.c | ||
39 | +++ b/hw/arm/smmu-common.c | ||
40 | @@ -XXX,XX +XXX,XX @@ static gboolean smmu_hash_remove_by_asid(gpointer key, gpointer value, | ||
41 | |||
42 | return SMMU_IOTLB_ASID(*iotlb_key) == asid; | ||
43 | } | ||
44 | + | ||
45 | +static gboolean smmu_hash_remove_by_vmid(gpointer key, gpointer value, | ||
46 | + gpointer user_data) | ||
47 | +{ | ||
48 | + uint16_t vmid = *(uint16_t *)user_data; | ||
49 | + SMMUIOTLBKey *iotlb_key = (SMMUIOTLBKey *)key; | ||
50 | + | ||
51 | + return SMMU_IOTLB_VMID(*iotlb_key) == vmid; | ||
52 | +} | ||
53 | + | ||
54 | static gboolean smmu_hash_remove_by_asid_vmid_iova(gpointer key, gpointer value, | ||
55 | gpointer user_data) | ||
56 | { | ||
57 | @@ -XXX,XX +XXX,XX @@ void smmu_iotlb_inv_asid(SMMUState *s, uint16_t asid) | ||
58 | g_hash_table_foreach_remove(s->iotlb, smmu_hash_remove_by_asid, &asid); | ||
59 | } | ||
60 | |||
61 | +inline void smmu_iotlb_inv_vmid(SMMUState *s, uint16_t vmid) | ||
62 | +{ | ||
63 | + trace_smmu_iotlb_inv_vmid(vmid); | ||
64 | + g_hash_table_foreach_remove(s->iotlb, smmu_hash_remove_by_vmid, &vmid); | ||
65 | +} | ||
66 | + | ||
67 | /* VMSAv8-64 Translation */ | ||
68 | |||
69 | /** | ||
70 | diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c | ||
71 | index XXXXXXX..XXXXXXX 100644 | ||
72 | --- a/hw/arm/smmuv3.c | ||
73 | +++ b/hw/arm/smmuv3.c | ||
74 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_inv_notifiers_iova(SMMUState *s, int asid, dma_addr_t iova, | ||
27 | } | 75 | } |
28 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, | 76 | } |
29 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_CBPR; | 77 | |
78 | -static void smmuv3_s1_range_inval(SMMUState *s, Cmd *cmd) | ||
79 | +static void smmuv3_range_inval(SMMUState *s, Cmd *cmd) | ||
80 | { | ||
81 | dma_addr_t end, addr = CMD_ADDR(cmd); | ||
82 | uint8_t type = CMD_TYPE(cmd); | ||
83 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_s1_range_inval(SMMUState *s, Cmd *cmd) | ||
30 | } | 84 | } |
31 | 85 | ||
32 | - cs->icc_ctlr_el1[GICV3_S] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 86 | if (!tg) { |
33 | + cs->icc_ctlr_el1[GICV3_S] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 87 | - trace_smmuv3_s1_range_inval(vmid, asid, addr, tg, 1, ttl, leaf); |
34 | if (value & ICC_CTLR_EL3_EOIMODE_EL1S) { | 88 | + trace_smmuv3_range_inval(vmid, asid, addr, tg, 1, ttl, leaf); |
35 | cs->icc_ctlr_el1[GICV3_S] |= ICC_CTLR_EL1_EOIMODE; | 89 | smmuv3_inv_notifiers_iova(s, asid, addr, tg, 1); |
36 | } | 90 | smmu_iotlb_inv_iova(s, asid, vmid, addr, tg, 1, ttl); |
91 | return; | ||
92 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_s1_range_inval(SMMUState *s, Cmd *cmd) | ||
93 | uint64_t mask = dma_aligned_pow2_mask(addr, end, 64); | ||
94 | |||
95 | num_pages = (mask + 1) >> granule; | ||
96 | - trace_smmuv3_s1_range_inval(vmid, asid, addr, tg, num_pages, ttl, leaf); | ||
97 | + trace_smmuv3_range_inval(vmid, asid, addr, tg, num_pages, ttl, leaf); | ||
98 | smmuv3_inv_notifiers_iova(s, asid, addr, tg, num_pages); | ||
99 | smmu_iotlb_inv_iova(s, asid, vmid, addr, tg, num_pages, ttl); | ||
100 | addr += mask + 1; | ||
101 | @@ -XXX,XX +XXX,XX @@ static int smmuv3_cmdq_consume(SMMUv3State *s) | ||
102 | { | ||
103 | uint16_t asid = CMD_ASID(&cmd); | ||
104 | |||
105 | + if (!STAGE1_SUPPORTED(s)) { | ||
106 | + cmd_error = SMMU_CERROR_ILL; | ||
107 | + break; | ||
108 | + } | ||
109 | + | ||
110 | trace_smmuv3_cmdq_tlbi_nh_asid(asid); | ||
111 | smmu_inv_notifiers_all(&s->smmu_state); | ||
112 | smmu_iotlb_inv_asid(bs, asid); | ||
113 | break; | ||
114 | } | ||
115 | case SMMU_CMD_TLBI_NH_ALL: | ||
116 | + if (!STAGE1_SUPPORTED(s)) { | ||
117 | + cmd_error = SMMU_CERROR_ILL; | ||
118 | + break; | ||
119 | + } | ||
120 | + QEMU_FALLTHROUGH; | ||
121 | case SMMU_CMD_TLBI_NSNH_ALL: | ||
122 | trace_smmuv3_cmdq_tlbi_nh(); | ||
123 | smmu_inv_notifiers_all(&s->smmu_state); | ||
124 | @@ -XXX,XX +XXX,XX @@ static int smmuv3_cmdq_consume(SMMUv3State *s) | ||
125 | break; | ||
126 | case SMMU_CMD_TLBI_NH_VAA: | ||
127 | case SMMU_CMD_TLBI_NH_VA: | ||
128 | - smmuv3_s1_range_inval(bs, &cmd); | ||
129 | + if (!STAGE1_SUPPORTED(s)) { | ||
130 | + cmd_error = SMMU_CERROR_ILL; | ||
131 | + break; | ||
132 | + } | ||
133 | + smmuv3_range_inval(bs, &cmd); | ||
134 | + break; | ||
135 | + case SMMU_CMD_TLBI_S12_VMALL: | ||
136 | + { | ||
137 | + uint16_t vmid = CMD_VMID(&cmd); | ||
138 | + | ||
139 | + if (!STAGE2_SUPPORTED(s)) { | ||
140 | + cmd_error = SMMU_CERROR_ILL; | ||
141 | + break; | ||
142 | + } | ||
143 | + | ||
144 | + trace_smmuv3_cmdq_tlbi_s12_vmid(vmid); | ||
145 | + smmu_inv_notifiers_all(&s->smmu_state); | ||
146 | + smmu_iotlb_inv_vmid(bs, vmid); | ||
147 | + break; | ||
148 | + } | ||
149 | + case SMMU_CMD_TLBI_S2_IPA: | ||
150 | + if (!STAGE2_SUPPORTED(s)) { | ||
151 | + cmd_error = SMMU_CERROR_ILL; | ||
152 | + break; | ||
153 | + } | ||
154 | + /* | ||
155 | + * As currently only either s1 or s2 are supported | ||
156 | + * we can reuse same function for s2. | ||
157 | + */ | ||
158 | + smmuv3_range_inval(bs, &cmd); | ||
159 | break; | ||
160 | case SMMU_CMD_TLBI_EL3_ALL: | ||
161 | case SMMU_CMD_TLBI_EL3_VA: | ||
162 | @@ -XXX,XX +XXX,XX @@ static int smmuv3_cmdq_consume(SMMUv3State *s) | ||
163 | case SMMU_CMD_TLBI_EL2_ASID: | ||
164 | case SMMU_CMD_TLBI_EL2_VA: | ||
165 | case SMMU_CMD_TLBI_EL2_VAA: | ||
166 | - case SMMU_CMD_TLBI_S12_VMALL: | ||
167 | - case SMMU_CMD_TLBI_S2_IPA: | ||
168 | case SMMU_CMD_ATC_INV: | ||
169 | case SMMU_CMD_PRI_RESP: | ||
170 | case SMMU_CMD_RESUME: | ||
171 | @@ -XXX,XX +XXX,XX @@ static int smmuv3_cmdq_consume(SMMUv3State *s) | ||
172 | break; | ||
173 | default: | ||
174 | cmd_error = SMMU_CERROR_ILL; | ||
175 | - qemu_log_mask(LOG_GUEST_ERROR, | ||
176 | - "Illegal command type: %d\n", CMD_TYPE(&cmd)); | ||
177 | break; | ||
178 | } | ||
179 | qemu_mutex_unlock(&s->mutex); | ||
180 | if (cmd_error) { | ||
181 | + if (cmd_error == SMMU_CERROR_ILL) { | ||
182 | + qemu_log_mask(LOG_GUEST_ERROR, | ||
183 | + "Illegal command type: %d\n", CMD_TYPE(&cmd)); | ||
184 | + } | ||
185 | break; | ||
186 | } | ||
187 | /* | ||
188 | diff --git a/hw/arm/trace-events b/hw/arm/trace-events | ||
189 | index XXXXXXX..XXXXXXX 100644 | ||
190 | --- a/hw/arm/trace-events | ||
191 | +++ b/hw/arm/trace-events | ||
192 | @@ -XXX,XX +XXX,XX @@ smmu_ptw_block_pte(int stage, int level, uint64_t baseaddr, uint64_t pteaddr, ui | ||
193 | smmu_get_pte(uint64_t baseaddr, int index, uint64_t pteaddr, uint64_t pte) "baseaddr=0x%"PRIx64" index=0x%x, pteaddr=0x%"PRIx64", pte=0x%"PRIx64 | ||
194 | smmu_iotlb_inv_all(void) "IOTLB invalidate all" | ||
195 | smmu_iotlb_inv_asid(uint16_t asid) "IOTLB invalidate asid=%d" | ||
196 | +smmu_iotlb_inv_vmid(uint16_t vmid) "IOTLB invalidate vmid=%d" | ||
197 | smmu_iotlb_inv_iova(uint16_t asid, uint64_t addr) "IOTLB invalidate asid=%d addr=0x%"PRIx64 | ||
198 | smmu_inv_notifiers_mr(const char *name) "iommu mr=%s" | ||
199 | smmu_iotlb_lookup_hit(uint16_t asid, uint16_t vmid, uint64_t addr, uint32_t hit, uint32_t miss, uint32_t p) "IOTLB cache HIT asid=%d vmid=%d addr=0x%"PRIx64" hit=%d miss=%d hit rate=%d" | ||
200 | @@ -XXX,XX +XXX,XX @@ smmuv3_cmdq_cfgi_ste_range(int start, int end) "start=0x%x - end=0x%x" | ||
201 | smmuv3_cmdq_cfgi_cd(uint32_t sid) "sid=0x%x" | ||
202 | smmuv3_config_cache_hit(uint32_t sid, uint32_t hits, uint32_t misses, uint32_t perc) "Config cache HIT for sid=0x%x (hits=%d, misses=%d, hit rate=%d)" | ||
203 | smmuv3_config_cache_miss(uint32_t sid, uint32_t hits, uint32_t misses, uint32_t perc) "Config cache MISS for sid=0x%x (hits=%d, misses=%d, hit rate=%d)" | ||
204 | -smmuv3_s1_range_inval(int vmid, int asid, uint64_t addr, uint8_t tg, uint64_t num_pages, uint8_t ttl, bool leaf) "vmid=%d asid=%d addr=0x%"PRIx64" tg=%d num_pages=0x%"PRIx64" ttl=%d leaf=%d" | ||
205 | +smmuv3_range_inval(int vmid, int asid, uint64_t addr, uint8_t tg, uint64_t num_pages, uint8_t ttl, bool leaf) "vmid=%d asid=%d addr=0x%"PRIx64" tg=%d num_pages=0x%"PRIx64" ttl=%d leaf=%d" | ||
206 | smmuv3_cmdq_tlbi_nh(void) "" | ||
207 | smmuv3_cmdq_tlbi_nh_asid(uint16_t asid) "asid=%d" | ||
208 | +smmuv3_cmdq_tlbi_s12_vmid(uint16_t vmid) "vmid=%d" | ||
209 | smmuv3_config_cache_inv(uint32_t sid) "Config cache INV for sid=0x%x" | ||
210 | smmuv3_notify_flag_add(const char *iommu) "ADD SMMUNotifier node for iommu mr=%s" | ||
211 | smmuv3_notify_flag_del(const char *iommu) "DEL SMMUNotifier node for iommu mr=%s" | ||
37 | -- | 212 | -- |
38 | 2.20.1 | 213 | 2.34.1 |
39 | |||
40 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Mostafa Saleh <smostafa@google.com> |
---|---|---|---|
2 | 2 | ||
3 | This is, after all, how we implement extract2 in tcg/aarch64. | 3 | In smmuv3_notify_iova, read the granule based on translation stage |
4 | and use VMID if valid value is sent. | ||
4 | 5 | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Mostafa Saleh <smostafa@google.com> |
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 7 | Reviewed-by: Eric Auger <eric.auger@redhat.com> |
7 | Message-id: 20190514011129.11330-2-richard.henderson@linaro.org | 8 | Tested-by: Eric Auger <eric.auger@redhat.com> |
9 | Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
10 | Message-id: 20230516203327.2051088-10-smostafa@google.com | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 12 | --- |
10 | target/arm/translate-a64.c | 38 ++++++++++++++++++++------------------ | 13 | hw/arm/smmuv3.c | 39 ++++++++++++++++++++++++++------------- |
11 | 1 file changed, 20 insertions(+), 18 deletions(-) | 14 | hw/arm/trace-events | 2 +- |
15 | 2 files changed, 27 insertions(+), 14 deletions(-) | ||
12 | 16 | ||
13 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 17 | diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c |
14 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/target/arm/translate-a64.c | 19 | --- a/hw/arm/smmuv3.c |
16 | +++ b/target/arm/translate-a64.c | 20 | +++ b/hw/arm/smmuv3.c |
17 | @@ -XXX,XX +XXX,XX @@ static void disas_extract(DisasContext *s, uint32_t insn) | 21 | @@ -XXX,XX +XXX,XX @@ epilogue: |
18 | } else { | 22 | * @mr: IOMMU mr region handle |
19 | tcg_gen_ext32u_i64(tcg_rd, cpu_reg(s, rm)); | 23 | * @n: notifier to be called |
20 | } | 24 | * @asid: address space ID or negative value if we don't care |
21 | - } else if (rm == rn) { /* ROR */ | 25 | + * @vmid: virtual machine ID or negative value if we don't care |
22 | - tcg_rm = cpu_reg(s, rm); | 26 | * @iova: iova |
23 | - if (sf) { | 27 | * @tg: translation granule (if communicated through range invalidation) |
24 | - tcg_gen_rotri_i64(tcg_rd, tcg_rm, imm); | 28 | * @num_pages: number of @granule sized pages (if tg != 0), otherwise 1 |
25 | - } else { | 29 | */ |
26 | - TCGv_i32 tmp = tcg_temp_new_i32(); | 30 | static void smmuv3_notify_iova(IOMMUMemoryRegion *mr, |
27 | - tcg_gen_extrl_i64_i32(tmp, tcg_rm); | 31 | IOMMUNotifier *n, |
28 | - tcg_gen_rotri_i32(tmp, tmp, imm); | 32 | - int asid, dma_addr_t iova, |
29 | - tcg_gen_extu_i32_i64(tcg_rd, tmp); | 33 | - uint8_t tg, uint64_t num_pages) |
30 | - tcg_temp_free_i32(tmp); | 34 | + int asid, int vmid, |
31 | - } | 35 | + dma_addr_t iova, uint8_t tg, |
32 | } else { | 36 | + uint64_t num_pages) |
33 | - tcg_rm = read_cpu_reg(s, rm, sf); | 37 | { |
34 | - tcg_rn = read_cpu_reg(s, rn, sf); | 38 | SMMUDevice *sdev = container_of(mr, SMMUDevice, iommu); |
35 | - tcg_gen_shri_i64(tcg_rm, tcg_rm, imm); | 39 | IOMMUTLBEvent event; |
36 | - tcg_gen_shli_i64(tcg_rn, tcg_rn, bitsize - imm); | 40 | uint8_t granule; |
37 | - tcg_gen_or_i64(tcg_rd, tcg_rm, tcg_rn); | 41 | + SMMUv3State *s = sdev->smmu; |
38 | - if (!sf) { | 42 | |
39 | - tcg_gen_ext32u_i64(tcg_rd, tcg_rd); | 43 | if (!tg) { |
40 | + tcg_rm = cpu_reg(s, rm); | 44 | SMMUEventInfo event = {.inval_ste_allowed = true}; |
41 | + tcg_rn = cpu_reg(s, rn); | 45 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_notify_iova(IOMMUMemoryRegion *mr, |
46 | return; | ||
47 | } | ||
48 | |||
49 | - tt = select_tt(cfg, iova); | ||
50 | - if (!tt) { | ||
51 | + if (vmid >= 0 && cfg->s2cfg.vmid != vmid) { | ||
52 | return; | ||
53 | } | ||
54 | - granule = tt->granule_sz; | ||
42 | + | 55 | + |
43 | + if (sf) { | 56 | + if (STAGE1_SUPPORTED(s)) { |
44 | + /* Specialization to ROR happens in EXTRACT2. */ | 57 | + tt = select_tt(cfg, iova); |
45 | + tcg_gen_extract2_i64(tcg_rd, tcg_rm, tcg_rn, imm); | 58 | + if (!tt) { |
46 | + } else { | 59 | + return; |
47 | + TCGv_i32 t0 = tcg_temp_new_i32(); | 60 | + } |
61 | + granule = tt->granule_sz; | ||
62 | + } else { | ||
63 | + granule = cfg->s2cfg.granule_sz; | ||
64 | + } | ||
48 | + | 65 | + |
49 | + tcg_gen_extrl_i64_i32(t0, tcg_rm); | 66 | } else { |
50 | + if (rm == rn) { | 67 | granule = tg * 2 + 10; |
51 | + tcg_gen_rotri_i32(t0, t0, imm); | 68 | } |
52 | + } else { | 69 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_notify_iova(IOMMUMemoryRegion *mr, |
53 | + TCGv_i32 t1 = tcg_temp_new_i32(); | 70 | memory_region_notify_iommu_one(n, &event); |
54 | + tcg_gen_extrl_i64_i32(t1, tcg_rn); | 71 | } |
55 | + tcg_gen_extract2_i32(t0, t0, t1, imm); | 72 | |
56 | + tcg_temp_free_i32(t1); | 73 | -/* invalidate an asid/iova range tuple in all mr's */ |
57 | + } | 74 | -static void smmuv3_inv_notifiers_iova(SMMUState *s, int asid, dma_addr_t iova, |
58 | + tcg_gen_extu_i32_i64(tcg_rd, t0); | 75 | - uint8_t tg, uint64_t num_pages) |
59 | + tcg_temp_free_i32(t0); | 76 | +/* invalidate an asid/vmid/iova range tuple in all mr's */ |
60 | } | 77 | +static void smmuv3_inv_notifiers_iova(SMMUState *s, int asid, int vmid, |
78 | + dma_addr_t iova, uint8_t tg, | ||
79 | + uint64_t num_pages) | ||
80 | { | ||
81 | SMMUDevice *sdev; | ||
82 | |||
83 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_inv_notifiers_iova(SMMUState *s, int asid, dma_addr_t iova, | ||
84 | IOMMUMemoryRegion *mr = &sdev->iommu; | ||
85 | IOMMUNotifier *n; | ||
86 | |||
87 | - trace_smmuv3_inv_notifiers_iova(mr->parent_obj.name, asid, iova, | ||
88 | - tg, num_pages); | ||
89 | + trace_smmuv3_inv_notifiers_iova(mr->parent_obj.name, asid, vmid, | ||
90 | + iova, tg, num_pages); | ||
91 | |||
92 | IOMMU_NOTIFIER_FOREACH(n, mr) { | ||
93 | - smmuv3_notify_iova(mr, n, asid, iova, tg, num_pages); | ||
94 | + smmuv3_notify_iova(mr, n, asid, vmid, iova, tg, num_pages); | ||
61 | } | 95 | } |
62 | } | 96 | } |
97 | } | ||
98 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_range_inval(SMMUState *s, Cmd *cmd) | ||
99 | |||
100 | if (!tg) { | ||
101 | trace_smmuv3_range_inval(vmid, asid, addr, tg, 1, ttl, leaf); | ||
102 | - smmuv3_inv_notifiers_iova(s, asid, addr, tg, 1); | ||
103 | + smmuv3_inv_notifiers_iova(s, asid, vmid, addr, tg, 1); | ||
104 | smmu_iotlb_inv_iova(s, asid, vmid, addr, tg, 1, ttl); | ||
105 | return; | ||
106 | } | ||
107 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_range_inval(SMMUState *s, Cmd *cmd) | ||
108 | |||
109 | num_pages = (mask + 1) >> granule; | ||
110 | trace_smmuv3_range_inval(vmid, asid, addr, tg, num_pages, ttl, leaf); | ||
111 | - smmuv3_inv_notifiers_iova(s, asid, addr, tg, num_pages); | ||
112 | + smmuv3_inv_notifiers_iova(s, asid, vmid, addr, tg, num_pages); | ||
113 | smmu_iotlb_inv_iova(s, asid, vmid, addr, tg, num_pages, ttl); | ||
114 | addr += mask + 1; | ||
115 | } | ||
116 | diff --git a/hw/arm/trace-events b/hw/arm/trace-events | ||
117 | index XXXXXXX..XXXXXXX 100644 | ||
118 | --- a/hw/arm/trace-events | ||
119 | +++ b/hw/arm/trace-events | ||
120 | @@ -XXX,XX +XXX,XX @@ smmuv3_cmdq_tlbi_s12_vmid(uint16_t vmid) "vmid=%d" | ||
121 | smmuv3_config_cache_inv(uint32_t sid) "Config cache INV for sid=0x%x" | ||
122 | smmuv3_notify_flag_add(const char *iommu) "ADD SMMUNotifier node for iommu mr=%s" | ||
123 | smmuv3_notify_flag_del(const char *iommu) "DEL SMMUNotifier node for iommu mr=%s" | ||
124 | -smmuv3_inv_notifiers_iova(const char *name, uint16_t asid, uint64_t iova, uint8_t tg, uint64_t num_pages) "iommu mr=%s asid=%d iova=0x%"PRIx64" tg=%d num_pages=0x%"PRIx64 | ||
125 | +smmuv3_inv_notifiers_iova(const char *name, uint16_t asid, uint16_t vmid, uint64_t iova, uint8_t tg, uint64_t num_pages) "iommu mr=%s asid=%d vmid=%d iova=0x%"PRIx64" tg=%d num_pages=0x%"PRIx64 | ||
126 | |||
63 | -- | 127 | -- |
64 | 2.20.1 | 128 | 2.34.1 |
65 | |||
66 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Mostafa Saleh <smostafa@google.com> |
---|---|---|---|
2 | 2 | ||
3 | It eases code review, unit is explicit. | 3 | As everything is in place, we can use a new system property to |
4 | advertise which stage is supported and remove bad_ste from STE | ||
5 | stage2 config. | ||
4 | 6 | ||
5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 7 | The property added arm-smmuv3.stage can have 3 values: |
6 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 8 | - "1": Stage-1 only is advertised. |
7 | Message-id: 20190520214342.13709-3-philmd@redhat.com | 9 | - "2": Stage-2 only is advertised. |
10 | |||
11 | If not passed or an unsupported value is passed, it will default to | ||
12 | stage-1. | ||
13 | |||
14 | Advertise VMID16. | ||
15 | |||
16 | Don't try to decode CD, if stage-2 is configured. | ||
17 | |||
18 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
19 | Signed-off-by: Mostafa Saleh <smostafa@google.com> | ||
20 | Tested-by: Eric Auger <eric.auger@redhat.com> | ||
21 | Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org> | ||
22 | Message-id: 20230516203327.2051088-11-smostafa@google.com | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 23 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 24 | --- |
10 | hw/arm/exynos4_boards.c | 5 +++-- | 25 | include/hw/arm/smmuv3.h | 1 + |
11 | 1 file changed, 3 insertions(+), 2 deletions(-) | 26 | hw/arm/smmuv3.c | 32 ++++++++++++++++++++++---------- |
27 | 2 files changed, 23 insertions(+), 10 deletions(-) | ||
12 | 28 | ||
13 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 29 | diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h |
14 | index XXXXXXX..XXXXXXX 100644 | 30 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/hw/arm/exynos4_boards.c | 31 | --- a/include/hw/arm/smmuv3.h |
16 | +++ b/hw/arm/exynos4_boards.c | 32 | +++ b/include/hw/arm/smmuv3.h |
33 | @@ -XXX,XX +XXX,XX @@ struct SMMUv3State { | ||
34 | |||
35 | qemu_irq irq[4]; | ||
36 | QemuMutex mutex; | ||
37 | + char *stage; | ||
38 | }; | ||
39 | |||
40 | typedef enum { | ||
41 | diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c | ||
42 | index XXXXXXX..XXXXXXX 100644 | ||
43 | --- a/hw/arm/smmuv3.c | ||
44 | +++ b/hw/arm/smmuv3.c | ||
17 | @@ -XXX,XX +XXX,XX @@ | 45 | @@ -XXX,XX +XXX,XX @@ |
18 | */ | 46 | #include "hw/irq.h" |
19 | 47 | #include "hw/sysbus.h" | |
20 | #include "qemu/osdep.h" | 48 | #include "migration/vmstate.h" |
21 | +#include "qemu/units.h" | 49 | +#include "hw/qdev-properties.h" |
22 | #include "qapi/error.h" | 50 | #include "hw/qdev-core.h" |
23 | #include "qemu/error-report.h" | 51 | #include "hw/pci/pci.h" |
24 | #include "qemu-common.h" | 52 | #include "cpu.h" |
25 | @@ -XXX,XX +XXX,XX @@ static int exynos4_board_smp_bootreg_addr[EXYNOS4_NUM_OF_BOARDS] = { | 53 | @@ -XXX,XX +XXX,XX @@ void smmuv3_record_event(SMMUv3State *s, SMMUEventInfo *info) |
54 | |||
55 | static void smmuv3_init_regs(SMMUv3State *s) | ||
56 | { | ||
57 | - /** | ||
58 | - * IDR0: stage1 only, AArch64 only, coherent access, 16b ASID, | ||
59 | - * multi-level stream table | ||
60 | - */ | ||
61 | - s->idr[0] = FIELD_DP32(s->idr[0], IDR0, S1P, 1); /* stage 1 supported */ | ||
62 | + /* Based on sys property, the stages supported in smmu will be advertised.*/ | ||
63 | + if (s->stage && !strcmp("2", s->stage)) { | ||
64 | + s->idr[0] = FIELD_DP32(s->idr[0], IDR0, S2P, 1); | ||
65 | + } else { | ||
66 | + s->idr[0] = FIELD_DP32(s->idr[0], IDR0, S1P, 1); | ||
67 | + } | ||
68 | + | ||
69 | s->idr[0] = FIELD_DP32(s->idr[0], IDR0, TTF, 2); /* AArch64 PTW only */ | ||
70 | s->idr[0] = FIELD_DP32(s->idr[0], IDR0, COHACC, 1); /* IO coherent */ | ||
71 | s->idr[0] = FIELD_DP32(s->idr[0], IDR0, ASID16, 1); /* 16-bit ASID */ | ||
72 | + s->idr[0] = FIELD_DP32(s->idr[0], IDR0, VMID16, 1); /* 16-bit VMID */ | ||
73 | s->idr[0] = FIELD_DP32(s->idr[0], IDR0, TTENDIAN, 2); /* little endian */ | ||
74 | s->idr[0] = FIELD_DP32(s->idr[0], IDR0, STALL_MODEL, 1); /* No stall */ | ||
75 | /* terminated transaction will always be aborted/error returned */ | ||
76 | @@ -XXX,XX +XXX,XX @@ static int decode_ste_s2_cfg(SMMUTransCfg *cfg, STE *ste) | ||
77 | goto bad_ste; | ||
78 | } | ||
79 | |||
80 | - /* This is still here as stage 2 has not been fully enabled yet. */ | ||
81 | - qemu_log_mask(LOG_UNIMP, "SMMUv3 does not support stage 2 yet\n"); | ||
82 | - goto bad_ste; | ||
83 | - | ||
84 | return 0; | ||
85 | |||
86 | bad_ste: | ||
87 | @@ -XXX,XX +XXX,XX @@ static int smmuv3_decode_config(IOMMUMemoryRegion *mr, SMMUTransCfg *cfg, | ||
88 | return ret; | ||
89 | } | ||
90 | |||
91 | - if (cfg->aborted || cfg->bypassed) { | ||
92 | + if (cfg->aborted || cfg->bypassed || (cfg->stage == 2)) { | ||
93 | return 0; | ||
94 | } | ||
95 | |||
96 | @@ -XXX,XX +XXX,XX @@ static const VMStateDescription vmstate_smmuv3 = { | ||
97 | } | ||
26 | }; | 98 | }; |
27 | 99 | ||
28 | static unsigned long exynos4_board_ram_size[EXYNOS4_NUM_OF_BOARDS] = { | 100 | +static Property smmuv3_properties[] = { |
29 | - [EXYNOS4_BOARD_NURI] = 0x40000000, | 101 | + /* |
30 | - [EXYNOS4_BOARD_SMDKC210] = 0x40000000, | 102 | + * Stages of translation advertised. |
31 | + [EXYNOS4_BOARD_NURI] = 1 * GiB, | 103 | + * "1": Stage 1 |
32 | + [EXYNOS4_BOARD_SMDKC210] = 1 * GiB, | 104 | + * "2": Stage 2 |
33 | }; | 105 | + * Defaults to stage 1 |
34 | 106 | + */ | |
35 | static struct arm_boot_info exynos4_board_binfo = { | 107 | + DEFINE_PROP_STRING("stage", SMMUv3State, stage), |
108 | + DEFINE_PROP_END_OF_LIST() | ||
109 | +}; | ||
110 | + | ||
111 | static void smmuv3_instance_init(Object *obj) | ||
112 | { | ||
113 | /* Nothing much to do here as of now */ | ||
114 | @@ -XXX,XX +XXX,XX @@ static void smmuv3_class_init(ObjectClass *klass, void *data) | ||
115 | &c->parent_phases); | ||
116 | c->parent_realize = dc->realize; | ||
117 | dc->realize = smmu_realize; | ||
118 | + device_class_set_props(dc, smmuv3_properties); | ||
119 | } | ||
120 | |||
121 | static int smmuv3_notify_flag_changed(IOMMUMemoryRegion *iommu, | ||
36 | -- | 122 | -- |
37 | 2.20.1 | 123 | 2.34.1 |
38 | |||
39 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Tommy Wu <tommy.wu@sifive.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 3 | When we receive a packet from the xilinx_axienet and then try to s2mem |
4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 4 | through the xilinx_axidma, if the descriptor ring buffer is full in the |
5 | Message-id: 20190520214342.13709-5-philmd@redhat.com | 5 | xilinx axidma driver, we’ll assert the DMASR.HALTED in the |
6 | function : stream_process_s2mem and return 0. In the end, we’ll be stuck in | ||
7 | an infinite loop in axienet_eth_rx_notify. | ||
8 | |||
9 | This patch checks the DMASR.HALTED state when we try to push data | ||
10 | from xilinx axi-enet to xilinx axi-dma. When the DMASR.HALTED is asserted, | ||
11 | we will not keep pushing the data and then prevent the infinte loop. | ||
12 | |||
13 | Signed-off-by: Tommy Wu <tommy.wu@sifive.com> | ||
14 | Reviewed-by: Edgar E. Iglesias <edgar@zeroasic.com> | ||
15 | Reviewed-by: Frank Chang <frank.chang@sifive.com> | ||
16 | Message-id: 20230519062137.1251741-1-tommy.wu@sifive.com | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 17 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 18 | --- |
8 | include/hw/arm/exynos4210.h | 9 +++++++-- | 19 | hw/dma/xilinx_axidma.c | 11 ++++++++--- |
9 | hw/arm/exynos4210.c | 28 ++++++++++++++++++++++++---- | 20 | 1 file changed, 8 insertions(+), 3 deletions(-) |
10 | hw/arm/exynos4_boards.c | 9 ++++++--- | ||
11 | 3 files changed, 37 insertions(+), 9 deletions(-) | ||
12 | 21 | ||
13 | diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h | 22 | diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c |
14 | index XXXXXXX..XXXXXXX 100644 | 23 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/include/hw/arm/exynos4210.h | 24 | --- a/hw/dma/xilinx_axidma.c |
16 | +++ b/include/hw/arm/exynos4210.h | 25 | +++ b/hw/dma/xilinx_axidma.c |
17 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210Irq { | 26 | @@ -XXX,XX +XXX,XX @@ static inline int stream_idle(struct Stream *s) |
18 | } Exynos4210Irq; | 27 | return !!(s->regs[R_DMASR] & DMASR_IDLE); |
19 | |||
20 | typedef struct Exynos4210State { | ||
21 | + /*< private >*/ | ||
22 | + SysBusDevice parent_obj; | ||
23 | + /*< public >*/ | ||
24 | ARMCPU *cpu[EXYNOS4210_NCPUS]; | ||
25 | Exynos4210Irq irqs; | ||
26 | qemu_irq *irq_table; | ||
27 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210State { | ||
28 | I2CBus *i2c_if[EXYNOS4210_I2C_NUMBER]; | ||
29 | } Exynos4210State; | ||
30 | |||
31 | +#define TYPE_EXYNOS4210_SOC "exynos4210" | ||
32 | +#define EXYNOS4210_SOC(obj) \ | ||
33 | + OBJECT_CHECK(Exynos4210State, obj, TYPE_EXYNOS4210_SOC) | ||
34 | + | ||
35 | void exynos4210_write_secondary(ARMCPU *cpu, | ||
36 | const struct arm_boot_info *info); | ||
37 | |||
38 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem); | ||
39 | - | ||
40 | /* Initialize exynos4210 IRQ subsystem stub */ | ||
41 | qemu_irq *exynos4210_init_irq(Exynos4210Irq *env); | ||
42 | |||
43 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | ||
44 | index XXXXXXX..XXXXXXX 100644 | ||
45 | --- a/hw/arm/exynos4210.c | ||
46 | +++ b/hw/arm/exynos4210.c | ||
47 | @@ -XXX,XX +XXX,XX @@ static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | ||
48 | sysbus_connect_irq(busdev, 0, irq); | ||
49 | } | 28 | } |
50 | 29 | ||
51 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | 30 | +static inline int stream_halted(struct Stream *s) |
52 | +static void exynos4210_realize(DeviceState *socdev, Error **errp) | ||
53 | { | ||
54 | - Exynos4210State *s = g_new0(Exynos4210State, 1); | ||
55 | + Exynos4210State *s = EXYNOS4210_SOC(socdev); | ||
56 | + MemoryRegion *system_mem = get_system_memory(); | ||
57 | qemu_irq gate_irq[EXYNOS4210_NCPUS][EXYNOS4210_IRQ_GATE_NINPUTS]; | ||
58 | SysBusDevice *busdev; | ||
59 | DeviceState *dev; | ||
60 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | ||
61 | qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); | ||
62 | pl330_create(EXYNOS4210_PL330_BASE2_ADDR, | ||
63 | qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); | ||
64 | - | ||
65 | - return s; | ||
66 | } | ||
67 | + | ||
68 | +static void exynos4210_class_init(ObjectClass *klass, void *data) | ||
69 | +{ | 31 | +{ |
70 | + DeviceClass *dc = DEVICE_CLASS(klass); | 32 | + return !!(s->regs[R_DMASR] & DMASR_HALTED); |
71 | + | ||
72 | + dc->realize = exynos4210_realize; | ||
73 | +} | 33 | +} |
74 | + | 34 | + |
75 | +static const TypeInfo exynos4210_info = { | 35 | static void stream_reset(struct Stream *s) |
76 | + .name = TYPE_EXYNOS4210_SOC, | 36 | { |
77 | + .parent = TYPE_SYS_BUS_DEVICE, | 37 | s->regs[R_DMASR] = DMASR_HALTED; /* starts up halted. */ |
78 | + .instance_size = sizeof(Exynos4210State), | 38 | @@ -XXX,XX +XXX,XX @@ static void stream_process_mem2s(struct Stream *s, StreamSink *tx_data_dev, |
79 | + .class_init = exynos4210_class_init, | 39 | uint64_t addr; |
80 | +}; | 40 | bool eop; |
81 | + | 41 | |
82 | +static void exynos4210_register_types(void) | 42 | - if (!stream_running(s) || stream_idle(s)) { |
83 | +{ | 43 | + if (!stream_running(s) || stream_idle(s) || stream_halted(s)) { |
84 | + type_register_static(&exynos4210_info); | 44 | return; |
85 | +} | 45 | } |
86 | + | 46 | |
87 | +type_init(exynos4210_register_types) | 47 | @@ -XXX,XX +XXX,XX @@ static size_t stream_process_s2mem(struct Stream *s, unsigned char *buf, |
88 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 48 | unsigned int rxlen; |
89 | index XXXXXXX..XXXXXXX 100644 | 49 | size_t pos = 0; |
90 | --- a/hw/arm/exynos4_boards.c | 50 | |
91 | +++ b/hw/arm/exynos4_boards.c | 51 | - if (!stream_running(s) || stream_idle(s)) { |
92 | @@ -XXX,XX +XXX,XX @@ typedef enum Exynos4BoardType { | 52 | + if (!stream_running(s) || stream_idle(s) || stream_halted(s)) { |
93 | } Exynos4BoardType; | 53 | return 0; |
94 | 54 | } | |
95 | typedef struct Exynos4BoardState { | 55 | |
96 | - Exynos4210State *soc; | 56 | @@ -XXX,XX +XXX,XX @@ xilinx_axidma_data_stream_can_push(StreamSink *obj, |
97 | + Exynos4210State soc; | 57 | XilinxAXIDMAStreamSink *ds = XILINX_AXI_DMA_DATA_STREAM(obj); |
98 | MemoryRegion dram0_mem; | 58 | struct Stream *s = &ds->dma->streams[1]; |
99 | MemoryRegion dram1_mem; | 59 | |
100 | } Exynos4BoardState; | 60 | - if (!stream_running(s) || stream_idle(s)) { |
101 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | 61 | + if (!stream_running(s) || stream_idle(s) || stream_halted(s)) { |
102 | exynos4_boards_init_ram(s, get_system_memory(), | 62 | ds->dma->notify = notify; |
103 | exynos4_board_ram_size[board_type]); | 63 | ds->dma->notify_opaque = notify_opaque; |
104 | 64 | return false; | |
105 | - s->soc = exynos4210_init(get_system_memory()); | ||
106 | + object_initialize(&s->soc, sizeof(s->soc), TYPE_EXYNOS4210_SOC); | ||
107 | + qdev_set_parent_bus(DEVICE(&s->soc), sysbus_get_default()); | ||
108 | + object_property_set_bool(OBJECT(&s->soc), true, "realized", | ||
109 | + &error_fatal); | ||
110 | |||
111 | return s; | ||
112 | } | ||
113 | @@ -XXX,XX +XXX,XX @@ static void smdkc210_init(MachineState *machine) | ||
114 | EXYNOS4_BOARD_SMDKC210); | ||
115 | |||
116 | lan9215_init(SMDK_LAN9118_BASE_ADDR, | ||
117 | - qemu_irq_invert(s->soc->irq_table[exynos4210_get_irq(37, 1)])); | ||
118 | + qemu_irq_invert(s->soc.irq_table[exynos4210_get_irq(37, 1)])); | ||
119 | arm_load_kernel(ARM_CPU(first_cpu), &exynos4_board_binfo); | ||
120 | } | ||
121 | |||
122 | -- | 65 | -- |
123 | 2.20.1 | 66 | 2.34.1 |
124 | 67 | ||
125 | 68 | diff view generated by jsdifflib |
1 | In ich_vmcr_write() we enforce "writes of BPR fields to less than | 1 | From: Clément Chigot <chigot@adacore.com> |
---|---|---|---|
2 | their minimum sets them to the minimum" by doing a "read vbpr and | ||
3 | write it back" operation. A typo here meant that we weren't handling | ||
4 | writes to these fields correctly, because we were reading from VBPR0 | ||
5 | but writing to VBPR1. | ||
6 | 2 | ||
3 | When passing --smp with a number lower than XLNX_ZYNQMP_NUM_APU_CPUS, | ||
4 | the expression (ms->smp.cpus - XLNX_ZYNQMP_NUM_APU_CPUS) will result | ||
5 | in a positive number as ms->smp.cpus is a unsigned int. | ||
6 | This will raise the following error afterwards, as Qemu will try to | ||
7 | instantiate some additional RPUs. | ||
8 | | $ qemu-system-aarch64 --smp 1 -M xlnx-zcu102 | ||
9 | | ** | ||
10 | | ERROR:../src/tcg/tcg.c:777:tcg_register_thread: | ||
11 | | assertion failed: (n < tcg_max_ctxs) | ||
12 | |||
13 | Signed-off-by: Clément Chigot <chigot@adacore.com> | ||
14 | Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com> | ||
15 | Tested-by: Francisco Iglesias <frasse.iglesias@gmail.com> | ||
16 | Message-id: 20230524143714.565792-1-chigot@adacore.com | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 17 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20190520162809.2677-4-peter.maydell@linaro.org | ||
10 | --- | 18 | --- |
11 | hw/intc/arm_gicv3_cpuif.c | 2 +- | 19 | hw/arm/xlnx-zynqmp.c | 2 +- |
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | 20 | 1 file changed, 1 insertion(+), 1 deletion(-) |
13 | 21 | ||
14 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | 22 | diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c |
15 | index XXXXXXX..XXXXXXX 100644 | 23 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/hw/intc/arm_gicv3_cpuif.c | 24 | --- a/hw/arm/xlnx-zynqmp.c |
17 | +++ b/hw/intc/arm_gicv3_cpuif.c | 25 | +++ b/hw/arm/xlnx-zynqmp.c |
18 | @@ -XXX,XX +XXX,XX @@ static void ich_vmcr_write(CPUARMState *env, const ARMCPRegInfo *ri, | 26 | @@ -XXX,XX +XXX,XX @@ static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s, |
19 | /* Enforce "writing BPRs to less than minimum sets them to the minimum" | 27 | const char *boot_cpu, Error **errp) |
20 | * by reading and writing back the fields. | 28 | { |
21 | */ | 29 | int i; |
22 | - write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G0)); | 30 | - int num_rpus = MIN(ms->smp.cpus - XLNX_ZYNQMP_NUM_APU_CPUS, |
23 | + write_vbpr(cs, GICV3_G0, read_vbpr(cs, GICV3_G0)); | 31 | + int num_rpus = MIN((int)(ms->smp.cpus - XLNX_ZYNQMP_NUM_APU_CPUS), |
24 | write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G1)); | 32 | XLNX_ZYNQMP_NUM_RPU_CPUS); |
25 | 33 | ||
26 | gicv3_cpuif_virt_update(cs); | 34 | if (num_rpus <= 0) { |
27 | -- | 35 | -- |
28 | 2.20.1 | 36 | 2.34.1 |
29 | 37 | ||
30 | 38 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Thomas Huth <thuth@redhat.com> | ||
1 | 2 | ||
3 | pflash-cfi02-test.c always uses the "musicpal" machine for testing, | ||
4 | test-arm-mptimer.c always uses the "vexpress-a9" machine, and | ||
5 | microbit-test.c requires the "microbit" machine, so we should only | ||
6 | run these tests if the machines have been enabled in the configuration. | ||
7 | |||
8 | Signed-off-by: Thomas Huth <thuth@redhat.com> | ||
9 | Reviewed-by: Fabiano Rosas <farosas@suse.de> | ||
10 | Message-id: 20230524080600.1618137-1-thuth@redhat.com | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | --- | ||
13 | tests/qtest/meson.build | 7 ++++--- | ||
14 | 1 file changed, 4 insertions(+), 3 deletions(-) | ||
15 | |||
16 | diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/tests/qtest/meson.build | ||
19 | +++ b/tests/qtest/meson.build | ||
20 | @@ -XXX,XX +XXX,XX @@ qtests_arm = \ | ||
21 | (config_all_devices.has_key('CONFIG_CMSDK_APB_DUALTIMER') ? ['cmsdk-apb-dualtimer-test'] : []) + \ | ||
22 | (config_all_devices.has_key('CONFIG_CMSDK_APB_TIMER') ? ['cmsdk-apb-timer-test'] : []) + \ | ||
23 | (config_all_devices.has_key('CONFIG_CMSDK_APB_WATCHDOG') ? ['cmsdk-apb-watchdog-test'] : []) + \ | ||
24 | - (config_all_devices.has_key('CONFIG_PFLASH_CFI02') ? ['pflash-cfi02-test'] : []) + \ | ||
25 | + (config_all_devices.has_key('CONFIG_PFLASH_CFI02') and | ||
26 | + config_all_devices.has_key('CONFIG_MUSICPAL') ? ['pflash-cfi02-test'] : []) + \ | ||
27 | (config_all_devices.has_key('CONFIG_ASPEED_SOC') ? qtests_aspeed : []) + \ | ||
28 | (config_all_devices.has_key('CONFIG_NPCM7XX') ? qtests_npcm7xx : []) + \ | ||
29 | (config_all_devices.has_key('CONFIG_GENERIC_LOADER') ? ['hexloader-test'] : []) + \ | ||
30 | (config_all_devices.has_key('CONFIG_TPM_TIS_I2C') ? ['tpm-tis-i2c-test'] : []) + \ | ||
31 | + (config_all_devices.has_key('CONFIG_VEXPRESS') ? ['test-arm-mptimer'] : []) + \ | ||
32 | + (config_all_devices.has_key('CONFIG_MICROBIT') ? ['microbit-test'] : []) + \ | ||
33 | ['arm-cpu-features', | ||
34 | - 'microbit-test', | ||
35 | - 'test-arm-mptimer', | ||
36 | 'boot-serial-test'] | ||
37 | |||
38 | # TODO: once aarch64 TCG is fixed on ARM 32 bit host, make bios-tables-test unconditional | ||
39 | -- | ||
40 | 2.34.1 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | For M-profile, there is no guest-facing A-profile format FSR, but we | ||
2 | still use the env->exception.fsr field to pass fault information from | ||
3 | the point where a fault is raised to the code in | ||
4 | arm_v7m_cpu_do_interrupt() which interprets it and sets the M-profile | ||
5 | specific fault status registers. So it doesn't matter whether we | ||
6 | fill in env->exception.fsr in the short format or the LPAE format, as | ||
7 | long as both sides agree. As it happens arm_v7m_cpu_do_interrupt() | ||
8 | assumes short-form. | ||
1 | 9 | ||
10 | In compute_fsr_fsc() we weren't explicitly choosing short-form for | ||
11 | M-profile, but instead relied on it falling out in the wash because | ||
12 | arm_s1_regime_using_lpae_format() would be false. This was broken in | ||
13 | commit 452c67a4 when we added v8R support, because we said "PMSAv8 is | ||
14 | always LPAE format" (as it is for v8R), forgetting that we were | ||
15 | implicitly using this code path on M-profile. At that point we would | ||
16 | hit a g_assert_not_reached(): | ||
17 | ERROR:../../target/arm/internals.h:549:arm_fi_to_lfsc: code should not be reached | ||
18 | |||
19 | #7 0x0000555555e055f7 in arm_fi_to_lfsc (fi=0x7fffecff9a90) at ../../target/arm/internals.h:549 | ||
20 | #8 0x0000555555e05a27 in compute_fsr_fsc (env=0x555557356670, fi=0x7fffecff9a90, target_el=1, mmu_idx=1, ret_fsc=0x7fffecff9a1c) | ||
21 | at ../../target/arm/tlb_helper.c:95 | ||
22 | #9 0x0000555555e05b62 in arm_deliver_fault (cpu=0x555557354800, addr=268961344, access_type=MMU_INST_FETCH, mmu_idx=1, fi=0x7fffecff9a90) | ||
23 | at ../../target/arm/tlb_helper.c:132 | ||
24 | #10 0x0000555555e06095 in arm_cpu_tlb_fill (cs=0x555557354800, address=268961344, size=1, access_type=MMU_INST_FETCH, mmu_idx=1, probe=false, retaddr=0) | ||
25 | at ../../target/arm/tlb_helper.c:260 | ||
26 | |||
27 | The specific assertion changed when commit fcc7404eff24b4c added | ||
28 | "assert not M-profile" to arm_is_secure_below_el3(), because the | ||
29 | conditions being checked in compute_fsr_fsc() include | ||
30 | arm_el_is_aa64(), which will end up calling arm_is_secure_below_el3() | ||
31 | and asserting before we try to call arm_fi_to_lfsc(): | ||
32 | |||
33 | #7 0x0000555555efaf43 in arm_is_secure_below_el3 (env=0x5555574665a0) at ../../target/arm/cpu.h:2396 | ||
34 | #8 0x0000555555efb103 in arm_is_el2_enabled (env=0x5555574665a0) at ../../target/arm/cpu.h:2448 | ||
35 | #9 0x0000555555efb204 in arm_el_is_aa64 (env=0x5555574665a0, el=1) at ../../target/arm/cpu.h:2509 | ||
36 | #10 0x0000555555efbdfd in compute_fsr_fsc (env=0x5555574665a0, fi=0x7fffecff99e0, target_el=1, mmu_idx=1, ret_fsc=0x7fffecff996c) | ||
37 | |||
38 | Avoid the assertion and the incorrect FSR format selection by | ||
39 | explicitly making M-profile use the short-format in this function. | ||
40 | |||
41 | Fixes: 452c67a42704 ("target/arm: Enable TTBCR_EAE for ARMv8-R AArch32")a | ||
42 | Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1658 | ||
43 | Cc: qemu-stable@nongnu.org | ||
44 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
45 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
46 | Message-id: 20230523131726.866635-1-peter.maydell@linaro.org | ||
47 | --- | ||
48 | target/arm/tcg/tlb_helper.c | 13 +++++++++++-- | ||
49 | 1 file changed, 11 insertions(+), 2 deletions(-) | ||
50 | |||
51 | diff --git a/target/arm/tcg/tlb_helper.c b/target/arm/tcg/tlb_helper.c | ||
52 | index XXXXXXX..XXXXXXX 100644 | ||
53 | --- a/target/arm/tcg/tlb_helper.c | ||
54 | +++ b/target/arm/tcg/tlb_helper.c | ||
55 | @@ -XXX,XX +XXX,XX @@ static uint32_t compute_fsr_fsc(CPUARMState *env, ARMMMUFaultInfo *fi, | ||
56 | ARMMMUIdx arm_mmu_idx = core_to_arm_mmu_idx(env, mmu_idx); | ||
57 | uint32_t fsr, fsc; | ||
58 | |||
59 | - if (target_el == 2 || arm_el_is_aa64(env, target_el) || | ||
60 | - arm_s1_regime_using_lpae_format(env, arm_mmu_idx)) { | ||
61 | + /* | ||
62 | + * For M-profile there is no guest-facing FSR. We compute a | ||
63 | + * short-form value for env->exception.fsr which we will then | ||
64 | + * examine in arm_v7m_cpu_do_interrupt(). In theory we could | ||
65 | + * use the LPAE format instead as long as both bits of code agree | ||
66 | + * (and arm_fi_to_lfsc() handled the M-profile specific | ||
67 | + * ARMFault_QEMU_NSCExec and ARMFault_QEMU_SFault cases). | ||
68 | + */ | ||
69 | + if (!arm_feature(env, ARM_FEATURE_M) && | ||
70 | + (target_el == 2 || arm_el_is_aa64(env, target_el) || | ||
71 | + arm_s1_regime_using_lpae_format(env, arm_mmu_idx))) { | ||
72 | /* | ||
73 | * LPAE format fault status register : bottom 6 bits are | ||
74 | * status code in the same form as needed for syndrome | ||
75 | -- | ||
76 | 2.34.1 | diff view generated by jsdifflib |
1 | The system_clock_scale global is used only by the armv7m systick | 1 | From: Fabiano Rosas <farosas@suse.de> |
---|---|---|---|
2 | device; move the extern declaration to the armv7m_systick.h header, | ||
3 | and expand the comment to explain what it is and that it should | ||
4 | ideally be replaced with a different approach. | ||
5 | 2 | ||
3 | We currently need to select ARM_V7M unconditionally when TCG is | ||
4 | present in the build because some translate.c helpers and the whole of | ||
5 | m_helpers.c are not yet under CONFIG_ARM_V7M. | ||
6 | |||
7 | Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
8 | Signed-off-by: Fabiano Rosas <farosas@suse.de> | ||
9 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
10 | Message-id: 20230523180525.29994-2-farosas@suse.de | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20190516163857.6430-2-peter.maydell@linaro.org | ||
10 | --- | 12 | --- |
11 | include/hw/arm/arm.h | 4 ---- | 13 | target/arm/Kconfig | 3 +++ |
12 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++++++++ | 14 | 1 file changed, 3 insertions(+) |
13 | 2 files changed, 22 insertions(+), 4 deletions(-) | ||
14 | 15 | ||
15 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h | 16 | diff --git a/target/arm/Kconfig b/target/arm/Kconfig |
16 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/include/hw/arm/arm.h | 18 | --- a/target/arm/Kconfig |
18 | +++ b/include/hw/arm/arm.h | 19 | +++ b/target/arm/Kconfig |
19 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, | 20 | @@ -XXX,XX +XXX,XX @@ |
20 | const struct arm_boot_info *info, | 21 | config ARM |
21 | hwaddr mvbar_addr); | 22 | bool |
22 | 23 | select ARM_COMPATIBLE_SEMIHOSTING if TCG | |
23 | -/* Multiplication factor to convert from system clock ticks to qemu timer | ||
24 | - ticks. */ | ||
25 | -extern int system_clock_scale; | ||
26 | - | ||
27 | #endif /* HW_ARM_H */ | ||
28 | diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_systick.h | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/include/hw/timer/armv7m_systick.h | ||
31 | +++ b/include/hw/timer/armv7m_systick.h | ||
32 | @@ -XXX,XX +XXX,XX @@ typedef struct SysTickState { | ||
33 | qemu_irq irq; | ||
34 | } SysTickState; | ||
35 | |||
36 | +/* | ||
37 | + * Multiplication factor to convert from system clock ticks to qemu timer | ||
38 | + * ticks. This should be set (by board code, usually) to a value | ||
39 | + * equal to NANOSECONDS_PER_SECOND / frq, where frq is the clock frequency | ||
40 | + * in Hz of the CPU. | ||
41 | + * | ||
42 | + * This value is used by the systick device when it is running in | ||
43 | + * its "use the CPU clock" mode (ie when SYST_CSR.CLKSOURCE == 1) to | ||
44 | + * set how fast the timer should tick. | ||
45 | + * | ||
46 | + * TODO: we should refactor this so that rather than using a global | ||
47 | + * we use a device property or something similar. This is complicated | ||
48 | + * because (a) the property would need to be plumbed through from the | ||
49 | + * board code down through various layers to the systick device | ||
50 | + * and (b) the property needs to be modifiable after realize, because | ||
51 | + * the stellaris board uses this to implement the behaviour where the | ||
52 | + * guest can reprogram the PLL registers to downclock the CPU, and the | ||
53 | + * systick device needs to react accordingly. Possibly this should | ||
54 | + * be deferred until we have a good API for modelling clock trees. | ||
55 | + */ | ||
56 | +extern int system_clock_scale; | ||
57 | + | 24 | + |
58 | #endif | 25 | + # We need to select this until we move m_helper.c and the |
26 | + # translate.c v7m helpers under ARM_V7M. | ||
27 | select ARM_V7M if TCG | ||
28 | |||
29 | config AARCH64 | ||
59 | -- | 30 | -- |
60 | 2.20.1 | 31 | 2.34.1 |
61 | 32 | ||
62 | 33 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Fabiano Rosas <farosas@suse.de> | ||
1 | 2 | ||
3 | When we moved the arm default CONFIGs into Kconfig and removed them | ||
4 | from default.mak, we made it harder to identify which CONFIGs are | ||
5 | selected by default in case users want to disable them. | ||
6 | |||
7 | Bring back the default entries into default.mak, but keep them | ||
8 | commented out. This way users can keep their workflows of editing | ||
9 | default.mak to remove build options without needing to search through | ||
10 | Kconfig. | ||
11 | |||
12 | Reported-by: Thomas Huth <thuth@redhat.com> | ||
13 | Signed-off-by: Fabiano Rosas <farosas@suse.de> | ||
14 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
15 | Message-id: 20230523180525.29994-3-farosas@suse.de | ||
16 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
17 | --- | ||
18 | configs/devices/aarch64-softmmu/default.mak | 6 ++++ | ||
19 | configs/devices/arm-softmmu/default.mak | 40 +++++++++++++++++++++ | ||
20 | 2 files changed, 46 insertions(+) | ||
21 | |||
22 | diff --git a/configs/devices/aarch64-softmmu/default.mak b/configs/devices/aarch64-softmmu/default.mak | ||
23 | index XXXXXXX..XXXXXXX 100644 | ||
24 | --- a/configs/devices/aarch64-softmmu/default.mak | ||
25 | +++ b/configs/devices/aarch64-softmmu/default.mak | ||
26 | @@ -XXX,XX +XXX,XX @@ | ||
27 | |||
28 | # We support all the 32 bit boards so need all their config | ||
29 | include ../arm-softmmu/default.mak | ||
30 | + | ||
31 | +# These are selected by default when TCG is enabled, uncomment them to | ||
32 | +# keep out of the build. | ||
33 | +# CONFIG_XLNX_ZYNQMP_ARM=n | ||
34 | +# CONFIG_XLNX_VERSAL=n | ||
35 | +# CONFIG_SBSA_REF=n | ||
36 | diff --git a/configs/devices/arm-softmmu/default.mak b/configs/devices/arm-softmmu/default.mak | ||
37 | index XXXXXXX..XXXXXXX 100644 | ||
38 | --- a/configs/devices/arm-softmmu/default.mak | ||
39 | +++ b/configs/devices/arm-softmmu/default.mak | ||
40 | @@ -XXX,XX +XXX,XX @@ | ||
41 | # CONFIG_TEST_DEVICES=n | ||
42 | |||
43 | CONFIG_ARM_VIRT=y | ||
44 | + | ||
45 | +# These are selected by default when TCG is enabled, uncomment them to | ||
46 | +# keep out of the build. | ||
47 | +# CONFIG_CUBIEBOARD=n | ||
48 | +# CONFIG_EXYNOS4=n | ||
49 | +# CONFIG_HIGHBANK=n | ||
50 | +# CONFIG_INTEGRATOR=n | ||
51 | +# CONFIG_FSL_IMX31=n | ||
52 | +# CONFIG_MUSICPAL=n | ||
53 | +# CONFIG_MUSCA=n | ||
54 | +# CONFIG_CHEETAH=n | ||
55 | +# CONFIG_SX1=n | ||
56 | +# CONFIG_NSERIES=n | ||
57 | +# CONFIG_STELLARIS=n | ||
58 | +# CONFIG_STM32VLDISCOVERY=n | ||
59 | +# CONFIG_REALVIEW=n | ||
60 | +# CONFIG_VERSATILE=n | ||
61 | +# CONFIG_VEXPRESS=n | ||
62 | +# CONFIG_ZYNQ=n | ||
63 | +# CONFIG_MAINSTONE=n | ||
64 | +# CONFIG_GUMSTIX=n | ||
65 | +# CONFIG_SPITZ=n | ||
66 | +# CONFIG_TOSA=n | ||
67 | +# CONFIG_Z2=n | ||
68 | +# CONFIG_NPCM7XX=n | ||
69 | +# CONFIG_COLLIE=n | ||
70 | +# CONFIG_ASPEED_SOC=n | ||
71 | +# CONFIG_NETDUINO2=n | ||
72 | +# CONFIG_NETDUINOPLUS2=n | ||
73 | +# CONFIG_OLIMEX_STM32_H405=n | ||
74 | +# CONFIG_MPS2=n | ||
75 | +# CONFIG_RASPI=n | ||
76 | +# CONFIG_DIGIC=n | ||
77 | +# CONFIG_SABRELITE=n | ||
78 | +# CONFIG_EMCRAFT_SF2=n | ||
79 | +# CONFIG_MICROBIT=n | ||
80 | +# CONFIG_FSL_IMX25=n | ||
81 | +# CONFIG_FSL_IMX7=n | ||
82 | +# CONFIG_FSL_IMX6UL=n | ||
83 | +# CONFIG_ALLWINNER_H3=n | ||
84 | -- | ||
85 | 2.34.1 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Fabiano Rosas <farosas@suse.de> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 3 | Replace the 'default y if TCG' pattern with 'default y; depends on |
4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 4 | TCG'. |
5 | Message-id: 20190520214342.13709-2-philmd@redhat.com | 5 | |
6 | That makes explict that there is a dependence on TCG and enabling | ||
7 | these CONFIGs via .mak files without TCG present will fail earlier. | ||
8 | |||
9 | Suggested-by: Paolo Bonzini <pbonzini@redhat.com> | ||
10 | Signed-off-by: Fabiano Rosas <farosas@suse.de> | ||
11 | Reviewed-by: Thomas Huth <thuth@redhat.com> | ||
12 | Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> | ||
13 | Message-id: 20230523180525.29994-4-farosas@suse.de | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 15 | --- |
8 | hw/arm/exynos4_boards.c | 24 ------------------------ | 16 | hw/arm/Kconfig | 123 ++++++++++++++++++++++++++++++++----------------- |
9 | 1 file changed, 24 deletions(-) | 17 | 1 file changed, 82 insertions(+), 41 deletions(-) |
10 | 18 | ||
11 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 19 | diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig |
12 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/hw/arm/exynos4_boards.c | 21 | --- a/hw/arm/Kconfig |
14 | +++ b/hw/arm/exynos4_boards.c | 22 | +++ b/hw/arm/Kconfig |
15 | @@ -XXX,XX +XXX,XX @@ | 23 | @@ -XXX,XX +XXX,XX @@ config ARM_VIRT |
16 | #include "hw/net/lan9118.h" | 24 | |
17 | #include "hw/boards.h" | 25 | config CHEETAH |
18 | 26 | bool | |
19 | -#undef DEBUG | 27 | - default y if TCG && ARM |
20 | - | 28 | + default y |
21 | -//#define DEBUG | 29 | + depends on TCG && ARM |
22 | - | 30 | select OMAP |
23 | -#ifdef DEBUG | 31 | select TSC210X |
24 | - #undef PRINT_DEBUG | 32 | |
25 | - #define PRINT_DEBUG(fmt, args...) \ | 33 | config CUBIEBOARD |
26 | - do { \ | 34 | bool |
27 | - fprintf(stderr, " [%s:%d] "fmt, __func__, __LINE__, ##args); \ | 35 | - default y if TCG && ARM |
28 | - } while (0) | 36 | + default y |
29 | -#else | 37 | + depends on TCG && ARM |
30 | - #define PRINT_DEBUG(fmt, args...) do {} while (0) | 38 | select ALLWINNER_A10 |
31 | -#endif | 39 | |
32 | - | 40 | config DIGIC |
33 | #define SMDK_LAN9118_BASE_ADDR 0x05000000 | 41 | bool |
34 | 42 | - default y if TCG && ARM | |
35 | typedef enum Exynos4BoardType { | 43 | + default y |
36 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | 44 | + depends on TCG && ARM |
37 | exynos4_board_binfo.gic_cpu_if_addr = | 45 | select PTIMER |
38 | EXYNOS4210_SMP_PRIVATE_BASE_ADDR + 0x100; | 46 | select PFLASH_CFI02 |
39 | 47 | ||
40 | - PRINT_DEBUG("\n ram_size: %luMiB [0x%08lx]\n" | 48 | config EXYNOS4 |
41 | - " kernel_filename: %s\n" | 49 | bool |
42 | - " kernel_cmdline: %s\n" | 50 | - default y if TCG && ARM |
43 | - " initrd_filename: %s\n", | 51 | + default y |
44 | - exynos4_board_ram_size[board_type] / 1048576, | 52 | + depends on TCG && ARM |
45 | - exynos4_board_ram_size[board_type], | 53 | imply I2C_DEVICES |
46 | - machine->kernel_filename, | 54 | select A9MPCORE |
47 | - machine->kernel_cmdline, | 55 | select I2C |
48 | - machine->initrd_filename); | 56 | @@ -XXX,XX +XXX,XX @@ config EXYNOS4 |
49 | - | 57 | |
50 | exynos4_boards_init_ram(s, get_system_memory(), | 58 | config HIGHBANK |
51 | exynos4_board_ram_size[board_type]); | 59 | bool |
60 | - default y if TCG && ARM | ||
61 | + default y | ||
62 | + depends on TCG && ARM | ||
63 | select A9MPCORE | ||
64 | select A15MPCORE | ||
65 | select AHCI | ||
66 | @@ -XXX,XX +XXX,XX @@ config HIGHBANK | ||
67 | |||
68 | config INTEGRATOR | ||
69 | bool | ||
70 | - default y if TCG && ARM | ||
71 | + default y | ||
72 | + depends on TCG && ARM | ||
73 | select ARM_TIMER | ||
74 | select INTEGRATOR_DEBUG | ||
75 | select PL011 # UART | ||
76 | @@ -XXX,XX +XXX,XX @@ config INTEGRATOR | ||
77 | |||
78 | config MAINSTONE | ||
79 | bool | ||
80 | - default y if TCG && ARM | ||
81 | + default y | ||
82 | + depends on TCG && ARM | ||
83 | select PXA2XX | ||
84 | select PFLASH_CFI01 | ||
85 | select SMC91C111 | ||
86 | |||
87 | config MUSCA | ||
88 | bool | ||
89 | - default y if TCG && ARM | ||
90 | + default y | ||
91 | + depends on TCG && ARM | ||
92 | select ARMSSE | ||
93 | select PL011 | ||
94 | select PL031 | ||
95 | @@ -XXX,XX +XXX,XX @@ config MARVELL_88W8618 | ||
96 | |||
97 | config MUSICPAL | ||
98 | bool | ||
99 | - default y if TCG && ARM | ||
100 | + default y | ||
101 | + depends on TCG && ARM | ||
102 | select OR_IRQ | ||
103 | select BITBANG_I2C | ||
104 | select MARVELL_88W8618 | ||
105 | @@ -XXX,XX +XXX,XX @@ config MUSICPAL | ||
106 | |||
107 | config NETDUINO2 | ||
108 | bool | ||
109 | - default y if TCG && ARM | ||
110 | + default y | ||
111 | + depends on TCG && ARM | ||
112 | select STM32F205_SOC | ||
113 | |||
114 | config NETDUINOPLUS2 | ||
115 | bool | ||
116 | - default y if TCG && ARM | ||
117 | + default y | ||
118 | + depends on TCG && ARM | ||
119 | select STM32F405_SOC | ||
120 | |||
121 | config OLIMEX_STM32_H405 | ||
122 | bool | ||
123 | - default y if TCG && ARM | ||
124 | + default y | ||
125 | + depends on TCG && ARM | ||
126 | select STM32F405_SOC | ||
127 | |||
128 | config NSERIES | ||
129 | bool | ||
130 | - default y if TCG && ARM | ||
131 | + default y | ||
132 | + depends on TCG && ARM | ||
133 | select OMAP | ||
134 | select TMP105 # temperature sensor | ||
135 | select BLIZZARD # LCD/TV controller | ||
136 | @@ -XXX,XX +XXX,XX @@ config PXA2XX | ||
137 | |||
138 | config GUMSTIX | ||
139 | bool | ||
140 | - default y if TCG && ARM | ||
141 | + default y | ||
142 | + depends on TCG && ARM | ||
143 | select PFLASH_CFI01 | ||
144 | select SMC91C111 | ||
145 | select PXA2XX | ||
146 | |||
147 | config TOSA | ||
148 | bool | ||
149 | - default y if TCG && ARM | ||
150 | + default y | ||
151 | + depends on TCG && ARM | ||
152 | select ZAURUS # scoop | ||
153 | select MICRODRIVE | ||
154 | select PXA2XX | ||
155 | @@ -XXX,XX +XXX,XX @@ config TOSA | ||
156 | |||
157 | config SPITZ | ||
158 | bool | ||
159 | - default y if TCG && ARM | ||
160 | + default y | ||
161 | + depends on TCG && ARM | ||
162 | select ADS7846 # touch-screen controller | ||
163 | select MAX111X # A/D converter | ||
164 | select WM8750 # audio codec | ||
165 | @@ -XXX,XX +XXX,XX @@ config SPITZ | ||
166 | |||
167 | config Z2 | ||
168 | bool | ||
169 | - default y if TCG && ARM | ||
170 | + default y | ||
171 | + depends on TCG && ARM | ||
172 | select PFLASH_CFI01 | ||
173 | select WM8750 | ||
174 | select PL011 # UART | ||
175 | @@ -XXX,XX +XXX,XX @@ config Z2 | ||
176 | |||
177 | config REALVIEW | ||
178 | bool | ||
179 | - default y if TCG && ARM | ||
180 | + default y | ||
181 | + depends on TCG && ARM | ||
182 | imply PCI_DEVICES | ||
183 | imply PCI_TESTDEV | ||
184 | imply I2C_DEVICES | ||
185 | @@ -XXX,XX +XXX,XX @@ config REALVIEW | ||
186 | |||
187 | config SBSA_REF | ||
188 | bool | ||
189 | - default y if TCG && AARCH64 | ||
190 | + default y | ||
191 | + depends on TCG && AARCH64 | ||
192 | imply PCI_DEVICES | ||
193 | select AHCI | ||
194 | select ARM_SMMUV3 | ||
195 | @@ -XXX,XX +XXX,XX @@ config SBSA_REF | ||
196 | |||
197 | config SABRELITE | ||
198 | bool | ||
199 | - default y if TCG && ARM | ||
200 | + default y | ||
201 | + depends on TCG && ARM | ||
202 | select FSL_IMX6 | ||
203 | select SSI_M25P80 | ||
204 | |||
205 | config STELLARIS | ||
206 | bool | ||
207 | - default y if TCG && ARM | ||
208 | + default y | ||
209 | + depends on TCG && ARM | ||
210 | imply I2C_DEVICES | ||
211 | select ARM_V7M | ||
212 | select CMSDK_APB_WATCHDOG | ||
213 | @@ -XXX,XX +XXX,XX @@ config STELLARIS | ||
214 | |||
215 | config STM32VLDISCOVERY | ||
216 | bool | ||
217 | - default y if TCG && ARM | ||
218 | + default y | ||
219 | + depends on TCG && ARM | ||
220 | select STM32F100_SOC | ||
221 | |||
222 | config STRONGARM | ||
223 | @@ -XXX,XX +XXX,XX @@ config STRONGARM | ||
224 | |||
225 | config COLLIE | ||
226 | bool | ||
227 | - default y if TCG && ARM | ||
228 | + default y | ||
229 | + depends on TCG && ARM | ||
230 | select PFLASH_CFI01 | ||
231 | select ZAURUS # scoop | ||
232 | select STRONGARM | ||
233 | |||
234 | config SX1 | ||
235 | bool | ||
236 | - default y if TCG && ARM | ||
237 | + default y | ||
238 | + depends on TCG && ARM | ||
239 | select OMAP | ||
240 | |||
241 | config VERSATILE | ||
242 | bool | ||
243 | - default y if TCG && ARM | ||
244 | + default y | ||
245 | + depends on TCG && ARM | ||
246 | select ARM_TIMER # sp804 | ||
247 | select PFLASH_CFI01 | ||
248 | select LSI_SCSI_PCI | ||
249 | @@ -XXX,XX +XXX,XX @@ config VERSATILE | ||
250 | |||
251 | config VEXPRESS | ||
252 | bool | ||
253 | - default y if TCG && ARM | ||
254 | + default y | ||
255 | + depends on TCG && ARM | ||
256 | select A9MPCORE | ||
257 | select A15MPCORE | ||
258 | select ARM_MPTIMER | ||
259 | @@ -XXX,XX +XXX,XX @@ config VEXPRESS | ||
260 | |||
261 | config ZYNQ | ||
262 | bool | ||
263 | - default y if TCG && ARM | ||
264 | + default y | ||
265 | + depends on TCG && ARM | ||
266 | select A9MPCORE | ||
267 | select CADENCE # UART | ||
268 | select PFLASH_CFI02 | ||
269 | @@ -XXX,XX +XXX,XX @@ config ZYNQ | ||
270 | config ARM_V7M | ||
271 | bool | ||
272 | # currently v7M must be included in a TCG build due to translate.c | ||
273 | - default y if TCG && ARM | ||
274 | + default y | ||
275 | + depends on TCG && ARM | ||
276 | select PTIMER | ||
277 | |||
278 | config ALLWINNER_A10 | ||
279 | @@ -XXX,XX +XXX,XX @@ config ALLWINNER_A10 | ||
280 | |||
281 | config ALLWINNER_H3 | ||
282 | bool | ||
283 | - default y if TCG && ARM | ||
284 | + default y | ||
285 | + depends on TCG && ARM | ||
286 | select ALLWINNER_A10_PIT | ||
287 | select ALLWINNER_SUN8I_EMAC | ||
288 | select ALLWINNER_I2C | ||
289 | @@ -XXX,XX +XXX,XX @@ config ALLWINNER_H3 | ||
290 | |||
291 | config RASPI | ||
292 | bool | ||
293 | - default y if TCG && ARM | ||
294 | + default y | ||
295 | + depends on TCG && ARM | ||
296 | select FRAMEBUFFER | ||
297 | select PL011 # UART | ||
298 | select SDHCI | ||
299 | @@ -XXX,XX +XXX,XX @@ config STM32F405_SOC | ||
300 | |||
301 | config XLNX_ZYNQMP_ARM | ||
302 | bool | ||
303 | - default y if TCG && AARCH64 | ||
304 | + default y | ||
305 | + depends on TCG && AARCH64 | ||
306 | select AHCI | ||
307 | select ARM_GIC | ||
308 | select CADENCE | ||
309 | @@ -XXX,XX +XXX,XX @@ config XLNX_ZYNQMP_ARM | ||
310 | |||
311 | config XLNX_VERSAL | ||
312 | bool | ||
313 | - default y if TCG && AARCH64 | ||
314 | + default y | ||
315 | + depends on TCG && AARCH64 | ||
316 | select ARM_GIC | ||
317 | select PL011 | ||
318 | select CADENCE | ||
319 | @@ -XXX,XX +XXX,XX @@ config XLNX_VERSAL | ||
320 | |||
321 | config NPCM7XX | ||
322 | bool | ||
323 | - default y if TCG && ARM | ||
324 | + default y | ||
325 | + depends on TCG && ARM | ||
326 | select A9MPCORE | ||
327 | select ADM1272 | ||
328 | select ARM_GIC | ||
329 | @@ -XXX,XX +XXX,XX @@ config NPCM7XX | ||
330 | |||
331 | config FSL_IMX25 | ||
332 | bool | ||
333 | - default y if TCG && ARM | ||
334 | + default y | ||
335 | + depends on TCG && ARM | ||
336 | imply I2C_DEVICES | ||
337 | select IMX | ||
338 | select IMX_FEC | ||
339 | @@ -XXX,XX +XXX,XX @@ config FSL_IMX25 | ||
340 | |||
341 | config FSL_IMX31 | ||
342 | bool | ||
343 | - default y if TCG && ARM | ||
344 | + default y | ||
345 | + depends on TCG && ARM | ||
346 | imply I2C_DEVICES | ||
347 | select SERIAL | ||
348 | select IMX | ||
349 | @@ -XXX,XX +XXX,XX @@ config FSL_IMX6 | ||
350 | |||
351 | config ASPEED_SOC | ||
352 | bool | ||
353 | - default y if TCG && ARM | ||
354 | + default y | ||
355 | + depends on TCG && ARM | ||
356 | select DS1338 | ||
357 | select FTGMAC100 | ||
358 | select I2C | ||
359 | @@ -XXX,XX +XXX,XX @@ config ASPEED_SOC | ||
360 | |||
361 | config MPS2 | ||
362 | bool | ||
363 | - default y if TCG && ARM | ||
364 | + default y | ||
365 | + depends on TCG && ARM | ||
366 | imply I2C_DEVICES | ||
367 | select ARMSSE | ||
368 | select LAN9118 | ||
369 | @@ -XXX,XX +XXX,XX @@ config MPS2 | ||
370 | |||
371 | config FSL_IMX7 | ||
372 | bool | ||
373 | - default y if TCG && ARM | ||
374 | + default y | ||
375 | + depends on TCG && ARM | ||
376 | imply PCI_DEVICES | ||
377 | imply TEST_DEVICES | ||
378 | imply I2C_DEVICES | ||
379 | @@ -XXX,XX +XXX,XX @@ config ARM_SMMUV3 | ||
380 | |||
381 | config FSL_IMX6UL | ||
382 | bool | ||
383 | - default y if TCG && ARM | ||
384 | + default y | ||
385 | + depends on TCG && ARM | ||
386 | imply I2C_DEVICES | ||
387 | select A15MPCORE | ||
388 | select IMX | ||
389 | @@ -XXX,XX +XXX,XX @@ config FSL_IMX6UL | ||
390 | |||
391 | config MICROBIT | ||
392 | bool | ||
393 | - default y if TCG && ARM | ||
394 | + default y | ||
395 | + depends on TCG && ARM | ||
396 | select NRF51_SOC | ||
397 | |||
398 | config NRF51_SOC | ||
399 | @@ -XXX,XX +XXX,XX @@ config NRF51_SOC | ||
400 | |||
401 | config EMCRAFT_SF2 | ||
402 | bool | ||
403 | - default y if TCG && ARM | ||
404 | + default y | ||
405 | + depends on TCG && ARM | ||
406 | select MSF2 | ||
407 | select SSI_M25P80 | ||
52 | 408 | ||
53 | -- | 409 | -- |
54 | 2.20.1 | 410 | 2.34.1 |
55 | 411 | ||
56 | 412 | diff view generated by jsdifflib |
1 | From: Alistair Francis <alistair.francis@wdc.com> | 1 | From: Enze Li <lienze@kylinos.cn> |
---|---|---|---|
2 | 2 | ||
3 | Commit 89e68b575 "target/arm: Use vector operations for saturation" | 3 | I noticed that in the latest version, the copyright string is still |
4 | causes this abort() when booting QEMU ARM with a Cortex-A15: | 4 | 2022, even though 2023 is halfway through. This patch fixes that and |
5 | fixes the documentation along with it. | ||
5 | 6 | ||
6 | 0 0x00007ffff4c2382f in raise () at /usr/lib/libc.so.6 | 7 | Signed-off-by: Enze Li <lienze@kylinos.cn> |
7 | 1 0x00007ffff4c0e672 in abort () at /usr/lib/libc.so.6 | 8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
8 | 2 0x00005555559c1839 in disas_neon_data_insn (insn=<optimized out>, s=<optimized out>) at ./target/arm/translate.c:6673 | 9 | Message-id: 20230525064345.1152801-1-lienze@kylinos.cn |
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 | ||
32 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
33 | --- | 11 | --- |
34 | target/arm/translate.c | 4 ++-- | 12 | docs/conf.py | 2 +- |
35 | 1 file changed, 2 insertions(+), 2 deletions(-) | 13 | include/qemu/help-texts.h | 2 +- |
14 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
36 | 15 | ||
37 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 16 | diff --git a/docs/conf.py b/docs/conf.py |
38 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
39 | --- a/target/arm/translate.c | 18 | --- a/docs/conf.py |
40 | +++ b/target/arm/translate.c | 19 | +++ b/docs/conf.py |
41 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | 20 | @@ -XXX,XX +XXX,XX @@ |
42 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | 21 | |
43 | rn_ofs, rm_ofs, vec_size, vec_size, | 22 | # General information about the project. |
44 | (u ? uqadd_op : sqadd_op) + size); | 23 | project = u'QEMU' |
45 | - break; | 24 | -copyright = u'2022, The QEMU Project Developers' |
46 | + return 0; | 25 | +copyright = u'2023, The QEMU Project Developers' |
47 | 26 | author = u'The QEMU Project Developers' | |
48 | case NEON_3R_VQSUB: | 27 | |
49 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | 28 | # The version info for the project you're documenting, acts as replacement for |
50 | rn_ofs, rm_ofs, vec_size, vec_size, | 29 | diff --git a/include/qemu/help-texts.h b/include/qemu/help-texts.h |
51 | (u ? uqsub_op : sqsub_op) + size); | 30 | index XXXXXXX..XXXXXXX 100644 |
52 | - break; | 31 | --- a/include/qemu/help-texts.h |
53 | + return 0; | 32 | +++ b/include/qemu/help-texts.h |
54 | 33 | @@ -XXX,XX +XXX,XX @@ | |
55 | case NEON_3R_VMUL: /* VMUL */ | 34 | #define QEMU_HELP_TEXTS_H |
56 | if (u) { | 35 | |
36 | /* Copyright string for -version arguments, About dialogs, etc */ | ||
37 | -#define QEMU_COPYRIGHT "Copyright (c) 2003-2022 " \ | ||
38 | +#define QEMU_COPYRIGHT "Copyright (c) 2003-2023 " \ | ||
39 | "Fabrice Bellard and the QEMU Project developers" | ||
40 | |||
41 | /* Bug reporting information for --help arguments, About dialogs, etc */ | ||
57 | -- | 42 | -- |
58 | 2.20.1 | 43 | 2.34.1 |
59 | |||
60 | diff view generated by jsdifflib |
1 | From: Guenter Roeck <linux@roeck-us.net> | 1 | From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> |
---|---|---|---|
2 | 2 | ||
3 | QEMU already supports pl330. Instantiate it for Exynos4210. | 3 | Let add GIC information into DeviceTree as part of SBSA-REF versioning. |
4 | 4 | ||
5 | Relevant part of Linux arch/arm/boot/dts/exynos4.dtsi: | 5 | Trusted Firmware will read it and provide to next firmware level. |
6 | 6 | ||
7 | / { | 7 | Bumps platform version to 0.1 one so we can check is node is present. |
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 | 8 | ||
44 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | 9 | Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> |
45 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
46 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
47 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
48 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
49 | Message-id: 20190520214342.13709-4-philmd@redhat.com | ||
50 | [PMD: Do not set default qdev properties, create the controllers in the SoC | ||
51 | rather than the board (Peter Maydell), add dtsi in commit message] | ||
52 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
53 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
54 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
55 | --- | 12 | --- |
56 | hw/arm/exynos4210.c | 26 ++++++++++++++++++++++++++ | 13 | hw/arm/sbsa-ref.c | 19 ++++++++++++++++++- |
57 | 1 file changed, 26 insertions(+) | 14 | 1 file changed, 18 insertions(+), 1 deletion(-) |
58 | 15 | ||
59 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | 16 | diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c |
60 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
61 | --- a/hw/arm/exynos4210.c | 18 | --- a/hw/arm/sbsa-ref.c |
62 | +++ b/hw/arm/exynos4210.c | 19 | +++ b/hw/arm/sbsa-ref.c |
63 | @@ -XXX,XX +XXX,XX @@ | 20 | @@ -XXX,XX +XXX,XX @@ |
64 | /* EHCI */ | 21 | #include "exec/hwaddr.h" |
65 | #define EXYNOS4210_EHCI_BASE_ADDR 0x12580000 | 22 | #include "kvm_arm.h" |
66 | 23 | #include "hw/arm/boot.h" | |
67 | +/* DMA */ | 24 | +#include "hw/arm/fdt.h" |
68 | +#define EXYNOS4210_PL330_BASE0_ADDR 0x12680000 | 25 | #include "hw/arm/smmuv3.h" |
69 | +#define EXYNOS4210_PL330_BASE1_ADDR 0x12690000 | 26 | #include "hw/block/flash.h" |
70 | +#define EXYNOS4210_PL330_BASE2_ADDR 0x12850000 | 27 | #include "hw/boards.h" |
28 | @@ -XXX,XX +XXX,XX @@ static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx) | ||
29 | return arm_cpu_mp_affinity(idx, clustersz); | ||
30 | } | ||
31 | |||
32 | +static void sbsa_fdt_add_gic_node(SBSAMachineState *sms) | ||
33 | +{ | ||
34 | + char *nodename; | ||
71 | + | 35 | + |
72 | static uint8_t chipid_and_omr[] = { 0x11, 0x02, 0x21, 0x43, | 36 | + nodename = g_strdup_printf("/intc"); |
73 | 0x09, 0x00, 0x00, 0x00 }; | 37 | + qemu_fdt_add_subnode(sms->fdt, nodename); |
74 | 38 | + qemu_fdt_setprop_sized_cells(sms->fdt, nodename, "reg", | |
75 | @@ -XXX,XX +XXX,XX @@ static uint64_t exynos4210_calc_affinity(int cpu) | 39 | + 2, sbsa_ref_memmap[SBSA_GIC_DIST].base, |
76 | return (0x9 << ARM_AFF1_SHIFT) | cpu; | 40 | + 2, sbsa_ref_memmap[SBSA_GIC_DIST].size, |
41 | + 2, sbsa_ref_memmap[SBSA_GIC_REDIST].base, | ||
42 | + 2, sbsa_ref_memmap[SBSA_GIC_REDIST].size); | ||
43 | + | ||
44 | + g_free(nodename); | ||
45 | +} | ||
46 | /* | ||
47 | * Firmware on this machine only uses ACPI table to load OS, these limited | ||
48 | * device tree nodes are just to let firmware know the info which varies from | ||
49 | @@ -XXX,XX +XXX,XX @@ static void create_fdt(SBSAMachineState *sms) | ||
50 | * fw compatibility. | ||
51 | */ | ||
52 | qemu_fdt_setprop_cell(fdt, "/", "machine-version-major", 0); | ||
53 | - qemu_fdt_setprop_cell(fdt, "/", "machine-version-minor", 0); | ||
54 | + qemu_fdt_setprop_cell(fdt, "/", "machine-version-minor", 1); | ||
55 | |||
56 | if (ms->numa_state->have_numa_distance) { | ||
57 | int size = nb_numa_nodes * nb_numa_nodes * 3 * sizeof(uint32_t); | ||
58 | @@ -XXX,XX +XXX,XX @@ static void create_fdt(SBSAMachineState *sms) | ||
59 | |||
60 | g_free(nodename); | ||
61 | } | ||
62 | + | ||
63 | + sbsa_fdt_add_gic_node(sms); | ||
77 | } | 64 | } |
78 | 65 | ||
79 | +static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | 66 | #define SBSA_FLASH_SECTOR_SIZE (256 * KiB) |
80 | +{ | ||
81 | + SysBusDevice *busdev; | ||
82 | + DeviceState *dev; | ||
83 | + | ||
84 | + dev = qdev_create(NULL, "pl330"); | ||
85 | + qdev_prop_set_uint8(dev, "num_periph_req", nreq); | ||
86 | + qdev_init_nofail(dev); | ||
87 | + busdev = SYS_BUS_DEVICE(dev); | ||
88 | + sysbus_mmio_map(busdev, 0, base); | ||
89 | + sysbus_connect_irq(busdev, 0, irq); | ||
90 | +} | ||
91 | + | ||
92 | Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | ||
93 | { | ||
94 | Exynos4210State *s = g_new0(Exynos4210State, 1); | ||
95 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | ||
96 | sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, | ||
97 | s->irq_table[exynos4210_get_irq(28, 3)]); | ||
98 | |||
99 | + /*** DMA controllers ***/ | ||
100 | + pl330_create(EXYNOS4210_PL330_BASE0_ADDR, | ||
101 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(35, 1)]), 32); | ||
102 | + pl330_create(EXYNOS4210_PL330_BASE1_ADDR, | ||
103 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); | ||
104 | + pl330_create(EXYNOS4210_PL330_BASE2_ADDR, | ||
105 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); | ||
106 | + | ||
107 | return s; | ||
108 | } | ||
109 | -- | 67 | -- |
110 | 2.20.1 | 68 | 2.34.1 |
111 | |||
112 | diff view generated by jsdifflib |
1 | The hw/arm/arm.h header now only includes declarations relating | 1 | From: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> |
---|---|---|---|
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. | ||
5 | 2 | ||
3 | We moved from VGA to Bochs to have PCIe card. | ||
4 | |||
5 | Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> | ||
6 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 7 | 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 | ||
10 | --- | 8 | --- |
11 | hw/intc/armv7m_nvic.c | 1 - | 9 | docs/system/arm/sbsa.rst | 2 +- |
12 | target/arm/arm-semi.c | 1 - | 10 | 1 file changed, 1 insertion(+), 1 deletion(-) |
13 | target/arm/cpu.c | 1 - | ||
14 | target/arm/cpu64.c | 1 - | ||
15 | target/arm/kvm.c | 1 - | ||
16 | target/arm/kvm32.c | 1 - | ||
17 | target/arm/kvm64.c | 1 - | ||
18 | 7 files changed, 7 deletions(-) | ||
19 | 11 | ||
20 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c | 12 | diff --git a/docs/system/arm/sbsa.rst b/docs/system/arm/sbsa.rst |
21 | index XXXXXXX..XXXXXXX 100644 | 13 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/hw/intc/armv7m_nvic.c | 14 | --- a/docs/system/arm/sbsa.rst |
23 | +++ b/hw/intc/armv7m_nvic.c | 15 | +++ b/docs/system/arm/sbsa.rst |
24 | @@ -XXX,XX +XXX,XX @@ | 16 | @@ -XXX,XX +XXX,XX @@ The sbsa-ref board supports: |
25 | #include "cpu.h" | 17 | - System bus EHCI controller |
26 | #include "hw/sysbus.h" | 18 | - CDROM and hard disc on AHCI bus |
27 | #include "qemu/timer.h" | 19 | - E1000E ethernet card on PCIe bus |
28 | -#include "hw/arm/arm.h" | 20 | - - VGA display adaptor on PCIe bus |
29 | #include "hw/intc/armv7m_nvic.h" | 21 | + - Bochs display adapter on PCIe bus |
30 | #include "target/arm/cpu.h" | 22 | - A generic SBSA watchdog device |
31 | #include "exec/exec-all.h" | ||
32 | diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c | ||
33 | index XXXXXXX..XXXXXXX 100644 | ||
34 | --- a/target/arm/arm-semi.c | ||
35 | +++ b/target/arm/arm-semi.c | ||
36 | @@ -XXX,XX +XXX,XX @@ | ||
37 | #else | ||
38 | #include "qemu-common.h" | ||
39 | #include "exec/gdbstub.h" | ||
40 | -#include "hw/arm/arm.h" | ||
41 | #include "qemu/cutils.h" | ||
42 | #endif | ||
43 | |||
44 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | ||
45 | index XXXXXXX..XXXXXXX 100644 | ||
46 | --- a/target/arm/cpu.c | ||
47 | +++ b/target/arm/cpu.c | ||
48 | @@ -XXX,XX +XXX,XX @@ | ||
49 | #if !defined(CONFIG_USER_ONLY) | ||
50 | #include "hw/loader.h" | ||
51 | #endif | ||
52 | -#include "hw/arm/arm.h" | ||
53 | #include "sysemu/sysemu.h" | ||
54 | #include "sysemu/hw_accel.h" | ||
55 | #include "kvm_arm.h" | ||
56 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | ||
57 | index XXXXXXX..XXXXXXX 100644 | ||
58 | --- a/target/arm/cpu64.c | ||
59 | +++ b/target/arm/cpu64.c | ||
60 | @@ -XXX,XX +XXX,XX @@ | ||
61 | #if !defined(CONFIG_USER_ONLY) | ||
62 | #include "hw/loader.h" | ||
63 | #endif | ||
64 | -#include "hw/arm/arm.h" | ||
65 | #include "sysemu/sysemu.h" | ||
66 | #include "sysemu/kvm.h" | ||
67 | #include "kvm_arm.h" | ||
68 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c | ||
69 | index XXXXXXX..XXXXXXX 100644 | ||
70 | --- a/target/arm/kvm.c | ||
71 | +++ b/target/arm/kvm.c | ||
72 | @@ -XXX,XX +XXX,XX @@ | ||
73 | #include "cpu.h" | ||
74 | #include "trace.h" | ||
75 | #include "internals.h" | ||
76 | -#include "hw/arm/arm.h" | ||
77 | #include "hw/pci/pci.h" | ||
78 | #include "exec/memattrs.h" | ||
79 | #include "exec/address-spaces.h" | ||
80 | diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c | ||
81 | index XXXXXXX..XXXXXXX 100644 | ||
82 | --- a/target/arm/kvm32.c | ||
83 | +++ b/target/arm/kvm32.c | ||
84 | @@ -XXX,XX +XXX,XX @@ | ||
85 | #include "sysemu/kvm.h" | ||
86 | #include "kvm_arm.h" | ||
87 | #include "internals.h" | ||
88 | -#include "hw/arm/arm.h" | ||
89 | #include "qemu/log.h" | ||
90 | |||
91 | static inline void set_feature(uint64_t *features, int feature) | ||
92 | diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c | ||
93 | index XXXXXXX..XXXXXXX 100644 | ||
94 | --- a/target/arm/kvm64.c | ||
95 | +++ b/target/arm/kvm64.c | ||
96 | @@ -XXX,XX +XXX,XX @@ | ||
97 | #include "sysemu/kvm.h" | ||
98 | #include "kvm_arm.h" | ||
99 | #include "internals.h" | ||
100 | -#include "hw/arm/arm.h" | ||
101 | |||
102 | static bool have_guest_debug; | ||
103 | 23 | ||
104 | -- | 24 | -- |
105 | 2.20.1 | 25 | 2.34.1 |
106 | |||
107 | diff view generated by jsdifflib |