summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPavel Fedin <p.fedin@samsung.com>2015-12-04 07:03:12 -0500
committerMarc Zyngier <marc.zyngier@arm.com>2015-12-04 11:29:47 -0500
commit3fec037d0fb292c4e5b2a7f8d132b5f9d5487ff3 (patch)
tree3158e73b958859af4406d1c47590b5332b66436a /arch
parentbc45a516fa90b43b1898758d8b53b74c24b954e4 (diff)
arm64: KVM: Remove const from struct sys_reg_params
Further rework is going to introduce a dedicated storage for transfer register value in struct sys_reg_params. Before doing this we have to remove 'const' modifiers from it in all accessor functions and their callers. Signed-off-by: Pavel Fedin <p.fedin@samsung.com> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/kvm/sys_regs.c36
-rw-r--r--arch/arm64/kvm/sys_regs.h4
-rw-r--r--arch/arm64/kvm/sys_regs_generic_v8.c2
3 files changed, 21 insertions, 21 deletions
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index 87a64e8db04c..545a72ae8b01 100644
--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -78,7 +78,7 @@ static u32 get_ccsidr(u32 csselr)
78 * See note at ARMv7 ARM B1.14.4 (TL;DR: S/W ops are not easily virtualized). 78 * See note at ARMv7 ARM B1.14.4 (TL;DR: S/W ops are not easily virtualized).
79 */ 79 */
80static bool access_dcsw(struct kvm_vcpu *vcpu, 80static bool access_dcsw(struct kvm_vcpu *vcpu,
81 const struct sys_reg_params *p, 81 struct sys_reg_params *p,
82 const struct sys_reg_desc *r) 82 const struct sys_reg_desc *r)
83{ 83{
84 if (!p->is_write) 84 if (!p->is_write)
@@ -94,7 +94,7 @@ static bool access_dcsw(struct kvm_vcpu *vcpu,
94 * sys_regs and leave it in complete control of the caches. 94 * sys_regs and leave it in complete control of the caches.
95 */ 95 */
96static bool access_vm_reg(struct kvm_vcpu *vcpu, 96static bool access_vm_reg(struct kvm_vcpu *vcpu,
97 const struct sys_reg_params *p, 97 struct sys_reg_params *p,
98 const struct sys_reg_desc *r) 98 const struct sys_reg_desc *r)
99{ 99{
100 unsigned long val; 100 unsigned long val;
@@ -122,7 +122,7 @@ static bool access_vm_reg(struct kvm_vcpu *vcpu,
122 * for both AArch64 and AArch32 accesses. 122 * for both AArch64 and AArch32 accesses.
123 */ 123 */
124static bool access_gic_sgi(struct kvm_vcpu *vcpu, 124static bool access_gic_sgi(struct kvm_vcpu *vcpu,
125 const struct sys_reg_params *p, 125 struct sys_reg_params *p,
126 const struct sys_reg_desc *r) 126 const struct sys_reg_desc *r)
127{ 127{
128 u64 val; 128 u64 val;
@@ -137,7 +137,7 @@ static bool access_gic_sgi(struct kvm_vcpu *vcpu,
137} 137}
138 138
139static bool trap_raz_wi(struct kvm_vcpu *vcpu, 139static bool trap_raz_wi(struct kvm_vcpu *vcpu,
140 const struct sys_reg_params *p, 140 struct sys_reg_params *p,
141 const struct sys_reg_desc *r) 141 const struct sys_reg_desc *r)
142{ 142{
143 if (p->is_write) 143 if (p->is_write)
@@ -147,7 +147,7 @@ static bool trap_raz_wi(struct kvm_vcpu *vcpu,
147} 147}
148 148
149static bool trap_oslsr_el1(struct kvm_vcpu *vcpu, 149static bool trap_oslsr_el1(struct kvm_vcpu *vcpu,
150 const struct sys_reg_params *p, 150 struct sys_reg_params *p,
151 const struct sys_reg_desc *r) 151 const struct sys_reg_desc *r)
152{ 152{
153 if (p->is_write) { 153 if (p->is_write) {
@@ -159,7 +159,7 @@ static bool trap_oslsr_el1(struct kvm_vcpu *vcpu,
159} 159}
160 160
161static bool trap_dbgauthstatus_el1(struct kvm_vcpu *vcpu, 161static bool trap_dbgauthstatus_el1(struct kvm_vcpu *vcpu,
162 const struct sys_reg_params *p, 162 struct sys_reg_params *p,
163 const struct sys_reg_desc *r) 163 const struct sys_reg_desc *r)
164{ 164{
165 if (p->is_write) { 165 if (p->is_write) {
@@ -200,7 +200,7 @@ static bool trap_dbgauthstatus_el1(struct kvm_vcpu *vcpu,
200 * now use the debug registers. 200 * now use the debug registers.
201 */ 201 */
202static bool trap_debug_regs(struct kvm_vcpu *vcpu, 202static bool trap_debug_regs(struct kvm_vcpu *vcpu,
203 const struct sys_reg_params *p, 203 struct sys_reg_params *p,
204 const struct sys_reg_desc *r) 204 const struct sys_reg_desc *r)
205{ 205{
206 if (p->is_write) { 206 if (p->is_write) {
@@ -225,7 +225,7 @@ static bool trap_debug_regs(struct kvm_vcpu *vcpu,
225 * hyp.S code switches between host and guest values in future. 225 * hyp.S code switches between host and guest values in future.
226 */ 226 */
227static inline void reg_to_dbg(struct kvm_vcpu *vcpu, 227static inline void reg_to_dbg(struct kvm_vcpu *vcpu,
228 const struct sys_reg_params *p, 228 struct sys_reg_params *p,
229 u64 *dbg_reg) 229 u64 *dbg_reg)
230{ 230{
231 u64 val = *vcpu_reg(vcpu, p->Rt); 231 u64 val = *vcpu_reg(vcpu, p->Rt);
@@ -240,7 +240,7 @@ static inline void reg_to_dbg(struct kvm_vcpu *vcpu,
240} 240}
241 241
242static inline void dbg_to_reg(struct kvm_vcpu *vcpu, 242static inline void dbg_to_reg(struct kvm_vcpu *vcpu,
243 const struct sys_reg_params *p, 243 struct sys_reg_params *p,
244 u64 *dbg_reg) 244 u64 *dbg_reg)
245{ 245{
246 u64 val = *dbg_reg; 246 u64 val = *dbg_reg;
@@ -252,7 +252,7 @@ static inline void dbg_to_reg(struct kvm_vcpu *vcpu,
252} 252}
253 253
254static inline bool trap_bvr(struct kvm_vcpu *vcpu, 254static inline bool trap_bvr(struct kvm_vcpu *vcpu,
255 const struct sys_reg_params *p, 255 struct sys_reg_params *p,
256 const struct sys_reg_desc *rd) 256 const struct sys_reg_desc *rd)
257{ 257{
258 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg]; 258 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg];
@@ -294,7 +294,7 @@ static inline void reset_bvr(struct kvm_vcpu *vcpu,
294} 294}
295 295
296static inline bool trap_bcr(struct kvm_vcpu *vcpu, 296static inline bool trap_bcr(struct kvm_vcpu *vcpu,
297 const struct sys_reg_params *p, 297 struct sys_reg_params *p,
298 const struct sys_reg_desc *rd) 298 const struct sys_reg_desc *rd)
299{ 299{
300 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bcr[rd->reg]; 300 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bcr[rd->reg];
@@ -337,7 +337,7 @@ static inline void reset_bcr(struct kvm_vcpu *vcpu,
337} 337}
338 338
339static inline bool trap_wvr(struct kvm_vcpu *vcpu, 339static inline bool trap_wvr(struct kvm_vcpu *vcpu,
340 const struct sys_reg_params *p, 340 struct sys_reg_params *p,
341 const struct sys_reg_desc *rd) 341 const struct sys_reg_desc *rd)
342{ 342{
343 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_wvr[rd->reg]; 343 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_wvr[rd->reg];
@@ -380,7 +380,7 @@ static inline void reset_wvr(struct kvm_vcpu *vcpu,
380} 380}
381 381
382static inline bool trap_wcr(struct kvm_vcpu *vcpu, 382static inline bool trap_wcr(struct kvm_vcpu *vcpu,
383 const struct sys_reg_params *p, 383 struct sys_reg_params *p,
384 const struct sys_reg_desc *rd) 384 const struct sys_reg_desc *rd)
385{ 385{
386 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_wcr[rd->reg]; 386 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_wcr[rd->reg];
@@ -687,7 +687,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
687}; 687};
688 688
689static bool trap_dbgidr(struct kvm_vcpu *vcpu, 689static bool trap_dbgidr(struct kvm_vcpu *vcpu,
690 const struct sys_reg_params *p, 690 struct sys_reg_params *p,
691 const struct sys_reg_desc *r) 691 const struct sys_reg_desc *r)
692{ 692{
693 if (p->is_write) { 693 if (p->is_write) {
@@ -706,7 +706,7 @@ static bool trap_dbgidr(struct kvm_vcpu *vcpu,
706} 706}
707 707
708static bool trap_debug32(struct kvm_vcpu *vcpu, 708static bool trap_debug32(struct kvm_vcpu *vcpu,
709 const struct sys_reg_params *p, 709 struct sys_reg_params *p,
710 const struct sys_reg_desc *r) 710 const struct sys_reg_desc *r)
711{ 711{
712 if (p->is_write) { 712 if (p->is_write) {
@@ -731,7 +731,7 @@ static bool trap_debug32(struct kvm_vcpu *vcpu,
731 */ 731 */
732 732
733static inline bool trap_xvr(struct kvm_vcpu *vcpu, 733static inline bool trap_xvr(struct kvm_vcpu *vcpu,
734 const struct sys_reg_params *p, 734 struct sys_reg_params *p,
735 const struct sys_reg_desc *rd) 735 const struct sys_reg_desc *rd)
736{ 736{
737 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg]; 737 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg];
@@ -991,7 +991,7 @@ int kvm_handle_cp14_load_store(struct kvm_vcpu *vcpu, struct kvm_run *run)
991 * Return 0 if the access has been handled, and -1 if not. 991 * Return 0 if the access has been handled, and -1 if not.
992 */ 992 */
993static int emulate_cp(struct kvm_vcpu *vcpu, 993static int emulate_cp(struct kvm_vcpu *vcpu,
994 const struct sys_reg_params *params, 994 struct sys_reg_params *params,
995 const struct sys_reg_desc *table, 995 const struct sys_reg_desc *table,
996 size_t num) 996 size_t num)
997{ 997{
@@ -1175,7 +1175,7 @@ int kvm_handle_cp14_32(struct kvm_vcpu *vcpu, struct kvm_run *run)
1175} 1175}
1176 1176
1177static int emulate_sys_reg(struct kvm_vcpu *vcpu, 1177static int emulate_sys_reg(struct kvm_vcpu *vcpu,
1178 const struct sys_reg_params *params) 1178 struct sys_reg_params *params)
1179{ 1179{
1180 size_t num; 1180 size_t num;
1181 const struct sys_reg_desc *table, *r; 1181 const struct sys_reg_desc *table, *r;
diff --git a/arch/arm64/kvm/sys_regs.h b/arch/arm64/kvm/sys_regs.h
index eaa324e4db4d..953abfc4b017 100644
--- a/arch/arm64/kvm/sys_regs.h
+++ b/arch/arm64/kvm/sys_regs.h
@@ -44,7 +44,7 @@ struct sys_reg_desc {
44 44
45 /* Trapped access from guest, if non-NULL. */ 45 /* Trapped access from guest, if non-NULL. */
46 bool (*access)(struct kvm_vcpu *, 46 bool (*access)(struct kvm_vcpu *,
47 const struct sys_reg_params *, 47 struct sys_reg_params *,
48 const struct sys_reg_desc *); 48 const struct sys_reg_desc *);
49 49
50 /* Initialization for vcpu. */ 50 /* Initialization for vcpu. */
@@ -77,7 +77,7 @@ static inline bool ignore_write(struct kvm_vcpu *vcpu,
77} 77}
78 78
79static inline bool read_zero(struct kvm_vcpu *vcpu, 79static inline bool read_zero(struct kvm_vcpu *vcpu,
80 const struct sys_reg_params *p) 80 struct sys_reg_params *p)
81{ 81{
82 *vcpu_reg(vcpu, p->Rt) = 0; 82 *vcpu_reg(vcpu, p->Rt) = 0;
83 return true; 83 return true;
diff --git a/arch/arm64/kvm/sys_regs_generic_v8.c b/arch/arm64/kvm/sys_regs_generic_v8.c
index 1e4576824165..ccd3e359b800 100644
--- a/arch/arm64/kvm/sys_regs_generic_v8.c
+++ b/arch/arm64/kvm/sys_regs_generic_v8.c
@@ -31,7 +31,7 @@
31#include "sys_regs.h" 31#include "sys_regs.h"
32 32
33static bool access_actlr(struct kvm_vcpu *vcpu, 33static bool access_actlr(struct kvm_vcpu *vcpu,
34 const struct sys_reg_params *p, 34 struct sys_reg_params *p,
35 const struct sys_reg_desc *r) 35 const struct sys_reg_desc *r)
36{ 36{
37 if (p->is_write) 37 if (p->is_write)