Skip to content

Commit 83b131a

Browse files
Fuad Tabbagregkh
authored andcommitted
KVM: arm64: Fix kvm_vcpu_initialized() macro parameter
commit d89fdda upstream. The macro is defined with parameter 'v' but the body references the literal token 'vcpu' instead, causing it to silently operate on whatever 'vcpu' resolves to in the caller's scope rather than the value passed by the caller. All current call sites happen to use a variable named 'vcpu', so the bug is latent. Fixes: e016333 ("KVM: arm64: Only reset vCPU-scoped feature ID regs once") Signed-off-by: Fuad Tabba <tabba@google.com> Link: https://patch.msgid.link/20260424084908.370776-5-tabba@google.com Signed-off-by: Marc Zyngier <maz@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7baa02b commit 83b131a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/arm64/include/asm/kvm_host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ static inline bool __vcpu_has_feature(const struct kvm_arch *ka, int feature)
14761476
#define kvm_vcpu_has_feature(k, f) __vcpu_has_feature(&(k)->arch, (f))
14771477
#define vcpu_has_feature(v, f) __vcpu_has_feature(&(v)->kvm->arch, (f))
14781478

1479-
#define kvm_vcpu_initialized(v) vcpu_get_flag(vcpu, VCPU_INITIALIZED)
1479+
#define kvm_vcpu_initialized(v) vcpu_get_flag(v, VCPU_INITIALIZED)
14801480

14811481
int kvm_trng_call(struct kvm_vcpu *vcpu);
14821482
#ifdef CONFIG_KVM

0 commit comments

Comments
 (0)