1
Arm patches for rc3 : just a handful of bug fixes.
1
A collection of bug fixes for rc2...
2
2
3
thanks
3
The following changes since commit 146aa0f104bb3bf88e43c4082a0bfc4bbda4fbd8:
4
-- PMM
5
4
6
5
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging (2020-04-03 15:30:11 +0100)
7
The following changes since commit 4ecc984210ca1bf508a96a550ec8a93a5f833f6c:
8
9
Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-4.2-rc3' into staging (2019-11-26 12:36:40 +0000)
10
6
11
are available in the Git repository at:
7
are available in the Git repository at:
12
8
13
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20191126
9
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20200406
14
10
15
for you to fetch changes up to 6a4ef4e5d1084ce41fafa7d470a644b0fd3d9317:
11
for you to fetch changes up to 8893790966d9c964557ad01be4a68ef50696ace8:
16
12
17
target/arm: Honor HCR_EL2.TID3 trapping requirements (2019-11-26 13:55:37 +0000)
13
dma/xlnx-zdma: Reorg to fix CUR_DSCR (2020-04-06 10:59:56 +0100)
18
14
19
----------------------------------------------------------------
15
----------------------------------------------------------------
20
target-arm queue:
16
target-arm queue:
21
* handle FTYPE flag correctly in v7M exception return
17
* don't expose "ieee_half" via gdbstub (prevents gdb crashes or errors
22
for v7M CPUs with an FPU (v8M CPUs were already correct)
18
with older GDB versions)
23
* versal: Add the CRP as unimplemented
19
* hw/arm/collie: Put StrongARMState* into a CollieMachineState struct
24
* Fix ISR_EL1 tracking when executing at EL2
20
* PSTATE.PAN should not clear exec bits
25
* Honor HCR_EL2.TID3 trapping requirements
21
* hw/gpio/aspeed_gpio.c: Don't directly include assert.h
22
(fixes compilation on some Windows build scenarios)
23
* dump: Fix writing of ELF section
24
* dma/xlnx-zdma: various bug fixes
25
* target/arm/helperc. delete obsolete TODO comment
26
26
27
----------------------------------------------------------------
27
----------------------------------------------------------------
28
Edgar E. Iglesias (1):
28
Alex Bennée (1):
29
hw/arm: versal: Add the CRP as unimplemented
29
target/arm: don't expose "ieee_half" via gdbstub
30
30
31
Jean-Hugues Deschênes (1):
31
Edgar E. Iglesias (5):
32
target/arm: Fix handling of cortex-m FTYPE flag in EXCRET
32
dma/xlnx-zdma: Remove comment
33
dma/xlnx-zdma: Populate DBG0.CMN_BUF_FREE
34
dma/xlnx-zdma: Clear DMA_DONE when halting
35
dma/xlnx-zdma: Advance the descriptor address when stopping
36
dma/xlnx-zdma: Reorg to fix CUR_DSCR
33
37
34
Marc Zyngier (2):
38
Peter Maydell (5):
35
target/arm: Fix ISR_EL1 tracking when executing at EL2
39
hw/arm/collie: Put StrongARMState* into a CollieMachineState struct
36
target/arm: Honor HCR_EL2.TID3 trapping requirements
40
target/arm: PSTATE.PAN should not clear exec bits
41
target/arm: Remove obsolete TODO note from get_phys_addr_lpae()
42
hw/gpio/aspeed_gpio.c: Don't directly include assert.h
43
dump: Fix writing of ELF section
37
44
38
include/hw/arm/xlnx-versal.h | 3 ++
45
dump/dump.c | 2 +-
39
hw/arm/xlnx-versal.c | 2 ++
46
hw/arm/collie.c | 33 +++++++++++++++++++++++++-----
40
target/arm/helper.c | 83 ++++++++++++++++++++++++++++++++++++++++++--
47
hw/dma/xlnx-zdma.c | 56 ++++++++++++++++++++++++++-------------------------
41
target/arm/m_helper.c | 7 ++--
48
hw/gpio/aspeed_gpio.c | 2 --
42
4 files changed, 89 insertions(+), 6 deletions(-)
49
target/arm/gdbstub.c | 7 ++++++-
50
target/arm/helper.c | 13 +++++-------
51
6 files changed, 69 insertions(+), 44 deletions(-)
43
52
diff view generated by jsdifflib
New patch
1
From: Alex Bennée <alex.bennee@linaro.org>
1
2
3
While support for parsing ieee_half in the XML description was added
4
to gdb in 2019 (a6d0f249) there is no easy way for the gdbstub to know
5
if the gdb end will understand it. Disable it for now and allow older
6
gdbs to successfully connect to the default -cpu max SVE enabled
7
QEMUs.
8
9
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
10
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
11
Message-id: 20200402143913.24005-1-alex.bennee@linaro.org
12
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
13
---
14
target/arm/gdbstub.c | 7 ++++++-
15
1 file changed, 6 insertions(+), 1 deletion(-)
16
17
diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c
18
index XXXXXXX..XXXXXXX 100644
19
--- a/target/arm/gdbstub.c
20
+++ b/target/arm/gdbstub.c
21
@@ -XXX,XX +XXX,XX @@ static const struct TypeSize vec_lanes[] = {
22
/* 16 bit */
23
{ "uint16", 16, 'h', 'u' },
24
{ "int16", 16, 'h', 's' },
25
- { "ieee_half", 16, 'h', 'f' },
26
+ /*
27
+ * TODO: currently there is no reliable way of telling
28
+ * if the remote gdb actually understands ieee_half so
29
+ * we don't expose it in the target description for now.
30
+ * { "ieee_half", 16, 'h', 'f' },
31
+ */
32
/* bytes */
33
{ "uint8", 8, 'b', 'u' },
34
{ "int8", 8, 'b', 's' },
35
--
36
2.20.1
37
38
diff view generated by jsdifflib
New patch
1
Coverity complains that the collie_init() function leaks the memory
2
allocated in sa1110_init(). This is true but not significant since
3
the function is called only once on machine init and the memory must
4
remain in existence until QEMU exits anyway.
1
5
6
Still, we can avoid the technical memory leak by keeping the pointer
7
to the StrongARMState inside the machine state struct. Switch from
8
the simple DEFINE_MACHINE() style to defining a subclass of
9
TYPE_MACHINE which extends the MachineState struct, and keep the
10
pointer there.
11
12
Fixes: CID 1421921
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
15
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
16
Message-id: 20200326204919.22006-1-peter.maydell@linaro.org
17
---
18
hw/arm/collie.c | 33 ++++++++++++++++++++++++++++-----
19
1 file changed, 28 insertions(+), 5 deletions(-)
20
21
diff --git a/hw/arm/collie.c b/hw/arm/collie.c
22
index XXXXXXX..XXXXXXX 100644
23
--- a/hw/arm/collie.c
24
+++ b/hw/arm/collie.c
25
@@ -XXX,XX +XXX,XX @@
26
#include "exec/address-spaces.h"
27
#include "cpu.h"
28
29
+typedef struct {
30
+ MachineState parent;
31
+
32
+ StrongARMState *sa1110;
33
+} CollieMachineState;
34
+
35
+#define TYPE_COLLIE_MACHINE MACHINE_TYPE_NAME("collie")
36
+#define COLLIE_MACHINE(obj) \
37
+ OBJECT_CHECK(CollieMachineState, obj, TYPE_COLLIE_MACHINE)
38
+
39
static struct arm_boot_info collie_binfo = {
40
.loader_start = SA_SDCS0,
41
.ram_size = 0x20000000,
42
@@ -XXX,XX +XXX,XX @@ static struct arm_boot_info collie_binfo = {
43
44
static void collie_init(MachineState *machine)
45
{
46
- StrongARMState *s;
47
DriveInfo *dinfo;
48
MachineClass *mc = MACHINE_GET_CLASS(machine);
49
+ CollieMachineState *cms = COLLIE_MACHINE(machine);
50
51
if (machine->ram_size != mc->default_ram_size) {
52
char *sz = size_to_str(mc->default_ram_size);
53
@@ -XXX,XX +XXX,XX @@ static void collie_init(MachineState *machine)
54
exit(EXIT_FAILURE);
55
}
56
57
- s = sa1110_init(machine->cpu_type);
58
+ cms->sa1110 = sa1110_init(machine->cpu_type);
59
60
memory_region_add_subregion(get_system_memory(), SA_SDCS0, machine->ram);
61
62
@@ -XXX,XX +XXX,XX @@ static void collie_init(MachineState *machine)
63
sysbus_create_simple("scoop", 0x40800000, NULL);
64
65
collie_binfo.board_id = 0x208;
66
- arm_load_kernel(s->cpu, machine, &collie_binfo);
67
+ arm_load_kernel(cms->sa1110->cpu, machine, &collie_binfo);
68
}
69
70
-static void collie_machine_init(MachineClass *mc)
71
+static void collie_machine_class_init(ObjectClass *oc, void *data)
72
{
73
+ MachineClass *mc = MACHINE_CLASS(oc);
74
+
75
mc->desc = "Sharp SL-5500 (Collie) PDA (SA-1110)";
76
mc->init = collie_init;
77
mc->ignore_memory_transaction_failures = true;
78
@@ -XXX,XX +XXX,XX @@ static void collie_machine_init(MachineClass *mc)
79
mc->default_ram_id = "strongarm.sdram";
80
}
81
82
-DEFINE_MACHINE("collie", collie_machine_init)
83
+static const TypeInfo collie_machine_typeinfo = {
84
+ .name = TYPE_COLLIE_MACHINE,
85
+ .parent = TYPE_MACHINE,
86
+ .class_init = collie_machine_class_init,
87
+ .instance_size = sizeof(CollieMachineState),
88
+};
89
+
90
+static void collie_machine_register_types(void)
91
+{
92
+ type_register_static(&collie_machine_typeinfo);
93
+}
94
+type_init(collie_machine_register_types);
95
--
96
2.20.1
97
98
diff view generated by jsdifflib
1
From: Marc Zyngier <maz@kernel.org>
1
Our implementation of the PSTATE.PAN bit incorrectly cleared all
2
access permission bits for privileged access to memory which is
3
user-accessible. It should only affect the privileged read and write
4
permissions; execute permission is dealt with via XN/PXN instead.
2
5
3
The ARMv8 ARM states when executing at EL2, EL3 or Secure EL1,
6
Fixes: 81636b70c226dc27d7ebc8d
4
ISR_EL1 shows the pending status of the physical IRQ, FIQ, or
5
SError interrupts.
6
7
Unfortunately, QEMU's implementation only considers the HCR_EL2
8
bits, and ignores the current exception level. This means a hypervisor
9
trying to look at its own interrupt state actually sees the guest
10
state, which is unexpected and breaks KVM as of Linux 5.3.
11
12
Instead, check for the running EL and return the physical bits
13
if not running in a virtualized context.
14
15
Fixes: 636540e9c40b
16
Cc: qemu-stable@nongnu.org
17
Reported-by: Quentin Perret <qperret@google.com>
18
Signed-off-by: Marc Zyngier <maz@kernel.org>
19
Message-id: 20191122135833.28953-1-maz@kernel.org
20
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
21
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
22
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
7
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
9
Message-id: 20200330170651.20901-1-peter.maydell@linaro.org
23
---
10
---
24
target/arm/helper.c | 7 +++++--
11
target/arm/helper.c | 6 ++++--
25
1 file changed, 5 insertions(+), 2 deletions(-)
12
1 file changed, 4 insertions(+), 2 deletions(-)
26
13
27
diff --git a/target/arm/helper.c b/target/arm/helper.c
14
diff --git a/target/arm/helper.c b/target/arm/helper.c
28
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
29
--- a/target/arm/helper.c
16
--- a/target/arm/helper.c
30
+++ b/target/arm/helper.c
17
+++ b/target/arm/helper.c
31
@@ -XXX,XX +XXX,XX @@ static uint64_t isr_read(CPUARMState *env, const ARMCPRegInfo *ri)
18
@@ -XXX,XX +XXX,XX @@ static int get_S1prot(CPUARMState *env, ARMMMUIdx mmu_idx, bool is_aa64,
32
CPUState *cs = env_cpu(env);
19
prot_rw = user_rw;
33
uint64_t hcr_el2 = arm_hcr_el2_eff(env);
20
} else {
34
uint64_t ret = 0;
21
if (user_rw && regime_is_pan(env, mmu_idx)) {
35
+ bool allow_virt = (arm_current_el(env) == 1 &&
22
- return 0;
36
+ (!arm_is_secure_below_el3(env) ||
23
+ /* PAN forbids data accesses but doesn't affect insn fetch */
37
+ (env->cp15.scr_el3 & SCR_EEL2)));
24
+ prot_rw = 0;
38
25
+ } else {
39
- if (hcr_el2 & HCR_IMO) {
26
+ prot_rw = simple_ap_to_rw_prot_is_user(ap, false);
40
+ if (allow_virt && (hcr_el2 & HCR_IMO)) {
41
if (cs->interrupt_request & CPU_INTERRUPT_VIRQ) {
42
ret |= CPSR_I;
43
}
27
}
44
@@ -XXX,XX +XXX,XX @@ static uint64_t isr_read(CPUARMState *env, const ARMCPRegInfo *ri)
28
- prot_rw = simple_ap_to_rw_prot_is_user(ap, false);
45
}
46
}
29
}
47
30
48
- if (hcr_el2 & HCR_FMO) {
31
if (ns && arm_is_secure(env) && (env->cp15.scr_el3 & SCR_SIF)) {
49
+ if (allow_virt && (hcr_el2 & HCR_FMO)) {
50
if (cs->interrupt_request & CPU_INTERRUPT_VFIQ) {
51
ret |= CPSR_F;
52
}
53
--
32
--
54
2.20.1
33
2.20.1
55
34
56
35
diff view generated by jsdifflib
1
From: Marc Zyngier <maz@kernel.org>
1
An old comment in get_phys_addr_lpae() claims that the code does not
2
support the different format TCR for VTCR_EL2. This used to be true
3
but it is not true now (in particular the aa64_va_parameters() and
4
aa32_va_parameters() functions correctly handle the different
5
register format by checking whether the mmu_idx is Stage2).
6
Remove the out of date parts of the comment.
2
7
3
HCR_EL2.TID3 mandates that access from EL1 to a long list of id
4
registers traps to EL2, and QEMU has so far ignored this requirement.
5
6
This breaks (among other things) KVM guests that have PtrAuth enabled,
7
while the hypervisor doesn't want to expose the feature to its guest.
8
To achieve this, KVM traps the ID registers (ID_AA64ISAR1_EL1 in this
9
case), and masks out the unsupported feature.
10
11
QEMU not honoring the trap request means that the guest observes
12
that the feature is present in the HW, starts using it, and dies
13
a horrible death when KVM injects an UNDEF, because the feature
14
*really* isn't supported.
15
16
Do the right thing by trapping to EL2 if HCR_EL2.TID3 is set.
17
18
Note that this change does not include trapping of the MVFR
19
registers from AArch32 (they are accessed via the VMRS
20
instruction and need to be handled in a different way).
21
22
Reported-by: Will Deacon <will@kernel.org>
23
Signed-off-by: Marc Zyngier <maz@kernel.org>
24
Tested-by: Will Deacon <will@kernel.org>
25
Message-id: 20191123115618.29230-1-maz@kernel.org
26
[PMM: added missing accessfn line for ID_AA4PFR2_EL1_RESERVED;
27
changed names of access functions to include _tid3]
28
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
29
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
8
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
10
Message-id: 20200331143407.3186-1-peter.maydell@linaro.org
30
---
11
---
31
target/arm/helper.c | 76 +++++++++++++++++++++++++++++++++++++++++++++
12
target/arm/helper.c | 7 +------
32
1 file changed, 76 insertions(+)
13
1 file changed, 1 insertion(+), 6 deletions(-)
33
14
34
diff --git a/target/arm/helper.c b/target/arm/helper.c
15
diff --git a/target/arm/helper.c b/target/arm/helper.c
35
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
36
--- a/target/arm/helper.c
17
--- a/target/arm/helper.c
37
+++ b/target/arm/helper.c
18
+++ b/target/arm/helper.c
38
@@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo predinv_reginfo[] = {
19
@@ -XXX,XX +XXX,XX @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address,
39
REGINFO_SENTINEL
20
bool aarch64 = arm_el_is_aa64(env, el);
40
};
21
bool guarded = false;
41
22
42
+static CPAccessResult access_aa64_tid3(CPUARMState *env, const ARMCPRegInfo *ri,
23
- /* TODO:
43
+ bool isread)
24
- * This code does not handle the different format TCR for VTCR_EL2.
44
+{
25
- * This code also does not support shareability levels.
45
+ if ((arm_current_el(env) < 2) && (arm_hcr_el2_eff(env) & HCR_TID3)) {
26
- * Attribute and permission bit handling should also be checked when adding
46
+ return CP_ACCESS_TRAP_EL2;
27
- * support for those page table walks.
47
+ }
28
- */
48
+
29
+ /* TODO: This code does not support shareability levels. */
49
+ return CP_ACCESS_OK;
30
if (aarch64) {
50
+}
31
param = aa64_va_parameters(env, address, mmu_idx,
51
+
32
access_type != MMU_INST_FETCH);
52
+static CPAccessResult access_aa32_tid3(CPUARMState *env, const ARMCPRegInfo *ri,
53
+ bool isread)
54
+{
55
+ if (arm_feature(env, ARM_FEATURE_V8)) {
56
+ return access_aa64_tid3(env, ri, isread);
57
+ }
58
+
59
+ return CP_ACCESS_OK;
60
+}
61
+
62
void register_cp_regs_for_features(ARMCPU *cpu)
63
{
64
/* Register all the coprocessor registers based on feature bits */
65
@@ -XXX,XX +XXX,XX @@ void register_cp_regs_for_features(ARMCPU *cpu)
66
{ .name = "ID_PFR0", .state = ARM_CP_STATE_BOTH,
67
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 0,
68
.access = PL1_R, .type = ARM_CP_CONST,
69
+ .accessfn = access_aa32_tid3,
70
.resetvalue = cpu->id_pfr0 },
71
/* ID_PFR1 is not a plain ARM_CP_CONST because we don't know
72
* the value of the GIC field until after we define these regs.
73
@@ -XXX,XX +XXX,XX @@ void register_cp_regs_for_features(ARMCPU *cpu)
74
{ .name = "ID_PFR1", .state = ARM_CP_STATE_BOTH,
75
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 1,
76
.access = PL1_R, .type = ARM_CP_NO_RAW,
77
+ .accessfn = access_aa32_tid3,
78
.readfn = id_pfr1_read,
79
.writefn = arm_cp_write_ignore },
80
{ .name = "ID_DFR0", .state = ARM_CP_STATE_BOTH,
81
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 2,
82
.access = PL1_R, .type = ARM_CP_CONST,
83
+ .accessfn = access_aa32_tid3,
84
.resetvalue = cpu->id_dfr0 },
85
{ .name = "ID_AFR0", .state = ARM_CP_STATE_BOTH,
86
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 3,
87
.access = PL1_R, .type = ARM_CP_CONST,
88
+ .accessfn = access_aa32_tid3,
89
.resetvalue = cpu->id_afr0 },
90
{ .name = "ID_MMFR0", .state = ARM_CP_STATE_BOTH,
91
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 4,
92
.access = PL1_R, .type = ARM_CP_CONST,
93
+ .accessfn = access_aa32_tid3,
94
.resetvalue = cpu->id_mmfr0 },
95
{ .name = "ID_MMFR1", .state = ARM_CP_STATE_BOTH,
96
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 5,
97
.access = PL1_R, .type = ARM_CP_CONST,
98
+ .accessfn = access_aa32_tid3,
99
.resetvalue = cpu->id_mmfr1 },
100
{ .name = "ID_MMFR2", .state = ARM_CP_STATE_BOTH,
101
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 6,
102
.access = PL1_R, .type = ARM_CP_CONST,
103
+ .accessfn = access_aa32_tid3,
104
.resetvalue = cpu->id_mmfr2 },
105
{ .name = "ID_MMFR3", .state = ARM_CP_STATE_BOTH,
106
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 7,
107
.access = PL1_R, .type = ARM_CP_CONST,
108
+ .accessfn = access_aa32_tid3,
109
.resetvalue = cpu->id_mmfr3 },
110
{ .name = "ID_ISAR0", .state = ARM_CP_STATE_BOTH,
111
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 0,
112
.access = PL1_R, .type = ARM_CP_CONST,
113
+ .accessfn = access_aa32_tid3,
114
.resetvalue = cpu->isar.id_isar0 },
115
{ .name = "ID_ISAR1", .state = ARM_CP_STATE_BOTH,
116
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 1,
117
.access = PL1_R, .type = ARM_CP_CONST,
118
+ .accessfn = access_aa32_tid3,
119
.resetvalue = cpu->isar.id_isar1 },
120
{ .name = "ID_ISAR2", .state = ARM_CP_STATE_BOTH,
121
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 2,
122
.access = PL1_R, .type = ARM_CP_CONST,
123
+ .accessfn = access_aa32_tid3,
124
.resetvalue = cpu->isar.id_isar2 },
125
{ .name = "ID_ISAR3", .state = ARM_CP_STATE_BOTH,
126
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 3,
127
.access = PL1_R, .type = ARM_CP_CONST,
128
+ .accessfn = access_aa32_tid3,
129
.resetvalue = cpu->isar.id_isar3 },
130
{ .name = "ID_ISAR4", .state = ARM_CP_STATE_BOTH,
131
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 4,
132
.access = PL1_R, .type = ARM_CP_CONST,
133
+ .accessfn = access_aa32_tid3,
134
.resetvalue = cpu->isar.id_isar4 },
135
{ .name = "ID_ISAR5", .state = ARM_CP_STATE_BOTH,
136
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 5,
137
.access = PL1_R, .type = ARM_CP_CONST,
138
+ .accessfn = access_aa32_tid3,
139
.resetvalue = cpu->isar.id_isar5 },
140
{ .name = "ID_MMFR4", .state = ARM_CP_STATE_BOTH,
141
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 6,
142
.access = PL1_R, .type = ARM_CP_CONST,
143
+ .accessfn = access_aa32_tid3,
144
.resetvalue = cpu->id_mmfr4 },
145
{ .name = "ID_ISAR6", .state = ARM_CP_STATE_BOTH,
146
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 7,
147
.access = PL1_R, .type = ARM_CP_CONST,
148
+ .accessfn = access_aa32_tid3,
149
.resetvalue = cpu->isar.id_isar6 },
150
REGINFO_SENTINEL
151
};
152
@@ -XXX,XX +XXX,XX @@ void register_cp_regs_for_features(ARMCPU *cpu)
153
{ .name = "ID_AA64PFR0_EL1", .state = ARM_CP_STATE_AA64,
154
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 0,
155
.access = PL1_R, .type = ARM_CP_NO_RAW,
156
+ .accessfn = access_aa64_tid3,
157
.readfn = id_aa64pfr0_read,
158
.writefn = arm_cp_write_ignore },
159
{ .name = "ID_AA64PFR1_EL1", .state = ARM_CP_STATE_AA64,
160
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 1,
161
.access = PL1_R, .type = ARM_CP_CONST,
162
+ .accessfn = access_aa64_tid3,
163
.resetvalue = cpu->isar.id_aa64pfr1},
164
{ .name = "ID_AA64PFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
165
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 2,
166
.access = PL1_R, .type = ARM_CP_CONST,
167
+ .accessfn = access_aa64_tid3,
168
.resetvalue = 0 },
169
{ .name = "ID_AA64PFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
170
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 3,
171
.access = PL1_R, .type = ARM_CP_CONST,
172
+ .accessfn = access_aa64_tid3,
173
.resetvalue = 0 },
174
{ .name = "ID_AA64ZFR0_EL1", .state = ARM_CP_STATE_AA64,
175
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 4,
176
.access = PL1_R, .type = ARM_CP_CONST,
177
+ .accessfn = access_aa64_tid3,
178
/* At present, only SVEver == 0 is defined anyway. */
179
.resetvalue = 0 },
180
{ .name = "ID_AA64PFR5_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
181
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 5,
182
.access = PL1_R, .type = ARM_CP_CONST,
183
+ .accessfn = access_aa64_tid3,
184
.resetvalue = 0 },
185
{ .name = "ID_AA64PFR6_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
186
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 6,
187
.access = PL1_R, .type = ARM_CP_CONST,
188
+ .accessfn = access_aa64_tid3,
189
.resetvalue = 0 },
190
{ .name = "ID_AA64PFR7_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
191
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 7,
192
.access = PL1_R, .type = ARM_CP_CONST,
193
+ .accessfn = access_aa64_tid3,
194
.resetvalue = 0 },
195
{ .name = "ID_AA64DFR0_EL1", .state = ARM_CP_STATE_AA64,
196
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 0,
197
.access = PL1_R, .type = ARM_CP_CONST,
198
+ .accessfn = access_aa64_tid3,
199
.resetvalue = cpu->id_aa64dfr0 },
200
{ .name = "ID_AA64DFR1_EL1", .state = ARM_CP_STATE_AA64,
201
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 1,
202
.access = PL1_R, .type = ARM_CP_CONST,
203
+ .accessfn = access_aa64_tid3,
204
.resetvalue = cpu->id_aa64dfr1 },
205
{ .name = "ID_AA64DFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
206
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 2,
207
.access = PL1_R, .type = ARM_CP_CONST,
208
+ .accessfn = access_aa64_tid3,
209
.resetvalue = 0 },
210
{ .name = "ID_AA64DFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
211
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 3,
212
.access = PL1_R, .type = ARM_CP_CONST,
213
+ .accessfn = access_aa64_tid3,
214
.resetvalue = 0 },
215
{ .name = "ID_AA64AFR0_EL1", .state = ARM_CP_STATE_AA64,
216
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 4,
217
.access = PL1_R, .type = ARM_CP_CONST,
218
+ .accessfn = access_aa64_tid3,
219
.resetvalue = cpu->id_aa64afr0 },
220
{ .name = "ID_AA64AFR1_EL1", .state = ARM_CP_STATE_AA64,
221
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 5,
222
.access = PL1_R, .type = ARM_CP_CONST,
223
+ .accessfn = access_aa64_tid3,
224
.resetvalue = cpu->id_aa64afr1 },
225
{ .name = "ID_AA64AFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
226
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 6,
227
.access = PL1_R, .type = ARM_CP_CONST,
228
+ .accessfn = access_aa64_tid3,
229
.resetvalue = 0 },
230
{ .name = "ID_AA64AFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
231
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 7,
232
.access = PL1_R, .type = ARM_CP_CONST,
233
+ .accessfn = access_aa64_tid3,
234
.resetvalue = 0 },
235
{ .name = "ID_AA64ISAR0_EL1", .state = ARM_CP_STATE_AA64,
236
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 0,
237
.access = PL1_R, .type = ARM_CP_CONST,
238
+ .accessfn = access_aa64_tid3,
239
.resetvalue = cpu->isar.id_aa64isar0 },
240
{ .name = "ID_AA64ISAR1_EL1", .state = ARM_CP_STATE_AA64,
241
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 1,
242
.access = PL1_R, .type = ARM_CP_CONST,
243
+ .accessfn = access_aa64_tid3,
244
.resetvalue = cpu->isar.id_aa64isar1 },
245
{ .name = "ID_AA64ISAR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
246
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 2,
247
.access = PL1_R, .type = ARM_CP_CONST,
248
+ .accessfn = access_aa64_tid3,
249
.resetvalue = 0 },
250
{ .name = "ID_AA64ISAR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
251
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 3,
252
.access = PL1_R, .type = ARM_CP_CONST,
253
+ .accessfn = access_aa64_tid3,
254
.resetvalue = 0 },
255
{ .name = "ID_AA64ISAR4_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
256
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 4,
257
.access = PL1_R, .type = ARM_CP_CONST,
258
+ .accessfn = access_aa64_tid3,
259
.resetvalue = 0 },
260
{ .name = "ID_AA64ISAR5_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
261
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 5,
262
.access = PL1_R, .type = ARM_CP_CONST,
263
+ .accessfn = access_aa64_tid3,
264
.resetvalue = 0 },
265
{ .name = "ID_AA64ISAR6_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
266
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 6,
267
.access = PL1_R, .type = ARM_CP_CONST,
268
+ .accessfn = access_aa64_tid3,
269
.resetvalue = 0 },
270
{ .name = "ID_AA64ISAR7_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
271
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 7,
272
.access = PL1_R, .type = ARM_CP_CONST,
273
+ .accessfn = access_aa64_tid3,
274
.resetvalue = 0 },
275
{ .name = "ID_AA64MMFR0_EL1", .state = ARM_CP_STATE_AA64,
276
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 0,
277
.access = PL1_R, .type = ARM_CP_CONST,
278
+ .accessfn = access_aa64_tid3,
279
.resetvalue = cpu->isar.id_aa64mmfr0 },
280
{ .name = "ID_AA64MMFR1_EL1", .state = ARM_CP_STATE_AA64,
281
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 1,
282
.access = PL1_R, .type = ARM_CP_CONST,
283
+ .accessfn = access_aa64_tid3,
284
.resetvalue = cpu->isar.id_aa64mmfr1 },
285
{ .name = "ID_AA64MMFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
286
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 2,
287
.access = PL1_R, .type = ARM_CP_CONST,
288
+ .accessfn = access_aa64_tid3,
289
.resetvalue = 0 },
290
{ .name = "ID_AA64MMFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
291
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 3,
292
.access = PL1_R, .type = ARM_CP_CONST,
293
+ .accessfn = access_aa64_tid3,
294
.resetvalue = 0 },
295
{ .name = "ID_AA64MMFR4_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
296
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 4,
297
.access = PL1_R, .type = ARM_CP_CONST,
298
+ .accessfn = access_aa64_tid3,
299
.resetvalue = 0 },
300
{ .name = "ID_AA64MMFR5_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
301
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 5,
302
.access = PL1_R, .type = ARM_CP_CONST,
303
+ .accessfn = access_aa64_tid3,
304
.resetvalue = 0 },
305
{ .name = "ID_AA64MMFR6_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
306
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 6,
307
.access = PL1_R, .type = ARM_CP_CONST,
308
+ .accessfn = access_aa64_tid3,
309
.resetvalue = 0 },
310
{ .name = "ID_AA64MMFR7_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
311
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 7,
312
.access = PL1_R, .type = ARM_CP_CONST,
313
+ .accessfn = access_aa64_tid3,
314
.resetvalue = 0 },
315
{ .name = "MVFR0_EL1", .state = ARM_CP_STATE_AA64,
316
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 0,
317
.access = PL1_R, .type = ARM_CP_CONST,
318
+ .accessfn = access_aa64_tid3,
319
.resetvalue = cpu->isar.mvfr0 },
320
{ .name = "MVFR1_EL1", .state = ARM_CP_STATE_AA64,
321
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 1,
322
.access = PL1_R, .type = ARM_CP_CONST,
323
+ .accessfn = access_aa64_tid3,
324
.resetvalue = cpu->isar.mvfr1 },
325
{ .name = "MVFR2_EL1", .state = ARM_CP_STATE_AA64,
326
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 2,
327
.access = PL1_R, .type = ARM_CP_CONST,
328
+ .accessfn = access_aa64_tid3,
329
.resetvalue = cpu->isar.mvfr2 },
330
{ .name = "MVFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
331
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 3,
332
.access = PL1_R, .type = ARM_CP_CONST,
333
+ .accessfn = access_aa64_tid3,
334
.resetvalue = 0 },
335
{ .name = "MVFR4_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
336
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 4,
337
.access = PL1_R, .type = ARM_CP_CONST,
338
+ .accessfn = access_aa64_tid3,
339
.resetvalue = 0 },
340
{ .name = "MVFR5_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
341
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 5,
342
.access = PL1_R, .type = ARM_CP_CONST,
343
+ .accessfn = access_aa64_tid3,
344
.resetvalue = 0 },
345
{ .name = "MVFR6_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
346
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 6,
347
.access = PL1_R, .type = ARM_CP_CONST,
348
+ .accessfn = access_aa64_tid3,
349
.resetvalue = 0 },
350
{ .name = "MVFR7_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
351
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 7,
352
.access = PL1_R, .type = ARM_CP_CONST,
353
+ .accessfn = access_aa64_tid3,
354
.resetvalue = 0 },
355
{ .name = "PMCEID0", .state = ARM_CP_STATE_AA32,
356
.cp = 15, .opc1 = 0, .crn = 9, .crm = 12, .opc2 = 6,
357
--
33
--
358
2.20.1
34
2.20.1
359
35
360
36
diff view generated by jsdifflib
New patch
1
Remove a direct include of assert.h -- this is already
2
provided by qemu/osdep.h, and it breaks our rule that the
3
first include must always be osdep.h.
1
4
5
In particular we must get the assert() macro via osdep.h
6
to avoid compile failures on mingw (see the comment in
7
osdep.h where we redefine assert() for that platform).
8
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
11
Reviewed-by: Cédric Le Goater <clg@kaod.org>
12
Message-id: 20200403124712.24826-1-peter.maydell@linaro.org
13
---
14
hw/gpio/aspeed_gpio.c | 2 --
15
1 file changed, 2 deletions(-)
16
17
diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c
18
index XXXXXXX..XXXXXXX 100644
19
--- a/hw/gpio/aspeed_gpio.c
20
+++ b/hw/gpio/aspeed_gpio.c
21
@@ -XXX,XX +XXX,XX @@
22
* SPDX-License-Identifier: GPL-2.0-or-later
23
*/
24
25
-#include <assert.h>
26
-
27
#include "qemu/osdep.h"
28
#include "qemu/host-utils.h"
29
#include "qemu/log.h"
30
--
31
2.20.1
32
33
diff view generated by jsdifflib
New patch
1
In write_elf_section() we set the 'shdr' pointer to point to local
2
structures shdr32 or shdr64, which we fill in to be written out to
3
the ELF dump. Unfortunately the address we pass to fd_write_vmcore()
4
has a spurious '&' operator, so instead of writing out the section
5
header we write out the literal pointer value followed by whatever is
6
on the stack after the 'shdr' local variable.
1
7
8
Pass the correct address into fd_write_vmcore().
9
10
Spotted by Coverity: CID 1421970.
11
12
Cc: qemu-stable@nongnu.org
13
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
14
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
15
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
16
Message-id: 20200324173630.12221-1-peter.maydell@linaro.org
17
---
18
dump/dump.c | 2 +-
19
1 file changed, 1 insertion(+), 1 deletion(-)
20
21
diff --git a/dump/dump.c b/dump/dump.c
22
index XXXXXXX..XXXXXXX 100644
23
--- a/dump/dump.c
24
+++ b/dump/dump.c
25
@@ -XXX,XX +XXX,XX @@ static void write_elf_section(DumpState *s, int type, Error **errp)
26
shdr = &shdr64;
27
}
28
29
- ret = fd_write_vmcore(&shdr, shdr_size, s);
30
+ ret = fd_write_vmcore(shdr, shdr_size, s);
31
if (ret < 0) {
32
error_setg_errno(errp, -ret,
33
"dump: failed to write section header table");
34
--
35
2.20.1
36
37
diff view generated by jsdifflib
New patch
1
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
1
2
3
Remove comment.
4
5
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
6
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
7
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
8
Message-id: 20200402134721.27863-2-edgar.iglesias@gmail.com
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
---
11
hw/dma/xlnx-zdma.c | 1 -
12
1 file changed, 1 deletion(-)
13
14
diff --git a/hw/dma/xlnx-zdma.c b/hw/dma/xlnx-zdma.c
15
index XXXXXXX..XXXXXXX 100644
16
--- a/hw/dma/xlnx-zdma.c
17
+++ b/hw/dma/xlnx-zdma.c
18
@@ -XXX,XX +XXX,XX @@ static void zdma_process_descr(XlnxZDMA *s)
19
zdma_src_done(s);
20
}
21
22
- /* Load next descriptor. */
23
if (ptype == PT_REG || src_cmd == CMD_STOP) {
24
ARRAY_FIELD_DP32(s->regs, ZDMA_CH_CTRL2, EN, 0);
25
zdma_set_state(s, DISABLED);
26
--
27
2.20.1
28
29
diff view generated by jsdifflib
New patch
1
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
1
2
3
Populate DBG0.CMN_BUF_FREE so that SW can see some free space.
4
5
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
6
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
7
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
8
Message-id: 20200402134721.27863-3-edgar.iglesias@gmail.com
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
---
11
hw/dma/xlnx-zdma.c | 6 ++++++
12
1 file changed, 6 insertions(+)
13
14
diff --git a/hw/dma/xlnx-zdma.c b/hw/dma/xlnx-zdma.c
15
index XXXXXXX..XXXXXXX 100644
16
--- a/hw/dma/xlnx-zdma.c
17
+++ b/hw/dma/xlnx-zdma.c
18
@@ -XXX,XX +XXX,XX @@ static RegisterAccessInfo zdma_regs_info[] = {
19
},{ .name = "ZDMA_CH_DBG0", .addr = A_ZDMA_CH_DBG0,
20
.rsvd = 0xfffffe00,
21
.ro = 0x1ff,
22
+
23
+ /*
24
+ * There's SW out there that will check the debug regs for free space.
25
+ * Claim that we always have 0x100 free.
26
+ */
27
+ .reset = 0x100
28
},{ .name = "ZDMA_CH_DBG1", .addr = A_ZDMA_CH_DBG1,
29
.rsvd = 0xfffffe00,
30
.ro = 0x1ff,
31
--
32
2.20.1
33
34
diff view generated by jsdifflib
1
From: Jean-Hugues Deschênes <Jean-Hugues.Deschenes@ossiaco.com>
1
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
2
2
3
According to the PushStack() pseudocode in the armv7m RM,
3
Clear DMA_DONE when halting the DMA channel.
4
bit 4 of the LR should be set to NOT(CONTROL.PFCA) when
5
an FPU is present. Current implementation is doing it for
6
armv8, but not for armv7. This patch makes the existing
7
logic applicable to both code paths.
8
4
9
Signed-off-by: Jean-Hugues Deschenes <jean-hugues.deschenes@ossiaco.com>
5
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
7
Acked-by: Alistair Francis <alistair.francis@wdc.com>
8
Message-id: 20200402134721.27863-4-edgar.iglesias@gmail.com
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
---
10
---
13
target/arm/m_helper.c | 7 +++----
11
hw/dma/xlnx-zdma.c | 1 +
14
1 file changed, 3 insertions(+), 4 deletions(-)
12
1 file changed, 1 insertion(+)
15
13
16
diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c
14
diff --git a/hw/dma/xlnx-zdma.c b/hw/dma/xlnx-zdma.c
17
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
18
--- a/target/arm/m_helper.c
16
--- a/hw/dma/xlnx-zdma.c
19
+++ b/target/arm/m_helper.c
17
+++ b/hw/dma/xlnx-zdma.c
20
@@ -XXX,XX +XXX,XX @@ void arm_v7m_cpu_do_interrupt(CPUState *cs)
18
@@ -XXX,XX +XXX,XX @@ static void zdma_process_descr(XlnxZDMA *s)
21
if (env->v7m.secure) {
19
if (src_cmd == CMD_HALT) {
22
lr |= R_V7M_EXCRET_S_MASK;
20
zdma_set_state(s, PAUSED);
23
}
21
ARRAY_FIELD_DP32(s->regs, ZDMA_CH_ISR, DMA_PAUSE, 1);
24
- if (!(env->v7m.control[M_REG_S] & R_V7M_CONTROL_FPCA_MASK)) {
22
+ ARRAY_FIELD_DP32(s->regs, ZDMA_CH_ISR, DMA_DONE, false);
25
- lr |= R_V7M_EXCRET_FTYPE_MASK;
23
zdma_ch_imr_update_irq(s);
26
- }
24
return;
27
} else {
28
lr = R_V7M_EXCRET_RES1_MASK |
29
R_V7M_EXCRET_S_MASK |
30
R_V7M_EXCRET_DCRS_MASK |
31
- R_V7M_EXCRET_FTYPE_MASK |
32
R_V7M_EXCRET_ES_MASK;
33
if (env->v7m.control[M_REG_NS] & R_V7M_CONTROL_SPSEL_MASK) {
34
lr |= R_V7M_EXCRET_SPSEL_MASK;
35
}
36
}
37
+ if (!(env->v7m.control[M_REG_S] & R_V7M_CONTROL_FPCA_MASK)) {
38
+ lr |= R_V7M_EXCRET_FTYPE_MASK;
39
+ }
40
if (!arm_v7m_is_handler_mode(env)) {
41
lr |= R_V7M_EXCRET_MODE_MASK;
42
}
25
}
43
--
26
--
44
2.20.1
27
2.20.1
45
28
46
29
diff view generated by jsdifflib
New patch
1
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
1
2
3
Advance the descriptor address when stopping the channel.
4
5
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
6
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
7
Acked-by: Alistair Francis <alistair.francis@wdc.com>
8
Message-id: 20200402134721.27863-5-edgar.iglesias@gmail.com
9
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
---
11
hw/dma/xlnx-zdma.c | 1 -
12
1 file changed, 1 deletion(-)
13
14
diff --git a/hw/dma/xlnx-zdma.c b/hw/dma/xlnx-zdma.c
15
index XXXXXXX..XXXXXXX 100644
16
--- a/hw/dma/xlnx-zdma.c
17
+++ b/hw/dma/xlnx-zdma.c
18
@@ -XXX,XX +XXX,XX @@ static void zdma_process_descr(XlnxZDMA *s)
19
if (ptype == PT_REG || src_cmd == CMD_STOP) {
20
ARRAY_FIELD_DP32(s->regs, ZDMA_CH_CTRL2, EN, 0);
21
zdma_set_state(s, DISABLED);
22
- return;
23
}
24
25
if (src_cmd == CMD_HALT) {
26
--
27
2.20.1
28
29
diff view generated by jsdifflib
1
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
1
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
2
2
3
Add the CRP as unimplemented thus avoiding bus errors when
3
Reorganize the descriptor handling so that CUR_DSCR always
4
guests access these registers.
4
points to the next descriptor to be processed.
5
5
6
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
6
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
7
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
7
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
8
Reviewed-by: Luc Michel <luc.michel@greensocs.com>
8
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
9
Message-id: 20191115154734.26449-2-edgar.iglesias@gmail.com
9
Message-id: 20200402134721.27863-6-edgar.iglesias@gmail.com
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
---
11
---
12
include/hw/arm/xlnx-versal.h | 3 +++
12
hw/dma/xlnx-zdma.c | 47 ++++++++++++++++++++++------------------------
13
hw/arm/xlnx-versal.c | 2 ++
13
1 file changed, 22 insertions(+), 25 deletions(-)
14
2 files changed, 5 insertions(+)
15
14
16
diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h
15
diff --git a/hw/dma/xlnx-zdma.c b/hw/dma/xlnx-zdma.c
17
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
18
--- a/include/hw/arm/xlnx-versal.h
17
--- a/hw/dma/xlnx-zdma.c
19
+++ b/include/hw/arm/xlnx-versal.h
18
+++ b/hw/dma/xlnx-zdma.c
20
@@ -XXX,XX +XXX,XX @@ typedef struct Versal {
19
@@ -XXX,XX +XXX,XX @@ static void zdma_load_src_descriptor(XlnxZDMA *s)
21
#define MM_IOU_SCNTRS_SIZE 0x10000
20
}
22
#define MM_FPD_CRF 0xfd1a0000U
21
}
23
#define MM_FPD_CRF_SIZE 0x140000
22
23
+static void zdma_update_descr_addr(XlnxZDMA *s, bool type,
24
+ unsigned int basereg)
25
+{
26
+ uint64_t addr, next;
24
+
27
+
25
+#define MM_PMC_CRP 0xf1260000U
28
+ if (type == DTYPE_LINEAR) {
26
+#define MM_PMC_CRP_SIZE 0x10000
29
+ addr = zdma_get_regaddr64(s, basereg);
27
#endif
30
+ next = addr + sizeof(s->dsc_dst);
28
diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
31
+ } else {
29
index XXXXXXX..XXXXXXX 100644
32
+ addr = zdma_get_regaddr64(s, basereg);
30
--- a/hw/arm/xlnx-versal.c
33
+ addr += sizeof(s->dsc_dst);
31
+++ b/hw/arm/xlnx-versal.c
34
+ address_space_read(s->dma_as, addr, s->attr, (void *) &next, 8);
32
@@ -XXX,XX +XXX,XX @@ static void versal_unimp(Versal *s)
35
+ }
33
MM_CRL, MM_CRL_SIZE);
36
+
34
versal_unimp_area(s, "crf", &s->mr_ps,
37
+ zdma_put_regaddr64(s, basereg, next);
35
MM_FPD_CRF, MM_FPD_CRF_SIZE);
38
+}
36
+ versal_unimp_area(s, "crp", &s->mr_ps,
39
+
37
+ MM_PMC_CRP, MM_PMC_CRP_SIZE);
40
static void zdma_load_dst_descriptor(XlnxZDMA *s)
38
versal_unimp_area(s, "iou-scntr", &s->mr_ps,
41
{
39
MM_IOU_SCNTR, MM_IOU_SCNTR_SIZE);
42
uint64_t dst_addr;
40
versal_unimp_area(s, "iou-scntr-seucre", &s->mr_ps,
43
unsigned int ptype = ARRAY_FIELD_EX32(s->regs, ZDMA_CH_CTRL0, POINT_TYPE);
44
+ bool dst_type;
45
46
if (ptype == PT_REG) {
47
memcpy(&s->dsc_dst, &s->regs[R_ZDMA_CH_DST_DSCR_WORD0],
48
@@ -XXX,XX +XXX,XX @@ static void zdma_load_dst_descriptor(XlnxZDMA *s)
49
if (!zdma_load_descriptor(s, dst_addr, &s->dsc_dst)) {
50
ARRAY_FIELD_DP32(s->regs, ZDMA_CH_ISR, AXI_RD_DST_DSCR, true);
51
}
52
-}
53
54
-static uint64_t zdma_update_descr_addr(XlnxZDMA *s, bool type,
55
- unsigned int basereg)
56
-{
57
- uint64_t addr, next;
58
-
59
- if (type == DTYPE_LINEAR) {
60
- next = zdma_get_regaddr64(s, basereg);
61
- next += sizeof(s->dsc_dst);
62
- zdma_put_regaddr64(s, basereg, next);
63
- } else {
64
- addr = zdma_get_regaddr64(s, basereg);
65
- addr += sizeof(s->dsc_dst);
66
- address_space_read(s->dma_as, addr, s->attr, &next, 8);
67
- zdma_put_regaddr64(s, basereg, next);
68
- }
69
- return next;
70
+ /* Advance the descriptor pointer. */
71
+ dst_type = FIELD_EX32(s->dsc_dst.words[3], ZDMA_CH_DST_DSCR_WORD3, TYPE);
72
+ zdma_update_descr_addr(s, dst_type, R_ZDMA_CH_DST_CUR_DSCR_LSB);
73
}
74
75
static void zdma_write_dst(XlnxZDMA *s, uint8_t *buf, uint32_t len)
76
@@ -XXX,XX +XXX,XX @@ static void zdma_write_dst(XlnxZDMA *s, uint8_t *buf, uint32_t len)
77
dst_size = FIELD_EX32(s->dsc_dst.words[2], ZDMA_CH_DST_DSCR_WORD2,
78
SIZE);
79
if (dst_size == 0 && ptype == PT_MEM) {
80
- uint64_t next;
81
- bool dst_type = FIELD_EX32(s->dsc_dst.words[3],
82
- ZDMA_CH_DST_DSCR_WORD3,
83
- TYPE);
84
-
85
- next = zdma_update_descr_addr(s, dst_type,
86
- R_ZDMA_CH_DST_CUR_DSCR_LSB);
87
- zdma_load_descriptor(s, next, &s->dsc_dst);
88
+ zdma_load_dst_descriptor(s);
89
dst_size = FIELD_EX32(s->dsc_dst.words[2], ZDMA_CH_DST_DSCR_WORD2,
90
SIZE);
91
}
41
--
92
--
42
2.20.1
93
2.20.1
43
94
44
95
diff view generated by jsdifflib