The vGICv3 ICC_APRn sysreg uaccess should call the APR access common interface. Signed-off-by: wanghaibin <wanghaibin.wang@xxxxxxxxxx> --- arch/arm64/kvm/vgic-sys-reg-v3.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/arch/arm64/kvm/vgic-sys-reg-v3.c b/arch/arm64/kvm/vgic-sys-reg-v3.c index 6260b69..0f7fbcd 100644 --- a/arch/arm64/kvm/vgic-sys-reg-v3.c +++ b/arch/arm64/kvm/vgic-sys-reg-v3.c @@ -188,23 +188,6 @@ static bool access_gic_grpen1(struct kvm_vcpu *vcpu, struct sys_reg_params *p, return true; } -static void vgic_v3_access_apr_reg(struct kvm_vcpu *vcpu, - struct sys_reg_params *p, u8 apr, u8 idx) -{ - struct vgic_v3_cpu_if *vgicv3 = &vcpu->arch.vgic_cpu.vgic_v3; - uint32_t *ap_reg; - - if (apr) - ap_reg = &vgicv3->vgic_ap1r[idx]; - else - ap_reg = &vgicv3->vgic_ap0r[idx]; - - if (p->is_write) - *ap_reg = p->regval; - else - p->regval = *ap_reg; -} - static bool access_gic_aprn(struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r, u8 apr) { @@ -218,19 +201,21 @@ static bool access_gic_aprn(struct kvm_vcpu *vcpu, struct sys_reg_params *p, */ switch (vgic_v3_cpu->num_pri_bits) { case 7: - vgic_v3_access_apr_reg(vcpu, p, apr, idx); break; case 6: if (idx > 1) goto err; - vgic_v3_access_apr_reg(vcpu, p, apr, idx); break; default: if (idx > 0) goto err; - vgic_v3_access_apr_reg(vcpu, p, apr, idx); } + if (p->is_write) + vgic_set_apr(vcpu, apr, idx, p->regval); + else + p->regval = vgic_get_apr(vcpu, apr, idx); + return true; err: if (!p->is_write) -- 1.8.3.1 _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/mailman/listinfo/kvmarm