From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 793E335B63B for ; Fri, 24 Apr 2026 08:49:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777020562; cv=none; b=GICx2h36hQQkqJlBXUw4+pPOQI9zaITm81T1H90b+XemBQnHfhNs42zcFJj37vj/aWOC4Z+s08ahEUZKgxljO53ZFB486T7TGT/z1z4LnIsqJb56xhWeo9W5RygFoCYBVMz2XlPwz7L5C2lQM/h7//gWe5cu0sVA6jtg5Er7DPc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777020562; c=relaxed/simple; bh=D6qZfKldpwjM+c/fUFYWGD6EGtCzM/BfOJ+cjy+IZ9U=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=WvLw/hT7Do1ZkK940QAZLHjhLtY5yxNVcOtZuLGfvDp3q7aVAmUDKbh/Q8Z5OVPxwZ7QCF52laQvwZDrBGLuztEn+MUEqBrK7n9qMG1pv2Ku/9yl9XfQaUOpDmpiRFoqjWTmWD9bu5jInpB1vlCtIraLwl7ZEYMwVsMaSjz+ykM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--tabba.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=YXnrSPoP; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--tabba.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YXnrSPoP" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-4837bfcfe0dso82748775e9.1 for ; Fri, 24 Apr 2026 01:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1777020554; x=1777625354; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=YJY1gPOgAaLT6+Kz2+e0ENJlulAl4LJwepN5ROf8PcQ=; b=YXnrSPoPKRGPrk9eaW7X0kcgf3AV7396+JzQDyhNRuLKzQepkNyeHX0h6cwZTbwRs1 NpeGGjkvY2dR/sGv7u2T293sfQ+ioeCpooKm5H6TyDI0Rt/lvyRhMcqxBn2uivHW8/2f mQStaNQaNVdC7o7u+Vd83US1ufrgGwqZmMVuOtCL0zGbTm529TRSCb6ZJ62Yabqg6ift SiTKzYLzEp7VcSKrQiEAm6EcT7TIzJckesj8mqTOcOacfzt5ZFro+sh7pNBV54s5FCII EoOi8NrcHbhPNtzGbJHfcRneBErhZrKQn3p98jiAB2Tm5fmsvU8RiFLDVWozikg8M7nt iG9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777020554; x=1777625354; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YJY1gPOgAaLT6+Kz2+e0ENJlulAl4LJwepN5ROf8PcQ=; b=TuGPVmIvMHxZ1K+35Md1Z5YI3YF2QLLVEerU0XSxep/rqH1HZclsNOCmnMCyFKpQuh MNxX216OfrEp17Vp+oazT2cV8rM0gn31qnH89zO7iEbVVGFiYNg3EeGkwiaYYSP8mYHY f4GAAZCQnF6guf/2r5fDNhx8VO7s0fEyUX/JhweToModUdCFx2N442OZNL3sCrfO3rpm dCgvqibmidxCsSdwbvbMfnjXjza6ee+LlWQt7RTGUNDGw4DDdHRE6RMyjI9x6zYVsgrW ZrnLFm0FNJGd/hE0bNdSUsdR/UuGxidv02zVOaprhS9plM65mqrk5LDjX4l7352BqCRh TeKw== X-Forwarded-Encrypted: i=1; AFNElJ97FOXEJbU3/H9MnJT+8GzImeYZnFbVY+N8osQbAuh3yC1qvRQ7xDY9zpwf0cx9IC6V55dmSoLgN307bS0=@vger.kernel.org X-Gm-Message-State: AOJu0Yya4kZ7LnU6cpI4yRO5OhEter68CpjO7gYbewQ3HOKImH4s0e9y ox/W0uY1SJHOim0deIgImadXb6QWsofUpFvs0o3dNy3SVEEUlBmBIU5Ey+y9BODBePdEy7Cuyx1 UEg== X-Received: from wmpz12.prod.google.com ([2002:a05:600c:a0c:b0:488:ab5f:9e9e]) (user=tabba job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:19cf:b0:48a:66a8:9981 with SMTP id 5b1f17b1804b1-48a66a89b9dmr10997185e9.27.1777020553789; Fri, 24 Apr 2026 01:49:13 -0700 (PDT) Date: Fri, 24 Apr 2026 09:49:06 +0100 In-Reply-To: <20260424084908.370776-1-tabba@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260424084908.370776-1-tabba@google.com> X-Mailer: git-send-email 2.54.0.rc2.544.gc7ae2d5bb8-goog Message-ID: <20260424084908.370776-5-tabba@google.com> Subject: [PATCH 4/6] KVM: arm64: Fix kvm_vcpu_initialized() macro parameter From: Fuad Tabba To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: tabba@google.com, catalin.marinas@arm.com, will@kernel.org, maz@kernel.org, oupton@kernel.org, qperret@google.com, suzuki.poulose@arm.com, joey.gouly@arm.com, yuzenghui@huawei.com Content-Type: text/plain; charset="UTF-8" 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: e016333745c7 ("KVM: arm64: Only reset vCPU-scoped feature ID regs once") Signed-off-by: Fuad Tabba --- arch/arm64/include/asm/kvm_host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 851f6171751c..0e5dbc1c5879 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -1548,7 +1548,7 @@ static inline bool __vcpu_has_feature(const struct kvm_arch *ka, int feature) #define kvm_vcpu_has_feature(k, f) __vcpu_has_feature(&(k)->arch, (f)) #define vcpu_has_feature(v, f) __vcpu_has_feature(&(v)->kvm->arch, (f)) -#define kvm_vcpu_initialized(v) vcpu_get_flag(vcpu, VCPU_INITIALIZED) +#define kvm_vcpu_initialized(v) vcpu_get_flag(v, VCPU_INITIALIZED) int kvm_trng_call(struct kvm_vcpu *vcpu); #ifdef CONFIG_KVM -- 2.54.0.rc2.544.gc7ae2d5bb8-goog