1 | A last arm pullreq before rc0. This is mostly bug fixes, | 1 | v2: drop pvpanic-pci patches. |
---|---|---|---|
2 | though you could call adding the missing local timer | ||
3 | support to bcm2836_control a new feature I suppose -- | ||
4 | in any case it's a small and localised change. | ||
5 | 2 | ||
6 | thanks | 3 | The following changes since commit f1fcb6851aba6dd9838886dc179717a11e344a1c: |
7 | -- PMM | ||
8 | 4 | ||
9 | The following changes since commit 7074ab12c81a1b2b1e0e1c40983f56b2c5ccc494: | 5 | Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2021-01-19' into staging (2021-01-19 11:57:07 +0000) |
10 | |||
11 | Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-pull-request' into staging (2019-03-14 16:19:37 +0000) | ||
12 | 6 | ||
13 | are available in the Git repository at: | 7 | are available in the Git repository at: |
14 | 8 | ||
15 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190315 | 9 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20210119-1 |
16 | 10 | ||
17 | for you to fetch changes up to 5de56742a3c91de3d646326bec43a989bba83ca4: | 11 | for you to fetch changes up to b93f4fbdc48283a39089469c44a5529d79dc40a8: |
18 | 12 | ||
19 | target/arm: Check access permission to ADDVL/ADDPL/RDVL (2019-03-15 11:12:29 +0000) | 13 | docs: Build and install all the docs in a single manual (2021-01-19 15:45:14 +0000) |
20 | 14 | ||
21 | ---------------------------------------------------------------- | 15 | ---------------------------------------------------------------- |
22 | target-arm queue: | 16 | target-arm queue: |
23 | * Add missing SVE-enabled check to ADDVL/ADDPL/RDVL | 17 | * Implement IMPDEF pauth algorithm |
24 | * virt-acpi-build: use PCIE_MMCFG_BUS to retrieve end_bus_number | 18 | * Support ARMv8.4-SEL2 |
25 | * virt-acpi-build: Fix SMMUv3 GSIV values | 19 | * Fix bug where we were truncating predicate vector lengths in SVE insns |
26 | * Allow EL0 to write to arch timer registers, not just read them | 20 | * npcm7xx_adc-test: Fix memleak in adc_qom_set |
27 | * bcm2836_control: Implement local timer | 21 | * target/arm/m_helper: Silence GCC 10 maybe-uninitialized error |
22 | * docs: Build and install all the docs in a single manual | ||
28 | 23 | ||
29 | ---------------------------------------------------------------- | 24 | ---------------------------------------------------------------- |
30 | Amir Charif (1): | 25 | Gan Qixin (1): |
31 | target/arm: Check access permission to ADDVL/ADDPL/RDVL | 26 | npcm7xx_adc-test: Fix memleak in adc_qom_set |
32 | 27 | ||
33 | Dongjiu Geng (1): | 28 | Peter Maydell (1): |
34 | target/arm: change arch timer registers access permission | 29 | docs: Build and install all the docs in a single manual |
35 | 30 | ||
36 | Eric Auger (1): | 31 | Philippe Mathieu-Daudé (1): |
37 | hw/arm/virt-acpi-build: Fix SMMUv3 GSIV values | 32 | target/arm/m_helper: Silence GCC 10 maybe-uninitialized error |
38 | 33 | ||
39 | Wei Yang (1): | 34 | Richard Henderson (7): |
40 | hw/arm/virt-acpi-build: use PCIE_MMCFG_BUS to retrieve end_bus_number | 35 | target/arm: Implement an IMPDEF pauth algorithm |
36 | target/arm: Add cpu properties to control pauth | ||
37 | target/arm: Use object_property_add_bool for "sve" property | ||
38 | target/arm: Introduce PREDDESC field definitions | ||
39 | target/arm: Update PFIRST, PNEXT for pred_desc | ||
40 | target/arm: Update ZIP, UZP, TRN for pred_desc | ||
41 | target/arm: Update REV, PUNPK for pred_desc | ||
41 | 42 | ||
42 | Zoltán Baldaszti (1): | 43 | Rémi Denis-Courmont (19): |
43 | hw/intc/bcm2836_control: Implement local timer | 44 | target/arm: remove redundant tests |
45 | target/arm: add arm_is_el2_enabled() helper | ||
46 | target/arm: use arm_is_el2_enabled() where applicable | ||
47 | target/arm: use arm_hcr_el2_eff() where applicable | ||
48 | target/arm: factor MDCR_EL2 common handling | ||
49 | target/arm: Define isar_feature function to test for presence of SEL2 | ||
50 | target/arm: add 64-bit S-EL2 to EL exception table | ||
51 | target/arm: add MMU stage 1 for Secure EL2 | ||
52 | target/arm: add ARMv8.4-SEL2 system registers | ||
53 | target/arm: handle VMID change in secure state | ||
54 | target/arm: do S1_ptw_translate() before address space lookup | ||
55 | target/arm: translate NS bit in page-walks | ||
56 | target/arm: generalize 2-stage page-walk condition | ||
57 | target/arm: secure stage 2 translation regime | ||
58 | target/arm: set HPFAR_EL2.NS on secure stage 2 faults | ||
59 | target/arm: revector to run-time pick target EL | ||
60 | target/arm: Implement SCR_EL2.EEL2 | ||
61 | target/arm: enable Secure EL2 in max CPU | ||
62 | target/arm: refactor vae1_tlbmask() | ||
44 | 63 | ||
45 | include/hw/intc/bcm2836_control.h | 9 ++++ | 64 | docs/conf.py | 46 ++++- |
46 | hw/arm/virt-acpi-build.c | 6 +-- | 65 | docs/devel/conf.py | 15 -- |
47 | hw/intc/bcm2836_control.c | 101 +++++++++++++++++++++++++++++++++++++- | 66 | docs/index.html.in | 17 -- |
48 | target/arm/helper.c | 30 +++++------ | 67 | docs/interop/conf.py | 28 --- |
49 | target/arm/translate-sve.c | 22 ++++++--- | 68 | docs/meson.build | 64 +++--- |
50 | 5 files changed, 140 insertions(+), 28 deletions(-) | 69 | docs/specs/conf.py | 16 -- |
70 | docs/system/arm/cpu-features.rst | 21 ++ | ||
71 | docs/system/conf.py | 28 --- | ||
72 | docs/tools/conf.py | 37 ---- | ||
73 | docs/user/conf.py | 15 -- | ||
74 | include/qemu/xxhash.h | 98 +++++++++ | ||
75 | target/arm/cpu-param.h | 2 +- | ||
76 | target/arm/cpu.h | 107 ++++++++-- | ||
77 | target/arm/internals.h | 45 +++++ | ||
78 | target/arm/cpu.c | 23 ++- | ||
79 | target/arm/cpu64.c | 65 ++++-- | ||
80 | target/arm/helper-a64.c | 8 +- | ||
81 | target/arm/helper.c | 414 ++++++++++++++++++++++++++------------- | ||
82 | target/arm/m_helper.c | 2 +- | ||
83 | target/arm/monitor.c | 1 + | ||
84 | target/arm/op_helper.c | 4 +- | ||
85 | target/arm/pauth_helper.c | 27 ++- | ||
86 | target/arm/sve_helper.c | 33 ++-- | ||
87 | target/arm/tlb_helper.c | 3 + | ||
88 | target/arm/translate-a64.c | 4 + | ||
89 | target/arm/translate-sve.c | 31 ++- | ||
90 | target/arm/translate.c | 36 +++- | ||
91 | tests/qtest/arm-cpu-features.c | 13 ++ | ||
92 | tests/qtest/npcm7xx_adc-test.c | 1 + | ||
93 | .gitlab-ci.yml | 4 +- | ||
94 | 30 files changed, 770 insertions(+), 438 deletions(-) | ||
95 | delete mode 100644 docs/devel/conf.py | ||
96 | delete mode 100644 docs/index.html.in | ||
97 | delete mode 100644 docs/interop/conf.py | ||
98 | delete mode 100644 docs/specs/conf.py | ||
99 | delete mode 100644 docs/system/conf.py | ||
100 | delete mode 100644 docs/tools/conf.py | ||
101 | delete mode 100644 docs/user/conf.py | ||
51 | 102 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Zoltán Baldaszti <bztemail@gmail.com> | ||
2 | 1 | ||
3 | The BCM2836 control logic module includes a simple | ||
4 | "local timer" which is a programmable down-counter that | ||
5 | can generates an interrupt. Implement this functionality. | ||
6 | |||
7 | Signed-off-by: Zoltán Baldaszti <bztemail@gmail.com> | ||
8 | [PMM: wrote commit message; wrapped long line; tweaked | ||
9 | some comments to match the final version of the code] | ||
10 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | --- | ||
13 | include/hw/intc/bcm2836_control.h | 9 +++ | ||
14 | hw/intc/bcm2836_control.c | 101 +++++++++++++++++++++++++++++- | ||
15 | 2 files changed, 108 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/include/hw/intc/bcm2836_control.h b/include/hw/intc/bcm2836_control.h | ||
18 | index XXXXXXX..XXXXXXX 100644 | ||
19 | --- a/include/hw/intc/bcm2836_control.h | ||
20 | +++ b/include/hw/intc/bcm2836_control.h | ||
21 | @@ -XXX,XX +XXX,XX @@ | ||
22 | * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft | ||
23 | * Written by Andrew Baumann | ||
24 | * | ||
25 | + * ARM Local Timer IRQ Copyright (c) 2019. Zoltán Baldaszti | ||
26 | + * Added basic IRQ_TIMER interrupt support | ||
27 | + * | ||
28 | * This code is licensed under the GNU GPLv2 and later. | ||
29 | */ | ||
30 | |||
31 | @@ -XXX,XX +XXX,XX @@ | ||
32 | #define BCM2836_CONTROL_H | ||
33 | |||
34 | #include "hw/sysbus.h" | ||
35 | +#include "qemu/timer.h" | ||
36 | |||
37 | /* 4 mailboxes per core, for 16 total */ | ||
38 | #define BCM2836_NCORES 4 | ||
39 | @@ -XXX,XX +XXX,XX @@ typedef struct BCM2836ControlState { | ||
40 | bool gpu_irq, gpu_fiq; | ||
41 | uint8_t timerirqs[BCM2836_NCORES]; | ||
42 | |||
43 | + /* local timer */ | ||
44 | + QEMUTimer timer; | ||
45 | + uint32_t local_timer_control; | ||
46 | + uint8_t route_localtimer; | ||
47 | + | ||
48 | /* interrupt source registers, post-routing (also input-derived; visible) */ | ||
49 | uint32_t irqsrc[BCM2836_NCORES]; | ||
50 | uint32_t fiqsrc[BCM2836_NCORES]; | ||
51 | diff --git a/hw/intc/bcm2836_control.c b/hw/intc/bcm2836_control.c | ||
52 | index XXXXXXX..XXXXXXX 100644 | ||
53 | --- a/hw/intc/bcm2836_control.c | ||
54 | +++ b/hw/intc/bcm2836_control.c | ||
55 | @@ -XXX,XX +XXX,XX @@ | ||
56 | * This code is licensed under the GNU GPLv2 and later. | ||
57 | * | ||
58 | * At present, only implements interrupt routing, and mailboxes (i.e., | ||
59 | - * not local timer, PMU interrupt, or AXI counters). | ||
60 | + * not PMU interrupt, or AXI counters). | ||
61 | + * | ||
62 | + * ARM Local Timer IRQ Copyright (c) 2019. Zoltán Baldaszti | ||
63 | * | ||
64 | * Ref: | ||
65 | * https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2836/QA7_rev3.4.pdf | ||
66 | @@ -XXX,XX +XXX,XX @@ | ||
67 | #include "qemu/log.h" | ||
68 | |||
69 | #define REG_GPU_ROUTE 0x0c | ||
70 | +#define REG_LOCALTIMERROUTING 0x24 | ||
71 | +#define REG_LOCALTIMERCONTROL 0x34 | ||
72 | +#define REG_LOCALTIMERACK 0x38 | ||
73 | #define REG_TIMERCONTROL 0x40 | ||
74 | #define REG_MBOXCONTROL 0x50 | ||
75 | #define REG_IRQSRC 0x60 | ||
76 | @@ -XXX,XX +XXX,XX @@ | ||
77 | #define IRQ_TIMER 11 | ||
78 | #define IRQ_MAX IRQ_TIMER | ||
79 | |||
80 | +#define LOCALTIMER_FREQ 38400000 | ||
81 | +#define LOCALTIMER_INTFLAG (1 << 31) | ||
82 | +#define LOCALTIMER_RELOAD (1 << 30) | ||
83 | +#define LOCALTIMER_INTENABLE (1 << 29) | ||
84 | +#define LOCALTIMER_ENABLE (1 << 28) | ||
85 | +#define LOCALTIMER_VALUE(x) ((x) & 0xfffffff) | ||
86 | + | ||
87 | static void deliver_local(BCM2836ControlState *s, uint8_t core, uint8_t irq, | ||
88 | uint32_t controlreg, uint8_t controlidx) | ||
89 | { | ||
90 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_control_update(BCM2836ControlState *s) | ||
91 | s->fiqsrc[s->route_gpu_fiq] |= (uint32_t)1 << IRQ_GPU; | ||
92 | } | ||
93 | |||
94 | + /* | ||
95 | + * handle the control module 'local timer' interrupt for one of the | ||
96 | + * cores' IRQ/FIQ; this is distinct from the per-CPU timer | ||
97 | + * interrupts handled below. | ||
98 | + */ | ||
99 | + if ((s->local_timer_control & LOCALTIMER_INTENABLE) && | ||
100 | + (s->local_timer_control & LOCALTIMER_INTFLAG)) { | ||
101 | + if (s->route_localtimer & 4) { | ||
102 | + s->fiqsrc[(s->route_localtimer & 3)] |= (uint32_t)1 << IRQ_TIMER; | ||
103 | + } else { | ||
104 | + s->irqsrc[(s->route_localtimer & 3)] |= (uint32_t)1 << IRQ_TIMER; | ||
105 | + } | ||
106 | + } | ||
107 | + | ||
108 | for (i = 0; i < BCM2836_NCORES; i++) { | ||
109 | /* handle local timer interrupts for this core */ | ||
110 | if (s->timerirqs[i]) { | ||
111 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_control_set_gpu_fiq(void *opaque, int irq, int level) | ||
112 | bcm2836_control_update(s); | ||
113 | } | ||
114 | |||
115 | +static void bcm2836_control_local_timer_set_next(void *opaque) | ||
116 | +{ | ||
117 | + BCM2836ControlState *s = opaque; | ||
118 | + uint64_t next_event; | ||
119 | + | ||
120 | + assert(LOCALTIMER_VALUE(s->local_timer_control) > 0); | ||
121 | + | ||
122 | + next_event = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + | ||
123 | + muldiv64(LOCALTIMER_VALUE(s->local_timer_control), | ||
124 | + NANOSECONDS_PER_SECOND, LOCALTIMER_FREQ); | ||
125 | + timer_mod(&s->timer, next_event); | ||
126 | +} | ||
127 | + | ||
128 | +static void bcm2836_control_local_timer_tick(void *opaque) | ||
129 | +{ | ||
130 | + BCM2836ControlState *s = opaque; | ||
131 | + | ||
132 | + bcm2836_control_local_timer_set_next(s); | ||
133 | + | ||
134 | + s->local_timer_control |= LOCALTIMER_INTFLAG; | ||
135 | + bcm2836_control_update(s); | ||
136 | +} | ||
137 | + | ||
138 | +static void bcm2836_control_local_timer_control(void *opaque, uint32_t val) | ||
139 | +{ | ||
140 | + BCM2836ControlState *s = opaque; | ||
141 | + | ||
142 | + s->local_timer_control = val; | ||
143 | + if (val & LOCALTIMER_ENABLE) { | ||
144 | + bcm2836_control_local_timer_set_next(s); | ||
145 | + } else { | ||
146 | + timer_del(&s->timer); | ||
147 | + } | ||
148 | +} | ||
149 | + | ||
150 | +static void bcm2836_control_local_timer_ack(void *opaque, uint32_t val) | ||
151 | +{ | ||
152 | + BCM2836ControlState *s = opaque; | ||
153 | + | ||
154 | + if (val & LOCALTIMER_INTFLAG) { | ||
155 | + s->local_timer_control &= ~LOCALTIMER_INTFLAG; | ||
156 | + } | ||
157 | + if ((val & LOCALTIMER_RELOAD) && | ||
158 | + (s->local_timer_control & LOCALTIMER_ENABLE)) { | ||
159 | + bcm2836_control_local_timer_set_next(s); | ||
160 | + } | ||
161 | +} | ||
162 | + | ||
163 | static uint64_t bcm2836_control_read(void *opaque, hwaddr offset, unsigned size) | ||
164 | { | ||
165 | BCM2836ControlState *s = opaque; | ||
166 | @@ -XXX,XX +XXX,XX @@ static uint64_t bcm2836_control_read(void *opaque, hwaddr offset, unsigned size) | ||
167 | assert(s->route_gpu_fiq < BCM2836_NCORES | ||
168 | && s->route_gpu_irq < BCM2836_NCORES); | ||
169 | return ((uint32_t)s->route_gpu_fiq << 2) | s->route_gpu_irq; | ||
170 | + } else if (offset == REG_LOCALTIMERROUTING) { | ||
171 | + return s->route_localtimer; | ||
172 | + } else if (offset == REG_LOCALTIMERCONTROL) { | ||
173 | + return s->local_timer_control; | ||
174 | + } else if (offset == REG_LOCALTIMERACK) { | ||
175 | + return 0; | ||
176 | } else if (offset >= REG_TIMERCONTROL && offset < REG_MBOXCONTROL) { | ||
177 | return s->timercontrol[(offset - REG_TIMERCONTROL) >> 2]; | ||
178 | } else if (offset >= REG_MBOXCONTROL && offset < REG_IRQSRC) { | ||
179 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_control_write(void *opaque, hwaddr offset, | ||
180 | if (offset == REG_GPU_ROUTE) { | ||
181 | s->route_gpu_irq = val & 0x3; | ||
182 | s->route_gpu_fiq = (val >> 2) & 0x3; | ||
183 | + } else if (offset == REG_LOCALTIMERROUTING) { | ||
184 | + s->route_localtimer = val & 7; | ||
185 | + } else if (offset == REG_LOCALTIMERCONTROL) { | ||
186 | + bcm2836_control_local_timer_control(s, val); | ||
187 | + } else if (offset == REG_LOCALTIMERACK) { | ||
188 | + bcm2836_control_local_timer_ack(s, val); | ||
189 | } else if (offset >= REG_TIMERCONTROL && offset < REG_MBOXCONTROL) { | ||
190 | s->timercontrol[(offset - REG_TIMERCONTROL) >> 2] = val & 0xff; | ||
191 | } else if (offset >= REG_MBOXCONTROL && offset < REG_IRQSRC) { | ||
192 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_control_reset(DeviceState *d) | ||
193 | |||
194 | s->route_gpu_irq = s->route_gpu_fiq = 0; | ||
195 | |||
196 | + timer_del(&s->timer); | ||
197 | + s->route_localtimer = 0; | ||
198 | + s->local_timer_control = 0; | ||
199 | + | ||
200 | for (i = 0; i < BCM2836_NCORES; i++) { | ||
201 | s->timercontrol[i] = 0; | ||
202 | s->mailboxcontrol[i] = 0; | ||
203 | @@ -XXX,XX +XXX,XX @@ static void bcm2836_control_init(Object *obj) | ||
204 | /* outputs to CPU cores */ | ||
205 | qdev_init_gpio_out_named(dev, s->irq, "irq", BCM2836_NCORES); | ||
206 | qdev_init_gpio_out_named(dev, s->fiq, "fiq", BCM2836_NCORES); | ||
207 | + | ||
208 | + /* create a qemu virtual timer */ | ||
209 | + timer_init_ns(&s->timer, QEMU_CLOCK_VIRTUAL, | ||
210 | + bcm2836_control_local_timer_tick, s); | ||
211 | } | ||
212 | |||
213 | static const VMStateDescription vmstate_bcm2836_control = { | ||
214 | .name = TYPE_BCM2836_CONTROL, | ||
215 | - .version_id = 1, | ||
216 | + .version_id = 2, | ||
217 | .minimum_version_id = 1, | ||
218 | .fields = (VMStateField[]) { | ||
219 | VMSTATE_UINT32_ARRAY(mailboxes, BCM2836ControlState, | ||
220 | @@ -XXX,XX +XXX,XX @@ static const VMStateDescription vmstate_bcm2836_control = { | ||
221 | VMSTATE_UINT32_ARRAY(timercontrol, BCM2836ControlState, BCM2836_NCORES), | ||
222 | VMSTATE_UINT32_ARRAY(mailboxcontrol, BCM2836ControlState, | ||
223 | BCM2836_NCORES), | ||
224 | + VMSTATE_TIMER_V(timer, BCM2836ControlState, 2), | ||
225 | + VMSTATE_UINT32_V(local_timer_control, BCM2836ControlState, 2), | ||
226 | + VMSTATE_UINT8_V(route_localtimer, BCM2836ControlState, 2), | ||
227 | VMSTATE_END_OF_LIST() | ||
228 | } | ||
229 | }; | ||
230 | -- | ||
231 | 2.20.1 | ||
232 | |||
233 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Eric Auger <eric.auger@redhat.com> | ||
2 | 1 | ||
3 | The GSIV numbers of the SPI based interrupts is not correct as | ||
4 | ARM_SPI_BASE was not added to the irqmap[VIRT_SMMU] value. So | ||
5 | this may collide with VIRTIO_MMIO irq window. | ||
6 | |||
7 | Signed-off-by: Eric Auger <eric.auger@redhat.com> | ||
8 | Message-id: 20190312091031.5185-1-eric.auger@redhat.com | ||
9 | Reviewed-by: Shannon Zhao <shannon.zhaosl@gmail.com> | ||
10 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
11 | --- | ||
12 | hw/arm/virt-acpi-build.c | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c | ||
16 | index XXXXXXX..XXXXXXX 100644 | ||
17 | --- a/hw/arm/virt-acpi-build.c | ||
18 | +++ b/hw/arm/virt-acpi-build.c | ||
19 | @@ -XXX,XX +XXX,XX @@ build_iort(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) | ||
20 | its->identifiers[0] = 0; /* MADT translation_id */ | ||
21 | |||
22 | if (vms->iommu == VIRT_IOMMU_SMMUV3) { | ||
23 | - int irq = vms->irqmap[VIRT_SMMU]; | ||
24 | + int irq = vms->irqmap[VIRT_SMMU] + ARM_SPI_BASE; | ||
25 | |||
26 | /* SMMUv3 node */ | ||
27 | smmu_offset = iort_node_offset + node_size; | ||
28 | -- | ||
29 | 2.20.1 | ||
30 | |||
31 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Dongjiu Geng <gengdongjiu@huawei.com> | ||
2 | 1 | ||
3 | Some generic arch timer registers are Config-RW in the EL0, | ||
4 | which means the EL0 exception level can have write permission | ||
5 | if it is appropriately configured. | ||
6 | |||
7 | When VM access registers, QEMU firstly checks whether they have RW | ||
8 | permission, then check whether it is appropriately configured. | ||
9 | If they are defined to read only in EL0, even though they have been | ||
10 | appropriately configured, they still do not have write permission. | ||
11 | So need to add the write permission according to ARMV8 spec when | ||
12 | define it. | ||
13 | |||
14 | Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com> | ||
15 | Message-id: 1552395177-12608-1-git-send-email-gengdongjiu@huawei.com | ||
16 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
17 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
18 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
19 | --- | ||
20 | target/arm/helper.c | 30 +++++++++++++++--------------- | ||
21 | 1 file changed, 15 insertions(+), 15 deletions(-) | ||
22 | |||
23 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
24 | index XXXXXXX..XXXXXXX 100644 | ||
25 | --- a/target/arm/helper.c | ||
26 | +++ b/target/arm/helper.c | ||
27 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo generic_timer_cp_reginfo[] = { | ||
28 | /* per-timer control */ | ||
29 | { .name = "CNTP_CTL", .cp = 15, .crn = 14, .crm = 2, .opc1 = 0, .opc2 = 1, | ||
30 | .secure = ARM_CP_SECSTATE_NS, | ||
31 | - .type = ARM_CP_IO | ARM_CP_ALIAS, .access = PL1_RW | PL0_R, | ||
32 | + .type = ARM_CP_IO | ARM_CP_ALIAS, .access = PL0_RW, | ||
33 | .accessfn = gt_ptimer_access, | ||
34 | .fieldoffset = offsetoflow32(CPUARMState, | ||
35 | cp15.c14_timer[GTIMER_PHYS].ctl), | ||
36 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo generic_timer_cp_reginfo[] = { | ||
37 | { .name = "CNTP_CTL_S", | ||
38 | .cp = 15, .crn = 14, .crm = 2, .opc1 = 0, .opc2 = 1, | ||
39 | .secure = ARM_CP_SECSTATE_S, | ||
40 | - .type = ARM_CP_IO | ARM_CP_ALIAS, .access = PL1_RW | PL0_R, | ||
41 | + .type = ARM_CP_IO | ARM_CP_ALIAS, .access = PL0_RW, | ||
42 | .accessfn = gt_ptimer_access, | ||
43 | .fieldoffset = offsetoflow32(CPUARMState, | ||
44 | cp15.c14_timer[GTIMER_SEC].ctl), | ||
45 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo generic_timer_cp_reginfo[] = { | ||
46 | }, | ||
47 | { .name = "CNTP_CTL_EL0", .state = ARM_CP_STATE_AA64, | ||
48 | .opc0 = 3, .opc1 = 3, .crn = 14, .crm = 2, .opc2 = 1, | ||
49 | - .type = ARM_CP_IO, .access = PL1_RW | PL0_R, | ||
50 | + .type = ARM_CP_IO, .access = PL0_RW, | ||
51 | .accessfn = gt_ptimer_access, | ||
52 | .fieldoffset = offsetof(CPUARMState, cp15.c14_timer[GTIMER_PHYS].ctl), | ||
53 | .resetvalue = 0, | ||
54 | .writefn = gt_phys_ctl_write, .raw_writefn = raw_write, | ||
55 | }, | ||
56 | { .name = "CNTV_CTL", .cp = 15, .crn = 14, .crm = 3, .opc1 = 0, .opc2 = 1, | ||
57 | - .type = ARM_CP_IO | ARM_CP_ALIAS, .access = PL1_RW | PL0_R, | ||
58 | + .type = ARM_CP_IO | ARM_CP_ALIAS, .access = PL0_RW, | ||
59 | .accessfn = gt_vtimer_access, | ||
60 | .fieldoffset = offsetoflow32(CPUARMState, | ||
61 | cp15.c14_timer[GTIMER_VIRT].ctl), | ||
62 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo generic_timer_cp_reginfo[] = { | ||
63 | }, | ||
64 | { .name = "CNTV_CTL_EL0", .state = ARM_CP_STATE_AA64, | ||
65 | .opc0 = 3, .opc1 = 3, .crn = 14, .crm = 3, .opc2 = 1, | ||
66 | - .type = ARM_CP_IO, .access = PL1_RW | PL0_R, | ||
67 | + .type = ARM_CP_IO, .access = PL0_RW, | ||
68 | .accessfn = gt_vtimer_access, | ||
69 | .fieldoffset = offsetof(CPUARMState, cp15.c14_timer[GTIMER_VIRT].ctl), | ||
70 | .resetvalue = 0, | ||
71 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo generic_timer_cp_reginfo[] = { | ||
72 | /* TimerValue views: a 32 bit downcounting view of the underlying state */ | ||
73 | { .name = "CNTP_TVAL", .cp = 15, .crn = 14, .crm = 2, .opc1 = 0, .opc2 = 0, | ||
74 | .secure = ARM_CP_SECSTATE_NS, | ||
75 | - .type = ARM_CP_NO_RAW | ARM_CP_IO, .access = PL1_RW | PL0_R, | ||
76 | + .type = ARM_CP_NO_RAW | ARM_CP_IO, .access = PL0_RW, | ||
77 | .accessfn = gt_ptimer_access, | ||
78 | .readfn = gt_phys_tval_read, .writefn = gt_phys_tval_write, | ||
79 | }, | ||
80 | { .name = "CNTP_TVAL_S", | ||
81 | .cp = 15, .crn = 14, .crm = 2, .opc1 = 0, .opc2 = 0, | ||
82 | .secure = ARM_CP_SECSTATE_S, | ||
83 | - .type = ARM_CP_NO_RAW | ARM_CP_IO, .access = PL1_RW | PL0_R, | ||
84 | + .type = ARM_CP_NO_RAW | ARM_CP_IO, .access = PL0_RW, | ||
85 | .accessfn = gt_ptimer_access, | ||
86 | .readfn = gt_sec_tval_read, .writefn = gt_sec_tval_write, | ||
87 | }, | ||
88 | { .name = "CNTP_TVAL_EL0", .state = ARM_CP_STATE_AA64, | ||
89 | .opc0 = 3, .opc1 = 3, .crn = 14, .crm = 2, .opc2 = 0, | ||
90 | - .type = ARM_CP_NO_RAW | ARM_CP_IO, .access = PL1_RW | PL0_R, | ||
91 | + .type = ARM_CP_NO_RAW | ARM_CP_IO, .access = PL0_RW, | ||
92 | .accessfn = gt_ptimer_access, .resetfn = gt_phys_timer_reset, | ||
93 | .readfn = gt_phys_tval_read, .writefn = gt_phys_tval_write, | ||
94 | }, | ||
95 | { .name = "CNTV_TVAL", .cp = 15, .crn = 14, .crm = 3, .opc1 = 0, .opc2 = 0, | ||
96 | - .type = ARM_CP_NO_RAW | ARM_CP_IO, .access = PL1_RW | PL0_R, | ||
97 | + .type = ARM_CP_NO_RAW | ARM_CP_IO, .access = PL0_RW, | ||
98 | .accessfn = gt_vtimer_access, | ||
99 | .readfn = gt_virt_tval_read, .writefn = gt_virt_tval_write, | ||
100 | }, | ||
101 | { .name = "CNTV_TVAL_EL0", .state = ARM_CP_STATE_AA64, | ||
102 | .opc0 = 3, .opc1 = 3, .crn = 14, .crm = 3, .opc2 = 0, | ||
103 | - .type = ARM_CP_NO_RAW | ARM_CP_IO, .access = PL1_RW | PL0_R, | ||
104 | + .type = ARM_CP_NO_RAW | ARM_CP_IO, .access = PL0_RW, | ||
105 | .accessfn = gt_vtimer_access, .resetfn = gt_virt_timer_reset, | ||
106 | .readfn = gt_virt_tval_read, .writefn = gt_virt_tval_write, | ||
107 | }, | ||
108 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo generic_timer_cp_reginfo[] = { | ||
109 | /* Comparison value, indicating when the timer goes off */ | ||
110 | { .name = "CNTP_CVAL", .cp = 15, .crm = 14, .opc1 = 2, | ||
111 | .secure = ARM_CP_SECSTATE_NS, | ||
112 | - .access = PL1_RW | PL0_R, | ||
113 | + .access = PL0_RW, | ||
114 | .type = ARM_CP_64BIT | ARM_CP_IO | ARM_CP_ALIAS, | ||
115 | .fieldoffset = offsetof(CPUARMState, cp15.c14_timer[GTIMER_PHYS].cval), | ||
116 | .accessfn = gt_ptimer_access, | ||
117 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo generic_timer_cp_reginfo[] = { | ||
118 | }, | ||
119 | { .name = "CNTP_CVAL_S", .cp = 15, .crm = 14, .opc1 = 2, | ||
120 | .secure = ARM_CP_SECSTATE_S, | ||
121 | - .access = PL1_RW | PL0_R, | ||
122 | + .access = PL0_RW, | ||
123 | .type = ARM_CP_64BIT | ARM_CP_IO | ARM_CP_ALIAS, | ||
124 | .fieldoffset = offsetof(CPUARMState, cp15.c14_timer[GTIMER_SEC].cval), | ||
125 | .accessfn = gt_ptimer_access, | ||
126 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo generic_timer_cp_reginfo[] = { | ||
127 | }, | ||
128 | { .name = "CNTP_CVAL_EL0", .state = ARM_CP_STATE_AA64, | ||
129 | .opc0 = 3, .opc1 = 3, .crn = 14, .crm = 2, .opc2 = 2, | ||
130 | - .access = PL1_RW | PL0_R, | ||
131 | + .access = PL0_RW, | ||
132 | .type = ARM_CP_IO, | ||
133 | .fieldoffset = offsetof(CPUARMState, cp15.c14_timer[GTIMER_PHYS].cval), | ||
134 | .resetvalue = 0, .accessfn = gt_ptimer_access, | ||
135 | .writefn = gt_phys_cval_write, .raw_writefn = raw_write, | ||
136 | }, | ||
137 | { .name = "CNTV_CVAL", .cp = 15, .crm = 14, .opc1 = 3, | ||
138 | - .access = PL1_RW | PL0_R, | ||
139 | + .access = PL0_RW, | ||
140 | .type = ARM_CP_64BIT | ARM_CP_IO | ARM_CP_ALIAS, | ||
141 | .fieldoffset = offsetof(CPUARMState, cp15.c14_timer[GTIMER_VIRT].cval), | ||
142 | .accessfn = gt_vtimer_access, | ||
143 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo generic_timer_cp_reginfo[] = { | ||
144 | }, | ||
145 | { .name = "CNTV_CVAL_EL0", .state = ARM_CP_STATE_AA64, | ||
146 | .opc0 = 3, .opc1 = 3, .crn = 14, .crm = 3, .opc2 = 2, | ||
147 | - .access = PL1_RW | PL0_R, | ||
148 | + .access = PL0_RW, | ||
149 | .type = ARM_CP_IO, | ||
150 | .fieldoffset = offsetof(CPUARMState, cp15.c14_timer[GTIMER_VIRT].cval), | ||
151 | .resetvalue = 0, .accessfn = gt_vtimer_access, | ||
152 | -- | ||
153 | 2.20.1 | ||
154 | |||
155 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Wei Yang <richardw.yang@linux.intel.com> | ||
2 | 1 | ||
3 | This is more proper to use PCIE_MMCFG_BUS to retrieve end_bus_number. | ||
4 | |||
5 | Signed-off-by: Wei Yang <richardw.yang@linux.intel.com> | ||
6 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
7 | Reviewed-by: Igor Mammedov <imammedo@redhat.com> | ||
8 | Message-id: 20190312074953.16671-1-richardw.yang@linux.intel.com | ||
9 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | --- | ||
11 | hw/arm/virt-acpi-build.c | 4 ++-- | ||
12 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/hw/arm/virt-acpi-build.c | ||
17 | +++ b/hw/arm/virt-acpi-build.c | ||
18 | @@ -XXX,XX +XXX,XX @@ build_mcfg(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) | ||
19 | /* Only a single allocation so no need to play with segments */ | ||
20 | mcfg->allocation[0].pci_segment = cpu_to_le16(0); | ||
21 | mcfg->allocation[0].start_bus_number = 0; | ||
22 | - mcfg->allocation[0].end_bus_number = (memmap[ecam_id].size | ||
23 | - / PCIE_MMCFG_SIZE_MIN) - 1; | ||
24 | + mcfg->allocation[0].end_bus_number = | ||
25 | + PCIE_MMCFG_BUS(memmap[ecam_id].size - 1); | ||
26 | |||
27 | build_header(linker, table_data, (void *)(table_data->data + mcfg_start), | ||
28 | "MCFG", table_data->len - mcfg_start, 1, NULL, NULL); | ||
29 | -- | ||
30 | 2.20.1 | ||
31 | |||
32 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Amir Charif <amir.charif@cea.fr> | ||
2 | 1 | ||
3 | These instructions do not trap when SVE is disabled in EL0, | ||
4 | causing them to be executed with wrong size information. | ||
5 | |||
6 | Signed-off-by: Amir Charif <amir.charif@cea.fr> | ||
7 | Message-id: 1552579248-31025-1-git-send-email-amir.charif@cea.fr | ||
8 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
9 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
10 | [PMM: added 'target/arm' prefix to subject] | ||
11 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | --- | ||
13 | target/arm/translate-sve.c | 22 ++++++++++++++-------- | ||
14 | 1 file changed, 14 insertions(+), 8 deletions(-) | ||
15 | |||
16 | diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c | ||
17 | index XXXXXXX..XXXXXXX 100644 | ||
18 | --- a/target/arm/translate-sve.c | ||
19 | +++ b/target/arm/translate-sve.c | ||
20 | @@ -XXX,XX +XXX,XX @@ static bool trans_INDEX_rr(DisasContext *s, arg_INDEX_rr *a) | ||
21 | |||
22 | static bool trans_ADDVL(DisasContext *s, arg_ADDVL *a) | ||
23 | { | ||
24 | - TCGv_i64 rd = cpu_reg_sp(s, a->rd); | ||
25 | - TCGv_i64 rn = cpu_reg_sp(s, a->rn); | ||
26 | - tcg_gen_addi_i64(rd, rn, a->imm * vec_full_reg_size(s)); | ||
27 | + if (sve_access_check(s)) { | ||
28 | + TCGv_i64 rd = cpu_reg_sp(s, a->rd); | ||
29 | + TCGv_i64 rn = cpu_reg_sp(s, a->rn); | ||
30 | + tcg_gen_addi_i64(rd, rn, a->imm * vec_full_reg_size(s)); | ||
31 | + } | ||
32 | return true; | ||
33 | } | ||
34 | |||
35 | static bool trans_ADDPL(DisasContext *s, arg_ADDPL *a) | ||
36 | { | ||
37 | - TCGv_i64 rd = cpu_reg_sp(s, a->rd); | ||
38 | - TCGv_i64 rn = cpu_reg_sp(s, a->rn); | ||
39 | - tcg_gen_addi_i64(rd, rn, a->imm * pred_full_reg_size(s)); | ||
40 | + if (sve_access_check(s)) { | ||
41 | + TCGv_i64 rd = cpu_reg_sp(s, a->rd); | ||
42 | + TCGv_i64 rn = cpu_reg_sp(s, a->rn); | ||
43 | + tcg_gen_addi_i64(rd, rn, a->imm * pred_full_reg_size(s)); | ||
44 | + } | ||
45 | return true; | ||
46 | } | ||
47 | |||
48 | static bool trans_RDVL(DisasContext *s, arg_RDVL *a) | ||
49 | { | ||
50 | - TCGv_i64 reg = cpu_reg(s, a->rd); | ||
51 | - tcg_gen_movi_i64(reg, a->imm * vec_full_reg_size(s)); | ||
52 | + if (sve_access_check(s)) { | ||
53 | + TCGv_i64 reg = cpu_reg(s, a->rd); | ||
54 | + tcg_gen_movi_i64(reg, a->imm * vec_full_reg_size(s)); | ||
55 | + } | ||
56 | return true; | ||
57 | } | ||
58 | |||
59 | -- | ||
60 | 2.20.1 | ||
61 | |||
62 | diff view generated by jsdifflib |