1
Arm patches for rc1:
1
Arm patches for rc3 : just a handful of bug fixes.
2
* two final "remove the old API" patches for some API transitions
3
* bugfix for raspi/highbank Linux boot
4
2
5
thanks
3
thanks
6
-- PMM
4
-- PMM
7
5
8
The following changes since commit 654efcb511d394c1d3f5292c28503d1d19e5b1d3:
9
6
10
Merge remote-tracking branch 'remotes/vivier/tags/q800-branch-pull-request' into staging (2019-11-11 09:23:46 +0000)
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)
11
10
12
are available in the Git repository at:
11
are available in the Git repository at:
13
12
14
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20191111
13
https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20191126
15
14
16
for you to fetch changes up to 45c078f163fd47c35e7505d98928fae63baada7d:
15
for you to fetch changes up to 6a4ef4e5d1084ce41fafa7d470a644b0fd3d9317:
17
16
18
hw/arm/boot: Set NSACR.{CP11, CP10} in dummy SMC setup routine (2019-11-11 13:44:16 +0000)
17
target/arm: Honor HCR_EL2.TID3 trapping requirements (2019-11-26 13:55:37 +0000)
19
18
20
----------------------------------------------------------------
19
----------------------------------------------------------------
21
target-arm queue:
20
target-arm queue:
22
* Remove old unassigned_access CPU hook API
21
* handle FTYPE flag correctly in v7M exception return
23
* Remove old ptimer_init_with_bh() API
22
for v7M CPUs with an FPU (v8M CPUs were already correct)
24
* hw/arm/boot: Set NSACR.{CP11, CP10} in dummy SMC setup routine
23
* versal: Add the CRP as unimplemented
24
* Fix ISR_EL1 tracking when executing at EL2
25
* Honor HCR_EL2.TID3 trapping requirements
25
26
26
----------------------------------------------------------------
27
----------------------------------------------------------------
27
Clement Deschamps (1):
28
Edgar E. Iglesias (1):
28
hw/arm/boot: Set NSACR.{CP11, CP10} in dummy SMC setup routine
29
hw/arm: versal: Add the CRP as unimplemented
29
30
30
Peter Maydell (2):
31
Jean-Hugues Deschênes (1):
31
ptimer: Remove old ptimer_init_with_bh() API
32
target/arm: Fix handling of cortex-m FTYPE flag in EXCRET
32
Remove unassigned_access CPU hook
33
33
34
include/hw/arm/boot.h | 7 ++--
34
Marc Zyngier (2):
35
include/hw/core/cpu.h | 24 --------------
35
target/arm: Fix ISR_EL1 tracking when executing at EL2
36
include/hw/ptimer.h | 45 ++++++++++++-------------
36
target/arm: Honor HCR_EL2.TID3 trapping requirements
37
accel/tcg/cputlb.c | 2 --
38
hw/arm/boot.c | 3 ++
39
hw/core/ptimer.c | 91 +++++++++------------------------------------------
40
memory.c | 7 ----
41
7 files changed, 44 insertions(+), 135 deletions(-)
42
37
38
include/hw/arm/xlnx-versal.h | 3 ++
39
hw/arm/xlnx-versal.c | 2 ++
40
target/arm/helper.c | 83 ++++++++++++++++++++++++++++++++++++++++++--
41
target/arm/m_helper.c | 7 ++--
42
4 files changed, 89 insertions(+), 6 deletions(-)
43
diff view generated by jsdifflib
New patch
1
From: Jean-Hugues Deschênes <Jean-Hugues.Deschenes@ossiaco.com>
1
2
3
According to the PushStack() pseudocode in the armv7m RM,
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
9
Signed-off-by: Jean-Hugues Deschenes <jean-hugues.deschenes@ossiaco.com>
10
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
---
13
target/arm/m_helper.c | 7 +++----
14
1 file changed, 3 insertions(+), 4 deletions(-)
15
16
diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/target/arm/m_helper.c
19
+++ b/target/arm/m_helper.c
20
@@ -XXX,XX +XXX,XX @@ void arm_v7m_cpu_do_interrupt(CPUState *cs)
21
if (env->v7m.secure) {
22
lr |= R_V7M_EXCRET_S_MASK;
23
}
24
- if (!(env->v7m.control[M_REG_S] & R_V7M_CONTROL_FPCA_MASK)) {
25
- lr |= R_V7M_EXCRET_FTYPE_MASK;
26
- }
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
}
43
--
44
2.20.1
45
46
diff view generated by jsdifflib
1
From: Clement Deschamps <clement.deschamps@greensocs.com>
1
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
2
2
3
The boot.c code usually puts the CPU into NS mode directly when it is
3
Add the CRP as unimplemented thus avoiding bus errors when
4
booting a kernel. Since fc1120a7f5f2d4b6 this has included a
4
guests access these registers.
5
requirement to set NSACR to give NS state access to the FPU; we fixed
6
that for the usual code path in ece628fcf6. However, it is also
7
possible for a board model to request an alternative mode of booting,
8
where its 'board_setup' code hook runs in Secure state and is
9
responsible for doing the S->NS transition after it has done whatever
10
work it must do in Secure state. In this situation the board_setup
11
code now also needs to update NSACR.
12
5
13
This affects all boards which set info->secure_board_setup, which is
6
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
14
currently the 'raspi' and 'highbank' families. They both use the
7
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
15
common arm_write_secure_board_setup_dummy_smc().
8
Reviewed-by: Luc Michel <luc.michel@greensocs.com>
16
9
Message-id: 20191115154734.26449-2-edgar.iglesias@gmail.com
17
Set the NSACR CP11 and CP10 bits in the code written by that
18
function, to allow FPU access in Non-Secure state when using dummy
19
SMC setup routine. Otherwise an AArch32 kernel booted on the
20
highbank or raspi boards will UNDEF as soon as it tries to use the
21
FPU.
22
23
Update the comment describing secure_board_setup to note the new
24
requirements on users of it.
25
26
This fixes a kernel panic when booting raspbian on raspi2.
27
28
Successfully tested with:
29
2017-01-11-raspbian-jessie-lite.img
30
2018-11-13-raspbian-stretch-lite.img
31
2019-07-10-raspbian-buster-lite.img
32
33
Fixes: fc1120a7f5
34
Signed-off-by: Clement Deschamps <clement.deschamps@greensocs.com>
35
Tested-by: Laurent Bonnans <laurent.bonnans@here.com>
36
Message-id: 20191104151137.81931-1-clement.deschamps@greensocs.com
37
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
38
[PMM: updated comment to boot.h to note new requirement on
39
users of secure_board_setup; edited/rewrote commit message]
40
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
41
---
11
---
42
include/hw/arm/boot.h | 7 +++++--
12
include/hw/arm/xlnx-versal.h | 3 +++
43
hw/arm/boot.c | 3 +++
13
hw/arm/xlnx-versal.c | 2 ++
44
2 files changed, 8 insertions(+), 2 deletions(-)
14
2 files changed, 5 insertions(+)
45
15
46
diff --git a/include/hw/arm/boot.h b/include/hw/arm/boot.h
16
diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h
47
index XXXXXXX..XXXXXXX 100644
17
index XXXXXXX..XXXXXXX 100644
48
--- a/include/hw/arm/boot.h
18
--- a/include/hw/arm/xlnx-versal.h
49
+++ b/include/hw/arm/boot.h
19
+++ b/include/hw/arm/xlnx-versal.h
50
@@ -XXX,XX +XXX,XX @@ struct arm_boot_info {
20
@@ -XXX,XX +XXX,XX @@ typedef struct Versal {
51
void (*write_board_setup)(ARMCPU *cpu,
21
#define MM_IOU_SCNTRS_SIZE 0x10000
52
const struct arm_boot_info *info);
22
#define MM_FPD_CRF 0xfd1a0000U
53
23
#define MM_FPD_CRF_SIZE 0x140000
54
- /* If set, the board specific loader/setup blob will be run from secure
24
+
55
+ /*
25
+#define MM_PMC_CRP 0xf1260000U
56
+ * If set, the board specific loader/setup blob will be run from secure
26
+#define MM_PMC_CRP_SIZE 0x10000
57
* mode, regardless of secure_boot. The blob becomes responsible for
27
#endif
58
- * changing to non-secure state if implementing a non-secure boot
28
diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
59
+ * changing to non-secure state if implementing a non-secure boot,
60
+ * including setting up EL3/Secure registers such as the NSACR as
61
+ * required by the Linux booting ABI before the switch to non-secure.
62
*/
63
bool secure_board_setup;
64
65
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
66
index XXXXXXX..XXXXXXX 100644
29
index XXXXXXX..XXXXXXX 100644
67
--- a/hw/arm/boot.c
30
--- a/hw/arm/xlnx-versal.c
68
+++ b/hw/arm/boot.c
31
+++ b/hw/arm/xlnx-versal.c
69
@@ -XXX,XX +XXX,XX @@ void arm_write_secure_board_setup_dummy_smc(ARMCPU *cpu,
32
@@ -XXX,XX +XXX,XX @@ static void versal_unimp(Versal *s)
70
};
33
MM_CRL, MM_CRL_SIZE);
71
uint32_t board_setup_blob[] = {
34
versal_unimp_area(s, "crf", &s->mr_ps,
72
/* board setup addr */
35
MM_FPD_CRF, MM_FPD_CRF_SIZE);
73
+ 0xee110f51, /* mrc p15, 0, r0, c1, c1, 2 ;read NSACR */
36
+ versal_unimp_area(s, "crp", &s->mr_ps,
74
+ 0xe3800b03, /* orr r0, #0xc00 ;set CP11, CP10 */
37
+ MM_PMC_CRP, MM_PMC_CRP_SIZE);
75
+ 0xee010f51, /* mcr p15, 0, r0, c1, c1, 2 ;write NSACR */
38
versal_unimp_area(s, "iou-scntr", &s->mr_ps,
76
0xe3a00e00 + (mvbar_addr >> 4), /* mov r0, #mvbar_addr */
39
MM_IOU_SCNTR, MM_IOU_SCNTR_SIZE);
77
0xee0c0f30, /* mcr p15, 0, r0, c12, c0, 1 ;set MVBAR */
40
versal_unimp_area(s, "iou-scntr-seucre", &s->mr_ps,
78
0xee110f11, /* mrc p15, 0, r0, c1 , c1, 0 ;read SCR */
79
--
41
--
80
2.20.1
42
2.20.1
81
43
82
44
diff view generated by jsdifflib
1
All targets have now migrated away from the old unassigned_access
1
From: Marc Zyngier <maz@kernel.org>
2
hook to the new do_transaction_failed hook. This means we can remove
3
the core-code infrastructure for that hook and the code that calls it.
4
2
3
The ARMv8 ARM states when executing at EL2, EL3 or Secure EL1,
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>
5
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
22
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
7
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
8
Message-id: 20191108173732.11816-1-peter.maydell@linaro.org
9
---
23
---
10
include/hw/core/cpu.h | 24 ------------------------
24
target/arm/helper.c | 7 +++++--
11
accel/tcg/cputlb.c | 2 --
25
1 file changed, 5 insertions(+), 2 deletions(-)
12
memory.c | 7 -------
13
3 files changed, 33 deletions(-)
14
26
15
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
27
diff --git a/target/arm/helper.c b/target/arm/helper.c
16
index XXXXXXX..XXXXXXX 100644
28
index XXXXXXX..XXXXXXX 100644
17
--- a/include/hw/core/cpu.h
29
--- a/target/arm/helper.c
18
+++ b/include/hw/core/cpu.h
30
+++ b/target/arm/helper.c
19
@@ -XXX,XX +XXX,XX @@ typedef enum MMUAccessType {
31
@@ -XXX,XX +XXX,XX @@ static uint64_t isr_read(CPUARMState *env, const ARMCPRegInfo *ri)
20
32
CPUState *cs = env_cpu(env);
21
typedef struct CPUWatchpoint CPUWatchpoint;
33
uint64_t hcr_el2 = arm_hcr_el2_eff(env);
22
34
uint64_t ret = 0;
23
-typedef void (*CPUUnassignedAccess)(CPUState *cpu, hwaddr addr,
35
+ bool allow_virt = (arm_current_el(env) == 1 &&
24
- bool is_write, bool is_exec, int opaque,
36
+ (!arm_is_secure_below_el3(env) ||
25
- unsigned size);
37
+ (env->cp15.scr_el3 & SCR_EEL2)));
26
-
38
27
struct TranslationBlock;
39
- if (hcr_el2 & HCR_IMO) {
28
40
+ if (allow_virt && (hcr_el2 & HCR_IMO)) {
29
/**
41
if (cs->interrupt_request & CPU_INTERRUPT_VIRQ) {
30
@@ -XXX,XX +XXX,XX @@ struct TranslationBlock;
42
ret |= CPSR_I;
31
* @reset_dump_flags: #CPUDumpFlags to use for reset logging.
43
}
32
* @has_work: Callback for checking if there is work to do.
44
@@ -XXX,XX +XXX,XX @@ static uint64_t isr_read(CPUARMState *env, const ARMCPRegInfo *ri)
33
* @do_interrupt: Callback for interrupt handling.
45
}
34
- * @do_unassigned_access: Callback for unassigned access handling.
35
- * (this is deprecated: new targets should use do_transaction_failed instead)
36
* @do_unaligned_access: Callback for unaligned access handling, if
37
* the target defines #TARGET_ALIGNED_ONLY.
38
* @do_transaction_failed: Callback for handling failed memory transactions
39
@@ -XXX,XX +XXX,XX @@ typedef struct CPUClass {
40
int reset_dump_flags;
41
bool (*has_work)(CPUState *cpu);
42
void (*do_interrupt)(CPUState *cpu);
43
- CPUUnassignedAccess do_unassigned_access;
44
void (*do_unaligned_access)(CPUState *cpu, vaddr addr,
45
MMUAccessType access_type,
46
int mmu_idx, uintptr_t retaddr);
47
@@ -XXX,XX +XXX,XX @@ struct CPUState {
48
* we store some rarely used information in the CPU context.
49
*/
50
uintptr_t mem_io_pc;
51
- /*
52
- * This is only needed for the legacy cpu_unassigned_access() hook;
53
- * when all targets using it have been converted to use
54
- * cpu_transaction_failed() instead it can be removed.
55
- */
56
- MMUAccessType mem_io_access_type;
57
58
int kvm_fd;
59
struct KVMState *kvm_state;
60
@@ -XXX,XX +XXX,XX @@ void cpu_interrupt(CPUState *cpu, int mask);
61
#ifdef NEED_CPU_H
62
63
#ifdef CONFIG_SOFTMMU
64
-static inline void cpu_unassigned_access(CPUState *cpu, hwaddr addr,
65
- bool is_write, bool is_exec,
66
- int opaque, unsigned size)
67
-{
68
- CPUClass *cc = CPU_GET_CLASS(cpu);
69
-
70
- if (cc->do_unassigned_access) {
71
- cc->do_unassigned_access(cpu, addr, is_write, is_exec, opaque, size);
72
- }
73
-}
74
-
75
static inline void cpu_unaligned_access(CPUState *cpu, vaddr addr,
76
MMUAccessType access_type,
77
int mmu_idx, uintptr_t retaddr)
78
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
79
index XXXXXXX..XXXXXXX 100644
80
--- a/accel/tcg/cputlb.c
81
+++ b/accel/tcg/cputlb.c
82
@@ -XXX,XX +XXX,XX @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry,
83
cpu_io_recompile(cpu, retaddr);
84
}
46
}
85
47
86
- cpu->mem_io_access_type = access_type;
48
- if (hcr_el2 & HCR_FMO) {
87
-
49
+ if (allow_virt && (hcr_el2 & HCR_FMO)) {
88
if (mr->global_locking && !qemu_mutex_iothread_locked()) {
50
if (cs->interrupt_request & CPU_INTERRUPT_VFIQ) {
89
qemu_mutex_lock_iothread();
51
ret |= CPSR_F;
90
locked = true;
52
}
91
diff --git a/memory.c b/memory.c
92
index XXXXXXX..XXXXXXX 100644
93
--- a/memory.c
94
+++ b/memory.c
95
@@ -XXX,XX +XXX,XX @@ static uint64_t unassigned_mem_read(void *opaque, hwaddr addr,
96
#ifdef DEBUG_UNASSIGNED
97
printf("Unassigned mem read " TARGET_FMT_plx "\n", addr);
98
#endif
99
- if (current_cpu != NULL) {
100
- bool is_exec = current_cpu->mem_io_access_type == MMU_INST_FETCH;
101
- cpu_unassigned_access(current_cpu, addr, false, is_exec, 0, size);
102
- }
103
return 0;
104
}
105
106
@@ -XXX,XX +XXX,XX @@ static void unassigned_mem_write(void *opaque, hwaddr addr,
107
#ifdef DEBUG_UNASSIGNED
108
printf("Unassigned mem write " TARGET_FMT_plx " = 0x%"PRIx64"\n", addr, val);
109
#endif
110
- if (current_cpu != NULL) {
111
- cpu_unassigned_access(current_cpu, addr, true, false, 0, size);
112
- }
113
}
114
115
static bool unassigned_mem_accepts(void *opaque, hwaddr addr,
116
--
53
--
117
2.20.1
54
2.20.1
118
55
119
56
diff view generated by jsdifflib
1
Now all the users of ptimers have converted to the transaction-based
1
From: Marc Zyngier <maz@kernel.org>
2
API, we can remove ptimer_init_with_bh() and all the code paths
2
3
that are used only by bottom-half based ptimers, and tidy up the
3
HCR_EL2.TID3 mandates that access from EL1 to a long list of id
4
documentation comments to consider the transaction-based API the
4
registers traps to EL2, and QEMU has so far ignored this requirement.
5
only possibility.
5
6
6
This breaks (among other things) KVM guests that have PtrAuth enabled,
7
The code changes result from:
7
while the hypervisor doesn't want to expose the feature to its guest.
8
* s->bh no longer exists
8
To achieve this, KVM traps the ID registers (ID_AA64ISAR1_EL1 in this
9
* s->callback is now always non-NULL
9
case), and masks out the unsupported feature.
10
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>
11
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
29
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
12
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
13
Message-id: 20191025142411.17085-1-peter.maydell@linaro.org
14
---
30
---
15
include/hw/ptimer.h | 45 +++++++++++-----------
31
target/arm/helper.c | 76 +++++++++++++++++++++++++++++++++++++++++++++
16
hw/core/ptimer.c | 91 ++++++++-------------------------------------
32
1 file changed, 76 insertions(+)
17
2 files changed, 36 insertions(+), 100 deletions(-)
33
18
34
diff --git a/target/arm/helper.c b/target/arm/helper.c
19
diff --git a/include/hw/ptimer.h b/include/hw/ptimer.h
20
index XXXXXXX..XXXXXXX 100644
35
index XXXXXXX..XXXXXXX 100644
21
--- a/include/hw/ptimer.h
36
--- a/target/arm/helper.c
22
+++ b/include/hw/ptimer.h
37
+++ b/target/arm/helper.c
23
@@ -XXX,XX +XXX,XX @@
38
@@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo predinv_reginfo[] = {
24
39
REGINFO_SENTINEL
25
#include "qemu/timer.h"
40
};
26
41
27
-/* The ptimer API implements a simple periodic countdown timer.
42
+static CPAccessResult access_aa64_tid3(CPUARMState *env, const ARMCPRegInfo *ri,
28
+/*
43
+ bool isread)
29
+ * The ptimer API implements a simple periodic countdown timer.
44
+{
30
* The countdown timer has a value (which can be read and written via
45
+ if ((arm_current_el(env) < 2) && (arm_hcr_el2_eff(env) & HCR_TID3)) {
31
* ptimer_get_count() and ptimer_set_count()). When it is enabled
46
+ return CP_ACCESS_TRAP_EL2;
32
* using ptimer_run(), the value will count downwards at the frequency
47
+ }
33
* which has been configured using ptimer_set_period() or ptimer_set_freq().
48
+
34
- * When it reaches zero it will trigger a QEMU bottom half handler, and
49
+ return CP_ACCESS_OK;
35
+ * When it reaches zero it will trigger a callback function, and
50
+}
36
* can be set to either reload itself from a specified limit value
51
+
37
* and keep counting down, or to stop (as a one-shot timer).
52
+static CPAccessResult access_aa32_tid3(CPUARMState *env, const ARMCPRegInfo *ri,
38
*
53
+ bool isread)
39
+ * A transaction-based API is used for modifying ptimer state: all calls
54
+{
40
+ * to functions which modify ptimer state must be between matched calls to
55
+ if (arm_feature(env, ARM_FEATURE_V8)) {
41
+ * ptimer_transaction_begin() and ptimer_transaction_commit().
56
+ return access_aa64_tid3(env, ri, isread);
42
+ * When ptimer_transaction_commit() is called it will evaluate the state
57
+ }
43
+ * of the timer after all the changes in the transaction, and call the
58
+
44
+ * callback if necessary. (See the ptimer_init() documentation for the full
59
+ return CP_ACCESS_OK;
45
+ * list of state-modifying functions and detailed semantics of the callback.)
60
+}
46
+ *
61
+
47
* Forgetting to set the period/frequency (or setting it to zero) is a
62
void register_cp_regs_for_features(ARMCPU *cpu)
48
* bug in the QEMU device and will cause warning messages to be printed
49
* to stderr when the guest attempts to enable the timer.
50
@@ -XXX,XX +XXX,XX @@
51
* ptimer_set_count() or ptimer_set_limit() will not trigger the timer
52
* (though it will cause a reload). Only a counter decrement to "0"
53
* will cause a trigger. Not compatible with NO_IMMEDIATE_TRIGGER;
54
- * ptimer_init_with_bh() will assert() that you don't set both.
55
+ * ptimer_init() will assert() that you don't set both.
56
*/
57
#define PTIMER_POLICY_TRIGGER_ONLY_ON_DECREMENT (1 << 5)
58
59
@@ -XXX,XX +XXX,XX @@
60
typedef struct ptimer_state ptimer_state;
61
typedef void (*ptimer_cb)(void *opaque);
62
63
-/**
64
- * ptimer_init_with_bh - Allocate and return a new ptimer
65
- * @bh: QEMU bottom half which is run on timer expiry
66
- * @policy: PTIMER_POLICY_* bits specifying behaviour
67
- *
68
- * The ptimer returned must be freed using ptimer_free().
69
- * The ptimer takes ownership of @bh and will delete it
70
- * when the ptimer is eventually freed.
71
- */
72
-ptimer_state *ptimer_init_with_bh(QEMUBH *bh, uint8_t policy_mask);
73
-
74
/**
75
* ptimer_init - Allocate and return a new ptimer
76
* @callback: function to call on ptimer expiry
77
@@ -XXX,XX +XXX,XX @@ ptimer_state *ptimer_init(ptimer_cb callback,
78
* ptimer_free - Free a ptimer
79
* @s: timer to free
80
*
81
- * Free a ptimer created using ptimer_init_with_bh() (including
82
- * deleting the bottom half which it is using).
83
+ * Free a ptimer created using ptimer_init().
84
*/
85
void ptimer_free(ptimer_state *s);
86
87
@@ -XXX,XX +XXX,XX @@ void ptimer_transaction_commit(ptimer_state *s);
88
* may be more appropriate.
89
*
90
* This function will assert if it is called outside a
91
- * ptimer_transaction_begin/commit block, unless this is a bottom-half ptimer.
92
+ * ptimer_transaction_begin/commit block.
93
*/
94
void ptimer_set_period(ptimer_state *s, int64_t period);
95
96
@@ -XXX,XX +XXX,XX @@ void ptimer_set_period(ptimer_state *s, int64_t period);
97
* precise to fractions of a nanosecond, avoiding rounding errors.
98
*
99
* This function will assert if it is called outside a
100
- * ptimer_transaction_begin/commit block, unless this is a bottom-half ptimer.
101
+ * ptimer_transaction_begin/commit block.
102
*/
103
void ptimer_set_freq(ptimer_state *s, uint32_t freq);
104
105
@@ -XXX,XX +XXX,XX @@ uint64_t ptimer_get_limit(ptimer_state *s);
106
* reload the counter when their reload register is written to.
107
*
108
* This function will assert if it is called outside a
109
- * ptimer_transaction_begin/commit block, unless this is a bottom-half ptimer.
110
+ * ptimer_transaction_begin/commit block.
111
*/
112
void ptimer_set_limit(ptimer_state *s, uint64_t limit, int reload);
113
114
@@ -XXX,XX +XXX,XX @@ uint64_t ptimer_get_count(ptimer_state *s);
115
* point in the future.
116
*
117
* This function will assert if it is called outside a
118
- * ptimer_transaction_begin/commit block, unless this is a bottom-half ptimer.
119
+ * ptimer_transaction_begin/commit block.
120
*/
121
void ptimer_set_count(ptimer_state *s, uint64_t count);
122
123
@@ -XXX,XX +XXX,XX @@ void ptimer_set_count(ptimer_state *s, uint64_t count);
124
* @s: ptimer
125
* @oneshot: non-zero if this timer should only count down once
126
*
127
- * Start a ptimer counting down; when it reaches zero the bottom half
128
- * passed to ptimer_init_with_bh() will be invoked.
129
+ * Start a ptimer counting down; when it reaches zero the callback function
130
+ * passed to ptimer_init() will be invoked.
131
* If the @oneshot argument is zero,
132
* the counter value will then be reloaded from the limit and it will
133
* start counting down again. If @oneshot is non-zero, then the counter
134
* will disable itself when it reaches zero.
135
*
136
* This function will assert if it is called outside a
137
- * ptimer_transaction_begin/commit block, unless this is a bottom-half ptimer.
138
+ * ptimer_transaction_begin/commit block.
139
*/
140
void ptimer_run(ptimer_state *s, int oneshot);
141
142
@@ -XXX,XX +XXX,XX @@ void ptimer_run(ptimer_state *s, int oneshot);
143
* restarted.
144
*
145
* This function will assert if it is called outside a
146
- * ptimer_transaction_begin/commit block, unless this is a bottom-half ptimer.
147
+ * ptimer_transaction_begin/commit block.
148
*/
149
void ptimer_stop(ptimer_state *s);
150
151
diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c
152
index XXXXXXX..XXXXXXX 100644
153
--- a/hw/core/ptimer.c
154
+++ b/hw/core/ptimer.c
155
@@ -XXX,XX +XXX,XX @@ struct ptimer_state
156
int64_t last_event;
157
int64_t next_event;
158
uint8_t policy_mask;
159
- QEMUBH *bh;
160
QEMUTimer *timer;
161
ptimer_cb callback;
162
void *callback_opaque;
163
@@ -XXX,XX +XXX,XX @@ struct ptimer_state
164
/* Use a bottom-half routine to avoid reentrancy issues. */
165
static void ptimer_trigger(ptimer_state *s)
166
{
63
{
167
- if (s->bh) {
64
/* Register all the coprocessor registers based on feature bits */
168
- replay_bh_schedule_event(s->bh);
65
@@ -XXX,XX +XXX,XX @@ void register_cp_regs_for_features(ARMCPU *cpu)
169
- }
66
{ .name = "ID_PFR0", .state = ARM_CP_STATE_BOTH,
170
- if (s->callback) {
67
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 0,
171
- s->callback(s->callback_opaque);
68
.access = PL1_R, .type = ARM_CP_CONST,
172
- }
69
+ .accessfn = access_aa32_tid3,
173
+ s->callback(s->callback_opaque);
70
.resetvalue = cpu->id_pfr0 },
174
}
71
/* ID_PFR1 is not a plain ARM_CP_CONST because we don't know
175
72
* the value of the GIC field until after we define these regs.
176
static void ptimer_reload(ptimer_state *s, int delta_adjust)
73
@@ -XXX,XX +XXX,XX @@ void register_cp_regs_for_features(ARMCPU *cpu)
177
@@ -XXX,XX +XXX,XX @@ uint64_t ptimer_get_count(ptimer_state *s)
74
{ .name = "ID_PFR1", .state = ARM_CP_STATE_BOTH,
178
75
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 1,
179
void ptimer_set_count(ptimer_state *s, uint64_t count)
76
.access = PL1_R, .type = ARM_CP_NO_RAW,
180
{
77
+ .accessfn = access_aa32_tid3,
181
- assert(s->in_transaction || !s->callback);
78
.readfn = id_pfr1_read,
182
+ assert(s->in_transaction);
79
.writefn = arm_cp_write_ignore },
183
s->delta = count;
80
{ .name = "ID_DFR0", .state = ARM_CP_STATE_BOTH,
184
if (s->enabled) {
81
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 2,
185
- if (!s->callback) {
82
.access = PL1_R, .type = ARM_CP_CONST,
186
- s->next_event = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
83
+ .accessfn = access_aa32_tid3,
187
- ptimer_reload(s, 0);
84
.resetvalue = cpu->id_dfr0 },
188
- } else {
85
{ .name = "ID_AFR0", .state = ARM_CP_STATE_BOTH,
189
- s->need_reload = true;
86
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 3,
190
- }
87
.access = PL1_R, .type = ARM_CP_CONST,
191
+ s->need_reload = true;
88
+ .accessfn = access_aa32_tid3,
192
}
89
.resetvalue = cpu->id_afr0 },
193
}
90
{ .name = "ID_MMFR0", .state = ARM_CP_STATE_BOTH,
194
91
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 4,
195
@@ -XXX,XX +XXX,XX @@ void ptimer_run(ptimer_state *s, int oneshot)
92
.access = PL1_R, .type = ARM_CP_CONST,
196
{
93
+ .accessfn = access_aa32_tid3,
197
bool was_disabled = !s->enabled;
94
.resetvalue = cpu->id_mmfr0 },
198
95
{ .name = "ID_MMFR1", .state = ARM_CP_STATE_BOTH,
199
- assert(s->in_transaction || !s->callback);
96
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 5,
200
+ assert(s->in_transaction);
97
.access = PL1_R, .type = ARM_CP_CONST,
201
98
+ .accessfn = access_aa32_tid3,
202
if (was_disabled && s->period == 0) {
99
.resetvalue = cpu->id_mmfr1 },
203
if (!qtest_enabled()) {
100
{ .name = "ID_MMFR2", .state = ARM_CP_STATE_BOTH,
204
@@ -XXX,XX +XXX,XX @@ void ptimer_run(ptimer_state *s, int oneshot)
101
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 6,
205
}
102
.access = PL1_R, .type = ARM_CP_CONST,
206
s->enabled = oneshot ? 2 : 1;
103
+ .accessfn = access_aa32_tid3,
207
if (was_disabled) {
104
.resetvalue = cpu->id_mmfr2 },
208
- if (!s->callback) {
105
{ .name = "ID_MMFR3", .state = ARM_CP_STATE_BOTH,
209
- s->next_event = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
106
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 1, .opc2 = 7,
210
- ptimer_reload(s, 0);
107
.access = PL1_R, .type = ARM_CP_CONST,
211
- } else {
108
+ .accessfn = access_aa32_tid3,
212
- s->need_reload = true;
109
.resetvalue = cpu->id_mmfr3 },
213
- }
110
{ .name = "ID_ISAR0", .state = ARM_CP_STATE_BOTH,
214
+ s->need_reload = true;
111
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 0,
215
}
112
.access = PL1_R, .type = ARM_CP_CONST,
216
}
113
+ .accessfn = access_aa32_tid3,
217
114
.resetvalue = cpu->isar.id_isar0 },
218
@@ -XXX,XX +XXX,XX @@ void ptimer_run(ptimer_state *s, int oneshot)
115
{ .name = "ID_ISAR1", .state = ARM_CP_STATE_BOTH,
219
is immediately restarted. */
116
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 1,
220
void ptimer_stop(ptimer_state *s)
117
.access = PL1_R, .type = ARM_CP_CONST,
221
{
118
+ .accessfn = access_aa32_tid3,
222
- assert(s->in_transaction || !s->callback);
119
.resetvalue = cpu->isar.id_isar1 },
223
+ assert(s->in_transaction);
120
{ .name = "ID_ISAR2", .state = ARM_CP_STATE_BOTH,
224
121
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 2,
225
if (!s->enabled)
122
.access = PL1_R, .type = ARM_CP_CONST,
226
return;
123
+ .accessfn = access_aa32_tid3,
227
@@ -XXX,XX +XXX,XX @@ void ptimer_stop(ptimer_state *s)
124
.resetvalue = cpu->isar.id_isar2 },
228
s->delta = ptimer_get_count(s);
125
{ .name = "ID_ISAR3", .state = ARM_CP_STATE_BOTH,
229
timer_del(s->timer);
126
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 3,
230
s->enabled = 0;
127
.access = PL1_R, .type = ARM_CP_CONST,
231
- if (s->callback) {
128
+ .accessfn = access_aa32_tid3,
232
- s->need_reload = false;
129
.resetvalue = cpu->isar.id_isar3 },
233
- }
130
{ .name = "ID_ISAR4", .state = ARM_CP_STATE_BOTH,
234
+ s->need_reload = false;
131
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 4,
235
}
132
.access = PL1_R, .type = ARM_CP_CONST,
236
133
+ .accessfn = access_aa32_tid3,
237
/* Set counter increment interval in nanoseconds. */
134
.resetvalue = cpu->isar.id_isar4 },
238
void ptimer_set_period(ptimer_state *s, int64_t period)
135
{ .name = "ID_ISAR5", .state = ARM_CP_STATE_BOTH,
239
{
136
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 5,
240
- assert(s->in_transaction || !s->callback);
137
.access = PL1_R, .type = ARM_CP_CONST,
241
+ assert(s->in_transaction);
138
+ .accessfn = access_aa32_tid3,
242
s->delta = ptimer_get_count(s);
139
.resetvalue = cpu->isar.id_isar5 },
243
s->period = period;
140
{ .name = "ID_MMFR4", .state = ARM_CP_STATE_BOTH,
244
s->period_frac = 0;
141
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 6,
245
if (s->enabled) {
142
.access = PL1_R, .type = ARM_CP_CONST,
246
- if (!s->callback) {
143
+ .accessfn = access_aa32_tid3,
247
- s->next_event = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
144
.resetvalue = cpu->id_mmfr4 },
248
- ptimer_reload(s, 0);
145
{ .name = "ID_ISAR6", .state = ARM_CP_STATE_BOTH,
249
- } else {
146
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 7,
250
- s->need_reload = true;
147
.access = PL1_R, .type = ARM_CP_CONST,
251
- }
148
+ .accessfn = access_aa32_tid3,
252
+ s->need_reload = true;
149
.resetvalue = cpu->isar.id_isar6 },
253
}
150
REGINFO_SENTINEL
254
}
151
};
255
152
@@ -XXX,XX +XXX,XX @@ void register_cp_regs_for_features(ARMCPU *cpu)
256
/* Set counter frequency in Hz. */
153
{ .name = "ID_AA64PFR0_EL1", .state = ARM_CP_STATE_AA64,
257
void ptimer_set_freq(ptimer_state *s, uint32_t freq)
154
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 0,
258
{
155
.access = PL1_R, .type = ARM_CP_NO_RAW,
259
- assert(s->in_transaction || !s->callback);
156
+ .accessfn = access_aa64_tid3,
260
+ assert(s->in_transaction);
157
.readfn = id_aa64pfr0_read,
261
s->delta = ptimer_get_count(s);
158
.writefn = arm_cp_write_ignore },
262
s->period = 1000000000ll / freq;
159
{ .name = "ID_AA64PFR1_EL1", .state = ARM_CP_STATE_AA64,
263
s->period_frac = (1000000000ll << 32) / freq;
160
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 1,
264
if (s->enabled) {
161
.access = PL1_R, .type = ARM_CP_CONST,
265
- if (!s->callback) {
162
+ .accessfn = access_aa64_tid3,
266
- s->next_event = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
163
.resetvalue = cpu->isar.id_aa64pfr1},
267
- ptimer_reload(s, 0);
164
{ .name = "ID_AA64PFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
268
- } else {
165
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 2,
269
- s->need_reload = true;
166
.access = PL1_R, .type = ARM_CP_CONST,
270
- }
167
+ .accessfn = access_aa64_tid3,
271
+ s->need_reload = true;
168
.resetvalue = 0 },
272
}
169
{ .name = "ID_AA64PFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
273
}
170
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 3,
274
171
.access = PL1_R, .type = ARM_CP_CONST,
275
@@ -XXX,XX +XXX,XX @@ void ptimer_set_freq(ptimer_state *s, uint32_t freq)
172
+ .accessfn = access_aa64_tid3,
276
count = limit. */
173
.resetvalue = 0 },
277
void ptimer_set_limit(ptimer_state *s, uint64_t limit, int reload)
174
{ .name = "ID_AA64ZFR0_EL1", .state = ARM_CP_STATE_AA64,
278
{
175
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 4,
279
- assert(s->in_transaction || !s->callback);
176
.access = PL1_R, .type = ARM_CP_CONST,
280
+ assert(s->in_transaction);
177
+ .accessfn = access_aa64_tid3,
281
s->limit = limit;
178
/* At present, only SVEver == 0 is defined anyway. */
282
if (reload)
179
.resetvalue = 0 },
283
s->delta = limit;
180
{ .name = "ID_AA64PFR5_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
284
if (s->enabled && reload) {
181
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 5,
285
- if (!s->callback) {
182
.access = PL1_R, .type = ARM_CP_CONST,
286
- s->next_event = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
183
+ .accessfn = access_aa64_tid3,
287
- ptimer_reload(s, 0);
184
.resetvalue = 0 },
288
- } else {
185
{ .name = "ID_AA64PFR6_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
289
- s->need_reload = true;
186
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 6,
290
- }
187
.access = PL1_R, .type = ARM_CP_CONST,
291
+ s->need_reload = true;
188
+ .accessfn = access_aa64_tid3,
292
}
189
.resetvalue = 0 },
293
}
190
{ .name = "ID_AA64PFR7_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
294
191
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 7,
295
@@ -XXX,XX +XXX,XX @@ uint64_t ptimer_get_limit(ptimer_state *s)
192
.access = PL1_R, .type = ARM_CP_CONST,
296
193
+ .accessfn = access_aa64_tid3,
297
void ptimer_transaction_begin(ptimer_state *s)
194
.resetvalue = 0 },
298
{
195
{ .name = "ID_AA64DFR0_EL1", .state = ARM_CP_STATE_AA64,
299
- assert(!s->in_transaction || !s->callback);
196
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 0,
300
+ assert(!s->in_transaction);
197
.access = PL1_R, .type = ARM_CP_CONST,
301
s->in_transaction = true;
198
+ .accessfn = access_aa64_tid3,
302
s->need_reload = false;
199
.resetvalue = cpu->id_aa64dfr0 },
303
}
200
{ .name = "ID_AA64DFR1_EL1", .state = ARM_CP_STATE_AA64,
304
@@ -XXX,XX +XXX,XX @@ const VMStateDescription vmstate_ptimer = {
201
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 1,
305
}
202
.access = PL1_R, .type = ARM_CP_CONST,
306
};
203
+ .accessfn = access_aa64_tid3,
307
204
.resetvalue = cpu->id_aa64dfr1 },
308
-ptimer_state *ptimer_init_with_bh(QEMUBH *bh, uint8_t policy_mask)
205
{ .name = "ID_AA64DFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
309
-{
206
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 2,
310
- ptimer_state *s;
207
.access = PL1_R, .type = ARM_CP_CONST,
311
-
208
+ .accessfn = access_aa64_tid3,
312
- s = (ptimer_state *)g_malloc0(sizeof(ptimer_state));
209
.resetvalue = 0 },
313
- s->bh = bh;
210
{ .name = "ID_AA64DFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
314
- s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, ptimer_tick, s);
211
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 3,
315
- s->policy_mask = policy_mask;
212
.access = PL1_R, .type = ARM_CP_CONST,
316
-
213
+ .accessfn = access_aa64_tid3,
317
- /*
214
.resetvalue = 0 },
318
- * These two policies are incompatible -- trigger-on-decrement implies
215
{ .name = "ID_AA64AFR0_EL1", .state = ARM_CP_STATE_AA64,
319
- * a timer trigger when the count becomes 0, but no-immediate-trigger
216
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 4,
320
- * implies a trigger when the count stops being 0.
217
.access = PL1_R, .type = ARM_CP_CONST,
321
- */
218
+ .accessfn = access_aa64_tid3,
322
- assert(!((policy_mask & PTIMER_POLICY_TRIGGER_ONLY_ON_DECREMENT) &&
219
.resetvalue = cpu->id_aa64afr0 },
323
- (policy_mask & PTIMER_POLICY_NO_IMMEDIATE_TRIGGER)));
220
{ .name = "ID_AA64AFR1_EL1", .state = ARM_CP_STATE_AA64,
324
- return s;
221
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 5,
325
-}
222
.access = PL1_R, .type = ARM_CP_CONST,
326
-
223
+ .accessfn = access_aa64_tid3,
327
ptimer_state *ptimer_init(ptimer_cb callback, void *callback_opaque,
224
.resetvalue = cpu->id_aa64afr1 },
328
uint8_t policy_mask)
225
{ .name = "ID_AA64AFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
329
{
226
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 6,
330
ptimer_state *s;
227
.access = PL1_R, .type = ARM_CP_CONST,
331
228
+ .accessfn = access_aa64_tid3,
332
- /*
229
.resetvalue = 0 },
333
- * The callback function is mandatory; so we use it to distinguish
230
{ .name = "ID_AA64AFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
334
- * old-style QEMUBH ptimers from new transaction API ptimers.
231
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 7,
335
- * (ptimer_init_with_bh() allows a NULL bh pointer and at least
232
.access = PL1_R, .type = ARM_CP_CONST,
336
- * one device (digic-timer) passes NULL, so it's not the case
233
+ .accessfn = access_aa64_tid3,
337
- * that either s->bh != NULL or s->callback != NULL.)
234
.resetvalue = 0 },
338
- */
235
{ .name = "ID_AA64ISAR0_EL1", .state = ARM_CP_STATE_AA64,
339
+ /* The callback function is mandatory. */
236
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 0,
340
assert(callback);
237
.access = PL1_R, .type = ARM_CP_CONST,
341
238
+ .accessfn = access_aa64_tid3,
342
s = g_new0(ptimer_state, 1);
239
.resetvalue = cpu->isar.id_aa64isar0 },
343
@@ -XXX,XX +XXX,XX @@ ptimer_state *ptimer_init(ptimer_cb callback, void *callback_opaque,
240
{ .name = "ID_AA64ISAR1_EL1", .state = ARM_CP_STATE_AA64,
344
241
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 1,
345
void ptimer_free(ptimer_state *s)
242
.access = PL1_R, .type = ARM_CP_CONST,
346
{
243
+ .accessfn = access_aa64_tid3,
347
- if (s->bh) {
244
.resetvalue = cpu->isar.id_aa64isar1 },
348
- qemu_bh_delete(s->bh);
245
{ .name = "ID_AA64ISAR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
349
- }
246
.opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 2,
350
timer_free(s->timer);
247
.access = PL1_R, .type = ARM_CP_CONST,
351
g_free(s);
248
+ .accessfn = access_aa64_tid3,
352
}
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,
353
--
357
--
354
2.20.1
358
2.20.1
355
359
356
360
diff view generated by jsdifflib