Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Pavel Fedin and committed by
Marc Zyngier
3fec037d bc45a516

+21 -21
+18 -18
arch/arm64/kvm/sys_regs.c
··· 78 78 * See note at ARMv7 ARM B1.14.4 (TL;DR: S/W ops are not easily virtualized). 79 79 */ 80 80 static bool access_dcsw(struct kvm_vcpu *vcpu, 81 - const struct sys_reg_params *p, 81 + struct sys_reg_params *p, 82 82 const struct sys_reg_desc *r) 83 83 { 84 84 if (!p->is_write) ··· 94 94 * sys_regs and leave it in complete control of the caches. 95 95 */ 96 96 static bool access_vm_reg(struct kvm_vcpu *vcpu, 97 - const struct sys_reg_params *p, 97 + struct sys_reg_params *p, 98 98 const struct sys_reg_desc *r) 99 99 { 100 100 unsigned long val; ··· 122 122 * for both AArch64 and AArch32 accesses. 123 123 */ 124 124 static bool access_gic_sgi(struct kvm_vcpu *vcpu, 125 - const struct sys_reg_params *p, 125 + struct sys_reg_params *p, 126 126 const struct sys_reg_desc *r) 127 127 { 128 128 u64 val; ··· 137 137 } 138 138 139 139 static bool trap_raz_wi(struct kvm_vcpu *vcpu, 140 - const struct sys_reg_params *p, 140 + struct sys_reg_params *p, 141 141 const struct sys_reg_desc *r) 142 142 { 143 143 if (p->is_write) ··· 147 147 } 148 148 149 149 static bool trap_oslsr_el1(struct kvm_vcpu *vcpu, 150 - const struct sys_reg_params *p, 150 + struct sys_reg_params *p, 151 151 const struct sys_reg_desc *r) 152 152 { 153 153 if (p->is_write) { ··· 159 159 } 160 160 161 161 static bool trap_dbgauthstatus_el1(struct kvm_vcpu *vcpu, 162 - const struct sys_reg_params *p, 162 + struct sys_reg_params *p, 163 163 const struct sys_reg_desc *r) 164 164 { 165 165 if (p->is_write) { ··· 200 200 * now use the debug registers. 201 201 */ 202 202 static bool trap_debug_regs(struct kvm_vcpu *vcpu, 203 - const struct sys_reg_params *p, 203 + struct sys_reg_params *p, 204 204 const struct sys_reg_desc *r) 205 205 { 206 206 if (p->is_write) { ··· 225 225 * hyp.S code switches between host and guest values in future. 226 226 */ 227 227 static inline void reg_to_dbg(struct kvm_vcpu *vcpu, 228 - const struct sys_reg_params *p, 228 + struct sys_reg_params *p, 229 229 u64 *dbg_reg) 230 230 { 231 231 u64 val = *vcpu_reg(vcpu, p->Rt); ··· 240 240 } 241 241 242 242 static inline void dbg_to_reg(struct kvm_vcpu *vcpu, 243 - const struct sys_reg_params *p, 243 + struct sys_reg_params *p, 244 244 u64 *dbg_reg) 245 245 { 246 246 u64 val = *dbg_reg; ··· 252 252 } 253 253 254 254 static inline bool trap_bvr(struct kvm_vcpu *vcpu, 255 - const struct sys_reg_params *p, 255 + struct sys_reg_params *p, 256 256 const struct sys_reg_desc *rd) 257 257 { 258 258 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg]; ··· 294 294 } 295 295 296 296 static inline bool trap_bcr(struct kvm_vcpu *vcpu, 297 - const struct sys_reg_params *p, 297 + struct sys_reg_params *p, 298 298 const struct sys_reg_desc *rd) 299 299 { 300 300 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bcr[rd->reg]; ··· 337 337 } 338 338 339 339 static inline bool trap_wvr(struct kvm_vcpu *vcpu, 340 - const struct sys_reg_params *p, 340 + struct sys_reg_params *p, 341 341 const struct sys_reg_desc *rd) 342 342 { 343 343 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_wvr[rd->reg]; ··· 380 380 } 381 381 382 382 static inline bool trap_wcr(struct kvm_vcpu *vcpu, 383 - const struct sys_reg_params *p, 383 + struct sys_reg_params *p, 384 384 const struct sys_reg_desc *rd) 385 385 { 386 386 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_wcr[rd->reg]; ··· 687 687 }; 688 688 689 689 static bool trap_dbgidr(struct kvm_vcpu *vcpu, 690 - const struct sys_reg_params *p, 690 + struct sys_reg_params *p, 691 691 const struct sys_reg_desc *r) 692 692 { 693 693 if (p->is_write) { ··· 706 706 } 707 707 708 708 static bool trap_debug32(struct kvm_vcpu *vcpu, 709 - const struct sys_reg_params *p, 709 + struct sys_reg_params *p, 710 710 const struct sys_reg_desc *r) 711 711 { 712 712 if (p->is_write) { ··· 731 731 */ 732 732 733 733 static inline bool trap_xvr(struct kvm_vcpu *vcpu, 734 - const struct sys_reg_params *p, 734 + struct sys_reg_params *p, 735 735 const struct sys_reg_desc *rd) 736 736 { 737 737 u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg]; ··· 991 991 * Return 0 if the access has been handled, and -1 if not. 992 992 */ 993 993 static int emulate_cp(struct kvm_vcpu *vcpu, 994 - const struct sys_reg_params *params, 994 + struct sys_reg_params *params, 995 995 const struct sys_reg_desc *table, 996 996 size_t num) 997 997 { ··· 1175 1175 } 1176 1176 1177 1177 static int emulate_sys_reg(struct kvm_vcpu *vcpu, 1178 - const struct sys_reg_params *params) 1178 + struct sys_reg_params *params) 1179 1179 { 1180 1180 size_t num; 1181 1181 const struct sys_reg_desc *table, *r;
+2 -2
arch/arm64/kvm/sys_regs.h
··· 44 44 45 45 /* Trapped access from guest, if non-NULL. */ 46 46 bool (*access)(struct kvm_vcpu *, 47 - const struct sys_reg_params *, 47 + struct sys_reg_params *, 48 48 const struct sys_reg_desc *); 49 49 50 50 /* Initialization for vcpu. */ ··· 77 77 } 78 78 79 79 static inline bool read_zero(struct kvm_vcpu *vcpu, 80 - const struct sys_reg_params *p) 80 + struct sys_reg_params *p) 81 81 { 82 82 *vcpu_reg(vcpu, p->Rt) = 0; 83 83 return true;
+1 -1
arch/arm64/kvm/sys_regs_generic_v8.c
··· 31 31 #include "sys_regs.h" 32 32 33 33 static bool access_actlr(struct kvm_vcpu *vcpu, 34 - const struct sys_reg_params *p, 34 + struct sys_reg_params *p, 35 35 const struct sys_reg_desc *r) 36 36 { 37 37 if (p->is_write)