1 | Couple of minor patches to sneak in before rc0. The PSCI return | 1 | v2: dropped a couple of cadence_gem changes to ID regs that |
---|---|---|---|
2 | values fix is the most important one. | 2 | caused new clang sanitizer warnings. |
3 | 3 | ||
4 | -- PMM | 4 | -- PMM |
5 | 5 | ||
6 | The following changes since commit 94b5d57d2f5a3c849cecd65e424bb6f50b998df9: | 6 | The following changes since commit dddb37495b844270088e68e3bf30b764d48d863f: |
7 | 7 | ||
8 | Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.9-20170314' into staging (2017-03-14 10:13:19 +0000) | 8 | Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20181015.0' into staging (2018-10-15 18:44:04 +0100) |
9 | 9 | ||
10 | are available in the git repository at: | 10 | are available in the Git repository at: |
11 | 11 | ||
12 | git://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20170314 | 12 | https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20181016-1 |
13 | 13 | ||
14 | for you to fetch changes up to d5affb0d8677e1a8a8fe03fa25005b669e7cdc02: | 14 | for you to fetch changes up to 2ef297af07196c29446556537861f8e7dfeeae7b: |
15 | 15 | ||
16 | target/arm/arm-powerctl: Fix psci info return values (2017-03-14 11:28:54 +0000) | 16 | coccinelle: new inplace-byteswaps.cocci to remove inplace-byteswapping calls (2018-10-16 17:14:55 +0100) |
17 | 17 | ||
18 | ---------------------------------------------------------------- | 18 | ---------------------------------------------------------------- |
19 | target-arm queue: | 19 | target-arm queue: |
20 | * arm-powerctl: Fix psci info return values | 20 | * hw/arm/virt: add DT property /secure-chosen/stdout-path indicating secure UART |
21 | * implement armv8 PMUSERENR (user-mode enable bits) | 21 | * target/arm: Fix aarch64_sve_change_el wrt EL0 |
22 | * target/arm: Define fields of ISAR registers | ||
23 | * target/arm: Align cortex-r5 id_isar0 | ||
24 | * target/arm: Fix cortex-a7 id_isar0 | ||
25 | * net/cadence_gem: Fix various bugs, add support for new | ||
26 | features that will be used by the Xilinx Versal board | ||
27 | * target-arm: powerctl: Enable HVC when starting CPUs to EL2 | ||
28 | * target/arm: Add the Cortex-A72 | ||
29 | * target/arm: Mark PMINTENCLR and PMINTENCLR_EL1 accesses as possibly doing IO | ||
30 | * target/arm: Mask PMOVSR writes based on supported counters | ||
31 | * target/arm: Initialize ARMMMUFaultInfo in v7m_stack_read/write | ||
32 | * coccinelle: new inplace-byteswaps.cocci to remove inplace-byteswapping calls | ||
22 | 33 | ||
23 | ---------------------------------------------------------------- | 34 | ---------------------------------------------------------------- |
24 | Andrew Baumann (1): | 35 | Aaron Lindsay (2): |
25 | target/arm: implement armv8 PMUSERENR (user-mode enable bits) | 36 | target/arm: Mark PMINTENCLR and PMINTENCLR_EL1 accesses as possibly doing IO |
37 | target/arm: Mask PMOVSR writes based on supported counters | ||
26 | 38 | ||
27 | Andrew Jones (1): | 39 | Edgar E. Iglesias (8): |
28 | target/arm/arm-powerctl: Fix psci info return values | 40 | net: cadence_gem: Disable TSU feature bit |
41 | net: cadence_gem: Use uint32_t for 32bit descriptor words | ||
42 | net: cadence_gem: Add macro with max number of descriptor words | ||
43 | net: cadence_gem: Add support for extended descriptors | ||
44 | net: cadence_gem: Add support for selecting the DMA MemoryRegion | ||
45 | net: cadence_gem: Implement support for 64bit descriptor addresses | ||
46 | target-arm: powerctl: Enable HVC when starting CPUs to EL2 | ||
47 | target/arm: Add the Cortex-A72 | ||
29 | 48 | ||
30 | target/arm/cpu.h | 4 +-- | 49 | Jerome Forissier (1): |
31 | target/arm/helper.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++------ | 50 | hw/arm/virt: add DT property /secure-chosen/stdout-path indicating secure UART |
32 | 2 files changed, 73 insertions(+), 10 deletions(-) | ||
33 | 51 | ||
52 | Peter Maydell (2): | ||
53 | target/arm: Initialize ARMMMUFaultInfo in v7m_stack_read/write | ||
54 | coccinelle: new inplace-byteswaps.cocci to remove inplace-byteswapping calls | ||
55 | |||
56 | Richard Henderson (4): | ||
57 | target/arm: Fix aarch64_sve_change_el wrt EL0 | ||
58 | target/arm: Define fields of ISAR registers | ||
59 | target/arm: Align cortex-r5 id_isar0 | ||
60 | target/arm: Fix cortex-a7 id_isar0 | ||
61 | |||
62 | include/hw/net/cadence_gem.h | 7 +- | ||
63 | target/arm/cpu.h | 95 ++++++++++++++- | ||
64 | hw/arm/virt.c | 4 + | ||
65 | hw/net/cadence_gem.c | 185 ++++++++++++++++++++--------- | ||
66 | target/arm/arm-powerctl.c | 10 ++ | ||
67 | target/arm/cpu.c | 7 +- | ||
68 | target/arm/cpu64.c | 66 +++++++++- | ||
69 | target/arm/helper.c | 27 +++-- | ||
70 | target/arm/op_helper.c | 6 +- | ||
71 | scripts/coccinelle/inplace-byteswaps.cocci | 65 ++++++++++ | ||
72 | 10 files changed, 402 insertions(+), 70 deletions(-) | ||
73 | create mode 100644 scripts/coccinelle/inplace-byteswaps.cocci | ||
74 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Andrew Baumann <Andrew.Baumann@microsoft.com> | ||
2 | 1 | ||
3 | In armv8, this register implements more than a single bit, with | ||
4 | fine-grained enables for read access to event counters, cycles | ||
5 | counters, and write access to the software increment. This change | ||
6 | implements those checks using custom access functions for the relevant | ||
7 | registers. | ||
8 | |||
9 | Signed-off-by: Andrew Baumann <Andrew.Baumann@microsoft.com> | ||
10 | Message-id: 20170228215801.10472-2-Andrew.Baumann@microsoft.com | ||
11 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
12 | [PMM: move a couple of access functions to be only compiled | ||
13 | ifndef CONFIG_USER_ONLY to avoid compiler warnings] | ||
14 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
15 | --- | ||
16 | target/arm/helper.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++------ | ||
17 | 1 file changed, 71 insertions(+), 8 deletions(-) | ||
18 | |||
19 | diff --git a/target/arm/helper.c b/target/arm/helper.c | ||
20 | index XXXXXXX..XXXXXXX 100644 | ||
21 | --- a/target/arm/helper.c | ||
22 | +++ b/target/arm/helper.c | ||
23 | @@ -XXX,XX +XXX,XX @@ static CPAccessResult pmreg_access(CPUARMState *env, const ARMCPRegInfo *ri, | ||
24 | */ | ||
25 | int el = arm_current_el(env); | ||
26 | |||
27 | - if (el == 0 && !env->cp15.c9_pmuserenr) { | ||
28 | + if (el == 0 && !(env->cp15.c9_pmuserenr & 1)) { | ||
29 | return CP_ACCESS_TRAP; | ||
30 | } | ||
31 | if (el < 2 && (env->cp15.mdcr_el2 & MDCR_TPM) | ||
32 | @@ -XXX,XX +XXX,XX @@ static CPAccessResult pmreg_access(CPUARMState *env, const ARMCPRegInfo *ri, | ||
33 | return CP_ACCESS_OK; | ||
34 | } | ||
35 | |||
36 | +static CPAccessResult pmreg_access_xevcntr(CPUARMState *env, | ||
37 | + const ARMCPRegInfo *ri, | ||
38 | + bool isread) | ||
39 | +{ | ||
40 | + /* ER: event counter read trap control */ | ||
41 | + if (arm_feature(env, ARM_FEATURE_V8) | ||
42 | + && arm_current_el(env) == 0 | ||
43 | + && (env->cp15.c9_pmuserenr & (1 << 3)) != 0 | ||
44 | + && isread) { | ||
45 | + return CP_ACCESS_OK; | ||
46 | + } | ||
47 | + | ||
48 | + return pmreg_access(env, ri, isread); | ||
49 | +} | ||
50 | + | ||
51 | +static CPAccessResult pmreg_access_swinc(CPUARMState *env, | ||
52 | + const ARMCPRegInfo *ri, | ||
53 | + bool isread) | ||
54 | +{ | ||
55 | + /* SW: software increment write trap control */ | ||
56 | + if (arm_feature(env, ARM_FEATURE_V8) | ||
57 | + && arm_current_el(env) == 0 | ||
58 | + && (env->cp15.c9_pmuserenr & (1 << 1)) != 0 | ||
59 | + && !isread) { | ||
60 | + return CP_ACCESS_OK; | ||
61 | + } | ||
62 | + | ||
63 | + return pmreg_access(env, ri, isread); | ||
64 | +} | ||
65 | + | ||
66 | #ifndef CONFIG_USER_ONLY | ||
67 | |||
68 | +static CPAccessResult pmreg_access_selr(CPUARMState *env, | ||
69 | + const ARMCPRegInfo *ri, | ||
70 | + bool isread) | ||
71 | +{ | ||
72 | + /* ER: event counter read trap control */ | ||
73 | + if (arm_feature(env, ARM_FEATURE_V8) | ||
74 | + && arm_current_el(env) == 0 | ||
75 | + && (env->cp15.c9_pmuserenr & (1 << 3)) != 0) { | ||
76 | + return CP_ACCESS_OK; | ||
77 | + } | ||
78 | + | ||
79 | + return pmreg_access(env, ri, isread); | ||
80 | +} | ||
81 | + | ||
82 | +static CPAccessResult pmreg_access_ccntr(CPUARMState *env, | ||
83 | + const ARMCPRegInfo *ri, | ||
84 | + bool isread) | ||
85 | +{ | ||
86 | + /* CR: cycle counter read trap control */ | ||
87 | + if (arm_feature(env, ARM_FEATURE_V8) | ||
88 | + && arm_current_el(env) == 0 | ||
89 | + && (env->cp15.c9_pmuserenr & (1 << 2)) != 0 | ||
90 | + && isread) { | ||
91 | + return CP_ACCESS_OK; | ||
92 | + } | ||
93 | + | ||
94 | + return pmreg_access(env, ri, isread); | ||
95 | +} | ||
96 | + | ||
97 | static inline bool arm_ccnt_enabled(CPUARMState *env) | ||
98 | { | ||
99 | /* This does not support checking PMCCFILTR_EL0 register */ | ||
100 | @@ -XXX,XX +XXX,XX @@ static uint64_t pmxevtyper_read(CPUARMState *env, const ARMCPRegInfo *ri) | ||
101 | static void pmuserenr_write(CPUARMState *env, const ARMCPRegInfo *ri, | ||
102 | uint64_t value) | ||
103 | { | ||
104 | - env->cp15.c9_pmuserenr = value & 1; | ||
105 | + if (arm_feature(env, ARM_FEATURE_V8)) { | ||
106 | + env->cp15.c9_pmuserenr = value & 0xf; | ||
107 | + } else { | ||
108 | + env->cp15.c9_pmuserenr = value & 1; | ||
109 | + } | ||
110 | } | ||
111 | |||
112 | static void pmintenset_write(CPUARMState *env, const ARMCPRegInfo *ri, | ||
113 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo v7_cp_reginfo[] = { | ||
114 | .raw_writefn = raw_write }, | ||
115 | /* Unimplemented so WI. */ | ||
116 | { .name = "PMSWINC", .cp = 15, .crn = 9, .crm = 12, .opc1 = 0, .opc2 = 4, | ||
117 | - .access = PL0_W, .accessfn = pmreg_access, .type = ARM_CP_NOP }, | ||
118 | + .access = PL0_W, .accessfn = pmreg_access_swinc, .type = ARM_CP_NOP }, | ||
119 | #ifndef CONFIG_USER_ONLY | ||
120 | { .name = "PMSELR", .cp = 15, .crn = 9, .crm = 12, .opc1 = 0, .opc2 = 5, | ||
121 | .access = PL0_RW, .type = ARM_CP_ALIAS, | ||
122 | .fieldoffset = offsetoflow32(CPUARMState, cp15.c9_pmselr), | ||
123 | - .accessfn = pmreg_access, .writefn = pmselr_write, | ||
124 | + .accessfn = pmreg_access_selr, .writefn = pmselr_write, | ||
125 | .raw_writefn = raw_write}, | ||
126 | { .name = "PMSELR_EL0", .state = ARM_CP_STATE_AA64, | ||
127 | .opc0 = 3, .opc1 = 3, .crn = 9, .crm = 12, .opc2 = 5, | ||
128 | - .access = PL0_RW, .accessfn = pmreg_access, | ||
129 | + .access = PL0_RW, .accessfn = pmreg_access_selr, | ||
130 | .fieldoffset = offsetof(CPUARMState, cp15.c9_pmselr), | ||
131 | .writefn = pmselr_write, .raw_writefn = raw_write, }, | ||
132 | { .name = "PMCCNTR", .cp = 15, .crn = 9, .crm = 13, .opc1 = 0, .opc2 = 0, | ||
133 | .access = PL0_RW, .resetvalue = 0, .type = ARM_CP_IO, | ||
134 | .readfn = pmccntr_read, .writefn = pmccntr_write32, | ||
135 | - .accessfn = pmreg_access }, | ||
136 | + .accessfn = pmreg_access_ccntr }, | ||
137 | { .name = "PMCCNTR_EL0", .state = ARM_CP_STATE_AA64, | ||
138 | .opc0 = 3, .opc1 = 3, .crn = 9, .crm = 13, .opc2 = 0, | ||
139 | - .access = PL0_RW, .accessfn = pmreg_access, | ||
140 | + .access = PL0_RW, .accessfn = pmreg_access_ccntr, | ||
141 | .type = ARM_CP_IO, | ||
142 | .readfn = pmccntr_read, .writefn = pmccntr_write, }, | ||
143 | #endif | ||
144 | @@ -XXX,XX +XXX,XX @@ static const ARMCPRegInfo v7_cp_reginfo[] = { | ||
145 | /* Unimplemented, RAZ/WI. */ | ||
146 | { .name = "PMXEVCNTR", .cp = 15, .crn = 9, .crm = 13, .opc1 = 0, .opc2 = 2, | ||
147 | .access = PL0_RW, .type = ARM_CP_CONST, .resetvalue = 0, | ||
148 | - .accessfn = pmreg_access }, | ||
149 | + .accessfn = pmreg_access_xevcntr }, | ||
150 | { .name = "PMUSERENR", .cp = 15, .crn = 9, .crm = 14, .opc1 = 0, .opc2 = 0, | ||
151 | .access = PL0_R | PL1_RW, .accessfn = access_tpm, | ||
152 | .fieldoffset = offsetof(CPUARMState, cp15.c9_pmuserenr), | ||
153 | -- | ||
154 | 2.7.4 | ||
155 | |||
156 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Andrew Jones <drjones@redhat.com> | ||
2 | 1 | ||
3 | The power state spec section 5.1.5 AFFINITY_INFO defines the | ||
4 | affinity info return values as | ||
5 | |||
6 | 0 ON | ||
7 | 1 OFF | ||
8 | 2 ON_PENDING | ||
9 | |||
10 | I grepped QEMU for power_state to ensure that no assumptions | ||
11 | of OFF=0 were being made. | ||
12 | |||
13 | Signed-off-by: Andrew Jones <drjones@redhat.com> | ||
14 | Message-id: 20170303123232.4967-1-drjones@redhat.com | ||
15 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
16 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
17 | --- | ||
18 | target/arm/cpu.h | 4 ++-- | ||
19 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
20 | |||
21 | diff --git a/target/arm/cpu.h b/target/arm/cpu.h | ||
22 | index XXXXXXX..XXXXXXX 100644 | ||
23 | --- a/target/arm/cpu.h | ||
24 | +++ b/target/arm/cpu.h | ||
25 | @@ -XXX,XX +XXX,XX @@ typedef void ARMELChangeHook(ARMCPU *cpu, void *opaque); | ||
26 | /* These values map onto the return values for | ||
27 | * QEMU_PSCI_0_2_FN_AFFINITY_INFO */ | ||
28 | typedef enum ARMPSCIState { | ||
29 | - PSCI_OFF = 0, | ||
30 | - PSCI_ON = 1, | ||
31 | + PSCI_ON = 0, | ||
32 | + PSCI_OFF = 1, | ||
33 | PSCI_ON_PENDING = 2 | ||
34 | } ARMPSCIState; | ||
35 | |||
36 | -- | ||
37 | 2.7.4 | ||
38 | |||
39 | diff view generated by jsdifflib |