diff options
author | Oliver Upton <oliver.upton@linux.dev> | 2023-04-04 15:40:39 +0000 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2023-04-05 12:07:41 +0100 |
commit | de40bb8abb764f6866d82c4e2a43acdb22892cf4 (patch) | |
tree | 256e1df6ddf7d8ec385deff647f0af83172d4bac /arch/arm64/kvm/hypercalls.c | |
parent | e65733b5c59a1ea20324a03494364958bef3fc68 (diff) |
KVM: arm64: Add a helper to check if a VM has ran once
The test_bit(...) pattern is quite a lot of keystrokes. Replace
existing callsites with a helper.
No functional change intended.
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230404154050.2270077-3-oliver.upton@linux.dev
Diffstat (limited to 'arch/arm64/kvm/hypercalls.c')
-rw-r--r-- | arch/arm64/kvm/hypercalls.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/arm64/kvm/hypercalls.c b/arch/arm64/kvm/hypercalls.c index 5da884e11337..a09a526a7d7c 100644 --- a/arch/arm64/kvm/hypercalls.c +++ b/arch/arm64/kvm/hypercalls.c @@ -379,8 +379,7 @@ static int kvm_arm_set_fw_reg_bmap(struct kvm_vcpu *vcpu, u64 reg_id, u64 val) mutex_lock(&kvm->lock); - if (test_bit(KVM_ARCH_FLAG_HAS_RAN_ONCE, &kvm->arch.flags) && - val != *fw_reg_bmap) { + if (kvm_vm_has_ran_once(kvm) && val != *fw_reg_bmap) { ret = -EBUSY; goto out; } |