1 | Not very much here, but several people have fallen over | 1 | Latest arm queue, half minor code cleanups and half minor |
---|---|---|---|
2 | the vector operation segfault bug, so let's get the fix | 2 | bug fixes. |
3 | into master. | ||
4 | 3 | ||
5 | thanks | ||
6 | -- PMM | 4 | -- PMM |
7 | 5 | ||
8 | The following changes since commit d418238dca7b4e0b124135827ead3076233052b1: | 6 | The following changes since commit 5d0e5694470d2952b4f257bc985cac8c89b4fd92: |
9 | 7 | ||
10 | Merge remote-tracking branch 'remotes/rth/tags/pull-rng-20190522' into staging (2019-05-23 12:57:17 +0100) | 8 | Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2019-06-17 11:55:14 +0100) |
11 | 9 | ||
12 | are available in the Git repository at: | 10 | are available in the Git repository at: |
13 | 11 | ||
14 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190523 | 12 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190617 |
15 | 13 | ||
16 | for you to fetch changes up to 98e4f4fdb8ea05d840f51f47125924c2bb9df2df: | 14 | for you to fetch changes up to 1120827fa182f0e76226df7ffe7a86598d1df54f: |
17 | 15 | ||
18 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC (2019-05-23 14:47:44 +0100) | 16 | target/arm: Only implement doubles if the FPU supports them (2019-06-17 15:15:06 +0100) |
19 | 17 | ||
20 | ---------------------------------------------------------------- | 18 | ---------------------------------------------------------------- |
21 | target-arm queue: | 19 | target-arm queue: |
22 | * exynos4210: QOM'ify the Exynos4210 SoC | 20 | * support large kernel images in bootloader (by avoiding |
23 | * exynos4210: Add DMA support for the Exynos4210 | 21 | putting the initrd over the top of them) |
24 | * arm_gicv3: Fix writes to ICC_CTLR_EL3 | 22 | * correctly disable FPU/DSP in the CPU for the mps2-an521, musca-a boards |
25 | * arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} | 23 | * arm_gicv3: Fix decoding of ID register range |
26 | * target/arm: Fix vector operation segfault | 24 | * arm_gicv3: GICD_TYPER.SecurityExtn is RAZ if GICD_CTLR.DS == 1 |
27 | * target/arm: Minor improvements to BFXIL, EXTR | 25 | * some code cleanups following on from the VFP decodetree conversion |
26 | * Only implement doubles if the FPU supports them | ||
27 | (so we now correctly model Cortex-M4, -M33 as single precision only) | ||
28 | 28 | ||
29 | ---------------------------------------------------------------- | 29 | ---------------------------------------------------------------- |
30 | Alistair Francis (1): | 30 | Peter Maydell (24): |
31 | target/arm: Fix vector operation segfault | 31 | hw/arm/boot: Don't assume RAM starts at address zero |
32 | hw/arm/boot: Diagnose layouts that put initrd or DTB off the end of RAM | ||
33 | hw/arm/boot: Avoid placing the initrd on top of the kernel | ||
34 | hw/arm/boot: Honour image size field in AArch64 Image format kernels | ||
35 | target/arm: Allow VFP and Neon to be disabled via a CPU property | ||
36 | target/arm: Allow M-profile CPUs to disable the DSP extension via CPU property | ||
37 | hw/arm/armv7m: Forward "vfp" and "dsp" properties to CPU | ||
38 | hw/arm: Correctly disable FPU/DSP for some ARMSSE-based boards | ||
39 | hw/intc/arm_gicv3: Fix decoding of ID register range | ||
40 | hw/intc/arm_gicv3: GICD_TYPER.SecurityExtn is RAZ if GICD_CTLR.DS == 1 | ||
41 | target/arm: Move vfp_expand_imm() to translate.[ch] | ||
42 | target/arm: Use vfp_expand_imm() for AArch32 VFP VMOV_imm | ||
43 | target/arm: Stop using cpu_F0s for NEON_2RM_VABS_F | ||
44 | target/arm: Stop using cpu_F0s for NEON_2RM_VNEG_F | ||
45 | target/arm: Stop using cpu_F0s for NEON_2RM_VRINT* | ||
46 | target/arm: Stop using cpu_F0s for NEON_2RM_VCVT[ANPM][US] | ||
47 | target/arm: Stop using cpu_F0s for NEON_2RM_VRECPE_F and NEON_2RM_VRSQRTE_F | ||
48 | target/arm: Stop using cpu_F0s for Neon f32/s32 VCVT | ||
49 | target/arm: Stop using cpu_F0s in Neon VCVT fixed-point ops | ||
50 | target/arm: stop using deprecated functions in NEON_2RM_VCVT_F16_F32 | ||
51 | target/arm: Stop using deprecated functions in NEON_2RM_VCVT_F32_F16 | ||
52 | target/arm: Remove unused cpu_F0s, cpu_F0d, cpu_F1s, cpu_F1d | ||
53 | target/arm: Fix typos in trans function prototypes | ||
54 | target/arm: Only implement doubles if the FPU supports them | ||
32 | 55 | ||
33 | Guenter Roeck (1): | 56 | include/hw/arm/armsse.h | 7 ++ |
34 | hw/arm/exynos4210: Add DMA support for the Exynos4210 | 57 | include/hw/arm/armv7m.h | 4 + |
58 | target/arm/cpu.h | 12 +++ | ||
59 | target/arm/translate-a64.h | 1 - | ||
60 | target/arm/translate.h | 7 ++ | ||
61 | hw/arm/armsse.c | 58 +++++++--- | ||
62 | hw/arm/armv7m.c | 18 ++++ | ||
63 | hw/arm/boot.c | 83 ++++++++++---- | ||
64 | hw/arm/musca.c | 8 ++ | ||
65 | hw/intc/arm_gicv3_dist.c | 12 ++- | ||
66 | hw/intc/arm_gicv3_redist.c | 4 +- | ||
67 | target/arm/cpu.c | 179 ++++++++++++++++++++++++++++-- | ||
68 | target/arm/translate-a64.c | 32 ------ | ||
69 | target/arm/translate-vfp.inc.c | 173 ++++++++++++++++++++++------- | ||
70 | target/arm/translate.c | 240 ++++++++++++++--------------------------- | ||
71 | target/arm/vfp.decode | 10 +- | ||
72 | 16 files changed, 572 insertions(+), 276 deletions(-) | ||
35 | 73 | ||
36 | Peter Maydell (5): | ||
37 | arm: Move system_clock_scale to armv7m_systick.h | ||
38 | arm: Remove unnecessary includes of hw/arm/arm.h | ||
39 | arm: Rename hw/arm/arm.h to hw/arm/boot.h | ||
40 | hw/intc/arm_gicv3: Fix write of ICH_VMCR_EL2.{VBPR0, VBPR1} | ||
41 | hw/intc/arm_gicv3: Fix writes to ICC_CTLR_EL3 | ||
42 | |||
43 | Philippe Mathieu-Daudé (3): | ||
44 | hw/arm/exynos4: Remove unuseful debug code | ||
45 | hw/arm/exynos4: Use the IEC binary prefix definitions | ||
46 | hw/arm/exynos4210: QOM'ify the Exynos4210 SoC | ||
47 | |||
48 | Richard Henderson (2): | ||
49 | target/arm: Use extract2 for EXTR | ||
50 | target/arm: Simplify BFXIL expansion | ||
51 | |||
52 | include/hw/arm/allwinner-a10.h | 2 +- | ||
53 | include/hw/arm/aspeed_soc.h | 1 - | ||
54 | include/hw/arm/bcm2836.h | 1 - | ||
55 | include/hw/arm/{arm.h => boot.h} | 12 +++------ | ||
56 | include/hw/arm/exynos4210.h | 9 +++++-- | ||
57 | include/hw/arm/fsl-imx25.h | 2 +- | ||
58 | include/hw/arm/fsl-imx31.h | 2 +- | ||
59 | include/hw/arm/fsl-imx6.h | 2 +- | ||
60 | include/hw/arm/fsl-imx6ul.h | 2 +- | ||
61 | include/hw/arm/fsl-imx7.h | 2 +- | ||
62 | include/hw/arm/virt.h | 2 +- | ||
63 | include/hw/arm/xlnx-versal.h | 2 +- | ||
64 | include/hw/arm/xlnx-zynqmp.h | 2 +- | ||
65 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++ | ||
66 | hw/arm/armsse.c | 2 +- | ||
67 | hw/arm/armv7m.c | 2 +- | ||
68 | hw/arm/aspeed.c | 2 +- | ||
69 | hw/arm/boot.c | 2 +- | ||
70 | hw/arm/collie.c | 2 +- | ||
71 | hw/arm/exynos4210.c | 54 ++++++++++++++++++++++++++++++++++++--- | ||
72 | hw/arm/exynos4_boards.c | 40 ++++++++--------------------- | ||
73 | hw/arm/highbank.c | 2 +- | ||
74 | hw/arm/integratorcp.c | 2 +- | ||
75 | hw/arm/mainstone.c | 2 +- | ||
76 | hw/arm/microbit.c | 2 +- | ||
77 | hw/arm/mps2-tz.c | 2 +- | ||
78 | hw/arm/mps2.c | 2 +- | ||
79 | hw/arm/msf2-soc.c | 1 - | ||
80 | hw/arm/msf2-som.c | 2 +- | ||
81 | hw/arm/musca.c | 2 +- | ||
82 | hw/arm/musicpal.c | 2 +- | ||
83 | hw/arm/netduino2.c | 2 +- | ||
84 | hw/arm/nrf51_soc.c | 2 +- | ||
85 | hw/arm/nseries.c | 2 +- | ||
86 | hw/arm/omap1.c | 2 +- | ||
87 | hw/arm/omap2.c | 2 +- | ||
88 | hw/arm/omap_sx1.c | 2 +- | ||
89 | hw/arm/palm.c | 2 +- | ||
90 | hw/arm/raspi.c | 2 +- | ||
91 | hw/arm/realview.c | 2 +- | ||
92 | hw/arm/spitz.c | 2 +- | ||
93 | hw/arm/stellaris.c | 2 +- | ||
94 | hw/arm/stm32f205_soc.c | 2 +- | ||
95 | hw/arm/strongarm.c | 2 +- | ||
96 | hw/arm/tosa.c | 2 +- | ||
97 | hw/arm/versatilepb.c | 2 +- | ||
98 | hw/arm/vexpress.c | 2 +- | ||
99 | hw/arm/virt.c | 2 +- | ||
100 | hw/arm/xilinx_zynq.c | 2 +- | ||
101 | hw/arm/xlnx-versal.c | 2 +- | ||
102 | hw/arm/z2.c | 2 +- | ||
103 | hw/intc/arm_gicv3_cpuif.c | 6 ++--- | ||
104 | hw/intc/armv7m_nvic.c | 1 - | ||
105 | target/arm/arm-semi.c | 1 - | ||
106 | target/arm/cpu.c | 1 - | ||
107 | target/arm/cpu64.c | 1 - | ||
108 | target/arm/kvm.c | 1 - | ||
109 | target/arm/kvm32.c | 1 - | ||
110 | target/arm/kvm64.c | 1 - | ||
111 | target/arm/translate-a64.c | 44 ++++++++++++++++--------------- | ||
112 | target/arm/translate.c | 4 +-- | ||
113 | 61 files changed, 164 insertions(+), 123 deletions(-) | ||
114 | rename include/hw/arm/{arm.h => boot.h} (96%) | ||
115 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | In the Arm kernel/initrd loading code, in some places we make the | ||
2 | incorrect assumption that info->ram_size can be treated as the | ||
3 | address of the end of RAM, as for instance when we calculate the | ||
4 | available space for the initrd using "info->ram_size - info->initrd_start". | ||
5 | This is wrong, because many Arm boards (including "virt") specify | ||
6 | a non-zero info->loader_start to indicate that their RAM area | ||
7 | starts at a non-zero physical address. | ||
1 | 8 | ||
9 | Correct the places which make this incorrect assumption. | ||
10 | |||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
13 | Tested-by: Mark Rutland <mark.rutland@arm.com> | ||
14 | Message-id: 20190516144733.32399-2-peter.maydell@linaro.org | ||
15 | --- | ||
16 | hw/arm/boot.c | 9 ++++----- | ||
17 | 1 file changed, 4 insertions(+), 5 deletions(-) | ||
18 | |||
19 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | ||
20 | index XXXXXXX..XXXXXXX 100644 | ||
21 | --- a/hw/arm/boot.c | ||
22 | +++ b/hw/arm/boot.c | ||
23 | @@ -XXX,XX +XXX,XX @@ static void arm_setup_direct_kernel_boot(ARMCPU *cpu, | ||
24 | int elf_machine; | ||
25 | hwaddr entry; | ||
26 | static const ARMInsnFixup *primary_loader; | ||
27 | + uint64_t ram_end = info->loader_start + info->ram_size; | ||
28 | |||
29 | if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { | ||
30 | primary_loader = bootloader_aarch64; | ||
31 | @@ -XXX,XX +XXX,XX @@ static void arm_setup_direct_kernel_boot(ARMCPU *cpu, | ||
32 | /* 32-bit ARM */ | ||
33 | entry = info->loader_start + KERNEL_LOAD_ADDR; | ||
34 | kernel_size = load_image_targphys_as(info->kernel_filename, entry, | ||
35 | - info->ram_size - KERNEL_LOAD_ADDR, | ||
36 | - as); | ||
37 | + ram_end - KERNEL_LOAD_ADDR, as); | ||
38 | is_linux = 1; | ||
39 | } | ||
40 | if (kernel_size < 0) { | ||
41 | @@ -XXX,XX +XXX,XX @@ static void arm_setup_direct_kernel_boot(ARMCPU *cpu, | ||
42 | if (info->initrd_filename) { | ||
43 | initrd_size = load_ramdisk_as(info->initrd_filename, | ||
44 | info->initrd_start, | ||
45 | - info->ram_size - info->initrd_start, | ||
46 | - as); | ||
47 | + ram_end - info->initrd_start, as); | ||
48 | if (initrd_size < 0) { | ||
49 | initrd_size = load_image_targphys_as(info->initrd_filename, | ||
50 | info->initrd_start, | ||
51 | - info->ram_size - | ||
52 | + ram_end - | ||
53 | info->initrd_start, | ||
54 | as); | ||
55 | } | ||
56 | -- | ||
57 | 2.20.1 | ||
58 | |||
59 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | We calculate the locations in memory where we want to put the | ||
2 | initrd and the DTB based on the size of the kernel, since they | ||
3 | come after it. Add some explicit checks that these aren't off the | ||
4 | end of RAM entirely. | ||
1 | 5 | ||
6 | (At the moment the way we calculate the initrd_start means that | ||
7 | it can't ever be off the end of RAM, but that will change with | ||
8 | the next commit.) | ||
9 | |||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
12 | Tested-by: Mark Rutland <mark.rutland@arm.com> | ||
13 | Message-id: 20190516144733.32399-3-peter.maydell@linaro.org | ||
14 | --- | ||
15 | hw/arm/boot.c | 23 +++++++++++++++++++++++ | ||
16 | 1 file changed, 23 insertions(+) | ||
17 | |||
18 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | ||
19 | index XXXXXXX..XXXXXXX 100644 | ||
20 | --- a/hw/arm/boot.c | ||
21 | +++ b/hw/arm/boot.c | ||
22 | @@ -XXX,XX +XXX,XX @@ static void arm_setup_direct_kernel_boot(ARMCPU *cpu, | ||
23 | error_report("could not load kernel '%s'", info->kernel_filename); | ||
24 | exit(1); | ||
25 | } | ||
26 | + | ||
27 | + if (kernel_size > info->ram_size) { | ||
28 | + error_report("kernel '%s' is too large to fit in RAM " | ||
29 | + "(kernel size %d, RAM size %" PRId64 ")", | ||
30 | + info->kernel_filename, kernel_size, info->ram_size); | ||
31 | + exit(1); | ||
32 | + } | ||
33 | + | ||
34 | info->entry = entry; | ||
35 | if (is_linux) { | ||
36 | uint32_t fixupcontext[FIXUP_MAX]; | ||
37 | |||
38 | if (info->initrd_filename) { | ||
39 | + | ||
40 | + if (info->initrd_start >= ram_end) { | ||
41 | + error_report("not enough space after kernel to load initrd"); | ||
42 | + exit(1); | ||
43 | + } | ||
44 | + | ||
45 | initrd_size = load_ramdisk_as(info->initrd_filename, | ||
46 | info->initrd_start, | ||
47 | ram_end - info->initrd_start, as); | ||
48 | @@ -XXX,XX +XXX,XX @@ static void arm_setup_direct_kernel_boot(ARMCPU *cpu, | ||
49 | info->initrd_filename); | ||
50 | exit(1); | ||
51 | } | ||
52 | + if (info->initrd_start + initrd_size > info->ram_size) { | ||
53 | + error_report("could not load initrd '%s': " | ||
54 | + "too big to fit into RAM after the kernel", | ||
55 | + info->initrd_filename); | ||
56 | + } | ||
57 | } else { | ||
58 | initrd_size = 0; | ||
59 | } | ||
60 | @@ -XXX,XX +XXX,XX @@ static void arm_setup_direct_kernel_boot(ARMCPU *cpu, | ||
61 | /* Place the DTB after the initrd in memory with alignment. */ | ||
62 | info->dtb_start = QEMU_ALIGN_UP(info->initrd_start + initrd_size, | ||
63 | align); | ||
64 | + if (info->dtb_start >= ram_end) { | ||
65 | + error_report("Not enough space for DTB after kernel/initrd"); | ||
66 | + exit(1); | ||
67 | + } | ||
68 | fixupcontext[FIXUP_ARGPTR_LO] = info->dtb_start; | ||
69 | fixupcontext[FIXUP_ARGPTR_HI] = info->dtb_start >> 32; | ||
70 | } else { | ||
71 | -- | ||
72 | 2.20.1 | ||
73 | |||
74 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | We currently put the initrd at the smaller of: |
---|---|---|---|
2 | * 128MB into RAM | ||
3 | * halfway into the RAM | ||
4 | (with the dtb following it). | ||
2 | 5 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 6 | However for large kernels this might mean that the kernel |
4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | 7 | overlaps the initrd. For some kinds of kernel (self-decompressing |
5 | Message-id: 20190520214342.13709-2-philmd@redhat.com | 8 | 32-bit kernels, and ELF images with a BSS section at the end) |
9 | we don't know the exact size, but even there we have a | ||
10 | minimum size. Put the initrd at least further into RAM than | ||
11 | that. For image formats that can give us an exact kernel size, this | ||
12 | will mean that we definitely avoid overlaying kernel and initrd. | ||
13 | |||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
15 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
16 | Tested-by: Mark Rutland <mark.rutland@arm.com> | ||
17 | Message-id: 20190516144733.32399-4-peter.maydell@linaro.org | ||
7 | --- | 18 | --- |
8 | hw/arm/exynos4_boards.c | 24 ------------------------ | 19 | hw/arm/boot.c | 34 ++++++++++++++++++++-------------- |
9 | 1 file changed, 24 deletions(-) | 20 | 1 file changed, 20 insertions(+), 14 deletions(-) |
10 | 21 | ||
11 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 22 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c |
12 | index XXXXXXX..XXXXXXX 100644 | 23 | index XXXXXXX..XXXXXXX 100644 |
13 | --- a/hw/arm/exynos4_boards.c | 24 | --- a/hw/arm/boot.c |
14 | +++ b/hw/arm/exynos4_boards.c | 25 | +++ b/hw/arm/boot.c |
15 | @@ -XXX,XX +XXX,XX @@ | 26 | @@ -XXX,XX +XXX,XX @@ static void arm_setup_direct_kernel_boot(ARMCPU *cpu, |
16 | #include "hw/net/lan9118.h" | 27 | if (info->nb_cpus == 0) |
17 | #include "hw/boards.h" | 28 | info->nb_cpus = 1; |
18 | 29 | ||
19 | -#undef DEBUG | 30 | - /* |
31 | - * We want to put the initrd far enough into RAM that when the | ||
32 | - * kernel is uncompressed it will not clobber the initrd. However | ||
33 | - * on boards without much RAM we must ensure that we still leave | ||
34 | - * enough room for a decent sized initrd, and on boards with large | ||
35 | - * amounts of RAM we must avoid the initrd being so far up in RAM | ||
36 | - * that it is outside lowmem and inaccessible to the kernel. | ||
37 | - * So for boards with less than 256MB of RAM we put the initrd | ||
38 | - * halfway into RAM, and for boards with 256MB of RAM or more we put | ||
39 | - * the initrd at 128MB. | ||
40 | - */ | ||
41 | - info->initrd_start = info->loader_start + | ||
42 | - MIN(info->ram_size / 2, 128 * 1024 * 1024); | ||
20 | - | 43 | - |
21 | -//#define DEBUG | 44 | /* Assume that raw images are linux kernels, and ELF images are not. */ |
22 | - | 45 | kernel_size = arm_load_elf(info, &elf_entry, &elf_low_addr, |
23 | -#ifdef DEBUG | 46 | &elf_high_addr, elf_machine, as); |
24 | - #undef PRINT_DEBUG | 47 | @@ -XXX,XX +XXX,XX @@ static void arm_setup_direct_kernel_boot(ARMCPU *cpu, |
25 | - #define PRINT_DEBUG(fmt, args...) \ | 48 | } |
26 | - do { \ | 49 | |
27 | - fprintf(stderr, " [%s:%d] "fmt, __func__, __LINE__, ##args); \ | 50 | info->entry = entry; |
28 | - } while (0) | 51 | + |
29 | -#else | 52 | + /* |
30 | - #define PRINT_DEBUG(fmt, args...) do {} while (0) | 53 | + * We want to put the initrd far enough into RAM that when the |
31 | -#endif | 54 | + * kernel is uncompressed it will not clobber the initrd. However |
32 | - | 55 | + * on boards without much RAM we must ensure that we still leave |
33 | #define SMDK_LAN9118_BASE_ADDR 0x05000000 | 56 | + * enough room for a decent sized initrd, and on boards with large |
34 | 57 | + * amounts of RAM we must avoid the initrd being so far up in RAM | |
35 | typedef enum Exynos4BoardType { | 58 | + * that it is outside lowmem and inaccessible to the kernel. |
36 | @@ -XXX,XX +XXX,XX @@ exynos4_boards_init_common(MachineState *machine, | 59 | + * So for boards with less than 256MB of RAM we put the initrd |
37 | exynos4_board_binfo.gic_cpu_if_addr = | 60 | + * halfway into RAM, and for boards with 256MB of RAM or more we put |
38 | EXYNOS4210_SMP_PRIVATE_BASE_ADDR + 0x100; | 61 | + * the initrd at 128MB. |
39 | 62 | + * We also refuse to put the initrd somewhere that will definitely | |
40 | - PRINT_DEBUG("\n ram_size: %luMiB [0x%08lx]\n" | 63 | + * overlay the kernel we just loaded, though for kernel formats which |
41 | - " kernel_filename: %s\n" | 64 | + * don't tell us their exact size (eg self-decompressing 32-bit kernels) |
42 | - " kernel_cmdline: %s\n" | 65 | + * we might still make a bad choice here. |
43 | - " initrd_filename: %s\n", | 66 | + */ |
44 | - exynos4_board_ram_size[board_type] / 1048576, | 67 | + info->initrd_start = info->loader_start + |
45 | - exynos4_board_ram_size[board_type], | 68 | + MAX(MIN(info->ram_size / 2, 128 * 1024 * 1024), kernel_size); |
46 | - machine->kernel_filename, | 69 | + info->initrd_start = TARGET_PAGE_ALIGN(info->initrd_start); |
47 | - machine->kernel_cmdline, | 70 | + |
48 | - machine->initrd_filename); | 71 | if (is_linux) { |
49 | - | 72 | uint32_t fixupcontext[FIXUP_MAX]; |
50 | exynos4_boards_init_ram(s, get_system_memory(), | ||
51 | exynos4_board_ram_size[board_type]); | ||
52 | 73 | ||
53 | -- | 74 | -- |
54 | 2.20.1 | 75 | 2.20.1 |
55 | 76 | ||
56 | 77 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Since Linux v3.17, the kernel's Image header includes a field image_size, | ||
2 | which gives the total size of the kernel including unpopulated data | ||
3 | sections such as the BSS). If this is present, then return it from | ||
4 | load_aarch64_image() as the true size of the kernel rather than | ||
5 | just using the size of the Image file itself. This allows the code | ||
6 | which calculates where to put the initrd to avoid putting it in | ||
7 | the kernel's BSS area. | ||
1 | 8 | ||
9 | This means that we should be able to reliably load kernel images | ||
10 | which are larger than 128MB without accidentally putting the | ||
11 | initrd or dtb in locations that clash with the kernel itself. | ||
12 | |||
13 | Fixes: https://bugs.launchpad.net/qemu/+bug/1823998 | ||
14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
15 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
16 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
17 | Tested-by: Mark Rutland <mark.rutland@arm.com> | ||
18 | Message-id: 20190516144733.32399-5-peter.maydell@linaro.org | ||
19 | --- | ||
20 | hw/arm/boot.c | 17 +++++++++++++++-- | ||
21 | 1 file changed, 15 insertions(+), 2 deletions(-) | ||
22 | |||
23 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | ||
24 | index XXXXXXX..XXXXXXX 100644 | ||
25 | --- a/hw/arm/boot.c | ||
26 | +++ b/hw/arm/boot.c | ||
27 | @@ -XXX,XX +XXX,XX @@ static uint64_t load_aarch64_image(const char *filename, hwaddr mem_base, | ||
28 | hwaddr *entry, AddressSpace *as) | ||
29 | { | ||
30 | hwaddr kernel_load_offset = KERNEL64_LOAD_ADDR; | ||
31 | + uint64_t kernel_size = 0; | ||
32 | uint8_t *buffer; | ||
33 | int size; | ||
34 | |||
35 | @@ -XXX,XX +XXX,XX @@ static uint64_t load_aarch64_image(const char *filename, hwaddr mem_base, | ||
36 | * is only valid if the image_size is non-zero. | ||
37 | */ | ||
38 | memcpy(&hdrvals, buffer + ARM64_TEXT_OFFSET_OFFSET, sizeof(hdrvals)); | ||
39 | - if (hdrvals[1] != 0) { | ||
40 | + | ||
41 | + kernel_size = le64_to_cpu(hdrvals[1]); | ||
42 | + | ||
43 | + if (kernel_size != 0) { | ||
44 | kernel_load_offset = le64_to_cpu(hdrvals[0]); | ||
45 | |||
46 | /* | ||
47 | @@ -XXX,XX +XXX,XX @@ static uint64_t load_aarch64_image(const char *filename, hwaddr mem_base, | ||
48 | } | ||
49 | } | ||
50 | |||
51 | + /* | ||
52 | + * Kernels before v3.17 don't populate the image_size field, and | ||
53 | + * raw images have no header. For those our best guess at the size | ||
54 | + * is the size of the Image file itself. | ||
55 | + */ | ||
56 | + if (kernel_size == 0) { | ||
57 | + kernel_size = size; | ||
58 | + } | ||
59 | + | ||
60 | *entry = mem_base + kernel_load_offset; | ||
61 | rom_add_blob_fixed_as(filename, buffer, size, *entry, as); | ||
62 | |||
63 | g_free(buffer); | ||
64 | |||
65 | - return size; | ||
66 | + return kernel_size; | ||
67 | } | ||
68 | |||
69 | static void arm_setup_direct_kernel_boot(ARMCPU *cpu, | ||
70 | -- | ||
71 | 2.20.1 | ||
72 | |||
73 | diff view generated by jsdifflib |
1 | The hw/arm/arm.h header now only includes declarations relating | 1 | Allow VFP and neon to be disabled via a CPU property. As with |
---|---|---|---|
2 | to boot.c code, so it is only needed by Arm board or SoC code. | 2 | the "pmu" property, we only allow these features to be removed |
3 | Remove some unnecessary inclusions of it from target/arm files | 3 | from CPUs which have it by default, not added to CPUs which |
4 | and from hw/intc/armv7m_nvic.c. | 4 | don't have it. |
5 | |||
6 | The primary motivation here is to be able to optionally | ||
7 | create Cortex-M33 CPUs with no FPU, but we provide switches | ||
8 | for both VFP and Neon because the two interact: | ||
9 | * AArch64 can't have one without the other | ||
10 | * Some ID register fields only change if both are disabled | ||
5 | 11 | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 13 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 14 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> |
9 | Message-id: 20190516163857.6430-3-peter.maydell@linaro.org | 15 | Message-id: 20190517174046.11146-2-peter.maydell@linaro.org |
10 | --- | 16 | --- |
11 | hw/intc/armv7m_nvic.c | 1 - | 17 | target/arm/cpu.h | 4 ++ |
12 | target/arm/arm-semi.c | 1 - | 18 | target/arm/cpu.c | 150 +++++++++++++++++++++++++++++++++++++++++++++-- |
13 | target/arm/cpu.c | 1 - | 19 | 2 files changed, 148 insertions(+), 6 deletions(-) |
14 | target/arm/cpu64.c | 1 - | 20 | |
15 | target/arm/kvm.c | 1 - | 21 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h |
16 | target/arm/kvm32.c | 1 - | ||
17 | target/arm/kvm64.c | 1 - | ||
18 | 7 files changed, 7 deletions(-) | ||
19 | |||
20 | diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c | ||
21 | index XXXXXXX..XXXXXXX 100644 | 22 | index XXXXXXX..XXXXXXX 100644 |
22 | --- a/hw/intc/armv7m_nvic.c | 23 | --- a/target/arm/cpu.h |
23 | +++ b/hw/intc/armv7m_nvic.c | 24 | +++ b/target/arm/cpu.h |
24 | @@ -XXX,XX +XXX,XX @@ | 25 | @@ -XXX,XX +XXX,XX @@ struct ARMCPU { |
25 | #include "cpu.h" | 26 | bool has_el3; |
26 | #include "hw/sysbus.h" | 27 | /* CPU has PMU (Performance Monitor Unit) */ |
27 | #include "qemu/timer.h" | 28 | bool has_pmu; |
28 | -#include "hw/arm/arm.h" | 29 | + /* CPU has VFP */ |
29 | #include "hw/intc/armv7m_nvic.h" | 30 | + bool has_vfp; |
30 | #include "target/arm/cpu.h" | 31 | + /* CPU has Neon */ |
31 | #include "exec/exec-all.h" | 32 | + bool has_neon; |
32 | diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c | 33 | |
33 | index XXXXXXX..XXXXXXX 100644 | 34 | /* CPU has memory protection unit */ |
34 | --- a/target/arm/arm-semi.c | 35 | bool has_mpu; |
35 | +++ b/target/arm/arm-semi.c | ||
36 | @@ -XXX,XX +XXX,XX @@ | ||
37 | #else | ||
38 | #include "qemu-common.h" | ||
39 | #include "exec/gdbstub.h" | ||
40 | -#include "hw/arm/arm.h" | ||
41 | #include "qemu/cutils.h" | ||
42 | #endif | ||
43 | |||
44 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | 36 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c |
45 | index XXXXXXX..XXXXXXX 100644 | 37 | index XXXXXXX..XXXXXXX 100644 |
46 | --- a/target/arm/cpu.c | 38 | --- a/target/arm/cpu.c |
47 | +++ b/target/arm/cpu.c | 39 | +++ b/target/arm/cpu.c |
48 | @@ -XXX,XX +XXX,XX @@ | 40 | @@ -XXX,XX +XXX,XX @@ static Property arm_cpu_cfgend_property = |
49 | #if !defined(CONFIG_USER_ONLY) | 41 | static Property arm_cpu_has_pmu_property = |
50 | #include "hw/loader.h" | 42 | DEFINE_PROP_BOOL("pmu", ARMCPU, has_pmu, true); |
51 | #endif | 43 | |
52 | -#include "hw/arm/arm.h" | 44 | +static Property arm_cpu_has_vfp_property = |
53 | #include "sysemu/sysemu.h" | 45 | + DEFINE_PROP_BOOL("vfp", ARMCPU, has_vfp, true); |
54 | #include "sysemu/hw_accel.h" | 46 | + |
55 | #include "kvm_arm.h" | 47 | +static Property arm_cpu_has_neon_property = |
56 | diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c | 48 | + DEFINE_PROP_BOOL("neon", ARMCPU, has_neon, true); |
57 | index XXXXXXX..XXXXXXX 100644 | 49 | + |
58 | --- a/target/arm/cpu64.c | 50 | static Property arm_cpu_has_mpu_property = |
59 | +++ b/target/arm/cpu64.c | 51 | DEFINE_PROP_BOOL("has-mpu", ARMCPU, has_mpu, true); |
60 | @@ -XXX,XX +XXX,XX @@ | 52 | |
61 | #if !defined(CONFIG_USER_ONLY) | 53 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_post_init(Object *obj) |
62 | #include "hw/loader.h" | 54 | if (arm_feature(&cpu->env, ARM_FEATURE_M)) { |
63 | #endif | 55 | set_feature(&cpu->env, ARM_FEATURE_PMSA); |
64 | -#include "hw/arm/arm.h" | 56 | } |
65 | #include "sysemu/sysemu.h" | 57 | + /* Similarly for the VFP feature bits */ |
66 | #include "sysemu/kvm.h" | 58 | + if (arm_feature(&cpu->env, ARM_FEATURE_VFP4)) { |
67 | #include "kvm_arm.h" | 59 | + set_feature(&cpu->env, ARM_FEATURE_VFP3); |
68 | diff --git a/target/arm/kvm.c b/target/arm/kvm.c | 60 | + } |
69 | index XXXXXXX..XXXXXXX 100644 | 61 | + if (arm_feature(&cpu->env, ARM_FEATURE_VFP3)) { |
70 | --- a/target/arm/kvm.c | 62 | + set_feature(&cpu->env, ARM_FEATURE_VFP); |
71 | +++ b/target/arm/kvm.c | 63 | + } |
72 | @@ -XXX,XX +XXX,XX @@ | 64 | |
73 | #include "cpu.h" | 65 | if (arm_feature(&cpu->env, ARM_FEATURE_CBAR) || |
74 | #include "trace.h" | 66 | arm_feature(&cpu->env, ARM_FEATURE_CBAR_RO)) { |
75 | #include "internals.h" | 67 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_post_init(Object *obj) |
76 | -#include "hw/arm/arm.h" | 68 | &error_abort); |
77 | #include "hw/pci/pci.h" | 69 | } |
78 | #include "exec/memattrs.h" | 70 | |
79 | #include "exec/address-spaces.h" | 71 | + /* |
80 | diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c | 72 | + * Allow user to turn off VFP and Neon support, but only for TCG -- |
81 | index XXXXXXX..XXXXXXX 100644 | 73 | + * KVM does not currently allow us to lie to the guest about its |
82 | --- a/target/arm/kvm32.c | 74 | + * ID/feature registers, so the guest always sees what the host has. |
83 | +++ b/target/arm/kvm32.c | 75 | + */ |
84 | @@ -XXX,XX +XXX,XX @@ | 76 | + if (arm_feature(&cpu->env, ARM_FEATURE_VFP)) { |
85 | #include "sysemu/kvm.h" | 77 | + cpu->has_vfp = true; |
86 | #include "kvm_arm.h" | 78 | + if (!kvm_enabled()) { |
87 | #include "internals.h" | 79 | + qdev_property_add_static(DEVICE(obj), &arm_cpu_has_vfp_property, |
88 | -#include "hw/arm/arm.h" | 80 | + &error_abort); |
89 | #include "qemu/log.h" | 81 | + } |
90 | 82 | + } | |
91 | static inline void set_feature(uint64_t *features, int feature) | 83 | + |
92 | diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c | 84 | + if (arm_feature(&cpu->env, ARM_FEATURE_NEON)) { |
93 | index XXXXXXX..XXXXXXX 100644 | 85 | + cpu->has_neon = true; |
94 | --- a/target/arm/kvm64.c | 86 | + if (!kvm_enabled()) { |
95 | +++ b/target/arm/kvm64.c | 87 | + qdev_property_add_static(DEVICE(obj), &arm_cpu_has_neon_property, |
96 | @@ -XXX,XX +XXX,XX @@ | 88 | + &error_abort); |
97 | #include "sysemu/kvm.h" | 89 | + } |
98 | #include "kvm_arm.h" | 90 | + } |
99 | #include "internals.h" | 91 | + |
100 | -#include "hw/arm/arm.h" | 92 | if (arm_feature(&cpu->env, ARM_FEATURE_PMSA)) { |
101 | 93 | qdev_property_add_static(DEVICE(obj), &arm_cpu_has_mpu_property, | |
102 | static bool have_guest_debug; | 94 | &error_abort); |
103 | 95 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | |
96 | return; | ||
97 | } | ||
98 | |||
99 | + if (arm_feature(env, ARM_FEATURE_AARCH64) && | ||
100 | + cpu->has_vfp != cpu->has_neon) { | ||
101 | + /* | ||
102 | + * This is an architectural requirement for AArch64; AArch32 is | ||
103 | + * more flexible and permits VFP-no-Neon and Neon-no-VFP. | ||
104 | + */ | ||
105 | + error_setg(errp, | ||
106 | + "AArch64 CPUs must have both VFP and Neon or neither"); | ||
107 | + return; | ||
108 | + } | ||
109 | + | ||
110 | + if (!cpu->has_vfp) { | ||
111 | + uint64_t t; | ||
112 | + uint32_t u; | ||
113 | + | ||
114 | + unset_feature(env, ARM_FEATURE_VFP); | ||
115 | + unset_feature(env, ARM_FEATURE_VFP3); | ||
116 | + unset_feature(env, ARM_FEATURE_VFP4); | ||
117 | + | ||
118 | + t = cpu->isar.id_aa64isar1; | ||
119 | + t = FIELD_DP64(t, ID_AA64ISAR1, JSCVT, 0); | ||
120 | + cpu->isar.id_aa64isar1 = t; | ||
121 | + | ||
122 | + t = cpu->isar.id_aa64pfr0; | ||
123 | + t = FIELD_DP64(t, ID_AA64PFR0, FP, 0xf); | ||
124 | + cpu->isar.id_aa64pfr0 = t; | ||
125 | + | ||
126 | + u = cpu->isar.id_isar6; | ||
127 | + u = FIELD_DP32(u, ID_ISAR6, JSCVT, 0); | ||
128 | + cpu->isar.id_isar6 = u; | ||
129 | + | ||
130 | + u = cpu->isar.mvfr0; | ||
131 | + u = FIELD_DP32(u, MVFR0, FPSP, 0); | ||
132 | + u = FIELD_DP32(u, MVFR0, FPDP, 0); | ||
133 | + u = FIELD_DP32(u, MVFR0, FPTRAP, 0); | ||
134 | + u = FIELD_DP32(u, MVFR0, FPDIVIDE, 0); | ||
135 | + u = FIELD_DP32(u, MVFR0, FPSQRT, 0); | ||
136 | + u = FIELD_DP32(u, MVFR0, FPSHVEC, 0); | ||
137 | + u = FIELD_DP32(u, MVFR0, FPROUND, 0); | ||
138 | + cpu->isar.mvfr0 = u; | ||
139 | + | ||
140 | + u = cpu->isar.mvfr1; | ||
141 | + u = FIELD_DP32(u, MVFR1, FPFTZ, 0); | ||
142 | + u = FIELD_DP32(u, MVFR1, FPDNAN, 0); | ||
143 | + u = FIELD_DP32(u, MVFR1, FPHP, 0); | ||
144 | + cpu->isar.mvfr1 = u; | ||
145 | + | ||
146 | + u = cpu->isar.mvfr2; | ||
147 | + u = FIELD_DP32(u, MVFR2, FPMISC, 0); | ||
148 | + cpu->isar.mvfr2 = u; | ||
149 | + } | ||
150 | + | ||
151 | + if (!cpu->has_neon) { | ||
152 | + uint64_t t; | ||
153 | + uint32_t u; | ||
154 | + | ||
155 | + unset_feature(env, ARM_FEATURE_NEON); | ||
156 | + | ||
157 | + t = cpu->isar.id_aa64isar0; | ||
158 | + t = FIELD_DP64(t, ID_AA64ISAR0, DP, 0); | ||
159 | + cpu->isar.id_aa64isar0 = t; | ||
160 | + | ||
161 | + t = cpu->isar.id_aa64isar1; | ||
162 | + t = FIELD_DP64(t, ID_AA64ISAR1, FCMA, 0); | ||
163 | + cpu->isar.id_aa64isar1 = t; | ||
164 | + | ||
165 | + t = cpu->isar.id_aa64pfr0; | ||
166 | + t = FIELD_DP64(t, ID_AA64PFR0, ADVSIMD, 0xf); | ||
167 | + cpu->isar.id_aa64pfr0 = t; | ||
168 | + | ||
169 | + u = cpu->isar.id_isar5; | ||
170 | + u = FIELD_DP32(u, ID_ISAR5, RDM, 0); | ||
171 | + u = FIELD_DP32(u, ID_ISAR5, VCMA, 0); | ||
172 | + cpu->isar.id_isar5 = u; | ||
173 | + | ||
174 | + u = cpu->isar.id_isar6; | ||
175 | + u = FIELD_DP32(u, ID_ISAR6, DP, 0); | ||
176 | + u = FIELD_DP32(u, ID_ISAR6, FHM, 0); | ||
177 | + cpu->isar.id_isar6 = u; | ||
178 | + | ||
179 | + u = cpu->isar.mvfr1; | ||
180 | + u = FIELD_DP32(u, MVFR1, SIMDLS, 0); | ||
181 | + u = FIELD_DP32(u, MVFR1, SIMDINT, 0); | ||
182 | + u = FIELD_DP32(u, MVFR1, SIMDSP, 0); | ||
183 | + u = FIELD_DP32(u, MVFR1, SIMDHP, 0); | ||
184 | + u = FIELD_DP32(u, MVFR1, SIMDFMAC, 0); | ||
185 | + cpu->isar.mvfr1 = u; | ||
186 | + | ||
187 | + u = cpu->isar.mvfr2; | ||
188 | + u = FIELD_DP32(u, MVFR2, SIMDMISC, 0); | ||
189 | + cpu->isar.mvfr2 = u; | ||
190 | + } | ||
191 | + | ||
192 | + if (!cpu->has_neon && !cpu->has_vfp) { | ||
193 | + uint64_t t; | ||
194 | + uint32_t u; | ||
195 | + | ||
196 | + t = cpu->isar.id_aa64isar0; | ||
197 | + t = FIELD_DP64(t, ID_AA64ISAR0, FHM, 0); | ||
198 | + cpu->isar.id_aa64isar0 = t; | ||
199 | + | ||
200 | + t = cpu->isar.id_aa64isar1; | ||
201 | + t = FIELD_DP64(t, ID_AA64ISAR1, FRINTTS, 0); | ||
202 | + cpu->isar.id_aa64isar1 = t; | ||
203 | + | ||
204 | + u = cpu->isar.mvfr0; | ||
205 | + u = FIELD_DP32(u, MVFR0, SIMDREG, 0); | ||
206 | + cpu->isar.mvfr0 = u; | ||
207 | + } | ||
208 | + | ||
209 | /* Some features automatically imply others: */ | ||
210 | if (arm_feature(env, ARM_FEATURE_V8)) { | ||
211 | if (arm_feature(env, ARM_FEATURE_M)) { | ||
212 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
213 | if (arm_feature(env, ARM_FEATURE_V5)) { | ||
214 | set_feature(env, ARM_FEATURE_V4T); | ||
215 | } | ||
216 | - if (arm_feature(env, ARM_FEATURE_VFP4)) { | ||
217 | - set_feature(env, ARM_FEATURE_VFP3); | ||
218 | - } | ||
219 | - if (arm_feature(env, ARM_FEATURE_VFP3)) { | ||
220 | - set_feature(env, ARM_FEATURE_VFP); | ||
221 | - } | ||
222 | if (arm_feature(env, ARM_FEATURE_LPAE)) { | ||
223 | set_feature(env, ARM_FEATURE_V7MP); | ||
224 | set_feature(env, ARM_FEATURE_PXN); | ||
104 | -- | 225 | -- |
105 | 2.20.1 | 226 | 2.20.1 |
106 | 227 | ||
107 | 228 | diff view generated by jsdifflib |
1 | The ICC_CTLR_EL3 register includes some bits which are aliases | 1 | Allow the DSP extension to be disabled via a CPU property for |
---|---|---|---|
2 | of bits in the ICC_CTLR_EL1(S) and (NS) registers. QEMU chooses | 2 | M-profile CPUs. (A and R-profile CPUs don't have this extension |
3 | to keep those bits in the cs->icc_ctlr_el1[] struct fields. | 3 | as a defined separate optional architecture extension, so |
4 | Unfortunately a missing '~' in the code to update the bits | 4 | they don't need the property.) |
5 | in those fields meant that writing to ICC_CTLR_EL3 would corrupt | ||
6 | the ICC_CLTR_EL1 register values. | ||
7 | 5 | ||
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> | 7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
10 | Message-id: 20190520162809.2677-5-peter.maydell@linaro.org | 8 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> |
9 | Message-id: 20190517174046.11146-3-peter.maydell@linaro.org | ||
11 | --- | 10 | --- |
12 | hw/intc/arm_gicv3_cpuif.c | 4 ++-- | 11 | target/arm/cpu.h | 2 ++ |
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | 12 | target/arm/cpu.c | 29 +++++++++++++++++++++++++++++ |
13 | 2 files changed, 31 insertions(+) | ||
14 | 14 | ||
15 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | 15 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h |
16 | index XXXXXXX..XXXXXXX 100644 | 16 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/hw/intc/arm_gicv3_cpuif.c | 17 | --- a/target/arm/cpu.h |
18 | +++ b/hw/intc/arm_gicv3_cpuif.c | 18 | +++ b/target/arm/cpu.h |
19 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, | 19 | @@ -XXX,XX +XXX,XX @@ struct ARMCPU { |
20 | trace_gicv3_icc_ctlr_el3_write(gicv3_redist_affid(cs), value); | 20 | bool has_vfp; |
21 | 21 | /* CPU has Neon */ | |
22 | /* *_EL1NS and *_EL1S bits are aliases into the ICC_CTLR_EL1 bits. */ | 22 | bool has_neon; |
23 | - cs->icc_ctlr_el1[GICV3_NS] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 23 | + /* CPU has M-profile DSP extension */ |
24 | + cs->icc_ctlr_el1[GICV3_NS] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 24 | + bool has_dsp; |
25 | if (value & ICC_CTLR_EL3_EOIMODE_EL1NS) { | 25 | |
26 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_EOIMODE; | 26 | /* CPU has memory protection unit */ |
27 | bool has_mpu; | ||
28 | diff --git a/target/arm/cpu.c b/target/arm/cpu.c | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/target/arm/cpu.c | ||
31 | +++ b/target/arm/cpu.c | ||
32 | @@ -XXX,XX +XXX,XX @@ static Property arm_cpu_has_vfp_property = | ||
33 | static Property arm_cpu_has_neon_property = | ||
34 | DEFINE_PROP_BOOL("neon", ARMCPU, has_neon, true); | ||
35 | |||
36 | +static Property arm_cpu_has_dsp_property = | ||
37 | + DEFINE_PROP_BOOL("dsp", ARMCPU, has_dsp, true); | ||
38 | + | ||
39 | static Property arm_cpu_has_mpu_property = | ||
40 | DEFINE_PROP_BOOL("has-mpu", ARMCPU, has_mpu, true); | ||
41 | |||
42 | @@ -XXX,XX +XXX,XX @@ void arm_cpu_post_init(Object *obj) | ||
43 | } | ||
27 | } | 44 | } |
28 | @@ -XXX,XX +XXX,XX @@ static void icc_ctlr_el3_write(CPUARMState *env, const ARMCPRegInfo *ri, | 45 | |
29 | cs->icc_ctlr_el1[GICV3_NS] |= ICC_CTLR_EL1_CBPR; | 46 | + if (arm_feature(&cpu->env, ARM_FEATURE_M) && |
47 | + arm_feature(&cpu->env, ARM_FEATURE_THUMB_DSP)) { | ||
48 | + qdev_property_add_static(DEVICE(obj), &arm_cpu_has_dsp_property, | ||
49 | + &error_abort); | ||
50 | + } | ||
51 | + | ||
52 | if (arm_feature(&cpu->env, ARM_FEATURE_PMSA)) { | ||
53 | qdev_property_add_static(DEVICE(obj), &arm_cpu_has_mpu_property, | ||
54 | &error_abort); | ||
55 | @@ -XXX,XX +XXX,XX @@ static void arm_cpu_realizefn(DeviceState *dev, Error **errp) | ||
56 | cpu->isar.mvfr0 = u; | ||
30 | } | 57 | } |
31 | 58 | ||
32 | - cs->icc_ctlr_el1[GICV3_S] &= (ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 59 | + if (arm_feature(env, ARM_FEATURE_M) && !cpu->has_dsp) { |
33 | + cs->icc_ctlr_el1[GICV3_S] &= ~(ICC_CTLR_EL1_CBPR | ICC_CTLR_EL1_EOIMODE); | 60 | + uint32_t u; |
34 | if (value & ICC_CTLR_EL3_EOIMODE_EL1S) { | 61 | + |
35 | cs->icc_ctlr_el1[GICV3_S] |= ICC_CTLR_EL1_EOIMODE; | 62 | + unset_feature(env, ARM_FEATURE_THUMB_DSP); |
36 | } | 63 | + |
64 | + u = cpu->isar.id_isar1; | ||
65 | + u = FIELD_DP32(u, ID_ISAR1, EXTEND, 1); | ||
66 | + cpu->isar.id_isar1 = u; | ||
67 | + | ||
68 | + u = cpu->isar.id_isar2; | ||
69 | + u = FIELD_DP32(u, ID_ISAR2, MULTU, 1); | ||
70 | + u = FIELD_DP32(u, ID_ISAR2, MULTS, 1); | ||
71 | + cpu->isar.id_isar2 = u; | ||
72 | + | ||
73 | + u = cpu->isar.id_isar3; | ||
74 | + u = FIELD_DP32(u, ID_ISAR3, SIMD, 1); | ||
75 | + u = FIELD_DP32(u, ID_ISAR3, SATURATE, 0); | ||
76 | + cpu->isar.id_isar3 = u; | ||
77 | + } | ||
78 | + | ||
79 | /* Some features automatically imply others: */ | ||
80 | if (arm_feature(env, ARM_FEATURE_V8)) { | ||
81 | if (arm_feature(env, ARM_FEATURE_M)) { | ||
37 | -- | 82 | -- |
38 | 2.20.1 | 83 | 2.20.1 |
39 | 84 | ||
40 | 85 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | Create "vfp" and "dsp" properties on the armv7m container object |
---|---|---|---|
2 | which will be forwarded to its CPU object, so that SoCs can | ||
3 | configure whether the CPU has these features. | ||
2 | 4 | ||
3 | It eases code review, unit is explicit. | 5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
7 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
8 | Message-id: 20190517174046.11146-4-peter.maydell@linaro.org | ||
9 | --- | ||
10 | include/hw/arm/armv7m.h | 4 ++++ | ||
11 | hw/arm/armv7m.c | 18 ++++++++++++++++++ | ||
12 | 2 files changed, 22 insertions(+) | ||
4 | 13 | ||
5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 14 | diff --git a/include/hw/arm/armv7m.h b/include/hw/arm/armv7m.h |
6 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
7 | Message-id: 20190520214342.13709-3-philmd@redhat.com | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | --- | ||
10 | hw/arm/exynos4_boards.c | 5 +++-- | ||
11 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/hw/arm/exynos4_boards.c | 16 | --- a/include/hw/arm/armv7m.h |
16 | +++ b/hw/arm/exynos4_boards.c | 17 | +++ b/include/hw/arm/armv7m.h |
17 | @@ -XXX,XX +XXX,XX @@ | 18 | @@ -XXX,XX +XXX,XX @@ typedef struct { |
19 | * devices will be automatically layered on top of this view.) | ||
20 | * + Property "idau": IDAU interface (forwarded to CPU object) | ||
21 | * + Property "init-svtor": secure VTOR reset value (forwarded to CPU object) | ||
22 | + * + Property "vfp": enable VFP (forwarded to CPU object) | ||
23 | + * + Property "dsp": enable DSP (forwarded to CPU object) | ||
24 | * + Property "enable-bitband": expose bitbanded IO | ||
18 | */ | 25 | */ |
19 | 26 | typedef struct ARMv7MState { | |
20 | #include "qemu/osdep.h" | 27 | @@ -XXX,XX +XXX,XX @@ typedef struct ARMv7MState { |
21 | +#include "qemu/units.h" | 28 | uint32_t init_svtor; |
22 | #include "qapi/error.h" | 29 | bool enable_bitband; |
23 | #include "qemu/error-report.h" | 30 | bool start_powered_off; |
24 | #include "qemu-common.h" | 31 | + bool vfp; |
25 | @@ -XXX,XX +XXX,XX @@ static int exynos4_board_smp_bootreg_addr[EXYNOS4_NUM_OF_BOARDS] = { | 32 | + bool dsp; |
33 | } ARMv7MState; | ||
34 | |||
35 | #endif | ||
36 | diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c | ||
37 | index XXXXXXX..XXXXXXX 100644 | ||
38 | --- a/hw/arm/armv7m.c | ||
39 | +++ b/hw/arm/armv7m.c | ||
40 | @@ -XXX,XX +XXX,XX @@ static void armv7m_realize(DeviceState *dev, Error **errp) | ||
41 | return; | ||
42 | } | ||
43 | } | ||
44 | + if (object_property_find(OBJECT(s->cpu), "vfp", NULL)) { | ||
45 | + object_property_set_bool(OBJECT(s->cpu), s->vfp, | ||
46 | + "vfp", &err); | ||
47 | + if (err != NULL) { | ||
48 | + error_propagate(errp, err); | ||
49 | + return; | ||
50 | + } | ||
51 | + } | ||
52 | + if (object_property_find(OBJECT(s->cpu), "dsp", NULL)) { | ||
53 | + object_property_set_bool(OBJECT(s->cpu), s->dsp, | ||
54 | + "dsp", &err); | ||
55 | + if (err != NULL) { | ||
56 | + error_propagate(errp, err); | ||
57 | + return; | ||
58 | + } | ||
59 | + } | ||
60 | |||
61 | /* | ||
62 | * Tell the CPU where the NVIC is; it will fail realize if it doesn't | ||
63 | @@ -XXX,XX +XXX,XX @@ static Property armv7m_properties[] = { | ||
64 | DEFINE_PROP_BOOL("enable-bitband", ARMv7MState, enable_bitband, false), | ||
65 | DEFINE_PROP_BOOL("start-powered-off", ARMv7MState, start_powered_off, | ||
66 | false), | ||
67 | + DEFINE_PROP_BOOL("vfp", ARMv7MState, vfp, true), | ||
68 | + DEFINE_PROP_BOOL("dsp", ARMv7MState, dsp, true), | ||
69 | DEFINE_PROP_END_OF_LIST(), | ||
26 | }; | 70 | }; |
27 | 71 | ||
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 | -- | 72 | -- |
37 | 2.20.1 | 73 | 2.20.1 |
38 | 74 | ||
39 | 75 | diff view generated by jsdifflib |
1 | The header file hw/arm/arm.h now includes only declarations | 1 | The SSE-200 hardware has configurable integration settings which |
---|---|---|---|
2 | relating to hw/arm/boot.c functionality. Rename it accordingly, | 2 | determine whether its two CPUs have the FPU and DSP: |
3 | and adjust its header comment. | 3 | * CPU0_FPU (default 0) |
4 | * CPU0_DSP (default 0) | ||
5 | * CPU1_FPU (default 1) | ||
6 | * CPU1_DSP (default 1) | ||
4 | 7 | ||
5 | The bulk of this commit was created via | 8 | Similarly, the IoTKit has settings for its single CPU: |
6 | perl -pi -e 's|hw/arm/arm.h|hw/arm/boot.h|' hw/arm/*.c include/hw/arm/*.h | 9 | * CPU0_FPU (default 1) |
10 | * CPU0_DSP (default 1) | ||
7 | 11 | ||
8 | In a few cases we can just delete the #include: | 12 | Of our four boards that use either the IoTKit or the SSE-200: |
9 | hw/arm/msf2-soc.c, include/hw/arm/aspeed_soc.h and | 13 | * mps2-an505, mps2-an521 and musca-a use the default settings |
10 | include/hw/arm/bcm2836.h did not require it. | 14 | * musca-b1 enables FPU and DSP on both CPUs |
15 | |||
16 | Currently QEMU models all these boards using CPUs with | ||
17 | both FPU and DSP enabled. This means that we are incorrect | ||
18 | for mps2-an521 and musca-a, which should not have FPU or DSP | ||
19 | on CPU0. | ||
20 | |||
21 | Create QOM properties on the ARMSSE devices corresponding to the | ||
22 | default h/w integration settings, and make the Musca-B1 board | ||
23 | enable FPU and DSP on both CPUs. This fixes the mps2-an521 | ||
24 | and musca-a behaviour, and leaves the musca-b1 and mps2-an505 | ||
25 | behaviour unchanged. | ||
11 | 26 | ||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 27 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
13 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 28 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> |
14 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 29 | Message-id: 20190517174046.11146-5-peter.maydell@linaro.org |
15 | Message-id: 20190516163857.6430-4-peter.maydell@linaro.org | ||
16 | --- | 30 | --- |
17 | include/hw/arm/allwinner-a10.h | 2 +- | 31 | include/hw/arm/armsse.h | 7 +++++ |
18 | include/hw/arm/aspeed_soc.h | 1 - | 32 | hw/arm/armsse.c | 58 ++++++++++++++++++++++++++++++++--------- |
19 | include/hw/arm/bcm2836.h | 1 - | 33 | hw/arm/musca.c | 8 ++++++ |
20 | include/hw/arm/{arm.h => boot.h} | 8 ++++---- | 34 | 3 files changed, 61 insertions(+), 12 deletions(-) |
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 | 35 | ||
69 | diff --git a/include/hw/arm/allwinner-a10.h b/include/hw/arm/allwinner-a10.h | 36 | diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h |
70 | index XXXXXXX..XXXXXXX 100644 | 37 | index XXXXXXX..XXXXXXX 100644 |
71 | --- a/include/hw/arm/allwinner-a10.h | 38 | --- a/include/hw/arm/armsse.h |
72 | +++ b/include/hw/arm/allwinner-a10.h | 39 | +++ b/include/hw/arm/armsse.h |
73 | @@ -XXX,XX +XXX,XX @@ | 40 | @@ -XXX,XX +XXX,XX @@ |
74 | #include "qemu-common.h" | 41 | * address of each SRAM bank (and thus the total amount of internal SRAM) |
75 | #include "qemu/error-report.h" | 42 | * + QOM property "init-svtor" sets the initial value of the CPU SVTOR register |
76 | #include "hw/char/serial.h" | 43 | * (where it expects to load the PC and SP from the vector table on reset) |
77 | -#include "hw/arm/arm.h" | 44 | + * + QOM properties "CPU0_FPU", "CPU0_DSP", "CPU1_FPU" and "CPU1_DSP" which |
78 | +#include "hw/arm/boot.h" | 45 | + * set whether the CPUs have the FPU and DSP features present. The default |
79 | #include "hw/timer/allwinner-a10-pit.h" | 46 | + * (matching the hardware) is that for CPU0 in an IoTKit and CPU1 in an |
80 | #include "hw/intc/allwinner-a10-pic.h" | 47 | + * SSE-200 both are present; CPU0 in an SSE-200 has neither. |
81 | #include "hw/net/allwinner_emac.h" | 48 | + * Since the IoTKit has only one CPU, it does not have the CPU1_* properties. |
82 | diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h | 49 | * + Named GPIO inputs "EXP_IRQ" 0..n are the expansion interrupts for CPU 0, |
83 | index XXXXXXX..XXXXXXX 100644 | 50 | * which are wired to its NVIC lines 32 .. n+32 |
84 | --- a/include/hw/arm/aspeed_soc.h | 51 | * + Named GPIO inputs "EXP_CPU1_IRQ" 0..n are the expansion interrupts for |
85 | +++ b/include/hw/arm/aspeed_soc.h | 52 | @@ -XXX,XX +XXX,XX @@ typedef struct ARMSSE { |
86 | @@ -XXX,XX +XXX,XX @@ | 53 | uint32_t mainclk_frq; |
87 | #ifndef ASPEED_SOC_H | 54 | uint32_t sram_addr_width; |
88 | #define ASPEED_SOC_H | 55 | uint32_t init_svtor; |
89 | 56 | + bool cpu_fpu[SSE_MAX_CPUS]; | |
90 | -#include "hw/arm/arm.h" | 57 | + bool cpu_dsp[SSE_MAX_CPUS]; |
91 | #include "hw/intc/aspeed_vic.h" | 58 | } ARMSSE; |
92 | #include "hw/misc/aspeed_scu.h" | 59 | |
93 | #include "hw/misc/aspeed_sdmc.h" | 60 | typedef struct ARMSSEInfo ARMSSEInfo; |
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 | 61 | diff --git a/hw/arm/armsse.c b/hw/arm/armsse.c |
242 | index XXXXXXX..XXXXXXX 100644 | 62 | index XXXXXXX..XXXXXXX 100644 |
243 | --- a/hw/arm/armsse.c | 63 | --- a/hw/arm/armsse.c |
244 | +++ b/hw/arm/armsse.c | 64 | +++ b/hw/arm/armsse.c |
245 | @@ -XXX,XX +XXX,XX @@ | 65 | @@ -XXX,XX +XXX,XX @@ struct ARMSSEInfo { |
246 | #include "hw/sysbus.h" | 66 | bool has_cachectrl; |
247 | #include "hw/registerfields.h" | 67 | bool has_cpusecctrl; |
248 | #include "hw/arm/armsse.h" | 68 | bool has_cpuid; |
249 | -#include "hw/arm/arm.h" | 69 | + Property *props; |
250 | +#include "hw/arm/boot.h" | 70 | +}; |
251 | 71 | + | |
252 | /* Format of the System Information block SYS_CONFIG register */ | 72 | +static Property iotkit_properties[] = { |
253 | typedef enum SysConfigFormat { | 73 | + DEFINE_PROP_LINK("memory", ARMSSE, board_memory, TYPE_MEMORY_REGION, |
254 | diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c | 74 | + MemoryRegion *), |
255 | index XXXXXXX..XXXXXXX 100644 | 75 | + DEFINE_PROP_UINT32("EXP_NUMIRQ", ARMSSE, exp_numirq, 64), |
256 | --- a/hw/arm/armv7m.c | 76 | + DEFINE_PROP_UINT32("MAINCLK", ARMSSE, mainclk_frq, 0), |
257 | +++ b/hw/arm/armv7m.c | 77 | + DEFINE_PROP_UINT32("SRAM_ADDR_WIDTH", ARMSSE, sram_addr_width, 15), |
258 | @@ -XXX,XX +XXX,XX @@ | 78 | + DEFINE_PROP_UINT32("init-svtor", ARMSSE, init_svtor, 0x10000000), |
259 | #include "qemu-common.h" | 79 | + DEFINE_PROP_BOOL("CPU0_FPU", ARMSSE, cpu_fpu[0], true), |
260 | #include "cpu.h" | 80 | + DEFINE_PROP_BOOL("CPU0_DSP", ARMSSE, cpu_dsp[0], true), |
261 | #include "hw/sysbus.h" | 81 | + DEFINE_PROP_END_OF_LIST() |
262 | -#include "hw/arm/arm.h" | 82 | +}; |
263 | +#include "hw/arm/boot.h" | 83 | + |
264 | #include "hw/loader.h" | 84 | +static Property armsse_properties[] = { |
265 | #include "elf.h" | 85 | + DEFINE_PROP_LINK("memory", ARMSSE, board_memory, TYPE_MEMORY_REGION, |
266 | #include "sysemu/qtest.h" | 86 | + MemoryRegion *), |
267 | diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c | 87 | + DEFINE_PROP_UINT32("EXP_NUMIRQ", ARMSSE, exp_numirq, 64), |
268 | index XXXXXXX..XXXXXXX 100644 | 88 | + DEFINE_PROP_UINT32("MAINCLK", ARMSSE, mainclk_frq, 0), |
269 | --- a/hw/arm/aspeed.c | 89 | + DEFINE_PROP_UINT32("SRAM_ADDR_WIDTH", ARMSSE, sram_addr_width, 15), |
270 | +++ b/hw/arm/aspeed.c | 90 | + DEFINE_PROP_UINT32("init-svtor", ARMSSE, init_svtor, 0x10000000), |
271 | @@ -XXX,XX +XXX,XX @@ | 91 | + DEFINE_PROP_BOOL("CPU0_FPU", ARMSSE, cpu_fpu[0], false), |
272 | #include "qemu-common.h" | 92 | + DEFINE_PROP_BOOL("CPU0_DSP", ARMSSE, cpu_dsp[0], false), |
273 | #include "cpu.h" | 93 | + DEFINE_PROP_BOOL("CPU1_FPU", ARMSSE, cpu_fpu[1], true), |
274 | #include "exec/address-spaces.h" | 94 | + DEFINE_PROP_BOOL("CPU1_DSP", ARMSSE, cpu_dsp[1], true), |
275 | -#include "hw/arm/arm.h" | 95 | + DEFINE_PROP_END_OF_LIST() |
276 | +#include "hw/arm/boot.h" | 96 | }; |
277 | #include "hw/arm/aspeed.h" | 97 | |
278 | #include "hw/arm/aspeed_soc.h" | 98 | static const ARMSSEInfo armsse_variants[] = { |
279 | #include "hw/boards.h" | 99 | @@ -XXX,XX +XXX,XX @@ static const ARMSSEInfo armsse_variants[] = { |
280 | diff --git a/hw/arm/boot.c b/hw/arm/boot.c | 100 | .has_cachectrl = false, |
281 | index XXXXXXX..XXXXXXX 100644 | 101 | .has_cpusecctrl = false, |
282 | --- a/hw/arm/boot.c | 102 | .has_cpuid = false, |
283 | +++ b/hw/arm/boot.c | 103 | + .props = iotkit_properties, |
284 | @@ -XXX,XX +XXX,XX @@ | 104 | }, |
285 | #include "qapi/error.h" | 105 | { |
286 | #include <libfdt.h> | 106 | .name = TYPE_SSE200, |
287 | #include "hw/hw.h" | 107 | @@ -XXX,XX +XXX,XX @@ static const ARMSSEInfo armsse_variants[] = { |
288 | -#include "hw/arm/arm.h" | 108 | .has_cachectrl = true, |
289 | +#include "hw/arm/boot.h" | 109 | .has_cpusecctrl = true, |
290 | #include "hw/arm/linux-boot-if.h" | 110 | .has_cpuid = true, |
291 | #include "sysemu/kvm.h" | 111 | + .props = armsse_properties, |
292 | #include "sysemu/sysemu.h" | 112 | }, |
293 | diff --git a/hw/arm/collie.c b/hw/arm/collie.c | 113 | }; |
294 | index XXXXXXX..XXXXXXX 100644 | 114 | |
295 | --- a/hw/arm/collie.c | 115 | @@ -XXX,XX +XXX,XX @@ static void armsse_realize(DeviceState *dev, Error **errp) |
296 | +++ b/hw/arm/collie.c | 116 | return; |
297 | @@ -XXX,XX +XXX,XX @@ | 117 | } |
298 | #include "hw/sysbus.h" | 118 | } |
299 | #include "hw/boards.h" | 119 | + if (!s->cpu_fpu[i]) { |
300 | #include "strongarm.h" | 120 | + object_property_set_bool(cpuobj, false, "vfp", &err); |
301 | -#include "hw/arm/arm.h" | 121 | + if (err) { |
302 | +#include "hw/arm/boot.h" | 122 | + error_propagate(errp, err); |
303 | #include "hw/block/flash.h" | 123 | + return; |
304 | #include "exec/address-spaces.h" | 124 | + } |
305 | #include "cpu.h" | 125 | + } |
306 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | 126 | + if (!s->cpu_dsp[i]) { |
307 | index XXXXXXX..XXXXXXX 100644 | 127 | + object_property_set_bool(cpuobj, false, "dsp", &err); |
308 | --- a/hw/arm/exynos4210.c | 128 | + if (err) { |
309 | +++ b/hw/arm/exynos4210.c | 129 | + error_propagate(errp, err); |
310 | @@ -XXX,XX +XXX,XX @@ | 130 | + return; |
311 | #include "hw/boards.h" | 131 | + } |
312 | #include "sysemu/sysemu.h" | 132 | + } |
313 | #include "hw/sysbus.h" | 133 | |
314 | -#include "hw/arm/arm.h" | 134 | if (i > 0) { |
315 | +#include "hw/arm/boot.h" | 135 | memory_region_add_subregion_overlap(&s->cpu_container[i], 0, |
316 | #include "hw/loader.h" | 136 | @@ -XXX,XX +XXX,XX @@ static const VMStateDescription armsse_vmstate = { |
317 | #include "hw/arm/exynos4210.h" | 137 | } |
318 | #include "hw/sd/sdhci.h" | 138 | }; |
319 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | 139 | |
320 | index XXXXXXX..XXXXXXX 100644 | 140 | -static Property armsse_properties[] = { |
321 | --- a/hw/arm/exynos4_boards.c | 141 | - DEFINE_PROP_LINK("memory", ARMSSE, board_memory, TYPE_MEMORY_REGION, |
322 | +++ b/hw/arm/exynos4_boards.c | 142 | - MemoryRegion *), |
323 | @@ -XXX,XX +XXX,XX @@ | 143 | - DEFINE_PROP_UINT32("EXP_NUMIRQ", ARMSSE, exp_numirq, 64), |
324 | #include "sysemu/sysemu.h" | 144 | - DEFINE_PROP_UINT32("MAINCLK", ARMSSE, mainclk_frq, 0), |
325 | #include "hw/sysbus.h" | 145 | - DEFINE_PROP_UINT32("SRAM_ADDR_WIDTH", ARMSSE, sram_addr_width, 15), |
326 | #include "net/net.h" | 146 | - DEFINE_PROP_UINT32("init-svtor", ARMSSE, init_svtor, 0x10000000), |
327 | -#include "hw/arm/arm.h" | 147 | - DEFINE_PROP_END_OF_LIST() |
328 | +#include "hw/arm/boot.h" | 148 | -}; |
329 | #include "exec/address-spaces.h" | 149 | - |
330 | #include "hw/arm/exynos4210.h" | 150 | static void armsse_reset(DeviceState *dev) |
331 | #include "hw/net/lan9118.h" | 151 | { |
332 | diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c | 152 | ARMSSE *s = ARMSSE(dev); |
333 | index XXXXXXX..XXXXXXX 100644 | 153 | @@ -XXX,XX +XXX,XX @@ static void armsse_class_init(ObjectClass *klass, void *data) |
334 | --- a/hw/arm/highbank.c | 154 | DeviceClass *dc = DEVICE_CLASS(klass); |
335 | +++ b/hw/arm/highbank.c | 155 | IDAUInterfaceClass *iic = IDAU_INTERFACE_CLASS(klass); |
336 | @@ -XXX,XX +XXX,XX @@ | 156 | ARMSSEClass *asc = ARMSSE_CLASS(klass); |
337 | #include "qemu/osdep.h" | 157 | + const ARMSSEInfo *info = data; |
338 | #include "qapi/error.h" | 158 | |
339 | #include "hw/sysbus.h" | 159 | dc->realize = armsse_realize; |
340 | -#include "hw/arm/arm.h" | 160 | dc->vmsd = &armsse_vmstate; |
341 | +#include "hw/arm/boot.h" | 161 | - dc->props = armsse_properties; |
342 | #include "hw/loader.h" | 162 | + dc->props = info->props; |
343 | #include "net/net.h" | 163 | dc->reset = armsse_reset; |
344 | #include "sysemu/kvm.h" | 164 | iic->check = armsse_idau_check; |
345 | diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c | 165 | - asc->info = data; |
346 | index XXXXXXX..XXXXXXX 100644 | 166 | + asc->info = info; |
347 | --- a/hw/arm/integratorcp.c | 167 | } |
348 | +++ b/hw/arm/integratorcp.c | 168 | |
349 | @@ -XXX,XX +XXX,XX @@ | 169 | static const TypeInfo armsse_info = { |
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 | 170 | diff --git a/hw/arm/musca.c b/hw/arm/musca.c |
436 | index XXXXXXX..XXXXXXX 100644 | 171 | index XXXXXXX..XXXXXXX 100644 |
437 | --- a/hw/arm/musca.c | 172 | --- a/hw/arm/musca.c |
438 | +++ b/hw/arm/musca.c | 173 | +++ b/hw/arm/musca.c |
439 | @@ -XXX,XX +XXX,XX @@ | 174 | @@ -XXX,XX +XXX,XX @@ static void musca_init(MachineState *machine) |
440 | #include "qapi/error.h" | 175 | qdev_prop_set_uint32(ssedev, "init-svtor", mmc->init_svtor); |
441 | #include "exec/address-spaces.h" | 176 | qdev_prop_set_uint32(ssedev, "SRAM_ADDR_WIDTH", mmc->sram_addr_width); |
442 | #include "sysemu/sysemu.h" | 177 | qdev_prop_set_uint32(ssedev, "MAINCLK", SYSCLK_FRQ); |
443 | -#include "hw/arm/arm.h" | 178 | + /* |
444 | +#include "hw/arm/boot.h" | 179 | + * Musca-A takes the default SSE-200 FPU/DSP settings (ie no for |
445 | #include "hw/arm/armsse.h" | 180 | + * CPU0 and yes for CPU1); Musca-B1 explicitly enables them for CPU0. |
446 | #include "hw/boards.h" | 181 | + */ |
447 | #include "hw/char/pl011.h" | 182 | + if (mmc->type == MUSCA_B1) { |
448 | diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c | 183 | + qdev_prop_set_bit(ssedev, "CPU0_FPU", true); |
449 | index XXXXXXX..XXXXXXX 100644 | 184 | + qdev_prop_set_bit(ssedev, "CPU0_DSP", true); |
450 | --- a/hw/arm/musicpal.c | 185 | + } |
451 | +++ b/hw/arm/musicpal.c | 186 | object_property_set_bool(OBJECT(&mms->sse), true, "realized", |
452 | @@ -XXX,XX +XXX,XX @@ | 187 | &error_fatal); |
453 | #include "qemu-common.h" | 188 | |
454 | #include "cpu.h" | ||
455 | #include "hw/sysbus.h" | ||
456 | -#include "hw/arm/arm.h" | ||
457 | +#include "hw/arm/boot.h" | ||
458 | #include "net/net.h" | ||
459 | #include "sysemu/sysemu.h" | ||
460 | #include "hw/boards.h" | ||
461 | diff --git a/hw/arm/netduino2.c b/hw/arm/netduino2.c | ||
462 | index XXXXXXX..XXXXXXX 100644 | ||
463 | --- a/hw/arm/netduino2.c | ||
464 | +++ b/hw/arm/netduino2.c | ||
465 | @@ -XXX,XX +XXX,XX @@ | ||
466 | #include "hw/boards.h" | ||
467 | #include "qemu/error-report.h" | ||
468 | #include "hw/arm/stm32f205_soc.h" | ||
469 | -#include "hw/arm/arm.h" | ||
470 | +#include "hw/arm/boot.h" | ||
471 | |||
472 | static void netduino2_init(MachineState *machine) | ||
473 | { | ||
474 | diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c | ||
475 | index XXXXXXX..XXXXXXX 100644 | ||
476 | --- a/hw/arm/nrf51_soc.c | ||
477 | +++ b/hw/arm/nrf51_soc.c | ||
478 | @@ -XXX,XX +XXX,XX @@ | ||
479 | #include "qemu/osdep.h" | ||
480 | #include "qapi/error.h" | ||
481 | #include "qemu-common.h" | ||
482 | -#include "hw/arm/arm.h" | ||
483 | +#include "hw/arm/boot.h" | ||
484 | #include "hw/sysbus.h" | ||
485 | #include "hw/boards.h" | ||
486 | #include "hw/misc/unimp.h" | ||
487 | diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c | ||
488 | index XXXXXXX..XXXXXXX 100644 | ||
489 | --- a/hw/arm/nseries.c | ||
490 | +++ b/hw/arm/nseries.c | ||
491 | @@ -XXX,XX +XXX,XX @@ | ||
492 | #include "qemu/bswap.h" | ||
493 | #include "sysemu/sysemu.h" | ||
494 | #include "hw/arm/omap.h" | ||
495 | -#include "hw/arm/arm.h" | ||
496 | +#include "hw/arm/boot.h" | ||
497 | #include "hw/irq.h" | ||
498 | #include "ui/console.h" | ||
499 | #include "hw/boards.h" | ||
500 | diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c | ||
501 | index XXXXXXX..XXXXXXX 100644 | ||
502 | --- a/hw/arm/omap1.c | ||
503 | +++ b/hw/arm/omap1.c | ||
504 | @@ -XXX,XX +XXX,XX @@ | ||
505 | #include "cpu.h" | ||
506 | #include "hw/boards.h" | ||
507 | #include "hw/hw.h" | ||
508 | -#include "hw/arm/arm.h" | ||
509 | +#include "hw/arm/boot.h" | ||
510 | #include "hw/arm/omap.h" | ||
511 | #include "sysemu/sysemu.h" | ||
512 | #include "hw/arm/soc_dma.h" | ||
513 | diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c | ||
514 | index XXXXXXX..XXXXXXX 100644 | ||
515 | --- a/hw/arm/omap2.c | ||
516 | +++ b/hw/arm/omap2.c | ||
517 | @@ -XXX,XX +XXX,XX @@ | ||
518 | #include "sysemu/qtest.h" | ||
519 | #include "hw/boards.h" | ||
520 | #include "hw/hw.h" | ||
521 | -#include "hw/arm/arm.h" | ||
522 | +#include "hw/arm/boot.h" | ||
523 | #include "hw/arm/omap.h" | ||
524 | #include "sysemu/sysemu.h" | ||
525 | #include "qemu/timer.h" | ||
526 | diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c | ||
527 | index XXXXXXX..XXXXXXX 100644 | ||
528 | --- a/hw/arm/omap_sx1.c | ||
529 | +++ b/hw/arm/omap_sx1.c | ||
530 | @@ -XXX,XX +XXX,XX @@ | ||
531 | #include "ui/console.h" | ||
532 | #include "hw/arm/omap.h" | ||
533 | #include "hw/boards.h" | ||
534 | -#include "hw/arm/arm.h" | ||
535 | +#include "hw/arm/boot.h" | ||
536 | #include "hw/block/flash.h" | ||
537 | #include "sysemu/qtest.h" | ||
538 | #include "exec/address-spaces.h" | ||
539 | diff --git a/hw/arm/palm.c b/hw/arm/palm.c | ||
540 | index XXXXXXX..XXXXXXX 100644 | ||
541 | --- a/hw/arm/palm.c | ||
542 | +++ b/hw/arm/palm.c | ||
543 | @@ -XXX,XX +XXX,XX @@ | ||
544 | #include "ui/console.h" | ||
545 | #include "hw/arm/omap.h" | ||
546 | #include "hw/boards.h" | ||
547 | -#include "hw/arm/arm.h" | ||
548 | +#include "hw/arm/boot.h" | ||
549 | #include "hw/input/tsc2xxx.h" | ||
550 | #include "hw/loader.h" | ||
551 | #include "exec/address-spaces.h" | ||
552 | diff --git a/hw/arm/raspi.c b/hw/arm/raspi.c | ||
553 | index XXXXXXX..XXXXXXX 100644 | ||
554 | --- a/hw/arm/raspi.c | ||
555 | +++ b/hw/arm/raspi.c | ||
556 | @@ -XXX,XX +XXX,XX @@ | ||
557 | #include "qemu/error-report.h" | ||
558 | #include "hw/boards.h" | ||
559 | #include "hw/loader.h" | ||
560 | -#include "hw/arm/arm.h" | ||
561 | +#include "hw/arm/boot.h" | ||
562 | #include "sysemu/sysemu.h" | ||
563 | |||
564 | #define SMPBOOT_ADDR 0x300 /* this should leave enough space for ATAGS */ | ||
565 | diff --git a/hw/arm/realview.c b/hw/arm/realview.c | ||
566 | index XXXXXXX..XXXXXXX 100644 | ||
567 | --- a/hw/arm/realview.c | ||
568 | +++ b/hw/arm/realview.c | ||
569 | @@ -XXX,XX +XXX,XX @@ | ||
570 | #include "qemu-common.h" | ||
571 | #include "cpu.h" | ||
572 | #include "hw/sysbus.h" | ||
573 | -#include "hw/arm/arm.h" | ||
574 | +#include "hw/arm/boot.h" | ||
575 | #include "hw/arm/primecell.h" | ||
576 | #include "hw/net/lan9118.h" | ||
577 | #include "hw/net/smc91c111.h" | ||
578 | diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c | ||
579 | index XXXXXXX..XXXXXXX 100644 | ||
580 | --- a/hw/arm/spitz.c | ||
581 | +++ b/hw/arm/spitz.c | ||
582 | @@ -XXX,XX +XXX,XX @@ | ||
583 | #include "qapi/error.h" | ||
584 | #include "hw/hw.h" | ||
585 | #include "hw/arm/pxa.h" | ||
586 | -#include "hw/arm/arm.h" | ||
587 | +#include "hw/arm/boot.h" | ||
588 | #include "sysemu/sysemu.h" | ||
589 | #include "hw/pcmcia.h" | ||
590 | #include "hw/i2c/i2c.h" | ||
591 | diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c | ||
592 | index XXXXXXX..XXXXXXX 100644 | ||
593 | --- a/hw/arm/stellaris.c | ||
594 | +++ b/hw/arm/stellaris.c | ||
595 | @@ -XXX,XX +XXX,XX @@ | ||
596 | #include "qapi/error.h" | ||
597 | #include "hw/sysbus.h" | ||
598 | #include "hw/ssi/ssi.h" | ||
599 | -#include "hw/arm/arm.h" | ||
600 | +#include "hw/arm/boot.h" | ||
601 | #include "qemu/timer.h" | ||
602 | #include "hw/i2c/i2c.h" | ||
603 | #include "net/net.h" | ||
604 | diff --git a/hw/arm/stm32f205_soc.c b/hw/arm/stm32f205_soc.c | ||
605 | index XXXXXXX..XXXXXXX 100644 | ||
606 | --- a/hw/arm/stm32f205_soc.c | ||
607 | +++ b/hw/arm/stm32f205_soc.c | ||
608 | @@ -XXX,XX +XXX,XX @@ | ||
609 | #include "qemu/osdep.h" | ||
610 | #include "qapi/error.h" | ||
611 | #include "qemu-common.h" | ||
612 | -#include "hw/arm/arm.h" | ||
613 | +#include "hw/arm/boot.h" | ||
614 | #include "exec/address-spaces.h" | ||
615 | #include "hw/arm/stm32f205_soc.h" | ||
616 | |||
617 | diff --git a/hw/arm/strongarm.c b/hw/arm/strongarm.c | ||
618 | index XXXXXXX..XXXXXXX 100644 | ||
619 | --- a/hw/arm/strongarm.c | ||
620 | +++ b/hw/arm/strongarm.c | ||
621 | @@ -XXX,XX +XXX,XX @@ | ||
622 | #include "hw/sysbus.h" | ||
623 | #include "strongarm.h" | ||
624 | #include "qemu/error-report.h" | ||
625 | -#include "hw/arm/arm.h" | ||
626 | +#include "hw/arm/boot.h" | ||
627 | #include "chardev/char-fe.h" | ||
628 | #include "chardev/char-serial.h" | ||
629 | #include "sysemu/sysemu.h" | ||
630 | diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c | ||
631 | index XXXXXXX..XXXXXXX 100644 | ||
632 | --- a/hw/arm/tosa.c | ||
633 | +++ b/hw/arm/tosa.c | ||
634 | @@ -XXX,XX +XXX,XX @@ | ||
635 | #include "qapi/error.h" | ||
636 | #include "hw/hw.h" | ||
637 | #include "hw/arm/pxa.h" | ||
638 | -#include "hw/arm/arm.h" | ||
639 | +#include "hw/arm/boot.h" | ||
640 | #include "hw/arm/sharpsl.h" | ||
641 | #include "hw/pcmcia.h" | ||
642 | #include "hw/boards.h" | ||
643 | diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c | ||
644 | index XXXXXXX..XXXXXXX 100644 | ||
645 | --- a/hw/arm/versatilepb.c | ||
646 | +++ b/hw/arm/versatilepb.c | ||
647 | @@ -XXX,XX +XXX,XX @@ | ||
648 | #include "qemu-common.h" | ||
649 | #include "cpu.h" | ||
650 | #include "hw/sysbus.h" | ||
651 | -#include "hw/arm/arm.h" | ||
652 | +#include "hw/arm/boot.h" | ||
653 | #include "hw/net/smc91c111.h" | ||
654 | #include "net/net.h" | ||
655 | #include "sysemu/sysemu.h" | ||
656 | diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c | ||
657 | index XXXXXXX..XXXXXXX 100644 | ||
658 | --- a/hw/arm/vexpress.c | ||
659 | +++ b/hw/arm/vexpress.c | ||
660 | @@ -XXX,XX +XXX,XX @@ | ||
661 | #include "qemu-common.h" | ||
662 | #include "cpu.h" | ||
663 | #include "hw/sysbus.h" | ||
664 | -#include "hw/arm/arm.h" | ||
665 | +#include "hw/arm/boot.h" | ||
666 | #include "hw/arm/primecell.h" | ||
667 | #include "hw/net/lan9118.h" | ||
668 | #include "hw/i2c/i2c.h" | ||
669 | diff --git a/hw/arm/virt.c b/hw/arm/virt.c | ||
670 | index XXXXXXX..XXXXXXX 100644 | ||
671 | --- a/hw/arm/virt.c | ||
672 | +++ b/hw/arm/virt.c | ||
673 | @@ -XXX,XX +XXX,XX @@ | ||
674 | #include "qemu/option.h" | ||
675 | #include "qapi/error.h" | ||
676 | #include "hw/sysbus.h" | ||
677 | -#include "hw/arm/arm.h" | ||
678 | +#include "hw/arm/boot.h" | ||
679 | #include "hw/arm/primecell.h" | ||
680 | #include "hw/arm/virt.h" | ||
681 | #include "hw/block/flash.h" | ||
682 | diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c | ||
683 | index XXXXXXX..XXXXXXX 100644 | ||
684 | --- a/hw/arm/xilinx_zynq.c | ||
685 | +++ b/hw/arm/xilinx_zynq.c | ||
686 | @@ -XXX,XX +XXX,XX @@ | ||
687 | #include "qemu-common.h" | ||
688 | #include "cpu.h" | ||
689 | #include "hw/sysbus.h" | ||
690 | -#include "hw/arm/arm.h" | ||
691 | +#include "hw/arm/boot.h" | ||
692 | #include "net/net.h" | ||
693 | #include "exec/address-spaces.h" | ||
694 | #include "sysemu/sysemu.h" | ||
695 | diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c | ||
696 | index XXXXXXX..XXXXXXX 100644 | ||
697 | --- a/hw/arm/xlnx-versal.c | ||
698 | +++ b/hw/arm/xlnx-versal.c | ||
699 | @@ -XXX,XX +XXX,XX @@ | ||
700 | #include "net/net.h" | ||
701 | #include "sysemu/sysemu.h" | ||
702 | #include "sysemu/kvm.h" | ||
703 | -#include "hw/arm/arm.h" | ||
704 | +#include "hw/arm/boot.h" | ||
705 | #include "kvm_arm.h" | ||
706 | #include "hw/misc/unimp.h" | ||
707 | #include "hw/intc/arm_gicv3_common.h" | ||
708 | diff --git a/hw/arm/z2.c b/hw/arm/z2.c | ||
709 | index XXXXXXX..XXXXXXX 100644 | ||
710 | --- a/hw/arm/z2.c | ||
711 | +++ b/hw/arm/z2.c | ||
712 | @@ -XXX,XX +XXX,XX @@ | ||
713 | #include "qemu/osdep.h" | ||
714 | #include "hw/hw.h" | ||
715 | #include "hw/arm/pxa.h" | ||
716 | -#include "hw/arm/arm.h" | ||
717 | +#include "hw/arm/boot.h" | ||
718 | #include "hw/i2c/i2c.h" | ||
719 | #include "hw/ssi/ssi.h" | ||
720 | #include "hw/boards.h" | ||
721 | -- | 189 | -- |
722 | 2.20.1 | 190 | 2.20.1 |
723 | 191 | ||
724 | 192 | diff view generated by jsdifflib |
1 | In ich_vmcr_write() we enforce "writes of BPR fields to less than | 1 | The GIC ID registers cover an area 0x30 bytes in size |
---|---|---|---|
2 | their minimum sets them to the minimum" by doing a "read vbpr and | 2 | (12 registers, 4 bytes each). We were incorrectly decoding |
3 | write it back" operation. A typo here meant that we weren't handling | 3 | only the first 0x20 bytes. |
4 | writes to these fields correctly, because we were reading from VBPR0 | ||
5 | but writing to VBPR1. | ||
6 | 4 | ||
7 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
8 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 6 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
9 | Message-id: 20190520162809.2677-4-peter.maydell@linaro.org | 7 | Message-id: 20190524124248.28394-2-peter.maydell@linaro.org |
10 | --- | 8 | --- |
11 | hw/intc/arm_gicv3_cpuif.c | 2 +- | 9 | hw/intc/arm_gicv3_dist.c | 4 ++-- |
12 | 1 file changed, 1 insertion(+), 1 deletion(-) | 10 | hw/intc/arm_gicv3_redist.c | 4 ++-- |
11 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
13 | 12 | ||
14 | diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c | 13 | diff --git a/hw/intc/arm_gicv3_dist.c b/hw/intc/arm_gicv3_dist.c |
15 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/hw/intc/arm_gicv3_cpuif.c | 15 | --- a/hw/intc/arm_gicv3_dist.c |
17 | +++ b/hw/intc/arm_gicv3_cpuif.c | 16 | +++ b/hw/intc/arm_gicv3_dist.c |
18 | @@ -XXX,XX +XXX,XX @@ static void ich_vmcr_write(CPUARMState *env, const ARMCPRegInfo *ri, | 17 | @@ -XXX,XX +XXX,XX @@ static MemTxResult gicd_readl(GICv3State *s, hwaddr offset, |
19 | /* Enforce "writing BPRs to less than minimum sets them to the minimum" | 18 | } |
20 | * by reading and writing back the fields. | 19 | return MEMTX_OK; |
21 | */ | 20 | } |
22 | - write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G0)); | 21 | - case GICD_IDREGS ... GICD_IDREGS + 0x1f: |
23 | + write_vbpr(cs, GICV3_G0, read_vbpr(cs, GICV3_G0)); | 22 | + case GICD_IDREGS ... GICD_IDREGS + 0x2f: |
24 | write_vbpr(cs, GICV3_G1, read_vbpr(cs, GICV3_G1)); | 23 | /* ID registers */ |
25 | 24 | *data = gicv3_idreg(offset - GICD_IDREGS); | |
26 | gicv3_cpuif_virt_update(cs); | 25 | return MEMTX_OK; |
26 | @@ -XXX,XX +XXX,XX @@ static MemTxResult gicd_writel(GICv3State *s, hwaddr offset, | ||
27 | gicd_write_irouter(s, attrs, irq, r); | ||
28 | return MEMTX_OK; | ||
29 | } | ||
30 | - case GICD_IDREGS ... GICD_IDREGS + 0x1f: | ||
31 | + case GICD_IDREGS ... GICD_IDREGS + 0x2f: | ||
32 | case GICD_TYPER: | ||
33 | case GICD_IIDR: | ||
34 | /* RO registers, ignore the write */ | ||
35 | diff --git a/hw/intc/arm_gicv3_redist.c b/hw/intc/arm_gicv3_redist.c | ||
36 | index XXXXXXX..XXXXXXX 100644 | ||
37 | --- a/hw/intc/arm_gicv3_redist.c | ||
38 | +++ b/hw/intc/arm_gicv3_redist.c | ||
39 | @@ -XXX,XX +XXX,XX @@ static MemTxResult gicr_readl(GICv3CPUState *cs, hwaddr offset, | ||
40 | } | ||
41 | *data = cs->gicr_nsacr; | ||
42 | return MEMTX_OK; | ||
43 | - case GICR_IDREGS ... GICR_IDREGS + 0x1f: | ||
44 | + case GICR_IDREGS ... GICR_IDREGS + 0x2f: | ||
45 | *data = gicv3_idreg(offset - GICR_IDREGS); | ||
46 | return MEMTX_OK; | ||
47 | default: | ||
48 | @@ -XXX,XX +XXX,XX @@ static MemTxResult gicr_writel(GICv3CPUState *cs, hwaddr offset, | ||
49 | return MEMTX_OK; | ||
50 | case GICR_IIDR: | ||
51 | case GICR_TYPER: | ||
52 | - case GICR_IDREGS ... GICR_IDREGS + 0x1f: | ||
53 | + case GICR_IDREGS ... GICR_IDREGS + 0x2f: | ||
54 | /* RO registers, ignore the write */ | ||
55 | qemu_log_mask(LOG_GUEST_ERROR, | ||
56 | "%s: invalid guest write to RO register at offset " | ||
27 | -- | 57 | -- |
28 | 2.20.1 | 58 | 2.20.1 |
29 | 59 | ||
30 | 60 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | The GICv3 specification says that the GICD_TYPER.SecurityExtn bit | ||
2 | is RAZ if GICD_CTLR.DS is 1. We were incorrectly making it RAZ | ||
3 | if the security extension is unsupported. "Security extension | ||
4 | unsupported" always implies GICD_CTLR.DS == 1, but the guest can | ||
5 | also set DS on a GIC which does support the security extension. | ||
6 | Fix the condition to correctly check the GICD_CTLR.DS bit. | ||
1 | 7 | ||
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
9 | Message-id: 20190524124248.28394-3-peter.maydell@linaro.org | ||
10 | --- | ||
11 | hw/intc/arm_gicv3_dist.c | 8 +++++++- | ||
12 | 1 file changed, 7 insertions(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/hw/intc/arm_gicv3_dist.c b/hw/intc/arm_gicv3_dist.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/hw/intc/arm_gicv3_dist.c | ||
17 | +++ b/hw/intc/arm_gicv3_dist.c | ||
18 | @@ -XXX,XX +XXX,XX @@ static MemTxResult gicd_readl(GICv3State *s, hwaddr offset, | ||
19 | * ITLinesNumber == (num external irqs / 32) - 1 | ||
20 | */ | ||
21 | int itlinesnumber = ((s->num_irq - GIC_INTERNAL) / 32) - 1; | ||
22 | + /* | ||
23 | + * SecurityExtn must be RAZ if GICD_CTLR.DS == 1, and | ||
24 | + * "security extensions not supported" always implies DS == 1, | ||
25 | + * so we only need to check the DS bit. | ||
26 | + */ | ||
27 | + bool sec_extn = !(s->gicd_ctlr & GICD_CTLR_DS); | ||
28 | |||
29 | - *data = (1 << 25) | (1 << 24) | (s->security_extn << 10) | | ||
30 | + *data = (1 << 25) | (1 << 24) | (sec_extn << 10) | | ||
31 | (0xf << 19) | itlinesnumber; | ||
32 | return MEMTX_OK; | ||
33 | } | ||
34 | -- | ||
35 | 2.20.1 | ||
36 | |||
37 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | We want to use vfp_expand_imm() in the AArch32 VFP decode; |
---|---|---|---|
2 | move it from the a64-only header/source file to the | ||
3 | AArch32 one (which is always compiled even for AArch64). | ||
2 | 4 | ||
3 | This is, after all, how we implement extract2 in tcg/aarch64. | 5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
8 | Message-id: 20190613163917.28589-2-peter.maydell@linaro.org | ||
9 | --- | ||
10 | target/arm/translate-a64.h | 1 - | ||
11 | target/arm/translate.h | 7 +++++++ | ||
12 | target/arm/translate-a64.c | 32 -------------------------------- | ||
13 | target/arm/translate-vfp.inc.c | 33 +++++++++++++++++++++++++++++++++ | ||
14 | 4 files changed, 40 insertions(+), 33 deletions(-) | ||
4 | 15 | ||
5 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | 16 | diff --git a/target/arm/translate-a64.h b/target/arm/translate-a64.h |
6 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | 17 | index XXXXXXX..XXXXXXX 100644 |
7 | Message-id: 20190514011129.11330-2-richard.henderson@linaro.org | 18 | --- a/target/arm/translate-a64.h |
8 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 19 | +++ b/target/arm/translate-a64.h |
9 | --- | 20 | @@ -XXX,XX +XXX,XX @@ void write_fp_dreg(DisasContext *s, int reg, TCGv_i64 v); |
10 | target/arm/translate-a64.c | 38 ++++++++++++++++++++------------------ | 21 | TCGv_ptr get_fpstatus_ptr(bool); |
11 | 1 file changed, 20 insertions(+), 18 deletions(-) | 22 | bool logic_imm_decode_wmask(uint64_t *result, unsigned int immn, |
12 | 23 | unsigned int imms, unsigned int immr); | |
24 | -uint64_t vfp_expand_imm(int size, uint8_t imm8); | ||
25 | bool sve_access_check(DisasContext *s); | ||
26 | |||
27 | /* We should have at some point before trying to access an FP register | ||
28 | diff --git a/target/arm/translate.h b/target/arm/translate.h | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/target/arm/translate.h | ||
31 | +++ b/target/arm/translate.h | ||
32 | @@ -XXX,XX +XXX,XX @@ static inline void gen_ss_advance(DisasContext *s) | ||
33 | } | ||
34 | } | ||
35 | |||
36 | +/* | ||
37 | + * Given a VFP floating point constant encoded into an 8 bit immediate in an | ||
38 | + * instruction, expand it to the actual constant value of the specified | ||
39 | + * size, as per the VFPExpandImm() pseudocode in the Arm ARM. | ||
40 | + */ | ||
41 | +uint64_t vfp_expand_imm(int size, uint8_t imm8); | ||
42 | + | ||
43 | /* Vector operations shared between ARM and AArch64. */ | ||
44 | extern const GVecGen3 mla_op[4]; | ||
45 | extern const GVecGen3 mls_op[4]; | ||
13 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 46 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c |
14 | index XXXXXXX..XXXXXXX 100644 | 47 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/target/arm/translate-a64.c | 48 | --- a/target/arm/translate-a64.c |
16 | +++ b/target/arm/translate-a64.c | 49 | +++ b/target/arm/translate-a64.c |
17 | @@ -XXX,XX +XXX,XX @@ static void disas_extract(DisasContext *s, uint32_t insn) | 50 | @@ -XXX,XX +XXX,XX @@ static void disas_fp_3src(DisasContext *s, uint32_t insn) |
18 | } else { | 51 | } |
19 | tcg_gen_ext32u_i64(tcg_rd, cpu_reg(s, rm)); | 52 | } |
20 | } | 53 | |
21 | - } else if (rm == rn) { /* ROR */ | 54 | -/* The imm8 encodes the sign bit, enough bits to represent an exponent in |
22 | - tcg_rm = cpu_reg(s, rm); | 55 | - * the range 01....1xx to 10....0xx, and the most significant 4 bits of |
23 | - if (sf) { | 56 | - * the mantissa; see VFPExpandImm() in the v8 ARM ARM. |
24 | - tcg_gen_rotri_i64(tcg_rd, tcg_rm, imm); | 57 | - */ |
25 | - } else { | 58 | -uint64_t vfp_expand_imm(int size, uint8_t imm8) |
26 | - TCGv_i32 tmp = tcg_temp_new_i32(); | 59 | -{ |
27 | - tcg_gen_extrl_i64_i32(tmp, tcg_rm); | 60 | - uint64_t imm; |
28 | - tcg_gen_rotri_i32(tmp, tmp, imm); | 61 | - |
29 | - tcg_gen_extu_i32_i64(tcg_rd, tmp); | 62 | - switch (size) { |
30 | - tcg_temp_free_i32(tmp); | 63 | - case MO_64: |
31 | - } | 64 | - imm = (extract32(imm8, 7, 1) ? 0x8000 : 0) | |
32 | } else { | 65 | - (extract32(imm8, 6, 1) ? 0x3fc0 : 0x4000) | |
33 | - tcg_rm = read_cpu_reg(s, rm, sf); | 66 | - extract32(imm8, 0, 6); |
34 | - tcg_rn = read_cpu_reg(s, rn, sf); | 67 | - imm <<= 48; |
35 | - tcg_gen_shri_i64(tcg_rm, tcg_rm, imm); | 68 | - break; |
36 | - tcg_gen_shli_i64(tcg_rn, tcg_rn, bitsize - imm); | 69 | - case MO_32: |
37 | - tcg_gen_or_i64(tcg_rd, tcg_rm, tcg_rn); | 70 | - imm = (extract32(imm8, 7, 1) ? 0x8000 : 0) | |
38 | - if (!sf) { | 71 | - (extract32(imm8, 6, 1) ? 0x3e00 : 0x4000) | |
39 | - tcg_gen_ext32u_i64(tcg_rd, tcg_rd); | 72 | - (extract32(imm8, 0, 6) << 3); |
40 | + tcg_rm = cpu_reg(s, rm); | 73 | - imm <<= 16; |
41 | + tcg_rn = cpu_reg(s, rn); | 74 | - break; |
75 | - case MO_16: | ||
76 | - imm = (extract32(imm8, 7, 1) ? 0x8000 : 0) | | ||
77 | - (extract32(imm8, 6, 1) ? 0x3000 : 0x4000) | | ||
78 | - (extract32(imm8, 0, 6) << 6); | ||
79 | - break; | ||
80 | - default: | ||
81 | - g_assert_not_reached(); | ||
82 | - } | ||
83 | - return imm; | ||
84 | -} | ||
85 | - | ||
86 | /* Floating point immediate | ||
87 | * 31 30 29 28 24 23 22 21 20 13 12 10 9 5 4 0 | ||
88 | * +---+---+---+-----------+------+---+------------+-------+------+------+ | ||
89 | diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c | ||
90 | index XXXXXXX..XXXXXXX 100644 | ||
91 | --- a/target/arm/translate-vfp.inc.c | ||
92 | +++ b/target/arm/translate-vfp.inc.c | ||
93 | @@ -XXX,XX +XXX,XX @@ | ||
94 | #include "decode-vfp.inc.c" | ||
95 | #include "decode-vfp-uncond.inc.c" | ||
96 | |||
97 | +/* | ||
98 | + * The imm8 encodes the sign bit, enough bits to represent an exponent in | ||
99 | + * the range 01....1xx to 10....0xx, and the most significant 4 bits of | ||
100 | + * the mantissa; see VFPExpandImm() in the v8 ARM ARM. | ||
101 | + */ | ||
102 | +uint64_t vfp_expand_imm(int size, uint8_t imm8) | ||
103 | +{ | ||
104 | + uint64_t imm; | ||
42 | + | 105 | + |
43 | + if (sf) { | 106 | + switch (size) { |
44 | + /* Specialization to ROR happens in EXTRACT2. */ | 107 | + case MO_64: |
45 | + tcg_gen_extract2_i64(tcg_rd, tcg_rm, tcg_rn, imm); | 108 | + imm = (extract32(imm8, 7, 1) ? 0x8000 : 0) | |
46 | + } else { | 109 | + (extract32(imm8, 6, 1) ? 0x3fc0 : 0x4000) | |
47 | + TCGv_i32 t0 = tcg_temp_new_i32(); | 110 | + extract32(imm8, 0, 6); |
111 | + imm <<= 48; | ||
112 | + break; | ||
113 | + case MO_32: | ||
114 | + imm = (extract32(imm8, 7, 1) ? 0x8000 : 0) | | ||
115 | + (extract32(imm8, 6, 1) ? 0x3e00 : 0x4000) | | ||
116 | + (extract32(imm8, 0, 6) << 3); | ||
117 | + imm <<= 16; | ||
118 | + break; | ||
119 | + case MO_16: | ||
120 | + imm = (extract32(imm8, 7, 1) ? 0x8000 : 0) | | ||
121 | + (extract32(imm8, 6, 1) ? 0x3000 : 0x4000) | | ||
122 | + (extract32(imm8, 0, 6) << 6); | ||
123 | + break; | ||
124 | + default: | ||
125 | + g_assert_not_reached(); | ||
126 | + } | ||
127 | + return imm; | ||
128 | +} | ||
48 | + | 129 | + |
49 | + tcg_gen_extrl_i64_i32(t0, tcg_rm); | 130 | /* |
50 | + if (rm == rn) { | 131 | * Return the offset of a 16-bit half of the specified VFP single-precision |
51 | + tcg_gen_rotri_i32(t0, t0, imm); | 132 | * register. If top is true, returns the top 16 bits; otherwise the bottom |
52 | + } else { | ||
53 | + TCGv_i32 t1 = tcg_temp_new_i32(); | ||
54 | + tcg_gen_extrl_i64_i32(t1, tcg_rn); | ||
55 | + tcg_gen_extract2_i32(t0, t0, t1, imm); | ||
56 | + tcg_temp_free_i32(t1); | ||
57 | + } | ||
58 | + tcg_gen_extu_i32_i64(tcg_rd, t0); | ||
59 | + tcg_temp_free_i32(t0); | ||
60 | } | ||
61 | } | ||
62 | } | ||
63 | -- | 133 | -- |
64 | 2.20.1 | 134 | 2.20.1 |
65 | 135 | ||
66 | 136 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | The AArch32 VMOV (immediate) instruction uses the same VFP encoded | ||
2 | immediate format we already handle in vfp_expand_imm(). Use that | ||
3 | function rather than hand-decoding it. | ||
1 | 4 | ||
5 | Suggested-by: Richard Henderson <richard.henderson@linaro.org> | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20190613163917.28589-3-peter.maydell@linaro.org | ||
10 | --- | ||
11 | target/arm/translate-vfp.inc.c | 28 ++++------------------------ | ||
12 | target/arm/vfp.decode | 10 ++++++---- | ||
13 | 2 files changed, 10 insertions(+), 28 deletions(-) | ||
14 | |||
15 | diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/target/arm/translate-vfp.inc.c | ||
18 | +++ b/target/arm/translate-vfp.inc.c | ||
19 | @@ -XXX,XX +XXX,XX @@ static bool trans_VMOV_imm_sp(DisasContext *s, arg_VMOV_imm_sp *a) | ||
20 | uint32_t delta_d = 0; | ||
21 | int veclen = s->vec_len; | ||
22 | TCGv_i32 fd; | ||
23 | - uint32_t n, i, vd; | ||
24 | + uint32_t vd; | ||
25 | |||
26 | vd = a->vd; | ||
27 | |||
28 | @@ -XXX,XX +XXX,XX @@ static bool trans_VMOV_imm_sp(DisasContext *s, arg_VMOV_imm_sp *a) | ||
29 | } | ||
30 | } | ||
31 | |||
32 | - n = (a->imm4h << 28) & 0x80000000; | ||
33 | - i = ((a->imm4h << 4) & 0x70) | a->imm4l; | ||
34 | - if (i & 0x40) { | ||
35 | - i |= 0x780; | ||
36 | - } else { | ||
37 | - i |= 0x800; | ||
38 | - } | ||
39 | - n |= i << 19; | ||
40 | - | ||
41 | - fd = tcg_temp_new_i32(); | ||
42 | - tcg_gen_movi_i32(fd, n); | ||
43 | + fd = tcg_const_i32(vfp_expand_imm(MO_32, a->imm)); | ||
44 | |||
45 | for (;;) { | ||
46 | neon_store_reg32(fd, vd); | ||
47 | @@ -XXX,XX +XXX,XX @@ static bool trans_VMOV_imm_dp(DisasContext *s, arg_VMOV_imm_dp *a) | ||
48 | uint32_t delta_d = 0; | ||
49 | int veclen = s->vec_len; | ||
50 | TCGv_i64 fd; | ||
51 | - uint32_t n, i, vd; | ||
52 | + uint32_t vd; | ||
53 | |||
54 | vd = a->vd; | ||
55 | |||
56 | @@ -XXX,XX +XXX,XX @@ static bool trans_VMOV_imm_dp(DisasContext *s, arg_VMOV_imm_dp *a) | ||
57 | } | ||
58 | } | ||
59 | |||
60 | - n = (a->imm4h << 28) & 0x80000000; | ||
61 | - i = ((a->imm4h << 4) & 0x70) | a->imm4l; | ||
62 | - if (i & 0x40) { | ||
63 | - i |= 0x3f80; | ||
64 | - } else { | ||
65 | - i |= 0x4000; | ||
66 | - } | ||
67 | - n |= i << 16; | ||
68 | - | ||
69 | - fd = tcg_temp_new_i64(); | ||
70 | - tcg_gen_movi_i64(fd, ((uint64_t)n) << 32); | ||
71 | + fd = tcg_const_i64(vfp_expand_imm(MO_64, a->imm)); | ||
72 | |||
73 | for (;;) { | ||
74 | neon_store_reg64(fd, vd); | ||
75 | diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode | ||
76 | index XXXXXXX..XXXXXXX 100644 | ||
77 | --- a/target/arm/vfp.decode | ||
78 | +++ b/target/arm/vfp.decode | ||
79 | @@ -XXX,XX +XXX,XX @@ | ||
80 | %vmov_idx_b 21:1 5:2 | ||
81 | %vmov_idx_h 21:1 6:1 | ||
82 | |||
83 | +%vmov_imm 16:4 0:4 | ||
84 | + | ||
85 | # VMOV scalar to general-purpose register; note that this does | ||
86 | # include some Neon cases. | ||
87 | VMOV_to_gp ---- 1110 u:1 1. 1 .... rt:4 1011 ... 1 0000 \ | ||
88 | @@ -XXX,XX +XXX,XX @@ VFM_sp ---- 1110 1.10 .... .... 1010 . o2:1 . 0 .... \ | ||
89 | VFM_dp ---- 1110 1.10 .... .... 1011 . o2:1 . 0 .... \ | ||
90 | vm=%vm_dp vn=%vn_dp vd=%vd_dp o1=2 | ||
91 | |||
92 | -VMOV_imm_sp ---- 1110 1.11 imm4h:4 .... 1010 0000 imm4l:4 \ | ||
93 | - vd=%vd_sp | ||
94 | -VMOV_imm_dp ---- 1110 1.11 imm4h:4 .... 1011 0000 imm4l:4 \ | ||
95 | - vd=%vd_dp | ||
96 | +VMOV_imm_sp ---- 1110 1.11 .... .... 1010 0000 .... \ | ||
97 | + vd=%vd_sp imm=%vmov_imm | ||
98 | +VMOV_imm_dp ---- 1110 1.11 .... .... 1011 0000 .... \ | ||
99 | + vd=%vd_dp imm=%vmov_imm | ||
100 | |||
101 | VMOV_reg_sp ---- 1110 1.11 0000 .... 1010 01.0 .... \ | ||
102 | vd=%vd_sp vm=%vm_sp | ||
103 | -- | ||
104 | 2.20.1 | ||
105 | |||
106 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Where Neon instructions are floating point operations, we | ||
2 | mostly use the old VFP utility functions like gen_vfp_abs() | ||
3 | which work on the TCG globals cpu_F0s and cpu_F1s. The | ||
4 | Neon for-each-element loop conditionally loads the inputs | ||
5 | into either a plain old TCG temporary for most operations | ||
6 | or into cpu_F0s for float operations, and similarly stores | ||
7 | back either cpu_F0s or the temporary. | ||
1 | 8 | ||
9 | Switch NEON_2RM_VABS_F away from using cpu_F0s, and | ||
10 | update neon_2rm_is_float_op() accordingly. | ||
11 | |||
12 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
13 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
14 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
15 | Message-id: 20190613163917.28589-4-peter.maydell@linaro.org | ||
16 | --- | ||
17 | target/arm/translate.c | 19 ++++++++----------- | ||
18 | 1 file changed, 8 insertions(+), 11 deletions(-) | ||
19 | |||
20 | diff --git a/target/arm/translate.c b/target/arm/translate.c | ||
21 | index XXXXXXX..XXXXXXX 100644 | ||
22 | --- a/target/arm/translate.c | ||
23 | +++ b/target/arm/translate.c | ||
24 | @@ -XXX,XX +XXX,XX @@ static TCGv_ptr get_fpstatus_ptr(int neon) | ||
25 | return statusptr; | ||
26 | } | ||
27 | |||
28 | -static inline void gen_vfp_abs(int dp) | ||
29 | -{ | ||
30 | - if (dp) | ||
31 | - gen_helper_vfp_absd(cpu_F0d, cpu_F0d); | ||
32 | - else | ||
33 | - gen_helper_vfp_abss(cpu_F0s, cpu_F0s); | ||
34 | -} | ||
35 | - | ||
36 | static inline void gen_vfp_neg(int dp) | ||
37 | { | ||
38 | if (dp) | ||
39 | @@ -XXX,XX +XXX,XX @@ static const uint8_t neon_3r_sizes[] = { | ||
40 | |||
41 | static int neon_2rm_is_float_op(int op) | ||
42 | { | ||
43 | - /* Return true if this neon 2reg-misc op is float-to-float */ | ||
44 | - return (op == NEON_2RM_VABS_F || op == NEON_2RM_VNEG_F || | ||
45 | + /* | ||
46 | + * Return true if this neon 2reg-misc op is float-to-float. | ||
47 | + * This is not a property of the operation but of our code -- | ||
48 | + * what we are asking here is "does the code for this case in | ||
49 | + * the Neon for-each-pass loop use cpu_F0s?". | ||
50 | + */ | ||
51 | + return (op == NEON_2RM_VNEG_F || | ||
52 | (op >= NEON_2RM_VRINTN && op <= NEON_2RM_VRINTZ) || | ||
53 | op == NEON_2RM_VRINTM || | ||
54 | (op >= NEON_2RM_VRINTP && op <= NEON_2RM_VCVTMS) || | ||
55 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | ||
56 | break; | ||
57 | } | ||
58 | case NEON_2RM_VABS_F: | ||
59 | - gen_vfp_abs(0); | ||
60 | + gen_helper_vfp_abss(tmp, tmp); | ||
61 | break; | ||
62 | case NEON_2RM_VNEG_F: | ||
63 | gen_vfp_neg(0); | ||
64 | -- | ||
65 | 2.20.1 | ||
66 | |||
67 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Switch NEON_2RM_VABS_F away from using cpu_F0s. | ||
1 | 2 | ||
3 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
6 | Message-id: 20190613163917.28589-5-peter.maydell@linaro.org | ||
7 | --- | ||
8 | target/arm/translate.c | 13 ++----------- | ||
9 | 1 file changed, 2 insertions(+), 11 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate.c b/target/arm/translate.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate.c | ||
14 | +++ b/target/arm/translate.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static TCGv_ptr get_fpstatus_ptr(int neon) | ||
16 | return statusptr; | ||
17 | } | ||
18 | |||
19 | -static inline void gen_vfp_neg(int dp) | ||
20 | -{ | ||
21 | - if (dp) | ||
22 | - gen_helper_vfp_negd(cpu_F0d, cpu_F0d); | ||
23 | - else | ||
24 | - gen_helper_vfp_negs(cpu_F0s, cpu_F0s); | ||
25 | -} | ||
26 | - | ||
27 | #define VFP_GEN_ITOF(name) \ | ||
28 | static inline void gen_vfp_##name(int dp, int neon) \ | ||
29 | { \ | ||
30 | @@ -XXX,XX +XXX,XX @@ static int neon_2rm_is_float_op(int op) | ||
31 | * what we are asking here is "does the code for this case in | ||
32 | * the Neon for-each-pass loop use cpu_F0s?". | ||
33 | */ | ||
34 | - return (op == NEON_2RM_VNEG_F || | ||
35 | - (op >= NEON_2RM_VRINTN && op <= NEON_2RM_VRINTZ) || | ||
36 | + return ((op >= NEON_2RM_VRINTN && op <= NEON_2RM_VRINTZ) || | ||
37 | op == NEON_2RM_VRINTM || | ||
38 | (op >= NEON_2RM_VRINTP && op <= NEON_2RM_VCVTMS) || | ||
39 | op >= NEON_2RM_VRECPE_F); | ||
40 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | ||
41 | gen_helper_vfp_abss(tmp, tmp); | ||
42 | break; | ||
43 | case NEON_2RM_VNEG_F: | ||
44 | - gen_vfp_neg(0); | ||
45 | + gen_helper_vfp_negs(tmp, tmp); | ||
46 | break; | ||
47 | case NEON_2RM_VSWP: | ||
48 | tmp2 = neon_load_reg(rd, pass); | ||
49 | -- | ||
50 | 2.20.1 | ||
51 | |||
52 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Switch NEON_2RM_VRINT* away from using cpu_F0s. | ||
1 | 2 | ||
3 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
6 | Message-id: 20190613163917.28589-6-peter.maydell@linaro.org | ||
7 | --- | ||
8 | target/arm/translate.c | 8 +++----- | ||
9 | 1 file changed, 3 insertions(+), 5 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate.c b/target/arm/translate.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate.c | ||
14 | +++ b/target/arm/translate.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static int neon_2rm_is_float_op(int op) | ||
16 | * what we are asking here is "does the code for this case in | ||
17 | * the Neon for-each-pass loop use cpu_F0s?". | ||
18 | */ | ||
19 | - return ((op >= NEON_2RM_VRINTN && op <= NEON_2RM_VRINTZ) || | ||
20 | - op == NEON_2RM_VRINTM || | ||
21 | - (op >= NEON_2RM_VRINTP && op <= NEON_2RM_VCVTMS) || | ||
22 | + return ((op >= NEON_2RM_VCVTAU && op <= NEON_2RM_VCVTMS) || | ||
23 | op >= NEON_2RM_VRECPE_F); | ||
24 | } | ||
25 | |||
26 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | ||
27 | tcg_rmode = tcg_const_i32(arm_rmode_to_sf(rmode)); | ||
28 | gen_helper_set_neon_rmode(tcg_rmode, tcg_rmode, | ||
29 | cpu_env); | ||
30 | - gen_helper_rints(cpu_F0s, cpu_F0s, fpstatus); | ||
31 | + gen_helper_rints(tmp, tmp, fpstatus); | ||
32 | gen_helper_set_neon_rmode(tcg_rmode, tcg_rmode, | ||
33 | cpu_env); | ||
34 | tcg_temp_free_ptr(fpstatus); | ||
35 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | ||
36 | case NEON_2RM_VRINTX: | ||
37 | { | ||
38 | TCGv_ptr fpstatus = get_fpstatus_ptr(1); | ||
39 | - gen_helper_rints_exact(cpu_F0s, cpu_F0s, fpstatus); | ||
40 | + gen_helper_rints_exact(tmp, tmp, fpstatus); | ||
41 | tcg_temp_free_ptr(fpstatus); | ||
42 | break; | ||
43 | } | ||
44 | -- | ||
45 | 2.20.1 | ||
46 | |||
47 | diff view generated by jsdifflib |
1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> | 1 | Stop using cpu_F0s for the NEON_2RM_VCVT[ANPM][US] ops. |
---|---|---|---|
2 | 2 | ||
3 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
4 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
5 | Message-id: 20190520214342.13709-5-philmd@redhat.com | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 3 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
6 | Message-id: 20190613163917.28589-7-peter.maydell@linaro.org | ||
7 | --- | 7 | --- |
8 | include/hw/arm/exynos4210.h | 9 +++++++-- | 8 | target/arm/translate.c | 7 +++---- |
9 | hw/arm/exynos4210.c | 28 ++++++++++++++++++++++++---- | 9 | 1 file changed, 3 insertions(+), 4 deletions(-) |
10 | hw/arm/exynos4_boards.c | 9 ++++++--- | ||
11 | 3 files changed, 37 insertions(+), 9 deletions(-) | ||
12 | 10 | ||
13 | diff --git a/include/hw/arm/exynos4210.h b/include/hw/arm/exynos4210.h | 11 | diff --git a/target/arm/translate.c b/target/arm/translate.c |
14 | index XXXXXXX..XXXXXXX 100644 | 12 | index XXXXXXX..XXXXXXX 100644 |
15 | --- a/include/hw/arm/exynos4210.h | 13 | --- a/target/arm/translate.c |
16 | +++ b/include/hw/arm/exynos4210.h | 14 | +++ b/target/arm/translate.c |
17 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210Irq { | 15 | @@ -XXX,XX +XXX,XX @@ static int neon_2rm_is_float_op(int op) |
18 | } Exynos4210Irq; | 16 | * what we are asking here is "does the code for this case in |
19 | 17 | * the Neon for-each-pass loop use cpu_F0s?". | |
20 | typedef struct Exynos4210State { | 18 | */ |
21 | + /*< private >*/ | 19 | - return ((op >= NEON_2RM_VCVTAU && op <= NEON_2RM_VCVTMS) || |
22 | + SysBusDevice parent_obj; | 20 | - op >= NEON_2RM_VRECPE_F); |
23 | + /*< public >*/ | 21 | + return op >= NEON_2RM_VRECPE_F; |
24 | ARMCPU *cpu[EXYNOS4210_NCPUS]; | ||
25 | Exynos4210Irq irqs; | ||
26 | qemu_irq *irq_table; | ||
27 | @@ -XXX,XX +XXX,XX @@ typedef struct Exynos4210State { | ||
28 | I2CBus *i2c_if[EXYNOS4210_I2C_NUMBER]; | ||
29 | } Exynos4210State; | ||
30 | |||
31 | +#define TYPE_EXYNOS4210_SOC "exynos4210" | ||
32 | +#define EXYNOS4210_SOC(obj) \ | ||
33 | + OBJECT_CHECK(Exynos4210State, obj, TYPE_EXYNOS4210_SOC) | ||
34 | + | ||
35 | void exynos4210_write_secondary(ARMCPU *cpu, | ||
36 | const struct arm_boot_info *info); | ||
37 | |||
38 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem); | ||
39 | - | ||
40 | /* Initialize exynos4210 IRQ subsystem stub */ | ||
41 | qemu_irq *exynos4210_init_irq(Exynos4210Irq *env); | ||
42 | |||
43 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | ||
44 | index XXXXXXX..XXXXXXX 100644 | ||
45 | --- a/hw/arm/exynos4210.c | ||
46 | +++ b/hw/arm/exynos4210.c | ||
47 | @@ -XXX,XX +XXX,XX @@ static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | ||
48 | sysbus_connect_irq(busdev, 0, irq); | ||
49 | } | 22 | } |
50 | 23 | ||
51 | -Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | 24 | static bool neon_2rm_is_v8_op(int op) |
52 | +static void exynos4210_realize(DeviceState *socdev, Error **errp) | 25 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) |
53 | { | 26 | cpu_env); |
54 | - Exynos4210State *s = g_new0(Exynos4210State, 1); | 27 | |
55 | + Exynos4210State *s = EXYNOS4210_SOC(socdev); | 28 | if (is_signed) { |
56 | + MemoryRegion *system_mem = get_system_memory(); | 29 | - gen_helper_vfp_tosls(cpu_F0s, cpu_F0s, |
57 | qemu_irq gate_irq[EXYNOS4210_NCPUS][EXYNOS4210_IRQ_GATE_NINPUTS]; | 30 | + gen_helper_vfp_tosls(tmp, tmp, |
58 | SysBusDevice *busdev; | 31 | tcg_shift, fpst); |
59 | DeviceState *dev; | 32 | } else { |
60 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | 33 | - gen_helper_vfp_touls(cpu_F0s, cpu_F0s, |
61 | qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); | 34 | + gen_helper_vfp_touls(tmp, tmp, |
62 | pl330_create(EXYNOS4210_PL330_BASE2_ADDR, | 35 | tcg_shift, fpst); |
63 | qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); | 36 | } |
64 | - | ||
65 | - return s; | ||
66 | } | ||
67 | + | ||
68 | +static void exynos4210_class_init(ObjectClass *klass, void *data) | ||
69 | +{ | ||
70 | + DeviceClass *dc = DEVICE_CLASS(klass); | ||
71 | + | ||
72 | + dc->realize = exynos4210_realize; | ||
73 | +} | ||
74 | + | ||
75 | +static const TypeInfo exynos4210_info = { | ||
76 | + .name = TYPE_EXYNOS4210_SOC, | ||
77 | + .parent = TYPE_SYS_BUS_DEVICE, | ||
78 | + .instance_size = sizeof(Exynos4210State), | ||
79 | + .class_init = exynos4210_class_init, | ||
80 | +}; | ||
81 | + | ||
82 | +static void exynos4210_register_types(void) | ||
83 | +{ | ||
84 | + type_register_static(&exynos4210_info); | ||
85 | +} | ||
86 | + | ||
87 | +type_init(exynos4210_register_types) | ||
88 | diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c | ||
89 | index XXXXXXX..XXXXXXX 100644 | ||
90 | --- a/hw/arm/exynos4_boards.c | ||
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 | } | ||
113 | @@ -XXX,XX +XXX,XX @@ static void smdkc210_init(MachineState *machine) | ||
114 | EXYNOS4_BOARD_SMDKC210); | ||
115 | |||
116 | lan9215_init(SMDK_LAN9118_BASE_ADDR, | ||
117 | - qemu_irq_invert(s->soc->irq_table[exynos4210_get_irq(37, 1)])); | ||
118 | + qemu_irq_invert(s->soc.irq_table[exynos4210_get_irq(37, 1)])); | ||
119 | arm_load_kernel(ARM_CPU(first_cpu), &exynos4_board_binfo); | ||
120 | } | ||
121 | 37 | ||
122 | -- | 38 | -- |
123 | 2.20.1 | 39 | 2.20.1 |
124 | 40 | ||
125 | 41 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Stop using cpu_F0s for NEON_2RM_VRECPE_F and NEON_2RM_VRSQRTE_F. | ||
1 | 2 | ||
3 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
6 | Message-id: 20190613163917.28589-8-peter.maydell@linaro.org | ||
7 | --- | ||
8 | target/arm/translate.c | 6 +++--- | ||
9 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate.c b/target/arm/translate.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate.c | ||
14 | +++ b/target/arm/translate.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static int neon_2rm_is_float_op(int op) | ||
16 | * what we are asking here is "does the code for this case in | ||
17 | * the Neon for-each-pass loop use cpu_F0s?". | ||
18 | */ | ||
19 | - return op >= NEON_2RM_VRECPE_F; | ||
20 | + return op >= NEON_2RM_VCVT_FS; | ||
21 | } | ||
22 | |||
23 | static bool neon_2rm_is_v8_op(int op) | ||
24 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | ||
25 | case NEON_2RM_VRECPE_F: | ||
26 | { | ||
27 | TCGv_ptr fpstatus = get_fpstatus_ptr(1); | ||
28 | - gen_helper_recpe_f32(cpu_F0s, cpu_F0s, fpstatus); | ||
29 | + gen_helper_recpe_f32(tmp, tmp, fpstatus); | ||
30 | tcg_temp_free_ptr(fpstatus); | ||
31 | break; | ||
32 | } | ||
33 | case NEON_2RM_VRSQRTE_F: | ||
34 | { | ||
35 | TCGv_ptr fpstatus = get_fpstatus_ptr(1); | ||
36 | - gen_helper_rsqrte_f32(cpu_F0s, cpu_F0s, fpstatus); | ||
37 | + gen_helper_rsqrte_f32(tmp, tmp, fpstatus); | ||
38 | tcg_temp_free_ptr(fpstatus); | ||
39 | break; | ||
40 | } | ||
41 | -- | ||
42 | 2.20.1 | ||
43 | |||
44 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Stop using cpu_F0s for the Neon f32/s32 VCVT operations. | ||
2 | Since this is the last user of cpu_F0s in the Neon 2rm-op | ||
3 | loop, we can remove the handling code for it too. | ||
1 | 4 | ||
5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
8 | Message-id: 20190613163917.28589-9-peter.maydell@linaro.org | ||
9 | --- | ||
10 | target/arm/translate.c | 82 ++++++++++++------------------------------ | ||
11 | 1 file changed, 22 insertions(+), 60 deletions(-) | ||
12 | |||
13 | diff --git a/target/arm/translate.c b/target/arm/translate.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/target/arm/translate.c | ||
16 | +++ b/target/arm/translate.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static TCGv_ptr get_fpstatus_ptr(int neon) | ||
18 | return statusptr; | ||
19 | } | ||
20 | |||
21 | -#define VFP_GEN_ITOF(name) \ | ||
22 | -static inline void gen_vfp_##name(int dp, int neon) \ | ||
23 | -{ \ | ||
24 | - TCGv_ptr statusptr = get_fpstatus_ptr(neon); \ | ||
25 | - if (dp) { \ | ||
26 | - gen_helper_vfp_##name##d(cpu_F0d, cpu_F0s, statusptr); \ | ||
27 | - } else { \ | ||
28 | - gen_helper_vfp_##name##s(cpu_F0s, cpu_F0s, statusptr); \ | ||
29 | - } \ | ||
30 | - tcg_temp_free_ptr(statusptr); \ | ||
31 | -} | ||
32 | - | ||
33 | -VFP_GEN_ITOF(uito) | ||
34 | -VFP_GEN_ITOF(sito) | ||
35 | -#undef VFP_GEN_ITOF | ||
36 | - | ||
37 | -#define VFP_GEN_FTOI(name) \ | ||
38 | -static inline void gen_vfp_##name(int dp, int neon) \ | ||
39 | -{ \ | ||
40 | - TCGv_ptr statusptr = get_fpstatus_ptr(neon); \ | ||
41 | - if (dp) { \ | ||
42 | - gen_helper_vfp_##name##d(cpu_F0s, cpu_F0d, statusptr); \ | ||
43 | - } else { \ | ||
44 | - gen_helper_vfp_##name##s(cpu_F0s, cpu_F0s, statusptr); \ | ||
45 | - } \ | ||
46 | - tcg_temp_free_ptr(statusptr); \ | ||
47 | -} | ||
48 | - | ||
49 | -VFP_GEN_FTOI(touiz) | ||
50 | -VFP_GEN_FTOI(tosiz) | ||
51 | -#undef VFP_GEN_FTOI | ||
52 | - | ||
53 | #define VFP_GEN_FIX(name, round) \ | ||
54 | static inline void gen_vfp_##name(int dp, int shift, int neon) \ | ||
55 | { \ | ||
56 | @@ -XXX,XX +XXX,XX @@ static const uint8_t neon_3r_sizes[] = { | ||
57 | #define NEON_2RM_VCVT_SF 62 | ||
58 | #define NEON_2RM_VCVT_UF 63 | ||
59 | |||
60 | -static int neon_2rm_is_float_op(int op) | ||
61 | -{ | ||
62 | - /* | ||
63 | - * Return true if this neon 2reg-misc op is float-to-float. | ||
64 | - * This is not a property of the operation but of our code -- | ||
65 | - * what we are asking here is "does the code for this case in | ||
66 | - * the Neon for-each-pass loop use cpu_F0s?". | ||
67 | - */ | ||
68 | - return op >= NEON_2RM_VCVT_FS; | ||
69 | -} | ||
70 | - | ||
71 | static bool neon_2rm_is_v8_op(int op) | ||
72 | { | ||
73 | /* Return true if this neon 2reg-misc op is ARMv8 and up */ | ||
74 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | ||
75 | default: | ||
76 | elementwise: | ||
77 | for (pass = 0; pass < (q ? 4 : 2); pass++) { | ||
78 | - if (neon_2rm_is_float_op(op)) { | ||
79 | - tcg_gen_ld_f32(cpu_F0s, cpu_env, | ||
80 | - neon_reg_offset(rm, pass)); | ||
81 | - tmp = NULL; | ||
82 | - } else { | ||
83 | - tmp = neon_load_reg(rm, pass); | ||
84 | - } | ||
85 | + tmp = neon_load_reg(rm, pass); | ||
86 | switch (op) { | ||
87 | case NEON_2RM_VREV32: | ||
88 | switch (size) { | ||
89 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | ||
90 | break; | ||
91 | } | ||
92 | case NEON_2RM_VCVT_FS: /* VCVT.F32.S32 */ | ||
93 | - gen_vfp_sito(0, 1); | ||
94 | + { | ||
95 | + TCGv_ptr fpstatus = get_fpstatus_ptr(1); | ||
96 | + gen_helper_vfp_sitos(tmp, tmp, fpstatus); | ||
97 | + tcg_temp_free_ptr(fpstatus); | ||
98 | break; | ||
99 | + } | ||
100 | case NEON_2RM_VCVT_FU: /* VCVT.F32.U32 */ | ||
101 | - gen_vfp_uito(0, 1); | ||
102 | + { | ||
103 | + TCGv_ptr fpstatus = get_fpstatus_ptr(1); | ||
104 | + gen_helper_vfp_uitos(tmp, tmp, fpstatus); | ||
105 | + tcg_temp_free_ptr(fpstatus); | ||
106 | break; | ||
107 | + } | ||
108 | case NEON_2RM_VCVT_SF: /* VCVT.S32.F32 */ | ||
109 | - gen_vfp_tosiz(0, 1); | ||
110 | + { | ||
111 | + TCGv_ptr fpstatus = get_fpstatus_ptr(1); | ||
112 | + gen_helper_vfp_tosizs(tmp, tmp, fpstatus); | ||
113 | + tcg_temp_free_ptr(fpstatus); | ||
114 | break; | ||
115 | + } | ||
116 | case NEON_2RM_VCVT_UF: /* VCVT.U32.F32 */ | ||
117 | - gen_vfp_touiz(0, 1); | ||
118 | + { | ||
119 | + TCGv_ptr fpstatus = get_fpstatus_ptr(1); | ||
120 | + gen_helper_vfp_touizs(tmp, tmp, fpstatus); | ||
121 | + tcg_temp_free_ptr(fpstatus); | ||
122 | break; | ||
123 | + } | ||
124 | default: | ||
125 | /* Reserved op values were caught by the | ||
126 | * neon_2rm_sizes[] check earlier. | ||
127 | */ | ||
128 | abort(); | ||
129 | } | ||
130 | - if (neon_2rm_is_float_op(op)) { | ||
131 | - tcg_gen_st_f32(cpu_F0s, cpu_env, | ||
132 | - neon_reg_offset(rd, pass)); | ||
133 | - } else { | ||
134 | - neon_store_reg(rd, pass, tmp); | ||
135 | - } | ||
136 | + neon_store_reg(rd, pass, tmp); | ||
137 | } | ||
138 | break; | ||
139 | } | ||
140 | -- | ||
141 | 2.20.1 | ||
142 | |||
143 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Stop using cpu_F0s in the Neon VCVT fixed-point operations. | ||
1 | 2 | ||
3 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
4 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
5 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
6 | Message-id: 20190613163917.28589-10-peter.maydell@linaro.org | ||
7 | --- | ||
8 | target/arm/translate.c | 62 +++++++++++++++++++----------------------- | ||
9 | 1 file changed, 28 insertions(+), 34 deletions(-) | ||
10 | |||
11 | diff --git a/target/arm/translate.c b/target/arm/translate.c | ||
12 | index XXXXXXX..XXXXXXX 100644 | ||
13 | --- a/target/arm/translate.c | ||
14 | +++ b/target/arm/translate.c | ||
15 | @@ -XXX,XX +XXX,XX @@ static const char * const regnames[] = | ||
16 | /* Function prototypes for gen_ functions calling Neon helpers. */ | ||
17 | typedef void NeonGenThreeOpEnvFn(TCGv_i32, TCGv_env, TCGv_i32, | ||
18 | TCGv_i32, TCGv_i32); | ||
19 | +/* Function prototypes for gen_ functions for fix point conversions */ | ||
20 | +typedef void VFPGenFixPointFn(TCGv_i32, TCGv_i32, TCGv_i32, TCGv_ptr); | ||
21 | |||
22 | /* initialize TCG globals. */ | ||
23 | void arm_translate_init(void) | ||
24 | @@ -XXX,XX +XXX,XX @@ static TCGv_ptr get_fpstatus_ptr(int neon) | ||
25 | return statusptr; | ||
26 | } | ||
27 | |||
28 | -#define VFP_GEN_FIX(name, round) \ | ||
29 | -static inline void gen_vfp_##name(int dp, int shift, int neon) \ | ||
30 | -{ \ | ||
31 | - TCGv_i32 tmp_shift = tcg_const_i32(shift); \ | ||
32 | - TCGv_ptr statusptr = get_fpstatus_ptr(neon); \ | ||
33 | - if (dp) { \ | ||
34 | - gen_helper_vfp_##name##d##round(cpu_F0d, cpu_F0d, tmp_shift, \ | ||
35 | - statusptr); \ | ||
36 | - } else { \ | ||
37 | - gen_helper_vfp_##name##s##round(cpu_F0s, cpu_F0s, tmp_shift, \ | ||
38 | - statusptr); \ | ||
39 | - } \ | ||
40 | - tcg_temp_free_i32(tmp_shift); \ | ||
41 | - tcg_temp_free_ptr(statusptr); \ | ||
42 | -} | ||
43 | -VFP_GEN_FIX(tosl, _round_to_zero) | ||
44 | -VFP_GEN_FIX(toul, _round_to_zero) | ||
45 | -VFP_GEN_FIX(slto, ) | ||
46 | -VFP_GEN_FIX(ulto, ) | ||
47 | -#undef VFP_GEN_FIX | ||
48 | - | ||
49 | static inline long vfp_reg_offset(bool dp, unsigned reg) | ||
50 | { | ||
51 | if (dp) { | ||
52 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | ||
53 | } | ||
54 | } else if (op >= 14) { | ||
55 | /* VCVT fixed-point. */ | ||
56 | + TCGv_ptr fpst; | ||
57 | + TCGv_i32 shiftv; | ||
58 | + VFPGenFixPointFn *fn; | ||
59 | + | ||
60 | if (!(insn & (1 << 21)) || (q && ((rd | rm) & 1))) { | ||
61 | return 1; | ||
62 | } | ||
63 | + | ||
64 | + if (!(op & 1)) { | ||
65 | + if (u) { | ||
66 | + fn = gen_helper_vfp_ultos; | ||
67 | + } else { | ||
68 | + fn = gen_helper_vfp_sltos; | ||
69 | + } | ||
70 | + } else { | ||
71 | + if (u) { | ||
72 | + fn = gen_helper_vfp_touls_round_to_zero; | ||
73 | + } else { | ||
74 | + fn = gen_helper_vfp_tosls_round_to_zero; | ||
75 | + } | ||
76 | + } | ||
77 | + | ||
78 | /* We have already masked out the must-be-1 top bit of imm6, | ||
79 | * hence this 32-shift where the ARM ARM has 64-imm6. | ||
80 | */ | ||
81 | shift = 32 - shift; | ||
82 | + fpst = get_fpstatus_ptr(1); | ||
83 | + shiftv = tcg_const_i32(shift); | ||
84 | for (pass = 0; pass < (q ? 4 : 2); pass++) { | ||
85 | - tcg_gen_ld_f32(cpu_F0s, cpu_env, neon_reg_offset(rm, pass)); | ||
86 | - if (!(op & 1)) { | ||
87 | - if (u) | ||
88 | - gen_vfp_ulto(0, shift, 1); | ||
89 | - else | ||
90 | - gen_vfp_slto(0, shift, 1); | ||
91 | - } else { | ||
92 | - if (u) | ||
93 | - gen_vfp_toul(0, shift, 1); | ||
94 | - else | ||
95 | - gen_vfp_tosl(0, shift, 1); | ||
96 | - } | ||
97 | - tcg_gen_st_f32(cpu_F0s, cpu_env, neon_reg_offset(rd, pass)); | ||
98 | + TCGv_i32 tmpf = neon_load_reg(rm, pass); | ||
99 | + fn(tmpf, tmpf, shiftv, fpst); | ||
100 | + neon_store_reg(rd, pass, tmpf); | ||
101 | } | ||
102 | + tcg_temp_free_ptr(fpst); | ||
103 | + tcg_temp_free_i32(shiftv); | ||
104 | } else { | ||
105 | return 1; | ||
106 | } | ||
107 | -- | ||
108 | 2.20.1 | ||
109 | |||
110 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | Remove some old constructs from NEON_2RM_VCVT_F16_F32 code: | ||
2 | * don't use cpu_F0s | ||
3 | * don't use tcg_gen_ld_f32 | ||
1 | 4 | ||
5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
7 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
8 | Message-id: 20190613163917.28589-11-peter.maydell@linaro.org | ||
9 | --- | ||
10 | target/arm/translate.c | 27 ++++++++++++--------------- | ||
11 | 1 file changed, 12 insertions(+), 15 deletions(-) | ||
12 | |||
13 | diff --git a/target/arm/translate.c b/target/arm/translate.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/target/arm/translate.c | ||
16 | +++ b/target/arm/translate.c | ||
17 | @@ -XXX,XX +XXX,XX @@ static TCGv_ptr vfp_reg_ptr(bool dp, int reg) | ||
18 | return ret; | ||
19 | } | ||
20 | |||
21 | -#define tcg_gen_ld_f32 tcg_gen_ld_i32 | ||
22 | #define tcg_gen_st_f32 tcg_gen_st_i32 | ||
23 | |||
24 | #define ARM_CP_RW_BIT (1 << 20) | ||
25 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | ||
26 | q || (rm & 1)) { | ||
27 | return 1; | ||
28 | } | ||
29 | - tmp = tcg_temp_new_i32(); | ||
30 | - tmp2 = tcg_temp_new_i32(); | ||
31 | fpst = get_fpstatus_ptr(true); | ||
32 | ahp = get_ahp_flag(); | ||
33 | - tcg_gen_ld_f32(cpu_F0s, cpu_env, neon_reg_offset(rm, 0)); | ||
34 | - gen_helper_vfp_fcvt_f32_to_f16(tmp, cpu_F0s, fpst, ahp); | ||
35 | - tcg_gen_ld_f32(cpu_F0s, cpu_env, neon_reg_offset(rm, 1)); | ||
36 | - gen_helper_vfp_fcvt_f32_to_f16(tmp2, cpu_F0s, fpst, ahp); | ||
37 | + tmp = neon_load_reg(rm, 0); | ||
38 | + gen_helper_vfp_fcvt_f32_to_f16(tmp, tmp, fpst, ahp); | ||
39 | + tmp2 = neon_load_reg(rm, 1); | ||
40 | + gen_helper_vfp_fcvt_f32_to_f16(tmp2, tmp2, fpst, ahp); | ||
41 | tcg_gen_shli_i32(tmp2, tmp2, 16); | ||
42 | tcg_gen_or_i32(tmp2, tmp2, tmp); | ||
43 | - tcg_gen_ld_f32(cpu_F0s, cpu_env, neon_reg_offset(rm, 2)); | ||
44 | - gen_helper_vfp_fcvt_f32_to_f16(tmp, cpu_F0s, fpst, ahp); | ||
45 | - tcg_gen_ld_f32(cpu_F0s, cpu_env, neon_reg_offset(rm, 3)); | ||
46 | + tcg_temp_free_i32(tmp); | ||
47 | + tmp = neon_load_reg(rm, 2); | ||
48 | + gen_helper_vfp_fcvt_f32_to_f16(tmp, tmp, fpst, ahp); | ||
49 | + tmp3 = neon_load_reg(rm, 3); | ||
50 | neon_store_reg(rd, 0, tmp2); | ||
51 | - tmp2 = tcg_temp_new_i32(); | ||
52 | - gen_helper_vfp_fcvt_f32_to_f16(tmp2, cpu_F0s, fpst, ahp); | ||
53 | - tcg_gen_shli_i32(tmp2, tmp2, 16); | ||
54 | - tcg_gen_or_i32(tmp2, tmp2, tmp); | ||
55 | - neon_store_reg(rd, 1, tmp2); | ||
56 | + gen_helper_vfp_fcvt_f32_to_f16(tmp3, tmp3, fpst, ahp); | ||
57 | + tcg_gen_shli_i32(tmp3, tmp3, 16); | ||
58 | + tcg_gen_or_i32(tmp3, tmp3, tmp); | ||
59 | + neon_store_reg(rd, 1, tmp3); | ||
60 | tcg_temp_free_i32(tmp); | ||
61 | tcg_temp_free_i32(ahp); | ||
62 | tcg_temp_free_ptr(fpst); | ||
63 | -- | ||
64 | 2.20.1 | ||
65 | |||
66 | diff view generated by jsdifflib |
1 | From: Alistair Francis <alistair.francis@wdc.com> | 1 | Remove some old constructns from NEON_2RM_VCVT_F16_F32 code: |
---|---|---|---|
2 | * don't use CPU_F0s | ||
3 | * don't use tcg_gen_st_f32 | ||
2 | 4 | ||
3 | Commit 89e68b575 "target/arm: Use vector operations for saturation" | 5 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
4 | causes this abort() when booting QEMU ARM with a Cortex-A15: | ||
5 | |||
6 | 0 0x00007ffff4c2382f in raise () at /usr/lib/libc.so.6 | ||
7 | 1 0x00007ffff4c0e672 in abort () at /usr/lib/libc.so.6 | ||
8 | 2 0x00005555559c1839 in disas_neon_data_insn (insn=<optimized out>, s=<optimized out>) at ./target/arm/translate.c:6673 | ||
9 | 3 0x00005555559c1839 in disas_neon_data_insn (s=<optimized out>, insn=<optimized out>) at ./target/arm/translate.c:6386 | ||
10 | 4 0x00005555559cd8a4 in disas_arm_insn (insn=4081107068, s=0x7fffe59a9510) at ./target/arm/translate.c:9289 | ||
11 | 5 0x00005555559cd8a4 in arm_tr_translate_insn (dcbase=0x7fffe59a9510, cpu=<optimized out>) at ./target/arm/translate.c:13612 | ||
12 | 6 0x00005555558d1d39 in translator_loop (ops=0x5555561cc580 <arm_translator_ops>, db=0x7fffe59a9510, cpu=0x55555686a2f0, tb=<optimized out>, max_insns=<optimized out>) at ./accel/tcg/translator.c:96 | ||
13 | 7 0x00005555559d10d4 in gen_intermediate_code (cpu=cpu@entry=0x55555686a2f0, tb=tb@entry=0x7fffd7840080 <code_gen_buffer+126091347>, max_insns=max_insns@entry=512) at ./target/arm/translate.c:13901 | ||
14 | 8 0x00005555558d06b9 in tb_gen_code (cpu=cpu@entry=0x55555686a2f0, pc=3067096216, cs_base=0, flags=192, cflags=-16252928, cflags@entry=524288) at ./accel/tcg/translate-all.c:1736 | ||
15 | 9 0x00005555558ce467 in tb_find (cf_mask=524288, tb_exit=1, last_tb=0x7fffd783e640 <code_gen_buffer+126084627>, cpu=0x1) at ./accel/tcg/cpu-exec.c:407 | ||
16 | 10 0x00005555558ce467 in cpu_exec (cpu=cpu@entry=0x55555686a2f0) at ./accel/tcg/cpu-exec.c:728 | ||
17 | 11 0x000055555588b0cf in tcg_cpu_exec (cpu=0x55555686a2f0) at ./cpus.c:1431 | ||
18 | 12 0x000055555588d223 in qemu_tcg_cpu_thread_fn (arg=0x55555686a2f0) at ./cpus.c:1735 | ||
19 | 13 0x000055555588d223 in qemu_tcg_cpu_thread_fn (arg=arg@entry=0x55555686a2f0) at ./cpus.c:1709 | ||
20 | 14 0x0000555555d2629a in qemu_thread_start (args=<optimized out>) at ./util/qemu-thread-posix.c:502 | ||
21 | 15 0x00007ffff4db8a92 in start_thread () at /usr/lib/libpthread. | ||
22 | |||
23 | This patch ensures that we don't hit the abort() in the second switch | ||
24 | case in disas_neon_data_insn() as we will return from the first case. | ||
25 | |||
26 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
27 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | 6 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> |
28 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 7 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
29 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | 8 | Message-id: 20190613163917.28589-12-peter.maydell@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> | ||
33 | --- | 9 | --- |
34 | target/arm/translate.c | 4 ++-- | 10 | target/arm/translate.c | 26 +++++++++++--------------- |
35 | 1 file changed, 2 insertions(+), 2 deletions(-) | 11 | 1 file changed, 11 insertions(+), 15 deletions(-) |
36 | 12 | ||
37 | diff --git a/target/arm/translate.c b/target/arm/translate.c | 13 | diff --git a/target/arm/translate.c b/target/arm/translate.c |
38 | index XXXXXXX..XXXXXXX 100644 | 14 | index XXXXXXX..XXXXXXX 100644 |
39 | --- a/target/arm/translate.c | 15 | --- a/target/arm/translate.c |
40 | +++ b/target/arm/translate.c | 16 | +++ b/target/arm/translate.c |
17 | @@ -XXX,XX +XXX,XX @@ static TCGv_ptr vfp_reg_ptr(bool dp, int reg) | ||
18 | return ret; | ||
19 | } | ||
20 | |||
21 | -#define tcg_gen_st_f32 tcg_gen_st_i32 | ||
22 | - | ||
23 | #define ARM_CP_RW_BIT (1 << 20) | ||
24 | |||
25 | /* Include the VFP decoder */ | ||
41 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | 26 | @@ -XXX,XX +XXX,XX @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) |
42 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | 27 | tmp = neon_load_reg(rm, 0); |
43 | rn_ofs, rm_ofs, vec_size, vec_size, | 28 | tmp2 = neon_load_reg(rm, 1); |
44 | (u ? uqadd_op : sqadd_op) + size); | 29 | tcg_gen_ext16u_i32(tmp3, tmp); |
45 | - break; | 30 | - gen_helper_vfp_fcvt_f16_to_f32(cpu_F0s, tmp3, fpst, ahp); |
46 | + return 0; | 31 | - tcg_gen_st_f32(cpu_F0s, cpu_env, neon_reg_offset(rd, 0)); |
47 | 32 | - tcg_gen_shri_i32(tmp3, tmp, 16); | |
48 | case NEON_3R_VQSUB: | 33 | - gen_helper_vfp_fcvt_f16_to_f32(cpu_F0s, tmp3, fpst, ahp); |
49 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | 34 | - tcg_gen_st_f32(cpu_F0s, cpu_env, neon_reg_offset(rd, 1)); |
50 | rn_ofs, rm_ofs, vec_size, vec_size, | 35 | - tcg_temp_free_i32(tmp); |
51 | (u ? uqsub_op : sqsub_op) + size); | 36 | + gen_helper_vfp_fcvt_f16_to_f32(tmp3, tmp3, fpst, ahp); |
52 | - break; | 37 | + neon_store_reg(rd, 0, tmp3); |
53 | + return 0; | 38 | + tcg_gen_shri_i32(tmp, tmp, 16); |
54 | 39 | + gen_helper_vfp_fcvt_f16_to_f32(tmp, tmp, fpst, ahp); | |
55 | case NEON_3R_VMUL: /* VMUL */ | 40 | + neon_store_reg(rd, 1, tmp); |
56 | if (u) { | 41 | + tmp3 = tcg_temp_new_i32(); |
42 | tcg_gen_ext16u_i32(tmp3, tmp2); | ||
43 | - gen_helper_vfp_fcvt_f16_to_f32(cpu_F0s, tmp3, fpst, ahp); | ||
44 | - tcg_gen_st_f32(cpu_F0s, cpu_env, neon_reg_offset(rd, 2)); | ||
45 | - tcg_gen_shri_i32(tmp3, tmp2, 16); | ||
46 | - gen_helper_vfp_fcvt_f16_to_f32(cpu_F0s, tmp3, fpst, ahp); | ||
47 | - tcg_gen_st_f32(cpu_F0s, cpu_env, neon_reg_offset(rd, 3)); | ||
48 | - tcg_temp_free_i32(tmp2); | ||
49 | - tcg_temp_free_i32(tmp3); | ||
50 | + gen_helper_vfp_fcvt_f16_to_f32(tmp3, tmp3, fpst, ahp); | ||
51 | + neon_store_reg(rd, 2, tmp3); | ||
52 | + tcg_gen_shri_i32(tmp2, tmp2, 16); | ||
53 | + gen_helper_vfp_fcvt_f16_to_f32(tmp2, tmp2, fpst, ahp); | ||
54 | + neon_store_reg(rd, 3, tmp2); | ||
55 | tcg_temp_free_i32(ahp); | ||
56 | tcg_temp_free_ptr(fpst); | ||
57 | break; | ||
57 | -- | 58 | -- |
58 | 2.20.1 | 59 | 2.20.1 |
59 | 60 | ||
60 | 61 | diff view generated by jsdifflib |
1 | From: Richard Henderson <richard.henderson@linaro.org> | 1 | Remove the now unused TCG globals cpu_F0s, cpu_F0d, cpu_F1s, cpu_F1d. |
---|---|---|---|
2 | 2 | ||
3 | The mask implied by the extract is redundant with the one | 3 | cpu_M0 is still used by the iwmmxt code, and cpu_V0 and |
4 | implied by the deposit. Also, fix spelling of BFXIL. | 4 | cpu_V1 are used by both iwmmxt and Neon. |
5 | 5 | ||
6 | Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> | ||
7 | Signed-off-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Message-id: 20190514011129.11330-3-richard.henderson@linaro.org | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
9 | Message-id: 20190613163917.28589-13-peter.maydell@linaro.org | ||
10 | --- | 10 | --- |
11 | target/arm/translate-a64.c | 6 +++--- | 11 | target/arm/translate.c | 12 ++---------- |
12 | 1 file changed, 3 insertions(+), 3 deletions(-) | 12 | 1 file changed, 2 insertions(+), 10 deletions(-) |
13 | 13 | ||
14 | diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c | 14 | diff --git a/target/arm/translate.c b/target/arm/translate.c |
15 | index XXXXXXX..XXXXXXX 100644 | 15 | index XXXXXXX..XXXXXXX 100644 |
16 | --- a/target/arm/translate-a64.c | 16 | --- a/target/arm/translate.c |
17 | +++ b/target/arm/translate-a64.c | 17 | +++ b/target/arm/translate.c |
18 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) | 18 | @@ -XXX,XX +XXX,XX @@ TCGv_i32 cpu_CF, cpu_NF, cpu_VF, cpu_ZF; |
19 | tcg_gen_extract_i64(tcg_rd, tcg_tmp, ri, len); | 19 | TCGv_i64 cpu_exclusive_addr; |
20 | return; | 20 | TCGv_i64 cpu_exclusive_val; |
21 | } | 21 | |
22 | - /* opc == 1, BXFIL fall through to deposit */ | 22 | -/* FIXME: These should be removed. */ |
23 | - tcg_gen_extract_i64(tcg_tmp, tcg_tmp, ri, len); | 23 | -static TCGv_i32 cpu_F0s, cpu_F1s; |
24 | + /* opc == 1, BFXIL fall through to deposit */ | 24 | -static TCGv_i64 cpu_F0d, cpu_F1d; |
25 | + tcg_gen_shri_i64(tcg_tmp, tcg_tmp, ri); | 25 | - |
26 | pos = 0; | 26 | #include "exec/gen-icount.h" |
27 | } else { | 27 | |
28 | /* Handle the ri > si case with a deposit | 28 | static const char * const regnames[] = |
29 | @@ -XXX,XX +XXX,XX @@ static void disas_bitfield(DisasContext *s, uint32_t insn) | 29 | @@ -XXX,XX +XXX,XX @@ static void arm_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) |
30 | len = ri; | 30 | dc->base.max_insns = MIN(dc->base.max_insns, bound); |
31 | } | 31 | } |
32 | 32 | ||
33 | - if (opc == 1) { /* BFM, BXFIL */ | 33 | - cpu_F0s = tcg_temp_new_i32(); |
34 | + if (opc == 1) { /* BFM, BFXIL */ | 34 | - cpu_F1s = tcg_temp_new_i32(); |
35 | tcg_gen_deposit_i64(tcg_rd, tcg_rd, tcg_tmp, pos, len); | 35 | - cpu_F0d = tcg_temp_new_i64(); |
36 | } else { | 36 | - cpu_F1d = tcg_temp_new_i64(); |
37 | /* SBFM or UBFM: We start with zero, and we haven't modified | 37 | - cpu_V0 = cpu_F0d; |
38 | - cpu_V1 = cpu_F1d; | ||
39 | + cpu_V0 = tcg_temp_new_i64(); | ||
40 | + cpu_V1 = tcg_temp_new_i64(); | ||
41 | /* FIXME: cpu_M0 can probably be the same as cpu_V0. */ | ||
42 | cpu_M0 = tcg_temp_new_i64(); | ||
43 | } | ||
38 | -- | 44 | -- |
39 | 2.20.1 | 45 | 2.20.1 |
40 | 46 | ||
41 | 47 | diff view generated by jsdifflib |
1 | The system_clock_scale global is used only by the armv7m systick | 1 | In several places cut and paste errors meant we were using the wrong |
---|---|---|---|
2 | device; move the extern declaration to the armv7m_systick.h header, | 2 | type for the 'arg' struct in trans_ functions called by the |
3 | and expand the comment to explain what it is and that it should | 3 | decodetree decoder, because we were using the _sp version of the |
4 | ideally be replaced with a different approach. | 4 | struct in the _dp function. These were harmless, because the two |
5 | structs were identical and so decodetree made them typedefs of the | ||
6 | same underlying structure (and we'd have had a compile error if they | ||
7 | were not harmless), but we should clean them up anyway. | ||
5 | 8 | ||
6 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
7 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 10 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
8 | Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> | 11 | Message-id: 20190614104457.24703-2-peter.maydell@linaro.org |
9 | Message-id: 20190516163857.6430-2-peter.maydell@linaro.org | ||
10 | --- | 12 | --- |
11 | include/hw/arm/arm.h | 4 ---- | 13 | target/arm/translate-vfp.inc.c | 28 ++++++++++++++-------------- |
12 | include/hw/timer/armv7m_systick.h | 22 ++++++++++++++++++++++ | 14 | 1 file changed, 14 insertions(+), 14 deletions(-) |
13 | 2 files changed, 22 insertions(+), 4 deletions(-) | ||
14 | 15 | ||
15 | diff --git a/include/hw/arm/arm.h b/include/hw/arm/arm.h | 16 | diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c |
16 | index XXXXXXX..XXXXXXX 100644 | 17 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/include/hw/arm/arm.h | 18 | --- a/target/arm/translate-vfp.inc.c |
18 | +++ b/include/hw/arm/arm.h | 19 | +++ b/target/arm/translate-vfp.inc.c |
19 | @@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu, | 20 | @@ -XXX,XX +XXX,XX @@ static bool trans_VMOV_64_sp(DisasContext *s, arg_VMOV_64_sp *a) |
20 | const struct arm_boot_info *info, | 21 | return true; |
21 | hwaddr mvbar_addr); | 22 | } |
22 | 23 | ||
23 | -/* Multiplication factor to convert from system clock ticks to qemu timer | 24 | -static bool trans_VMOV_64_dp(DisasContext *s, arg_VMOV_64_sp *a) |
24 | - ticks. */ | 25 | +static bool trans_VMOV_64_dp(DisasContext *s, arg_VMOV_64_dp *a) |
25 | -extern int system_clock_scale; | 26 | { |
26 | - | 27 | TCGv_i32 tmp; |
27 | #endif /* HW_ARM_H */ | 28 | |
28 | diff --git a/include/hw/timer/armv7m_systick.h b/include/hw/timer/armv7m_systick.h | 29 | @@ -XXX,XX +XXX,XX @@ static bool trans_VLDR_VSTR_sp(DisasContext *s, arg_VLDR_VSTR_sp *a) |
29 | index XXXXXXX..XXXXXXX 100644 | 30 | return true; |
30 | --- a/include/hw/timer/armv7m_systick.h | 31 | } |
31 | +++ b/include/hw/timer/armv7m_systick.h | 32 | |
32 | @@ -XXX,XX +XXX,XX @@ typedef struct SysTickState { | 33 | -static bool trans_VLDR_VSTR_dp(DisasContext *s, arg_VLDR_VSTR_sp *a) |
33 | qemu_irq irq; | 34 | +static bool trans_VLDR_VSTR_dp(DisasContext *s, arg_VLDR_VSTR_dp *a) |
34 | } SysTickState; | 35 | { |
35 | 36 | uint32_t offset; | |
36 | +/* | 37 | TCGv_i32 addr; |
37 | + * Multiplication factor to convert from system clock ticks to qemu timer | 38 | @@ -XXX,XX +XXX,XX @@ static void gen_VMLA_dp(TCGv_i64 vd, TCGv_i64 vn, TCGv_i64 vm, TCGv_ptr fpst) |
38 | + * ticks. This should be set (by board code, usually) to a value | 39 | tcg_temp_free_i64(tmp); |
39 | + * equal to NANOSECONDS_PER_SECOND / frq, where frq is the clock frequency | 40 | } |
40 | + * in Hz of the CPU. | 41 | |
41 | + * | 42 | -static bool trans_VMLA_dp(DisasContext *s, arg_VMLA_sp *a) |
42 | + * This value is used by the systick device when it is running in | 43 | +static bool trans_VMLA_dp(DisasContext *s, arg_VMLA_dp *a) |
43 | + * its "use the CPU clock" mode (ie when SYST_CSR.CLKSOURCE == 1) to | 44 | { |
44 | + * set how fast the timer should tick. | 45 | return do_vfp_3op_dp(s, gen_VMLA_dp, a->vd, a->vn, a->vm, true); |
45 | + * | 46 | } |
46 | + * TODO: we should refactor this so that rather than using a global | 47 | @@ -XXX,XX +XXX,XX @@ static void gen_VMLS_dp(TCGv_i64 vd, TCGv_i64 vn, TCGv_i64 vm, TCGv_ptr fpst) |
47 | + * we use a device property or something similar. This is complicated | 48 | tcg_temp_free_i64(tmp); |
48 | + * because (a) the property would need to be plumbed through from the | 49 | } |
49 | + * board code down through various layers to the systick device | 50 | |
50 | + * and (b) the property needs to be modifiable after realize, because | 51 | -static bool trans_VMLS_dp(DisasContext *s, arg_VMLS_sp *a) |
51 | + * the stellaris board uses this to implement the behaviour where the | 52 | +static bool trans_VMLS_dp(DisasContext *s, arg_VMLS_dp *a) |
52 | + * guest can reprogram the PLL registers to downclock the CPU, and the | 53 | { |
53 | + * systick device needs to react accordingly. Possibly this should | 54 | return do_vfp_3op_dp(s, gen_VMLS_dp, a->vd, a->vn, a->vm, true); |
54 | + * be deferred until we have a good API for modelling clock trees. | 55 | } |
55 | + */ | 56 | @@ -XXX,XX +XXX,XX @@ static void gen_VNMLS_dp(TCGv_i64 vd, TCGv_i64 vn, TCGv_i64 vm, TCGv_ptr fpst) |
56 | +extern int system_clock_scale; | 57 | tcg_temp_free_i64(tmp); |
57 | + | 58 | } |
58 | #endif | 59 | |
60 | -static bool trans_VNMLS_dp(DisasContext *s, arg_VNMLS_sp *a) | ||
61 | +static bool trans_VNMLS_dp(DisasContext *s, arg_VNMLS_dp *a) | ||
62 | { | ||
63 | return do_vfp_3op_dp(s, gen_VNMLS_dp, a->vd, a->vn, a->vm, true); | ||
64 | } | ||
65 | @@ -XXX,XX +XXX,XX @@ static void gen_VNMLA_dp(TCGv_i64 vd, TCGv_i64 vn, TCGv_i64 vm, TCGv_ptr fpst) | ||
66 | tcg_temp_free_i64(tmp); | ||
67 | } | ||
68 | |||
69 | -static bool trans_VNMLA_dp(DisasContext *s, arg_VNMLA_sp *a) | ||
70 | +static bool trans_VNMLA_dp(DisasContext *s, arg_VNMLA_dp *a) | ||
71 | { | ||
72 | return do_vfp_3op_dp(s, gen_VNMLA_dp, a->vd, a->vn, a->vm, true); | ||
73 | } | ||
74 | @@ -XXX,XX +XXX,XX @@ static bool trans_VMUL_sp(DisasContext *s, arg_VMUL_sp *a) | ||
75 | return do_vfp_3op_sp(s, gen_helper_vfp_muls, a->vd, a->vn, a->vm, false); | ||
76 | } | ||
77 | |||
78 | -static bool trans_VMUL_dp(DisasContext *s, arg_VMUL_sp *a) | ||
79 | +static bool trans_VMUL_dp(DisasContext *s, arg_VMUL_dp *a) | ||
80 | { | ||
81 | return do_vfp_3op_dp(s, gen_helper_vfp_muld, a->vd, a->vn, a->vm, false); | ||
82 | } | ||
83 | @@ -XXX,XX +XXX,XX @@ static void gen_VNMUL_dp(TCGv_i64 vd, TCGv_i64 vn, TCGv_i64 vm, TCGv_ptr fpst) | ||
84 | gen_helper_vfp_negd(vd, vd); | ||
85 | } | ||
86 | |||
87 | -static bool trans_VNMUL_dp(DisasContext *s, arg_VNMUL_sp *a) | ||
88 | +static bool trans_VNMUL_dp(DisasContext *s, arg_VNMUL_dp *a) | ||
89 | { | ||
90 | return do_vfp_3op_dp(s, gen_VNMUL_dp, a->vd, a->vn, a->vm, false); | ||
91 | } | ||
92 | @@ -XXX,XX +XXX,XX @@ static bool trans_VADD_sp(DisasContext *s, arg_VADD_sp *a) | ||
93 | return do_vfp_3op_sp(s, gen_helper_vfp_adds, a->vd, a->vn, a->vm, false); | ||
94 | } | ||
95 | |||
96 | -static bool trans_VADD_dp(DisasContext *s, arg_VADD_sp *a) | ||
97 | +static bool trans_VADD_dp(DisasContext *s, arg_VADD_dp *a) | ||
98 | { | ||
99 | return do_vfp_3op_dp(s, gen_helper_vfp_addd, a->vd, a->vn, a->vm, false); | ||
100 | } | ||
101 | @@ -XXX,XX +XXX,XX @@ static bool trans_VSUB_sp(DisasContext *s, arg_VSUB_sp *a) | ||
102 | return do_vfp_3op_sp(s, gen_helper_vfp_subs, a->vd, a->vn, a->vm, false); | ||
103 | } | ||
104 | |||
105 | -static bool trans_VSUB_dp(DisasContext *s, arg_VSUB_sp *a) | ||
106 | +static bool trans_VSUB_dp(DisasContext *s, arg_VSUB_dp *a) | ||
107 | { | ||
108 | return do_vfp_3op_dp(s, gen_helper_vfp_subd, a->vd, a->vn, a->vm, false); | ||
109 | } | ||
110 | @@ -XXX,XX +XXX,XX @@ static bool trans_VDIV_sp(DisasContext *s, arg_VDIV_sp *a) | ||
111 | return do_vfp_3op_sp(s, gen_helper_vfp_divs, a->vd, a->vn, a->vm, false); | ||
112 | } | ||
113 | |||
114 | -static bool trans_VDIV_dp(DisasContext *s, arg_VDIV_sp *a) | ||
115 | +static bool trans_VDIV_dp(DisasContext *s, arg_VDIV_dp *a) | ||
116 | { | ||
117 | return do_vfp_3op_dp(s, gen_helper_vfp_divd, a->vd, a->vn, a->vm, false); | ||
118 | } | ||
119 | @@ -XXX,XX +XXX,XX @@ static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp *a) | ||
120 | return true; | ||
121 | } | ||
122 | |||
123 | -static bool trans_VFM_dp(DisasContext *s, arg_VFM_sp *a) | ||
124 | +static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) | ||
125 | { | ||
126 | /* | ||
127 | * VFNMA : fd = muladd(-fd, fn, fm) | ||
128 | @@ -XXX,XX +XXX,XX @@ static bool trans_VRINTR_sp(DisasContext *s, arg_VRINTR_sp *a) | ||
129 | return true; | ||
130 | } | ||
131 | |||
132 | -static bool trans_VRINTR_dp(DisasContext *s, arg_VRINTR_sp *a) | ||
133 | +static bool trans_VRINTR_dp(DisasContext *s, arg_VRINTR_dp *a) | ||
134 | { | ||
135 | TCGv_ptr fpst; | ||
136 | TCGv_i64 tmp; | ||
137 | @@ -XXX,XX +XXX,XX @@ static bool trans_VRINTZ_sp(DisasContext *s, arg_VRINTZ_sp *a) | ||
138 | return true; | ||
139 | } | ||
140 | |||
141 | -static bool trans_VRINTZ_dp(DisasContext *s, arg_VRINTZ_sp *a) | ||
142 | +static bool trans_VRINTZ_dp(DisasContext *s, arg_VRINTZ_dp *a) | ||
143 | { | ||
144 | TCGv_ptr fpst; | ||
145 | TCGv_i64 tmp; | ||
59 | -- | 146 | -- |
60 | 2.20.1 | 147 | 2.20.1 |
61 | 148 | ||
62 | 149 | diff view generated by jsdifflib |
1 | From: Guenter Roeck <linux@roeck-us.net> | 1 | The architecture permits FPUs which have only single-precision |
---|---|---|---|
2 | 2 | support, not double-precision; Cortex-M4 and Cortex-M33 are | |
3 | QEMU already supports pl330. Instantiate it for Exynos4210. | 3 | both like that. Add the necessary checks on the MVFR0 FPDP |
4 | 4 | field so that we UNDEF any double-precision instructions on | |
5 | Relevant part of Linux arch/arm/boot/dts/exynos4.dtsi: | 5 | CPUs like this. |
6 | 6 | ||
7 | / { | 7 | Note that even if FPDP==0 the insns like VMOV-to/from-gpreg, |
8 | soc: soc { | 8 | VLDM/VSTM, VLDR/VSTR which take double precision registers |
9 | amba { | 9 | still exist. |
10 | pdma0: pdma@12680000 { | 10 | |
11 | compatible = "arm,pl330", "arm,primecell"; | ||
12 | reg = <0x12680000 0x1000>; | ||
13 | interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; | ||
14 | clocks = <&clock CLK_PDMA0>; | ||
15 | clock-names = "apb_pclk"; | ||
16 | #dma-cells = <1>; | ||
17 | #dma-channels = <8>; | ||
18 | #dma-requests = <32>; | ||
19 | }; | ||
20 | pdma1: pdma@12690000 { | ||
21 | compatible = "arm,pl330", "arm,primecell"; | ||
22 | reg = <0x12690000 0x1000>; | ||
23 | interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>; | ||
24 | clocks = <&clock CLK_PDMA1>; | ||
25 | clock-names = "apb_pclk"; | ||
26 | #dma-cells = <1>; | ||
27 | #dma-channels = <8>; | ||
28 | #dma-requests = <32>; | ||
29 | }; | ||
30 | mdma1: mdma@12850000 { | ||
31 | compatible = "arm,pl330", "arm,primecell"; | ||
32 | reg = <0x12850000 0x1000>; | ||
33 | interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>; | ||
34 | clocks = <&clock CLK_MDMA>; | ||
35 | clock-names = "apb_pclk"; | ||
36 | #dma-cells = <1>; | ||
37 | #dma-channels = <8>; | ||
38 | #dma-requests = <1>; | ||
39 | }; | ||
40 | }; | ||
41 | }; | ||
42 | }; | ||
43 | |||
44 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | ||
45 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
46 | Reviewed-by: Alistair Francis <alistair.francis@wdc.com> | ||
47 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
48 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
49 | Message-id: 20190520214342.13709-4-philmd@redhat.com | ||
50 | [PMD: Do not set default qdev properties, create the controllers in the SoC | ||
51 | rather than the board (Peter Maydell), add dtsi in commit message] | ||
52 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
53 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
54 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | 11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> |
12 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
13 | Message-id: 20190614104457.24703-3-peter.maydell@linaro.org | ||
55 | --- | 14 | --- |
56 | hw/arm/exynos4210.c | 26 ++++++++++++++++++++++++++ | 15 | target/arm/cpu.h | 6 +++ |
57 | 1 file changed, 26 insertions(+) | 16 | target/arm/translate-vfp.inc.c | 84 ++++++++++++++++++++++++++++++++++ |
58 | 17 | 2 files changed, 90 insertions(+) | |
59 | diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c | 18 | |
19 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
60 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
61 | --- a/hw/arm/exynos4210.c | 21 | --- a/target/arm/cpu.h |
62 | +++ b/hw/arm/exynos4210.c | 22 | +++ b/target/arm/cpu.h |
63 | @@ -XXX,XX +XXX,XX @@ | 23 | @@ -XXX,XX +XXX,XX @@ static inline bool isar_feature_aa32_fpshvec(const ARMISARegisters *id) |
64 | /* EHCI */ | 24 | return FIELD_EX64(id->mvfr0, MVFR0, FPSHVEC) > 0; |
65 | #define EXYNOS4210_EHCI_BASE_ADDR 0x12580000 | ||
66 | |||
67 | +/* DMA */ | ||
68 | +#define EXYNOS4210_PL330_BASE0_ADDR 0x12680000 | ||
69 | +#define EXYNOS4210_PL330_BASE1_ADDR 0x12690000 | ||
70 | +#define EXYNOS4210_PL330_BASE2_ADDR 0x12850000 | ||
71 | + | ||
72 | static uint8_t chipid_and_omr[] = { 0x11, 0x02, 0x21, 0x43, | ||
73 | 0x09, 0x00, 0x00, 0x00 }; | ||
74 | |||
75 | @@ -XXX,XX +XXX,XX @@ static uint64_t exynos4210_calc_affinity(int cpu) | ||
76 | return (0x9 << ARM_AFF1_SHIFT) | cpu; | ||
77 | } | 25 | } |
78 | 26 | ||
79 | +static void pl330_create(uint32_t base, qemu_irq irq, int nreq) | 27 | +static inline bool isar_feature_aa32_fpdp(const ARMISARegisters *id) |
80 | +{ | 28 | +{ |
81 | + SysBusDevice *busdev; | 29 | + /* Return true if CPU supports double precision floating point */ |
82 | + DeviceState *dev; | 30 | + return FIELD_EX64(id->mvfr0, MVFR0, FPDP) > 0; |
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 | +} | 31 | +} |
91 | + | 32 | + |
92 | Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | 33 | /* |
93 | { | 34 | * We always set the FP and SIMD FP16 fields to indicate identical |
94 | Exynos4210State *s = g_new0(Exynos4210State, 1); | 35 | * levels of support (assuming SIMD is implemented at all), so |
95 | @@ -XXX,XX +XXX,XX @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem) | 36 | diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c |
96 | sysbus_create_simple(TYPE_EXYNOS4210_EHCI, EXYNOS4210_EHCI_BASE_ADDR, | 37 | index XXXXXXX..XXXXXXX 100644 |
97 | s->irq_table[exynos4210_get_irq(28, 3)]); | 38 | --- a/target/arm/translate-vfp.inc.c |
98 | 39 | +++ b/target/arm/translate-vfp.inc.c | |
99 | + /*** DMA controllers ***/ | 40 | @@ -XXX,XX +XXX,XX @@ static bool trans_VSEL(DisasContext *s, arg_VSEL *a) |
100 | + pl330_create(EXYNOS4210_PL330_BASE0_ADDR, | 41 | ((a->vm | a->vn | a->vd) & 0x10)) { |
101 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(35, 1)]), 32); | 42 | return false; |
102 | + pl330_create(EXYNOS4210_PL330_BASE1_ADDR, | 43 | } |
103 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(36, 1)]), 32); | 44 | + |
104 | + pl330_create(EXYNOS4210_PL330_BASE2_ADDR, | 45 | + if (dp && !dc_isar_feature(aa32_fpdp, s)) { |
105 | + qemu_irq_invert(s->irq_table[exynos4210_get_irq(34, 1)]), 1); | 46 | + return false; |
106 | + | 47 | + } |
107 | return s; | 48 | + |
108 | } | 49 | rd = a->vd; |
50 | rn = a->vn; | ||
51 | rm = a->vm; | ||
52 | @@ -XXX,XX +XXX,XX @@ static bool trans_VMINMAXNM(DisasContext *s, arg_VMINMAXNM *a) | ||
53 | ((a->vm | a->vn | a->vd) & 0x10)) { | ||
54 | return false; | ||
55 | } | ||
56 | + | ||
57 | + if (dp && !dc_isar_feature(aa32_fpdp, s)) { | ||
58 | + return false; | ||
59 | + } | ||
60 | + | ||
61 | rd = a->vd; | ||
62 | rn = a->vn; | ||
63 | rm = a->vm; | ||
64 | @@ -XXX,XX +XXX,XX @@ static bool trans_VRINT(DisasContext *s, arg_VRINT *a) | ||
65 | ((a->vm | a->vd) & 0x10)) { | ||
66 | return false; | ||
67 | } | ||
68 | + | ||
69 | + if (dp && !dc_isar_feature(aa32_fpdp, s)) { | ||
70 | + return false; | ||
71 | + } | ||
72 | + | ||
73 | rd = a->vd; | ||
74 | rm = a->vm; | ||
75 | |||
76 | @@ -XXX,XX +XXX,XX @@ static bool trans_VCVT(DisasContext *s, arg_VCVT *a) | ||
77 | if (dp && !dc_isar_feature(aa32_fp_d32, s) && (a->vm & 0x10)) { | ||
78 | return false; | ||
79 | } | ||
80 | + | ||
81 | + if (dp && !dc_isar_feature(aa32_fpdp, s)) { | ||
82 | + return false; | ||
83 | + } | ||
84 | + | ||
85 | rd = a->vd; | ||
86 | rm = a->vm; | ||
87 | |||
88 | @@ -XXX,XX +XXX,XX @@ static bool do_vfp_3op_dp(DisasContext *s, VFPGen3OpDPFn *fn, | ||
89 | return false; | ||
90 | } | ||
91 | |||
92 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
93 | + return false; | ||
94 | + } | ||
95 | + | ||
96 | if (!dc_isar_feature(aa32_fpshvec, s) && | ||
97 | (veclen != 0 || s->vec_stride != 0)) { | ||
98 | return false; | ||
99 | @@ -XXX,XX +XXX,XX @@ static bool do_vfp_2op_dp(DisasContext *s, VFPGen2OpDPFn *fn, int vd, int vm) | ||
100 | return false; | ||
101 | } | ||
102 | |||
103 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
104 | + return false; | ||
105 | + } | ||
106 | + | ||
107 | if (!dc_isar_feature(aa32_fpshvec, s) && | ||
108 | (veclen != 0 || s->vec_stride != 0)) { | ||
109 | return false; | ||
110 | @@ -XXX,XX +XXX,XX @@ static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp *a) | ||
111 | return false; | ||
112 | } | ||
113 | |||
114 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
115 | + return false; | ||
116 | + } | ||
117 | + | ||
118 | if (!vfp_access_check(s)) { | ||
119 | return true; | ||
120 | } | ||
121 | @@ -XXX,XX +XXX,XX @@ static bool trans_VMOV_imm_dp(DisasContext *s, arg_VMOV_imm_dp *a) | ||
122 | return false; | ||
123 | } | ||
124 | |||
125 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
126 | + return false; | ||
127 | + } | ||
128 | + | ||
129 | if (!dc_isar_feature(aa32_fpshvec, s) && | ||
130 | (veclen != 0 || s->vec_stride != 0)) { | ||
131 | return false; | ||
132 | @@ -XXX,XX +XXX,XX @@ static bool trans_VCMP_dp(DisasContext *s, arg_VCMP_dp *a) | ||
133 | return false; | ||
134 | } | ||
135 | |||
136 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
137 | + return false; | ||
138 | + } | ||
139 | + | ||
140 | if (!vfp_access_check(s)) { | ||
141 | return true; | ||
142 | } | ||
143 | @@ -XXX,XX +XXX,XX @@ static bool trans_VCVT_f64_f16(DisasContext *s, arg_VCVT_f64_f16 *a) | ||
144 | return false; | ||
145 | } | ||
146 | |||
147 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
148 | + return false; | ||
149 | + } | ||
150 | + | ||
151 | if (!vfp_access_check(s)) { | ||
152 | return true; | ||
153 | } | ||
154 | @@ -XXX,XX +XXX,XX @@ static bool trans_VCVT_f16_f64(DisasContext *s, arg_VCVT_f16_f64 *a) | ||
155 | return false; | ||
156 | } | ||
157 | |||
158 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
159 | + return false; | ||
160 | + } | ||
161 | + | ||
162 | if (!vfp_access_check(s)) { | ||
163 | return true; | ||
164 | } | ||
165 | @@ -XXX,XX +XXX,XX @@ static bool trans_VRINTR_dp(DisasContext *s, arg_VRINTR_dp *a) | ||
166 | return false; | ||
167 | } | ||
168 | |||
169 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
170 | + return false; | ||
171 | + } | ||
172 | + | ||
173 | if (!vfp_access_check(s)) { | ||
174 | return true; | ||
175 | } | ||
176 | @@ -XXX,XX +XXX,XX @@ static bool trans_VRINTZ_dp(DisasContext *s, arg_VRINTZ_dp *a) | ||
177 | return false; | ||
178 | } | ||
179 | |||
180 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
181 | + return false; | ||
182 | + } | ||
183 | + | ||
184 | if (!vfp_access_check(s)) { | ||
185 | return true; | ||
186 | } | ||
187 | @@ -XXX,XX +XXX,XX @@ static bool trans_VRINTX_dp(DisasContext *s, arg_VRINTX_dp *a) | ||
188 | return false; | ||
189 | } | ||
190 | |||
191 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
192 | + return false; | ||
193 | + } | ||
194 | + | ||
195 | if (!vfp_access_check(s)) { | ||
196 | return true; | ||
197 | } | ||
198 | @@ -XXX,XX +XXX,XX @@ static bool trans_VCVT_sp(DisasContext *s, arg_VCVT_sp *a) | ||
199 | return false; | ||
200 | } | ||
201 | |||
202 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
203 | + return false; | ||
204 | + } | ||
205 | + | ||
206 | if (!vfp_access_check(s)) { | ||
207 | return true; | ||
208 | } | ||
209 | @@ -XXX,XX +XXX,XX @@ static bool trans_VCVT_dp(DisasContext *s, arg_VCVT_dp *a) | ||
210 | return false; | ||
211 | } | ||
212 | |||
213 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
214 | + return false; | ||
215 | + } | ||
216 | + | ||
217 | if (!vfp_access_check(s)) { | ||
218 | return true; | ||
219 | } | ||
220 | @@ -XXX,XX +XXX,XX @@ static bool trans_VCVT_int_dp(DisasContext *s, arg_VCVT_int_dp *a) | ||
221 | return false; | ||
222 | } | ||
223 | |||
224 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
225 | + return false; | ||
226 | + } | ||
227 | + | ||
228 | if (!vfp_access_check(s)) { | ||
229 | return true; | ||
230 | } | ||
231 | @@ -XXX,XX +XXX,XX @@ static bool trans_VJCVT(DisasContext *s, arg_VJCVT *a) | ||
232 | return false; | ||
233 | } | ||
234 | |||
235 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
236 | + return false; | ||
237 | + } | ||
238 | + | ||
239 | if (!vfp_access_check(s)) { | ||
240 | return true; | ||
241 | } | ||
242 | @@ -XXX,XX +XXX,XX @@ static bool trans_VCVT_fix_dp(DisasContext *s, arg_VCVT_fix_dp *a) | ||
243 | return false; | ||
244 | } | ||
245 | |||
246 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
247 | + return false; | ||
248 | + } | ||
249 | + | ||
250 | if (!vfp_access_check(s)) { | ||
251 | return true; | ||
252 | } | ||
253 | @@ -XXX,XX +XXX,XX @@ static bool trans_VCVT_dp_int(DisasContext *s, arg_VCVT_dp_int *a) | ||
254 | return false; | ||
255 | } | ||
256 | |||
257 | + if (!dc_isar_feature(aa32_fpdp, s)) { | ||
258 | + return false; | ||
259 | + } | ||
260 | + | ||
261 | if (!vfp_access_check(s)) { | ||
262 | return true; | ||
263 | } | ||
109 | -- | 264 | -- |
110 | 2.20.1 | 265 | 2.20.1 |
111 | 266 | ||
112 | 267 | diff view generated by jsdifflib |