From nobody Thu Apr 9 19:17:44 2026 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) (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 C2DFC3EB81E for ; Tue, 3 Mar 2026 19:03:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772564626; cv=none; b=Y59cmpLdETTJI4Wyhr2QK7Lpm4Inbm89+ENOC0Yf8TY5mZZ0z9wV/9H2f1VNIzHg3Z9pU8qsRGwTK9Fz+g7LSP81ZiyIUW6HuxrFCklhDqcwLJoEVXB2T/srnl+igm12O/uuG+UzraxY3/eYKiAtVrYwli5J0+t5FqOaIZQvvA0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772564626; c=relaxed/simple; bh=u7/13Qa3F2z+DYiu+VjB8O1ezedwn/ik7S2XPnbA6UQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=eJYHlLx3lwF2zvSpxRrwyvbB3F/g/VQeNZjGHKzDEZZRhrFr9v+5OAmV87CDdvyPeUDXs2jUo2bhHRbbPI8dA8bamVIDumQ2fHnT/taLRBApOESJkWn6s+SF1wReaqDOnIRrhds3t+0qzEheuf2sykuWtRp24Uq9nbU8oEKwKeA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=b42AJugh; arc=none smtp.client-ip=209.85.214.201 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--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="b42AJugh" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-2ae4f27033cso24593305ad.3 for ; Tue, 03 Mar 2026 11:03:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1772564624; x=1773169424; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=yz3MkihpO/3OgXiBEUXwzX0zyHyXB+v43DwfQqlp7z0=; b=b42AJughBKEH5TfXni8ocol6gvLPQvtAgGd34hmwo3BD54brWnVck2y80n2o3Eorf5 PLKQEF3WL7NajAbLvbHjPRJAvb2azW3Pc5auPEt3YCh01wyrh5pJvTNgV2/nzjDMkhvv MJF1Mf+eYbm0NaBrSIzMhidTkhBz5pjdYVpz8wm+F27a5pYKcu554VpLvqAPXNgFtiqU d2fTrCiLumXOmFhNqjC9Ng7+dP/nhI53T6D9gnwvg6ZexN5yN6N1NuOXe9h+OnO6Hxgb ZNPj5VOutSI2jB9aJblLImdjM6rCq7UlGyDc4LY+eshel0JcEaNKSU/0Z/2nFym+8t/o 9ucw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772564624; x=1773169424; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yz3MkihpO/3OgXiBEUXwzX0zyHyXB+v43DwfQqlp7z0=; b=q1wSej1jQAvZJzcRNbrbDmLdOrSuR1UzBPavlw9cvNUTPlCwTyEWfoozRhX/8nQVp7 Q/Z+mkuWyULtyPHgTcPDIVBdKyk4FyP/EZIQN/yLj+Nxftd7mWA8XGEv+ggohnTCVrOv NKcTa2Jnh6eAJDSnCO7vNL8Q98p+Af5WS6z4IpjYALY90Ebpn8iBhg2W0hbp68iggsVQ NcXNipQgy8a1lnt0VamzmqVcx21bA1fVudW4QruBzTU8oFsQTA+B+PZLQ1bp4Y6Km+SF 3XqifrqJzoFSr17J5NvLAeoiQq3CPjLtOpGWvAYdmOsMJZBz2dD9DJyQ68dUOdy4QIb6 wUcA== X-Forwarded-Encrypted: i=1; AJvYcCUsprN7L1PkPDUsdlQSh6e8lTmWSYXEijWqTiS4nE4W0rJUjOPVRypFtYCET8i5nHf1DvIV48lnxNp7Ryk=@vger.kernel.org X-Gm-Message-State: AOJu0YzUrj0mD/phwvAf8PsunnGHV+Z/CxjKALPYq7be26548IdO+g8u hRlHTIawEBY3wfWbMAuGomx97csweXqQ4hfIZ64PqRlis/0ugLP0m62hLcRoOMxroElyu63hJqi +6iSx4g== X-Received: from plcm18.prod.google.com ([2002:a17:902:f212:b0:2ae:5419:3a0a]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:1aad:b0:2a9:47d0:12cb with SMTP id d9443c01a7336-2ae2e401dabmr174603315ad.22.1772564624033; Tue, 03 Mar 2026 11:03:44 -0800 (PST) Reply-To: Sean Christopherson Date: Tue, 3 Mar 2026 11:03:38 -0800 In-Reply-To: <20260303190339.974325-1-seanjc@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260303190339.974325-1-seanjc@google.com> X-Mailer: git-send-email 2.53.0.473.g4a7958ca14-goog Message-ID: <20260303190339.974325-2-seanjc@google.com> Subject: [PATCH 1/2] KVM: PPC: e500: Fix build error due to using kmalloc_obj() with wrong type From: Sean Christopherson To: Madhavan Srinivasan Cc: linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Sean Christopherson Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Fix a build error in kvmppc_e500_tlb_init() that was introduced by the conversion to use kzalloc_objs(), as KVM confusingly uses the size of the structure that is one and only field in tlbe_priv: arch/powerpc/kvm/e500_mmu.c:923:33: error: assignment to 'struct tlbe_pri= v *' from incompatible pointer type 'struct tlbe_ref *' [-Wincompatible-poin= ter-types] 923 | vcpu_e500->gtlb_priv[0] =3D kzalloc_objs(struct tlbe_ref, | ^ KVM has been flawed since commit 0164c0f0c404 ("KVM: PPC: e500: clear up confusion between host and guest entries"), but the issue went unnoticed until kmalloc_obj() came along and enforced types, as "struct tlbe_priv" was just a wrapper of "struct tlbe_ref" (why on earth the two ever existed separately...). Fixes: 69050f8d6d07 ("treewide: Replace kmalloc with kmalloc_obj for non-sc= alar types") Cc: Kees Cook Signed-off-by: Sean Christopherson Reviewed-by: Christophe Leroy (CS GROUP) --- arch/powerpc/kvm/e500_mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/e500_mmu.c b/arch/powerpc/kvm/e500_mmu.c index 48580c85f23b..75ed1496ead5 100644 --- a/arch/powerpc/kvm/e500_mmu.c +++ b/arch/powerpc/kvm/e500_mmu.c @@ -920,12 +920,12 @@ int kvmppc_e500_tlb_init(struct kvmppc_vcpu_e500 *vcp= u_e500) vcpu_e500->gtlb_offset[0] =3D 0; vcpu_e500->gtlb_offset[1] =3D KVM_E500_TLB0_SIZE; =20 - vcpu_e500->gtlb_priv[0] =3D kzalloc_objs(struct tlbe_ref, + vcpu_e500->gtlb_priv[0] =3D kzalloc_objs(struct tlbe_priv, vcpu_e500->gtlb_params[0].entries); if (!vcpu_e500->gtlb_priv[0]) goto free_vcpu; =20 - vcpu_e500->gtlb_priv[1] =3D kzalloc_objs(struct tlbe_ref, + vcpu_e500->gtlb_priv[1] =3D kzalloc_objs(struct tlbe_priv, vcpu_e500->gtlb_params[1].entries); if (!vcpu_e500->gtlb_priv[1]) goto free_vcpu; --=20 2.53.0.473.g4a7958ca14-goog