Skip to content

Commit 3fec037

Browse files
pfedinMarc Zyngier
authored andcommitted
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>
1 parent bc45a51 commit 3fec037

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

arch/arm64/kvm/sys_regs.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static u32 get_ccsidr(u32 csselr)
7878
* See note at ARMv7 ARM B1.14.4 (TL;DR: S/W ops are not easily virtualized).
7979
*/
8080
static bool access_dcsw(struct kvm_vcpu *vcpu,
81-
const struct sys_reg_params *p,
81+
struct sys_reg_params *p,
8282
const struct sys_reg_desc *r)
8383
{
8484
if (!p->is_write)
@@ -94,7 +94,7 @@ static bool access_dcsw(struct kvm_vcpu *vcpu,
9494
* sys_regs and leave it in complete control of the caches.
9595
*/
9696
static bool access_vm_reg(struct kvm_vcpu *vcpu,
97-
const struct sys_reg_params *p,
97+
struct sys_reg_params *p,
9898
const struct sys_reg_desc *r)
9999
{
100100
unsigned long val;
@@ -122,7 +122,7 @@ static bool access_vm_reg(struct kvm_vcpu *vcpu,
122122
* for both AArch64 and AArch32 accesses.
123123
*/
124124
static bool access_gic_sgi(struct kvm_vcpu *vcpu,
125-
const struct sys_reg_params *p,
125+
struct sys_reg_params *p,
126126
const struct sys_reg_desc *r)
127127
{
128128
u64 val;
@@ -137,7 +137,7 @@ static bool access_gic_sgi(struct kvm_vcpu *vcpu,
137137
}
138138

139139
static bool trap_raz_wi(struct kvm_vcpu *vcpu,
140-
const struct sys_reg_params *p,
140+
struct sys_reg_params *p,
141141
const struct sys_reg_desc *r)
142142
{
143143
if (p->is_write)
@@ -147,7 +147,7 @@ static bool trap_raz_wi(struct kvm_vcpu *vcpu,
147147
}
148148

149149
static bool trap_oslsr_el1(struct kvm_vcpu *vcpu,
150-
const struct sys_reg_params *p,
150+
struct sys_reg_params *p,
151151
const struct sys_reg_desc *r)
152152
{
153153
if (p->is_write) {
@@ -159,7 +159,7 @@ static bool trap_oslsr_el1(struct kvm_vcpu *vcpu,
159159
}
160160

161161
static bool trap_dbgauthstatus_el1(struct kvm_vcpu *vcpu,
162-
const struct sys_reg_params *p,
162+
struct sys_reg_params *p,
163163
const struct sys_reg_desc *r)
164164
{
165165
if (p->is_write) {
@@ -200,7 +200,7 @@ static bool trap_dbgauthstatus_el1(struct kvm_vcpu *vcpu,
200200
* now use the debug registers.
201201
*/
202202
static bool trap_debug_regs(struct kvm_vcpu *vcpu,
203-
const struct sys_reg_params *p,
203+
struct sys_reg_params *p,
204204
const struct sys_reg_desc *r)
205205
{
206206
if (p->is_write) {
@@ -225,7 +225,7 @@ static bool trap_debug_regs(struct kvm_vcpu *vcpu,
225225
* hyp.S code switches between host and guest values in future.
226226
*/
227227
static inline void reg_to_dbg(struct kvm_vcpu *vcpu,
228-
const struct sys_reg_params *p,
228+
struct sys_reg_params *p,
229229
u64 *dbg_reg)
230230
{
231231
u64 val = *vcpu_reg(vcpu, p->Rt);
@@ -240,7 +240,7 @@ static inline void reg_to_dbg(struct kvm_vcpu *vcpu,
240240
}
241241

242242
static inline void dbg_to_reg(struct kvm_vcpu *vcpu,
243-
const struct sys_reg_params *p,
243+
struct sys_reg_params *p,
244244
u64 *dbg_reg)
245245
{
246246
u64 val = *dbg_reg;
@@ -252,7 +252,7 @@ static inline void dbg_to_reg(struct kvm_vcpu *vcpu,
252252
}
253253

254254
static inline bool trap_bvr(struct kvm_vcpu *vcpu,
255-
const struct sys_reg_params *p,
255+
struct sys_reg_params *p,
256256
const struct sys_reg_desc *rd)
257257
{
258258
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,
294294
}
295295

296296
static inline bool trap_bcr(struct kvm_vcpu *vcpu,
297-
const struct sys_reg_params *p,
297+
struct sys_reg_params *p,
298298
const struct sys_reg_desc *rd)
299299
{
300300
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,
337337
}
338338

339339
static inline bool trap_wvr(struct kvm_vcpu *vcpu,
340-
const struct sys_reg_params *p,
340+
struct sys_reg_params *p,
341341
const struct sys_reg_desc *rd)
342342
{
343343
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,
380380
}
381381

382382
static inline bool trap_wcr(struct kvm_vcpu *vcpu,
383-
const struct sys_reg_params *p,
383+
struct sys_reg_params *p,
384384
const struct sys_reg_desc *rd)
385385
{
386386
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[] = {
687687
};
688688

689689
static bool trap_dbgidr(struct kvm_vcpu *vcpu,
690-
const struct sys_reg_params *p,
690+
struct sys_reg_params *p,
691691
const struct sys_reg_desc *r)
692692
{
693693
if (p->is_write) {
@@ -706,7 +706,7 @@ static bool trap_dbgidr(struct kvm_vcpu *vcpu,
706706
}
707707

708708
static bool trap_debug32(struct kvm_vcpu *vcpu,
709-
const struct sys_reg_params *p,
709+
struct sys_reg_params *p,
710710
const struct sys_reg_desc *r)
711711
{
712712
if (p->is_write) {
@@ -731,7 +731,7 @@ static bool trap_debug32(struct kvm_vcpu *vcpu,
731731
*/
732732

733733
static inline bool trap_xvr(struct kvm_vcpu *vcpu,
734-
const struct sys_reg_params *p,
734+
struct sys_reg_params *p,
735735
const struct sys_reg_desc *rd)
736736
{
737737
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)
991991
* Return 0 if the access has been handled, and -1 if not.
992992
*/
993993
static int emulate_cp(struct kvm_vcpu *vcpu,
994-
const struct sys_reg_params *params,
994+
struct sys_reg_params *params,
995995
const struct sys_reg_desc *table,
996996
size_t num)
997997
{
@@ -1175,7 +1175,7 @@ int kvm_handle_cp14_32(struct kvm_vcpu *vcpu, struct kvm_run *run)
11751175
}
11761176

11771177
static int emulate_sys_reg(struct kvm_vcpu *vcpu,
1178-
const struct sys_reg_params *params)
1178+
struct sys_reg_params *params)
11791179
{
11801180
size_t num;
11811181
const struct sys_reg_desc *table, *r;

arch/arm64/kvm/sys_regs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct sys_reg_desc {
4444

4545
/* Trapped access from guest, if non-NULL. */
4646
bool (*access)(struct kvm_vcpu *,
47-
const struct sys_reg_params *,
47+
struct sys_reg_params *,
4848
const struct sys_reg_desc *);
4949

5050
/* Initialization for vcpu. */
@@ -77,7 +77,7 @@ static inline bool ignore_write(struct kvm_vcpu *vcpu,
7777
}
7878

7979
static inline bool read_zero(struct kvm_vcpu *vcpu,
80-
const struct sys_reg_params *p)
80+
struct sys_reg_params *p)
8181
{
8282
*vcpu_reg(vcpu, p->Rt) = 0;
8383
return true;

arch/arm64/kvm/sys_regs_generic_v8.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "sys_regs.h"
3232

3333
static bool access_actlr(struct kvm_vcpu *vcpu,
34-
const struct sys_reg_params *p,
34+
struct sys_reg_params *p,
3535
const struct sys_reg_desc *r)
3636
{
3737
if (p->is_write)

0 commit comments

Comments
 (0)