Skip to content

Commit 592efc6

Browse files
ouptonMarc Zyngier
authored andcommitted
KVM: arm64: Rename is_id_reg() to imply VM scope
The naming of some of the feature ID checks is ambiguous. Rephrase the is_id_reg() helper to make its purpose slightly clearer. Signed-off-by: Oliver Upton <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent fec50db commit 592efc6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

arch/arm64/kvm/sys_regs.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,9 +1570,10 @@ static u64 read_id_reg(const struct kvm_vcpu *vcpu, const struct sys_reg_desc *r
15701570

15711571
/*
15721572
* Return true if the register's (Op0, Op1, CRn, CRm, Op2) is
1573-
* (3, 0, 0, crm, op2), where 1<=crm<8, 0<=op2<8.
1573+
* (3, 0, 0, crm, op2), where 1<=crm<8, 0<=op2<8, which is the range of ID
1574+
* registers KVM maintains on a per-VM basis.
15741575
*/
1575-
static inline bool is_id_reg(u32 id)
1576+
static inline bool is_vm_ftr_id_reg(u32 id)
15761577
{
15771578
return (sys_reg_Op0(id) == 3 && sys_reg_Op1(id) == 0 &&
15781579
sys_reg_CRn(id) == 0 && sys_reg_CRm(id) >= 1 &&
@@ -3521,7 +3522,7 @@ static void kvm_reset_id_regs(struct kvm_vcpu *vcpu)
35213522
lockdep_assert_held(&kvm->arch.config_lock);
35223523

35233524
/* Initialize all idregs */
3524-
while (is_id_reg(id)) {
3525+
while (is_vm_ftr_id_reg(id)) {
35253526
IDREG(kvm, id) = idreg->reset(vcpu, idreg);
35263527

35273528
idreg++;
@@ -3547,7 +3548,7 @@ void kvm_reset_sys_regs(struct kvm_vcpu *vcpu)
35473548
for (i = 0; i < ARRAY_SIZE(sys_reg_descs); i++) {
35483549
const struct sys_reg_desc *r = &sys_reg_descs[i];
35493550

3550-
if (is_id_reg(reg_to_encoding(r)))
3551+
if (is_vm_ftr_id_reg(reg_to_encoding(r)))
35513552
continue;
35523553

35533554
if (r->reset)
@@ -4014,7 +4015,7 @@ int kvm_vm_ioctl_get_reg_writable_masks(struct kvm *kvm, struct reg_mask_range *
40144015
* compliant with a given revision of the architecture, but the
40154016
* RES0/RES1 definitions allow us to do that.
40164017
*/
4017-
if (is_id_reg(encoding)) {
4018+
if (is_vm_ftr_id_reg(encoding)) {
40184019
if (!reg->val ||
40194020
(is_aa32_id_reg(encoding) && !kvm_supports_32bit_el0()))
40204021
continue;

0 commit comments

Comments
 (0)