提交 3fec037d 编写于 作者: P Pavel Fedin 提交者: Marc Zyngier

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: NPavel Fedin <p.fedin@samsung.com>
Reviewed-by: NMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
上级 bc45a516
...@@ -78,7 +78,7 @@ static u32 get_ccsidr(u32 csselr) ...@@ -78,7 +78,7 @@ static u32 get_ccsidr(u32 csselr)
* See note at ARMv7 ARM B1.14.4 (TL;DR: S/W ops are not easily virtualized). * See note at ARMv7 ARM B1.14.4 (TL;DR: S/W ops are not easily virtualized).
*/ */
static bool access_dcsw(struct kvm_vcpu *vcpu, static bool access_dcsw(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *r) const struct sys_reg_desc *r)
{ {
if (!p->is_write) if (!p->is_write)
...@@ -94,7 +94,7 @@ static bool access_dcsw(struct kvm_vcpu *vcpu, ...@@ -94,7 +94,7 @@ static bool access_dcsw(struct kvm_vcpu *vcpu,
* sys_regs and leave it in complete control of the caches. * sys_regs and leave it in complete control of the caches.
*/ */
static bool access_vm_reg(struct kvm_vcpu *vcpu, static bool access_vm_reg(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *r) const struct sys_reg_desc *r)
{ {
unsigned long val; unsigned long val;
...@@ -122,7 +122,7 @@ static bool access_vm_reg(struct kvm_vcpu *vcpu, ...@@ -122,7 +122,7 @@ static bool access_vm_reg(struct kvm_vcpu *vcpu,
* for both AArch64 and AArch32 accesses. * for both AArch64 and AArch32 accesses.
*/ */
static bool access_gic_sgi(struct kvm_vcpu *vcpu, static bool access_gic_sgi(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *r) const struct sys_reg_desc *r)
{ {
u64 val; u64 val;
...@@ -137,7 +137,7 @@ static bool access_gic_sgi(struct kvm_vcpu *vcpu, ...@@ -137,7 +137,7 @@ static bool access_gic_sgi(struct kvm_vcpu *vcpu,
} }
static bool trap_raz_wi(struct kvm_vcpu *vcpu, static bool trap_raz_wi(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *r) const struct sys_reg_desc *r)
{ {
if (p->is_write) if (p->is_write)
...@@ -147,7 +147,7 @@ static bool trap_raz_wi(struct kvm_vcpu *vcpu, ...@@ -147,7 +147,7 @@ static bool trap_raz_wi(struct kvm_vcpu *vcpu,
} }
static bool trap_oslsr_el1(struct kvm_vcpu *vcpu, static bool trap_oslsr_el1(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *r) const struct sys_reg_desc *r)
{ {
if (p->is_write) { if (p->is_write) {
...@@ -159,7 +159,7 @@ static bool trap_oslsr_el1(struct kvm_vcpu *vcpu, ...@@ -159,7 +159,7 @@ static bool trap_oslsr_el1(struct kvm_vcpu *vcpu,
} }
static bool trap_dbgauthstatus_el1(struct kvm_vcpu *vcpu, static bool trap_dbgauthstatus_el1(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *r) const struct sys_reg_desc *r)
{ {
if (p->is_write) { if (p->is_write) {
...@@ -200,7 +200,7 @@ static bool trap_dbgauthstatus_el1(struct kvm_vcpu *vcpu, ...@@ -200,7 +200,7 @@ static bool trap_dbgauthstatus_el1(struct kvm_vcpu *vcpu,
* now use the debug registers. * now use the debug registers.
*/ */
static bool trap_debug_regs(struct kvm_vcpu *vcpu, static bool trap_debug_regs(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *r) const struct sys_reg_desc *r)
{ {
if (p->is_write) { if (p->is_write) {
...@@ -225,7 +225,7 @@ static bool trap_debug_regs(struct kvm_vcpu *vcpu, ...@@ -225,7 +225,7 @@ static bool trap_debug_regs(struct kvm_vcpu *vcpu,
* hyp.S code switches between host and guest values in future. * hyp.S code switches between host and guest values in future.
*/ */
static inline void reg_to_dbg(struct kvm_vcpu *vcpu, static inline void reg_to_dbg(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
u64 *dbg_reg) u64 *dbg_reg)
{ {
u64 val = *vcpu_reg(vcpu, p->Rt); u64 val = *vcpu_reg(vcpu, p->Rt);
...@@ -240,7 +240,7 @@ static inline void reg_to_dbg(struct kvm_vcpu *vcpu, ...@@ -240,7 +240,7 @@ static inline void reg_to_dbg(struct kvm_vcpu *vcpu,
} }
static inline void dbg_to_reg(struct kvm_vcpu *vcpu, static inline void dbg_to_reg(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
u64 *dbg_reg) u64 *dbg_reg)
{ {
u64 val = *dbg_reg; u64 val = *dbg_reg;
...@@ -252,7 +252,7 @@ static inline void dbg_to_reg(struct kvm_vcpu *vcpu, ...@@ -252,7 +252,7 @@ static inline void dbg_to_reg(struct kvm_vcpu *vcpu,
} }
static inline bool trap_bvr(struct kvm_vcpu *vcpu, static inline bool trap_bvr(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *rd) const struct sys_reg_desc *rd)
{ {
u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg]; 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,7 +294,7 @@ static inline void reset_bvr(struct kvm_vcpu *vcpu,
} }
static inline bool trap_bcr(struct kvm_vcpu *vcpu, static inline bool trap_bcr(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *rd) const struct sys_reg_desc *rd)
{ {
u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bcr[rd->reg]; 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,7 +337,7 @@ static inline void reset_bcr(struct kvm_vcpu *vcpu,
} }
static inline bool trap_wvr(struct kvm_vcpu *vcpu, static inline bool trap_wvr(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *rd) const struct sys_reg_desc *rd)
{ {
u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_wvr[rd->reg]; 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,7 +380,7 @@ static inline void reset_wvr(struct kvm_vcpu *vcpu,
} }
static inline bool trap_wcr(struct kvm_vcpu *vcpu, static inline bool trap_wcr(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *rd) const struct sys_reg_desc *rd)
{ {
u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_wcr[rd->reg]; 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,7 +687,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
}; };
static bool trap_dbgidr(struct kvm_vcpu *vcpu, static bool trap_dbgidr(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *r) const struct sys_reg_desc *r)
{ {
if (p->is_write) { if (p->is_write) {
...@@ -706,7 +706,7 @@ static bool trap_dbgidr(struct kvm_vcpu *vcpu, ...@@ -706,7 +706,7 @@ static bool trap_dbgidr(struct kvm_vcpu *vcpu,
} }
static bool trap_debug32(struct kvm_vcpu *vcpu, static bool trap_debug32(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *r) const struct sys_reg_desc *r)
{ {
if (p->is_write) { if (p->is_write) {
...@@ -731,7 +731,7 @@ static bool trap_debug32(struct kvm_vcpu *vcpu, ...@@ -731,7 +731,7 @@ static bool trap_debug32(struct kvm_vcpu *vcpu,
*/ */
static inline bool trap_xvr(struct kvm_vcpu *vcpu, static inline bool trap_xvr(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *rd) const struct sys_reg_desc *rd)
{ {
u64 *dbg_reg = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg]; 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,7 +991,7 @@ int kvm_handle_cp14_load_store(struct kvm_vcpu *vcpu, struct kvm_run *run)
* Return 0 if the access has been handled, and -1 if not. * Return 0 if the access has been handled, and -1 if not.
*/ */
static int emulate_cp(struct kvm_vcpu *vcpu, static int emulate_cp(struct kvm_vcpu *vcpu,
const struct sys_reg_params *params, struct sys_reg_params *params,
const struct sys_reg_desc *table, const struct sys_reg_desc *table,
size_t num) size_t num)
{ {
...@@ -1175,7 +1175,7 @@ int kvm_handle_cp14_32(struct kvm_vcpu *vcpu, struct kvm_run *run) ...@@ -1175,7 +1175,7 @@ int kvm_handle_cp14_32(struct kvm_vcpu *vcpu, struct kvm_run *run)
} }
static int emulate_sys_reg(struct kvm_vcpu *vcpu, static int emulate_sys_reg(struct kvm_vcpu *vcpu,
const struct sys_reg_params *params) struct sys_reg_params *params)
{ {
size_t num; size_t num;
const struct sys_reg_desc *table, *r; const struct sys_reg_desc *table, *r;
......
...@@ -44,7 +44,7 @@ struct sys_reg_desc { ...@@ -44,7 +44,7 @@ struct sys_reg_desc {
/* Trapped access from guest, if non-NULL. */ /* Trapped access from guest, if non-NULL. */
bool (*access)(struct kvm_vcpu *, bool (*access)(struct kvm_vcpu *,
const struct sys_reg_params *, struct sys_reg_params *,
const struct sys_reg_desc *); const struct sys_reg_desc *);
/* Initialization for vcpu. */ /* Initialization for vcpu. */
...@@ -77,7 +77,7 @@ static inline bool ignore_write(struct kvm_vcpu *vcpu, ...@@ -77,7 +77,7 @@ static inline bool ignore_write(struct kvm_vcpu *vcpu,
} }
static inline bool read_zero(struct kvm_vcpu *vcpu, static inline bool read_zero(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p) struct sys_reg_params *p)
{ {
*vcpu_reg(vcpu, p->Rt) = 0; *vcpu_reg(vcpu, p->Rt) = 0;
return true; return true;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "sys_regs.h" #include "sys_regs.h"
static bool access_actlr(struct kvm_vcpu *vcpu, static bool access_actlr(struct kvm_vcpu *vcpu,
const struct sys_reg_params *p, struct sys_reg_params *p,
const struct sys_reg_desc *r) const struct sys_reg_desc *r)
{ {
if (p->is_write) if (p->is_write)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册