Skip to content

Commit 187de7c

Browse files
brooniectmarinas
authored andcommitted
arm64/sysreg: Standardise naming of bitfield constants in OSL[AS]R_EL1
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. Reviewed-by: Shaoqin Huang <[email protected]> Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Oliver Upton <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 103b884 commit 187de7c

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

arch/arm64/include/asm/kvm_host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ void kvm_arm_clear_debug(struct kvm_vcpu *vcpu);
10311031
void kvm_arm_reset_debug_ptr(struct kvm_vcpu *vcpu);
10321032

10331033
#define kvm_vcpu_os_lock_enabled(vcpu) \
1034-
(!!(__vcpu_sys_reg(vcpu, OSLSR_EL1) & SYS_OSLSR_OSLK))
1034+
(!!(__vcpu_sys_reg(vcpu, OSLSR_EL1) & OSLSR_EL1_OSLK))
10351035

10361036
int kvm_arm_vcpu_arch_set_attr(struct kvm_vcpu *vcpu,
10371037
struct kvm_device_attr *attr);

arch/arm64/include/asm/sysreg.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@
144144
#define SYS_MDRAR_EL1 sys_reg(2, 0, 1, 0, 0)
145145

146146
#define SYS_OSLAR_EL1 sys_reg(2, 0, 1, 0, 4)
147-
#define SYS_OSLAR_OSLK BIT(0)
147+
#define OSLAR_EL1_OSLK BIT(0)
148148

149149
#define SYS_OSLSR_EL1 sys_reg(2, 0, 1, 1, 4)
150-
#define SYS_OSLSR_OSLM_MASK (BIT(3) | BIT(0))
151-
#define SYS_OSLSR_OSLM_NI 0
152-
#define SYS_OSLSR_OSLM_IMPLEMENTED BIT(3)
153-
#define SYS_OSLSR_OSLK BIT(1)
150+
#define OSLSR_EL1_OSLM_MASK (BIT(3) | BIT(0))
151+
#define OSLSR_EL1_OSLM_NI 0
152+
#define OSLSR_EL1_OSLM_IMPLEMENTED BIT(3)
153+
#define OSLSR_EL1_OSLK BIT(1)
154154

155155
#define SYS_OSDLR_EL1 sys_reg(2, 0, 1, 3, 4)
156156
#define SYS_DBGPRCR_EL1 sys_reg(2, 0, 1, 4, 4)

arch/arm64/kvm/sys_regs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,9 @@ static bool trap_oslar_el1(struct kvm_vcpu *vcpu,
388388
return read_from_write_only(vcpu, p, r);
389389

390390
/* Forward the OSLK bit to OSLSR */
391-
oslsr = __vcpu_sys_reg(vcpu, OSLSR_EL1) & ~SYS_OSLSR_OSLK;
392-
if (p->regval & SYS_OSLAR_OSLK)
393-
oslsr |= SYS_OSLSR_OSLK;
391+
oslsr = __vcpu_sys_reg(vcpu, OSLSR_EL1) & ~OSLSR_EL1_OSLK;
392+
if (p->regval & OSLAR_EL1_OSLK)
393+
oslsr |= OSLSR_EL1_OSLK;
394394

395395
__vcpu_sys_reg(vcpu, OSLSR_EL1) = oslsr;
396396
return true;
@@ -414,7 +414,7 @@ static int set_oslsr_el1(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd,
414414
* The only modifiable bit is the OSLK bit. Refuse the write if
415415
* userspace attempts to change any other bit in the register.
416416
*/
417-
if ((val ^ rd->val) & ~SYS_OSLSR_OSLK)
417+
if ((val ^ rd->val) & ~OSLSR_EL1_OSLK)
418418
return -EINVAL;
419419

420420
__vcpu_sys_reg(vcpu, rd->reg) = val;
@@ -1781,7 +1781,7 @@ static const struct sys_reg_desc sys_reg_descs[] = {
17811781
{ SYS_DESC(SYS_MDRAR_EL1), trap_raz_wi },
17821782
{ SYS_DESC(SYS_OSLAR_EL1), trap_oslar_el1 },
17831783
{ SYS_DESC(SYS_OSLSR_EL1), trap_oslsr_el1, reset_val, OSLSR_EL1,
1784-
SYS_OSLSR_OSLM_IMPLEMENTED, .set_user = set_oslsr_el1, },
1784+
OSLSR_EL1_OSLM_IMPLEMENTED, .set_user = set_oslsr_el1, },
17851785
{ SYS_DESC(SYS_OSDLR_EL1), trap_raz_wi },
17861786
{ SYS_DESC(SYS_DBGPRCR_EL1), trap_raz_wi },
17871787
{ SYS_DESC(SYS_DBGCLAIMSET_EL1), trap_raz_wi },

0 commit comments

Comments
 (0)