1 | Not very much here, but several people have fallen over | 1 | The following changes since commit 6eeea6725a70e6fcb5abba0764496bdab07ddfb3: |
---|---|---|---|
2 | the vector operation segfault bug, so let's get the fix | ||
3 | into master. | ||
4 | 2 | ||
5 | thanks | 3 | Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-10-06' into staging (2020-10-06 21:13:34 +0100) |
6 | -- PMM | ||
7 | |||
8 | The following changes since commit d418238dca7b4e0b124135827ead3076233052b1: | ||
9 | |||
10 | Merge remote-tracking branch 'remotes/rth/tags/pull-rng-20190522' into staging (2019-05-23 12:57:17 +0100) | ||
11 | 4 | ||
12 | are available in the Git repository at: | 5 | are available in the Git repository at: |
13 | 6 | ||
14 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190523 | 7 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20201008 |
15 | 8 | ||
16 | for you to fetch changes up to 98e4f4fdb8ea05d840f51f47125924c2bb9df2df: | 9 | for you to fetch changes up to ba118c26e16a97e6ff6de8184057d3420ce16a23: |
17 | 10 | ||
18 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC (2019-05-23 14:47:44 +0100) | 11 | target/arm: Make '-cpu max' have a 48-bit PA (2020-10-08 15:24:32 +0100) |
19 | 12 | ||
20 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
21 | target-arm queue: | 14 | target-arm queue: |
22 | * exynos4210: QOM'ify the Exynos4210 SoC | 15 | * hw/ssi/npcm7xx_fiu: Fix handling of unsigned integer |
23 | * exynos4210: Add DMA support for the Exynos4210 | 16 | * hw/arm/fsl-imx25: Fix a typo |
24 | * arm_gicv3: Fix writes to ICC_CTLR_EL3 | 17 | * hw/arm/sbsa-ref : Fix SMMUv3 Initialisation |
25 | * arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} | 18 | * hw/arm/sbsa-ref : allocate IRQs for SMMUv3 |
26 | * target/arm: Fix vector operation segfault | 19 | * hw/char/bcm2835_aux: Allow less than 32-bit accesses |
27 | * target/arm: Minor improvements to BFXIL, EXTR | 20 | * hw/arm/virt: Implement kvm-steal-time |
21 | * target/arm: Make '-cpu max' have a 48-bit PA | ||
28 | 22 | ||
29 | ---------------------------------------------------------------- | 23 | ---------------------------------------------------------------- |
30 | Alistair Francis (1): | 24 | Andrew Jones (6): |
31 | target/arm: Fix vector operation segfault | 25 | linux headers: sync to 5.9-rc7 |
26 | target/arm/kvm: Make uncalled stubs explicitly unreachable | ||
27 | hw/arm/virt: Move post cpu realize check into its own function | ||
28 | hw/arm/virt: Move kvm pmu setup to virt_cpu_post_init | ||
29 | tests/qtest: Restore aarch64 arm-cpu-features test | ||
30 | hw/arm/virt: Implement kvm-steal-time | ||
32 | 31 | ||
33 | Guenter Roeck (1): | 32 | Graeme Gregory (2): |
34 | hw/arm/exynos4210: Add DMA support for the Exynos4210 | 33 | hw/arm/sbsa-ref : Fix SMMUv3 Initialisation |
34 | hw/arm/sbsa-ref : allocate IRQs for SMMUv3 | ||
35 | 35 | ||
36 | Peter Maydell (5): | 36 | Peter Maydell (1): |
37 | arm: Move system_clock_scale to armv7m_systick.h | 37 | target/arm: Make '-cpu max' have a 48-bit PA |
38 | arm: Remove unnecessary includes of hw/arm/arm.h | ||
39 | arm: Rename hw/arm/arm.h to hw/arm/boot.h | ||
40 | hw/intc/arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} | ||
41 | hw/intc/arm_gicv3: Fix writes to ICC_CTLR_EL3 | ||
42 | 38 | ||
43 | Philippe Mathieu-Daudé (3): | 39 | Philippe Mathieu-Daudé (3): |
44 | hw/arm/exynos4: Remove unuseful debug code | 40 | hw/ssi/npcm7xx_fiu: Fix handling of unsigned integer |
45 | hw/arm/exynos4: Use the IEC binary prefix definitions | 41 | hw/arm/fsl-imx25: Fix a typo |
46 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC | 42 | hw/char/bcm2835_aux: Allow less than 32-bit accesses |
47 | 43 | ||
48 | Richard Henderson (2): | 44 | docs/system/arm/cpu-features.rst | 11 ++++ |
49 | target/arm: Use extract2 for EXTR | 45 | include/hw/arm/fsl-imx25.h | 2 +- |
50 | target/arm: Simplify BFXIL expansion | 46 | include/hw/arm/virt.h | 5 ++ |
47 | linux-headers/linux/kvm.h | 6 ++- | ||
48 | target/arm/cpu.h | 4 ++ | ||
49 | target/arm/kvm_arm.h | 94 ++++++++++++++++++++++++++------- | ||
50 | hw/arm/sbsa-ref.c | 3 +- | ||
51 | hw/arm/virt.c | 110 ++++++++++++++++++++++++++++----------- | ||
52 | hw/char/bcm2835_aux.c | 4 +- | ||
53 | hw/ssi/npcm7xx_fiu.c | 12 ++--- | ||
54 | target/arm/cpu.c | 8 +++ | ||
55 | target/arm/cpu64.c | 4 ++ | ||
56 | target/arm/kvm.c | 16 ++++++ | ||
57 | target/arm/kvm64.c | 64 +++++++++++++++++++++-- | ||
58 | target/arm/monitor.c | 2 +- | ||
59 | tests/qtest/arm-cpu-features.c | 25 +++++++-- | ||
60 | hw/ssi/trace-events | 2 +- | ||
61 | tests/qtest/meson.build | 3 +- | ||
62 | 18 files changed, 303 insertions(+), 72 deletions(-) | ||
51 | 63 | ||
52 | include/hw/arm/allwinner-a10.h | 2 +- | ||
53 | include/hw/arm/aspeed_soc.h | 1 - | ||
54 | include/hw/arm/bcm2836.h | 1 - | ||
55 | include/hw/arm/{arm.h => boot.h} | 12 +++------ | ||
56 | include/hw/arm/exynos4210.h | 9 +++++-- | ||
57 | include/hw/arm/fsl-imx25.h | 2 +- | ||
58 | include/hw/arm/fsl-imx31.h | 2 +- | ||
59 | include/hw/arm/fsl-imx6.h | 2 +- | ||
60 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
61 | include/hw/arm/fsl-imx7.h | 2 +- | ||
62 | include/hw/arm/virt.h | 2 +- | ||
63 | include/hw/arm/xlnx-versal.h | 2 +- | ||
64 | include/hw/arm/xlnx-zynqmp.h | 2 +- | ||
65 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++ | ||
66 | hw/arm/armsse.c | 2 +- | ||
67 | hw/arm/armv7m.c | 2 +- | ||
68 | hw/arm/aspeed.c | 2 +- | ||
69 | hw/arm/boot.c | 2 +- | ||
70 | hw/arm/collie.c | 2 +- | ||
71 | hw/arm/exynos4210.c | 54 ++++++++++++++++++++++++++++++++++++--- | ||
72 | hw/arm/exynos4_boards.c | 40 ++++++++--------------------- | ||
73 | hw/arm/highbank.c | 2 +- | ||
74 | hw/arm/integratorcp.c | 2 +- | ||
75 | hw/arm/mainstone.c | 2 +- | ||
76 | hw/arm/microbit.c | 2 +- | ||
77 | hw/arm/mps2-tz.c | 2 +- | ||
78 | hw/arm/mps2.c | 2 +- | ||
79 | hw/arm/msf2-soc.c | 1 - | ||
80 | hw/arm/msf2-som.c | 2 +- | ||
81 | hw/arm/musca.c | 2 +- | ||
82 | hw/arm/musicpal.c | 2 +- | ||
83 | hw/arm/netduino2.c | 2 +- | ||
84 | hw/arm/nrf51_soc.c | 2 +- | ||
85 | hw/arm/nseries.c | 2 +- | ||
86 | hw/arm/omap1.c | 2 +- | ||
87 | hw/arm/omap2.c | 2 +- | ||
88 | hw/arm/omap_sx1.c | 2 +- | ||
89 | hw/arm/palm.c | 2 +- | ||
90 | hw/arm/raspi.c | 2 +- | ||
91 | hw/arm/realview.c | 2 +- | ||
92 | hw/arm/spitz.c | 2 +- | ||
93 | hw/arm/stellaris.c | 2 +- | ||
94 | hw/arm/stm32f205_soc.c | 2 +- | ||
95 | hw/arm/strongarm.c | 2 +- | ||
96 | hw/arm/tosa.c | 2 +- | ||
97 | hw/arm/versatilepb.c | 2 +- | ||
98 | hw/arm/vexpress.c | 2 +- | ||
99 | hw/arm/virt.c | 2 +- | ||
100 | hw/arm/xilinx_zynq.c | 2 +- | ||
101 | hw/arm/xlnx-versal.c | 2 +- | ||
102 | hw/arm/z2.c | 2 +- | ||
103 | hw/intc/arm_gicv3_cpuif.c | 6 ++--- | ||
104 | hw/intc/armv7m_nvic.c | 1 - | ||
105 | target/arm/arm-semi.c | 1 - | ||
106 | target/arm/cpu.c | 1 - | ||
107 | target/arm/cpu64.c | 1 - | ||
108 | target/arm/kvm.c | 1 - | ||
109 | target/arm/kvm32.c | 1 - | ||
110 | target/arm/kvm64.c | 1 - | ||
111 | target/arm/translate-a64.c | 44 ++++++++++++++++--------------- | ||
112 | target/arm/translate.c | 4 +-- | ||
113 | 61 files changed, 164 insertions(+), 123 deletions(-) | ||
114 | rename include/hw/arm/{arm.h => boot.h} (96%) | ||
115 | diff view generated by jsdifflib |
1 | From: Guenter Roeck <linux@roeck-us.net> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | QEMU already supports pl330. Instantiate it for Exynos4210. | 3 | Fix integer handling issues handling issue reported by Coverity: |
4 | 4 | ||
5 | Relevant part of Linux arch/arm/boot/dts/exynos4.dtsi: | 5 | hw/ssi/npcm7xx_fiu.c: 162 in npcm7xx_fiu_flash_read() |
6 | >>> CID 1432730: Integer handling issues (NEGATIVE_RETURNS) | ||
7 | >>> "npcm7xx_fiu_cs_index(fiu, f)" is passed to a parameter that cannot be negative. | ||
8 | 162 npcm7xx_fiu_select(fiu, npcm7xx_fiu_cs_index(fiu, f)); | ||
6 | 9 | ||
7 | / { | 10 | hw/ssi/npcm7xx_fiu.c: 221 in npcm7xx_fiu_flash_write() |
8 | soc: soc { | 11 | 218 cs_id = npcm7xx_fiu_cs_index(fiu, f); |
9 | amba { | 12 | 219 trace_npcm7xx_fiu_flash_write(DEVICE(fiu)->canonical_path, cs_id, addr, |
10 | pdma0: pdma@12680000 { | 13 | 220 size, v); |
11 | compatible = "arm,pl330", "arm,primecell"; | 14 | >>> CID 1432729: Integer handling issues (NEGATIVE_RETURNS) |
12 | reg = <0x12680000 0x1000>; | 15 | >>> "cs_id" is passed to a parameter that cannot be negative. |
13 | interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; | 16 | 221 npcm7xx_fiu_select(fiu, cs_id); |
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 | 17 | ||
44 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | 18 | Since the index of the flash can not be negative, return an |
45 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 19 | unsigned type. |
46 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 20 | |
47 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 21 | Reported-by: Coverity (CID 1432729 & 1432730: NEGATIVE_RETURNS) |
48 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 22 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
49 | Message-id: 20190520214342.13709-4-philmd@redhat.com | 23 | Reviewed-by: Havard Skinnemoen <hskinnemoen@google.com> |
50 | [PMD: Do not set default qdev properties, create the controllers in the SoC | 24 | Message-id: 20200919132435.310527-1-f4bug@amsat.org |
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> | ||
54 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 25 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
55 | --- | 26 | --- |
56 | hw/arm/exynos4210.c | 26 ++++++++++++++++++++++++++ | 27 | hw/ssi/npcm7xx_fiu.c | 12 ++++++------ |
57 | 1 file changed, 26 insertions(+) | 28 | hw/ssi/trace-events | 2 +- |
29 | 2 files changed, 7 insertions(+), 7 deletions(-) | ||
58 | 30 | ||
59 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | 31 | diff --git a/hw/ssi/npcm7xx_fiu.c b/hw/ssi/npcm7xx_fiu.c |
60 | index XXXXXXX..XXXXXXX 100644 | 32 | index XXXXXXX..XXXXXXX 100644 |
61 | --- a/hw/arm/exynos4210.c | 33 | --- a/hw/ssi/npcm7xx_fiu.c |
62 | +++ b/hw/arm/exynos4210.c | 34 | +++ b/hw/ssi/npcm7xx_fiu.c |
63 | @@ -XXX,XX +XXX,XX @@ | 35 | @@ -XXX,XX +XXX,XX @@ enum NPCM7xxFIURegister { |
64 | /* EHCI */ | 36 | * Returns the index of flash in the fiu->flash array. This corresponds to the |
65 | #define EXYNOS4210_EHCI_BASE_ADDR 0x12580000 | 37 | * chip select ID of the flash. |
66 | 38 | */ | |
67 | +/* DMA */ | 39 | -static int npcm7xx_fiu_cs_index(NPCM7xxFIUState *fiu, NPCM7xxFIUFlash *flash) |
68 | +#define EXYNOS4210_PL330_BASE0_ADDR 0x12680000 | 40 | +static unsigned npcm7xx_fiu_cs_index(NPCM7xxFIUState *fiu, |
69 | +#define EXYNOS4210_PL330_BASE1_ADDR 0x12690000 | 41 | + NPCM7xxFIUFlash *flash) |
70 | +#define EXYNOS4210_PL330_BASE2_ADDR 0x12850000 | 42 | { |
71 | + | 43 | int index = flash - fiu->flash; |
72 | static uint8_t chipid_and_omr[] = { 0x11, 0x02, 0x21, 0x43, | 44 | |
73 | 0x09, 0x00, 0x00, 0x00 }; | 45 | @@ -XXX,XX +XXX,XX @@ static int npcm7xx_fiu_cs_index(NPCM7xxFIUState *fiu, NPCM7xxFIUFlash *flash) |
74 | |||
75 | @@ -XXX,XX +XXX,XX @@ static uint64_t exynos4210_calc_affinity(int cpu) | ||
76 | return (0x9 << ARM_AFF1_SHIFT) | cpu; | ||
77 | } | 46 | } |
78 | 47 | ||
79 | +static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | 48 | /* Assert the chip select specified in the UMA Control/Status Register. */ |
80 | +{ | 49 | -static void npcm7xx_fiu_select(NPCM7xxFIUState *s, int cs_id) |
81 | + SysBusDevice *busdev; | 50 | +static void npcm7xx_fiu_select(NPCM7xxFIUState *s, unsigned cs_id) |
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 | { | 51 | { |
94 | Exynos4210State *s = g_new0(Exynos4210State, 1); | 52 | trace_npcm7xx_fiu_select(DEVICE(s)->canonical_path, cs_id); |
95 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | 53 | |
96 | sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, | 54 | if (cs_id < s->cs_count) { |
97 | s->irq_table[exynos4210_get_irq(28, 3)]); | 55 | qemu_irq_lower(s->cs_lines[cs_id]); |
98 | 56 | + s->active_cs = cs_id; | |
99 | + /*** DMA controllers ***/ | 57 | } else { |
100 | + pl330_create(EXYNOS4210_PL330_BASE0_ADDR, | 58 | qemu_log_mask(LOG_GUEST_ERROR, |
101 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(35, 1)]), 32); | 59 | "%s: UMA to CS%d; this module has only %d chip selects", |
102 | + pl330_create(EXYNOS4210_PL330_BASE1_ADDR, | 60 | DEVICE(s)->canonical_path, cs_id, s->cs_count); |
103 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); | 61 | - cs_id = -1; |
104 | + pl330_create(EXYNOS4210_PL330_BASE2_ADDR, | 62 | + s->active_cs = -1; |
105 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); | 63 | } |
106 | + | 64 | - |
107 | return s; | 65 | - s->active_cs = cs_id; |
108 | } | 66 | } |
67 | |||
68 | /* Deassert the currently active chip select. */ | ||
69 | @@ -XXX,XX +XXX,XX @@ static void npcm7xx_fiu_flash_write(void *opaque, hwaddr addr, uint64_t v, | ||
70 | NPCM7xxFIUFlash *f = opaque; | ||
71 | NPCM7xxFIUState *fiu = f->fiu; | ||
72 | uint32_t dwr_cfg; | ||
73 | - int cs_id; | ||
74 | + unsigned cs_id; | ||
75 | int i; | ||
76 | |||
77 | if (fiu->active_cs != -1) { | ||
78 | diff --git a/hw/ssi/trace-events b/hw/ssi/trace-events | ||
79 | index XXXXXXX..XXXXXXX 100644 | ||
80 | --- a/hw/ssi/trace-events | ||
81 | +++ b/hw/ssi/trace-events | ||
82 | @@ -XXX,XX +XXX,XX @@ npcm7xx_fiu_deselect(const char *id, int cs) "%s deselect CS%d" | ||
83 | npcm7xx_fiu_ctrl_read(const char *id, uint64_t addr, uint32_t data) "%s offset: 0x%04" PRIx64 " value: 0x%08" PRIx32 | ||
84 | npcm7xx_fiu_ctrl_write(const char *id, uint64_t addr, uint32_t data) "%s offset: 0x%04" PRIx64 " value: 0x%08" PRIx32 | ||
85 | npcm7xx_fiu_flash_read(const char *id, int cs, uint64_t addr, unsigned int size, uint64_t value) "%s[%d] offset: 0x%08" PRIx64 " size: %u value: 0x%" PRIx64 | ||
86 | -npcm7xx_fiu_flash_write(const char *id, int cs, uint64_t addr, unsigned int size, uint64_t value) "%s[%d] offset: 0x%08" PRIx64 " size: %u value: 0x%" PRIx64 | ||
87 | +npcm7xx_fiu_flash_write(const char *id, unsigned cs, uint64_t addr, unsigned int size, uint64_t value) "%s[%d] offset: 0x%08" PRIx64 " size: %u value: 0x%" PRIx64 | ||
109 | -- | 88 | -- |
110 | 2.20.1 | 89 | 2.20.1 |
111 | 90 | ||
112 | 91 | diff view generated by jsdifflib |
1 | The ICC_CTLR_EL3 register includes some bits which are aliases | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | of bits in the ICC_CTLR_EL1(S) and (NS) registers. QEMU chooses | ||
3 | to keep those bits in the cs->icc_ctlr_el1[] struct fields. | ||
4 | Unfortunately a missing '~' in the code to update the bits | ||
5 | in those fields meant that writing to ICC_CTLR_EL3 would corrupt | ||
6 | the ICC_CLTR_EL1 register values. | ||
7 | 2 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
4 | Message-id: 20201002080935.1660005-1-f4bug@amsat.org | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | 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 | --- | 7 | --- |
12 | hw/intc/arm_gicv3_cpuif.c | 4 ++-- | 8 | include/hw/arm/fsl-imx25.h | 2 +- |
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | 9 | 1 file changed, 1 insertion(+), 1 deletion(-) |
14 | 10 | ||
15 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | 11 | diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h |
16 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/hw/intc/arm_gicv3_cpuif.c | 13 | --- a/include/hw/arm/fsl-imx25.h |
18 | +++ b/hw/intc/arm_gicv3_cpuif.c | 14 | +++ b/include/hw/arm/fsl-imx25.h |
19 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, | 15 | @@ -XXX,XX +XXX,XX @@ struct FslIMX25State { |
20 | trace_gicv3_icc_ctlr_el3_write(gicv3_redist_affid(cs), value); | 16 | * 0xBB00_0000 0xBB00_0FFF 4 Kbytes NAND flash main area buffer |
21 | 17 | * 0xBB00_1000 0xBB00_11FF 512 B NAND flash spare area buffer | |
22 | /* *_EL1NS and *_EL1S bits are aliases into the ICC_CTLR_EL1 bits. */ | 18 | * 0xBB00_1200 0xBB00_1DFF 3 Kbytes Reserved |
23 | - cs->icc_ctlr_el1[GICV3_NS] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 19 | - * 0xBB00_1E00 0xBB00_1FFF 512 B NAND flash control regisers |
24 | + cs->icc_ctlr_el1[GICV3_NS] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 20 | + * 0xBB00_1E00 0xBB00_1FFF 512 B NAND flash control registers |
25 | if (value & ICC_CTLR_EL3_EOIMODE_EL1NS) { | 21 | * 0xBB01_2000 0xBFFF_FFFF 96 Mbytes (minus 8 Kbytes) Reserved |
26 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_EOIMODE; | 22 | * 0xC000_0000 0xFFFF_FFFF 1024 Mbytes Reserved |
27 | } | 23 | */ |
28 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, | ||
29 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_CBPR; | ||
30 | } | ||
31 | |||
32 | - cs->icc_ctlr_el1[GICV3_S] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | ||
33 | + cs->icc_ctlr_el1[GICV3_S] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | ||
34 | if (value & ICC_CTLR_EL3_EOIMODE_EL1S) { | ||
35 | cs->icc_ctlr_el1[GICV3_S] |= ICC_CTLR_EL1_EOIMODE; | ||
36 | } | ||
37 | -- | 24 | -- |
38 | 2.20.1 | 25 | 2.20.1 |
39 | 26 | ||
40 | 27 | diff view generated by jsdifflib |
1 | In ich_vmcr_write() we enforce "writes of BPR fields to less than | 1 | From: Graeme Gregory <graeme@nuviainc.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 | SMMUv3 has an error in a previous patch where an i was transposed to a 1 | ||
4 | meaning interrupts would not have been correctly assigned to the SMMUv3 | ||
5 | instance. | ||
6 | |||
7 | Fixes: 48ba18e6d3f3 ("hw/arm/sbsa-ref: Simplify by moving the gic in the machine state") | ||
8 | Signed-off-by: Graeme Gregory <graeme@nuviainc.com> | ||
9 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
10 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
11 | Message-id: 20201007100732.4103790-2-graeme@nuviainc.com | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | 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 | --- | 13 | --- |
11 | hw/intc/arm_gicv3_cpuif.c | 2 +- | 14 | hw/arm/sbsa-ref.c | 2 +- |
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | 15 | 1 file changed, 1 insertion(+), 1 deletion(-) |
13 | 16 | ||
14 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | 17 | diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c |
15 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/hw/intc/arm_gicv3_cpuif.c | 19 | --- a/hw/arm/sbsa-ref.c |
17 | +++ b/hw/intc/arm_gicv3_cpuif.c | 20 | +++ b/hw/arm/sbsa-ref.c |
18 | @@ -XXX,XX +XXX,XX @@ static void ich_vmcr_write(CPUARMState *env, const ARMCPRegInfo *ri, | 21 | @@ -XXX,XX +XXX,XX @@ static void create_smmu(const SBSAMachineState *sms, PCIBus *bus) |
19 | /* Enforce "writing BPRs to less than minimum sets them to the minimum" | 22 | sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base); |
20 | * by reading and writing back the fields. | 23 | for (i = 0; i < NUM_SMMU_IRQS; i++) { |
21 | */ | 24 | sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, |
22 | - write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G0)); | 25 | - qdev_get_gpio_in(sms->gic, irq + 1)); |
23 | + write_vbpr(cs, GICV3_G0, read_vbpr(cs, GICV3_G0)); | 26 | + qdev_get_gpio_in(sms->gic, irq + i)); |
24 | write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G1)); | 27 | } |
25 | 28 | } | |
26 | gicv3_cpuif_virt_update(cs); | 29 | |
27 | -- | 30 | -- |
28 | 2.20.1 | 31 | 2.20.1 |
29 | 32 | ||
30 | 33 | diff view generated by jsdifflib |
1 | From: Alistair Francis <alistair.francis@wdc.com> | 1 | From: Graeme Gregory <graeme@nuviainc.com> |
---|---|---|---|
2 | 2 | ||
3 | Commit 89e68b575 "target/arm: Use vector operations for saturation" | 3 | Original commit did not allocate IRQs for the SMMUv3 in the irqmap |
4 | causes this abort() when booting QEMU ARM with a Cortex-A15: | 4 | effectively using irq 0->3 (shared with other devices). Assuming |
5 | original intent was to allocate unique IRQs then add an allocation | ||
6 | to the irqmap. | ||
5 | 7 | ||
6 | 0 0x00007ffff4c2382f in raise () at /usr/lib/libc.so.6 | 8 | Fixes: e9fdf453240 ("hw/arm: Add arm SBSA reference machine, devices part") |
7 | 1 0x00007ffff4c0e672 in abort () at /usr/lib/libc.so.6 | 9 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> |
8 | 2 0x00005555559c1839 in disas_neon_data_insn (insn=<optimized out>, s=<optimized out>) at ./target/arm/translate.c:6673 | 10 | Signed-off-by: Graeme Gregory <graeme@nuviainc.com> |
9 | 3 0x00005555559c1839 in disas_neon_data_insn (s=<optimized out>, insn=<optimized out>) at ./target/arm/translate.c:6386 | 11 | Reviewed-by: Eric Auger <eric.auger@redhat.com> |
10 | 4 0x00005555559cd8a4 in disas_arm_insn (insn=4081107068, s=0x7fffe59a9510) at ./target/arm/translate.c:9289 | 12 | Message-id: 20201007100732.4103790-3-graeme@nuviainc.com |
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> | 13 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
33 | --- | 14 | --- |
34 | target/arm/translate.c | 4 ++-- | 15 | hw/arm/sbsa-ref.c | 1 + |
35 | 1 file changed, 2 insertions(+), 2 deletions(-) | 16 | 1 file changed, 1 insertion(+) |
36 | 17 | ||
37 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 18 | diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c |
38 | index XXXXXXX..XXXXXXX 100644 | 19 | index XXXXXXX..XXXXXXX 100644 |
39 | --- a/target/arm/translate.c | 20 | --- a/hw/arm/sbsa-ref.c |
40 | +++ b/target/arm/translate.c | 21 | +++ b/hw/arm/sbsa-ref.c |
41 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | 22 | @@ -XXX,XX +XXX,XX @@ static const int sbsa_ref_irqmap[] = { |
42 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | 23 | [SBSA_SECURE_UART_MM] = 9, |
43 | rn_ofs, rm_ofs, vec_size, vec_size, | 24 | [SBSA_AHCI] = 10, |
44 | (u ? uqadd_op : sqadd_op) + size); | 25 | [SBSA_EHCI] = 11, |
45 | - break; | 26 | + [SBSA_SMMU] = 12, /* ... to 15 */ |
46 | + return 0; | 27 | }; |
47 | 28 | ||
48 | case NEON_3R_VQSUB: | 29 | static uint64_t sbsa_ref_cpu_mp_affinity(SBSAMachineState *sms, int idx) |
49 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | ||
50 | rn_ofs, rm_ofs, vec_size, vec_size, | ||
51 | (u ? uqsub_op : sqsub_op) + size); | ||
52 | - break; | ||
53 | + return 0; | ||
54 | |||
55 | case NEON_3R_VMUL: /* VMUL */ | ||
56 | if (u) { | ||
57 | -- | 30 | -- |
58 | 2.20.1 | 31 | 2.20.1 |
59 | 32 | ||
60 | 33 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Philippe Mathieu-Daudé <f4bug@amsat.org> |
---|---|---|---|
2 | 2 | ||
3 | It eases code review, unit is explicit. | 3 | The "BCM2835 ARM Peripherals" datasheet [*] chapter 2 |
4 | ("Auxiliaries: UART1 & SPI1, SPI2"), list the register | ||
5 | sizes as 3/8/16/32 bits. We assume this means this | ||
6 | peripheral allows 8-bit accesses. | ||
4 | 7 | ||
5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 8 | This was not an issue until commit 5d971f9e67 which reverted |
6 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 9 | ("memory: accept mismatching sizes in memory_region_access_valid"). |
7 | Message-id: 20190520214342.13709-3-philmd@redhat.com | 10 | |
11 | The model is implemented as 32-bit accesses (see commit 97398d900c, | ||
12 | all registers are 32-bit) so replace MemoryRegionOps.valid as | ||
13 | MemoryRegionOps.impl, and re-introduce MemoryRegionOps.valid | ||
14 | with a 8/32-bit range. | ||
15 | |||
16 | [*] https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf | ||
17 | |||
18 | Fixes: 97398d900c ("bcm2835_aux: add emulation of BCM2835 AUX (aka UART1) block") | ||
19 | Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
20 | Message-id: 20201002181032.1899463-1-f4bug@amsat.org | ||
21 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 22 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 23 | --- |
10 | hw/arm/exynos4_boards.c | 5 +++-- | 24 | hw/char/bcm2835_aux.c | 4 +++- |
11 | 1 file changed, 3 insertions(+), 2 deletions(-) | 25 | 1 file changed, 3 insertions(+), 1 deletion(-) |
12 | 26 | ||
13 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 27 | diff --git a/hw/char/bcm2835_aux.c b/hw/char/bcm2835_aux.c |
14 | index XXXXXXX..XXXXXXX 100644 | 28 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/hw/arm/exynos4_boards.c | 29 | --- a/hw/char/bcm2835_aux.c |
16 | +++ b/hw/arm/exynos4_boards.c | 30 | +++ b/hw/char/bcm2835_aux.c |
17 | @@ -XXX,XX +XXX,XX @@ | 31 | @@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps bcm2835_aux_ops = { |
18 | */ | 32 | .read = bcm2835_aux_read, |
19 | 33 | .write = bcm2835_aux_write, | |
20 | #include "qemu/osdep.h" | 34 | .endianness = DEVICE_NATIVE_ENDIAN, |
21 | +#include "qemu/units.h" | 35 | - .valid.min_access_size = 4, |
22 | #include "qapi/error.h" | 36 | + .impl.min_access_size = 4, |
23 | #include "qemu/error-report.h" | 37 | + .impl.max_access_size = 4, |
24 | #include "qemu-common.h" | 38 | + .valid.min_access_size = 1, |
25 | @@ -XXX,XX +XXX,XX @@ static int exynos4_board_smp_bootreg_addr[EXYNOS4_NUM_OF_BOARDS] = { | 39 | .valid.max_access_size = 4, |
26 | }; | 40 | }; |
27 | 41 | ||
28 | static unsigned long exynos4_board_ram_size[EXYNOS4_NUM_OF_BOARDS] = { | ||
29 | - [EXYNOS4_BOARD_NURI] = 0x40000000, | ||
30 | - [EXYNOS4_BOARD_SMDKC210] = 0x40000000, | ||
31 | + [EXYNOS4_BOARD_NURI] = 1 * GiB, | ||
32 | + [EXYNOS4_BOARD_SMDKC210] = 1 * GiB, | ||
33 | }; | ||
34 | |||
35 | static struct arm_boot_info exynos4_board_binfo = { | ||
36 | -- | 42 | -- |
37 | 2.20.1 | 43 | 2.20.1 |
38 | 44 | ||
39 | 45 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Andrew Jones <drjones@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | The mask implied by the extract is redundant with the one | 3 | Update against Linux 5.9-rc7. |
4 | implied by the deposit. Also, fix spelling of BFXIL. | ||
5 | 4 | ||
6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | 5 | Cc: Paolo Bonzini <pbonzini@redhat.com> |
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 6 | Signed-off-by: Andrew Jones <drjones@redhat.com> |
8 | Message-id: 20190514011129.11330-3-richard.henderson@linaro.org | 7 | Message-id: 20201001061718.101915-2-drjones@redhat.com |
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
10 | --- | 9 | --- |
11 | target/arm/translate-a64.c | 6 +++--- | 10 | linux-headers/linux/kvm.h | 6 ++++-- |
12 | 1 file changed, 3 insertions(+), 3 deletions(-) | 11 | 1 file changed, 4 insertions(+), 2 deletions(-) |
13 | 12 | ||
14 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 13 | diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h |
15 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-a64.c | 15 | --- a/linux-headers/linux/kvm.h |
17 | +++ b/target/arm/translate-a64.c | 16 | +++ b/linux-headers/linux/kvm.h |
18 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) | 17 | @@ -XXX,XX +XXX,XX @@ struct kvm_ppc_resize_hpt { |
19 | tcg_gen_extract_i64(tcg_rd, tcg_tmp, ri, len); | 18 | #define KVM_VM_PPC_HV 1 |
20 | return; | 19 | #define KVM_VM_PPC_PR 2 |
21 | } | 20 | |
22 | - /* opc == 1, BXFIL fall through to deposit */ | 21 | -/* on MIPS, 0 forces trap & emulate, 1 forces VZ ASE */ |
23 | - tcg_gen_extract_i64(tcg_tmp, tcg_tmp, ri, len); | 22 | -#define KVM_VM_MIPS_TE 0 |
24 | + /* opc == 1, BFXIL fall through to deposit */ | 23 | +/* on MIPS, 0 indicates auto, 1 forces VZ ASE, 2 forces trap & emulate */ |
25 | + tcg_gen_shri_i64(tcg_tmp, tcg_tmp, ri); | 24 | +#define KVM_VM_MIPS_AUTO 0 |
26 | pos = 0; | 25 | #define KVM_VM_MIPS_VZ 1 |
27 | } else { | 26 | +#define KVM_VM_MIPS_TE 2 |
28 | /* Handle the ri > si case with a deposit | 27 | |
29 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) | 28 | #define KVM_S390_SIE_PAGE_OFFSET 1 |
30 | len = ri; | 29 | |
31 | } | 30 | @@ -XXX,XX +XXX,XX @@ struct kvm_ppc_resize_hpt { |
32 | 31 | #define KVM_CAP_LAST_CPU 184 | |
33 | - if (opc == 1) { /* BFM, BXFIL */ | 32 | #define KVM_CAP_SMALLER_MAXPHYADDR 185 |
34 | + if (opc == 1) { /* BFM, BFXIL */ | 33 | #define KVM_CAP_S390_DIAG318 186 |
35 | tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_tmp, pos, len); | 34 | +#define KVM_CAP_STEAL_TIME 187 |
36 | } else { | 35 | |
37 | /* SBFM or UBFM: We start with zero, and we haven't modified | 36 | #ifdef KVM_CAP_IRQ_ROUTING |
37 | |||
38 | -- | 38 | -- |
39 | 2.20.1 | 39 | 2.20.1 |
40 | 40 | ||
41 | 41 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Andrew Jones <drjones@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 3 | When we compile without KVM support !defined(CONFIG_KVM) we generate |
4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 4 | stubs for functions that the linker will still encounter. Sometimes |
5 | Message-id: 20190520214342.13709-5-philmd@redhat.com | 5 | these stubs can be executed safely and are placed in paths where they |
6 | get executed with or without KVM. Other functions should never be | ||
7 | called without KVM. Those functions should be guarded by kvm_enabled(), | ||
8 | but should also be robust to refactoring mistakes. Putting a | ||
9 | g_assert_not_reached() in the function should help. Additionally, | ||
10 | the g_assert_not_reached() calls may actually help the linker remove | ||
11 | some code. | ||
12 | |||
13 | We remove the stubs for kvm_arm_get/put_virtual_time(), as they aren't | ||
14 | necessary at all - the only caller is in kvm.c | ||
15 | |||
16 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
17 | Signed-off-by: Andrew Jones <drjones@redhat.com> | ||
18 | Message-id: 20201001061718.101915-3-drjones@redhat.com | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 19 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 20 | --- |
8 | include/hw/arm/exynos4210.h | 9 +++++++-- | 21 | target/arm/kvm_arm.h | 51 +++++++++++++++++++++++++++----------------- |
9 | hw/arm/exynos4210.c | 28 ++++++++++++++++++++++++---- | 22 | 1 file changed, 32 insertions(+), 19 deletions(-) |
10 | hw/arm/exynos4_boards.c | 9 ++++++--- | ||
11 | 3 files changed, 37 insertions(+), 9 deletions(-) | ||
12 | 23 | ||
13 | diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h | 24 | diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h |
14 | index XXXXXXX..XXXXXXX 100644 | 25 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/include/hw/arm/exynos4210.h | 26 | --- a/target/arm/kvm_arm.h |
16 | +++ b/include/hw/arm/exynos4210.h | 27 | +++ b/target/arm/kvm_arm.h |
17 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210Irq { | 28 | @@ -XXX,XX +XXX,XX @@ int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level); |
18 | } Exynos4210Irq; | 29 | |
19 | 30 | #else | |
20 | typedef struct Exynos4210State { | 31 | |
21 | + /*< private >*/ | 32 | -static inline void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) |
22 | + SysBusDevice parent_obj; | 33 | -{ |
23 | + /*< public >*/ | 34 | - /* |
24 | ARMCPU *cpu[EXYNOS4210_NCPUS]; | 35 | - * This should never actually be called in the "not KVM" case, |
25 | Exynos4210Irq irqs; | 36 | - * but set up the fields to indicate an error anyway. |
26 | qemu_irq *irq_table; | 37 | - */ |
27 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210State { | 38 | - cpu->kvm_target = QEMU_KVM_ARM_TARGET_NONE; |
28 | I2CBus *i2c_if[EXYNOS4210_I2C_NUMBER]; | 39 | - cpu->host_cpu_probe_failed = true; |
29 | } Exynos4210State; | 40 | -} |
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 | - | 41 | - |
40 | /* Initialize exynos4210 IRQ subsystem stub */ | 42 | -static inline void kvm_arm_add_vcpu_properties(Object *obj) {} |
41 | qemu_irq *exynos4210_init_irq(Exynos4210Irq *env); | 43 | - |
42 | 44 | +/* | |
43 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | 45 | + * It's safe to call these functions without KVM support. |
44 | index XXXXXXX..XXXXXXX 100644 | 46 | + * They should either do nothing or return "not supported". |
45 | --- a/hw/arm/exynos4210.c | 47 | + */ |
46 | +++ b/hw/arm/exynos4210.c | 48 | static inline bool kvm_arm_aarch32_supported(void) |
47 | @@ -XXX,XX +XXX,XX @@ static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | 49 | { |
48 | sysbus_connect_irq(busdev, 0, irq); | 50 | return false; |
51 | @@ -XXX,XX +XXX,XX @@ static inline bool kvm_arm_sve_supported(void) | ||
52 | return false; | ||
49 | } | 53 | } |
50 | 54 | ||
51 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | 55 | +/* |
52 | +static void exynos4210_realize(DeviceState *socdev, Error **errp) | 56 | + * These functions should never actually be called without KVM support. |
53 | { | 57 | + */ |
54 | - Exynos4210State *s = g_new0(Exynos4210State, 1); | 58 | +static inline void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu) |
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 | +{ | 59 | +{ |
70 | + DeviceClass *dc = DEVICE_CLASS(klass); | 60 | + g_assert_not_reached(); |
71 | + | ||
72 | + dc->realize = exynos4210_realize; | ||
73 | +} | 61 | +} |
74 | + | 62 | + |
75 | +static const TypeInfo exynos4210_info = { | 63 | +static inline void kvm_arm_add_vcpu_properties(Object *obj) |
76 | + .name = TYPE_EXYNOS4210_SOC, | ||
77 | + .parent = TYPE_SYS_BUS_DEVICE, | ||
78 | + .instance_size = sizeof(Exynos4210State), | ||
79 | + .class_init = exynos4210_class_init, | ||
80 | +}; | ||
81 | + | ||
82 | +static void exynos4210_register_types(void) | ||
83 | +{ | 64 | +{ |
84 | + type_register_static(&exynos4210_info); | 65 | + g_assert_not_reached(); |
85 | +} | 66 | +} |
86 | + | 67 | + |
87 | +type_init(exynos4210_register_types) | 68 | static inline int kvm_arm_get_max_vm_ipa_size(MachineState *ms) |
88 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 69 | { |
89 | index XXXXXXX..XXXXXXX 100644 | 70 | - return -ENOENT; |
90 | --- a/hw/arm/exynos4_boards.c | 71 | + g_assert_not_reached(); |
91 | +++ b/hw/arm/exynos4_boards.c | ||
92 | @@ -XXX,XX +XXX,XX @@ typedef enum Exynos4BoardType { | ||
93 | } Exynos4BoardType; | ||
94 | |||
95 | typedef struct Exynos4BoardState { | ||
96 | - Exynos4210State *soc; | ||
97 | + Exynos4210State soc; | ||
98 | MemoryRegion dram0_mem; | ||
99 | MemoryRegion dram1_mem; | ||
100 | } Exynos4BoardState; | ||
101 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | ||
102 | exynos4_boards_init_ram(s, get_system_memory(), | ||
103 | exynos4_board_ram_size[board_type]); | ||
104 | |||
105 | - s->soc = exynos4210_init(get_system_memory()); | ||
106 | + object_initialize(&s->soc, sizeof(s->soc), TYPE_EXYNOS4210_SOC); | ||
107 | + qdev_set_parent_bus(DEVICE(&s->soc), sysbus_get_default()); | ||
108 | + object_property_set_bool(OBJECT(&s->soc), true, "realized", | ||
109 | + &error_fatal); | ||
110 | |||
111 | return s; | ||
112 | } | 72 | } |
113 | @@ -XXX,XX +XXX,XX @@ static void smdkc210_init(MachineState *machine) | 73 | |
114 | EXYNOS4_BOARD_SMDKC210); | 74 | static inline int kvm_arm_vgic_probe(void) |
115 | 75 | { | |
116 | lan9215_init(SMDK_LAN9118_BASE_ADDR, | 76 | - return 0; |
117 | - qemu_irq_invert(s->soc->irq_table[exynos4210_get_irq(37, 1)])); | 77 | + g_assert_not_reached(); |
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 | } | 78 | } |
121 | 79 | ||
80 | -static inline void kvm_arm_pmu_set_irq(CPUState *cs, int irq) {} | ||
81 | -static inline void kvm_arm_pmu_init(CPUState *cs) {} | ||
82 | +static inline void kvm_arm_pmu_set_irq(CPUState *cs, int irq) | ||
83 | +{ | ||
84 | + g_assert_not_reached(); | ||
85 | +} | ||
86 | |||
87 | -static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map) {} | ||
88 | +static inline void kvm_arm_pmu_init(CPUState *cs) | ||
89 | +{ | ||
90 | + g_assert_not_reached(); | ||
91 | +} | ||
92 | + | ||
93 | +static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map) | ||
94 | +{ | ||
95 | + g_assert_not_reached(); | ||
96 | +} | ||
97 | |||
98 | -static inline void kvm_arm_get_virtual_time(CPUState *cs) {} | ||
99 | -static inline void kvm_arm_put_virtual_time(CPUState *cs) {} | ||
100 | #endif | ||
101 | |||
102 | static inline const char *gic_class_name(void) | ||
122 | -- | 103 | -- |
123 | 2.20.1 | 104 | 2.20.1 |
124 | 105 | ||
125 | 106 | diff view generated by jsdifflib |
1 | The header file hw/arm/arm.h now includes only declarations | 1 | From: Andrew Jones <drjones@redhat.com> |
---|---|---|---|
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 | We'll add more to this new function in coming patches so we also |
6 | perl -pi -e 's|hw/arm/arm.h|hw/arm/boot.h|' hw/arm/*.c include/hw/arm/*.h | 4 | state the gic must be created and call it below create_gic(). |
7 | 5 | ||
8 | In a few cases we can just delete the #include: | 6 | No functional change intended. |
9 | hw/arm/msf2-soc.c, include/hw/arm/aspeed_soc.h and | ||
10 | include/hw/arm/bcm2836.h did not require it. | ||
11 | 7 | ||
8 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | Signed-off-by: Andrew Jones <drjones@redhat.com> | ||
11 | Message-id: 20201001061718.101915-4-drjones@redhat.com | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
13 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
14 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
15 | Message-id: 20190516163857.6430-4-peter.maydell@linaro.org | ||
16 | --- | 13 | --- |
17 | include/hw/arm/allwinner-a10.h | 2 +- | 14 | hw/arm/virt.c | 43 +++++++++++++++++++++++++++---------------- |
18 | include/hw/arm/aspeed_soc.h | 1 - | 15 | 1 file changed, 27 insertions(+), 16 deletions(-) |
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 | 16 | ||
69 | diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h | ||
70 | index XXXXXXX..XXXXXXX 100644 | ||
71 | --- a/include/hw/arm/allwinner-a10.h | ||
72 | +++ b/include/hw/arm/allwinner-a10.h | ||
73 | @@ -XXX,XX +XXX,XX @@ | ||
74 | #include "qemu-common.h" | ||
75 | #include "qemu/error-report.h" | ||
76 | #include "hw/char/serial.h" | ||
77 | -#include "hw/arm/arm.h" | ||
78 | +#include "hw/arm/boot.h" | ||
79 | #include "hw/timer/allwinner-a10-pit.h" | ||
80 | #include "hw/intc/allwinner-a10-pic.h" | ||
81 | #include "hw/net/allwinner_emac.h" | ||
82 | diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h | ||
83 | index XXXXXXX..XXXXXXX 100644 | ||
84 | --- a/include/hw/arm/aspeed_soc.h | ||
85 | +++ b/include/hw/arm/aspeed_soc.h | ||
86 | @@ -XXX,XX +XXX,XX @@ | ||
87 | #ifndef ASPEED_SOC_H | ||
88 | #define ASPEED_SOC_H | ||
89 | |||
90 | -#include "hw/arm/arm.h" | ||
91 | #include "hw/intc/aspeed_vic.h" | ||
92 | #include "hw/misc/aspeed_scu.h" | ||
93 | #include "hw/misc/aspeed_sdmc.h" | ||
94 | diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h | ||
95 | index XXXXXXX..XXXXXXX 100644 | ||
96 | --- a/include/hw/arm/bcm2836.h | ||
97 | +++ b/include/hw/arm/bcm2836.h | ||
98 | @@ -XXX,XX +XXX,XX @@ | ||
99 | #ifndef BCM2836_H | ||
100 | #define BCM2836_H | ||
101 | |||
102 | -#include "hw/arm/arm.h" | ||
103 | #include "hw/arm/bcm2835_peripherals.h" | ||
104 | #include "hw/intc/bcm2836_control.h" | ||
105 | |||
106 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/boot.h | ||
107 | similarity index 98% | ||
108 | rename from include/hw/arm/arm.h | ||
109 | rename to include/hw/arm/boot.h | ||
110 | index XXXXXXX..XXXXXXX 100644 | ||
111 | --- a/include/hw/arm/arm.h | ||
112 | +++ b/include/hw/arm/boot.h | ||
113 | @@ -XXX,XX +XXX,XX @@ | ||
114 | /* | ||
115 | - * Misc ARM declarations | ||
116 | + * ARM kernel loader. | ||
117 | * | ||
118 | * Copyright (c) 2006 CodeSourcery. | ||
119 | * Written by Paul Brook | ||
120 | @@ -XXX,XX +XXX,XX @@ | ||
121 | * | ||
122 | */ | ||
123 | |||
124 | -#ifndef HW_ARM_H | ||
125 | -#define HW_ARM_H | ||
126 | +#ifndef HW_ARM_BOOT_H | ||
127 | +#define HW_ARM_BOOT_H | ||
128 | |||
129 | #include "exec/memory.h" | ||
130 | #include "target/arm/cpu-qom.h" | ||
131 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, | ||
132 | const struct arm_boot_info *info, | ||
133 | hwaddr mvbar_addr); | ||
134 | |||
135 | -#endif /* HW_ARM_H */ | ||
136 | +#endif /* HW_ARM_BOOT_H */ | ||
137 | diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h | ||
138 | index XXXXXXX..XXXXXXX 100644 | ||
139 | --- a/include/hw/arm/fsl-imx25.h | ||
140 | +++ b/include/hw/arm/fsl-imx25.h | ||
141 | @@ -XXX,XX +XXX,XX @@ | ||
142 | #ifndef FSL_IMX25_H | ||
143 | #define FSL_IMX25_H | ||
144 | |||
145 | -#include "hw/arm/arm.h" | ||
146 | +#include "hw/arm/boot.h" | ||
147 | #include "hw/intc/imx_avic.h" | ||
148 | #include "hw/misc/imx25_ccm.h" | ||
149 | #include "hw/char/imx_serial.h" | ||
150 | diff --git a/include/hw/arm/fsl-imx31.h b/include/hw/arm/fsl-imx31.h | ||
151 | index XXXXXXX..XXXXXXX 100644 | ||
152 | --- a/include/hw/arm/fsl-imx31.h | ||
153 | +++ b/include/hw/arm/fsl-imx31.h | ||
154 | @@ -XXX,XX +XXX,XX @@ | ||
155 | #ifndef FSL_IMX31_H | ||
156 | #define FSL_IMX31_H | ||
157 | |||
158 | -#include "hw/arm/arm.h" | ||
159 | +#include "hw/arm/boot.h" | ||
160 | #include "hw/intc/imx_avic.h" | ||
161 | #include "hw/misc/imx31_ccm.h" | ||
162 | #include "hw/char/imx_serial.h" | ||
163 | diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h | ||
164 | index XXXXXXX..XXXXXXX 100644 | ||
165 | --- a/include/hw/arm/fsl-imx6.h | ||
166 | +++ b/include/hw/arm/fsl-imx6.h | ||
167 | @@ -XXX,XX +XXX,XX @@ | ||
168 | #ifndef FSL_IMX6_H | ||
169 | #define FSL_IMX6_H | ||
170 | |||
171 | -#include "hw/arm/arm.h" | ||
172 | +#include "hw/arm/boot.h" | ||
173 | #include "hw/cpu/a9mpcore.h" | ||
174 | #include "hw/misc/imx6_ccm.h" | ||
175 | #include "hw/misc/imx6_src.h" | ||
176 | diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h | ||
177 | index XXXXXXX..XXXXXXX 100644 | ||
178 | --- a/include/hw/arm/fsl-imx6ul.h | ||
179 | +++ b/include/hw/arm/fsl-imx6ul.h | ||
180 | @@ -XXX,XX +XXX,XX @@ | ||
181 | #ifndef FSL_IMX6UL_H | ||
182 | #define FSL_IMX6UL_H | ||
183 | |||
184 | -#include "hw/arm/arm.h" | ||
185 | +#include "hw/arm/boot.h" | ||
186 | #include "hw/cpu/a15mpcore.h" | ||
187 | #include "hw/misc/imx6ul_ccm.h" | ||
188 | #include "hw/misc/imx6_src.h" | ||
189 | diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h | ||
190 | index XXXXXXX..XXXXXXX 100644 | ||
191 | --- a/include/hw/arm/fsl-imx7.h | ||
192 | +++ b/include/hw/arm/fsl-imx7.h | ||
193 | @@ -XXX,XX +XXX,XX @@ | ||
194 | #ifndef FSL_IMX7_H | ||
195 | #define FSL_IMX7_H | ||
196 | |||
197 | -#include "hw/arm/arm.h" | ||
198 | +#include "hw/arm/boot.h" | ||
199 | #include "hw/cpu/a15mpcore.h" | ||
200 | #include "hw/intc/imx_gpcv2.h" | ||
201 | #include "hw/misc/imx7_ccm.h" | ||
202 | diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h | ||
203 | index XXXXXXX..XXXXXXX 100644 | ||
204 | --- a/include/hw/arm/virt.h | ||
205 | +++ b/include/hw/arm/virt.h | ||
206 | @@ -XXX,XX +XXX,XX @@ | ||
207 | #include "exec/hwaddr.h" | ||
208 | #include "qemu/notify.h" | ||
209 | #include "hw/boards.h" | ||
210 | -#include "hw/arm/arm.h" | ||
211 | +#include "hw/arm/boot.h" | ||
212 | #include "hw/block/flash.h" | ||
213 | #include "sysemu/kvm.h" | ||
214 | #include "hw/intc/arm_gicv3_common.h" | ||
215 | diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h | ||
216 | index XXXXXXX..XXXXXXX 100644 | ||
217 | --- a/include/hw/arm/xlnx-versal.h | ||
218 | +++ b/include/hw/arm/xlnx-versal.h | ||
219 | @@ -XXX,XX +XXX,XX @@ | ||
220 | #define XLNX_VERSAL_H | ||
221 | |||
222 | #include "hw/sysbus.h" | ||
223 | -#include "hw/arm/arm.h" | ||
224 | +#include "hw/arm/boot.h" | ||
225 | #include "hw/intc/arm_gicv3.h" | ||
226 | |||
227 | #define TYPE_XLNX_VERSAL "xlnx-versal" | ||
228 | diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h | ||
229 | index XXXXXXX..XXXXXXX 100644 | ||
230 | --- a/include/hw/arm/xlnx-zynqmp.h | ||
231 | +++ b/include/hw/arm/xlnx-zynqmp.h | ||
232 | @@ -XXX,XX +XXX,XX @@ | ||
233 | #ifndef XLNX_ZYNQMP_H | ||
234 | |||
235 | #include "qemu-common.h" | ||
236 | -#include "hw/arm/arm.h" | ||
237 | +#include "hw/arm/boot.h" | ||
238 | #include "hw/intc/arm_gic.h" | ||
239 | #include "hw/net/cadence_gem.h" | ||
240 | #include "hw/char/cadence_uart.h" | ||
241 | diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c | ||
242 | index XXXXXXX..XXXXXXX 100644 | ||
243 | --- a/hw/arm/armsse.c | ||
244 | +++ b/hw/arm/armsse.c | ||
245 | @@ -XXX,XX +XXX,XX @@ | ||
246 | #include "hw/sysbus.h" | ||
247 | #include "hw/registerfields.h" | ||
248 | #include "hw/arm/armsse.h" | ||
249 | -#include "hw/arm/arm.h" | ||
250 | +#include "hw/arm/boot.h" | ||
251 | |||
252 | /* Format of the System Information block SYS_CONFIG register */ | ||
253 | typedef enum SysConfigFormat { | ||
254 | diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c | ||
255 | index XXXXXXX..XXXXXXX 100644 | ||
256 | --- a/hw/arm/armv7m.c | ||
257 | +++ b/hw/arm/armv7m.c | ||
258 | @@ -XXX,XX +XXX,XX @@ | ||
259 | #include "qemu-common.h" | ||
260 | #include "cpu.h" | ||
261 | #include "hw/sysbus.h" | ||
262 | -#include "hw/arm/arm.h" | ||
263 | +#include "hw/arm/boot.h" | ||
264 | #include "hw/loader.h" | ||
265 | #include "elf.h" | ||
266 | #include "sysemu/qtest.h" | ||
267 | diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c | ||
268 | index XXXXXXX..XXXXXXX 100644 | ||
269 | --- a/hw/arm/aspeed.c | ||
270 | +++ b/hw/arm/aspeed.c | ||
271 | @@ -XXX,XX +XXX,XX @@ | ||
272 | #include "qemu-common.h" | ||
273 | #include "cpu.h" | ||
274 | #include "exec/address-spaces.h" | ||
275 | -#include "hw/arm/arm.h" | ||
276 | +#include "hw/arm/boot.h" | ||
277 | #include "hw/arm/aspeed.h" | ||
278 | #include "hw/arm/aspeed_soc.h" | ||
279 | #include "hw/boards.h" | ||
280 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | ||
281 | index XXXXXXX..XXXXXXX 100644 | ||
282 | --- a/hw/arm/boot.c | ||
283 | +++ b/hw/arm/boot.c | ||
284 | @@ -XXX,XX +XXX,XX @@ | ||
285 | #include "qapi/error.h" | ||
286 | #include <libfdt.h> | ||
287 | #include "hw/hw.h" | ||
288 | -#include "hw/arm/arm.h" | ||
289 | +#include "hw/arm/boot.h" | ||
290 | #include "hw/arm/linux-boot-if.h" | ||
291 | #include "sysemu/kvm.h" | ||
292 | #include "sysemu/sysemu.h" | ||
293 | diff --git a/hw/arm/collie.c b/hw/arm/collie.c | ||
294 | index XXXXXXX..XXXXXXX 100644 | ||
295 | --- a/hw/arm/collie.c | ||
296 | +++ b/hw/arm/collie.c | ||
297 | @@ -XXX,XX +XXX,XX @@ | ||
298 | #include "hw/sysbus.h" | ||
299 | #include "hw/boards.h" | ||
300 | #include "strongarm.h" | ||
301 | -#include "hw/arm/arm.h" | ||
302 | +#include "hw/arm/boot.h" | ||
303 | #include "hw/block/flash.h" | ||
304 | #include "exec/address-spaces.h" | ||
305 | #include "cpu.h" | ||
306 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | ||
307 | index XXXXXXX..XXXXXXX 100644 | ||
308 | --- a/hw/arm/exynos4210.c | ||
309 | +++ b/hw/arm/exynos4210.c | ||
310 | @@ -XXX,XX +XXX,XX @@ | ||
311 | #include "hw/boards.h" | ||
312 | #include "sysemu/sysemu.h" | ||
313 | #include "hw/sysbus.h" | ||
314 | -#include "hw/arm/arm.h" | ||
315 | +#include "hw/arm/boot.h" | ||
316 | #include "hw/loader.h" | ||
317 | #include "hw/arm/exynos4210.h" | ||
318 | #include "hw/sd/sdhci.h" | ||
319 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | ||
320 | index XXXXXXX..XXXXXXX 100644 | ||
321 | --- a/hw/arm/exynos4_boards.c | ||
322 | +++ b/hw/arm/exynos4_boards.c | ||
323 | @@ -XXX,XX +XXX,XX @@ | ||
324 | #include "sysemu/sysemu.h" | ||
325 | #include "hw/sysbus.h" | ||
326 | #include "net/net.h" | ||
327 | -#include "hw/arm/arm.h" | ||
328 | +#include "hw/arm/boot.h" | ||
329 | #include "exec/address-spaces.h" | ||
330 | #include "hw/arm/exynos4210.h" | ||
331 | #include "hw/net/lan9118.h" | ||
332 | diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c | ||
333 | index XXXXXXX..XXXXXXX 100644 | ||
334 | --- a/hw/arm/highbank.c | ||
335 | +++ b/hw/arm/highbank.c | ||
336 | @@ -XXX,XX +XXX,XX @@ | ||
337 | #include "qemu/osdep.h" | ||
338 | #include "qapi/error.h" | ||
339 | #include "hw/sysbus.h" | ||
340 | -#include "hw/arm/arm.h" | ||
341 | +#include "hw/arm/boot.h" | ||
342 | #include "hw/loader.h" | ||
343 | #include "net/net.h" | ||
344 | #include "sysemu/kvm.h" | ||
345 | diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c | ||
346 | index XXXXXXX..XXXXXXX 100644 | ||
347 | --- a/hw/arm/integratorcp.c | ||
348 | +++ b/hw/arm/integratorcp.c | ||
349 | @@ -XXX,XX +XXX,XX @@ | ||
350 | #include "cpu.h" | ||
351 | #include "hw/sysbus.h" | ||
352 | #include "hw/boards.h" | ||
353 | -#include "hw/arm/arm.h" | ||
354 | +#include "hw/arm/boot.h" | ||
355 | #include "hw/misc/arm_integrator_debug.h" | ||
356 | #include "hw/net/smc91c111.h" | ||
357 | #include "net/net.h" | ||
358 | diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c | ||
359 | index XXXXXXX..XXXXXXX 100644 | ||
360 | --- a/hw/arm/mainstone.c | ||
361 | +++ b/hw/arm/mainstone.c | ||
362 | @@ -XXX,XX +XXX,XX @@ | ||
363 | #include "qapi/error.h" | ||
364 | #include "hw/hw.h" | ||
365 | #include "hw/arm/pxa.h" | ||
366 | -#include "hw/arm/arm.h" | ||
367 | +#include "hw/arm/boot.h" | ||
368 | #include "net/net.h" | ||
369 | #include "hw/net/smc91c111.h" | ||
370 | #include "hw/boards.h" | ||
371 | diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c | ||
372 | index XXXXXXX..XXXXXXX 100644 | ||
373 | --- a/hw/arm/microbit.c | ||
374 | +++ b/hw/arm/microbit.c | ||
375 | @@ -XXX,XX +XXX,XX @@ | ||
376 | #include "qemu/osdep.h" | ||
377 | #include "qapi/error.h" | ||
378 | #include "hw/boards.h" | ||
379 | -#include "hw/arm/arm.h" | ||
380 | +#include "hw/arm/boot.h" | ||
381 | #include "sysemu/sysemu.h" | ||
382 | #include "exec/address-spaces.h" | ||
383 | |||
384 | diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c | ||
385 | index XXXXXXX..XXXXXXX 100644 | ||
386 | --- a/hw/arm/mps2-tz.c | ||
387 | +++ b/hw/arm/mps2-tz.c | ||
388 | @@ -XXX,XX +XXX,XX @@ | ||
389 | #include "qemu/osdep.h" | ||
390 | #include "qapi/error.h" | ||
391 | #include "qemu/error-report.h" | ||
392 | -#include "hw/arm/arm.h" | ||
393 | +#include "hw/arm/boot.h" | ||
394 | #include "hw/arm/armv7m.h" | ||
395 | #include "hw/or-irq.h" | ||
396 | #include "hw/boards.h" | ||
397 | diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c | ||
398 | index XXXXXXX..XXXXXXX 100644 | ||
399 | --- a/hw/arm/mps2.c | ||
400 | +++ b/hw/arm/mps2.c | ||
401 | @@ -XXX,XX +XXX,XX @@ | ||
402 | #include "qemu/osdep.h" | ||
403 | #include "qapi/error.h" | ||
404 | #include "qemu/error-report.h" | ||
405 | -#include "hw/arm/arm.h" | ||
406 | +#include "hw/arm/boot.h" | ||
407 | #include "hw/arm/armv7m.h" | ||
408 | #include "hw/or-irq.h" | ||
409 | #include "hw/boards.h" | ||
410 | diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c | ||
411 | index XXXXXXX..XXXXXXX 100644 | ||
412 | --- a/hw/arm/msf2-soc.c | ||
413 | +++ b/hw/arm/msf2-soc.c | ||
414 | @@ -XXX,XX +XXX,XX @@ | ||
415 | #include "qemu/units.h" | ||
416 | #include "qapi/error.h" | ||
417 | #include "qemu-common.h" | ||
418 | -#include "hw/arm/arm.h" | ||
419 | #include "exec/address-spaces.h" | ||
420 | #include "hw/char/serial.h" | ||
421 | #include "hw/boards.h" | ||
422 | diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c | ||
423 | index XXXXXXX..XXXXXXX 100644 | ||
424 | --- a/hw/arm/msf2-som.c | ||
425 | +++ b/hw/arm/msf2-som.c | ||
426 | @@ -XXX,XX +XXX,XX @@ | ||
427 | #include "qapi/error.h" | ||
428 | #include "qemu/error-report.h" | ||
429 | #include "hw/boards.h" | ||
430 | -#include "hw/arm/arm.h" | ||
431 | +#include "hw/arm/boot.h" | ||
432 | #include "exec/address-spaces.h" | ||
433 | #include "hw/arm/msf2-soc.h" | ||
434 | #include "cpu.h" | ||
435 | diff --git a/hw/arm/musca.c b/hw/arm/musca.c | ||
436 | index XXXXXXX..XXXXXXX 100644 | ||
437 | --- a/hw/arm/musca.c | ||
438 | +++ b/hw/arm/musca.c | ||
439 | @@ -XXX,XX +XXX,XX @@ | ||
440 | #include "qapi/error.h" | ||
441 | #include "exec/address-spaces.h" | ||
442 | #include "sysemu/sysemu.h" | ||
443 | -#include "hw/arm/arm.h" | ||
444 | +#include "hw/arm/boot.h" | ||
445 | #include "hw/arm/armsse.h" | ||
446 | #include "hw/boards.h" | ||
447 | #include "hw/char/pl011.h" | ||
448 | diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c | ||
449 | index XXXXXXX..XXXXXXX 100644 | ||
450 | --- a/hw/arm/musicpal.c | ||
451 | +++ b/hw/arm/musicpal.c | ||
452 | @@ -XXX,XX +XXX,XX @@ | ||
453 | #include "qemu-common.h" | ||
454 | #include "cpu.h" | ||
455 | #include "hw/sysbus.h" | ||
456 | -#include "hw/arm/arm.h" | ||
457 | +#include "hw/arm/boot.h" | ||
458 | #include "net/net.h" | ||
459 | #include "sysemu/sysemu.h" | ||
460 | #include "hw/boards.h" | ||
461 | diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c | ||
462 | index XXXXXXX..XXXXXXX 100644 | ||
463 | --- a/hw/arm/netduino2.c | ||
464 | +++ b/hw/arm/netduino2.c | ||
465 | @@ -XXX,XX +XXX,XX @@ | ||
466 | #include "hw/boards.h" | ||
467 | #include "qemu/error-report.h" | ||
468 | #include "hw/arm/stm32f205_soc.h" | ||
469 | -#include "hw/arm/arm.h" | ||
470 | +#include "hw/arm/boot.h" | ||
471 | |||
472 | static void netduino2_init(MachineState *machine) | ||
473 | { | ||
474 | diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c | ||
475 | index XXXXXXX..XXXXXXX 100644 | ||
476 | --- a/hw/arm/nrf51_soc.c | ||
477 | +++ b/hw/arm/nrf51_soc.c | ||
478 | @@ -XXX,XX +XXX,XX @@ | ||
479 | #include "qemu/osdep.h" | ||
480 | #include "qapi/error.h" | ||
481 | #include "qemu-common.h" | ||
482 | -#include "hw/arm/arm.h" | ||
483 | +#include "hw/arm/boot.h" | ||
484 | #include "hw/sysbus.h" | ||
485 | #include "hw/boards.h" | ||
486 | #include "hw/misc/unimp.h" | ||
487 | diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c | ||
488 | index XXXXXXX..XXXXXXX 100644 | ||
489 | --- a/hw/arm/nseries.c | ||
490 | +++ b/hw/arm/nseries.c | ||
491 | @@ -XXX,XX +XXX,XX @@ | ||
492 | #include "qemu/bswap.h" | ||
493 | #include "sysemu/sysemu.h" | ||
494 | #include "hw/arm/omap.h" | ||
495 | -#include "hw/arm/arm.h" | ||
496 | +#include "hw/arm/boot.h" | ||
497 | #include "hw/irq.h" | ||
498 | #include "ui/console.h" | ||
499 | #include "hw/boards.h" | ||
500 | diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c | ||
501 | index XXXXXXX..XXXXXXX 100644 | ||
502 | --- a/hw/arm/omap1.c | ||
503 | +++ b/hw/arm/omap1.c | ||
504 | @@ -XXX,XX +XXX,XX @@ | ||
505 | #include "cpu.h" | ||
506 | #include "hw/boards.h" | ||
507 | #include "hw/hw.h" | ||
508 | -#include "hw/arm/arm.h" | ||
509 | +#include "hw/arm/boot.h" | ||
510 | #include "hw/arm/omap.h" | ||
511 | #include "sysemu/sysemu.h" | ||
512 | #include "hw/arm/soc_dma.h" | ||
513 | diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c | ||
514 | index XXXXXXX..XXXXXXX 100644 | ||
515 | --- a/hw/arm/omap2.c | ||
516 | +++ b/hw/arm/omap2.c | ||
517 | @@ -XXX,XX +XXX,XX @@ | ||
518 | #include "sysemu/qtest.h" | ||
519 | #include "hw/boards.h" | ||
520 | #include "hw/hw.h" | ||
521 | -#include "hw/arm/arm.h" | ||
522 | +#include "hw/arm/boot.h" | ||
523 | #include "hw/arm/omap.h" | ||
524 | #include "sysemu/sysemu.h" | ||
525 | #include "qemu/timer.h" | ||
526 | diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c | ||
527 | index XXXXXXX..XXXXXXX 100644 | ||
528 | --- a/hw/arm/omap_sx1.c | ||
529 | +++ b/hw/arm/omap_sx1.c | ||
530 | @@ -XXX,XX +XXX,XX @@ | ||
531 | #include "ui/console.h" | ||
532 | #include "hw/arm/omap.h" | ||
533 | #include "hw/boards.h" | ||
534 | -#include "hw/arm/arm.h" | ||
535 | +#include "hw/arm/boot.h" | ||
536 | #include "hw/block/flash.h" | ||
537 | #include "sysemu/qtest.h" | ||
538 | #include "exec/address-spaces.h" | ||
539 | diff --git a/hw/arm/palm.c b/hw/arm/palm.c | ||
540 | index XXXXXXX..XXXXXXX 100644 | ||
541 | --- a/hw/arm/palm.c | ||
542 | +++ b/hw/arm/palm.c | ||
543 | @@ -XXX,XX +XXX,XX @@ | ||
544 | #include "ui/console.h" | ||
545 | #include "hw/arm/omap.h" | ||
546 | #include "hw/boards.h" | ||
547 | -#include "hw/arm/arm.h" | ||
548 | +#include "hw/arm/boot.h" | ||
549 | #include "hw/input/tsc2xxx.h" | ||
550 | #include "hw/loader.h" | ||
551 | #include "exec/address-spaces.h" | ||
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 | 17 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c |
670 | index XXXXXXX..XXXXXXX 100644 | 18 | index XXXXXXX..XXXXXXX 100644 |
671 | --- a/hw/arm/virt.c | 19 | --- a/hw/arm/virt.c |
672 | +++ b/hw/arm/virt.c | 20 | +++ b/hw/arm/virt.c |
673 | @@ -XXX,XX +XXX,XX @@ | 21 | @@ -XXX,XX +XXX,XX @@ static void finalize_gic_version(VirtMachineState *vms) |
674 | #include "qemu/option.h" | 22 | } |
675 | #include "qapi/error.h" | 23 | } |
676 | #include "hw/sysbus.h" | 24 | |
677 | -#include "hw/arm/arm.h" | 25 | +/* |
678 | +#include "hw/arm/boot.h" | 26 | + * virt_cpu_post_init() must be called after the CPUs have |
679 | #include "hw/arm/primecell.h" | 27 | + * been realized and the GIC has been created. |
680 | #include "hw/arm/virt.h" | 28 | + */ |
681 | #include "hw/block/flash.h" | 29 | +static void virt_cpu_post_init(VirtMachineState *vms) |
682 | diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c | 30 | +{ |
683 | index XXXXXXX..XXXXXXX 100644 | 31 | + bool aarch64; |
684 | --- a/hw/arm/xilinx_zynq.c | 32 | + |
685 | +++ b/hw/arm/xilinx_zynq.c | 33 | + aarch64 = object_property_get_bool(OBJECT(first_cpu), "aarch64", NULL); |
686 | @@ -XXX,XX +XXX,XX @@ | 34 | + |
687 | #include "qemu-common.h" | 35 | + if (!kvm_enabled()) { |
688 | #include "cpu.h" | 36 | + if (aarch64 && vms->highmem) { |
689 | #include "hw/sysbus.h" | 37 | + int requested_pa_size = 64 - clz64(vms->highest_gpa); |
690 | -#include "hw/arm/arm.h" | 38 | + int pamax = arm_pamax(ARM_CPU(first_cpu)); |
691 | +#include "hw/arm/boot.h" | 39 | + |
692 | #include "net/net.h" | 40 | + if (pamax < requested_pa_size) { |
693 | #include "exec/address-spaces.h" | 41 | + error_report("VCPU supports less PA bits (%d) than " |
694 | #include "sysemu/sysemu.h" | 42 | + "requested by the memory map (%d)", |
695 | diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c | 43 | + pamax, requested_pa_size); |
696 | index XXXXXXX..XXXXXXX 100644 | 44 | + exit(1); |
697 | --- a/hw/arm/xlnx-versal.c | 45 | + } |
698 | +++ b/hw/arm/xlnx-versal.c | 46 | + } |
699 | @@ -XXX,XX +XXX,XX @@ | 47 | + } |
700 | #include "net/net.h" | 48 | +} |
701 | #include "sysemu/sysemu.h" | 49 | + |
702 | #include "sysemu/kvm.h" | 50 | static void machvirt_init(MachineState *machine) |
703 | -#include "hw/arm/arm.h" | 51 | { |
704 | +#include "hw/arm/boot.h" | 52 | VirtMachineState *vms = VIRT_MACHINE(machine); |
705 | #include "kvm_arm.h" | 53 | @@ -XXX,XX +XXX,XX @@ static void machvirt_init(MachineState *machine) |
706 | #include "hw/misc/unimp.h" | 54 | fdt_add_timer_nodes(vms); |
707 | #include "hw/intc/arm_gicv3_common.h" | 55 | fdt_add_cpu_nodes(vms); |
708 | diff --git a/hw/arm/z2.c b/hw/arm/z2.c | 56 | |
709 | index XXXXXXX..XXXXXXX 100644 | 57 | - if (!kvm_enabled()) { |
710 | --- a/hw/arm/z2.c | 58 | - ARMCPU *cpu = ARM_CPU(first_cpu); |
711 | +++ b/hw/arm/z2.c | 59 | - bool aarch64 = object_property_get_bool(OBJECT(cpu), "aarch64", NULL); |
712 | @@ -XXX,XX +XXX,XX @@ | 60 | - |
713 | #include "qemu/osdep.h" | 61 | - if (aarch64 && vms->highmem) { |
714 | #include "hw/hw.h" | 62 | - int requested_pa_size, pamax = arm_pamax(cpu); |
715 | #include "hw/arm/pxa.h" | 63 | - |
716 | -#include "hw/arm/arm.h" | 64 | - requested_pa_size = 64 - clz64(vms->highest_gpa); |
717 | +#include "hw/arm/boot.h" | 65 | - if (pamax < requested_pa_size) { |
718 | #include "hw/i2c/i2c.h" | 66 | - error_report("VCPU supports less PA bits (%d) than requested " |
719 | #include "hw/ssi/ssi.h" | 67 | - "by the memory map (%d)", pamax, requested_pa_size); |
720 | #include "hw/boards.h" | 68 | - exit(1); |
69 | - } | ||
70 | - } | ||
71 | - } | ||
72 | - | ||
73 | memory_region_add_subregion(sysmem, vms->memmap[VIRT_MEM].base, | ||
74 | machine->ram); | ||
75 | if (machine->device_memory) { | ||
76 | @@ -XXX,XX +XXX,XX @@ static void machvirt_init(MachineState *machine) | ||
77 | |||
78 | create_gic(vms); | ||
79 | |||
80 | + virt_cpu_post_init(vms); | ||
81 | + | ||
82 | fdt_add_pmu_nodes(vms); | ||
83 | |||
84 | create_uart(vms, VIRT_UART, sysmem, serial_hd(0)); | ||
721 | -- | 85 | -- |
722 | 2.20.1 | 86 | 2.20.1 |
723 | 87 | ||
724 | 88 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | From: Andrew Jones <drjones@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | This is, after all, how we implement extract2 in tcg/aarch64. | 3 | Move the KVM PMU setup part of fdt_add_pmu_nodes() to |
4 | virt_cpu_post_init(), which is a more appropriate location. Now | ||
5 | fdt_add_pmu_nodes() is also named more appropriately, because it | ||
6 | no longer does anything but fdt node creation. | ||
7 | |||
8 | No functional change intended. | ||
4 | 9 | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 11 | Reviewed-by: Eric Auger <eric.auger@redhat.com> |
7 | Message-id: 20190514011129.11330-2-richard.henderson@linaro.org | 12 | Signed-off-by: Andrew Jones <drjones@redhat.com> |
13 | Message-id: 20201001061718.101915-5-drjones@redhat.com | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
9 | --- | 15 | --- |
10 | target/arm/translate-a64.c | 38 ++++++++++++++++++++------------------ | 16 | hw/arm/virt.c | 34 ++++++++++++++++++---------------- |
11 | 1 file changed, 20 insertions(+), 18 deletions(-) | 17 | 1 file changed, 18 insertions(+), 16 deletions(-) |
12 | 18 | ||
13 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 19 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c |
14 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/target/arm/translate-a64.c | 21 | --- a/hw/arm/virt.c |
16 | +++ b/target/arm/translate-a64.c | 22 | +++ b/hw/arm/virt.c |
17 | @@ -XXX,XX +XXX,XX @@ static void disas_extract(DisasContext *s, uint32_t insn) | 23 | @@ -XXX,XX +XXX,XX @@ static void fdt_add_gic_node(VirtMachineState *vms) |
18 | } else { | 24 | |
19 | tcg_gen_ext32u_i64(tcg_rd, cpu_reg(s, rm)); | 25 | static void fdt_add_pmu_nodes(const VirtMachineState *vms) |
20 | } | 26 | { |
21 | - } else if (rm == rn) { /* ROR */ | 27 | - CPUState *cpu; |
22 | - tcg_rm = cpu_reg(s, rm); | 28 | - ARMCPU *armcpu; |
23 | - if (sf) { | 29 | + ARMCPU *armcpu = ARM_CPU(first_cpu); |
24 | - tcg_gen_rotri_i64(tcg_rd, tcg_rm, imm); | 30 | uint32_t irqflags = GIC_FDT_IRQ_FLAGS_LEVEL_HI; |
25 | - } else { | 31 | |
26 | - TCGv_i32 tmp = tcg_temp_new_i32(); | 32 | - CPU_FOREACH(cpu) { |
27 | - tcg_gen_extrl_i64_i32(tmp, tcg_rm); | 33 | - armcpu = ARM_CPU(cpu); |
28 | - tcg_gen_rotri_i32(tmp, tmp, imm); | 34 | - if (!arm_feature(&armcpu->env, ARM_FEATURE_PMU)) { |
29 | - tcg_gen_extu_i32_i64(tcg_rd, tmp); | 35 | - return; |
30 | - tcg_temp_free_i32(tmp); | 36 | - } |
37 | - if (kvm_enabled()) { | ||
38 | - if (kvm_irqchip_in_kernel()) { | ||
39 | - kvm_arm_pmu_set_irq(cpu, PPI(VIRTUAL_PMU_IRQ)); | ||
31 | - } | 40 | - } |
32 | } else { | 41 | - kvm_arm_pmu_init(cpu); |
33 | - tcg_rm = read_cpu_reg(s, rm, sf); | 42 | - } |
34 | - tcg_rn = read_cpu_reg(s, rn, sf); | 43 | + if (!arm_feature(&armcpu->env, ARM_FEATURE_PMU)) { |
35 | - tcg_gen_shri_i64(tcg_rm, tcg_rm, imm); | 44 | + assert(!object_property_get_bool(OBJECT(armcpu), "pmu", NULL)); |
36 | - tcg_gen_shli_i64(tcg_rn, tcg_rn, bitsize - imm); | 45 | + return; |
37 | - tcg_gen_or_i64(tcg_rd, tcg_rm, tcg_rn); | 46 | } |
38 | - if (!sf) { | 47 | |
39 | - tcg_gen_ext32u_i64(tcg_rd, tcg_rd); | 48 | if (vms->gic_version == VIRT_GIC_VERSION_2) { |
40 | + tcg_rm = cpu_reg(s, rm); | 49 | @@ -XXX,XX +XXX,XX @@ static void fdt_add_pmu_nodes(const VirtMachineState *vms) |
41 | + tcg_rn = cpu_reg(s, rn); | 50 | (1 << vms->smp_cpus) - 1); |
42 | + | 51 | } |
43 | + if (sf) { | 52 | |
44 | + /* Specialization to ROR happens in EXTRACT2. */ | 53 | - armcpu = ARM_CPU(qemu_get_cpu(0)); |
45 | + tcg_gen_extract2_i64(tcg_rd, tcg_rm, tcg_rn, imm); | 54 | qemu_fdt_add_subnode(vms->fdt, "/pmu"); |
46 | + } else { | 55 | if (arm_feature(&armcpu->env, ARM_FEATURE_V8)) { |
47 | + TCGv_i32 t0 = tcg_temp_new_i32(); | 56 | const char compat[] = "arm,armv8-pmuv3"; |
48 | + | 57 | @@ -XXX,XX +XXX,XX @@ static void finalize_gic_version(VirtMachineState *vms) |
49 | + tcg_gen_extrl_i64_i32(t0, tcg_rm); | 58 | */ |
50 | + if (rm == rn) { | 59 | static void virt_cpu_post_init(VirtMachineState *vms) |
51 | + tcg_gen_rotri_i32(t0, t0, imm); | 60 | { |
52 | + } else { | 61 | - bool aarch64; |
53 | + TCGv_i32 t1 = tcg_temp_new_i32(); | 62 | + bool aarch64, pmu; |
54 | + tcg_gen_extrl_i64_i32(t1, tcg_rn); | 63 | + CPUState *cpu; |
55 | + tcg_gen_extract2_i32(t0, t0, t1, imm); | 64 | |
56 | + tcg_temp_free_i32(t1); | 65 | aarch64 = object_property_get_bool(OBJECT(first_cpu), "aarch64", NULL); |
66 | + pmu = object_property_get_bool(OBJECT(first_cpu), "pmu", NULL); | ||
67 | |||
68 | - if (!kvm_enabled()) { | ||
69 | + if (kvm_enabled()) { | ||
70 | + CPU_FOREACH(cpu) { | ||
71 | + if (pmu) { | ||
72 | + assert(arm_feature(&ARM_CPU(cpu)->env, ARM_FEATURE_PMU)); | ||
73 | + if (kvm_irqchip_in_kernel()) { | ||
74 | + kvm_arm_pmu_set_irq(cpu, PPI(VIRTUAL_PMU_IRQ)); | ||
57 | + } | 75 | + } |
58 | + tcg_gen_extu_i32_i64(tcg_rd, t0); | 76 | + kvm_arm_pmu_init(cpu); |
59 | + tcg_temp_free_i32(t0); | 77 | + } |
60 | } | 78 | + } |
61 | } | 79 | + } else { |
62 | } | 80 | if (aarch64 && vms->highmem) { |
81 | int requested_pa_size = 64 - clz64(vms->highest_gpa); | ||
82 | int pamax = arm_pamax(ARM_CPU(first_cpu)); | ||
63 | -- | 83 | -- |
64 | 2.20.1 | 84 | 2.20.1 |
65 | 85 | ||
66 | 86 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | From: Andrew Jones <drjones@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 3 | arm-cpu-features got dropped from the AArch64 tests during the meson |
4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 4 | conversion shuffle. |
5 | Message-id: 20190520214342.13709-2-philmd@redhat.com | 5 | |
6 | Signed-off-by: Andrew Jones <drjones@redhat.com> | ||
7 | Message-id: 20201001061718.101915-6-drjones@redhat.com | ||
8 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | --- | 10 | --- |
8 | hw/arm/exynos4_boards.c | 24 ------------------------ | 11 | tests/qtest/meson.build | 3 ++- |
9 | 1 file changed, 24 deletions(-) | 12 | 1 file changed, 2 insertions(+), 1 deletion(-) |
10 | 13 | ||
11 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 14 | diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build |
12 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/hw/arm/exynos4_boards.c | 16 | --- a/tests/qtest/meson.build |
14 | +++ b/hw/arm/exynos4_boards.c | 17 | +++ b/tests/qtest/meson.build |
15 | @@ -XXX,XX +XXX,XX @@ | 18 | @@ -XXX,XX +XXX,XX @@ qtests_aarch64 = \ |
16 | #include "hw/net/lan9118.h" | 19 | (cpu != 'arm' ? ['bios-tables-test'] : []) + \ |
17 | #include "hw/boards.h" | 20 | (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-test'] : []) + \ |
18 | 21 | (config_all_devices.has_key('CONFIG_TPM_TIS_SYSBUS') ? ['tpm-tis-device-swtpm-test'] : []) + \ | |
19 | -#undef DEBUG | 22 | - ['numa-test', |
20 | - | 23 | + ['arm-cpu-features', |
21 | -//#define DEBUG | 24 | + 'numa-test', |
22 | - | 25 | 'boot-serial-test', |
23 | -#ifdef DEBUG | 26 | 'migration-test'] |
24 | - #undef PRINT_DEBUG | ||
25 | - #define PRINT_DEBUG(fmt, args...) \ | ||
26 | - do { \ | ||
27 | - fprintf(stderr, " [%s:%d] "fmt, __func__, __LINE__, ##args); \ | ||
28 | - } while (0) | ||
29 | -#else | ||
30 | - #define PRINT_DEBUG(fmt, args...) do {} while (0) | ||
31 | -#endif | ||
32 | - | ||
33 | #define SMDK_LAN9118_BASE_ADDR 0x05000000 | ||
34 | |||
35 | typedef enum Exynos4BoardType { | ||
36 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | ||
37 | exynos4_board_binfo.gic_cpu_if_addr = | ||
38 | EXYNOS4210_SMP_PRIVATE_BASE_ADDR + 0x100; | ||
39 | |||
40 | - PRINT_DEBUG("\n ram_size: %luMiB [0x%08lx]\n" | ||
41 | - " kernel_filename: %s\n" | ||
42 | - " kernel_cmdline: %s\n" | ||
43 | - " initrd_filename: %s\n", | ||
44 | - exynos4_board_ram_size[board_type] / 1048576, | ||
45 | - exynos4_board_ram_size[board_type], | ||
46 | - machine->kernel_filename, | ||
47 | - machine->kernel_cmdline, | ||
48 | - machine->initrd_filename); | ||
49 | - | ||
50 | exynos4_boards_init_ram(s, get_system_memory(), | ||
51 | exynos4_board_ram_size[board_type]); | ||
52 | 27 | ||
53 | -- | 28 | -- |
54 | 2.20.1 | 29 | 2.20.1 |
55 | 30 | ||
56 | 31 | diff view generated by jsdifflib |
1 | The hw/arm/arm.h header now only includes declarations relating | 1 | From: Andrew Jones <drjones@redhat.com> |
---|---|---|---|
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 add the kvm-steal-time CPU property and implement it for machvirt. | ||
4 | A tiny bit of refactoring was also done to allow pmu and pvtime to | ||
5 | use the same vcpu device helper functions. | ||
6 | |||
7 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
8 | Signed-off-by: Andrew Jones <drjones@redhat.com> | ||
9 | Message-id: 20201001061718.101915-7-drjones@redhat.com | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 10 | 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 | --- | 11 | --- |
11 | hw/intc/armv7m_nvic.c | 1 - | 12 | docs/system/arm/cpu-features.rst | 11 ++++++ |
12 | target/arm/arm-semi.c | 1 - | 13 | include/hw/arm/virt.h | 5 +++ |
13 | target/arm/cpu.c | 1 - | 14 | target/arm/cpu.h | 4 ++ |
14 | target/arm/cpu64.c | 1 - | 15 | target/arm/kvm_arm.h | 43 +++++++++++++++++++++ |
15 | target/arm/kvm.c | 1 - | 16 | hw/arm/virt.c | 43 +++++++++++++++++++-- |
16 | target/arm/kvm32.c | 1 - | 17 | target/arm/cpu.c | 8 ++++ |
17 | target/arm/kvm64.c | 1 - | 18 | target/arm/kvm.c | 16 ++++++++ |
18 | 7 files changed, 7 deletions(-) | 19 | target/arm/kvm64.c | 64 +++++++++++++++++++++++++++++--- |
20 | target/arm/monitor.c | 2 +- | ||
21 | tests/qtest/arm-cpu-features.c | 25 +++++++++++-- | ||
22 | 10 files changed, 208 insertions(+), 13 deletions(-) | ||
19 | 23 | ||
20 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c | 24 | diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-features.rst |
21 | index XXXXXXX..XXXXXXX 100644 | 25 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/hw/intc/armv7m_nvic.c | 26 | --- a/docs/system/arm/cpu-features.rst |
23 | +++ b/hw/intc/armv7m_nvic.c | 27 | +++ b/docs/system/arm/cpu-features.rst |
28 | @@ -XXX,XX +XXX,XX @@ the list of KVM VCPU features and their descriptions. | ||
29 | adjustment, also restoring the legacy (pre-5.0) | ||
30 | behavior. | ||
31 | |||
32 | + kvm-steal-time Since v5.2, kvm-steal-time is enabled by | ||
33 | + default when KVM is enabled, the feature is | ||
34 | + supported, and the guest is 64-bit. | ||
35 | + | ||
36 | + When kvm-steal-time is enabled a 64-bit guest | ||
37 | + can account for time its CPUs were not running | ||
38 | + due to the host not scheduling the corresponding | ||
39 | + VCPU threads. The accounting statistics may | ||
40 | + influence the guest scheduler behavior and/or be | ||
41 | + exposed to the guest userspace. | ||
42 | + | ||
43 | SVE CPU Properties | ||
44 | ================== | ||
45 | |||
46 | diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h | ||
47 | index XXXXXXX..XXXXXXX 100644 | ||
48 | --- a/include/hw/arm/virt.h | ||
49 | +++ b/include/hw/arm/virt.h | ||
24 | @@ -XXX,XX +XXX,XX @@ | 50 | @@ -XXX,XX +XXX,XX @@ |
25 | #include "cpu.h" | 51 | |
26 | #include "hw/sysbus.h" | 52 | #define PPI(irq) ((irq) + 16) |
27 | #include "qemu/timer.h" | 53 | |
28 | -#include "hw/arm/arm.h" | 54 | +/* See Linux kernel arch/arm64/include/asm/pvclock-abi.h */ |
29 | #include "hw/intc/armv7m_nvic.h" | 55 | +#define PVTIME_SIZE_PER_CPU 64 |
30 | #include "target/arm/cpu.h" | 56 | + |
31 | #include "exec/exec-all.h" | 57 | enum { |
32 | diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c | 58 | VIRT_FLASH, |
33 | index XXXXXXX..XXXXXXX 100644 | 59 | VIRT_MEM, |
34 | --- a/target/arm/arm-semi.c | 60 | @@ -XXX,XX +XXX,XX @@ enum { |
35 | +++ b/target/arm/arm-semi.c | 61 | VIRT_PCDIMM_ACPI, |
62 | VIRT_ACPI_GED, | ||
63 | VIRT_NVDIMM_ACPI, | ||
64 | + VIRT_PVTIME, | ||
65 | VIRT_LOWMEMMAP_LAST, | ||
66 | }; | ||
67 | |||
68 | @@ -XXX,XX +XXX,XX @@ struct VirtMachineClass { | ||
69 | bool no_highmem_ecam; | ||
70 | bool no_ged; /* Machines < 4.2 has no support for ACPI GED device */ | ||
71 | bool kvm_no_adjvtime; | ||
72 | + bool no_kvm_steal_time; | ||
73 | bool acpi_expose_flash; | ||
74 | }; | ||
75 | |||
76 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
77 | index XXXXXXX..XXXXXXX 100644 | ||
78 | --- a/target/arm/cpu.h | ||
79 | +++ b/target/arm/cpu.h | ||
36 | @@ -XXX,XX +XXX,XX @@ | 80 | @@ -XXX,XX +XXX,XX @@ |
81 | #include "hw/registerfields.h" | ||
82 | #include "cpu-qom.h" | ||
83 | #include "exec/cpu-defs.h" | ||
84 | +#include "qapi/qapi-types-common.h" | ||
85 | |||
86 | /* ARM processors have a weak memory model */ | ||
87 | #define TCG_GUEST_DEFAULT_MO (0) | ||
88 | @@ -XXX,XX +XXX,XX @@ struct ARMCPU { | ||
89 | bool kvm_vtime_dirty; | ||
90 | uint64_t kvm_vtime; | ||
91 | |||
92 | + /* KVM steal time */ | ||
93 | + OnOffAuto kvm_steal_time; | ||
94 | + | ||
95 | /* Uniprocessor system with MP extensions */ | ||
96 | bool mp_is_up; | ||
97 | |||
98 | diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h | ||
99 | index XXXXXXX..XXXXXXX 100644 | ||
100 | --- a/target/arm/kvm_arm.h | ||
101 | +++ b/target/arm/kvm_arm.h | ||
102 | @@ -XXX,XX +XXX,XX @@ void kvm_arm_set_cpu_features_from_host(ARMCPU *cpu); | ||
103 | */ | ||
104 | void kvm_arm_add_vcpu_properties(Object *obj); | ||
105 | |||
106 | +/** | ||
107 | + * kvm_arm_steal_time_finalize: | ||
108 | + * @cpu: ARMCPU for which to finalize kvm-steal-time | ||
109 | + * @errp: Pointer to Error* for error propagation | ||
110 | + * | ||
111 | + * Validate the kvm-steal-time property selection and set its default | ||
112 | + * based on KVM support and guest configuration. | ||
113 | + */ | ||
114 | +void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp); | ||
115 | + | ||
116 | +/** | ||
117 | + * kvm_arm_steal_time_supported: | ||
118 | + * | ||
119 | + * Returns: true if KVM can enable steal time reporting | ||
120 | + * and false otherwise. | ||
121 | + */ | ||
122 | +bool kvm_arm_steal_time_supported(void); | ||
123 | + | ||
124 | /** | ||
125 | * kvm_arm_aarch32_supported: | ||
126 | * | ||
127 | @@ -XXX,XX +XXX,XX @@ int kvm_arm_vgic_probe(void); | ||
128 | |||
129 | void kvm_arm_pmu_set_irq(CPUState *cs, int irq); | ||
130 | void kvm_arm_pmu_init(CPUState *cs); | ||
131 | + | ||
132 | +/** | ||
133 | + * kvm_arm_pvtime_init: | ||
134 | + * @cs: CPUState | ||
135 | + * @ipa: Per-vcpu guest physical base address of the pvtime structures | ||
136 | + * | ||
137 | + * Initializes PVTIME for the VCPU, setting the PVTIME IPA to @ipa. | ||
138 | + */ | ||
139 | +void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa); | ||
140 | + | ||
141 | int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level); | ||
142 | |||
37 | #else | 143 | #else |
38 | #include "qemu-common.h" | 144 | @@ -XXX,XX +XXX,XX @@ static inline bool kvm_arm_sve_supported(void) |
39 | #include "exec/gdbstub.h" | 145 | return false; |
40 | -#include "hw/arm/arm.h" | 146 | } |
41 | #include "qemu/cutils.h" | 147 | |
42 | #endif | 148 | +static inline bool kvm_arm_steal_time_supported(void) |
149 | +{ | ||
150 | + return false; | ||
151 | +} | ||
152 | + | ||
153 | /* | ||
154 | * These functions should never actually be called without KVM support. | ||
155 | */ | ||
156 | @@ -XXX,XX +XXX,XX @@ static inline void kvm_arm_pmu_init(CPUState *cs) | ||
157 | g_assert_not_reached(); | ||
158 | } | ||
159 | |||
160 | +static inline void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) | ||
161 | +{ | ||
162 | + g_assert_not_reached(); | ||
163 | +} | ||
164 | + | ||
165 | +static inline void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp) | ||
166 | +{ | ||
167 | + g_assert_not_reached(); | ||
168 | +} | ||
169 | + | ||
170 | static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map) | ||
171 | { | ||
172 | g_assert_not_reached(); | ||
173 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | ||
174 | index XXXXXXX..XXXXXXX 100644 | ||
175 | --- a/hw/arm/virt.c | ||
176 | +++ b/hw/arm/virt.c | ||
177 | @@ -XXX,XX +XXX,XX @@ static const MemMapEntry base_memmap[] = { | ||
178 | [VIRT_PCDIMM_ACPI] = { 0x09070000, MEMORY_HOTPLUG_IO_LEN }, | ||
179 | [VIRT_ACPI_GED] = { 0x09080000, ACPI_GED_EVT_SEL_LEN }, | ||
180 | [VIRT_NVDIMM_ACPI] = { 0x09090000, NVDIMM_ACPI_IO_LEN}, | ||
181 | + [VIRT_PVTIME] = { 0x090a0000, 0x00010000 }, | ||
182 | [VIRT_MMIO] = { 0x0a000000, 0x00000200 }, | ||
183 | /* ...repeating for a total of NUM_VIRTIO_TRANSPORTS, each of that size */ | ||
184 | [VIRT_PLATFORM_BUS] = { 0x0c000000, 0x02000000 }, | ||
185 | @@ -XXX,XX +XXX,XX @@ static void finalize_gic_version(VirtMachineState *vms) | ||
186 | * virt_cpu_post_init() must be called after the CPUs have | ||
187 | * been realized and the GIC has been created. | ||
188 | */ | ||
189 | -static void virt_cpu_post_init(VirtMachineState *vms) | ||
190 | +static void virt_cpu_post_init(VirtMachineState *vms, int max_cpus, | ||
191 | + MemoryRegion *sysmem) | ||
192 | { | ||
193 | - bool aarch64, pmu; | ||
194 | + bool aarch64, pmu, steal_time; | ||
195 | CPUState *cpu; | ||
196 | |||
197 | aarch64 = object_property_get_bool(OBJECT(first_cpu), "aarch64", NULL); | ||
198 | pmu = object_property_get_bool(OBJECT(first_cpu), "pmu", NULL); | ||
199 | + steal_time = object_property_get_bool(OBJECT(first_cpu), | ||
200 | + "kvm-steal-time", NULL); | ||
201 | |||
202 | if (kvm_enabled()) { | ||
203 | + hwaddr pvtime_reg_base = vms->memmap[VIRT_PVTIME].base; | ||
204 | + hwaddr pvtime_reg_size = vms->memmap[VIRT_PVTIME].size; | ||
205 | + | ||
206 | + if (steal_time) { | ||
207 | + MemoryRegion *pvtime = g_new(MemoryRegion, 1); | ||
208 | + hwaddr pvtime_size = max_cpus * PVTIME_SIZE_PER_CPU; | ||
209 | + | ||
210 | + /* The memory region size must be a multiple of host page size. */ | ||
211 | + pvtime_size = REAL_HOST_PAGE_ALIGN(pvtime_size); | ||
212 | + | ||
213 | + if (pvtime_size > pvtime_reg_size) { | ||
214 | + error_report("pvtime requires a %ld byte memory region for " | ||
215 | + "%d CPUs, but only %ld has been reserved", | ||
216 | + pvtime_size, max_cpus, pvtime_reg_size); | ||
217 | + exit(1); | ||
218 | + } | ||
219 | + | ||
220 | + memory_region_init_ram(pvtime, NULL, "pvtime", pvtime_size, NULL); | ||
221 | + memory_region_add_subregion(sysmem, pvtime_reg_base, pvtime); | ||
222 | + } | ||
223 | + | ||
224 | CPU_FOREACH(cpu) { | ||
225 | if (pmu) { | ||
226 | assert(arm_feature(&ARM_CPU(cpu)->env, ARM_FEATURE_PMU)); | ||
227 | @@ -XXX,XX +XXX,XX @@ static void virt_cpu_post_init(VirtMachineState *vms) | ||
228 | } | ||
229 | kvm_arm_pmu_init(cpu); | ||
230 | } | ||
231 | + if (steal_time) { | ||
232 | + kvm_arm_pvtime_init(cpu, pvtime_reg_base + | ||
233 | + cpu->cpu_index * PVTIME_SIZE_PER_CPU); | ||
234 | + } | ||
235 | } | ||
236 | } else { | ||
237 | if (aarch64 && vms->highmem) { | ||
238 | @@ -XXX,XX +XXX,XX @@ static void machvirt_init(MachineState *machine) | ||
239 | object_property_set_bool(cpuobj, "kvm-no-adjvtime", true, NULL); | ||
240 | } | ||
241 | |||
242 | + if (vmc->no_kvm_steal_time && | ||
243 | + object_property_find(cpuobj, "kvm-steal-time")) { | ||
244 | + object_property_set_bool(cpuobj, "kvm-steal-time", false, NULL); | ||
245 | + } | ||
246 | + | ||
247 | if (vmc->no_pmu && object_property_find(cpuobj, "pmu")) { | ||
248 | object_property_set_bool(cpuobj, "pmu", false, NULL); | ||
249 | } | ||
250 | @@ -XXX,XX +XXX,XX @@ static void machvirt_init(MachineState *machine) | ||
251 | |||
252 | create_gic(vms); | ||
253 | |||
254 | - virt_cpu_post_init(vms); | ||
255 | + virt_cpu_post_init(vms, possible_cpus->len, sysmem); | ||
256 | |||
257 | fdt_add_pmu_nodes(vms); | ||
258 | |||
259 | @@ -XXX,XX +XXX,XX @@ DEFINE_VIRT_MACHINE_AS_LATEST(5, 2) | ||
260 | |||
261 | static void virt_machine_5_1_options(MachineClass *mc) | ||
262 | { | ||
263 | + VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); | ||
264 | + | ||
265 | virt_machine_5_2_options(mc); | ||
266 | compat_props_add(mc->compat_props, hw_compat_5_1, hw_compat_5_1_len); | ||
267 | + vmc->no_kvm_steal_time = true; | ||
268 | } | ||
269 | DEFINE_VIRT_MACHINE(5, 1) | ||
43 | 270 | ||
44 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 271 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c |
45 | index XXXXXXX..XXXXXXX 100644 | 272 | index XXXXXXX..XXXXXXX 100644 |
46 | --- a/target/arm/cpu.c | 273 | --- a/target/arm/cpu.c |
47 | +++ b/target/arm/cpu.c | 274 | +++ b/target/arm/cpu.c |
48 | @@ -XXX,XX +XXX,XX @@ | 275 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp) |
49 | #if !defined(CONFIG_USER_ONLY) | 276 | return; |
50 | #include "hw/loader.h" | 277 | } |
51 | #endif | 278 | } |
52 | -#include "hw/arm/arm.h" | 279 | + |
53 | #include "sysemu/sysemu.h" | 280 | + if (kvm_enabled()) { |
54 | #include "sysemu/hw_accel.h" | 281 | + kvm_arm_steal_time_finalize(cpu, &local_err); |
55 | #include "kvm_arm.h" | 282 | + if (local_err != NULL) { |
56 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 283 | + error_propagate(errp, local_err); |
57 | index XXXXXXX..XXXXXXX 100644 | 284 | + return; |
58 | --- a/target/arm/cpu64.c | 285 | + } |
59 | +++ b/target/arm/cpu64.c | 286 | + } |
60 | @@ -XXX,XX +XXX,XX @@ | 287 | } |
61 | #if !defined(CONFIG_USER_ONLY) | 288 | |
62 | #include "hw/loader.h" | 289 | static void arm_cpu_realizefn(DeviceState *dev, Error **errp) |
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 | 290 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c |
69 | index XXXXXXX..XXXXXXX 100644 | 291 | index XXXXXXX..XXXXXXX 100644 |
70 | --- a/target/arm/kvm.c | 292 | --- a/target/arm/kvm.c |
71 | +++ b/target/arm/kvm.c | 293 | +++ b/target/arm/kvm.c |
72 | @@ -XXX,XX +XXX,XX @@ | 294 | @@ -XXX,XX +XXX,XX @@ static void kvm_no_adjvtime_set(Object *obj, bool value, Error **errp) |
73 | #include "cpu.h" | 295 | ARM_CPU(obj)->kvm_adjvtime = !value; |
74 | #include "trace.h" | 296 | } |
75 | #include "internals.h" | 297 | |
76 | -#include "hw/arm/arm.h" | 298 | +static bool kvm_steal_time_get(Object *obj, Error **errp) |
77 | #include "hw/pci/pci.h" | 299 | +{ |
78 | #include "exec/memattrs.h" | 300 | + return ARM_CPU(obj)->kvm_steal_time != ON_OFF_AUTO_OFF; |
79 | #include "exec/address-spaces.h" | 301 | +} |
80 | diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c | 302 | + |
81 | index XXXXXXX..XXXXXXX 100644 | 303 | +static void kvm_steal_time_set(Object *obj, bool value, Error **errp) |
82 | --- a/target/arm/kvm32.c | 304 | +{ |
83 | +++ b/target/arm/kvm32.c | 305 | + ARM_CPU(obj)->kvm_steal_time = value ? ON_OFF_AUTO_ON : ON_OFF_AUTO_OFF; |
84 | @@ -XXX,XX +XXX,XX @@ | 306 | +} |
85 | #include "sysemu/kvm.h" | 307 | + |
86 | #include "kvm_arm.h" | 308 | /* KVM VCPU properties should be prefixed with "kvm-". */ |
87 | #include "internals.h" | 309 | void kvm_arm_add_vcpu_properties(Object *obj) |
88 | -#include "hw/arm/arm.h" | 310 | { |
89 | #include "qemu/log.h" | 311 | @@ -XXX,XX +XXX,XX @@ void kvm_arm_add_vcpu_properties(Object *obj) |
90 | 312 | "the virtual counter. VM stopped time " | |
91 | static inline void set_feature(uint64_t *features, int feature) | 313 | "will be counted."); |
314 | } | ||
315 | + | ||
316 | + cpu->kvm_steal_time = ON_OFF_AUTO_AUTO; | ||
317 | + object_property_add_bool(obj, "kvm-steal-time", kvm_steal_time_get, | ||
318 | + kvm_steal_time_set); | ||
319 | + object_property_set_description(obj, "kvm-steal-time", | ||
320 | + "Set off to disable KVM steal time."); | ||
321 | } | ||
322 | |||
323 | bool kvm_arm_pmu_supported(void) | ||
92 | diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c | 324 | diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c |
93 | index XXXXXXX..XXXXXXX 100644 | 325 | index XXXXXXX..XXXXXXX 100644 |
94 | --- a/target/arm/kvm64.c | 326 | --- a/target/arm/kvm64.c |
95 | +++ b/target/arm/kvm64.c | 327 | +++ b/target/arm/kvm64.c |
96 | @@ -XXX,XX +XXX,XX @@ | 328 | @@ -XXX,XX +XXX,XX @@ |
97 | #include "sysemu/kvm.h" | 329 | #include <linux/kvm.h> |
98 | #include "kvm_arm.h" | 330 | |
99 | #include "internals.h" | 331 | #include "qemu-common.h" |
100 | -#include "hw/arm/arm.h" | 332 | +#include "qapi/error.h" |
101 | 333 | #include "cpu.h" | |
102 | static bool have_guest_debug; | 334 | #include "qemu/timer.h" |
103 | 335 | #include "qemu/error-report.h" | |
336 | @@ -XXX,XX +XXX,XX @@ static CPUWatchpoint *find_hw_watchpoint(CPUState *cpu, target_ulong addr) | ||
337 | return NULL; | ||
338 | } | ||
339 | |||
340 | -static bool kvm_arm_pmu_set_attr(CPUState *cs, struct kvm_device_attr *attr) | ||
341 | +static bool kvm_arm_set_device_attr(CPUState *cs, struct kvm_device_attr *attr, | ||
342 | + const char *name) | ||
343 | { | ||
344 | int err; | ||
345 | |||
346 | err = kvm_vcpu_ioctl(cs, KVM_HAS_DEVICE_ATTR, attr); | ||
347 | if (err != 0) { | ||
348 | - error_report("PMU: KVM_HAS_DEVICE_ATTR: %s", strerror(-err)); | ||
349 | + error_report("%s: KVM_HAS_DEVICE_ATTR: %s", name, strerror(-err)); | ||
350 | return false; | ||
351 | } | ||
352 | |||
353 | err = kvm_vcpu_ioctl(cs, KVM_SET_DEVICE_ATTR, attr); | ||
354 | if (err != 0) { | ||
355 | - error_report("PMU: KVM_SET_DEVICE_ATTR: %s", strerror(-err)); | ||
356 | + error_report("%s: KVM_SET_DEVICE_ATTR: %s", name, strerror(-err)); | ||
357 | return false; | ||
358 | } | ||
359 | |||
360 | @@ -XXX,XX +XXX,XX @@ void kvm_arm_pmu_init(CPUState *cs) | ||
361 | if (!ARM_CPU(cs)->has_pmu) { | ||
362 | return; | ||
363 | } | ||
364 | - if (!kvm_arm_pmu_set_attr(cs, &attr)) { | ||
365 | + if (!kvm_arm_set_device_attr(cs, &attr, "PMU")) { | ||
366 | error_report("failed to init PMU"); | ||
367 | abort(); | ||
368 | } | ||
369 | @@ -XXX,XX +XXX,XX @@ void kvm_arm_pmu_set_irq(CPUState *cs, int irq) | ||
370 | if (!ARM_CPU(cs)->has_pmu) { | ||
371 | return; | ||
372 | } | ||
373 | - if (!kvm_arm_pmu_set_attr(cs, &attr)) { | ||
374 | + if (!kvm_arm_set_device_attr(cs, &attr, "PMU")) { | ||
375 | error_report("failed to set irq for PMU"); | ||
376 | abort(); | ||
377 | } | ||
378 | } | ||
379 | |||
380 | +void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa) | ||
381 | +{ | ||
382 | + struct kvm_device_attr attr = { | ||
383 | + .group = KVM_ARM_VCPU_PVTIME_CTRL, | ||
384 | + .attr = KVM_ARM_VCPU_PVTIME_IPA, | ||
385 | + .addr = (uint64_t)&ipa, | ||
386 | + }; | ||
387 | + | ||
388 | + if (ARM_CPU(cs)->kvm_steal_time == ON_OFF_AUTO_OFF) { | ||
389 | + return; | ||
390 | + } | ||
391 | + if (!kvm_arm_set_device_attr(cs, &attr, "PVTIME IPA")) { | ||
392 | + error_report("failed to init PVTIME IPA"); | ||
393 | + abort(); | ||
394 | + } | ||
395 | +} | ||
396 | + | ||
397 | static int read_sys_reg32(int fd, uint32_t *pret, uint64_t id) | ||
398 | { | ||
399 | uint64_t ret; | ||
400 | @@ -XXX,XX +XXX,XX @@ bool kvm_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) | ||
401 | return true; | ||
402 | } | ||
403 | |||
404 | +void kvm_arm_steal_time_finalize(ARMCPU *cpu, Error **errp) | ||
405 | +{ | ||
406 | + bool has_steal_time = kvm_arm_steal_time_supported(); | ||
407 | + | ||
408 | + if (cpu->kvm_steal_time == ON_OFF_AUTO_AUTO) { | ||
409 | + if (!has_steal_time || !arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { | ||
410 | + cpu->kvm_steal_time = ON_OFF_AUTO_OFF; | ||
411 | + } else { | ||
412 | + cpu->kvm_steal_time = ON_OFF_AUTO_ON; | ||
413 | + } | ||
414 | + } else if (cpu->kvm_steal_time == ON_OFF_AUTO_ON) { | ||
415 | + if (!has_steal_time) { | ||
416 | + error_setg(errp, "'kvm-steal-time' cannot be enabled " | ||
417 | + "on this host"); | ||
418 | + return; | ||
419 | + } else if (!arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { | ||
420 | + /* | ||
421 | + * DEN0057A chapter 2 says "This specification only covers | ||
422 | + * systems in which the Execution state of the hypervisor | ||
423 | + * as well as EL1 of virtual machines is AArch64.". And, | ||
424 | + * to ensure that, the smc/hvc calls are only specified as | ||
425 | + * smc64/hvc64. | ||
426 | + */ | ||
427 | + error_setg(errp, "'kvm-steal-time' cannot be enabled " | ||
428 | + "for AArch32 guests"); | ||
429 | + return; | ||
430 | + } | ||
431 | + } | ||
432 | +} | ||
433 | + | ||
434 | bool kvm_arm_aarch32_supported(void) | ||
435 | { | ||
436 | return kvm_check_extension(kvm_state, KVM_CAP_ARM_EL1_32BIT); | ||
437 | @@ -XXX,XX +XXX,XX @@ bool kvm_arm_sve_supported(void) | ||
438 | return kvm_check_extension(kvm_state, KVM_CAP_ARM_SVE); | ||
439 | } | ||
440 | |||
441 | +bool kvm_arm_steal_time_supported(void) | ||
442 | +{ | ||
443 | + return kvm_check_extension(kvm_state, KVM_CAP_STEAL_TIME); | ||
444 | +} | ||
445 | + | ||
446 | QEMU_BUILD_BUG_ON(KVM_ARM64_SVE_VQ_MIN != 1); | ||
447 | |||
448 | void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map) | ||
449 | diff --git a/target/arm/monitor.c b/target/arm/monitor.c | ||
450 | index XXXXXXX..XXXXXXX 100644 | ||
451 | --- a/target/arm/monitor.c | ||
452 | +++ b/target/arm/monitor.c | ||
453 | @@ -XXX,XX +XXX,XX @@ static const char *cpu_model_advertised_features[] = { | ||
454 | "sve128", "sve256", "sve384", "sve512", | ||
455 | "sve640", "sve768", "sve896", "sve1024", "sve1152", "sve1280", | ||
456 | "sve1408", "sve1536", "sve1664", "sve1792", "sve1920", "sve2048", | ||
457 | - "kvm-no-adjvtime", | ||
458 | + "kvm-no-adjvtime", "kvm-steal-time", | ||
459 | NULL | ||
460 | }; | ||
461 | |||
462 | diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c | ||
463 | index XXXXXXX..XXXXXXX 100644 | ||
464 | --- a/tests/qtest/arm-cpu-features.c | ||
465 | +++ b/tests/qtest/arm-cpu-features.c | ||
466 | @@ -XXX,XX +XXX,XX @@ static void test_query_cpu_model_expansion(const void *data) | ||
467 | assert_set_feature(qts, "max", "pmu", true); | ||
468 | |||
469 | assert_has_not_feature(qts, "max", "kvm-no-adjvtime"); | ||
470 | + assert_has_not_feature(qts, "max", "kvm-steal-time"); | ||
471 | |||
472 | if (g_str_equal(qtest_get_arch(), "aarch64")) { | ||
473 | assert_has_feature_enabled(qts, "max", "aarch64"); | ||
474 | @@ -XXX,XX +XXX,XX @@ static void test_query_cpu_model_expansion_kvm(const void *data) | ||
475 | assert_set_feature(qts, "host", "kvm-no-adjvtime", false); | ||
476 | |||
477 | if (g_str_equal(qtest_get_arch(), "aarch64")) { | ||
478 | + bool kvm_supports_steal_time; | ||
479 | bool kvm_supports_sve; | ||
480 | char max_name[8], name[8]; | ||
481 | uint32_t max_vq, vq; | ||
482 | @@ -XXX,XX +XXX,XX @@ static void test_query_cpu_model_expansion_kvm(const void *data) | ||
483 | QDict *resp; | ||
484 | char *error; | ||
485 | |||
486 | + assert_error(qts, "cortex-a15", | ||
487 | + "We cannot guarantee the CPU type 'cortex-a15' works " | ||
488 | + "with KVM on this host", NULL); | ||
489 | + | ||
490 | assert_has_feature_enabled(qts, "host", "aarch64"); | ||
491 | |||
492 | /* Enabling and disabling pmu should always work. */ | ||
493 | @@ -XXX,XX +XXX,XX @@ static void test_query_cpu_model_expansion_kvm(const void *data) | ||
494 | assert_set_feature(qts, "host", "pmu", false); | ||
495 | assert_set_feature(qts, "host", "pmu", true); | ||
496 | |||
497 | - assert_error(qts, "cortex-a15", | ||
498 | - "We cannot guarantee the CPU type 'cortex-a15' works " | ||
499 | - "with KVM on this host", NULL); | ||
500 | - | ||
501 | + /* | ||
502 | + * Some features would be enabled by default, but they're disabled | ||
503 | + * because this instance of KVM doesn't support them. Test that the | ||
504 | + * features are present, and, when enabled, issue further tests. | ||
505 | + */ | ||
506 | + assert_has_feature(qts, "host", "kvm-steal-time"); | ||
507 | assert_has_feature(qts, "host", "sve"); | ||
508 | + | ||
509 | resp = do_query_no_props(qts, "host"); | ||
510 | + kvm_supports_steal_time = resp_get_feature(resp, "kvm-steal-time"); | ||
511 | kvm_supports_sve = resp_get_feature(resp, "sve"); | ||
512 | vls = resp_get_sve_vls(resp); | ||
513 | qobject_unref(resp); | ||
514 | |||
515 | + if (kvm_supports_steal_time) { | ||
516 | + /* If we have steal-time then we should be able to toggle it. */ | ||
517 | + assert_set_feature(qts, "host", "kvm-steal-time", false); | ||
518 | + assert_set_feature(qts, "host", "kvm-steal-time", true); | ||
519 | + } | ||
520 | + | ||
521 | if (kvm_supports_sve) { | ||
522 | g_assert(vls != 0); | ||
523 | max_vq = 64 - __builtin_clzll(vls); | ||
524 | @@ -XXX,XX +XXX,XX @@ static void test_query_cpu_model_expansion_kvm(const void *data) | ||
525 | assert_has_not_feature(qts, "host", "aarch64"); | ||
526 | assert_has_not_feature(qts, "host", "pmu"); | ||
527 | assert_has_not_feature(qts, "host", "sve"); | ||
528 | + assert_has_not_feature(qts, "host", "kvm-steal-time"); | ||
529 | } | ||
530 | |||
531 | qtest_quit(qts); | ||
104 | -- | 532 | -- |
105 | 2.20.1 | 533 | 2.20.1 |
106 | 534 | ||
107 | 535 | diff view generated by jsdifflib |
1 | The system_clock_scale global is used only by the armv7m systick | 1 | QEMU supports a 48-bit physical address range, but we don't currently |
---|---|---|---|
2 | device; move the extern declaration to the armv7m_systick.h header, | 2 | expose it in the '-cpu max' ID registers (you get the same range as |
3 | and expand the comment to explain what it is and that it should | 3 | Cortex-A57, which is 44 bits). |
4 | ideally be replaced with a different approach. | 4 | |
5 | Set the ID_AA64MMFR0.PARange field to indicate 48 bits. | ||
5 | 6 | ||
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 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 9 | Message-id: 20201001160116.18095-1-peter.maydell@linaro.org |
9 | Message-id: 20190516163857.6430-2-peter.maydell@linaro.org | ||
10 | --- | 10 | --- |
11 | include/hw/arm/arm.h | 4 ---- | 11 | target/arm/cpu64.c | 4 ++++ |
12 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++++++++ | 12 | 1 file changed, 4 insertions(+) |
13 | 2 files changed, 22 insertions(+), 4 deletions(-) | ||
14 | 13 | ||
15 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h | 14 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c |
16 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/include/hw/arm/arm.h | 16 | --- a/target/arm/cpu64.c |
18 | +++ b/include/hw/arm/arm.h | 17 | +++ b/target/arm/cpu64.c |
19 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, | 18 | @@ -XXX,XX +XXX,XX @@ static void aarch64_max_initfn(Object *obj) |
20 | const struct arm_boot_info *info, | 19 | t = FIELD_DP64(t, ID_AA64PFR1, MTE, 2); |
21 | hwaddr mvbar_addr); | 20 | cpu->isar.id_aa64pfr1 = t; |
22 | 21 | ||
23 | -/* Multiplication factor to convert from system clock ticks to qemu timer | 22 | + t = cpu->isar.id_aa64mmfr0; |
24 | - ticks. */ | 23 | + t = FIELD_DP64(t, ID_AA64MMFR0, PARANGE, 5); /* PARange: 48 bits */ |
25 | -extern int system_clock_scale; | 24 | + cpu->isar.id_aa64mmfr0 = t; |
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 | + | 25 | + |
58 | #endif | 26 | t = cpu->isar.id_aa64mmfr1; |
27 | t = FIELD_DP64(t, ID_AA64MMFR1, HPDS, 1); /* HPD */ | ||
28 | t = FIELD_DP64(t, ID_AA64MMFR1, LO, 1); | ||
59 | -- | 29 | -- |
60 | 2.20.1 | 30 | 2.20.1 |
61 | 31 | ||
62 | 32 | diff view generated by jsdifflib |