From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D5F2218593; Fri, 11 Jul 2025 08:53:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752224025; cv=none; b=e95rU2Kltb7bOFnoLtuKXsHwMkUUOX/E4CWpdtqUlUkqHkKHo2cO8cm6Jj90CQ/KqWemNE7zHtGGa1by2jIQg3whH4Jfw528bl10/2c9l0SmEscX5PfoDUWFPhmJMxJBE0rNkzlesURli0kMOit7BtGVocPdYmmkQ/QXVKMzaL4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752224025; c=relaxed/simple; bh=mQI53t4QPyDABHATdUC2IVmzwHPIX8ZlllLvLCz6H0M=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=NQNzpUTwx+OYvBOas4Ai++ToO3AzLkRh7MkM6NB1KncWL3Rrj+5rSvBL0IjwsYEXQkKKgq47neLSsmN9y8ALstrVDDBIiLNtf/jQKn4FoEu2d8RT43sbeJImXIdzgUf+rj99sb5LpNwk98YPZBpaPNZ9OzGmcnjR22r2OaS23j4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CfqHolZk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CfqHolZk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1515C4CEED; Fri, 11 Jul 2025 08:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752224024; bh=mQI53t4QPyDABHATdUC2IVmzwHPIX8ZlllLvLCz6H0M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CfqHolZkPXR+eVlblNsPmPOjAM9RltC64m0ZnuoOMrqj+lWKEXbaARAOxSZPbw5ns 5/g4+z5i4lFbgKFdUs/3Tb9ndkDOBvdnVVTl1FuAxiLMA1NpJ4qNHVgwfUFuBluSGC z8bIhaTB71FZLwgJv0F8gHt+eEiPYSVEfPdKGNVlgqJ3DhNwrZNlNiPAtft3vomFuQ ZtuSf1Hzne+NGq7ZDk0WSY82BTJZ/CZFJ/FFOf7ErKXTQWjfbUHhI1q1Ov/gDGju9b QTju/goVcwGqZAFpd262je5o8e0Cefxa9ispPSmXVSULlKAE1lhGCH25Fvv5k1cztH 92v2iF/HCj3xw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1ua9Vm-00EoED-Gl; Fri, 11 Jul 2025 09:53:42 +0100 Date: Fri, 11 Jul 2025 09:53:41 +0100 Message-ID: <86frf39kh6.wl-maz@kernel.org> From: Marc Zyngier To: "Arnd Bergmann" Cc: "Arnd Bergmann" , "Oliver Upton" , "Catalin Marinas" , "Will Deacon" , "Joey Gouly" , "Suzuki K Poulose" , "Zenghui Yu" , "Mark Brown" , "James Morse" , "Sebastian Ott" , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: arm64: fix u64_replace_bits() usage In-Reply-To: <4befb9eb-96e6-4a7c-9746-286144564f4e@app.fastmail.com> References: <20250711072752.2781647-1-arnd@kernel.org> <86h5zj9laj.wl-maz@kernel.org> <4befb9eb-96e6-4a7c-9746-286144564f4e@app.fastmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: arnd@arndb.de, arnd@kernel.org, oliver.upton@linux.dev, catalin.marinas@arm.com, will@kernel.org, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, broonie@kernel.org, james.morse@arm.com, sebott@redhat.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Fri, 11 Jul 2025 09:44:23 +0100, "Arnd Bergmann" wrote: > > On Fri, Jul 11, 2025, at 10:36, Marc Zyngier wrote: > > On Fri, 11 Jul 2025 08:27:47 +0100, Arnd Bergmann wrote: > >> if (hpmn > vcpu->kvm->arch.nr_pmu_counters) { > >> hpmn = vcpu->kvm->arch.nr_pmu_counters; > >> - u64_replace_bits(val, hpmn, MDCR_EL2_HPMN); > >> + val = u64_replace_bits(val, hpmn, MDCR_EL2_HPMN); > >> } > >> > >> __vcpu_assign_sys_reg(vcpu, MDCR_EL2, val); > > > > This is only in -next, right? Because I have a fix for this already > > queued for 6.16, as per [1]. > > Yes, as far as I can tell, the warning only showed up in linux-next > after f66f9c3d09c1 ("bitfield: Ensure the return values of helper > functions are checked"). > > As far as I can tell, Ben added the check in linux/bitfield.h > when he sent you his version of the fix, they just ended up > in linux-next in the wrong order, so I ended up recreating his > original fix slightly differently. I don't think Ben's fix is in -next, as I queued it in the kvmarm fixes branch, which isn't pulled by -next. Hopefully Paolo will send this to Linus shortly (pull request here[1]), and -next will be clean again. Thanks, M. [1] https://lore.kernel.org/r/20250711084835.2411230-1-maz@kernel.org -- Without deviation from the norm, progress is not possible.