1 | v2: dropped a couple of cadence_gem changes to ID regs that | 1 | A last arm pullreq before rc0. This is mostly bug fixes, |
---|---|---|---|
2 | caused new clang sanitizer warnings. | 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. | ||
3 | 5 | ||
6 | thanks | ||
4 | -- PMM | 7 | -- PMM |
5 | 8 | ||
6 | The following changes since commit dddb37495b844270088e68e3bf30b764d48d863f: | 9 | The following changes since commit 7074ab12c81a1b2b1e0e1c40983f56b2c5ccc494: |
7 | 10 | ||
8 | Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20181015.0' into staging (2018-10-15 18:44:04 +0100) | 11 | Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-pull-request' into staging (2019-03-14 16:19:37 +0000) |
9 | 12 | ||
10 | are available in the Git repository at: | 13 | are available in the Git repository at: |
11 | 14 | ||
12 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20181016-1 | 15 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190315 |
13 | 16 | ||
14 | for you to fetch changes up to 2ef297af07196c29446556537861f8e7dfeeae7b: | 17 | for you to fetch changes up to 5de56742a3c91de3d646326bec43a989bba83ca4: |
15 | 18 | ||
16 | coccinelle: new inplace-byteswaps.cocci to remove inplace-byteswapping calls (2018-10-16 17:14:55 +0100) | 19 | target/arm: Check access permission to ADDVL/ADDPL/RDVL (2019-03-15 11:12:29 +0000) |
17 | 20 | ||
18 | ---------------------------------------------------------------- | 21 | ---------------------------------------------------------------- |
19 | target-arm queue: | 22 | target-arm queue: |
20 | * hw/arm/virt: add DT property /secure-chosen/stdout-path indicating secure UART | 23 | * Add missing SVE-enabled check to ADDVL/ADDPL/RDVL |
21 | * target/arm: Fix aarch64_sve_change_el wrt EL0 | 24 | * virt-acpi-build: use PCIE_MMCFG_BUS to retrieve end_bus_number |
22 | * target/arm: Define fields of ISAR registers | 25 | * virt-acpi-build: Fix SMMUv3 GSIV values |
23 | * target/arm: Align cortex-r5 id_isar0 | 26 | * Allow EL0 to write to arch timer registers, not just read them |
24 | * target/arm: Fix cortex-a7 id_isar0 | 27 | * bcm2836_control: Implement local timer |
25 | * net/cadence_gem: Fix various bugs, add support for new | ||
26 | features that will be used by the Xilinx Versal board | ||
27 | * target-arm: powerctl: Enable HVC when starting CPUs to EL2 | ||
28 | * target/arm: Add the Cortex-A72 | ||
29 | * target/arm: Mark PMINTENCLR and PMINTENCLR_EL1 accesses as possibly doing IO | ||
30 | * target/arm: Mask PMOVSR writes based on supported counters | ||
31 | * target/arm: Initialize ARMMMUFaultInfo in v7m_stack_read/write | ||
32 | * coccinelle: new inplace-byteswaps.cocci to remove inplace-byteswapping calls | ||
33 | 28 | ||
34 | ---------------------------------------------------------------- | 29 | ---------------------------------------------------------------- |
35 | Aaron Lindsay (2): | 30 | Amir Charif (1): |
36 | target/arm: Mark PMINTENCLR and PMINTENCLR_EL1 accesses as possibly doing IO | 31 | target/arm: Check access permission to ADDVL/ADDPL/RDVL |
37 | target/arm: Mask PMOVSR writes based on supported counters | ||
38 | 32 | ||
39 | Edgar E. Iglesias (8): | 33 | Dongjiu Geng (1): |
40 | net: cadence_gem: Disable TSU feature bit | 34 | target/arm: change arch timer registers access permission |
41 | net: cadence_gem: Use uint32_t for 32bit descriptor words | ||
42 | net: cadence_gem: Add macro with max number of descriptor words | ||
43 | net: cadence_gem: Add support for extended descriptors | ||
44 | net: cadence_gem: Add support for selecting the DMA MemoryRegion | ||
45 | net: cadence_gem: Implement support for 64bit descriptor addresses | ||
46 | target-arm: powerctl: Enable HVC when starting CPUs to EL2 | ||
47 | target/arm: Add the Cortex-A72 | ||
48 | 35 | ||
49 | Jerome Forissier (1): | 36 | Eric Auger (1): |
50 | hw/arm/virt: add DT property /secure-chosen/stdout-path indicating secure UART | 37 | hw/arm/virt-acpi-build: Fix SMMUv3 GSIV values |
51 | 38 | ||
52 | Peter Maydell (2): | 39 | Wei Yang (1): |
53 | target/arm: Initialize ARMMMUFaultInfo in v7m_stack_read/write | 40 | hw/arm/virt-acpi-build: use PCIE_MMCFG_BUS to retrieve end_bus_number |
54 | coccinelle: new inplace-byteswaps.cocci to remove inplace-byteswapping calls | ||
55 | 41 | ||
56 | Richard Henderson (4): | 42 | Zoltán Baldaszti (1): |
57 | target/arm: Fix aarch64_sve_change_el wrt EL0 | 43 | hw/intc/bcm2836_control: Implement local timer |
58 | target/arm: Define fields of ISAR registers | ||
59 | target/arm: Align cortex-r5 id_isar0 | ||
60 | target/arm: Fix cortex-a7 id_isar0 | ||
61 | 44 | ||
62 | include/hw/net/cadence_gem.h | 7 +- | 45 | include/hw/intc/bcm2836_control.h | 9 ++++ |
63 | target/arm/cpu.h | 95 ++++++++++++++- | 46 | hw/arm/virt-acpi-build.c | 6 +-- |
64 | hw/arm/virt.c | 4 + | 47 | hw/intc/bcm2836_control.c | 101 +++++++++++++++++++++++++++++++++++++- |
65 | hw/net/cadence_gem.c | 185 ++++++++++++++++++++--------- | 48 | target/arm/helper.c | 30 +++++------ |
66 | target/arm/arm-powerctl.c | 10 ++ | 49 | target/arm/translate-sve.c | 22 ++++++--- |
67 | target/arm/cpu.c | 7 +- | 50 | 5 files changed, 140 insertions(+), 28 deletions(-) |
68 | target/arm/cpu64.c | 66 +++++++++- | ||
69 | target/arm/helper.c | 27 +++-- | ||
70 | target/arm/op_helper.c | 6 +- | ||
71 | scripts/coccinelle/inplace-byteswaps.cocci | 65 ++++++++++ | ||
72 | 10 files changed, 402 insertions(+), 70 deletions(-) | ||
73 | create mode 100644 scripts/coccinelle/inplace-byteswaps.cocci | ||
74 | 51 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | 1 | From: Zoltán Baldaszti <bztemail@gmail.com> | |
2 | |||
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 |
New patch | |||
---|---|---|---|
1 | From: Eric Auger <eric.auger@redhat.com> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Dongjiu Geng <gengdongjiu@huawei.com> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Wei Yang <richardw.yang@linux.intel.com> | ||
1 | 2 | ||
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 |
New patch | |||
---|---|---|---|
1 | From: Amir Charif <amir.charif@cea.fr> | ||
1 | 2 | ||
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 |