Messages in this thread | | | Date | Tue, 23 May 2023 19:52:45 +0800 | Subject | Re: [PATCH 4/5] arm64/sysreg: Standardise naming of bitfield constants in OSL[AS]R_EL1 | From | Shaoqin Huang <> |
| |
On 5/23/23 00:22, Mark Brown wrote: > Our standard scheme for naming the constants for bitfields in system > registers includes _ELx in the name but not the SYS_, update the > constants for OSL[AS]R_EL1 to follow this convention. > > Signed-off-by: Mark Brown <broonie@kernel.org> Reviewed-by: Shaoqin Huang <shahuang@redhat.com> > --- > arch/arm64/include/asm/kvm_host.h | 2 +- > arch/arm64/include/asm/sysreg.h | 10 +++++----- > arch/arm64/kvm/sys_regs.c | 10 +++++----- > 3 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index bcd774d74f34..cde4ad590f8c 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -996,7 +996,7 @@ void kvm_arm_clear_debug(struct kvm_vcpu *vcpu); > void kvm_arm_reset_debug_ptr(struct kvm_vcpu *vcpu); > > #define kvm_vcpu_os_lock_enabled(vcpu) \ > - (!!(__vcpu_sys_reg(vcpu, OSLSR_EL1) & SYS_OSLSR_OSLK)) > + (!!(__vcpu_sys_reg(vcpu, OSLSR_EL1) & OSLSR_EL1_OSLK)) > > int kvm_arm_vcpu_arch_set_attr(struct kvm_vcpu *vcpu, > struct kvm_device_attr *attr); > diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h > index 4ecae92b56b5..09de958e79ed 100644 > --- a/arch/arm64/include/asm/sysreg.h > +++ b/arch/arm64/include/asm/sysreg.h > @@ -141,13 +141,13 @@ > #define SYS_MDRAR_EL1 sys_reg(2, 0, 1, 0, 0) > > #define SYS_OSLAR_EL1 sys_reg(2, 0, 1, 0, 4) > -#define SYS_OSLAR_OSLK BIT(0) > +#define OSLAR_EL1_OSLK BIT(0) > > #define SYS_OSLSR_EL1 sys_reg(2, 0, 1, 1, 4) > -#define SYS_OSLSR_OSLM_MASK (BIT(3) | BIT(0)) > -#define SYS_OSLSR_OSLM_NI 0 > -#define SYS_OSLSR_OSLM_IMPLEMENTED BIT(3) > -#define SYS_OSLSR_OSLK BIT(1) > +#define OSLSR_EL1_OSLM_MASK (BIT(3) | BIT(0)) > +#define OSLSR_EL1_OSLM_NI 0 > +#define OSLSR_EL1_OSLM_IMPLEMENTED BIT(3) > +#define OSLSR_EL1_OSLK BIT(1) > > #define SYS_OSDLR_EL1 sys_reg(2, 0, 1, 3, 4) > #define SYS_DBGPRCR_EL1 sys_reg(2, 0, 1, 4, 4) > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > index 53749d3a0996..8a5160a90d3c 100644 > --- a/arch/arm64/kvm/sys_regs.c > +++ b/arch/arm64/kvm/sys_regs.c > @@ -388,9 +388,9 @@ static bool trap_oslar_el1(struct kvm_vcpu *vcpu, > return read_from_write_only(vcpu, p, r); > > /* Forward the OSLK bit to OSLSR */ > - oslsr = __vcpu_sys_reg(vcpu, OSLSR_EL1) & ~SYS_OSLSR_OSLK; > - if (p->regval & SYS_OSLAR_OSLK) > - oslsr |= SYS_OSLSR_OSLK; > + oslsr = __vcpu_sys_reg(vcpu, OSLSR_EL1) & ~OSLSR_EL1_OSLK; > + if (p->regval & OSLAR_EL1_OSLK) > + oslsr |= OSLSR_EL1_OSLK; > > __vcpu_sys_reg(vcpu, OSLSR_EL1) = oslsr; > return true; > @@ -414,7 +414,7 @@ static int set_oslsr_el1(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, > * The only modifiable bit is the OSLK bit. Refuse the write if > * userspace attempts to change any other bit in the register. > */ > - if ((val ^ rd->val) & ~SYS_OSLSR_OSLK) > + if ((val ^ rd->val) & ~OSLSR_EL1_OSLK) > return -EINVAL; > > __vcpu_sys_reg(vcpu, rd->reg) = val; > @@ -1760,7 +1760,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { > { SYS_DESC(SYS_MDRAR_EL1), trap_raz_wi }, > { SYS_DESC(SYS_OSLAR_EL1), trap_oslar_el1 }, > { SYS_DESC(SYS_OSLSR_EL1), trap_oslsr_el1, reset_val, OSLSR_EL1, > - SYS_OSLSR_OSLM_IMPLEMENTED, .set_user = set_oslsr_el1, }, > + OSLSR_EL1_OSLM_IMPLEMENTED, .set_user = set_oslsr_el1, }, > { SYS_DESC(SYS_OSDLR_EL1), trap_raz_wi }, > { SYS_DESC(SYS_DBGPRCR_EL1), trap_raz_wi }, > { SYS_DESC(SYS_DBGCLAIMSET_EL1), trap_raz_wi }, >
-- Shaoqin
| |