1
ARM queue: nothing particularly exciting, but 18 patches
1
target-arm queue for rc1 -- these are all bug fixes.
2
is enough to send out.
3
2
4
thanks
3
thanks
5
-- PMM
4
-- PMM
6
5
7
The following changes since commit 3dabde1128b671f36ac6cb36b97b273139964420:
6
The following changes since commit b9404bf592e7ba74180e1a54ed7a266ec6ee67f2:
8
7
9
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-hmp-20170914' into staging (2017-09-14 16:33:02 +0100)
8
Merge remote-tracking branch 'remotes/dgilbert/tags/pull-hmp-20190715' into staging (2019-07-15 12:22:07 +0100)
10
9
11
are available in the git repository at:
10
are available in the Git repository at:
12
11
13
git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20170914
12
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20190715
14
13
15
for you to fetch changes up to ce3bc112cdb1d462e2d52eaa17a7314e7f3af504:
14
for you to fetch changes up to 51c9122e92b776a3f16af0b9282f1dc5012e2a19:
16
15
17
mps2-an511: Fix wiring of UART overflow interrupt lines (2017-09-14 18:43:19 +0100)
16
target/arm: NS BusFault on vector table fetch escalates to NS HardFault (2019-07-15 14:17:04 +0100)
18
17
19
----------------------------------------------------------------
18
----------------------------------------------------------------
20
target-arm queue:
19
target-arm queue:
21
* v7M: various code cleanups
20
* report ARMv8-A FP support for AArch32 -cpu max
22
* v7M: set correct BFSR bits on bus fault
21
* hw/ssi/xilinx_spips: Avoid AXI writes to the LQSPI linear memory
23
* v7M: clear exclusive monitor on reset and exception entry/exit
22
* hw/ssi/xilinx_spips: Avoid out-of-bound access to lqspi_buf[]
24
* v7M: don't apply priority mask to negative priorities
23
* hw/ssi/mss-spi: Avoid crash when reading empty RX FIFO
25
* zcu102: support 'secure' and 'virtualization' machine properties
24
* hw/display/xlnx_dp: Avoid crash when reading empty RX FIFO
26
* aarch64: fix ERET single stepping
25
* hw/arm/virt: Fix non-secure flash mode
27
* gpex: implement PCI INTx routing
26
* pl031: Correctly migrate state when using -rtc clock=host
28
* mps2-an511: fix UART overflow interrupt line wiring
27
* fix regression that meant arm926 and arm1026 lost VFP
28
double-precision support
29
* v8M: NS BusFault on vector table fetch escalates to NS HardFault
29
30
30
----------------------------------------------------------------
31
----------------------------------------------------------------
31
Alistair Francis (5):
32
Alex Bennée (1):
32
xlnx-ep108: Rename to ZCU102
33
target/arm: report ARMv8-A FP support for AArch32 -cpu max
33
xlnx-zcu102: Manually create the machines
34
xlnx-zcu102: Add a machine level secure property
35
xlnx-zcu102: Add a machine level virtualization property
36
xlnx-zcu102: Mark the EP108 machine as deprecated
37
34
38
Jaroslaw Pelczar (1):
35
David Engraf (1):
39
AArch64: Fix single stepping of ERET instruction
36
hw/arm/virt: Fix non-secure flash mode
40
37
41
Peter Maydell (8):
38
Peter Maydell (3):
42
target/arm: Use M_REG_NUM_BANKS rather than hardcoding 2
39
pl031: Correctly migrate state when using -rtc clock=host
43
target/arm: Clear exclusive monitor on v7M reset, exception entry/exit
40
target/arm: Set VFP-related MVFR0 fields for arm926 and arm1026
44
target/arm: Get PRECISERR and IBUSERR the right way round
41
target/arm: NS BusFault on vector table fetch escalates to NS HardFault
45
nvic: Don't apply group priority mask to negative priorities
46
target/arm: Remove unnecessary '| 0xf0000000' from do_v7m_exception_exit()
47
target/arm: Add and use defines for EXCRET constants
48
target/arm: Rename 'type' to 'excret' in do_v7m_exception_exit()
49
mps2-an511: Fix wiring of UART overflow interrupt lines
50
42
51
Pranavkumar Sawargaonkar (3):
43
Philippe Mathieu-Daudé (5):
52
hw/pci-host/gpex: Set INTx index/gsi mapping
44
hw/ssi/xilinx_spips: Convert lqspi_read() to read_with_attrs
53
hw/arm/virt: Set INTx/gsi mapping
45
hw/ssi/xilinx_spips: Avoid AXI writes to the LQSPI linear memory
54
hw/pci-host/gpex: Implement PCI INTx routing
46
hw/ssi/xilinx_spips: Avoid out-of-bound access to lqspi_buf[]
47
hw/ssi/mss-spi: Avoid crash when reading empty RX FIFO
48
hw/display/xlnx_dp: Avoid crash when reading empty RX FIFO
55
49
56
Richard Henderson (1):
50
include/hw/timer/pl031.h | 2 ++
57
target/arm: Avoid an extra temporary for store_exclusive
51
hw/arm/virt.c | 2 +-
52
hw/core/machine.c | 1 +
53
hw/display/xlnx_dp.c | 15 +++++---
54
hw/ssi/mss-spi.c | 8 ++++-
55
hw/ssi/xilinx_spips.c | 43 +++++++++++++++-------
56
hw/timer/pl031.c | 92 +++++++++++++++++++++++++++++++++++++++++++++---
57
target/arm/cpu.c | 16 +++++++++
58
target/arm/m_helper.c | 21 ++++++++---
59
9 files changed, 174 insertions(+), 26 deletions(-)
58
60
59
hw/arm/Makefile.objs | 2 +-
60
include/hw/arm/xlnx-zynqmp.h | 2 +
61
include/hw/pci-host/gpex.h | 3 +
62
target/arm/cpu.h | 35 +++---
63
target/arm/internals.h | 20 ++++
64
hw/arm/mps2.c | 4 +-
65
hw/arm/virt.c | 1 +
66
hw/arm/xlnx-ep108.c | 139 -----------------------
67
hw/arm/xlnx-zcu102.c | 259 +++++++++++++++++++++++++++++++++++++++++++
68
hw/arm/xlnx-zynqmp.c | 3 +-
69
hw/intc/armv7m_nvic.c | 11 +-
70
hw/pci-host/gpex.c | 22 ++++
71
target/arm/cpu.c | 6 +
72
target/arm/helper.c | 43 ++++---
73
target/arm/op_helper.c | 2 +-
74
target/arm/translate-a64.c | 27 ++---
75
16 files changed, 382 insertions(+), 197 deletions(-)
76
delete mode 100644 hw/arm/xlnx-ep108.c
77
create mode 100644 hw/arm/xlnx-zcu102.c
78
diff view generated by jsdifflib
Deleted patch
1
Use a symbolic constant M_REG_NUM_BANKS for the array size for
2
registers which are banked by M profile security state, rather
3
than hardcoding lots of 2s.
4
1
5
Suggested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
9
Message-id: 1505137930-13255-2-git-send-email-peter.maydell@linaro.org
10
---
11
target/arm/cpu.h | 35 +++++++++++++++++++----------------
12
1 file changed, 19 insertions(+), 16 deletions(-)
13
14
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
15
index XXXXXXX..XXXXXXX 100644
16
--- a/target/arm/cpu.h
17
+++ b/target/arm/cpu.h
18
@@ -XXX,XX +XXX,XX @@
19
* accessed via env->registerfield[env->v7m.secure] (whether the security
20
* extension is implemented or not).
21
*/
22
-#define M_REG_NS 0
23
-#define M_REG_S 1
24
+enum {
25
+ M_REG_NS = 0,
26
+ M_REG_S = 1,
27
+ M_REG_NUM_BANKS = 2,
28
+};
29
30
/* ARM-specific interrupt pending bits. */
31
#define CPU_INTERRUPT_FIQ CPU_INTERRUPT_TGT_EXT_1
32
@@ -XXX,XX +XXX,XX @@ typedef struct CPUARMState {
33
uint32_t other_sp;
34
uint32_t other_ss_msp;
35
uint32_t other_ss_psp;
36
- uint32_t vecbase[2];
37
- uint32_t basepri[2];
38
- uint32_t control[2];
39
- uint32_t ccr[2]; /* Configuration and Control */
40
- uint32_t cfsr[2]; /* Configurable Fault Status */
41
+ uint32_t vecbase[M_REG_NUM_BANKS];
42
+ uint32_t basepri[M_REG_NUM_BANKS];
43
+ uint32_t control[M_REG_NUM_BANKS];
44
+ uint32_t ccr[M_REG_NUM_BANKS]; /* Configuration and Control */
45
+ uint32_t cfsr[M_REG_NUM_BANKS]; /* Configurable Fault Status */
46
uint32_t hfsr; /* HardFault Status */
47
uint32_t dfsr; /* Debug Fault Status Register */
48
- uint32_t mmfar[2]; /* MemManage Fault Address */
49
+ uint32_t mmfar[M_REG_NUM_BANKS]; /* MemManage Fault Address */
50
uint32_t bfar; /* BusFault Address */
51
- unsigned mpu_ctrl[2]; /* MPU_CTRL */
52
+ unsigned mpu_ctrl[M_REG_NUM_BANKS]; /* MPU_CTRL */
53
int exception;
54
- uint32_t primask[2];
55
- uint32_t faultmask[2];
56
+ uint32_t primask[M_REG_NUM_BANKS];
57
+ uint32_t faultmask[M_REG_NUM_BANKS];
58
uint32_t secure; /* Is CPU in Secure state? (not guest visible) */
59
} v7m;
60
61
@@ -XXX,XX +XXX,XX @@ typedef struct CPUARMState {
62
uint32_t *drbar;
63
uint32_t *drsr;
64
uint32_t *dracr;
65
- uint32_t rnr[2];
66
+ uint32_t rnr[M_REG_NUM_BANKS];
67
} pmsav7;
68
69
/* PMSAv8 MPU */
70
@@ -XXX,XX +XXX,XX @@ typedef struct CPUARMState {
71
* pmsav7.rnr (region number register)
72
* pmsav7_dregion (number of configured regions)
73
*/
74
- uint32_t *rbar[2];
75
- uint32_t *rlar[2];
76
- uint32_t mair0[2];
77
- uint32_t mair1[2];
78
+ uint32_t *rbar[M_REG_NUM_BANKS];
79
+ uint32_t *rlar[M_REG_NUM_BANKS];
80
+ uint32_t mair0[M_REG_NUM_BANKS];
81
+ uint32_t mair1[M_REG_NUM_BANKS];
82
} pmsav8;
83
84
void *nvic;
85
--
86
2.7.4
87
88
diff view generated by jsdifflib
1
From: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
1
From: Alex Bennée <alex.bennee@linaro.org>
2
2
3
To implement INTx to gsi routing we need to pass the gpex host
3
When we converted to using feature bits in 602f6e42cfbf we missed out
4
bridge the gsi associated to each INTx index. Let's introduce
4
the fact (dp && arm_dc_feature(s, ARM_FEATURE_V8)) was supported for
5
irq_num array and gpex_set_irq_num setter function.
5
-cpu max configurations. This caused a regression in the GCC test
6
suite. Fix this by setting the appropriate bits in mvfr1.FPHP to
7
report ARMv8-A with FP support (but not ARMv8.2-FP16).
6
8
7
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
9
Fixes: https://bugs.launchpad.net/qemu/+bug/1836078
8
Signed-off-by: Tushar Jagad <tushar.jagad@linaro.org>
10
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
9
Signed-off-by: Eric Auger <eric.auger@redhat.com>
11
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
10
Tested-by: Feng Kan <fkan@apm.com>
12
Message-id: 20190711103737.10017-1-alex.bennee@linaro.org
11
Reviewed-by: Andrew Jones <drjones@redhat.com>
12
Message-id: 1505296004-6798-2-git-send-email-eric.auger@redhat.com
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
---
14
---
15
include/hw/pci-host/gpex.h | 3 +++
15
target/arm/cpu.c | 4 ++++
16
hw/pci-host/gpex.c | 10 ++++++++++
16
1 file changed, 4 insertions(+)
17
2 files changed, 13 insertions(+)
18
17
19
diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h
18
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
20
index XXXXXXX..XXXXXXX 100644
19
index XXXXXXX..XXXXXXX 100644
21
--- a/include/hw/pci-host/gpex.h
20
--- a/target/arm/cpu.c
22
+++ b/include/hw/pci-host/gpex.h
21
+++ b/target/arm/cpu.c
23
@@ -XXX,XX +XXX,XX @@ typedef struct GPEXHost {
22
@@ -XXX,XX +XXX,XX @@ static void arm_max_initfn(Object *obj)
24
MemoryRegion io_ioport;
23
t = FIELD_DP32(t, ID_ISAR6, SPECRES, 1);
25
MemoryRegion io_mmio;
24
cpu->isar.id_isar6 = t;
26
qemu_irq irq[GPEX_NUM_IRQS];
25
27
+ int irq_num[GPEX_NUM_IRQS];
26
+ t = cpu->isar.mvfr1;
28
} GPEXHost;
27
+ t = FIELD_DP32(t, MVFR1, FPHP, 2); /* v8.0 FP support */
29
28
+ cpu->isar.mvfr1 = t;
30
+int gpex_set_irq_num(GPEXHost *s, int index, int gsi);
31
+
29
+
32
#endif /* HW_GPEX_H */
30
t = cpu->isar.mvfr2;
33
diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
31
t = FIELD_DP32(t, MVFR2, SIMDMISC, 3); /* SIMD MaxNum */
34
index XXXXXXX..XXXXXXX 100644
32
t = FIELD_DP32(t, MVFR2, FPMISC, 4); /* FP MaxNum */
35
--- a/hw/pci-host/gpex.c
36
+++ b/hw/pci-host/gpex.c
37
@@ -XXX,XX +XXX,XX @@ static void gpex_set_irq(void *opaque, int irq_num, int level)
38
qemu_set_irq(s->irq[irq_num], level);
39
}
40
41
+int gpex_set_irq_num(GPEXHost *s, int index, int gsi)
42
+{
43
+ if (index >= GPEX_NUM_IRQS) {
44
+ return -EINVAL;
45
+ }
46
+
47
+ s->irq_num[index] = gsi;
48
+ return 0;
49
+}
50
+
51
static void gpex_host_realize(DeviceState *dev, Error **errp)
52
{
53
PCIHostState *pci = PCI_HOST_BRIDGE(dev);
54
--
33
--
55
2.7.4
34
2.20.1
56
35
57
36
diff view generated by jsdifflib
1
From: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
1
From: Philippe Mathieu-Daudé <philmd@redhat.com>
2
2
3
Now we are able to retrieve the gsi from the INTx pin, let's
3
In the next commit we will implement the write_with_attrs()
4
enable intx_to_irq routing. From that point on, irqfd becomes
4
handler. To avoid using different APIs, convert the read()
5
usable along with INTx when assigning a PCIe device.
5
handler first.
6
6
7
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
7
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
8
Signed-off-by: Tushar Jagad <tushar.jagad@linaro.org>
8
Tested-by: Francisco Iglesias <frasse.iglesias@gmail.com>
9
Signed-off-by: Eric Auger <eric.auger@redhat.com>
9
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
10
Reviewed-by: Andrew Jones <drjones@redhat.com>
11
Tested-by: Feng Kan <fkan@apm.com>
12
Message-id: 1505296004-6798-4-git-send-email-eric.auger@redhat.com
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
---
11
---
15
hw/pci-host/gpex.c | 12 ++++++++++++
12
hw/ssi/xilinx_spips.c | 23 +++++++++++------------
16
1 file changed, 12 insertions(+)
13
1 file changed, 11 insertions(+), 12 deletions(-)
17
14
18
diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
15
diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c
19
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
20
--- a/hw/pci-host/gpex.c
17
--- a/hw/ssi/xilinx_spips.c
21
+++ b/hw/pci-host/gpex.c
18
+++ b/hw/ssi/xilinx_spips.c
22
@@ -XXX,XX +XXX,XX @@ int gpex_set_irq_num(GPEXHost *s, int index, int gsi)
19
@@ -XXX,XX +XXX,XX @@ static void lqspi_load_cache(void *opaque, hwaddr addr)
23
return 0;
20
}
24
}
21
}
25
22
26
+static PCIINTxRoute gpex_route_intx_pin_to_irq(void *opaque, int pin)
23
-static uint64_t
27
+{
24
-lqspi_read(void *opaque, hwaddr addr, unsigned int size)
28
+ PCIINTxRoute route;
25
+static MemTxResult lqspi_read(void *opaque, hwaddr addr, uint64_t *value,
29
+ GPEXHost *s = opaque;
26
+ unsigned size, MemTxAttrs attrs)
27
{
28
- XilinxQSPIPS *q = opaque;
29
- uint32_t ret;
30
+ XilinxQSPIPS *q = XILINX_QSPIPS(opaque);
31
32
if (addr >= q->lqspi_cached_addr &&
33
addr <= q->lqspi_cached_addr + LQSPI_CACHE_SIZE - 4) {
34
uint8_t *retp = &q->lqspi_buf[addr - q->lqspi_cached_addr];
35
- ret = cpu_to_le32(*(uint32_t *)retp);
36
- DB_PRINT_L(1, "addr: %08x, data: %08x\n", (unsigned)addr,
37
- (unsigned)ret);
38
- return ret;
39
- } else {
40
- lqspi_load_cache(opaque, addr);
41
- return lqspi_read(opaque, addr, size);
42
+ *value = cpu_to_le32(*(uint32_t *)retp);
43
+ DB_PRINT_L(1, "addr: %08" HWADDR_PRIx ", data: %08" PRIx64 "\n",
44
+ addr, *value);
45
+ return MEMTX_OK;
46
}
30
+
47
+
31
+ route.mode = PCI_INTX_ENABLED;
48
+ lqspi_load_cache(opaque, addr);
32
+ route.irq = s->irq_num[pin];
49
+ return lqspi_read(opaque, addr, value, size, attrs);
33
+
34
+ return route;
35
+}
36
+
37
static void gpex_host_realize(DeviceState *dev, Error **errp)
38
{
39
PCIHostState *pci = PCI_HOST_BRIDGE(dev);
40
@@ -XXX,XX +XXX,XX @@ static void gpex_host_realize(DeviceState *dev, Error **errp)
41
&s->io_ioport, 0, 4, TYPE_PCIE_BUS);
42
43
qdev_set_parent_bus(DEVICE(&s->gpex_root), BUS(pci->bus));
44
+ pci_bus_set_route_irq_fn(pci->bus, gpex_route_intx_pin_to_irq);
45
qdev_init_nofail(DEVICE(&s->gpex_root));
46
}
50
}
47
51
52
static const MemoryRegionOps lqspi_ops = {
53
- .read = lqspi_read,
54
+ .read_with_attrs = lqspi_read,
55
.endianness = DEVICE_NATIVE_ENDIAN,
56
.valid = {
57
.min_access_size = 1,
48
--
58
--
49
2.7.4
59
2.20.1
50
60
51
61
diff view generated by jsdifflib
1
From: Alistair Francis <alistair.francis@xilinx.com>
1
From: Philippe Mathieu-Daudé <philmd@redhat.com>
2
2
3
Add a machine level virtualization property. This defaults to false and can be
3
Lei Sun found while auditing the code that a CPU write would
4
set to true using this machine command line argument:
4
trigger a NULL pointer dereference.
5
-machine xlnx-zcu102,virtualization=on
6
5
7
This follows what the ARM virt machine does.
6
>From UG1085 datasheet [*] AXI writes in this region are ignored
7
and generates an AXI Slave Error (SLVERR).
8
8
9
This property only applies to the ZCU102 machine. The EP108 machine does
9
Fix by implementing the write_with_attrs() handler.
10
not have this property.
10
Return MEMTX_ERROR when the region is accessed (this error maps
11
to an AXI slave error).
11
12
12
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
13
[*] https://www.xilinx.com/support/documentation/user_guides/ug1085-zynq-ultrascale-trm.pdf
13
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
14
15
Reported-by: Lei Sun <slei.casper@gmail.com>
16
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
17
Tested-by: Francisco Iglesias <frasse.iglesias@gmail.com>
18
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
19
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
15
---
20
---
16
include/hw/arm/xlnx-zynqmp.h | 2 ++
21
hw/ssi/xilinx_spips.c | 16 ++++++++++++++++
17
hw/arm/xlnx-zcu102.c | 30 +++++++++++++++++++++++++++++-
22
1 file changed, 16 insertions(+)
18
hw/arm/xlnx-zynqmp.c | 3 ++-
19
3 files changed, 33 insertions(+), 2 deletions(-)
20
23
21
diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h
24
diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c
22
index XXXXXXX..XXXXXXX 100644
25
index XXXXXXX..XXXXXXX 100644
23
--- a/include/hw/arm/xlnx-zynqmp.h
26
--- a/hw/ssi/xilinx_spips.c
24
+++ b/include/hw/arm/xlnx-zynqmp.h
27
+++ b/hw/ssi/xilinx_spips.c
25
@@ -XXX,XX +XXX,XX @@ typedef struct XlnxZynqMPState {
28
@@ -XXX,XX +XXX,XX @@ static MemTxResult lqspi_read(void *opaque, hwaddr addr, uint64_t *value,
26
29
return lqspi_read(opaque, addr, value, size, attrs);
27
/* Has the ARM Security extensions? */
28
bool secure;
29
+ /* Has the ARM Virtualization extensions? */
30
+ bool virt;
31
/* Has the RPU subsystem? */
32
bool has_rpu;
33
} XlnxZynqMPState;
34
diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c
35
index XXXXXXX..XXXXXXX 100644
36
--- a/hw/arm/xlnx-zcu102.c
37
+++ b/hw/arm/xlnx-zcu102.c
38
@@ -XXX,XX +XXX,XX @@ typedef struct XlnxZCU102 {
39
MemoryRegion ddr_ram;
40
41
bool secure;
42
+ bool virt;
43
} XlnxZCU102;
44
45
#define TYPE_ZCU102_MACHINE MACHINE_TYPE_NAME("xlnx-zcu102")
46
@@ -XXX,XX +XXX,XX @@ static void zcu102_set_secure(Object *obj, bool value, Error **errp)
47
s->secure = value;
48
}
30
}
49
31
50
+static bool zcu102_get_virt(Object *obj, Error **errp)
32
+static MemTxResult lqspi_write(void *opaque, hwaddr offset, uint64_t value,
33
+ unsigned size, MemTxAttrs attrs)
51
+{
34
+{
52
+ XlnxZCU102 *s = ZCU102_MACHINE(obj);
35
+ /*
36
+ * From UG1085, Chapter 24 (Quad-SPI controllers):
37
+ * - Writes are ignored
38
+ * - AXI writes generate an external AXI slave error (SLVERR)
39
+ */
40
+ qemu_log_mask(LOG_GUEST_ERROR, "%s Unexpected %u-bit access to 0x%" PRIx64
41
+ " (value: 0x%" PRIx64 "\n",
42
+ __func__, size << 3, offset, value);
53
+
43
+
54
+ return s->virt;
44
+ return MEMTX_ERROR;
55
+}
45
+}
56
+
46
+
57
+static void zcu102_set_virt(Object *obj, bool value, Error **errp)
47
static const MemoryRegionOps lqspi_ops = {
58
+{
48
.read_with_attrs = lqspi_read,
59
+ XlnxZCU102 *s = ZCU102_MACHINE(obj);
49
+ .write_with_attrs = lqspi_write,
60
+
50
.endianness = DEVICE_NATIVE_ENDIAN,
61
+ s->virt = value;
51
.valid = {
62
+}
52
.min_access_size = 1,
63
+
64
static void xlnx_zynqmp_init(XlnxZCU102 *s, MachineState *machine)
65
{
66
int i;
67
@@ -XXX,XX +XXX,XX @@ static void xlnx_zynqmp_init(XlnxZCU102 *s, MachineState *machine)
68
"ddr-ram", &error_abort);
69
object_property_set_bool(OBJECT(&s->soc), s->secure, "secure",
70
&error_fatal);
71
+ object_property_set_bool(OBJECT(&s->soc), s->virt, "virtualization",
72
+ &error_fatal);
73
74
object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal);
75
76
@@ -XXX,XX +XXX,XX @@ static void xlnx_ep108_machine_instance_init(Object *obj)
77
{
78
XlnxZCU102 *s = EP108_MACHINE(obj);
79
80
- /* EP108, we don't support setting secure */
81
+ /* EP108, we don't support setting secure or virt */
82
s->secure = false;
83
+ s->virt = false;
84
}
85
86
static void xlnx_ep108_machine_class_init(ObjectClass *oc, void *data)
87
@@ -XXX,XX +XXX,XX @@ static void xlnx_zcu102_machine_instance_init(Object *obj)
88
"Set on/off to enable/disable the ARM "
89
"Security Extensions (TrustZone)",
90
NULL);
91
+
92
+ /* Default to virt (EL2) being disabled */
93
+ s->virt = false;
94
+ object_property_add_bool(obj, "virtualization", zcu102_get_virt,
95
+ zcu102_set_virt, NULL);
96
+ object_property_set_description(obj, "virtualization",
97
+ "Set on/off to enable/disable emulating a "
98
+ "guest CPU which implements the ARM "
99
+ "Virtualization Extensions",
100
+ NULL);
101
}
102
103
static void xlnx_zcu102_machine_class_init(ObjectClass *oc, void *data)
104
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
105
index XXXXXXX..XXXXXXX 100644
106
--- a/hw/arm/xlnx-zynqmp.c
107
+++ b/hw/arm/xlnx-zynqmp.c
108
@@ -XXX,XX +XXX,XX @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
109
object_property_set_bool(OBJECT(&s->apu_cpu[i]),
110
s->secure, "has_el3", NULL);
111
object_property_set_bool(OBJECT(&s->apu_cpu[i]),
112
- false, "has_el2", NULL);
113
+ s->virt, "has_el2", NULL);
114
object_property_set_int(OBJECT(&s->apu_cpu[i]), GIC_BASE_ADDR,
115
"reset-cbar", &error_abort);
116
object_property_set_bool(OBJECT(&s->apu_cpu[i]), true, "realized",
117
@@ -XXX,XX +XXX,XX @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
118
static Property xlnx_zynqmp_props[] = {
119
DEFINE_PROP_STRING("boot-cpu", XlnxZynqMPState, boot_cpu),
120
DEFINE_PROP_BOOL("secure", XlnxZynqMPState, secure, false),
121
+ DEFINE_PROP_BOOL("virtualization", XlnxZynqMPState, virt, false),
122
DEFINE_PROP_BOOL("has_rpu", XlnxZynqMPState, has_rpu, false),
123
DEFINE_PROP_LINK("ddr-ram", XlnxZynqMPState, ddr_ram, TYPE_MEMORY_REGION,
124
MemoryRegion *),
125
--
53
--
126
2.7.4
54
2.20.1
127
55
128
56
diff view generated by jsdifflib
1
From: Richard Henderson <richard.henderson@linaro.org>
1
From: Philippe Mathieu-Daudé <philmd@redhat.com>
2
2
3
Instead of copying addr to a local temp, reuse the value (which we
3
Both lqspi_read() and lqspi_load_cache() expect a 32-bit
4
have just compared as equal) already saved in cpu_exclusive_addr.
4
aligned address.
5
5
6
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6
>From UG1085 datasheet [*] chapter on 'Quad-SPI Controller':
7
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
7
8
Message-id: 20170908163859.29820-1-richard.henderson@linaro.org
8
Transfer Size Limitations
9
10
Because of the 32-bit wide TX, RX, and generic FIFO, all
11
APB/AXI transfers must be an integer multiple of 4-bytes.
12
Shorter transfers are not possible.
13
14
Set MemoryRegionOps.impl values to force 32-bit accesses,
15
this way we are sure we do not access the lqspi_buf[] array
16
out of bound.
17
18
[*] https://www.xilinx.com/support/documentation/user_guides/ug1085-zynq-ultrascale-trm.pdf
19
20
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
21
Tested-by: Francisco Iglesias <frasse.iglesias@gmail.com>
22
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
23
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
---
24
---
11
target/arm/translate-a64.c | 26 +++++++++-----------------
25
hw/ssi/xilinx_spips.c | 4 ++++
12
1 file changed, 9 insertions(+), 17 deletions(-)
26
1 file changed, 4 insertions(+)
13
27
14
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
28
diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c
15
index XXXXXXX..XXXXXXX 100644
29
index XXXXXXX..XXXXXXX 100644
16
--- a/target/arm/translate-a64.c
30
--- a/hw/ssi/xilinx_spips.c
17
+++ b/target/arm/translate-a64.c
31
+++ b/hw/ssi/xilinx_spips.c
18
@@ -XXX,XX +XXX,XX @@ static void gen_load_exclusive(DisasContext *s, int rt, int rt2,
32
@@ -XXX,XX +XXX,XX @@ static const MemoryRegionOps lqspi_ops = {
19
}
33
.read_with_attrs = lqspi_read,
20
34
.write_with_attrs = lqspi_write,
21
static void gen_store_exclusive(DisasContext *s, int rd, int rt, int rt2,
35
.endianness = DEVICE_NATIVE_ENDIAN,
22
- TCGv_i64 inaddr, int size, int is_pair)
36
+ .impl = {
23
+ TCGv_i64 addr, int size, int is_pair)
37
+ .min_access_size = 4,
24
{
38
+ .max_access_size = 4,
25
/* if (env->exclusive_addr == addr && env->exclusive_val == [addr]
39
+ },
26
* && (!is_pair || env->exclusive_high == [addr + datasize])) {
40
.valid = {
27
@@ -XXX,XX +XXX,XX @@ static void gen_store_exclusive(DisasContext *s, int rd, int rt, int rt2,
41
.min_access_size = 1,
28
*/
42
.max_access_size = 4
29
TCGLabel *fail_label = gen_new_label();
30
TCGLabel *done_label = gen_new_label();
31
- TCGv_i64 addr = tcg_temp_local_new_i64();
32
TCGv_i64 tmp;
33
34
- /* Copy input into a local temp so it is not trashed when the
35
- * basic block ends at the branch insn.
36
- */
37
- tcg_gen_mov_i64(addr, inaddr);
38
tcg_gen_brcond_i64(TCG_COND_NE, addr, cpu_exclusive_addr, fail_label);
39
40
tmp = tcg_temp_new_i64();
41
@@ -XXX,XX +XXX,XX @@ static void gen_store_exclusive(DisasContext *s, int rd, int rt, int rt2,
42
} else {
43
tcg_gen_concat32_i64(tmp, cpu_reg(s, rt2), cpu_reg(s, rt));
44
}
45
- tcg_gen_atomic_cmpxchg_i64(tmp, addr, cpu_exclusive_val, tmp,
46
+ tcg_gen_atomic_cmpxchg_i64(tmp, cpu_exclusive_addr,
47
+ cpu_exclusive_val, tmp,
48
get_mem_index(s),
49
MO_64 | MO_ALIGN | s->be_data);
50
tcg_gen_setcond_i64(TCG_COND_NE, tmp, tmp, cpu_exclusive_val);
51
} else if (s->be_data == MO_LE) {
52
- gen_helper_paired_cmpxchg64_le(tmp, cpu_env, addr, cpu_reg(s, rt),
53
- cpu_reg(s, rt2));
54
+ gen_helper_paired_cmpxchg64_le(tmp, cpu_env, cpu_exclusive_addr,
55
+ cpu_reg(s, rt), cpu_reg(s, rt2));
56
} else {
57
- gen_helper_paired_cmpxchg64_be(tmp, cpu_env, addr, cpu_reg(s, rt),
58
- cpu_reg(s, rt2));
59
+ gen_helper_paired_cmpxchg64_be(tmp, cpu_env, cpu_exclusive_addr,
60
+ cpu_reg(s, rt), cpu_reg(s, rt2));
61
}
62
} else {
63
- TCGv_i64 val = cpu_reg(s, rt);
64
- tcg_gen_atomic_cmpxchg_i64(tmp, addr, cpu_exclusive_val, val,
65
- get_mem_index(s),
66
+ tcg_gen_atomic_cmpxchg_i64(tmp, cpu_exclusive_addr, cpu_exclusive_val,
67
+ cpu_reg(s, rt), get_mem_index(s),
68
size | MO_ALIGN | s->be_data);
69
tcg_gen_setcond_i64(TCG_COND_NE, tmp, tmp, cpu_exclusive_val);
70
}
71
-
72
- tcg_temp_free_i64(addr);
73
-
74
tcg_gen_mov_i64(cpu_reg(s, rd), tmp);
75
tcg_temp_free_i64(tmp);
76
tcg_gen_br(done_label);
77
--
43
--
78
2.7.4
44
2.20.1
79
45
80
46
diff view generated by jsdifflib
1
Fix an error that meant we were wiring every UART's overflow
1
From: Philippe Mathieu-Daudé <philmd@redhat.com>
2
interrupts into the same inputs 0 and 1 of the OR gate,
3
rather than giving each its own input.
4
2
5
Cc: qemu-stable@nongnu.org
3
Reading the RX_DATA register when the RX_FIFO is empty triggers
4
an abort. This can be easily reproduced:
5
6
$ qemu-system-arm -M emcraft-sf2 -monitor stdio -S
7
QEMU 4.0.50 monitor - type 'help' for more information
8
(qemu) x 0x40001010
9
Aborted (core dumped)
10
11
(gdb) bt
12
#1 0x00007f035874f895 in abort () at /lib64/libc.so.6
13
#2 0x00005628686591ff in fifo8_pop (fifo=0x56286a9a4c68) at util/fifo8.c:66
14
#3 0x00005628683e0b8e in fifo32_pop (fifo=0x56286a9a4c68) at include/qemu/fifo32.h:137
15
#4 0x00005628683e0efb in spi_read (opaque=0x56286a9a4850, addr=4, size=4) at hw/ssi/mss-spi.c:168
16
#5 0x0000562867f96801 in memory_region_read_accessor (mr=0x56286a9a4b60, addr=16, value=0x7ffeecb0c5c8, size=4, shift=0, mask=4294967295, attrs=...) at memory.c:439
17
#6 0x0000562867f96cdb in access_with_adjusted_size (addr=16, value=0x7ffeecb0c5c8, size=4, access_size_min=1, access_size_max=4, access_fn=0x562867f967c3 <memory_region_read_accessor>, mr=0x56286a9a4b60, attrs=...) at memory.c:569
18
#7 0x0000562867f99940 in memory_region_dispatch_read1 (mr=0x56286a9a4b60, addr=16, pval=0x7ffeecb0c5c8, size=4, attrs=...) at memory.c:1420
19
#8 0x0000562867f99a08 in memory_region_dispatch_read (mr=0x56286a9a4b60, addr=16, pval=0x7ffeecb0c5c8, size=4, attrs=...) at memory.c:1447
20
#9 0x0000562867f38721 in flatview_read_continue (fv=0x56286aec6360, addr=1073745936, attrs=..., buf=0x7ffeecb0c7c0 "\340ǰ\354\376\177", len=4, addr1=16, l=4, mr=0x56286a9a4b60) at exec.c:3385
21
#10 0x0000562867f38874 in flatview_read (fv=0x56286aec6360, addr=1073745936, attrs=..., buf=0x7ffeecb0c7c0 "\340ǰ\354\376\177", len=4) at exec.c:3423
22
#11 0x0000562867f388ea in address_space_read_full (as=0x56286aa3e890, addr=1073745936, attrs=..., buf=0x7ffeecb0c7c0 "\340ǰ\354\376\177", len=4) at exec.c:3436
23
#12 0x0000562867f389c5 in address_space_rw (as=0x56286aa3e890, addr=1073745936, attrs=..., buf=0x7ffeecb0c7c0 "\340ǰ\354\376\177", len=4, is_write=false) at exec.c:3466
24
#13 0x0000562867f3bdd7 in cpu_memory_rw_debug (cpu=0x56286aa19d00, addr=1073745936, buf=0x7ffeecb0c7c0 "\340ǰ\354\376\177", len=4, is_write=0) at exec.c:3976
25
#14 0x000056286811ed51 in memory_dump (mon=0x56286a8c32d0, count=1, format=120, wsize=4, addr=1073745936, is_physical=0) at monitor/misc.c:730
26
#15 0x000056286811eff1 in hmp_memory_dump (mon=0x56286a8c32d0, qdict=0x56286b15c400) at monitor/misc.c:785
27
#16 0x00005628684740ee in handle_hmp_command (mon=0x56286a8c32d0, cmdline=0x56286a8caeb2 "0x40001010") at monitor/hmp.c:1082
28
29
From the datasheet "Actel SmartFusion Microcontroller Subsystem
30
User's Guide" Rev.1, Table 13-3 "SPI Register Summary", this
31
register has a reset value of 0.
32
33
Check the FIFO is not empty before accessing it, else log an
34
error message.
35
36
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
37
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
38
Message-id: 20190709113715.7761-3-philmd@redhat.com
6
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
39
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
8
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
9
Message-id: 1505232834-20890-1-git-send-email-peter.maydell@linaro.org
10
---
40
---
11
hw/arm/mps2.c | 4 ++--
41
hw/ssi/mss-spi.c | 8 +++++++-
12
1 file changed, 2 insertions(+), 2 deletions(-)
42
1 file changed, 7 insertions(+), 1 deletion(-)
13
43
14
diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
44
diff --git a/hw/ssi/mss-spi.c b/hw/ssi/mss-spi.c
15
index XXXXXXX..XXXXXXX 100644
45
index XXXXXXX..XXXXXXX 100644
16
--- a/hw/arm/mps2.c
46
--- a/hw/ssi/mss-spi.c
17
+++ b/hw/arm/mps2.c
47
+++ b/hw/ssi/mss-spi.c
18
@@ -XXX,XX +XXX,XX @@ static void mps2_common_init(MachineState *machine)
48
@@ -XXX,XX +XXX,XX @@ spi_read(void *opaque, hwaddr addr, unsigned int size)
19
cmsdk_apb_uart_create(uartbase[i],
49
case R_SPI_RX:
20
qdev_get_gpio_in(txrx_orgate_dev, 0),
50
s->regs[R_SPI_STATUS] &= ~S_RXFIFOFUL;
21
qdev_get_gpio_in(txrx_orgate_dev, 1),
51
s->regs[R_SPI_STATUS] &= ~S_RXCHOVRF;
22
- qdev_get_gpio_in(orgate_dev, 0),
52
- ret = fifo32_pop(&s->rx_fifo);
23
- qdev_get_gpio_in(orgate_dev, 1),
53
+ if (fifo32_is_empty(&s->rx_fifo)) {
24
+ qdev_get_gpio_in(orgate_dev, i * 2),
54
+ qemu_log_mask(LOG_GUEST_ERROR,
25
+ qdev_get_gpio_in(orgate_dev, i * 2 + 1),
55
+ "%s: Reading empty RX_FIFO\n",
26
NULL,
56
+ __func__);
27
uartchr, SYSCLK_FRQ);
57
+ } else {
58
+ ret = fifo32_pop(&s->rx_fifo);
59
+ }
60
if (fifo32_is_empty(&s->rx_fifo)) {
61
s->regs[R_SPI_STATUS] |= S_RXFIFOEMP;
28
}
62
}
29
--
63
--
30
2.7.4
64
2.20.1
31
65
32
66
diff view generated by jsdifflib
1
From: Alistair Francis <alistair.francis@xilinx.com>
1
From: Philippe Mathieu-Daudé <philmd@redhat.com>
2
2
3
Add a machine level secure property. This defaults to false and can be
3
In the previous commit we fixed a crash when the guest read a
4
set to true using this machine command line argument:
4
register that pop from an empty FIFO.
5
-machine xlnx-zcu102,secure=on
5
By auditing the repository, we found another similar use with
6
an easy way to reproduce:
6
7
7
This follows what the ARM virt machine does.
8
$ qemu-system-aarch64 -M xlnx-zcu102 -monitor stdio -S
9
QEMU 4.0.50 monitor - type 'help' for more information
10
(qemu) xp/b 0xfd4a0134
11
Aborted (core dumped)
8
12
9
This property only applies to the ZCU102 machine. The EP108 machine does
13
(gdb) bt
10
not have this property.
14
#0 0x00007f6936dea57f in raise () at /lib64/libc.so.6
15
#1 0x00007f6936dd4895 in abort () at /lib64/libc.so.6
16
#2 0x0000561ad32975ec in xlnx_dp_aux_pop_rx_fifo (s=0x7f692babee70) at hw/display/xlnx_dp.c:431
17
#3 0x0000561ad3297dc0 in xlnx_dp_read (opaque=0x7f692babee70, offset=77, size=4) at hw/display/xlnx_dp.c:667
18
#4 0x0000561ad321b896 in memory_region_read_accessor (mr=0x7f692babf620, addr=308, value=0x7ffe05c1db88, size=4, shift=0, mask=4294967295, attrs=...) at memory.c:439
19
#5 0x0000561ad321bd70 in access_with_adjusted_size (addr=308, value=0x7ffe05c1db88, size=1, access_size_min=4, access_size_max=4, access_fn=0x561ad321b858 <memory_region_read_accessor>, mr=0x7f692babf620, attrs=...) at memory.c:569
20
#6 0x0000561ad321e9d5 in memory_region_dispatch_read1 (mr=0x7f692babf620, addr=308, pval=0x7ffe05c1db88, size=1, attrs=...) at memory.c:1420
21
#7 0x0000561ad321ea9d in memory_region_dispatch_read (mr=0x7f692babf620, addr=308, pval=0x7ffe05c1db88, size=1, attrs=...) at memory.c:1447
22
#8 0x0000561ad31bd742 in flatview_read_continue (fv=0x561ad69c04f0, addr=4249485620, attrs=..., buf=0x7ffe05c1dcf0 "\020\335\301\005\376\177", len=1, addr1=308, l=1, mr=0x7f692babf620) at exec.c:3385
23
#9 0x0000561ad31bd895 in flatview_read (fv=0x561ad69c04f0, addr=4249485620, attrs=..., buf=0x7ffe05c1dcf0 "\020\335\301\005\376\177", len=1) at exec.c:3423
24
#10 0x0000561ad31bd90b in address_space_read_full (as=0x561ad5bb3020, addr=4249485620, attrs=..., buf=0x7ffe05c1dcf0 "\020\335\301\005\376\177", len=1) at exec.c:3436
25
#11 0x0000561ad33b1c42 in address_space_read (len=1, buf=0x7ffe05c1dcf0 "\020\335\301\005\376\177", attrs=..., addr=4249485620, as=0x561ad5bb3020) at include/exec/memory.h:2131
26
#12 0x0000561ad33b1c42 in memory_dump (mon=0x561ad59c4530, count=1, format=120, wsize=1, addr=4249485620, is_physical=1) at monitor/misc.c:723
27
#13 0x0000561ad33b1fc1 in hmp_physical_memory_dump (mon=0x561ad59c4530, qdict=0x561ad6c6fd00) at monitor/misc.c:795
28
#14 0x0000561ad37b4a9f in handle_hmp_command (mon=0x561ad59c4530, cmdline=0x561ad59d0f22 "/b 0x00000000fd4a0134") at monitor/hmp.c:1082
11
29
12
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
30
Fix by checking the FIFO is not empty before popping from it.
13
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
31
32
The datasheet is not clear about the reset value of this register,
33
we choose to return '0'.
34
35
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
36
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
37
Message-id: 20190709113715.7761-4-philmd@redhat.com
14
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
38
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
15
---
39
---
16
hw/arm/xlnx-zcu102.c | 32 ++++++++++++++++++++++++++++++++
40
hw/display/xlnx_dp.c | 15 +++++++++++----
17
1 file changed, 32 insertions(+)
41
1 file changed, 11 insertions(+), 4 deletions(-)
18
42
19
diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c
43
diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c
20
index XXXXXXX..XXXXXXX 100644
44
index XXXXXXX..XXXXXXX 100644
21
--- a/hw/arm/xlnx-zcu102.c
45
--- a/hw/display/xlnx_dp.c
22
+++ b/hw/arm/xlnx-zcu102.c
46
+++ b/hw/display/xlnx_dp.c
23
@@ -XXX,XX +XXX,XX @@ typedef struct XlnxZCU102 {
47
@@ -XXX,XX +XXX,XX @@ static uint8_t xlnx_dp_aux_pop_rx_fifo(XlnxDPState *s)
24
48
uint8_t ret;
25
XlnxZynqMPState soc;
49
26
MemoryRegion ddr_ram;
50
if (fifo8_is_empty(&s->rx_fifo)) {
27
+
51
- DPRINTF("rx_fifo underflow..\n");
28
+ bool secure;
52
- abort();
29
} XlnxZCU102;
53
+ qemu_log_mask(LOG_GUEST_ERROR,
30
54
+ "%s: Reading empty RX_FIFO\n",
31
#define TYPE_ZCU102_MACHINE MACHINE_TYPE_NAME("xlnx-zcu102")
55
+ __func__);
32
@@ -XXX,XX +XXX,XX @@ typedef struct XlnxZCU102 {
56
+ /*
33
57
+ * The datasheet is not clear about the reset value, it seems
34
static struct arm_boot_info xlnx_zcu102_binfo;
58
+ * to be unspecified. We choose to return '0'.
35
59
+ */
36
+static bool zcu102_get_secure(Object *obj, Error **errp)
60
+ ret = 0;
37
+{
61
+ } else {
38
+ XlnxZCU102 *s = ZCU102_MACHINE(obj);
62
+ ret = fifo8_pop(&s->rx_fifo);
39
+
63
+ DPRINTF("pop 0x%" PRIX8 " from rx_fifo.\n", ret);
40
+ return s->secure;
64
}
41
+}
65
- ret = fifo8_pop(&s->rx_fifo);
42
+
66
- DPRINTF("pop 0x%" PRIX8 " from rx_fifo.\n", ret);
43
+static void zcu102_set_secure(Object *obj, bool value, Error **errp)
67
return ret;
44
+{
45
+ XlnxZCU102 *s = ZCU102_MACHINE(obj);
46
+
47
+ s->secure = value;
48
+}
49
+
50
static void xlnx_zynqmp_init(XlnxZCU102 *s, MachineState *machine)
51
{
52
int i;
53
@@ -XXX,XX +XXX,XX @@ static void xlnx_zynqmp_init(XlnxZCU102 *s, MachineState *machine)
54
55
object_property_set_link(OBJECT(&s->soc), OBJECT(&s->ddr_ram),
56
"ddr-ram", &error_abort);
57
+ object_property_set_bool(OBJECT(&s->soc), s->secure, "secure",
58
+ &error_fatal);
59
60
object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal);
61
62
@@ -XXX,XX +XXX,XX @@ static void xlnx_ep108_init(MachineState *machine)
63
64
static void xlnx_ep108_machine_instance_init(Object *obj)
65
{
66
+ XlnxZCU102 *s = EP108_MACHINE(obj);
67
+
68
+ /* EP108, we don't support setting secure */
69
+ s->secure = false;
70
}
68
}
71
69
72
static void xlnx_ep108_machine_class_init(ObjectClass *oc, void *data)
73
@@ -XXX,XX +XXX,XX @@ static void xlnx_zcu102_init(MachineState *machine)
74
75
static void xlnx_zcu102_machine_instance_init(Object *obj)
76
{
77
+ XlnxZCU102 *s = ZCU102_MACHINE(obj);
78
+
79
+ /* Default to secure mode being disabled */
80
+ s->secure = false;
81
+ object_property_add_bool(obj, "secure", zcu102_get_secure,
82
+ zcu102_set_secure, NULL);
83
+ object_property_set_description(obj, "secure",
84
+ "Set on/off to enable/disable the ARM "
85
+ "Security Extensions (TrustZone)",
86
+ NULL);
87
}
88
89
static void xlnx_zcu102_machine_class_init(ObjectClass *oc, void *data)
90
--
70
--
91
2.7.4
71
2.20.1
92
72
93
73
diff view generated by jsdifflib
1
From: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
1
From: David Engraf <david.engraf@sysgo.com>
2
2
3
Let's provide the GPEX host bridge with the INTx/gsi mapping. This is
3
Using the whole 128 MiB flash in non-secure mode is not working because
4
needed for INTx/gsi routing.
4
virt_flash_fdt() expects the same address for secure_sysmem and sysmem.
5
This is not correctly handled by caller because it forwards NULL for
6
secure_sysmem in non-secure flash mode.
5
7
6
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
8
Fixed by using sysmem when secure_sysmem is NULL.
7
Signed-off-by: Tushar Jagad <tushar.jagad@linaro.org>
9
8
Signed-off-by: Eric Auger <eric.auger@redhat.com>
10
Signed-off-by: David Engraf <david.engraf@sysgo.com>
9
Reviewed-by: Andrew Jones <drjones@redhat.com>
11
Message-id: 20190712075002.14326-1-david.engraf@sysgo.com
10
Tested-by: Feng Kan <fkan@apm.com>
12
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
11
Message-id: 1505296004-6798-3-git-send-email-eric.auger@redhat.com
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
---
14
---
14
hw/arm/virt.c | 1 +
15
hw/arm/virt.c | 2 +-
15
1 file changed, 1 insertion(+)
16
1 file changed, 1 insertion(+), 1 deletion(-)
16
17
17
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
18
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
18
index XXXXXXX..XXXXXXX 100644
19
index XXXXXXX..XXXXXXX 100644
19
--- a/hw/arm/virt.c
20
--- a/hw/arm/virt.c
20
+++ b/hw/arm/virt.c
21
+++ b/hw/arm/virt.c
21
@@ -XXX,XX +XXX,XX @@ static void create_pcie(const VirtMachineState *vms, qemu_irq *pic)
22
@@ -XXX,XX +XXX,XX @@ static void machvirt_init(MachineState *machine)
22
23
&machine->device_memory->mr);
23
for (i = 0; i < GPEX_NUM_IRQS; i++) {
24
sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, pic[irq + i]);
25
+ gpex_set_irq_num(GPEX_HOST(dev), i, irq + i);
26
}
24
}
27
25
28
pci = PCI_HOST_BRIDGE(dev);
26
- virt_flash_fdt(vms, sysmem, secure_sysmem);
27
+ virt_flash_fdt(vms, sysmem, secure_sysmem ?: sysmem);
28
29
create_gic(vms, pic);
30
29
--
31
--
30
2.7.4
32
2.20.1
31
33
32
34
diff view generated by jsdifflib
1
From: Alistair Francis <alistair.francis@xilinx.com>
1
The PL031 RTC tracks the difference between the guest RTC
2
2
and the host RTC using a tick_offset field. For migration,
3
In preperation for future work let's manually create the Xilnx machines.
3
however, we currently always migrate the offset between
4
This will allow us to set properties for the machines in the future.
4
the guest and the vm_clock, even if the RTC clock is not
5
5
the same as the vm_clock; this was an attempt to retain
6
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
6
migration backwards compatibility.
7
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
7
8
Unfortunately this results in the RTC behaving oddly across
9
a VM state save and restore -- since the VM clock stands still
10
across save-then-restore, regardless of how much real world
11
time has elapsed, the guest RTC ends up out of sync with the
12
host RTC in the restored VM.
13
14
Fix this by migrating the raw tick_offset. To retain migration
15
compatibility as far as possible, we have a new property
16
migrate-tick-offset; by default this is 'true' and we will
17
migrate the true tick offset in a new subsection; if the
18
incoming data has no subsection we fall back to the old
19
vm_clock-based offset information, so old->new migration
20
compatibility is preserved. For complete new->old migration
21
compatibility, the property is set to 'false' for 4.0 and
22
earlier machine types (this will only affect 'virt-4.0'
23
and below, as none of the other pl031-using machines are
24
versioned).
25
26
Reported-by: Russell King <rmk@armlinux.org.uk>
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
27
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
28
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
29
Message-id: 20190709143912.28905-1-peter.maydell@linaro.org
9
---
30
---
10
hw/arm/xlnx-zcu102.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++-----
31
include/hw/timer/pl031.h | 2 +
11
1 file changed, 67 insertions(+), 7 deletions(-)
32
hw/core/machine.c | 1 +
12
33
hw/timer/pl031.c | 92 ++++++++++++++++++++++++++++++++++++++--
13
diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c
34
3 files changed, 91 insertions(+), 4 deletions(-)
35
36
diff --git a/include/hw/timer/pl031.h b/include/hw/timer/pl031.h
14
index XXXXXXX..XXXXXXX 100644
37
index XXXXXXX..XXXXXXX 100644
15
--- a/hw/arm/xlnx-zcu102.c
38
--- a/include/hw/timer/pl031.h
16
+++ b/hw/arm/xlnx-zcu102.c
39
+++ b/include/hw/timer/pl031.h
17
@@ -XXX,XX +XXX,XX @@
40
@@ -XXX,XX +XXX,XX @@ typedef struct PL031State {
18
#include "qemu/log.h"
41
*/
19
42
uint32_t tick_offset_vmstate;
20
typedef struct XlnxZCU102 {
43
uint32_t tick_offset;
21
+ MachineState parent_obj;
44
+ bool tick_offset_migrated;
22
+
45
+ bool migrate_tick_offset;
23
XlnxZynqMPState soc;
46
24
MemoryRegion ddr_ram;
47
uint32_t mr;
25
} XlnxZCU102;
48
uint32_t lr;
26
49
diff --git a/hw/core/machine.c b/hw/core/machine.c
27
+#define TYPE_ZCU102_MACHINE MACHINE_TYPE_NAME("xlnx-zcu102")
50
index XXXXXXX..XXXXXXX 100644
28
+#define ZCU102_MACHINE(obj) \
51
--- a/hw/core/machine.c
29
+ OBJECT_CHECK(XlnxZCU102, (obj), TYPE_ZCU102_MACHINE)
52
+++ b/hw/core/machine.c
30
+
53
@@ -XXX,XX +XXX,XX @@ GlobalProperty hw_compat_4_0[] = {
31
+#define TYPE_EP108_MACHINE MACHINE_TYPE_NAME("xlnx-ep108")
54
{ "virtio-gpu-pci", "edid", "false" },
32
+#define EP108_MACHINE(obj) \
55
{ "virtio-device", "use-started", "false" },
33
+ OBJECT_CHECK(XlnxZCU102, (obj), TYPE_EP108_MACHINE)
56
{ "virtio-balloon-device", "qemu-4-0-config-size", "true" },
34
+
57
+ { "pl031", "migrate-tick-offset", "false" },
35
static struct arm_boot_info xlnx_zcu102_binfo;
58
};
36
59
const size_t hw_compat_4_0_len = G_N_ELEMENTS(hw_compat_4_0);
37
-static void xlnx_zcu102_init(MachineState *machine)
60
38
+static void xlnx_zynqmp_init(XlnxZCU102 *s, MachineState *machine)
61
diff --git a/hw/timer/pl031.c b/hw/timer/pl031.c
62
index XXXXXXX..XXXXXXX 100644
63
--- a/hw/timer/pl031.c
64
+++ b/hw/timer/pl031.c
65
@@ -XXX,XX +XXX,XX @@ static int pl031_pre_save(void *opaque)
39
{
66
{
40
- XlnxZCU102 *s = g_new0(XlnxZCU102, 1);
67
PL031State *s = opaque;
41
int i;
68
42
uint64_t ram_size = machine->ram_size;
69
- /* tick_offset is base_time - rtc_clock base time. Instead, we want to
43
70
- * store the base time relative to the QEMU_CLOCK_VIRTUAL for backwards-compatibility. */
44
@@ -XXX,XX +XXX,XX @@ static void xlnx_zcu102_init(MachineState *machine)
71
+ /*
45
arm_load_kernel(s->soc.boot_cpu_ptr, &xlnx_zcu102_binfo);
72
+ * The PL031 device model code uses the tick_offset field, which is
73
+ * the offset between what the guest RTC should read and what the
74
+ * QEMU rtc_clock reads:
75
+ * guest_rtc = rtc_clock + tick_offset
76
+ * and so
77
+ * tick_offset = guest_rtc - rtc_clock
78
+ *
79
+ * We want to migrate this offset, which sounds straightforward.
80
+ * Unfortunately older versions of QEMU migrated a conversion of this
81
+ * offset into an offset from the vm_clock. (This was in turn an
82
+ * attempt to be compatible with even older QEMU versions, but it
83
+ * has incorrect behaviour if the rtc_clock is not the same as the
84
+ * vm_clock.) So we put the actual tick_offset into a migration
85
+ * subsection, and the backwards-compatible time-relative-to-vm_clock
86
+ * in the main migration state.
87
+ *
88
+ * Calculate base time relative to QEMU_CLOCK_VIRTUAL:
89
+ */
90
int64_t delta = qemu_clock_get_ns(rtc_clock) - qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
91
s->tick_offset_vmstate = s->tick_offset + delta / NANOSECONDS_PER_SECOND;
92
93
return 0;
46
}
94
}
47
95
48
-static void xlnx_ep108_machine_init(MachineClass *mc)
96
+static int pl031_pre_load(void *opaque)
49
+static void xlnx_ep108_init(MachineState *machine)
50
+{
97
+{
51
+ XlnxZCU102 *s = EP108_MACHINE(machine);
98
+ PL031State *s = opaque;
52
+
99
+
53
+ xlnx_zynqmp_init(s, machine);
100
+ s->tick_offset_migrated = false;
101
+ return 0;
54
+}
102
+}
55
+
103
+
56
+static void xlnx_ep108_machine_instance_init(Object *obj)
104
static int pl031_post_load(void *opaque, int version_id)
57
{
105
{
106
PL031State *s = opaque;
107
108
- int64_t delta = qemu_clock_get_ns(rtc_clock) - qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
109
- s->tick_offset = s->tick_offset_vmstate - delta / NANOSECONDS_PER_SECOND;
110
+ /*
111
+ * If we got the tick_offset subsection, then we can just use
112
+ * the value in that. Otherwise the source is an older QEMU and
113
+ * has given us the offset from the vm_clock; convert it back to
114
+ * an offset from the rtc_clock. This will cause time to incorrectly
115
+ * go backwards compared to the host RTC, but this is unavoidable.
116
+ */
117
+
118
+ if (!s->tick_offset_migrated) {
119
+ int64_t delta = qemu_clock_get_ns(rtc_clock) -
120
+ qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
121
+ s->tick_offset = s->tick_offset_vmstate -
122
+ delta / NANOSECONDS_PER_SECOND;
123
+ }
124
pl031_set_alarm(s);
125
return 0;
126
}
127
128
+static int pl031_tick_offset_post_load(void *opaque, int version_id)
129
+{
130
+ PL031State *s = opaque;
131
+
132
+ s->tick_offset_migrated = true;
133
+ return 0;
58
+}
134
+}
59
+
135
+
60
+static void xlnx_ep108_machine_class_init(ObjectClass *oc, void *data)
136
+static bool pl031_tick_offset_needed(void *opaque)
61
+{
137
+{
62
+ MachineClass *mc = MACHINE_CLASS(oc);
138
+ PL031State *s = opaque;
63
+
139
+
64
mc->desc = "Xilinx ZynqMP EP108 board";
140
+ return s->migrate_tick_offset;
65
- mc->init = xlnx_zcu102_init;
141
+}
66
+ mc->init = xlnx_ep108_init;
142
+
67
mc->block_default_type = IF_IDE;
143
+static const VMStateDescription vmstate_pl031_tick_offset = {
68
mc->units_per_default_bus = 1;
144
+ .name = "pl031/tick-offset",
69
mc->ignore_memory_transaction_failures = true;
145
+ .version_id = 1,
146
+ .minimum_version_id = 1,
147
+ .needed = pl031_tick_offset_needed,
148
+ .post_load = pl031_tick_offset_post_load,
149
+ .fields = (VMStateField[]) {
150
+ VMSTATE_UINT32(tick_offset, PL031State),
151
+ VMSTATE_END_OF_LIST()
152
+ }
153
+};
154
+
155
static const VMStateDescription vmstate_pl031 = {
156
.name = "pl031",
157
.version_id = 1,
158
.minimum_version_id = 1,
159
.pre_save = pl031_pre_save,
160
+ .pre_load = pl031_pre_load,
161
.post_load = pl031_post_load,
162
.fields = (VMStateField[]) {
163
VMSTATE_UINT32(tick_offset_vmstate, PL031State),
164
@@ -XXX,XX +XXX,XX @@ static const VMStateDescription vmstate_pl031 = {
165
VMSTATE_UINT32(im, PL031State),
166
VMSTATE_UINT32(is, PL031State),
167
VMSTATE_END_OF_LIST()
168
+ },
169
+ .subsections = (const VMStateDescription*[]) {
170
+ &vmstate_pl031_tick_offset,
171
+ NULL
172
}
173
};
174
175
+static Property pl031_properties[] = {
176
+ /*
177
+ * True to correctly migrate the tick offset of the RTC. False to
178
+ * obtain backward migration compatibility with older QEMU versions,
179
+ * at the expense of the guest RTC going backwards compared with the
180
+ * host RTC when the VM is saved/restored if using -rtc host.
181
+ * (Even if set to 'true' older QEMU can migrate forward to newer QEMU;
182
+ * 'false' also permits newer QEMU to migrate to older QEMU.)
183
+ */
184
+ DEFINE_PROP_BOOL("migrate-tick-offset",
185
+ PL031State, migrate_tick_offset, true),
186
+ DEFINE_PROP_END_OF_LIST()
187
+};
188
+
189
static void pl031_class_init(ObjectClass *klass, void *data)
190
{
191
DeviceClass *dc = DEVICE_CLASS(klass);
192
193
dc->vmsd = &vmstate_pl031;
194
+ dc->props = pl031_properties;
70
}
195
}
71
196
72
-DEFINE_MACHINE("xlnx-ep108", xlnx_ep108_machine_init)
197
static const TypeInfo pl031_info = {
73
+static const TypeInfo xlnx_ep108_machine_init_typeinfo = {
74
+ .name = MACHINE_TYPE_NAME("xlnx-ep108"),
75
+ .parent = TYPE_MACHINE,
76
+ .class_init = xlnx_ep108_machine_class_init,
77
+ .instance_init = xlnx_ep108_machine_instance_init,
78
+ .instance_size = sizeof(XlnxZCU102),
79
+};
80
81
-static void xlnx_zcu102_machine_init(MachineClass *mc)
82
+static void xlnx_ep108_machine_init_register_types(void)
83
{
84
+ type_register_static(&xlnx_ep108_machine_init_typeinfo);
85
+}
86
+
87
+static void xlnx_zcu102_init(MachineState *machine)
88
+{
89
+ XlnxZCU102 *s = ZCU102_MACHINE(machine);
90
+
91
+ xlnx_zynqmp_init(s, machine);
92
+}
93
+
94
+static void xlnx_zcu102_machine_instance_init(Object *obj)
95
+{
96
+}
97
+
98
+static void xlnx_zcu102_machine_class_init(ObjectClass *oc, void *data)
99
+{
100
+ MachineClass *mc = MACHINE_CLASS(oc);
101
+
102
mc->desc = "Xilinx ZynqMP ZCU102 board";
103
mc->init = xlnx_zcu102_init;
104
mc->block_default_type = IF_IDE;
105
@@ -XXX,XX +XXX,XX @@ static void xlnx_zcu102_machine_init(MachineClass *mc)
106
mc->ignore_memory_transaction_failures = true;
107
}
108
109
-DEFINE_MACHINE("xlnx-zcu102", xlnx_zcu102_machine_init)
110
+static const TypeInfo xlnx_zcu102_machine_init_typeinfo = {
111
+ .name = MACHINE_TYPE_NAME("xlnx-zcu102"),
112
+ .parent = TYPE_MACHINE,
113
+ .class_init = xlnx_zcu102_machine_class_init,
114
+ .instance_init = xlnx_zcu102_machine_instance_init,
115
+ .instance_size = sizeof(XlnxZCU102),
116
+};
117
+
118
+static void xlnx_zcu102_machine_init_register_types(void)
119
+{
120
+ type_register_static(&xlnx_zcu102_machine_init_typeinfo);
121
+}
122
+
123
+type_init(xlnx_zcu102_machine_init_register_types)
124
+type_init(xlnx_ep108_machine_init_register_types)
125
--
198
--
126
2.7.4
199
2.20.1
127
200
128
201
diff view generated by jsdifflib
1
For M profile we must clear the exclusive monitor on reset, exception
1
The ARMv5 architecture didn't specify detailed per-feature ID
2
entry and exception exit. We weren't doing any of these things; fix
2
registers. Now that we're using the MVFR0 register fields to
3
this bug.
3
gate the existence of VFP instructions, we need to set up
4
the correct values in the cpu->isar structure so that we still
5
provide an FPU to the guest.
4
6
7
This fixes a regression in the arm926 and arm1026 CPUs, which
8
are the only ones that both have VFP and are ARMv5 or earlier.
9
This regression was introduced by the VFP refactoring, and more
10
specifically by commits 1120827fa182f0e76 and 266bd25c485597c,
11
which accidentally disabled VFP short-vector support and
12
double-precision support on these CPUs.
13
14
Fixes: 1120827fa182f0e
15
Fixes: 266bd25c485597c
16
Fixes: https://bugs.launchpad.net/qemu/+bug/1836192
17
Reported-by: Christophe Lyon <christophe.lyon@linaro.org>
5
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
18
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
7
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
19
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
8
Message-id: 1505137930-13255-3-git-send-email-peter.maydell@linaro.org
20
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
21
Tested-by: Christophe Lyon <christophe.lyon@linaro.org>
22
Message-id: 20190711131241.22231-1-peter.maydell@linaro.org
9
---
23
---
10
target/arm/internals.h | 10 ++++++++++
24
target/arm/cpu.c | 12 ++++++++++++
11
target/arm/cpu.c | 6 ++++++
25
1 file changed, 12 insertions(+)
12
target/arm/helper.c | 2 ++
13
target/arm/op_helper.c | 2 +-
14
4 files changed, 19 insertions(+), 1 deletion(-)
15
26
16
diff --git a/target/arm/internals.h b/target/arm/internals.h
17
index XXXXXXX..XXXXXXX 100644
18
--- a/target/arm/internals.h
19
+++ b/target/arm/internals.h
20
@@ -XXX,XX +XXX,XX @@ void arm_handle_psci_call(ARMCPU *cpu);
21
#endif
22
23
/**
24
+ * arm_clear_exclusive: clear the exclusive monitor
25
+ * @env: CPU env
26
+ * Clear the CPU's exclusive monitor, like the guest CLREX instruction.
27
+ */
28
+static inline void arm_clear_exclusive(CPUARMState *env)
29
+{
30
+ env->exclusive_addr = -1;
31
+}
32
+
33
+/**
34
* ARMMMUFaultInfo: Information describing an ARM MMU Fault
35
* @s2addr: Address that caused a fault at stage 2
36
* @stage2: True if we faulted at stage 2
37
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
27
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
38
index XXXXXXX..XXXXXXX 100644
28
index XXXXXXX..XXXXXXX 100644
39
--- a/target/arm/cpu.c
29
--- a/target/arm/cpu.c
40
+++ b/target/arm/cpu.c
30
+++ b/target/arm/cpu.c
41
@@ -XXX,XX +XXX,XX @@ static void arm_cpu_reset(CPUState *s)
31
@@ -XXX,XX +XXX,XX @@ static void arm926_initfn(Object *obj)
42
env->regs[15] = 0xFFFF0000;
32
* set the field to indicate Jazelle support within QEMU.
43
}
33
*/
44
34
cpu->isar.id_isar1 = FIELD_DP32(cpu->isar.id_isar1, ID_ISAR1, JAZELLE, 1);
45
+ /* M profile requires that reset clears the exclusive monitor;
35
+ /*
46
+ * A profile does not, but clearing it makes more sense than having it
36
+ * Similarly, we need to set MVFR0 fields to enable double precision
47
+ * set with an exclusive access on address zero.
37
+ * and short vector support even though ARMv5 doesn't have this register.
48
+ */
38
+ */
49
+ arm_clear_exclusive(env);
39
+ cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSHVEC, 1);
50
+
40
+ cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPDP, 1);
51
env->vfp.xregs[ARM_VFP_FPEXC] = 0;
52
#endif
53
54
diff --git a/target/arm/helper.c b/target/arm/helper.c
55
index XXXXXXX..XXXXXXX 100644
56
--- a/target/arm/helper.c
57
+++ b/target/arm/helper.c
58
@@ -XXX,XX +XXX,XX @@ static void v7m_exception_taken(ARMCPU *cpu, uint32_t lr)
59
60
armv7m_nvic_acknowledge_irq(env->nvic);
61
switch_v7m_sp(env, 0);
62
+ arm_clear_exclusive(env);
63
/* Clear IT bits */
64
env->condexec_bits = 0;
65
env->regs[14] = lr;
66
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
67
}
68
69
/* Otherwise, we have a successful exception exit. */
70
+ arm_clear_exclusive(env);
71
qemu_log_mask(CPU_LOG_INT, "...successful exception return\n");
72
}
41
}
73
42
74
diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c
43
static void arm946_initfn(Object *obj)
75
index XXXXXXX..XXXXXXX 100644
44
@@ -XXX,XX +XXX,XX @@ static void arm1026_initfn(Object *obj)
76
--- a/target/arm/op_helper.c
45
* set the field to indicate Jazelle support within QEMU.
77
+++ b/target/arm/op_helper.c
46
*/
78
@@ -XXX,XX +XXX,XX @@ void HELPER(exception_return)(CPUARMState *env)
47
cpu->isar.id_isar1 = FIELD_DP32(cpu->isar.id_isar1, ID_ISAR1, JAZELLE, 1);
79
48
+ /*
80
aarch64_save_sp(env, cur_el);
49
+ * Similarly, we need to set MVFR0 fields to enable double precision
81
50
+ * and short vector support even though ARMv5 doesn't have this register.
82
- env->exclusive_addr = -1;
51
+ */
83
+ arm_clear_exclusive(env);
52
+ cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPSHVEC, 1);
84
53
+ cpu->isar.mvfr0 = FIELD_DP32(cpu->isar.mvfr0, MVFR0, FPDP, 1);
85
/* We must squash the PSTATE.SS bit to zero unless both of the
54
86
* following hold:
55
{
56
/* The 1026 had an IFAR at c6,c0,0,1 rather than the ARMv6 c6,c0,0,2 */
87
--
57
--
88
2.7.4
58
2.20.1
89
59
90
60
diff view generated by jsdifflib
Deleted patch
1
For a bus fault, the M profile BFSR bit PRECISERR means a bus
2
fault on a data access, and IBUSERR means a bus fault on an
3
instruction access. We had these the wrong way around; fix this.
4
1
5
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
7
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
8
Message-id: 1505137930-13255-4-git-send-email-peter.maydell@linaro.org
9
---
10
target/arm/helper.c | 8 ++++----
11
1 file changed, 4 insertions(+), 4 deletions(-)
12
13
diff --git a/target/arm/helper.c b/target/arm/helper.c
14
index XXXXXXX..XXXXXXX 100644
15
--- a/target/arm/helper.c
16
+++ b/target/arm/helper.c
17
@@ -XXX,XX +XXX,XX @@ void arm_v7m_cpu_do_interrupt(CPUState *cs)
18
case 0x8: /* External Abort */
19
switch (cs->exception_index) {
20
case EXCP_PREFETCH_ABORT:
21
- env->v7m.cfsr[M_REG_NS] |= R_V7M_CFSR_PRECISERR_MASK;
22
- qemu_log_mask(CPU_LOG_INT, "...with CFSR.PRECISERR\n");
23
+ env->v7m.cfsr[M_REG_NS] |= R_V7M_CFSR_IBUSERR_MASK;
24
+ qemu_log_mask(CPU_LOG_INT, "...with CFSR.IBUSERR\n");
25
break;
26
case EXCP_DATA_ABORT:
27
env->v7m.cfsr[M_REG_NS] |=
28
- (R_V7M_CFSR_IBUSERR_MASK | R_V7M_CFSR_BFARVALID_MASK);
29
+ (R_V7M_CFSR_PRECISERR_MASK | R_V7M_CFSR_BFARVALID_MASK);
30
env->v7m.bfar = env->exception.vaddress;
31
qemu_log_mask(CPU_LOG_INT,
32
- "...with CFSR.IBUSERR and BFAR 0x%x\n",
33
+ "...with CFSR.PRECISERR and BFAR 0x%x\n",
34
env->v7m.bfar);
35
break;
36
}
37
--
38
2.7.4
39
40
diff view generated by jsdifflib
1
In several places we were unconditionally applying the
1
In the M-profile architecture, when we do a vector table fetch and it
2
nvic_gprio_mask() to a priority value. This is incorrect
2
fails, we need to report a HardFault. Whether this is a Secure HF or
3
if the priority is one of the fixed negative priority
3
a NonSecure HF depends on several things. If AIRCR.BFHFNMINS is 0
4
values (for NMI and HardFault), so don't do it.
4
then HF is always Secure, because there is no NonSecure HardFault.
5
Otherwise, the answer depends on whether the 'underlying exception'
6
(MemManage, BusFault, SecureFault) targets Secure or NonSecure. (In
7
the pseudocode, this is handled in the Vector() function: the final
8
exc.isSecure is calculated by looking at the exc.isSecure from the
9
exception returned from the memory access, not the isSecure input
10
argument.)
5
11
6
This bug would have caused both NMI and HardFault to be
12
We weren't doing this correctly, because we were looking at
7
considered as the same priority and so NMI wouldn't
13
the target security domain of the exception we were trying to
8
correctly preempt HardFault.
14
load the vector table entry for. This produces errors of two kinds:
15
* a load from the NS vector table which hits the "NS access
16
to S memory" SecureFault should end up as a Secure HardFault,
17
but we were raising an NS HardFault
18
* a load from the S vector table which causes a BusFault
19
should raise an NS HardFault if BFHFNMINS == 1 (because
20
in that case all BusFaults are NonSecure), but we were raising
21
a Secure HardFault
22
23
Correct the logic.
24
25
We also fix a comment error where we claimed that we might
26
be escalating MemManage to HardFault, and forgot about SecureFault.
27
(Vector loads can never hit MPU access faults, because they're
28
always aligned and always use the default address map.)
9
29
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
30
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
31
Message-id: 20190705094823.28905-1-peter.maydell@linaro.org
12
Message-id: 1505137930-13255-5-git-send-email-peter.maydell@linaro.org
13
---
32
---
14
hw/intc/armv7m_nvic.c | 11 +++++++++--
33
target/arm/m_helper.c | 21 +++++++++++++++++----
15
1 file changed, 9 insertions(+), 2 deletions(-)
34
1 file changed, 17 insertions(+), 4 deletions(-)
16
35
17
diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
36
diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c
18
index XXXXXXX..XXXXXXX 100644
37
index XXXXXXX..XXXXXXX 100644
19
--- a/hw/intc/armv7m_nvic.c
38
--- a/target/arm/m_helper.c
20
+++ b/hw/intc/armv7m_nvic.c
39
+++ b/target/arm/m_helper.c
21
@@ -XXX,XX +XXX,XX @@ static void nvic_recompute_state(NVICState *s)
40
@@ -XXX,XX +XXX,XX @@ static bool arm_v7m_load_vector(ARMCPU *cpu, int exc, bool targets_secure,
41
if (sattrs.ns) {
42
attrs.secure = false;
43
} else if (!targets_secure) {
44
- /* NS access to S memory */
45
+ /*
46
+ * NS access to S memory: the underlying exception which we escalate
47
+ * to HardFault is SecureFault, which always targets Secure.
48
+ */
49
+ exc_secure = true;
50
goto load_fail;
22
}
51
}
23
}
52
}
24
53
@@ -XXX,XX +XXX,XX @@ static bool arm_v7m_load_vector(ARMCPU *cpu, int exc, bool targets_secure,
25
+ if (active_prio > 0) {
54
vector_entry = address_space_ldl(arm_addressspace(cs, attrs), addr,
26
+ active_prio &= nvic_gprio_mask(s);
55
attrs, &result);
56
if (result != MEMTX_OK) {
57
+ /*
58
+ * Underlying exception is BusFault: its target security state
59
+ * depends on BFHFNMINS.
60
+ */
61
+ exc_secure = !(cpu->env.v7m.aircr & R_V7M_AIRCR_BFHFNMINS_MASK);
62
goto load_fail;
63
}
64
*pvec = vector_entry;
65
@@ -XXX,XX +XXX,XX @@ load_fail:
66
/*
67
* All vector table fetch fails are reported as HardFault, with
68
* HFSR.VECTTBL and .FORCED set. (FORCED is set because
69
- * technically the underlying exception is a MemManage or BusFault
70
+ * technically the underlying exception is a SecureFault or BusFault
71
* that is escalated to HardFault.) This is a terminal exception,
72
* so we will either take the HardFault immediately or else enter
73
* lockup (the latter case is handled in armv7m_nvic_set_pending_derived()).
74
+ * The HardFault is Secure if BFHFNMINS is 0 (meaning that all HFs are
75
+ * secure); otherwise it targets the same security state as the
76
+ * underlying exception.
77
*/
78
- exc_secure = targets_secure ||
79
- !(cpu->env.v7m.aircr & R_V7M_AIRCR_BFHFNMINS_MASK);
80
+ if (!(cpu->env.v7m.aircr & R_V7M_AIRCR_BFHFNMINS_MASK)) {
81
+ exc_secure = true;
27
+ }
82
+ }
28
+
83
env->v7m.hfsr |= R_V7M_HFSR_VECTTBL_MASK | R_V7M_HFSR_FORCED_MASK;
29
s->vectpending = pend_irq;
84
armv7m_nvic_set_pending_derived(env->nvic, ARMV7M_EXCP_HARD, exc_secure);
30
- s->exception_prio = active_prio & nvic_gprio_mask(s);
85
return false;
31
+ s->exception_prio = active_prio;
32
33
trace_nvic_recompute_state(s->vectpending, s->exception_prio);
34
}
35
@@ -XXX,XX +XXX,XX @@ void armv7m_nvic_acknowledge_irq(void *opaque)
36
assert(vec->enabled);
37
assert(vec->pending);
38
39
- pendgroupprio = vec->prio & nvic_gprio_mask(s);
40
+ pendgroupprio = vec->prio;
41
+ if (pendgroupprio > 0) {
42
+ pendgroupprio &= nvic_gprio_mask(s);
43
+ }
44
assert(pendgroupprio < running);
45
46
trace_nvic_acknowledge_irq(pending, vec->prio);
47
--
86
--
48
2.7.4
87
2.20.1
49
88
50
89
diff view generated by jsdifflib
Deleted patch
1
In do_v7m_exception_exit(), there's no need to force the high 4
2
bits of 'type' to 1 when calling v7m_exception_taken(), because
3
we know that they're always 1 or we could not have got to this
4
"handle return to magic exception return address" code. Remove
5
the unnecessary ORs.
6
1
7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
9
Acked-by: Alistair Francis <alistair.francis@xilinx.com>
10
Message-id: 1505137930-13255-6-git-send-email-peter.maydell@linaro.org
11
---
12
target/arm/helper.c | 4 ++--
13
1 file changed, 2 insertions(+), 2 deletions(-)
14
15
diff --git a/target/arm/helper.c b/target/arm/helper.c
16
index XXXXXXX..XXXXXXX 100644
17
--- a/target/arm/helper.c
18
+++ b/target/arm/helper.c
19
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
20
*/
21
env->v7m.cfsr[env->v7m.secure] |= R_V7M_CFSR_INVPC_MASK;
22
armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE);
23
- v7m_exception_taken(cpu, type | 0xf0000000);
24
+ v7m_exception_taken(cpu, type);
25
qemu_log_mask(CPU_LOG_INT, "...taking UsageFault on existing "
26
"stackframe: failed exception return integrity check\n");
27
return;
28
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
29
armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE);
30
env->v7m.cfsr[env->v7m.secure] |= R_V7M_CFSR_INVPC_MASK;
31
v7m_push_stack(cpu);
32
- v7m_exception_taken(cpu, type | 0xf0000000);
33
+ v7m_exception_taken(cpu, type);
34
qemu_log_mask(CPU_LOG_INT, "...taking UsageFault on new stackframe: "
35
"failed exception return integrity check\n");
36
return;
37
--
38
2.7.4
39
40
diff view generated by jsdifflib
Deleted patch
1
The exception-return magic values get some new bits in v8M, which
2
makes some bit definitions for them worthwhile.
3
1
4
We don't use the bit definitions for the switch on the low bits
5
which checks the return type for v7M, because this is defined
6
in the v7M ARM ARM as a set of valid values rather than via
7
per-bit checks.
8
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
11
Message-id: 1505137930-13255-7-git-send-email-peter.maydell@linaro.org
12
---
13
target/arm/internals.h | 10 ++++++++++
14
target/arm/helper.c | 14 +++++++++-----
15
2 files changed, 19 insertions(+), 5 deletions(-)
16
17
diff --git a/target/arm/internals.h b/target/arm/internals.h
18
index XXXXXXX..XXXXXXX 100644
19
--- a/target/arm/internals.h
20
+++ b/target/arm/internals.h
21
@@ -XXX,XX +XXX,XX @@ FIELD(V7M_CONTROL, NPRIV, 0, 1)
22
FIELD(V7M_CONTROL, SPSEL, 1, 1)
23
FIELD(V7M_CONTROL, FPCA, 2, 1)
24
25
+/* Bit definitions for v7M exception return payload */
26
+FIELD(V7M_EXCRET, ES, 0, 1)
27
+FIELD(V7M_EXCRET, RES0, 1, 1)
28
+FIELD(V7M_EXCRET, SPSEL, 2, 1)
29
+FIELD(V7M_EXCRET, MODE, 3, 1)
30
+FIELD(V7M_EXCRET, FTYPE, 4, 1)
31
+FIELD(V7M_EXCRET, DCRS, 5, 1)
32
+FIELD(V7M_EXCRET, S, 6, 1)
33
+FIELD(V7M_EXCRET, RES1, 7, 25) /* including the must-be-1 prefix */
34
+
35
/*
36
* For AArch64, map a given EL to an index in the banked_spsr array.
37
* Note that this mapping and the AArch32 mapping defined in bank_number()
38
diff --git a/target/arm/helper.c b/target/arm/helper.c
39
index XXXXXXX..XXXXXXX 100644
40
--- a/target/arm/helper.c
41
+++ b/target/arm/helper.c
42
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
43
" previous exception %d\n",
44
type, env->v7m.exception);
45
46
- if (extract32(type, 5, 23) != extract32(-1, 5, 23)) {
47
+ if ((type & R_V7M_EXCRET_RES1_MASK) != R_V7M_EXCRET_RES1_MASK) {
48
qemu_log_mask(LOG_GUEST_ERROR, "M profile: zero high bits in exception "
49
"exit PC value 0x%" PRIx32 " are UNPREDICTABLE\n", type);
50
}
51
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
52
* which security state's faultmask to clear. (v8M ARM ARM R_KBNF.)
53
*/
54
if (arm_feature(env, ARM_FEATURE_M_SECURITY)) {
55
- int es = type & 1;
56
+ int es = type & R_V7M_EXCRET_ES_MASK;
57
if (armv7m_nvic_raw_execution_priority(env->nvic) >= 0) {
58
env->v7m.faultmask[es] = 0;
59
}
60
@@ -XXX,XX +XXX,XX @@ void arm_v7m_cpu_do_interrupt(CPUState *cs)
61
return; /* Never happens. Keep compiler happy. */
62
}
63
64
- lr = 0xfffffff1;
65
+ lr = R_V7M_EXCRET_RES1_MASK |
66
+ R_V7M_EXCRET_S_MASK |
67
+ R_V7M_EXCRET_DCRS_MASK |
68
+ R_V7M_EXCRET_FTYPE_MASK |
69
+ R_V7M_EXCRET_ES_MASK;
70
if (env->v7m.control[env->v7m.secure] & R_V7M_CONTROL_SPSEL_MASK) {
71
- lr |= 4;
72
+ lr |= R_V7M_EXCRET_SPSEL_MASK;
73
}
74
if (!arm_v7m_is_handler_mode(env)) {
75
- lr |= 8;
76
+ lr |= R_V7M_EXCRET_MODE_MASK;
77
}
78
79
v7m_push_stack(cpu);
80
--
81
2.7.4
82
83
diff view generated by jsdifflib
Deleted patch
1
In the v7M and v8M ARM ARM, the magic exception return values are
2
referred to as EXC_RETURN values, and in QEMU we use V7M_EXCRET_*
3
constants to define bits within them. Rename the 'type' variable
4
which holds the exception return value in do_v7m_exception_exit()
5
to excret, making it clearer that it does hold an EXC_RETURN value.
6
1
7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
9
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
10
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
11
Message-id: 1505137930-13255-8-git-send-email-peter.maydell@linaro.org
12
---
13
target/arm/helper.c | 23 ++++++++++++-----------
14
1 file changed, 12 insertions(+), 11 deletions(-)
15
16
diff --git a/target/arm/helper.c b/target/arm/helper.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/target/arm/helper.c
19
+++ b/target/arm/helper.c
20
@@ -XXX,XX +XXX,XX @@ static void v7m_push_stack(ARMCPU *cpu)
21
static void do_v7m_exception_exit(ARMCPU *cpu)
22
{
23
CPUARMState *env = &cpu->env;
24
- uint32_t type;
25
+ uint32_t excret;
26
uint32_t xpsr;
27
bool ufault = false;
28
bool return_to_sp_process = false;
29
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
30
* the target value up between env->regs[15] and env->thumb in
31
* gen_bx(). Reconstitute it.
32
*/
33
- type = env->regs[15];
34
+ excret = env->regs[15];
35
if (env->thumb) {
36
- type |= 1;
37
+ excret |= 1;
38
}
39
40
qemu_log_mask(CPU_LOG_INT, "Exception return: magic PC %" PRIx32
41
" previous exception %d\n",
42
- type, env->v7m.exception);
43
+ excret, env->v7m.exception);
44
45
- if ((type & R_V7M_EXCRET_RES1_MASK) != R_V7M_EXCRET_RES1_MASK) {
46
+ if ((excret & R_V7M_EXCRET_RES1_MASK) != R_V7M_EXCRET_RES1_MASK) {
47
qemu_log_mask(LOG_GUEST_ERROR, "M profile: zero high bits in exception "
48
- "exit PC value 0x%" PRIx32 " are UNPREDICTABLE\n", type);
49
+ "exit PC value 0x%" PRIx32 " are UNPREDICTABLE\n",
50
+ excret);
51
}
52
53
if (env->v7m.exception != ARMV7M_EXCP_NMI) {
54
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
55
* which security state's faultmask to clear. (v8M ARM ARM R_KBNF.)
56
*/
57
if (arm_feature(env, ARM_FEATURE_M_SECURITY)) {
58
- int es = type & R_V7M_EXCRET_ES_MASK;
59
+ int es = excret & R_V7M_EXCRET_ES_MASK;
60
if (armv7m_nvic_raw_execution_priority(env->nvic) >= 0) {
61
env->v7m.faultmask[es] = 0;
62
}
63
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
64
g_assert_not_reached();
65
}
66
67
- switch (type & 0xf) {
68
+ switch (excret & 0xf) {
69
case 1: /* Return to Handler */
70
return_to_handler = true;
71
break;
72
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
73
*/
74
env->v7m.cfsr[env->v7m.secure] |= R_V7M_CFSR_INVPC_MASK;
75
armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE);
76
- v7m_exception_taken(cpu, type);
77
+ v7m_exception_taken(cpu, excret);
78
qemu_log_mask(CPU_LOG_INT, "...taking UsageFault on existing "
79
"stackframe: failed exception return integrity check\n");
80
return;
81
@@ -XXX,XX +XXX,XX @@ static void do_v7m_exception_exit(ARMCPU *cpu)
82
83
/* The restored xPSR exception field will be zero if we're
84
* resuming in Thread mode. If that doesn't match what the
85
- * exception return type specified then this is a UsageFault.
86
+ * exception return excret specified then this is a UsageFault.
87
*/
88
if (return_to_handler != arm_v7m_is_handler_mode(env)) {
89
/* Take an INVPC UsageFault by pushing the stack again. */
90
armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE);
91
env->v7m.cfsr[env->v7m.secure] |= R_V7M_CFSR_INVPC_MASK;
92
v7m_push_stack(cpu);
93
- v7m_exception_taken(cpu, type);
94
+ v7m_exception_taken(cpu, excret);
95
qemu_log_mask(CPU_LOG_INT, "...taking UsageFault on new stackframe: "
96
"failed exception return integrity check\n");
97
return;
98
--
99
2.7.4
100
101
diff view generated by jsdifflib
Deleted patch
1
From: Alistair Francis <alistair.francis@xilinx.com>
2
1
3
The EP108 is a early access development board. Now that silicon is in
4
production people have access to the ZCU102. Let's rename the internal
5
QEMU files and variables to use the ZCU102.
6
7
There is no functional change here as the EP108 is still a valid board
8
option.
9
10
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
11
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
---
14
hw/arm/Makefile.objs | 2 +-
15
hw/arm/{xlnx-ep108.c => xlnx-zcu102.c} | 30 +++++++++++++++---------------
16
2 files changed, 16 insertions(+), 16 deletions(-)
17
rename hw/arm/{xlnx-ep108.c => xlnx-zcu102.c} (85%)
18
19
diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs
20
index XXXXXXX..XXXXXXX 100644
21
--- a/hw/arm/Makefile.objs
22
+++ b/hw/arm/Makefile.objs
23
@@ -XXX,XX +XXX,XX @@ obj-y += omap1.o omap2.o strongarm.o
24
obj-$(CONFIG_ALLWINNER_A10) += allwinner-a10.o cubieboard.o
25
obj-$(CONFIG_RASPI) += bcm2835_peripherals.o bcm2836.o raspi.o
26
obj-$(CONFIG_STM32F205_SOC) += stm32f205_soc.o
27
-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp.o xlnx-ep108.o
28
+obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp.o xlnx-zcu102.o
29
obj-$(CONFIG_FSL_IMX25) += fsl-imx25.o imx25_pdk.o
30
obj-$(CONFIG_FSL_IMX31) += fsl-imx31.o kzm.o
31
obj-$(CONFIG_FSL_IMX6) += fsl-imx6.o sabrelite.o
32
diff --git a/hw/arm/xlnx-ep108.c b/hw/arm/xlnx-zcu102.c
33
similarity index 85%
34
rename from hw/arm/xlnx-ep108.c
35
rename to hw/arm/xlnx-zcu102.c
36
index XXXXXXX..XXXXXXX 100644
37
--- a/hw/arm/xlnx-ep108.c
38
+++ b/hw/arm/xlnx-zcu102.c
39
@@ -XXX,XX +XXX,XX @@
40
/*
41
- * Xilinx ZynqMP EP108 board
42
+ * Xilinx ZynqMP ZCU102 board
43
*
44
* Copyright (C) 2015 Xilinx Inc
45
* Written by Peter Crosthwaite <peter.crosthwaite@xilinx.com>
46
@@ -XXX,XX +XXX,XX @@
47
#include "exec/address-spaces.h"
48
#include "qemu/log.h"
49
50
-typedef struct XlnxEP108 {
51
+typedef struct XlnxZCU102 {
52
XlnxZynqMPState soc;
53
MemoryRegion ddr_ram;
54
-} XlnxEP108;
55
+} XlnxZCU102;
56
57
-static struct arm_boot_info xlnx_ep108_binfo;
58
+static struct arm_boot_info xlnx_zcu102_binfo;
59
60
-static void xlnx_ep108_init(MachineState *machine)
61
+static void xlnx_zcu102_init(MachineState *machine)
62
{
63
- XlnxEP108 *s = g_new0(XlnxEP108, 1);
64
+ XlnxZCU102 *s = g_new0(XlnxZCU102, 1);
65
int i;
66
uint64_t ram_size = machine->ram_size;
67
68
@@ -XXX,XX +XXX,XX @@ static void xlnx_ep108_init(MachineState *machine)
69
}
70
71
if (ram_size < 0x08000000) {
72
- qemu_log("WARNING: RAM size 0x%" PRIx64 " is small for EP108",
73
+ qemu_log("WARNING: RAM size 0x%" PRIx64 " is small for ZCU102",
74
ram_size);
75
}
76
77
@@ -XXX,XX +XXX,XX @@ static void xlnx_ep108_init(MachineState *machine)
78
79
/* TODO create and connect IDE devices for ide_drive_get() */
80
81
- xlnx_ep108_binfo.ram_size = ram_size;
82
- xlnx_ep108_binfo.kernel_filename = machine->kernel_filename;
83
- xlnx_ep108_binfo.kernel_cmdline = machine->kernel_cmdline;
84
- xlnx_ep108_binfo.initrd_filename = machine->initrd_filename;
85
- xlnx_ep108_binfo.loader_start = 0;
86
- arm_load_kernel(s->soc.boot_cpu_ptr, &xlnx_ep108_binfo);
87
+ xlnx_zcu102_binfo.ram_size = ram_size;
88
+ xlnx_zcu102_binfo.kernel_filename = machine->kernel_filename;
89
+ xlnx_zcu102_binfo.kernel_cmdline = machine->kernel_cmdline;
90
+ xlnx_zcu102_binfo.initrd_filename = machine->initrd_filename;
91
+ xlnx_zcu102_binfo.loader_start = 0;
92
+ arm_load_kernel(s->soc.boot_cpu_ptr, &xlnx_zcu102_binfo);
93
}
94
95
static void xlnx_ep108_machine_init(MachineClass *mc)
96
{
97
mc->desc = "Xilinx ZynqMP EP108 board";
98
- mc->init = xlnx_ep108_init;
99
+ mc->init = xlnx_zcu102_init;
100
mc->block_default_type = IF_IDE;
101
mc->units_per_default_bus = 1;
102
mc->ignore_memory_transaction_failures = true;
103
@@ -XXX,XX +XXX,XX @@ DEFINE_MACHINE("xlnx-ep108", xlnx_ep108_machine_init)
104
static void xlnx_zcu102_machine_init(MachineClass *mc)
105
{
106
mc->desc = "Xilinx ZynqMP ZCU102 board";
107
- mc->init = xlnx_ep108_init;
108
+ mc->init = xlnx_zcu102_init;
109
mc->block_default_type = IF_IDE;
110
mc->units_per_default_bus = 1;
111
mc->ignore_memory_transaction_failures = true;
112
--
113
2.7.4
114
115
diff view generated by jsdifflib
Deleted patch
1
From: Alistair Francis <alistair.francis@xilinx.com>
2
1
3
The EP108 is the same as the ZCU102, mark it as deprecated as we don't
4
need two machines.
5
6
Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
7
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
---
10
hw/arm/xlnx-zcu102.c | 2 +-
11
1 file changed, 1 insertion(+), 1 deletion(-)
12
13
diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c
14
index XXXXXXX..XXXXXXX 100644
15
--- a/hw/arm/xlnx-zcu102.c
16
+++ b/hw/arm/xlnx-zcu102.c
17
@@ -XXX,XX +XXX,XX @@ static void xlnx_ep108_machine_class_init(ObjectClass *oc, void *data)
18
{
19
MachineClass *mc = MACHINE_CLASS(oc);
20
21
- mc->desc = "Xilinx ZynqMP EP108 board";
22
+ mc->desc = "Xilinx ZynqMP EP108 board (Deprecated, please use xlnx-zcu102)";
23
mc->init = xlnx_ep108_init;
24
mc->block_default_type = IF_IDE;
25
mc->units_per_default_bus = 1;
26
--
27
2.7.4
28
29
diff view generated by jsdifflib
Deleted patch
1
From: Jaroslaw Pelczar <j.pelczar@samsung.com>
2
1
3
Previously when single stepping through ERET instruction via GDB
4
would result in debugger entering the "next" PC after ERET instruction.
5
When debugging in kernel mode, this will also cause unintended behavior,
6
because debugger will try to access memory from EL0 point of view.
7
8
Signed-off-by: Jaroslaw Pelczar <j.pelczar@samsung.com>
9
Message-id: 001c01d32895$483027f0$d89077d0$@samsung.com
10
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
---
13
target/arm/translate-a64.c | 1 +
14
1 file changed, 1 insertion(+)
15
16
diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/target/arm/translate-a64.c
19
+++ b/target/arm/translate-a64.c
20
@@ -XXX,XX +XXX,XX @@ static void aarch64_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
21
default:
22
gen_a64_set_pc_im(dc->pc);
23
/* fall through */
24
+ case DISAS_EXIT:
25
case DISAS_JUMP:
26
if (dc->base.singlestep_enabled) {
27
gen_exception_internal(EXCP_DEBUG);
28
--
29
2.7.4
30
31
diff view generated by jsdifflib